// 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. #ifdef _AFXDLL Enable3dControls(); // Call this when using MFC in a shared DLL #else Enable3dControlsStatic(); // Call this when linking to MFC statically #endif // Change the registry key under which our settings are stored. // You should modify this string to be something appropriate // such as the name of your company or organization. SetRegistryKey(_T(\ LoadStdProfileSettings(10); // Load standard INI file options (including MRU) // Register the application's document templates. Document templates // serve as the connection between documents, frame windows and views. CSingleDocTemplate* pDocTemplate; // create main SDI Frame window CMainFrame* pMainFrame = new CMainFrame; if (!pMainFrame->LoadFrame(IDR_MAINFRAME)) return FALSE; m_pMainWnd = pMainFrame; pDocTemplate = new CSingleDocTemplate( IDR_MODELTYPE, RUNTIME_CLASS(CToolDoc), RUNTIME_CLASS(CMainFrame), RUNTIME_CLASS(CRenderView)); AddDocTemplate(pDocTemplate); // The main window has been initialized, so show and update it. //pMainFrame->ShowWindow(SW_SHOWMAXIMIZED); pMainFrame->ShowWindow(SW_SHOW); pMainFrame->UpdateWindow();
31
return TRUE; }
// App command to run the dialog void CToolApp::OnAppAbout() { CAboutDlg aboutDlg; aboutDlg.DoModal(); }
6、ToolDoc.cpp #include \#include \#include \
#include \
#ifdef _DEBUG
#define new DEBUG_NEW #undef THIS_FILE
static char THIS_FILE[] = __FILE__; #endif
IMPLEMENT_DYNCREATE(CToolDoc, CDocument)
BEGIN_MESSAGE_MAP(CToolDoc, CDocument) //{{AFX_MSG_MAP(CToolDoc) // NOTE - the ClassWizard will add and remove mapping macros here. // DO NOT EDIT what you see in these blocks of generated code! //}}AFX_MSG_MAP END_MESSAGE_MAP()
extern CToolApp theApp;
// CToolDoc construction/destruction
// Constructor
CToolDoc::CToolDoc() { }
32
// Destructor
CToolDoc::~CToolDoc() { }
BOOL CToolDoc::OnNewDocument() { if (!CDocument::OnNewDocument()) return FALSE; return TRUE; }
// CToolDoc serialization
void CToolDoc::Serialize(CArchive& ar) { if (ar.IsStoring()){} else{} }
///////////////////////////////////////////////////////////////////////////// // CToolDoc diagnostics
#ifdef _DEBUG
void CToolDoc::AssertValid() const { CDocument::AssertValid(); }
void CToolDoc::Dump(CDumpContext& dc) const { CDocument::Dump(dc); }
#endif //_DEBUG 三、实验总结:
通过本次实验,我进一步认识到了OPENGL的强大功能,同时我也认识到学习好《高级计算机图形学》的重要意义,同时在对场景的实现过程中,我更加深刻地理解了各种算法。
33
百度搜索“77cn”或“免费范文网”即可找到本站免费阅读全部范文。收藏本站方便下次阅读,免费范文网,提供经典小说综合文库研究生计算机图形学课程室内场景OpenGL--实验报告(7)在线全文阅读。
相关推荐: