Jump to content
  • Advertisement
Sign in to follow this  
ms75214

black screen of death

This topic is 2842 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

when doing opengl dev, i often get what i call the black screen of death. this is where your drawing code is executing but nothing shows up but a black screen.

anyone else get this a lot? i'm trying to find a better way to handle this.

i'm also trying to think of possible causes:

backface culling is throwing your stuff away
lighting is making your stuff dark
gluperspective isn't right
your model or projection matrices are off

is there a methodical way of fixing this?

Share this post


Link to post
Share on other sites
Advertisement

Are you asking about some kind of a general problem or a specific one? I imagine there is plenty that can go wrong.


well, i was having a specific one.

here was my drawing code:


void drawboard(Board &B)
{
//glClearColor (0.0f, 0.0f, .0f, 0.0f);
//glClear (GL_COLOR_BUFFER_BIT);

glLoadIdentity();
//gluPerspective(60.0f, 800.0/560.0, 0.1f, 100.0f);

// we don't need depth buffer stuff since we have backface culling
//glDisable(GL_DEPTH_TEST);
//glDepthMask(GL_FALSE);
//glEnable(GL_CULL_FACE);

...


after commenting out the gluPerspective(60.0f, 800.0/560.0, 0.1f, 100.0f); call it worked.

i think maybe gluPerspective was messing with the modelview matrix instead of the perspective matrix.

Share this post


Link to post
Share on other sites

// we don't need depth buffer stuff since we have backface culling
That's an odd comment.
Backface culling doesn't remove the need for a depth buffer. Drawing things in painters order AND having non-overlapped polygons, does.

Edit: I meant to say "non-intersecting polygons", but yeah non-overlapping does also.

Share this post


Link to post
Share on other sites
You messed up the matrix stack, pal! here's how to do it:

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(...);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

if the problem still exist, maybe it's a driver bug..

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

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

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!