Jump to content
  • Advertisement
Sign in to follow this  
Mattias Pettersson

Problem opening window in freeglut

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

Hi! I posted this on the newb forum but I didn't get any replies. So I will try my luck here too. I am new to linux and has recently installed ubuntu. I have installed freeglut dev and have been able to compile with gcc and run a window. For some reason I can see the window in front of me for a frame or so. Then it automatically disappear but is still visible in the taskbar. If I click it in the taskbar, it automatically hides itself again. Any ideas? Maybe I should post some code too. int main(int argc, char** argv) { glutInit(&argc, argv); glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); glutInitWindowSize (250, 250); glutInitWindowPosition (100, 100); glutCreateWindow (argv[0]); GL_Initialize(); glutDisplayFunc(GL_Display); glutMainLoop(); return 0; } void GL_Initialize(void) { glClearColor(0.0f, 0.0f, 0.0f, 0.0f); glMatrixMode(GL_PROJECTION); glLoadIdentity(); glOrtho(0.0f, 1.0f, 0.0f, 1.0f, -1.0f, 1.0f); } void GL_Display(void) { glClear (GL_COLOR_BUFFER_BIT); glColor3f(1.0f, 1.0f, 1.0f); glBegin(GL_POLYGON); glVertex3f(0.25f, 0.25f, 0.0f); glVertex3f(0.75f, 0.25f, 0.0f); glVertex3f(0.75f, 0.75f, 0.0f); glVertex3f(0.25f, 0.75f, 0.0f); glEnd(); glutSwapBuffers(); glFlush(); } That's it! Thanks in advance.

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!