Jump to content
  • Advertisement
Sign in to follow this  
TheMightyDude

Win32 Controls within an OpenGL window.

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

Hello All Just a quick question... I have an OpenGL window, and I want to have a Combo Box, a couple of Command buttons and a few Slider controls. Does anyone know how to get it to display within an OpenGL window? Or isnt this posible, if so will I have to create these controls by hand? Because I dont really want to code complete control sets to be used within OpenGL if you can use windows controls. Thansk in advance Paul Kirby

Share this post


Link to post
Share on other sites
Advertisement
I don't think that's possible.
You could create a window with your controls and than display the OpenGL stuff in a part of that window (I wouldn't know how to do that, but I think 3D editors are made that way).
Or, if you want these controls for your game menus or something like that, you have to create them by yourself or use a library that does it for you (I can't tell you any specific name but I guess there are some out there)

Share this post


Link to post
Share on other sites
I imagine it would be easier to just use controls within OpenGL, look into the GLUT library which is made for making such GUIs in OpenGL. I'm not sure how good GLUT's built in control selection is, but extensions exist that should cover anything you need.

Share this post


Link to post
Share on other sites
You can create a control that will house the opengl rendering. I would suggest a multi-line richedit control since you can vary the size and place all your other controls outside.

The code to render within the control is not all that different from rendering in a window, simply take its device context.

Or you can look at this.

Share this post


Link to post
Share on other sites
Thanks for all the replies.

I will look into how GLUT does it.

I dont really want to use GLUT, but it may help me see how I could do it.

Thanks for the help :)

Paul Kirby

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by Kazade
Im not sure if its what you are looking for but try GLUI.

Luke.


GLUI uses GLUT :(

I dont really want to use GLUT at all, if I can help it.

Thanks for the reply

Paul

Share this post


Link to post
Share on other sites
In my last OGL app, I created a seperate window for OGL rendering, tracked it inside a normal dialog (it moves with the dialog when you drag the dialog around) and set it to go fullscreen with a button and back to a dialog window with Esc.

As for using native win API controls on top of openGL, you can do it if you stop rendering when the control is active, otherwise it'll flash as the openGL window continues it's rendering loop and Windows continually sees the need for a repaint on the control.

Before calling your control, stop your rendering loop. I set 'state' flags when a control was active.

The rendering loop looks at the 'state' it's in before commencing with it's next iteration and doesn't render if 'control'-state is set.

Of course, this means you'll have to show/hide your controls with a hotkey, mouse-press, or maybe a context-menu to get 'em up on the screen - they can't be there when you're in render-mode......which is why I ended up building a dialog to house the controls (28 buttons, edit boxes, etc.) and a seperate window altogether just for openGL rendering.

But try it out and see what you come up with.

[Edited by - comservlant on November 28, 2004 1:10:38 AM]

Share this post


Link to post
Share on other sites
you can also create OpenGL contexts inside of custom control Dialog Boxes in MFC. There is a way to do that somewhere... I just dont remember where I found it :)

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!