//----------------------------------------------------------------------------// void OpenGLRenderer::beginRendering() { //save current attributes glPushClientAttrib(GL_CLIENT_ALL_ATTRIB_BITS); glPushAttrib(GL_ALL_ATTRIB_BITS); // save current matrices glMatrixMode(GL_PROJECTION); glPushMatrix(); glMatrixMode(GL_MODELVIEW); glPushMatrix(); // do required set-up. yes, it really is this minimal ;) glEnable(GL_SCISSOR_TEST); glEnable(GL_TEXTURE_2D); glEnable(GL_BLEND); // force set blending ops to get to a known state. setupRenderingBlendMode(BM_NORMAL, true); // enable arrays that we'll be using in the batches glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_COLOR_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glDisableClientState(GL_SECONDARY_COLOR_ARRAY); glDisableClientState(GL_INDEX_ARRAY); glDisableClientState(GL_NORMAL_ARRAY); glDisableClientState(GL_FOG_COORDINATE_ARRAY); glDisableClientState(GL_EDGE_FLAG_ARRAY); // if enabled, restores a subset of the GL state back to default values. if (d_initExtraStates) setupExtraStates(); }
//----------------------------------------------------------------------------// void OpenGL3Renderer::beginRendering() { // do required set-up. yes, it really is this minimal ;) glEnable(GL_SCISSOR_TEST); glEnable(GL_BLEND); // force set blending ops to get to a known state. setupRenderingBlendMode(BM_NORMAL, true); // if enabled, restores a subset of the GL state back to default values. if (d_initExtraStates) setupExtraStates(); d_shaderStandard->bind(); d_openGLStateChanger->reset(); }