2#if(!defined(BACKEND_AS_OPENGL_ES) && !defined(ENGINE_CLIENT_BACKEND_OPENGL_BACKEND_OPENGL_H)) || \
3 (defined(BACKEND_AS_OPENGL_ES) && !defined(ENGINE_CLIENT_BACKEND_OPENGL_BACKEND_OPENGL_H_AS_ES))
5#if !defined(BACKEND_AS_OPENGL_ES) && !defined(ENGINE_CLIENT_BACKEND_OPENGL_BACKEND_OPENGL_H)
6#define ENGINE_CLIENT_BACKEND_OPENGL_BACKEND_OPENGL_H
9#if defined(BACKEND_AS_OPENGL_ES) && !defined(ENGINE_CLIENT_BACKEND_OPENGL_BACKEND_OPENGL_H_AS_ES)
10#define ENGINE_CLIENT_BACKEND_OPENGL_BACKEND_OPENGL_H_AS_ES
23#if defined(BACKEND_AS_OPENGL_ES) && defined(CONF_BACKEND_OPENGL_ES3)
24#define BACKEND_GL_MODERN_API 1
34 m_Tex(0),
m_Tex2DArray(0),
m_Sampler(0),
m_Sampler2DArray(0),
m_LastWrapMode(
CCommandBuffer::WRAP_REPEAT),
m_MemSize(0),
m_Width(0),
m_Height(0),
m_RescaleCount(0),
m_ResizeWidth(0),
m_ResizeHeight(0)
87 void TextureUpdate(
int Slot,
int X,
int Y,
int Width,
int Height,
int GLFormat, uint8_t *pTexData);
88 void TextureCreate(
int Slot,
int Width,
int Height,
int GLFormat,
int GLStoreFormat,
int Flags, uint8_t *pTexData);
90 virtual bool Cmd_Init(
const SCommand_Init *pCommand);
139#ifndef BACKEND_AS_OPENGL_ES
158#ifndef BACKEND_GL_MODERN_API
159 bool DoAnalyzeStep(
size_t CheckCount,
size_t VerticesCount, uint8_t aFakeTexture[],
size_t SingleImageSize);
168#ifndef BACKEND_GL_MODERN_API
201#if defined(BACKEND_AS_OPENGL_ES) && defined(CONF_BACKEND_OPENGL_ES3)
202#undef BACKEND_GL_MODERN_API
ERunCommandReturnTypes
Definition: backend_base.h:28
Definition: graphics_threaded.h:16
Definition: backend_base.h:82
Definition: backend_opengl.h:132
CGLSLTileProgram * m_pBorderTileProgramTextured
Definition: backend_opengl.h:192
CGLSLPrimitiveProgram * m_pPrimitive3DProgram
Definition: backend_opengl.h:193
CGLSLTileProgram * m_pBorderTileProgram
Definition: backend_opengl.h:191
std::vector< SBufferContainer > m_vBufferContainers
Definition: backend_opengl.h:137
void Cmd_RenderBorderTile(const CCommandBuffer::SCommand_RenderBorderTile *pCommand) override
Definition: backend_opengl.cpp:1996
void SetState(const CCommandBuffer::SState &State, CGLSLTWProgram *pProgram, bool Use2DArrayTextures=false)
Definition: backend_opengl.cpp:1114
void Cmd_CopyBufferObject(const CCommandBuffer::SCommand_CopyBufferObject *pCommand) override
Definition: backend_opengl.cpp:1906
GL_SVertexTex3D m_aStreamVertices[1024 *4]
Definition: backend_opengl.h:140
void Cmd_RenderTileLayer(const CCommandBuffer::SCommand_RenderTileLayer *pCommand) override
Definition: backend_opengl.cpp:2043
CGLSLPrimitiveProgram * m_pPrimitive3DProgramTextured
Definition: backend_opengl.h:194
bool IsTileMapAnalysisSucceeded()
Definition: backend_opengl.cpp:1361
void Cmd_UpdateBufferContainer(const CCommandBuffer::SCommand_UpdateBufferContainer *pCommand) override
Definition: backend_opengl.cpp:1958
void Cmd_RecreateBufferObject(const CCommandBuffer::SCommand_RecreateBufferObject *pCommand) override
Definition: backend_opengl.cpp:1869
bool DoAnalyzeStep(size_t CheckCount, size_t VerticesCount, uint8_t aFakeTexture[], size_t SingleImageSize)
Definition: backend_opengl.cpp:1262
void Cmd_RenderTex3D(const CCommandBuffer::SCommand_RenderTex3D *pCommand) override
Definition: backend_opengl.cpp:1787
void Cmd_UpdateBufferObject(const CCommandBuffer::SCommand_UpdateBufferObject *pCommand) override
Definition: backend_opengl.cpp:1889
bool Cmd_Init(const SCommand_Init *pCommand) override
Definition: backend_opengl.cpp:1539
void UseProgram(CGLSLTWProgram *pProgram)
Definition: backend_opengl.cpp:1109
CGLSLTileProgram * m_pTileProgram
Definition: backend_opengl.h:189
void Cmd_CreateBufferObject(const CCommandBuffer::SCommand_CreateBufferObject *pCommand) override
Definition: backend_opengl.cpp:1838
void Cmd_IndicesRequiredNumNotify(const CCommandBuffer::SCommand_IndicesRequiredNumNotify *pCommand) override
Definition: backend_opengl.cpp:1992
CGLSLTileProgram * m_pTileProgramTextured
Definition: backend_opengl.h:190
void Cmd_CreateBufferContainer(const CCommandBuffer::SCommand_CreateBufferContainer *pCommand) override
Definition: backend_opengl.cpp:1932
void Cmd_Shutdown(const SCommand_Shutdown *pCommand) override
Definition: backend_opengl.cpp:1776
std::vector< SBufferObject > m_vBufferObjectIndices
Definition: backend_opengl.h:156
void Cmd_DeleteBufferContainer(const CCommandBuffer::SCommand_DeleteBufferContainer *pCommand) override
Definition: backend_opengl.cpp:1973
void Cmd_DeleteBufferObject(const CCommandBuffer::SCommand_DeleteBufferObject *pCommand) override
Definition: backend_opengl.cpp:1921
Definition: backend_opengl.h:198
Definition: backend_opengl.h:29
bool GetPresentedImageData(uint32_t &Width, uint32_t &Height, CImageInfo::EImageFormat &Format, std::vector< uint8_t > &vDstData) override
Definition: backend_opengl.cpp:275
virtual void Cmd_RenderQuadContainerAsSpriteMultiple(const CCommandBuffer::SCommand_RenderQuadContainerAsSpriteMultiple *pCommand)
Definition: backend_opengl.h:122
virtual ~CCommandProcessorFragment_OpenGL()=default
virtual void Cmd_RenderTileLayer(const CCommandBuffer::SCommand_RenderTileLayer *pCommand)
Definition: backend_opengl.h:116
bool m_HasShaders
Definition: backend_opengl.h:67
virtual void Cmd_Texture_Destroy(const CCommandBuffer::SCommand_Texture_Destroy *pCommand)
Definition: backend_opengl.cpp:692
bool m_Has3DTextures
Definition: backend_opengl.h:63
virtual void Cmd_CreateBufferContainer(const CCommandBuffer::SCommand_CreateBufferContainer *pCommand)
Definition: backend_opengl.h:111
virtual void Cmd_DeleteBufferObject(const CCommandBuffer::SCommand_DeleteBufferObject *pCommand)
Definition: backend_opengl.h:109
virtual void Cmd_TextTexture_Update(const CCommandBuffer::SCommand_TextTexture_Update *pCommand)
Definition: backend_opengl.cpp:910
virtual void Cmd_RenderBorderTile(const CCommandBuffer::SCommand_RenderBorderTile *pCommand)
Definition: backend_opengl.h:117
std::atomic< uint64_t > * m_pTextureMemoryUsage
Definition: backend_opengl.h:53
virtual void Cmd_Render(const CCommandBuffer::SCommand_Render *pCommand)
Definition: backend_opengl.cpp:943
virtual void Cmd_Clear(const CCommandBuffer::SCommand_Clear *pCommand)
Definition: backend_opengl.cpp:927
virtual void Cmd_ReadPixel(const CCommandBuffer::SCommand_TrySwapAndReadPixel *pCommand)
Definition: backend_opengl.cpp:974
bool m_Has2DArrayTexturesAsExtension
Definition: backend_opengl.h:61
virtual void Cmd_RenderTex3D(const CCommandBuffer::SCommand_RenderTex3D *pCommand)
Definition: backend_opengl.h:99
virtual void Cmd_CreateBufferObject(const CCommandBuffer::SCommand_CreateBufferObject *pCommand)
Definition: backend_opengl.h:105
bool IsTexturedState(const CCommandBuffer::SState &State)
Definition: backend_opengl.cpp:58
std::vector< CTexture > m_vTextures
Definition: backend_opengl.h:52
ERunCommandReturnTypes RunCommand(const CCommandBuffer::SCommand *pBaseCommand) override
Definition: backend_opengl.cpp:1039
virtual void Cmd_UpdateBufferObject(const CCommandBuffer::SCommand_UpdateBufferObject *pCommand)
Definition: backend_opengl.h:107
virtual void Cmd_TextTextures_Create(const CCommandBuffer::SCommand_TextTextures_Create *pCommand)
Definition: backend_opengl.cpp:921
bool m_Has2DArrayTextures
Definition: backend_opengl.h:60
CCommandProcessorFragment_OpenGL()
Definition: backend_opengl.cpp:1033
bool m_HasMipMaps
Definition: backend_opengl.h:64
virtual void Cmd_RenderQuadContainer(const CCommandBuffer::SCommand_RenderQuadContainer *pCommand)
Definition: backend_opengl.h:120
void TextureUpdate(int Slot, int X, int Y, int Width, int Height, int GLFormat, uint8_t *pTexData)
Definition: backend_opengl.cpp:615
virtual bool IsNewApi()
Definition: backend_opengl.h:80
virtual void Cmd_DeleteBufferContainer(const CCommandBuffer::SCommand_DeleteBufferContainer *pCommand)
Definition: backend_opengl.h:113
TWGLenum m_2DArrayTarget
Definition: backend_opengl.h:62
bool m_IsOpenGLES
Definition: backend_opengl.h:73
virtual bool Cmd_Init(const SCommand_Init *pCommand)
Definition: backend_opengl.cpp:582
bool m_LastClipEnable
Definition: backend_opengl.h:69
virtual void Cmd_RenderQuadLayer(const CCommandBuffer::SCommand_RenderQuadLayer *pCommand)
Definition: backend_opengl.h:118
virtual void Cmd_Update_Viewport(const CCommandBuffer::SCommand_Update_Viewport *pCommand)
Definition: backend_opengl.cpp:36
uint32_t m_CanvasHeight
Definition: backend_opengl.h:56
virtual void Cmd_Shutdown(const SCommand_Shutdown *pCommand)
Definition: backend_opengl.h:91
virtual void Cmd_RenderText(const CCommandBuffer::SCommand_RenderText *pCommand)
Definition: backend_opengl.h:119
void TextureCreate(int Slot, int Width, int Height, int GLFormat, int GLStoreFormat, int Flags, uint8_t *pTexData)
Definition: backend_opengl.cpp:697
bool InitOpenGL(const SCommand_Init *pCommand)
Definition: backend_opengl.cpp:306
virtual void Cmd_RecreateBufferObject(const CCommandBuffer::SCommand_RecreateBufferObject *pCommand)
Definition: backend_opengl.h:106
virtual void Cmd_Screenshot(const CCommandBuffer::SCommand_TrySwapAndScreenshot *pCommand)
Definition: backend_opengl.cpp:993
TWGLint m_MaxTexSize
Definition: backend_opengl.h:58
virtual void Cmd_RenderQuadContainerEx(const CCommandBuffer::SCommand_RenderQuadContainerEx *pCommand)
Definition: backend_opengl.h:121
int m_LastBlendMode
Definition: backend_opengl.h:68
virtual void Cmd_CopyBufferObject(const CCommandBuffer::SCommand_CopyBufferObject *pCommand)
Definition: backend_opengl.h:108
int m_OpenGLTextureLodBIAS
Definition: backend_opengl.h:71
void DestroyTexture(int Slot)
Definition: backend_opengl.cpp:659
virtual void Cmd_UpdateBufferContainer(const CCommandBuffer::SCommand_UpdateBufferContainer *pCommand)
Definition: backend_opengl.h:112
static size_t GLFormatToPixelSize(int GLFormat)
Definition: backend_opengl.cpp:46
void SetState(const CCommandBuffer::SState &State, bool Use2DArrayTexture=false)
Definition: backend_opengl.cpp:63
uint32_t m_CanvasWidth
Definition: backend_opengl.h:55
bool m_HasNPOTTextures
Definition: backend_opengl.h:65
virtual void Cmd_TextTextures_Destroy(const CCommandBuffer::SCommand_TextTextures_Destroy *pCommand)
Definition: backend_opengl.cpp:915
virtual void Cmd_Texture_Create(const CCommandBuffer::SCommand_Texture_Create *pCommand)
Definition: backend_opengl.cpp:905
virtual void Cmd_IndicesRequiredNumNotify(const CCommandBuffer::SCommand_IndicesRequiredNumNotify *pCommand)
Definition: backend_opengl.h:114
Definition: opengl_sl_program.h:98
Definition: opengl_sl_program.h:55
Definition: opengl_sl_program.h:150
EImageFormat
Definition: image.h:18
uint32_t TWGLuint
Definition: graphics_defines.h:7
int32_t TWGLint
Definition: graphics_defines.h:8
uint32_t TWGLenum
Definition: graphics_defines.h:9
#define dbg_assert(test, msg)
Definition: system.h:76
Definition: graphics_threaded.h:212
Definition: graphics_threaded.h:295
Definition: graphics_threaded.h:316
Definition: graphics_threaded.h:254
Definition: graphics_threaded.h:344
Definition: graphics_threaded.h:308
Definition: graphics_threaded.h:353
Definition: graphics_threaded.h:268
Definition: graphics_threaded.h:376
Definition: graphics_threaded.h:448
Definition: graphics_threaded.h:431
Definition: graphics_threaded.h:419
Definition: graphics_threaded.h:390
Definition: graphics_threaded.h:244
Definition: graphics_threaded.h:402
Definition: graphics_threaded.h:361
Definition: graphics_threaded.h:234
Definition: graphics_threaded.h:570
Definition: graphics_threaded.h:544
Definition: graphics_threaded.h:560
Definition: graphics_threaded.h:520
Definition: graphics_threaded.h:535
Definition: graphics_threaded.h:466
Definition: graphics_threaded.h:475
Definition: graphics_threaded.h:330
Definition: graphics_threaded.h:282
Definition: graphics_threaded.h:508
Definition: graphics_threaded.h:185
Definition: graphics_threaded.h:196
Definition: backend_base.h:128
Definition: backend_base.h:167
Definition: backend_opengl.h:134
SBufferContainerInfo m_ContainerInfo
Definition: backend_opengl.h:135
Definition: backend_opengl.h:144
uint8_t * m_pData
Definition: backend_opengl.h:152
size_t m_DataSize
Definition: backend_opengl.h:153
SBufferObject(TWGLuint BufferObjectId)
Definition: backend_opengl.h:145
TWGLuint m_BufferObjectId
Definition: backend_opengl.h:151
Definition: backend_opengl.h:32
CTexture()
Definition: backend_opengl.h:33
TWGLuint m_Sampler
Definition: backend_opengl.h:40
int m_RescaleCount
Definition: backend_opengl.h:48
int m_Width
Definition: backend_opengl.h:46
TWGLuint m_Tex2DArray
Definition: backend_opengl.h:39
TWGLuint m_Sampler2DArray
Definition: backend_opengl.h:41
int m_Height
Definition: backend_opengl.h:47
int m_MemSize
Definition: backend_opengl.h:44
TWGLuint m_Tex
Definition: backend_opengl.h:38
float m_ResizeWidth
Definition: backend_opengl.h:49
int m_LastWrapMode
Definition: backend_opengl.h:42
float m_ResizeHeight
Definition: backend_opengl.h:50
Definition: graphics.h:116
Definition: graphics.h:25