···4545option(SDL_gpu_DISABLE_GLES_2 "Disable OpenGLES 2.X renderer" OFF)
4646option(SDL_gpu_DISABLE_GLES_3 "Disable OpenGLES 3.X renderer" OFF)
47474848+option(SDL_gpu_USE_SYSTEM_GLEW "Attempt to use the system GLEW library (may not support GL 3+)" OFF)
4949+4850if(APPLE)
4951 if(IOS)
5052 # iOS 8 may need the framework option
···134136 add_definitions("-DSDL_GPU_DISABLE_OPENGL_4")
135137 endif (SDL_gpu_DISABLE_OPENGL_4)
136138137137- # If glew is not found here, we’ll use the bundled version
138138- find_package(GLEW)
139139- if(NOT GLEW_FOUND)
140140- message(" Using bundled version of GLEW")
141141- endif(NOT GLEW_FOUND)
139139+ if(SDL_gpu_USE_SYSTEM_GLEW)
140140+ # If glew is not found here, we’ll use the bundled version
141141+ find_package(GLEW)
142142+ endif()
143143+144144+ if(NOT GLEW_FOUND)
145145+ message(" Using bundled version of GLEW")
146146+ endif(NOT GLEW_FOUND)
142147143148144149 if (NOT SDL_gpu_DISABLE_OPENGL)
+7-3
src/renderer_GL_common.inl
···936936 screen = SDL_SetVideoMode(w, h, 0, SDL_flags);
937937938938 if(screen == NULL)
939939+ {
940940+ GPU_PushErrorCode("GPU_Init", GPU_ERROR_BACKEND_ERROR, "Screen surface creation failed.");
939941 return NULL;
942942+ }
940943#endif
941944942945 renderer->enabled_features = 0xFFFFFFFF; // Pretend to support them all if using incompatible headers
···10361039 window = SDL_GetWindowFromID(windowID);
10371040 if(window == NULL)
10381041 {
10421042+ GPU_PushErrorCode("GPU_CreateTargetFromWindow", GPU_ERROR_BACKEND_ERROR, "Failed to acquire the window from the given ID.");
10391043 if(created)
10401044 {
10411045 SDL_free(cdata->blit_buffer);
···10671071 screen = SDL_GetVideoSurface();
10681072 if(screen == NULL)
10691073 {
10741074+ GPU_PushErrorCode("GPU_CreateTargetFromWindow", GPU_ERROR_BACKEND_ERROR, "Failed to acquire the video surface.");
10701075 if(created)
10711076 {
10721077 SDL_free(cdata->blit_buffer);
···11291134 if (GLEW_OK != err)
11301135 {
11311136 // Probably don't have the right GL version for this renderer
11371137+ GPU_PushErrorCode("GPU_CreateTargetFromWindow", GPU_ERROR_BACKEND_ERROR, "Failed to initialize extensions for renderer %s.", renderer->id.name);
11321138 target->context->failed = 1;
11331139 return NULL;
11341140 }
···11791185 // Did the wrong runtime library try to use a later versioned renderer?
11801186 if(renderer->id.major_version < renderer->requested_id.major_version)
11811187 {
11821182- #ifdef SDL_GPU_USE_GLES
11831183- GPU_PushErrorCode("GPU_CreateTargetFromWindow", GPU_ERROR_BACKEND_ERROR, "Renderer version (%d) is incompatible with the available OpenGL runtime library version (%d).", renderer->requested_id.major_version, renderer->id.major_version);
11841184- #endif
11881188+ GPU_PushErrorCode("GPU_CreateTargetFromWindow", GPU_ERROR_BACKEND_ERROR, "Renderer major version (%d) is incompatible with the available OpenGL runtime library version (%d).", renderer->requested_id.major_version, renderer->id.major_version);
11851189 target->context->failed = 1;
11861190 return NULL;
11871191 }