Hey all, I tried searching but I couldn't find an answer to my problem. I am trying to convert an OpenGL program to GX. I'm close, I can feel it.
What it's supposed to do: The program renders the 3D scene, then copies the buffer (which in GX would be the embeded frame buffer) to a big array (which I'll call the texture buffer). This array is then combined with the 2D array that was already rendered in another location of the program. The combined buffer is then applied as a texture and displayed on a quad. This quad is smaller than the whole screen.
The OpenGL function that copies to the array is given as:
glReadPixels(0, 0, 256,224, GL_BGRA, GL_UNSIGNED_BYTE, renderScreen3D);
I am really unsure as to how to go about doing this. I have tried several times to no avail. The copy function (that doesn't work) that I came up with was:
static u8 renderScreen3D[256*224*4]; // This is 32-bit aligned
//...
// In the copy function:
GX_SetTexCopySrc(0, 0, 256, 224);
GX_SetTexCopyDst(256, 224, GX_TF_RGB8, GX_FALSE);
GX_CopyTex((renderScreen3D), GX_TRUE);
What am I missing?
Also, since this is smaller than the whole screen, is it possible to "limit" my rendering to a smaller "screen" so to speak? Since I have to copy to a smaller "screen" anyway. Would that help preserve precious GPU clock ticks?
Thanks!