opengl with dialog box
Hi everyone.
Up til now ive been using GLUT to create a boids flocking app. But now i want interactivity! eg: slider bars, buttons, checkboxes! Id like my app to have 1 opengl window and 1 window with the controls (or some variation thereof...)
Whats the best way to do this? Im using VC++ 6.0 but i know nothing about windows programming (im pretty new to it...)
I hope someone can help or atleast point me to a tutorial that might help!
Thanks,
glJunkie.
The only tutorial that I know of that may be close to what you''re looking for is here.
Also, have you tried GLUI? It''s similiar to GLUT in that it''s cross platformable, but it creates some nice control windows. And you don''t need to know any Win32 to use it. I used it when I was in college for several projects which needed to run on Unix. My favorite feature (besides that it auto configured the placement so you didn''t have to do anything with that) was that it had callbacks for all the controls. So when the user changed a setting, pushed a button, moved a slider, etc. GLUI would do the callback, or it would instantly update the variable for you! I don''t have the link here at work, but you should be able to find it pretty easily at OpenGL.org. I highly suggest it, especially since you don''t have any Windows experience.
Jason
Also, have you tried GLUI? It''s similiar to GLUT in that it''s cross platformable, but it creates some nice control windows. And you don''t need to know any Win32 to use it. I used it when I was in college for several projects which needed to run on Unix. My favorite feature (besides that it auto configured the placement so you didn''t have to do anything with that) was that it had callbacks for all the controls. So when the user changed a setting, pushed a button, moved a slider, etc. GLUI would do the callback, or it would instantly update the variable for you! I don''t have the link here at work, but you should be able to find it pretty easily at OpenGL.org. I highly suggest it, especially since you don''t have any Windows experience.
Jason
Many thanks for your posts - GLUI looks great, but for reasons I wont bore you with - slider bars are something I really need in my app - and GLUI just doesnt support them...
I think the stuff here is the right way to go:
http://pws.prserv.net/mfcogl/
Ive been looking at the code for the slider bar app and i think i get it more or less
One thing though - Is it a big step to have the OpenGL part constantly updating, eg: constantly rotating / changing color, But sill be interactive via the slider bar?
I presume this will require repeatedly calling OnPaint(), but I dont understand how this can be done. Id really appreciate some help on this one.
Many thanks.
I think the stuff here is the right way to go:
http://pws.prserv.net/mfcogl/
Ive been looking at the code for the slider bar app and i think i get it more or less

One thing though - Is it a big step to have the OpenGL part constantly updating, eg: constantly rotating / changing color, But sill be interactive via the slider bar?
I presume this will require repeatedly calling OnPaint(), but I dont understand how this can be done. Id really appreciate some help on this one.
Many thanks.
Hi all,
i am interested in knowing how to use mfc with opengl. It is quite useful maybe in certain areas which command buttons, checkbox etc, becomres part of the user interaction. Anyone has any more good links to any tutorial that cover this topic? Does the nehe site currently has any tutorial for this topic?
thanks!
Uh, weekee, you may want to try posting a new topic instead of hijacking this one.
Sorry to repost the request - but this is killing me! The below link is a VC++ OpenGL dialog app with a slider bar that rotates an object. I want to modify it so that the object is say, continually rotating about the x axis, and rotation in the y axis is controlled by the slider. (Thats arbitrary - what i really want to know is how to have an animation whose behavior is modifiable via controls!)
This must be possible - and if anyone could help out Id *Really appreciate it!
http://pws.prserv.net/mfcogl/zip_files/slider2.zip
This must be possible - and if anyone could help out Id *Really appreciate it!
http://pws.prserv.net/mfcogl/zip_files/slider2.zip
hi,
sorry....do not meant to hijack the topic. Just thought that i am looking for the same information so i post in this thread so all the information will be consolidate on this thread
sorry for any inconvience

I downloaded the code and tried out an idea I had. Set up WM_TIMER messages and just invalidate the window''s rect. This generates a WM_PAINT message and the object(s) can be animated. I''ll email you the modified source and exe so you can check it out (sorry no webspace at this time, if anyone else is interested in the source, email me and I''ll send it to you).
Jason
Jason
Hi Jason, Many thanks.
I tried the invalidate rect idea already - and it worked great apart from 1 bug which I read about at the OpenGL.org forums (but that I cant refind...)
The bug is that as soon as you move the window / change to another window, the controls dispaear - this is because they dont receive a message to redraw themselves on screen.
I dont know how to set up the timer you describe so the code would be great!
Many thanks Jason and to everyone who''ve helped me with this problem btw. Ill post a link to my finished project as soon as its finished (about 2 weeks) - Its a "boids" app.
Real name is Tim - the nick was a , well theres no excuse.
Tim.
I tried the invalidate rect idea already - and it worked great apart from 1 bug which I read about at the OpenGL.org forums (but that I cant refind...)
The bug is that as soon as you move the window / change to another window, the controls dispaear - this is because they dont receive a message to redraw themselves on screen.
I dont know how to set up the timer you describe so the code would be great!
Many thanks Jason and to everyone who''ve helped me with this problem btw. Ill post a link to my finished project as soon as its finished (about 2 weeks) - Its a "boids" app.
Real name is Tim - the nick was a , well theres no excuse.
Tim.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement