Click here to Skip to main content
13,400,969 members (37,579 online)
Click here to Skip to main content
Add your own
alternative version


110 bookmarked
Posted 26 Jul 2001

OpenGL Win32 AppWizard

, 19 May 2003
Rate this:
Please Sign up or sign in to vote.
This Custom AppWizard for VC++ 6.0 or VC++.NET creates an OpenGL enabled Win32 application suitable for demos and simple games.

Sample Image - OGLWiz.gif
An example of a generated application

Installation (VC6 version)

Copy OGLWiz.awx and Oglwiz.hlp to your Custom AppWizard directory (probably "C:\Program Files\Microsoft Visual Studio\Common\MSDev98\Template").

Overview of the generated project (VC6 version)

Projects generated with this AppWizard contains two classes:
  • CApp
  • CMainWnd
There is a global instance of CApp (gApp) that owns an instance of CMainWnd (m_pMainWnd). CApp creates the main window, initializes OpenGL, maintains the message pump and manages screen updates. CMainWnd encapsulates the main window and its OpenGL rendering context. CApp notifies CMainWnd of different phases of the OpenGL RC life cycle (by calling CMainWnd::InitScene(), CMainWnd::KillScene() and CMainWnd::DrawScene()). CMainWnd::Tick() is called (by CApp) each time the windows message queue is empty.

This may not be the most elegant OO solution; some of the code in CApp really belongs in CMainWnd, like window creation and (some of the) message handling. But the idea is to let CApp do the grunt work of Win32API and OpenGL setup and leave CMainWnd free to concentrate on what's displayed in the client area.

Using the wizard

Chose to create a new project, selecting "OpenGL Win32 Application" from the list of project types, enter a project name and press OK.

The following options to customize the project are available:


Menu: Check this box to add a menu to the main window.
Keyboard accelerator: Adds a keyboard accelerator resource and processes accelerator keys.
About box: Creates an about dialog and a dialog callback routine. Also adds an About command to the menu (if available).

Main window

Select appearance of the main window.

Window: Creates an overlapped main window with default size.
Fullscreen: Creates a topmost popup window that occupies the entire screen.
Both: Appearence is determined with a switch: If FULLSCREEN is not #defined, the application runs in a window.
Show FPS in caption: Adds code to show Frames Per Second on regular intervals. (Not available in fullscreen mode)

OpenGL Support

Use OpenGL: Adds code to initialize and maintain an OpenGL RC. If this box is not checked, a plain Win32 application is created.
Sample code: Adds code that renders a simple OpenGL scene (spinning cube).
Double buffering: Creates a double-buffered pixel buffer.
Color depth: Number of color bitplanes in each color buffer.
Z-buffer depth: Bit-depth of the Z-buffer.
Background color: Press the button to select background color for main window.

Notes on the VC++.NET appwizard

In VC++.NET, appwizards are no longer compiled plugins, but rather a collection of scripts and template files, with a HTML-based UI. See Readme.txt for installation instructions.

I took the opportunity to change the object model into something that, IMO, is a bit cleaner. Instead of having one class for the window and one class for the application, there is now one abstract base class, CApp, that takes care of window creation, OpenGL initialization etc. The "meat" of the generated app goes in a derived class that overrides a number of virtual functions of CApp. For example, InitScene(), DrawScene() and KillScene() are virtual.

Other than that, the VC++.NET version of the AppWizard behaves basically the same as the VC++6 version.


  • 20 May 2003 - Updated VS.NET download


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


About the Author

Ulf Öhlén
Sweden Sweden
No Biography provided

You may also be interested in...

Comments and Discussions

GeneralThanks, what about Microsoft Visual Studio .NET 2005 Pin
ceman8228-Jan-07 4:03
memberceman8228-Jan-07 4:03 
GeneralRe: Thanks, what about Microsoft Visual Studio .NET 2005 Pin
markthecoder29-Jan-07 14:19
membermarkthecoder29-Jan-07 14:19 
GeneralIt crashed! Pin
HALi9-Apr-03 22:17
memberHALi9-Apr-03 22:17 
GeneralRe: It crashed! Pin
RizwanSattar13-Apr-03 6:37
memberRizwanSattar13-Apr-03 6:37 
Generalsome opinions/ideas Pin
Koray Balci21-Mar-03 0:09
memberKoray Balci21-Mar-03 0:09 
QuestionVC++ appwizard?? Pin
Super Jack15-Jan-03 5:38
memberSuper Jack15-Jan-03 5:38 
AnswerRe: VC++ appwizard?? Pin
Ulf Öhlén15-Jan-03 7:21
memberUlf Öhlén15-Jan-03 7:21 
GeneralRe: VC++ appwizard?? Pin
Super Jack16-Jan-03 0:51
memberSuper Jack16-Jan-03 0:51 
GeneralRe: VC++ appwizard?? Pin
bear_16-Jan-03 8:18
memberbear_16-Jan-03 8:18 
GeneralRe: VC++ appwizard?? Pin
Ulf Öhlén16-Jan-03 9:00
memberUlf Öhlén16-Jan-03 9:00 
GeneralRe: VC++ appwizard?? Pin
Super Jack17-Jan-03 7:40
memberSuper Jack17-Jan-03 7:40 
GeneralRe: VC++ appwizard?? Pin
hain19-Feb-03 7:40
memberhain19-Feb-03 7:40 
GeneralRe: VC++ appwizard?? Pin
JM100013-Jun-06 5:03
memberJM100013-Jun-06 5:03 
GeneralRe: VC++ appwizard?? Pin
Koray Balci20-Mar-03 2:57
memberKoray Balci20-Mar-03 2:57 
GeneralRe: VC++ appwizard?? Pin
shaul224-Apr-03 22:41
membershaul224-Apr-03 22:41 
GeneralRe: VC++ appwizard?? Pin
Ulf Öhlén15-May-03 1:09
memberUlf Öhlén15-May-03 1:09 
GeneralRe: VC++ appwizard?? Pin
olmec_the_holy11-Sep-03 23:57
memberolmec_the_holy11-Sep-03 23:57 
GeneralProblem... Pin
Ali Khanlarkhani12-Jan-03 21:30
memberAli Khanlarkhani12-Jan-03 21:30 
GeneralRe: Problem... Pin
Ulf Öhlén13-Jan-03 5:25
memberUlf Öhlén13-Jan-03 5:25 
GeneralRe: Problem... Pin
Jyrki Rasku23-Jan-03 2:09
memberJyrki Rasku23-Jan-03 2:09 
GeneralRe: Problem... Pin
hain18-Feb-03 12:30
memberhain18-Feb-03 12:30 
GeneralRe: Problem... Pin
Synetech18-Feb-03 14:33
memberSynetech18-Feb-03 14:33 
GeneralRe: Problem... Pin
hain19-Feb-03 7:31
memberhain19-Feb-03 7:31 
GeneralRe: Problem... Pin
Ulf Öhlén20-Feb-03 3:40
memberUlf Öhlén20-Feb-03 3:40 
Generalerreur Pin
skysee2-Dec-02 23:03
memberskysee2-Dec-02 23:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.180218.2 | Last Updated 20 May 2003
Article Copyright 2001 by Ulf Öhlén
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid