Click here to Skip to main content
Click here to Skip to main content
Articles » Multimedia » OpenGL » General » Downloads
 
Add your own
alternative version

OpenGL Win32 AppWizard

, 19 May 2003
This Custom AppWizard for VC++ 6.0 or VC++.NET creates an OpenGL enabled Win32 application suitable for demos and simple games.
oglwiz7.zip
OGLWiz7
1033
HTML
1033
Images
OGLWiz7.gif
OGLWiz7_Background.gif
Scripts
1033
Templates
1033
Templates.inf
res
Mainicon.ico
OGLWiz7.ico
OGLWiz7.vsdir
OGLWiz7.vsz
oglwiz_bin.zip
OGLWiz.awx
OGLWIZ.HLP
oglwiz_src.zip
res
OGLWiz.ico
Template
newproj.inf
confirm.inf
res
SDKTest.ICO
small.ico
hlp
OGLWiz.hpj
OGLWiz.rtf
OGLWiz.hm
OGLWIZ.HLP
OGLWiz.clv
OGLWiz.dsp
OGLWiz.dsw
// App.h: interface for the CApp class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(APP_H_INCLUDED)
#define APP_H_INCLUDED

#pragma once

#define FRAME_INTERVAL 1000     // Interval between FPS updates (ms)
#define FPS_TIMER_ID 0xFFFFFFFF // ID for FPS timer

/////////////////////////////////////////////////////////////////////////////
// CApp
// Application base class

class CApp
{
private:
	BOOL m_bFPSTimer; // Flag to indicate if FPS timer is active
	UINT m_nFrames;   // Number of frames since last FPS update

protected:
	HINSTANCE m_hInstance;// Handle to application instance
	HACCEL m_hAccelTable;	// Accelerator table
	HWND m_hWnd;			// Handle to window

	HDC m_hDC;				// Handle to DC
[!if CHK_OPENGL]
	HGLRC m_hRC;		  // Handle to RC

	//Viewport info
	GLfloat m_fFovy;  // Field-of-view
  GLfloat m_fZNear; // Near clipping plane
  GLfloat m_fZFar;  // Far clipping plane	

[!endif]

	void OnIdle();
[!if CHK_OPENGL]
	virtual void DrawScene() = 0;
	virtual void KillScene() = 0;
	virtual void InitScene() = 0;
	virtual BOOL Tick() { return TRUE; }
[!else]
	virtual BOOL Tick() { return FALSE; }
[!endif]

	void SetFPSTimer(BOOL bStart);
	BOOL GetFPSTimer();
	virtual void OnUpdateFPS(float fFPS){}

	virtual BOOL OnCommand(int nCmdID, int nEvent);	
	void OnCreate();
	void OnDestroy();
	void OnSize(int cx, int cy);
	virtual void OnPaint(HDC hDC);
[!if CHK_OPENGL]
	void FireDrawScene();
	void SetViewPort(float fFovy, float fZNear, float fZFar, BOOL bApply = TRUE);
[!endif]
	virtual void PreCreateWindow(WNDCLASSEX &wcex, DWORD &dwStyle, DWORD &dwExStyle, int &x, int &y, int &cx, int &cy);
[!if CHK_OPENGL]
	virtual void PreCreateRC(PIXELFORMATDESCRIPTOR &pfd);
[!endif]
	virtual BOOL InitInstance(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine);
	virtual void ExitInstance();

[!if CHK_ABOUT]
	int ShowAboutDialog();
	static LRESULT CALLBACK AboutProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam);

[!endif]
public:
	static CApp* m_pAppInstance;

	int Run(HINSTANCE hInstance, int nCmdShow, LPSTR lpCmdLine);
	virtual LRESULT WindowProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

	CApp();
	virtual ~CApp();
};
[!if CHK_OPENGL]

void GLCube(GLfloat x1, GLfloat y1, GLfloat z1, GLfloat x2, GLfloat y2, GLfloat z2);
[!endif]

#endif // !defined(APP_H_INCLUDED)

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for 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

Share

About the Author

Ulf Öhlén

Sweden Sweden
No Biography provided

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