diff --git a/FFGLTouchEngine/src/TouchEngine.cpp b/FFGLTouchEngine/src/TouchEngine.cpp index 2986735..2e85d9a 100644 --- a/FFGLTouchEngine/src/TouchEngine.cpp +++ b/FFGLTouchEngine/src/TouchEngine.cpp @@ -1110,7 +1110,7 @@ void FFGLTouchEngine::ClearTouchInstance() { return; } -void FFGLTouchEngine::InitializeGlTexture(GLuint& texture, uint16_t width, uint16_t height) +void FFGLTouchEngine::InitializeGlTexture(GLuint& texture, uint16_t width, uint16_t height, GLenum format) { if (texture != 0) { glDeleteTextures(1, &texture); @@ -1119,7 +1119,7 @@ void FFGLTouchEngine::InitializeGlTexture(GLuint& texture, uint16_t width, uint1 glGenTextures(1, &texture); glBindTexture(GL_TEXTURE_2D, texture); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, format, NULL); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); @@ -1159,6 +1159,11 @@ void FFGLTouchEngine::eventCallback(TEEvent event, TEResult result, int64_t star // The TouchEngine has encountered an error // You can get the error message with TEInstanceGetError } + + if (result == TEResultNoKey || result == TEResultKeyError || result == TEResultExpiredKey) { + FFGLLog::LogToHost("TouchEngine License Error"); + return; + } switch (event) { case TEEventInstanceDidLoad: if (LoadTEGraphicsContext(false)) { diff --git a/FFGLTouchEngineFX/src/TouchEngineFX.cpp b/FFGLTouchEngineFX/src/TouchEngineFX.cpp index 39c8fda..db4b31c 100644 --- a/FFGLTouchEngineFX/src/TouchEngineFX.cpp +++ b/FFGLTouchEngineFX/src/TouchEngineFX.cpp @@ -1403,6 +1403,11 @@ void FFGLTouchEngineFX::eventCallback(TEEvent event, TEResult result, int64_t st // The TouchEngine has encountered an error // You can get the error message with TEInstanceGetError } + + if (result == TEResultNoKey || result == TEResultKeyError || result == TEResultExpiredKey) { + FFGLLog::LogToHost("TouchEngine License Error"); + return; + } switch (event) { case TEEventInstanceDidLoad: if (LoadTEGraphicsContext(false)) {