OpenGL in splitter pane? (Using MFC)

Started by
2 comments, last by TFS_Waldo 18 years, 7 months ago
Hello GDNet. =) Well, here is my question. I want to create a 3D world editor. I feel very confident and comfortable in attempting this. I know I can get at least a BASIC world editor done. But, I need to know how I can do the view. Well, I am going to use MFC. My environment is MS Visual C++ 6.0, first. =P I would like to use OpenGL for the renderer (right pane) and a tree-view with different objects (sub-items: lights, meshes, trees, terrain, etc.) in the left pane. Up to the splitter and tree-view, I know how to do, no problem. But, how do I set up the right pane for OpenGL rendering. Is there any way to do it with OpenGL using SDL, or do I HAVE to use Win32 OpenGL? A little code to making a child window (ex. right pane) an OpenGL view would be greatly appreciated. I mean, can you just setup OpenGL using the HWND of the right pane, or is there more? Sorry for the sort of stupid questions. But I have been using SDL for OpenGL lately, so I don't remember a WHOLE lot about setting up a window using Win32 for OGL. Thanks in advance, Matt U.
:==-_ Why don't the voices just leave me alone?! _-==:
Advertisement
NEHE's homepage has a link to his MFC Visual C++ Appwizard. Create a project and check the function CMainFrame::OnCreateClient. Its based on wgl ("wiggle"). It creates a device context from the hwnd, and then uses wglCreateContext() and wglMakeCurrent() to set it up for OpenGL. You should be able to do the same thing from your child window, using its hWnd. Just be sure to resize the OpenGL viewport whenever your child window resizes.
Use your brain or lose your mind.
I have lots of source code for enabling OpenGL Rendering in a CView derived class. I also have code for making static splitter panes (ala Hammer). PM Me if you'd like to get it, and if you need any help in general.
Sorry for not responding for a while, but I found what I needed yesterday. I haven't implemented it yet, but it uses OpenGL in a "CView" derived class. I am fixing to do so now. I will let you all know if I need anymore help. Thanks a lot! =)
:==-_ Why don't the voices just leave me alone?! _-==:

This topic is closed to new replies.

Advertisement