예제 #1
0
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);
}
예제 #2
0
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);
}