Hello,
i’m not sure if i expressed it correct: “simple and modern rendering”. I have a rendering-thread, rendering 3d-objects with the same light and projection- /view-matrices. Now i want to draw a simple cube-map as background. So i need no shaders, no light and not even depth-buffer - only nine textured quads, that are rotated like the view and that i draw before everything else.
So, for the beginning i used glBegin()…glEnd() for drawing (which i also still use to draw my frame-buffers to the screen). Unfortunately i get no restult. So my objects are still rendered, but the background stays black.
The code i currently use (with a lot of lined added in order of this problem) is this:
void DrawCubeMap () {
CheckGL("Errors left in cue");
//glColor3f(1,1,1);
glDisable (GL_LIGHTING);
glEnable (GL_TEXTURE_2D);
glActiveTexture (GL_TEXTURE1);
glBindTexture (GL_TEXTURE_2D, 2);
glUnmapBuffer (GL_ARRAY_BUFFER);
glBindBuffer (GL_ARRAY_BUFFER, 0); //Print("4");
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri (GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glDisable (GL_CULL_FACE);
glDisable (GL_COLOR_MATERIAL);
glTexEnvf (GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glViewport (0, 0, 1280, 800);
glUseProgram(0);
glDisable (GL_DEPTH_TEST);
// gluPerspective(90,1,1,100);
CheckGL("Before draw cube");
glBegin (GL_QUADS);
glNormal3f( 0.0f, 0.0f, 0.5f);
glTexCoord2f(0.253, 0.002); glVertex3f (-50, 50, -50);
glTexCoord2f(0.497, 0.002); glVertex3f ( 50, 50, -50);
[...]
glTexCoord2f(0.497, 0.997); glVertex3f ( 50, 50, 50);
glTexCoord2f(0.253, 0.997); glVertex3f (-50, 50, 50);
glEnd ();
glFlush();
CheckGL("After draw cube");
glEnable (GL_DEPTH_TEST);
}
For me this looks okay, but maybe i’m blind and a fresh view from outside helps…
Thank you,
Frank