GLFW Fullscreen problem

I just port my code from win32api to GLFW and It work pretty well in window mode.

But when i try fullscreen mode the performance is very horrible and there are some kind of scanlines when the scene is moving.

can someone tell me how to fix this ?

this is the code i use to initialize window

  


#include <StdAfx.h>
#include "./MainEngine.h"
#include <GL/glfw.h>

MainEngine* mainEngine;

int main( void )
{
		int running = GL_TRUE;
		
		glfwInit();
		glfwSetTime(1);
		if( !glfwOpenWindow( 1024,768, 8,8,8,8,16,0, GLFW_FULLSCREEN) )
		{
			glfwTerminate();
			return 0;
		}
		
		mainEngine = new MainEngine();
		mainEngine->isFrameLimit = false;
		mainEngine->isUseOpenGL2 = 1;
		mainEngine->initComponent();
		mainEngine->isPostProcessing = true;
		mainEngine->resize(1024,768);
		
		while( running )
		{
			
			mainEngine->mainLoop();

			glfwSwapBuffers();

			/*
			running = !glfwGetKey( GLFW_KEY_ESC ) &&
			glfwGetWindowParam( GLFW_OPENED );
			*/
		}
		
		glfwTerminate();
		return 0;
}

either you don’t get accelerated OpenGL, or vsync is worse with fullscreen (faster framerate than windowed with simple scenes)
try :

glfwSwapInterval(1) //to activate vsync.

// 24 bits depth buffer (standard)
if( !glfwOpenWindow( 1024,768, 8,8,8,8,24,0, GLFW_FULLSCREEN) )

still don’t work

I don’t think that it has something to do with
not having accelerated OpenGL. since it run smooth but with scanline/flicker

I have set vsynce in nvidia control panel to “application control” but it still don’t work.

If I cant use GLFW for it Windowing,can I use its other function (keyboard / joystick / timer) with my own create windows ?

Not sure, just ask Marcus (GLFW author) about this :
http://www.opengl.org/cgi-bin/ubb/ultimatebb.cgi?ubb=get_profile;u=00004282

I’m the one you should bug about GLFW not working nowadays :slight_smile:

You need to call glfwSwapInterval after opening your window, or it will be ignored. Please see if that helps.