Sign in to follow this  
scubabbl

Problem with GLFW Fullscreen mode

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this