Jump to content
  • Advertisement
Sign in to follow this  
openglJunkie

OpenGL OpenGL won't Render Objects Fullscreen

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

What are some common reasons for OpenGL not rendering when switching to fullscreen mode? I have a bunch of code and if I need to post some code, I'd like to narrow the choices down as little as possible.

Share this post


Link to post
Share on other sites
Advertisement
If you are using textures you have to rebind all your textures each time you switch video mode. Hope that helps.

Share this post


Link to post
Share on other sites
Quote:
Original post by Hexmind
If you are using textures you have to rebind all your textures each time you switch video mode.

No you don't. You only need to reload resources if you lose the context.

Quote:

What are some common reasons for OpenGL not rendering when switching to fullscreen mode?

There aren't any, unless you provide some more information. It could be virtually anything. Check if your glViewport params are correct, if you have a valid OpenGL context bound, if your new video mode supports GL rendering, etc.

Share this post


Link to post
Share on other sites
Apparently this only happens when I'm trying to draw a line. I was just messing around and had switched over from using points, but I don't see why my lines aren't being displayed while in fullscreen.

If you need to know, I'm using OpenGL with Win32 and the code for the Win32 part is encapsulated. So if you need any of that I can get it.


bool init()
{
int w = opengl->getWidth(), h = opengl->getHeight();

glClearColor(0.0f, 0.0f, 0.0f, 0.0f);

// Enable States
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LEQUAL);
glClearDepth(1.0);

glShadeModel(GL_SMOOTH);

return true;
}
void display()
{
glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT);

// I added this to see if it would work help my fullscreen problem
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport(0.0, 0.0, opengl->getWidth(), opengl->getHeight());
glOrtho(0.0f, opengl->getWidth(), 0.0f, opengl->getHeight(), 1.0f, 100.0f);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();

gluLookAt(
0.0, 0.0, 1.0,
0.0, 0.0, 0.0,
0.0, 1.0, 0.0);

glColor3f(0.0f, 0.0f, 1.0f);
glPointSize(5);
glBegin(GL_LINES);
glVertex2f(0.0f, 0.0f);
glVertex2f(100.0f, 100.0f);
glEnd();

glFlush();
}

void resize(int w, int h)
{
if(h==0) h = 1;

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewport(0, 0, w, h);
gluPerspective(45.0, w/h, 1.0, 100.0);

glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
}


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.

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!