【vc++精品源码栏目提醒】:文章导读:在新的一年中,各位网友都进入紧张的学习或是工作阶段。
网学会员整理了vc++精品源码-【精品】计算机图形学 MFC VC++6.0制作的简单时钟源代码 - 其它资料的相关内容供大家参考,祝大家在新的一年里工作和学习顺利!
计算机图形学 MFC VC6.0 制作的简单时钟// MFCFrame1View.cpp : implementation of the CMFCFrame1View class//include stdafx.hinclude MFCFrame1.hinclude MFCFrame1Doc.hinclude MFCFrame1View.hinclude PointDialog.hinclude math.hGLUquadricObj objCylinder gluNewQuadricifdef _DEBUGdefine new DEBUG_NEWundef THIS_FILEstatic char THIS_FILE __FILE__endif/////////////////////////////////////////////////////////////////////////////// CMFCFrame1ViewIMPLEMENT_DYNCREATECMFCFrame1View CViewBEGIN_MESSAGE_MAPCMFCFrame1View CView //AFX_MSG_MAPCMFCFrame1View ON_WM_CREATE ON_WM_DESTROY ON_WM_SIZE ON_COMMANDIDM_ZIXUAN OnZixuan ON_WM_TIMER ON_COMMANDIDM_ChangDirect OnChangDirect //AFX_MSG_MAP // Standard printing commands ON_COMMANDID_FILE_PRINT CView::OnFilePrint ON_COMMANDID_FILE_PRINT_DIRECT CView::OnFilePrint ON_COMMANDID_FILE_PRINT_PREVIEW CView::OnFilePrintPreviewEND_MESSAGE_MAP/////////////////////////////////////////////////////////////////////////////// CMFCFrame1View construction/destructionCMFCFrame1View::CMFCFrame1View // TODO: add construction code here this-m_GLPixelIndex 0 this-m_hGLContext NULL Angle10.0 Angle230.0 Timer0 x0.0 z0.0 juli40.0CMFCFrame1View::CMFCFrame1ViewBOOL CMFCFrame1View::PreCreateWindowCREATESTRUCT cs // TODO: Modify the Window class or styles here by modifying // the CREATESTRUCT cs cs.style WS_CLIPCHILDREN WS_CLIPSIBLINGS return CView::PreCreateWindowcs/////////////////////////////////////////////////////////////////////////////// CMFCFrame1View drawing/////////////////////////////////////////////////////////////////////////////// CMFCFrame1View printingBOOL CMFCFrame1View::OnPreparePrintingCPrintInfo pInfo // default preparation return DoPreparePrintingpInfovoid CMFCFrame1View::OnBeginPrintingCDC /pDC/ CPrintInfo /pInfo/ // TODO: add extra initialization before printingvoid CMFCFrame1View::OnEndPrintingCDC /pDC/ CPrintInfo /pInfo/ // TODO: add cleanup after printing/////////////////////////////////////////////////////////////////////////////// CMFCFrame1View diagnosticsifdef _DEBUGvoid CMFCFrame1View::AssertValid const CView::AssertValidvoid CMFCFrame1View::DumpCDumpContext dc const CView::DumpdcCMFCFrame1Doc CMFCFrame1View::GetDocument // non-debug version is inline ASSERTm_pDocument-IsKindOfRUNTIME_CLASSCMFCFrame1Doc return CMFCFrame1Docm_pDocumentendif //_DEBUG/////////////////////////////////////////////////////////////////////////////// CMFCFrame1View message handlersBOOL CMFCFrame1View::SetWindowPixelFormatHDC hDC PIXELFORMATDESCRIPTOR pixelDesc sizeofPIXELFORMATDESCRIPTOR 1 PFD_DRAW_TO_WINDOWPFD_SUPPORT_OPENGL PFD_DOUBLEBUFFERPFD_SUPPORT_GDI PFD_TYPE_RGBA 24 000000 0 0 0 0000 32 0 0 PFD_MAIN_PLANE 0 000 this-m_GLPixelIndex ChoosePixelFormathDCpixelDesc ifthis-m_GLPixelIndex0 this-m_GLPixelIndex 1ifDescribePixelFormathDCthis-m_GLPixelIndexsizeofPIXELFORMATDESCRIPTORpixelDesc0 return FALSE ifSetPixelFormathDCthis-m_GLPixelIndexpixelDescFALSE return FALSE return TRUEint CMFCFrame1View::OnCreateLPCREATESTRUCT lpCreateStruct if CView::OnCreatelpCreateStruct -1 ret