Archived

This topic is now archived and is closed to further replies.

GL_QUADS and a shiny black screen

This topic is 5965 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi people, I''m using OpenGL ortho mode and wanna display a simple quad with a color and an alpha value. So far so good, but everything I get is a black screen. The code seems right to me....could anybode please help!?? void cSprite:lane(RECT dim,float r,float g,float b,float alpha) { glLoadIdentity(); glTranslatef((float)dim.left,(float)dim.top,0.0f); glColor4f(r,g,b,alpha); glBegin(GL_QUADS); glVertex2d(0,dim.bottom); // top left glVertex2d(0,0); // bottom left glVertex2d(dim.right,0); // top right glVertex2d(dim.right,dim.bottom); // bottom right glEnd(); } I''m calling the function with these params: rc.left=0; rc.top=0; rc.right=640; rc.bottom=480; Sprite->Plane(rc,1.0f,1.0f,1.0f,0.0f); thanks! Bye, Alex

Share this post


Link to post
Share on other sites
glClearColor(1,0,0,1);
if u see a pure red screen then the object cant be seen
perhaps the cameras pointing the wrong way or the backface is facing the camera etc.
if u do see a black square perhaps u have lighting enabled

Share this post


Link to post
Share on other sites