Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

How to draw OpenGL to a window you created in a dialog box with the resource editor

0.00/5 (No votes)
24 Oct 2001 1  
How to draw OpenGL to a window you created in a dialog box with the resource editor without manually using CreateWindow.

Sample Image - screenshot.jpg

Introduction

This example code I created explains and shows how you can draw OpenGL into a window that you created with the resource editor, without having to call CreateWindow. In my example, I used VC 6's New project creator wizard to start my project and then created a dialog box. In the dialog box, I have created 4 edit style windows. The technique used is simply retrieve the handle of the edit windows, retrieve the HDC for each window and pass them into your regular OpenGL initialization and rendering. What is important to note in my example is you have to set the current rendering context to the desired window before painting to it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here