Jump to content
  • Advertisement

Archived

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

notatric

GL_QUADS and a shiny black screen

This topic is 6182 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
Advertisement
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
Hi,

I set the background to red but I''m getting a black one -> the quad is drawn but don''t uses the color....

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!