• Advertisement
Sign in to follow this  

Problem with GLFW Fullscreen mode

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

In the below code, when I call glfwOpenWindow with the GLFW_WINDOW flag, I get a window with a rectangle drawn in it. But if I switch GLFW_WINDOW to GLFW_FULLSCREEN, I get a fullscreen display, but no more rectangle. Any ideas?
#include <stdlib.h>

#define GLFW_DLL

#include <GL/glfw.h>


const int width = 1600;
const int height = 1200;
 

int main()

{

	if ( glfwInit() != GL_TRUE ){

		exit( 0 );
	}
 

    if ( glfwOpenWindow( width, height, 5, 6, 5, 0, 0, 0, GLFW_WINDOW) != GL_TRUE )

    {

        glfwTerminate();

        exit( 0 );       

    }
 

      glMatrixMode( GL_PROJECTION );

      glLoadIdentity();

      glFrustum(.5, -.5, -.5 * ((float)height) / (float)width, .5 * ((float)height) / (float)width, 1, 50);

      glMatrixMode(GL_MODELVIEW);

 

      while( 1 )

      {

            if ( glfwGetKey(GLFW_KEY_ESC) == GLFW_PRESS )

                  break; 

            glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

            glLoadIdentity( );
 

            /****************************************/

            glTranslatef( 0, 0, -5 );

            glColor3f(0.5f,0.5f,1.0f);

            glBegin(GL_QUADS);

                  glVertex3f(-1.0f, 1.0f, 0.0f);

                  glVertex3f( 1.0f, 1.0f, 0.0f);

                  glVertex3f( 1.0f,-1.0f, 0.0f);

                  glVertex3f(-1.0f,-1.0f, 0.0f);

            glEnd();

            /****************************************/
 

            glfwSwapBuffers();

      } 

      glfwTerminate();

      exit( 0 );

	  return 0;

}

Share this post


Link to post
Share on other sites
Advertisement
Try setting glViewport to something sensible. (I think this is a known issue in the current stable release)

Share this post


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

  • Advertisement