void Context::initContext() { // Here we go. From the top. Where is glResetState? oglDisable(GL_ALPHA_TEST); oglDisable(GL_AUTO_NORMAL); oglEnable(GL_BLEND); // Skip clip planes, there are thousands of them. oglDisable(GL_COLOR_LOGIC_OP); oglDisable(GL_COLOR_MATERIAL); oglDisable(GL_COLOR_TABLE); oglDisable(GL_CONVOLUTION_1D); oglDisable(GL_CONVOLUTION_2D); oglDisable(GL_CULL_FACE); oglDisable(GL_DEPTH_TEST); oglDisable(GL_DITHER); oglDisable(GL_FOG); oglDisable(GL_HISTOGRAM); oglDisable(GL_INDEX_LOGIC_OP); oglDisable(GL_LIGHTING); // Skip line smmooth // Skip map oglDisable(GL_MINMAX); // Skip polygon offset oglDisable(GL_SEPARABLE_2D); oglDisable(GL_SCISSOR_TEST); oglDisable(GL_STENCIL_TEST); oglEnable(GL_TEXTURE_2D); oglDisable(GL_TEXTURE_GEN_Q); oglDisable(GL_TEXTURE_GEN_R); oglDisable(GL_TEXTURE_GEN_S); oglDisable(GL_TEXTURE_GEN_T); oglBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); }
Context::Context(HDC hdc) { timeT = clock(); frameCount = 0; ctx = owglCreateContext(hdc); owglMakeCurrent(hdc, ctx); // Here we go. From the top. Where is glResetState? oglDisable(GL_ALPHA_TEST); oglDisable(GL_AUTO_NORMAL); oglEnable(GL_BLEND); // Skip clip planes, there are thousands of them. oglDisable(GL_COLOR_LOGIC_OP); oglDisable(GL_COLOR_MATERIAL); oglDisable(GL_COLOR_TABLE); oglDisable(GL_CONVOLUTION_1D); oglDisable(GL_CONVOLUTION_2D); oglDisable(GL_CULL_FACE); oglDisable(GL_DEPTH_TEST); oglDisable(GL_DITHER); oglDisable(GL_FOG); oglDisable(GL_HISTOGRAM); oglDisable(GL_INDEX_LOGIC_OP); oglDisable(GL_LIGHTING); // Skip line smmooth // Skip map oglDisable(GL_MINMAX); // Skip polygon offset oglDisable(GL_SEPARABLE_2D); oglDisable(GL_SCISSOR_TEST); oglDisable(GL_STENCIL_TEST); oglEnable(GL_TEXTURE_2D); oglDisable(GL_TEXTURE_GEN_Q); oglDisable(GL_TEXTURE_GEN_R); oglDisable(GL_TEXTURE_GEN_S); oglDisable(GL_TEXTURE_GEN_T); oglBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA); texture = ~0; }