this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'master' of https://github.com/grimfang4/sdl-gpu

+17 -8
+10 -5
CMakeLists.txt
··· 45 45 option(SDL_gpu_DISABLE_GLES_2 "Disable OpenGLES 2.X renderer" OFF) 46 46 option(SDL_gpu_DISABLE_GLES_3 "Disable OpenGLES 3.X renderer" OFF) 47 47 48 + option(SDL_gpu_USE_SYSTEM_GLEW "Attempt to use the system GLEW library (may not support GL 3+)" OFF) 49 + 48 50 if(APPLE) 49 51 if(IOS) 50 52 # iOS 8 may need the framework option ··· 134 136 add_definitions("-DSDL_GPU_DISABLE_OPENGL_4") 135 137 endif (SDL_gpu_DISABLE_OPENGL_4) 136 138 137 - # If glew is not found here, we’ll use the bundled version 138 - find_package(GLEW) 139 - if(NOT GLEW_FOUND) 140 - message(" Using bundled version of GLEW") 141 - endif(NOT GLEW_FOUND) 139 + if(SDL_gpu_USE_SYSTEM_GLEW) 140 + # If glew is not found here, we’ll use the bundled version 141 + find_package(GLEW) 142 + endif() 143 + 144 + if(NOT GLEW_FOUND) 145 + message(" Using bundled version of GLEW") 146 + endif(NOT GLEW_FOUND) 142 147 143 148 144 149 if (NOT SDL_gpu_DISABLE_OPENGL)
+7 -3
src/renderer_GL_common.inl
··· 936 936 screen = SDL_SetVideoMode(w, h, 0, SDL_flags); 937 937 938 938 if(screen == NULL) 939 + { 940 + GPU_PushErrorCode("GPU_Init", GPU_ERROR_BACKEND_ERROR, "Screen surface creation failed."); 939 941 return NULL; 942 + } 940 943 #endif 941 944 942 945 renderer->enabled_features = 0xFFFFFFFF; // Pretend to support them all if using incompatible headers ··· 1036 1039 window = SDL_GetWindowFromID(windowID); 1037 1040 if(window == NULL) 1038 1041 { 1042 + GPU_PushErrorCode("GPU_CreateTargetFromWindow", GPU_ERROR_BACKEND_ERROR, "Failed to acquire the window from the given ID."); 1039 1043 if(created) 1040 1044 { 1041 1045 SDL_free(cdata->blit_buffer); ··· 1067 1071 screen = SDL_GetVideoSurface(); 1068 1072 if(screen == NULL) 1069 1073 { 1074 + GPU_PushErrorCode("GPU_CreateTargetFromWindow", GPU_ERROR_BACKEND_ERROR, "Failed to acquire the video surface."); 1070 1075 if(created) 1071 1076 { 1072 1077 SDL_free(cdata->blit_buffer); ··· 1129 1134 if (GLEW_OK != err) 1130 1135 { 1131 1136 // Probably don't have the right GL version for this renderer 1137 + GPU_PushErrorCode("GPU_CreateTargetFromWindow", GPU_ERROR_BACKEND_ERROR, "Failed to initialize extensions for renderer %s.", renderer->id.name); 1132 1138 target->context->failed = 1; 1133 1139 return NULL; 1134 1140 } ··· 1179 1185 // Did the wrong runtime library try to use a later versioned renderer? 1180 1186 if(renderer->id.major_version < renderer->requested_id.major_version) 1181 1187 { 1182 - #ifdef SDL_GPU_USE_GLES 1183 - 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); 1184 - #endif 1188 + 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); 1185 1189 target->context->failed = 1; 1186 1190 return NULL; 1187 1191 }