OpenGLView.cpp
上传用户:kairuinn
上传日期:2009-02-07
资源大小:2922k
文件大小:60k
- // OpenGLView.cpp : implementation file
- //
- #include "stdafx.h"
- #include "..//Solidgraph.h"
- #include "OpenGLView.h"
- #include "..//Drawer.h"
- #include "..//ChildFrm.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- static GLfloat g_fMouseZMult = 0.01f; // Mouse 'Z'-Axis multiplier
- static GLfloat g_fMouseRotateMult = 0.5f; // Mouse 'Rotation' multiplier
- static GLfloat g_fMouseScaleMult = 0.01f; // Mouse 'Scale' multiplier
- #define SEL_BUF_SIZE 65535
- static GLuint hits_buffer[SEL_BUF_SIZE];
- /////////////////////////////////////////////////////////////////////////////
- // COpenGLView
- IMPLEMENT_DYNCREATE(COpenGLView, CView)
- COpenGLView::COpenGLView()
- {
- // OpenGL
- m_hGLContext = NULL;
- m_hDC = NULL;
- m_need_release_DC = false;
- m_background = NULL;
-
- // Colors
- m_ClearColorRed = 1.0f;//0.7f;//191
- m_ClearColorGreen = 1.0f;//0.7f;//191
- m_ClearColorBlue = 1.0f;//0.7f;//191
- m_rezPointColorRed = 1.0f;
- m_rezPointColorGreen = 0.0f;
- m_rezPointColorBlue = 0.0f;
- m_rezLineColorRed = 0.0f;
- m_rezLineColorGreen = 1.0f;
- m_rezLineColorBlue = 0.0f;
- m_rezPointSize = 5.0f;
- m_rezLineWidth = 2.0f;
- m_ScreenLeftButtonDownPoint.x = 0;
- m_ScreenLeftButtonDownPoint.y = 0;
- m_hand_action = HA_ROTATE;
- m_planes = new CPlanes();
- m_transforming_matrix = NULL;
- #ifdef _DEBUG
- m_FPSCounter.SetAveraging(FPS_TIME, 1.0); // 篑疱漤