Jump to content
  • Advertisement
Sign in to follow this  
TFS_Waldo

OpenGL OpenGL in splitter pane? (Using MFC)

This topic is 4679 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 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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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! =)

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!