最近看到一个源码,可以读取obj格式模型,显示模型;显示的模型如上一篇博文;
它在视类窗口创建的时候,执行如下的一些,
int CRenderView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{if (CView::OnCreate(lpCreateStruct) == -1)return -1;HWND hWnd = GetSafeHwnd();HDC hDC = ::GetDC(hWnd);if(SetWindowPixelFormat(hDC)==FALSE)return 0;if(CreateViewGLContext(hDC)==FALSE)return 0;// Default mode//glPolygonMode(GL_FRONT,GL_LINE);glPolygonMode(GL_BACK,GL_LINE);//glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);//glPolygonMode(GL_FRONT_AND_BACK,GL_POINT);glShadeModel(GL_FLAT);glEnable(GL_NORMALIZE);// Lights, material propertiesGLfloat ambientProperties[] = {0.5f, 0.5f, 0.5f, 1.0f};GLfloat diffuseProper