3dframe (CPP)
3dframe (CPP)
cpp
//
// Copyright (c) Craig Fahrnbach 1997, 1998
//
// This program is freely distributable without licensing fees and is
// provided without guarantee or warrantee expressed or implied. This
// program is -not- in the public domain.
//
// This file should be included in your application's main
// include file so that it is available to all modules that
// need access the the OpenGL 3D classes
//
#include "stdafx.h"
#include "3dPlus.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
//////////////////////////////////////////////////////////////////
// C3dFrame
IMPLEMENT_DYNAMIC(C3dFrame, CObject)
/////////////////////////////////////////////////////////////////////////////
// C3dFrame construction
C3dFrame::C3dFrame()
{
// Assign Default values to member attributes
m_hWnd = NULL;
m_hDC = NULL;
m_hRC = NULL;
}
/////////////////////////////////////////////////////////////////////////////
// C3dFrame Destructor
C3dFrame::~C3dFrame()
{
if(m_hRC)
// Clean up rendering context stuff
wglDeleteContext(m_hRC);
}
/////////////////////////////////////////////////////////////////////////////
// C3dFrame Procedures
m_hWnd = pParent->m_hWnd;
m_hDC = ::GetDC(pParent->m_hWnd);
return TRUE;
}
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER |
FORMAT_MESSAGE_FROM_SYSTEM,
NULL,
GetLastError(),
MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), // Default
language
(LPTSTR) &lpMsgBuf,
0,
NULL);
// Display the string.
MessageBox( NULL, (LPTSTR)lpMsgBuf, "GetLastError", MB_OK|
MB_ICONINFORMATION );
return TRUE;
}