Click here to Skip to main content
13,556,507 members
Click here to Skip to main content

Stats

66.8K views
6.7K downloads
87 bookmarked
Posted 30 Oct 2010
Licenced CPOL

Writing a Platform and GUI Toolkit Independent OpenGL Class

, 1 Nov 2010
Article showing how to write OS and GUI toolkit portable OpenGL view class
basecode
linux
MultiGL
buildall.sh
GLView
GLViewGTKApp
.cproject
.project
aclocal.m4
AUTHORS
autogen.sh
autom4te.cache
output.0
output.1
requests
traces.0
traces.1
ChangeLog
config.guess
config.h.in
config.sub
configure
configure.in
COPYING
depcomp
glviewgtkapp.glade
glviewgtkapp.gladep
INSTALL
install-sh
Makefile.am
Makefile.in
missing
mkinstalldirs
NEWS
po
ChangeLog
Makefile.in.in
POTFILES.in
README
src
Makefile.am
Makefile.in
stamp-h.in
GLViewMotifApp
.cproject
.project
aclocal.m4
autom4te.cache
output.0
output.1
requests
traces.0
traces.1
config.h.in
configure
configure.ac
depcomp
install-sh
Makefile.am
Makefile.in
missing
src
Makefile.am
Makefile.in
GLViewQtApp
.cproject
.project
GLViewQtApp.ico
GLViewQtApp.pro
GLViewQtApp.pro.user
glviewqtapp.qrc
glviewqtapp.ui
Makefile
Resources
.cproject
.project
aclocal.m4
autom4te.cache
output.0
output.1
output.2
requests
traces.0
traces.1
traces.2
config.guess
config.h.in
config.sub
configure
configure.ac
depcomp
install-sh
ltmain.sh
m4
libtool.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4
Makefile.am
Makefile.in
missing
src
Makefile.am
Makefile.in
run.sh
win32
MultiGL
GLView
GLViewGTKApp
AUTHORS
autogen.sh
ChangeLog
configure.in
devcpp
glviewgtkapp.dev
glviewgtkapp.glade
glviewgtkapp.gladep
Makefile.am
msvc
glviewgtkapp.suo
NEWS
po
ChangeLog
POTFILES.in
README
src
Makefile.am
stamp-h.in
GLViewMFCDlgApp
GLViewMFCDlgApp.aps
res
GLViewMFCDlgApp.ico
GLViewMFCMDIApp
res
buttons.bmp
filelarge.bmp
filesmall.bmp
GLViewMFCMDIApp.ico
GLViewMFCMDIAppDoc.ico
main.bmp
Toolbar.bmp
Toolbar256.bmp
writelarge.bmp
writesmall.bmp
GLViewQtApp
GLViewQtApp
GLViewQtApp.ico
GLViewQtApp.pro
glviewqtapp.qrc
glviewqtapp.ui
Makefile
moc_glviewqtapp.o
Resources
GLView.cpp.bak
GLView.suo
MultiGL.suo
// GLViewMFCDlgApp.cpp : Defines the class behaviors for the application.
//

#include "stdafx.h"
#include "GLViewMFCDlgApp.h"
#include "GLViewMFCDlgAppDlg.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#endif


// CGLViewMFCDlgAppApp

BEGIN_MESSAGE_MAP(CGLViewMFCDlgAppApp, CWinAppEx)
	ON_COMMAND(ID_HELP, &CWinApp::OnHelp)
END_MESSAGE_MAP()


// CGLViewMFCDlgAppApp construction

CGLViewMFCDlgAppApp::CGLViewMFCDlgAppApp()
{
	// TODO: add construction code here,
	// Place all significant initialization in InitInstance
}


// The one and only CGLViewMFCDlgAppApp object

CGLViewMFCDlgAppApp theApp;


// CGLViewMFCDlgAppApp initialization

BOOL CGLViewMFCDlgAppApp::InitInstance()
{
	// InitCommonControlsEx() is required on Windows XP if an application
	// manifest specifies use of ComCtl32.dll version 6 or later to enable
	// visual styles.  Otherwise, any window creation will fail.
	INITCOMMONCONTROLSEX InitCtrls;
	InitCtrls.dwSize = sizeof(InitCtrls);
	// Set this to include all the common control classes you want to use
	// in your application.
	InitCtrls.dwICC = ICC_WIN95_CLASSES;
	InitCommonControlsEx(&InitCtrls);

	CWinAppEx::InitInstance();

	AfxEnableControlContainer();

	// Standard initialization
	// If you are not using these features and wish to reduce the size
	// of your final executable, you should remove from the following
	// the specific initialization routines you do not need
	// Change the registry key under which our settings are stored
	// TODO: You should modify this string to be something appropriate
	// such as the name of your company or organization
	SetRegistryKey(_T("Local AppWizard-Generated Applications"));

	CGLViewMFCDlgAppDlg dlg;
	m_pMainWnd = &dlg;
	INT_PTR nResponse = dlg.DoModal();
	if (nResponse == IDOK)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with OK
	}
	else if (nResponse == IDCANCEL)
	{
		// TODO: Place code here to handle when the dialog is
		//  dismissed with Cancel
	}

	// Since the dialog has been closed, return FALSE so that we exit the
	//  application, rather than start the application's message pump.
	return FALSE;
}

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Sharjith
Product Manager Mahindra & Mahindra
India India
Sharjith is a Mechanical Engineer with strong passion for Automobiles, Aircrafts and Software development.

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.180515.1 | Last Updated 1 Nov 2010
Article Copyright 2010 by Sharjith
Everything else Copyright © CodeProject, 1999-2018
Layout: fixed | fluid