cozman wrote on Tuesday, August 09, 2005:
I have an application which works fine in windowed mode but in fullscreen only takes up a portion fo the screen. I’ve traced the problem to when I set the viewport. I wrote a small demo displaying the behavior, it should draw a white line from the top left corner to the bottom right, but on my system (xorg 6.8.2, Radeon 9600 Pro with fglrx drivers) it does not take up the entire screen.
Sample Code:
#include <GL/glfw.h>
#include <GL/gl.h>
int main()
{
glfwInit();
glfwOpenWindow(800, 600, 8, 8, 8, 8, 0, 0, GLFW_FULLSCREEN);
glViewport\(0, 600, 800, 600\);
glMatrixMode\(GL\_PROJECTION\);
glLoadIdentity\(\);
glOrtho\(0, 800, 600, 0, -1.0, 1.0\);
glMatrixMode\(GL\_MODELVIEW\);
glLoadIdentity\(\);
do
\{
glClear\(GL\_COLOR\_BUFFER\_BIT\);
glBegin\(GL\_LINES\);
glVertex2f\(0,0\);
glVertex2f\(800,600\);
glEnd\(\);
glfwSwapBuffers\(\);
\} while\(glfwGetWindowParam\(GLFW\_OPENED\) && glfwGetKey\(GLFW\_KEY\_ESC\) \!= GLFW\_PRESS\);
glfwCloseWindow\(\);
glfwTerminate\(\);
}
I’ve also been told that the code works fine in Windows (but have not had a chance to test it myself). Does this code work on other people’s systems or is there some sort of GLFW/X11 bug I’m encountering here?