summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e452d33)
raw | patch | inline | side by side (parent: e452d33)
author | fgsfds <pvt.fgsfds@gmail.com> | |
Sun, 9 Feb 2020 21:44:35 +0000 (00:44 +0300) | ||
committer | fgsfds <pvt.fgsfds@gmail.com> | |
Mon, 10 Feb 2020 17:19:50 +0000 (20:19 +0300) |
src/engine/e_graphics.pas | patch | blob | history |
index 18f75c44ea3263119bd6bfbb429a614c05060e09..5b117f0433010d0a438ab68d0db3104282711971 100644 (file)
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;
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);
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);
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);
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;