Hi,
thank you all for your hints.
I wrote the image directly to the background buffer
and then cleared the depth buffer. All works fine now.
Best regards,
Torsten.
static void gl_draw(void) {
glViewport(0, 0, xwidth, yheight);
glClearColor(0.0f, 0.0f, 0.0f, 0.0f);
glClearDepth(1.0);
glDepthFunc(GL_LESS);
glEnable(GL_DEPTH_TEST);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glShadeModel(GL_FLAT);
glDisable(GL_LIGHTING);
glDisable(GL_LIGHT0);
glCullFace(GL_FRONT|GL_BACK);
glDisable(GL_BLEND);
glDisable(GL_ALPHA);
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glMatrixMode(GL_MODELVIEW);
glRasterPos2f(-1.0, -1.0);
glDrawPixels(xwidth, yheight, GL_RGB, GL_UNSIGNED_BYTE, as->pixels);
glClear(GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(45.0f, (GLfloat)xwidth/(GLfloat)yheight, 0.1f,100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(cam_x, cam_y, cam_z,
0.0, 0.0, 0.0,
0.0, 0.0, 1.0);
draw_axes();
SDL_GL_SwapBuffers();
}> Hi,
i load an image that has exactly the size of my SDL window.
I’d like to set this picture as the background picture and
draw some OpenGL in front of it.
Can anybody tell me how to do that in SDL?
Or is this a complete OpenGL issue (then i’ll ask somewhere
else)?
Thanks for any hints,
Torsten.
SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl