If this means that you’re not allowed to use any 3D graphics hardware, then OpenGL is not going to be helpful to you.
If it means that you’re not rendering in perspective 3D, then OpenGL can draw orthographics 3D just fine. And if you only use 1 z-value, it’s no different from 2D.
by purely 2D i just mean without any appearance of 3D. using modern graphics hardware is fine.
effectively i just want to set pixels in the frame buffer as fast as possible. how i do that is an open question.
the obvious approach is to draw the pixels to a texture each frame and render that on a screen-aligned quad, but i’m wondering if there’s a faster way if i want one texel to be exactly one pixel.
(i’ll probably go with the texture route anyhow since it can be wrapped on geometry, but i thought openGL might let you just write straight to the frameBuffer)
The best way to do 2D through OpenGL is to do it all through OpenGL. I don’t mean just displaying a finished image. I mean generating that image in OpenGL.
If you’re just wanting to display some image you loaded off of disk, that’s fine. But if you’re doing some 2D rendering (sprite graphics, line drawing, whatever), you should be using OpenGL to do that rendering.
I’m a bit aesthetically underwhelmed by some of the demos there, but maybe it’s because i haven’t compiled most them yet.
I might be able to use GPUs to do the actual math via texture look-ups and such, but for starters i’m just going to do the crunch in CPU and dump it to a texture (or the frame buffer, if SDL allows that)
Doing a 2d-look is very simple in OpenGL - you just fix your camera above the scene and do your lighting with several tiled textures. I tried it out some time ago - great quality, very simple and lighting fast! As said above, it will limit your target audiency thought…
BTW, already baldurs gate 2 was rendered using OpenGL for images! They rendered textured squads to represent the world and the characters.