#163176 - sverx - Wed Sep 24, 2008 3:30 pm
In this post, Sausage Boy wrote: |
The textured_quad example in devkitPro should be a great starting point. Or, optionally, this, which is the same example, but with a paletted texture. You'll want to get rid of GL_TEXTURE_COLOR0_TRANSPARENT if you decide to use that though. |
I made a search on that forum and I found NeHe's tutorial: I'm reading it because I really don't even know what OpenGL is! I'm reading lesson 1 and -even if the tutorial seems well written- I guess it's too soon to say I understand what I'm reading...
Yes, I noticed the textured_quad example: I gave a look to it but it was before, so I really didn't understand any of the few lines of code. :|
Anyway I'll also give a look to your link -later-, thanks :)
Sausage Boy wrote: | ||
Now, you need to set 3D up so one pixel on the texture maps exactly to one pixel on the screen. This is done through orthographic projection. Replace glViewport with something like this
This means the screen will go from 0 to 256 horizontally in 3D space, and 0-192 vertically (obviously). |
That's good, in fact I need to 'drive' pixels on the screen changing texels (right?) on the texture so that they corresponds.
Sausage Boy wrote: |
It also sets the near clipping plane to -1, and the far clipping plane to 1. Anything in between will get drawn. Orthographic projection means we don't care about how far away something is from the camera, everything is drawn at the same size. |
So it's ok if my quad has the 4 corners all with Z=0, right?
Sausage Boy wrote: |
All you need to do now is put a quad with your texture in there, and update it every frame. |
Right. Well, I've got to decide if it's better to use one big texture (256x256) or some smaller textures to save some memory... it shouldn't be hard to show some 12 (4x3) textures each 64x64, right?
Sausage Boy wrote: |
The greatest reference for all this is GBATEK. It might look complicated at first, but it really pays off when you get used to it. |
Thanks, it's one of my preferred, but it isn't good for a topic where I'm a complete beginner ;)
Thanks :)