From d5b991e52d4cbc5981cbeca7b337f1086d33afc2 Mon Sep 17 00:00:00 2001 From: Ketmar Dark Date: Mon, 11 Sep 2017 19:41:16 +0300 Subject: [PATCH] added `glFlush()` and `glFinish()` to texture uploader: this should make buggy drivers happier (i hope) --- src/engine/e_texture.pas | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/engine/e_texture.pas b/src/engine/e_texture.pas index c0e6f99..62ace83 100644 --- a/src/engine/e_texture.pas +++ b/src/engine/e_texture.pas @@ -162,6 +162,10 @@ begin glBindTexture(GL_TEXTURE_2D, 0); + // so driver will really upload the texture (this is *sometimes* required for buggy videodrivers) + glFlush(); + glFinish(); + Result := true; end; @@ -192,7 +196,7 @@ begin imageSize := Width*Height*4; GetMem(image, imageSize); try - // it's slow, but i don't care for now + // it is slow, but i don't care for now ii := image; for y := height-1 downto 0 do begin @@ -274,7 +278,7 @@ begin imageSize := img.width*img.height*4; GetMem(image, imageSize); try - // it's slow, but i don't care for now + // it is slow, but i don't care for now ii := image; for y := fY+fHeight-1 downto fY do begin -- 2.29.2