I have several questions in regards to this code and code that uses these objects:
Code: Select all
const Tex3DS_SubTexture subtex = {
512, 256,
0.0f, 1.0f, 1.0f, 0.0f
};
C3D_Tex tex;
C3D_TexInitVRAM(&tex, 512, 256, GPU_RGBA8);
C3D_RenderTarget* target = C3D_RenderTargetCreateFromTex(&tex, GPU_TEXFACE_2D, 0, -1);
C2D_Image img = {&tex, &subtex};
So my questions are:
- Looking at the source code for "Tex3DS_SubTexture" makes it seem like it's just a struct that describes a region, is this correct?
- Initializing vram produces a texture, but this texture is... what, unusable in the current state, or not easily usable through the 2D library? Is that why we have to create a render target?
- What's the purpose of then creating an 'image' from the texture (but not the target) using the subtexture info? Looking at the code in the linked post, it looks to me like the render target is what I can write into, and the image is a different kind of "view" into the texture which can be used to draw the texture to the screen.
- I know resources are limited on the 3ds, but I was wondering if there are either practical or hard limits on contiguous textures? I noticed the fields for Tex3DS_SubTexture for width/height are 16 bit unsigned. If I'm not going to be putting basically ANYTHING else into vram (save for perhaps some smaller buffers), would it be possible for me to create a contiguous texture region that's, say, 320px wide by 4000px tall (RGBA8)?
- If the previous is possible, will it be completely inefficient to draw just a screen-sized region of this big texture onto the lower screen, or does the size of the texture not matter too much because I can specify a small region? Imagine the screen is a vertical sliding window on the 320x4000 texture.