diff --git a/jni/love/src/libraries/glad/glad.hpp b/jni/love/src/libraries/glad/glad.hpp index 3914de5e..2608bc86 100644 --- a/jni/love/src/libraries/glad/glad.hpp +++ b/jni/love/src/libraries/glad/glad.hpp @@ -143,10 +143,10 @@ typedef uint64_t GLuint64EXT; typedef struct __GLsync *GLsync; struct _cl_context; struct _cl_event; -typedef void ( *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void ( *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void ( *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); -typedef void ( *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); +typedef void (APIENTRY *GLDEBUGPROC)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id,GLenum category,GLenum severity,GLsizei length,const GLchar *message,void *userParam); typedef unsigned short GLhalfNV; typedef GLintptr GLvdpauSurfaceNV; diff --git a/jni/love/src/modules/graphics/opengl/Image.cpp b/jni/love/src/modules/graphics/opengl/Image.cpp index 23f7a9a3..8642bc24 100644 --- a/jni/love/src/modules/graphics/opengl/Image.cpp +++ b/jni/love/src/modules/graphics/opengl/Image.cpp @@ -460,14 +460,19 @@ void Image::uploadTexturePadded() } else if (data.get()) { + GLenum xformat = GL_RGBA; GLenum iformat = (format == FORMAT_SRGB) ? GL_SRGB_ALPHA : GL_RGBA; + + if (GLAD_ES_VERSION_2_0 && !GLAD_ES_VERSION_3_0) + xformat = iformat; + glTexImage2D(GL_TEXTURE_2D, 0, iformat, (GLsizei)paddedWidth, (GLsizei)paddedHeight, 0, - GL_RGBA, + xformat, GL_UNSIGNED_BYTE, 0); @@ -476,7 +481,7 @@ void Image::uploadTexturePadded() 0, 0, (GLsizei)width, (GLsizei)height, - GL_RGBA, + xformat, GL_UNSIGNED_BYTE, data->getData()); } @@ -498,14 +503,20 @@ void Image::uploadTexture() } else if (data.get()) { + GLenum xformat = GL_RGBA; GLenum iformat = (format == FORMAT_SRGB) ? GL_SRGB_ALPHA : GL_RGBA; + + // The internal and external format parameters must match in OpenGL ES 2. + if (GLAD_ES_VERSION_2_0 && !GLAD_ES_VERSION_3_0) + xformat = iformat; + glTexImage2D(GL_TEXTURE_2D, 0, iformat, (GLsizei)width, (GLsizei)height, 0, - GL_RGBA, + xformat, GL_UNSIGNED_BYTE, data->getData()); } diff --git a/jni/love/src/modules/graphics/opengl/ParticleSystem.cpp b/jni/love/src/modules/graphics/opengl/ParticleSystem.cpp index 24d37d1b..8986b90f 100644 --- a/jni/love/src/modules/graphics/opengl/ParticleSystem.cpp +++ b/jni/love/src/modules/graphics/opengl/ParticleSystem.cpp @@ -113,6 +113,7 @@ ParticleSystem::ParticleSystem(const ParticleSystem &p) , pHead(nullptr) , pTail(nullptr) , particleVerts(nullptr) + , ibo(nullptr) , texture(p.texture) , active(p.active) , insertMode(p.insertMode)