A fast 2D and 3D game engine — TypeScript SDK, C++/WebAssembly core, visual editor. Ship one project to web, desktop, WeChat MiniGames, playable ads, and native Android / iOS.
TypeScript 2d-game-engine3d3d-game-engineandroidcppecsgame-editorgame-enginegamedeviostypescriptwebassemblywebglwebgpuwechat-minigame
fix: editor type-check error and Linux GCC build failures
esengineb90cf9069077
diff --git a/src/esengine/renderer/OpenGLHeaders.hpp b/src/esengine/renderer/OpenGLHeaders.hppindex 558c80b1b..4a7b745d1 100644--- a/src/esengine/renderer/OpenGLHeaders.hpp+++ b/src/esengine/renderer/OpenGLHeaders.hpp@@ -29,10 +29,25 @@#include <glad/glad.h>#endif-// GL error codes not present in all headers+// GL constants not present in all headers / glad configurations#ifndef GL_CONTEXT_LOST#define GL_CONTEXT_LOST 0x0507#endif#ifndef GL_CONTEXT_LOST_WEBGL#define GL_CONTEXT_LOST_WEBGL 0x9242#endif+#ifndef GL_INCR+ #define GL_INCR 0x1E02+#endif+#ifndef GL_DECR+ #define GL_DECR 0x1E03+#endif+#ifndef GL_INVERT+ #define GL_INVERT 0x150A+#endif+#ifndef GL_INCR_WRAP+ #define GL_INCR_WRAP 0x8507+#endif+#ifndef GL_DECR_WRAP+ #define GL_DECR_WRAP 0x8508+#endifdiff --git a/src/esengine/renderer/plugins/SpritePlugin.cpp b/src/esengine/renderer/plugins/SpritePlugin.cppindex 25233f0c3..c82ed78ce 100644--- a/src/esengine/renderer/plugins/SpritePlugin.cpp+++ b/src/esengine/renderer/plugins/SpritePlugin.cpp@@ -329,13 +329,13 @@ void SpritePlugin::emitTiledQuads(i32 tilesX = static_cast<i32>(std::ceil(absSize.x / step.x));for (i32 iy = 0; iy < tilesY; ++iy) {- f32 ty = iy * step.y;+ f32 ty = static_cast<f32>(iy) * step.y;f32 th = glm::min(tileSize.y, absSize.y - ty);if (th <= 0.0f) break;f32 vFrac = th / tileSize.y;for (i32 ix = 0; ix < tilesX; ++ix) {- f32 tx = ix * step.x;+ f32 tx = static_cast<f32>(ix) * step.x;f32 tw = glm::min(tileSize.x, absSize.x - tx);if (tw <= 0.0f) break;f32 uFrac = tw / tileSize.x;diff --git a/third_party/glad/include/glad/glad.h b/third_party/glad/include/glad/glad.hindex 94d1fb491..c9b7cb893 100644--- a/third_party/glad/include/glad/glad.h+++ b/third_party/glad/include/glad/glad.h@@ -600,6 +600,17 @@ int gladLoadGLLoader(GLADloadproc load);*/int gladLoaderInitialized(void);+/* Instancing (GL 3.1+ / GL_ARB_instanced_arrays) */+#ifndef GL_VERTEX_ATTRIB_ARRAY_DIVISOR+#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE+#endif+typedef void (APIENTRYP PFNGLVERTEXATTRIBDIVISORPROC)(GLuint index, GLuint divisor);+typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDPROC)(GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount);+extern PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor;+extern PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced;+#define glVertexAttribDivisor glad_glVertexAttribDivisor+#define glDrawElementsInstanced glad_glDrawElementsInstanced+#ifdef __cplusplus}#endifdiff --git a/third_party/glad/src/glad.c b/third_party/glad/src/glad.cindex 6b9696f05..a5f68671c 100644--- a/third_party/glad/src/glad.c+++ b/third_party/glad/src/glad.c@@ -125,6 +125,10 @@ PFNGLRENDERBUFFERSTORAGEPROC glad_glRenderbufferStorage = NULL;PFNGLFRAMEBUFFERRENDERBUFFERPROC glad_glFramebufferRenderbuffer = NULL;PFNGLBLITFRAMEBUFFERPROC glad_glBlitFramebuffer = NULL;+/* Instancing */+PFNGLVERTEXATTRIBDIVISORPROC glad_glVertexAttribDivisor = NULL;+PFNGLDRAWELEMENTSINSTANCEDPROC glad_glDrawElementsInstanced = NULL;+/* =============================================================================* Loader Implementation* =========================================================================== */@@ -242,6 +246,10 @@ int gladLoadGLLoader(GLADloadproc load) {glad_glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)load("glFramebufferRenderbuffer");glad_glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)load("glBlitFramebuffer");+ /* Instancing (GL 3.1+) */+ glad_glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)load("glVertexAttribDivisor");+ glad_glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)load("glDrawElementsInstanced");+/* Check critical functions */if (glad_glClear == NULL || glad_glViewport == NULL || glad_glGetString == NULL) {return 0;