OpenGL: Only enable blending for glyphs
Should improve performance
This commit is contained in:
parent
cf94736cbf
commit
67b3143ed6
1 changed files with 8 additions and 1 deletions
|
@ -199,7 +199,6 @@ BOOL Backend_Init(SDL_Window *p_window)
|
||||||
glEnable(GL_DEBUG_OUTPUT);
|
glEnable(GL_DEBUG_OUTPUT);
|
||||||
glDebugMessageCallback(MessageCallback, 0);
|
glDebugMessageCallback(MessageCallback, 0);
|
||||||
|
|
||||||
glEnable(GL_BLEND);
|
|
||||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||||
|
|
||||||
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
|
@ -269,6 +268,8 @@ void Backend_DrawScreen(void)
|
||||||
{
|
{
|
||||||
glUseProgram(program_texture);
|
glUseProgram(program_texture);
|
||||||
|
|
||||||
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
// Enable texture coordinates, since this uses textures
|
// Enable texture coordinates, since this uses textures
|
||||||
glEnableVertexAttribArray(2);
|
glEnableVertexAttribArray(2);
|
||||||
|
|
||||||
|
@ -377,6 +378,8 @@ static void BlitCommon(Backend_Surface *source_surface, const RECT *rect, Backen
|
||||||
// Switch to colour-key shader if we have to
|
// Switch to colour-key shader if we have to
|
||||||
glUseProgram(colour_key ? program_texture_colour_key : program_texture);
|
glUseProgram(colour_key ? program_texture_colour_key : program_texture);
|
||||||
|
|
||||||
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
// Enable texture coordinates, since this uses textures
|
// Enable texture coordinates, since this uses textures
|
||||||
glEnableVertexAttribArray(2);
|
glEnableVertexAttribArray(2);
|
||||||
|
|
||||||
|
@ -438,6 +441,8 @@ static void ColourFillCommon(Backend_Surface *surface, const RECT *rect, unsigne
|
||||||
|
|
||||||
glUseProgram(program_colour_fill);
|
glUseProgram(program_colour_fill);
|
||||||
|
|
||||||
|
glDisable(GL_BLEND);
|
||||||
|
|
||||||
// Disable texture coordinate array, since this doesn't use textures
|
// Disable texture coordinate array, since this doesn't use textures
|
||||||
glDisableVertexAttribArray(2);
|
glDisableVertexAttribArray(2);
|
||||||
|
|
||||||
|
@ -568,6 +573,8 @@ static void DrawGlyphCommon(Backend_Surface *surface, Backend_Glyph *glyph, long
|
||||||
|
|
||||||
glUseProgram(program_glyph);
|
glUseProgram(program_glyph);
|
||||||
|
|
||||||
|
glEnable(GL_BLEND);
|
||||||
|
|
||||||
// Enable texture coordinates, since this uses textures
|
// Enable texture coordinates, since this uses textures
|
||||||
glEnableVertexAttribArray(2);
|
glEnableVertexAttribArray(2);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue