Click here to Skip to main content
15,885,244 members
Articles / Desktop Programming / MFC

Writing a Platform and GUI Toolkit Independent OpenGL Class

Rate me:
Please Sign up or sign in to vote.
4.92/5 (33 votes)
1 Nov 2010CPOL13 min read 96.8K   7.5K   89  
Article showing how to write OS and GUI toolkit portable OpenGL view class
// GLViewMFCDlgAppDlg.h : header file
//

#pragma once
#include "afxwin.h"

#include <GLView.h>

// CGLViewMFCDlgAppDlg dialog
class CGLViewMFCDlgAppDlg : public CDialog
{
// Construction
public:
	CGLViewMFCDlgAppDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	enum { IDD = IDD_GLVIEWMFCDLGAPP_DIALOG };

	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support


// Implementation
protected:
	HICON m_hIcon;

	// Generated message map functions
	virtual BOOL OnInitDialog();
	afx_msg void OnSysCommand(UINT nID, LPARAM lParam);
	afx_msg void OnPaint();
	afx_msg HCURSOR OnQueryDragIcon();
	DECLARE_MESSAGE_MAP()
public:
	CStatic m_cGLFrame;

private:
	CGLView* m_pGLView;
public:
	afx_msg void OnBnClickedOk();
	afx_msg void OnBnClickedCancel();
};

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)


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

Comments and Discussions