   Blank Screen (strange....)
  Ok, I started to learn Java a while ago (don't worry this topic does concern c++ and opengl) and for my IDE I used eclipse. Now, I love eclipse, others may not. But the point is I went online downloaded all the libs, includes, and the c++ eclipse version to get up and running for openGL. Well, I created a simple test run app to make sure everything was working and linked. The screen shows up and everything, no runtime or compile errors, yet, the screen is blank when there should be a quad there. Now, I haven't programmed in c++ or openGL for a while because I was messing around with Java for school so I'm thinking there is probably some line of code I'm missing or is in the wrong place. If you could please look at the code below and help me out. ThankS!!!!#include <windows.h>#include <GL/gl.h>#include <GL/glu.h>#include <GL/glut.h>#include <iostream>using namespace std;void draw(){    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // This clear the background colorglLoadIdentity(); // Initialize the model matrix as identity    glBegin( GL_QUADS );//glColor3f(255.0, 0.0, 0.0);glVertex3f(-1.0, -1.0, 0.0);glVertex3f(1.0, -1.0, 0.0);glVertex3f(1.0, 1.0, 0.0);glVertex3f(-1.0, 1.0, 0.0);glEnd();glutSwapBuffers();glutPostRedisplay();}void reshape(int width, int height){glMatrixMode(GL_PROJECTION);glLoadIdentity();  gluPerspective(45.0f, width/height , 10.0f, 10000.0f); // We define the "viewing volume"glMatrixMode(GL_MODELVIEW);glLoadIdentity();glutPostRedisplay ();}void init(){   glClearColor(0.0, 0.0, 0.0, 0.0); // This clear the background color to black    glClearDepth(0.0);    glShadeModel(GL_SMOOTH); // Type of shading for the polygons  // Viewport transformation    glViewport(0,0, 640, 480 );    glEnable(GL_DEPTH_TEST); // We enable the depth test (also called z buffer)    glPolygonMode (GL_FRONT_AND_BACK, GL_FILL); // Polygon rasterization modeglEnable(GL_TEXTURE_2D); // This Enable the Texture mapping}void keyBoardIO(unsigned char key, int x, int y){switch(key){case 27:// ESC keyexit(1);default:break;}// end swtich}// end functionint main(int argc, char **argv){glutInit(&argc, argv);glutInitWindowSize(640, 480);glutInitWindowPosition(300, 300);glutInitDisplayMode(GLUT_RGBA | GLUT_DOUBLE | GLUT_DEPTH );glutCreateWindow("OpenGL Project");init();glutReshapeFunc(reshape);glutDisplayFunc(draw);glutKeyboardFunc( keyBoardIO );glutMainLoop();return 0;}
  I'll admit I didn't fully read through all of your code, but it would seem that your quad is simply being clipped since you are loading the identity matrix and then drawing the quad on the same Z-plane as the camera. Try moving it back a little (draw the quad with a z value of -1 or something) and it should work.   ;  No, I know about the clipping problem because I had it at -10 at first. Yet, that didn't work either so I just tried 0 to see what happened. Thanks for at least reading some of my code though.   ;  hey ^^,remove glEnable(GL_TEXTURE_2D); // This Enable the Texture mappingcause u don't use texture .and try to move ur quad to depth > 0take care.   ;  well, the glEnable(GL_TEXTURE_2D) I added because when I was writing it I was planning on adding textures in but as you can see I didn't get that far. I just left it in there b/c I thought it wouldn't affect my dilemma. As for changing the z position of the quad, already tried it. Still no results.Thanks though for trying to help!   ;  Debugging 101: Are you certain your function is even being executed?(and "I think it is" isn't a good answer, get it to print to the console or stick a break point in to catch it with the debugger to make sure).   ;  think this is the problem:glClearDepth(0.0);set it to 1.0 and then it should work ;]also try to push your quad ahead so that it fits in the view volumethis gluPerspective(45.0f, width/height, 10.0f, 10000.0f);may cause bitter z-fighting effect(unless you're using 24bit depth), why don't you set the far clipping plane somewhere closer?hope this will helpregards   ;omg O_o;; did u even try what i said in my last post ???or you just post blanky to ppl ?cause i compile it and tried it so do what i said b4 .remove glEnable(GL_TEXTURE); and move ur quad !or than that plz stop asking ppl if u don't want to follow advices!take care.   ;  Nah, the problem is thisglClearDepth(0.0);which should beglClearDepth(1.0);and thisgluPerspective(45.0f, width/height, 10.0f, 10000.0f);could begluPerspective(45.0f, width/height, 0.1f, 1000.0f);and translate back the quad or put some negative z values inglVertex3f(-1.0, -1.0, -1.0);You might want to shove a glViewport call in void reshape(int width, int height)The entire code is rather poor. I suggest you use some of Red Books examples or some online example to learn.   