aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/media/UVideo.pas7
-rw-r--r--src/menu/UDisplay.pas8
2 files changed, 11 insertions, 4 deletions
diff --git a/src/media/UVideo.pas b/src/media/UVideo.pas
index 0716bee2..c7d59fc8 100644
--- a/src/media/UVideo.pas
+++ b/src/media/UVideo.pas
@@ -824,8 +824,8 @@ begin
// Or should we add padding with avpicture_fill? (check which one is faster)
//glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
- // TODO: check if this is faster
- //glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
+ // glTexEnvi with GL_REPLACE might give a small speed improvement
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
if (not fPboEnabled) then
begin
@@ -867,6 +867,9 @@ begin
Log.LogError('PBO texture stream error: ' + gluErrorString(glErr), 'TVideo_FFmpeg.GetFrame');
end;
+ // reset to default
+ glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
+
if (not fFrameTexValid) then
fFrameTexValid := true;
diff --git a/src/menu/UDisplay.pas b/src/menu/UDisplay.pas
index 0b32c6cd..e3ec272a 100644
--- a/src/menu/UDisplay.pas
+++ b/src/menu/UDisplay.pas
@@ -204,10 +204,9 @@ begin
for i := 0 to 1 do
begin
glBindTexture(GL_TEXTURE_2D, FadeTex[i]);
- //glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
- glTexImage2D(GL_TEXTURE_2D, 0, 3, TexW, TexH, 0, GL_RGB, GL_UNSIGNED_BYTE, nil);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexImage2D(GL_TEXTURE_2D, 0, 3, TexW, TexH, 0, GL_RGB, GL_UNSIGNED_BYTE, nil);
end;
end;
@@ -366,6 +365,8 @@ begin
FadeH := ScreenH/TexH;
glBindTexture(GL_TEXTURE_2D, FadeTex[S-1]);
+ // TODO: check if glTexEnvi() gives any speed improvement
+ //glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE);
glColor4f(1, 1, 1, 1-FadeStateSquare);
glEnable(GL_TEXTURE_2D);
@@ -386,6 +387,9 @@ begin
glEnd;
glDisable(GL_BLEND);
glDisable(GL_TEXTURE_2D);
+
+ // reset to default
+ //glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE);
end;
end