OpenGL + SDL
JTippets answered a similar question here. Just because you need something 'pixel perfect' does not mean you cannot involve textures.
If you want pixel perfect rendering, just remember that when polygons rasterize they rasterize to the center of the pixel. If you wanted to draw a line from 0 to 5 inclusive, you draw from 0.5 to 5.5.
Try setting up your ortho projection matrix and then translate it <0.5, 0.5, 0.0> to center your pixels.
Try setting up your ortho projection matrix and then translate it <0.5, 0.5, 0.0> to center your pixels.
Hmmm, very interesting. I thought 3D cards do not provide such capability and the exact accuracy depends on the card used. If textures can be used then indeed it's very nice performance wise.
JTippets answered a similar question here. Just because you need something 'pixel perfect' does not mean you cannot involve textures.
OK, so now it's mostly convenience question. Is there a way to use BOTH OpenGL (for 3D) and SDL_Blit (for primitive 2D overlay), so I don't need to rewrite my already existing SDL code?
Also, I would like to understand how exactly opening screen/context/canvas works? A screen is a screen, it should be a buffer on GFX card VRAM which should be usable the same way by all APIs. What exactly happens when I define the screen as "SDL_OPENGL" and why can't I use normal SDL Blits then?
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement