Hello,
i have been experimenting with using openGL in wxWindows and i successfully was able to implement a single openGL window in a frame, however if i try to add any other controls to the window the openGL window dissappears leaving just the frame and control!
i would like to make a frame with an openGL window with several controls (listboxes buttons textboxes and so forth), but i want to do it in one frame, is there some example source for this, or does anyone know what could cause this problem?
Thanks
OpenGL canvas and frames
-
- Knows some wx things
- Posts: 29
- Joined: Tue Jul 04, 2006 6:49 am
-
- Knows some wx things
- Posts: 29
- Joined: Tue Jul 04, 2006 6:49 am
Here you can find the portion of my program's source code where i use wxGLCanvas for my OpenGL Editor.
In the zip file you'll find the executable for Windows XP too. To use it you must copy and paste "glut32.dll" in your Windows/System folder.
http://mio.discoremoto.alice.it/piumina
Hope this will be useful!
In the zip file you'll find the executable for Windows XP too. To use it you must copy and paste "glut32.dll" in your Windows/System folder.
http://mio.discoremoto.alice.it/piumina
Hope this will be useful!
-
- Knows some wx things
- Posts: 29
- Joined: Tue Jul 04, 2006 6:49 am
You may want to check out these two more highlevel OpenGL based packades which are supposed to work with wxWidgets,
http://g3d-cpp.sourceforge.net/
http://www.openscenegraph.org/
http://g3d-cpp.sourceforge.net/
http://www.openscenegraph.org/
Thanks for the links ppl
I think there may be a bug in wxMac2.6.3...
i have looked in the wx source code and found the following entry in the constructor for wxGLContext in the carbon implementation
m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetTopLevelWindowRef()));
im not an expert carbon programmer, so the GetTopLevel thing looks very suspciously like it grabs the window handle for the parent frame. This would explain the problem that i have been having, as any attempt to pass a child frame would result in getting the parent frame reference.
Can anyone verify this? If someone doesnt shoot me down in flames in the next few days ill submit a bug.
edit: fixed cocoa/carbon typo
I think there may be a bug in wxMac2.6.3...
i have looked in the wx source code and found the following entry in the constructor for wxGLContext in the carbon implementation
m_drawable = (AGLDrawable) UMAGetWindowPort(MAC_WXHWND(win->MacGetTopLevelWindowRef()));
im not an expert carbon programmer, so the GetTopLevel thing looks very suspciously like it grabs the window handle for the parent frame. This would explain the problem that i have been having, as any attempt to pass a child frame would result in getting the parent frame reference.
Can anyone verify this? If someone doesnt shoot me down in flames in the next few days ill submit a bug.
edit: fixed cocoa/carbon typo
Learnig openGL
I'm lucky to find this topic here in the forum!
Could someone here help me on my way to begin using opengl? We must admit it's not an easy step learning c++ an begin using OpenGL!
Also, about OSG, does it worth using it?
Thanks a lot for any reply!
Could someone here help me on my way to begin using opengl? We must admit it's not an easy step learning c++ an begin using OpenGL!
Also, about OSG, does it worth using it?
Thanks a lot for any reply!
-
- Earned some good credits
- Posts: 122
- Joined: Fri Apr 14, 2006 9:49 pm
- Location: Beaverton, OR
- Contact:
I'm not sure if this will help, but in general most of the time you won't want to use the frame directly, but rather create a wxPanel, attach it to the wxFrame, and create the wxGLCanvas on the panel rather than the frame. Doing things directly on a frame can give funny results in some operating systems.