From: Ketmar Dark Date: Mon, 11 Sep 2017 16:41:16 +0000 (+0300) Subject: added `glFlush()` and `glFinish()` to texture uploader: this should make buggy driver... X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=d5b991e52d4cbc5981cbeca7b337f1086d33afc2;p=d2df-sdl.git added `glFlush()` and `glFinish()` to texture uploader: this should make buggy drivers happier (i hope) --- 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