Jump to content
  • Advertisement
Sign in to follow this  
jeff8j

OpenGL OPENGL from X Window ID

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

Through the api I am using I get handed a X Window ID

I am having the hardest time trying to make opengl work for that window.

here is what i am doing but I dont think its right can someone help.


int i = 0;
glutInit(&i, NULL);

glutSetWindow( (XID)instanceData->window.window );

// register the display callback
glutDisplayFunc(glDisplay);
// register the reshape callback
glutReshapeFunc(Reshape);
// register the idle callback
glutIdleFunc(DoIdle);
// register the keyboard callback
glutKeyboardFunc(KeyboardFunc);
// call our initialization
glInit();
// forever sink into an internal GLUT loop
glutMainLoop();


That crashes at the set window part.

Share this post


Link to post
Share on other sites
Advertisement
GlutSetWindow does not take an X11 window handle. It takes a GLUT window handle returned from GlutCreateWindow.

The reason for this is that SetWindow needs access to the GL context attached to the X11 window which it gets via the GLUT handle, not just the actual renderable window.

(I know they're both integers, but they're not fungible.)

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!