void COpenGL::updateScreen() { glEnable(GL_TEXTURE_2D); // Set up an array of values to use as the sprite vertices. GLfloat vertices[] = { 0, 0, 1, 0, 1, 1, 0, 1, }; // Set up an array of values for the texture coordinates. GLfloat texcoords[] = { 0, 0, 1, 0, 1, 1, 0, 1, }; //Render the vertices by pointing to the arrays. glEnableClientState(GL_VERTEX_ARRAY); glEnableClientState(GL_TEXTURE_COORD_ARRAY); glVertexPointer(2, GL_FLOAT, 0, vertices); glTexCoordPointer(2, GL_FLOAT, 0, texcoords); glEnable(GL_BLEND); if(m_VidConfig.m_ScaleXFilter > 1) { if(getPerSurfaceAlpha(FXSurface)) SDL_BlitSurface(FXSurface, NULL, BlitSurface, NULL); } loadSurface(m_texture, BlitSurface); renderTexture(m_texture); if(m_VidConfig.m_ScaleXFilter == 1) { if(FXSurface && getPerSurfaceAlpha(FXSurface)) { reloadFX(FXSurface); renderTexture(m_texFX, true); } } glDisableClientState(GL_VERTEX_ARRAY); glDisableClientState(GL_TEXTURE_COORD_ARRAY); glDisable(GL_BLEND); glDisable(GL_TEXTURE_2D); g_pInput->renderOverlay(); SDL_GL_SwapBuffers(); }
void CSDLVideo::collectSurfaces() { SDL_Surface *overlay = mpOverlaySurface.get(); if( getPerSurfaceAlpha(overlay) ) SDL_BlitSurface(overlay, NULL, mpGameSfc.get(), NULL); }
void CPalette::applyFade() { Uint8 current_alpha = getPerSurfaceAlpha(m_fxsurface); if( m_alpha!=current_alpha ) { m_fade_in_progess = true; if( m_alpha>current_alpha ) { if(current_alpha+m_fadespeed>m_alpha) current_alpha = m_alpha; else current_alpha += m_fadespeed; } else if( m_alpha<current_alpha ) { if(current_alpha-m_fadespeed<m_alpha) current_alpha = m_alpha; else current_alpha -= m_fadespeed; } SDL_SetAlpha( m_fxsurface, SDL_SRCALPHA, current_alpha); } else { m_fade_in_progess = false; } }