MGLContext::MGLContext(void): m_currentFrameBuffer(0) { // version const char * version = (const char *)glGetString(GL_VERSION); if(version) { sscanf(version, "%d", &g_GLversion); printf("GL_VERSION : %s\n", version); } // init cull face (back) enableCullFace(); setCullMode(M_CULL_BACK); // normalize glEnable(GL_NORMALIZE); // fog glHint(GL_FOG_HINT, GL_NICEST); glFogf(GL_FOG_MODE, GL_LINEAR); // depth enableDepthTest(); setDepthMode(M_DEPTH_LEQUAL); glClearDepth(1.0f); // line glLineWidth(1); // stencil glClearStencil(0); // pixel pack/unpack glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_PACK_ALIGNMENT, 1); // anisotropic filtering glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy); }
MES2Context::MES2Context(void): m_currentFrameBuffer(0) { m_matrixStep = 0; m_matrixMode = M_MATRIX_MODELVIEW; // version const char * version = (const char *)glGetString(GL_VERSION); if(version) { m_gl_version=version; sscanf(version, "%d", &g_GLversion); } // init cull face (back) enableCullFace(); setCullMode(M_CULL_BACK); // depth enableDepthTest(); setDepthMode(M_DEPTH_LEQUAL); glClearDepthf(1.0f); // line glLineWidth(1); // stencil glClearStencil(0); // pixel pack/unpack glPixelStorei(GL_UNPACK_ALIGNMENT, 1); glPixelStorei(GL_PACK_ALIGNMENT, 1); // anisotropic filtering glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maxAnisotropy); }