From: fgsfds Date: Sun, 9 Feb 2020 21:44:35 +0000 (+0300) Subject: temp fix headless builds X-Git-Url: http://deadsoftware.ru/gitweb?a=commitdiff_plain;h=2eef851bffd910fba2f9ab4de47dd6e143345287;p=d2df-sdl.git temp fix headless builds --- diff --git a/src/engine/e_graphics.pas b/src/engine/e_graphics.pas index 18f75c4..5b117f0 100644 --- a/src/engine/e_graphics.pas +++ b/src/engine/e_graphics.pas @@ -199,11 +199,13 @@ var e_TextureFonts: array of TTextureFont = nil; e_CharFonts: array of TCharFont; //e_SavedTextures: array of TSavedTexture; +{$IFNDEF HEADLESS} e_FBO: GLuint = 0; e_RBO: GLuint = 0; e_Frame: GLuint = 0; e_FrameW: Integer = -1; e_FrameH: Integer = -1; +{$ENDIF} //function e_getTextGLId (ID: DWORD): GLuint; begin result := e_Textures[ID].tx.id; end; @@ -381,6 +383,9 @@ end; procedure e_ResizeFramebuffer(Width, Height: Integer); begin +{$IFNDEF HEADLESS} + if e_NoGraphics then Exit; + glBindTexture(GL_TEXTURE_2D, 0); glBindRenderbuffer(GL_RENDERBUFFER, 0); glBindFramebuffer(GL_FRAMEBUFFER, 0); @@ -421,6 +426,7 @@ begin glBindFramebuffer(GL_FRAMEBUFFER, e_FBO); glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, e_Frame, 0); glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_STENCIL_ATTACHMENT, GL_RENDERBUFFER, e_RBO); +{$ENDIF} end; procedure e_ResizeWindow(Width, Height: Integer); @@ -453,7 +459,8 @@ end; procedure e_BlitFramebuffer(WinWidth, WinHeight: Integer); begin - if (e_FBO = 0) or (e_Frame = 0) then exit; +{$IFNDEF HEADLESS} + if (e_FBO = 0) or (e_Frame = 0) or e_NoGraphics then exit; glDisable(GL_BLEND); glEnable(GL_TEXTURE_2D); glBindFramebuffer(GL_FRAMEBUFFER, 0); @@ -465,6 +472,7 @@ begin glEnd(); glBindFramebuffer(GL_FRAMEBUFFER, e_FBO); e_SetViewPort(0, 0, e_FrameW, e_FrameH); +{$ENDIF} end; procedure e_Draw(ID: DWORD; X, Y: Integer; Alpha: Byte; AlphaChannel: Boolean;