Skip to content

Commit

Permalink
Handled key problem cases
Browse files Browse the repository at this point in the history
  • Loading branch information
medcelerate committed Jul 21, 2024
1 parent d9f783c commit fc1af62
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
9 changes: 7 additions & 2 deletions FFGLTouchEngine/src/TouchEngine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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);
Expand Down Expand Up @@ -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)) {
Expand Down
5 changes: 5 additions & 0 deletions FFGLTouchEngineFX/src/TouchEngineFX.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit fc1af62

Please sign in to comment.