Hi,
if i remember correctly, blitting directly on a screen
that has SDL_OPENGL set was not possible.
I wanted to do that for an overlay help screen, but then
chose to generate a texture and draw that one with
OpenGL functionality (GL_QUAD).
After doing the 3D stuff i used this code to draw the
overlay:
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glDisable(GL_DEPTH_TEST);
glViewport(0, 0, xwidth, yheight);
gluOrtho2D(0, xwidth, 0, yheight);
glEnable(GL_TEXTURE_2D);
glEnable(GL_BLEND);
glEnable(GL_ALPHA);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor3f(1.0, 1.0, 1.0);
glBindTexture(GL_TEXTURE_2D, texbase);
glBegin(GL_QUADS);
glTexCoord2d(0, 0);
glVertex2d(0, 0);
glTexCoord2d(1, 0);
glVertex2d(tn, 0);
glTexCoord2d(1, 1);
glVertex2d(tn, tn);
glTexCoord2d(0, 1);
glVertex2d(0, tn);
glEnd();
Hope that’s whatr you wanted.
Regards,
Torsten.> Hi!
Is it safe to rely on SDL_BlitSurface() for blitting onto OpenGL surfaces?
Are there any restrictions, particularly regaring the blitting of surfaces
with an alpha channel?
Or should I go the OpenGL way instead and load everything into a texture
first?
Regards,
Gregor
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl