this repo has no description
0
fork

Configure Feed

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

Fixed version checks for core GL 3 shaders. Removed warning in C99 for int to ptr conversion.

+11 -2
+11 -2
src/renderer_GL_common.inl
··· 7 7 #include <math.h> 8 8 #include <string.h> 9 9 10 + // Check for C99 support 11 + // We'll use it for intptr_t which is used to suppress warnings about converting an int to a ptr for GL calls. 12 + #if __STDC_VERSION__ >= 199901L 13 + #include <stdint.h> 14 + #else 15 + #define intptr_t long 16 + #endif 17 + 10 18 #include "stb_image.h" 11 19 #include "stb_image_write.h" 12 20 ··· 1270 1278 const char* untextured_fragment_shader_source = GPU_DEFAULT_UNTEXTURED_FRAGMENT_SHADER_SOURCE; 1271 1279 1272 1280 #ifdef SDL_GPU_ENABLE_CORE_SHADERS 1273 - if(renderer->id.major_version == 3 && renderer->id.minor_version >= 2) 1281 + // Use core shaders only when supported by the actual context we got 1282 + if(renderer->id.major_version > 3 || (renderer->id.major_version == 3 && renderer->id.minor_version >= 2)) 1274 1283 { 1275 1284 textured_vertex_shader_source = GPU_DEFAULT_TEXTURED_VERTEX_SHADER_SOURCE_CORE; 1276 1285 textured_fragment_shader_source = GPU_DEFAULT_TEXTURED_FRAGMENT_SHADER_SOURCE_CORE; ··· 4070 4079 glBufferData(GL_ARRAY_BUFFER, bytes_used, a->next_value, GL_STREAM_DRAW); 4071 4080 4072 4081 glEnableVertexAttribArray(a->attribute.location); 4073 - glVertexAttribPointer(a->attribute.location, a->attribute.format.num_elems_per_value, a->attribute.format.type, a->attribute.format.normalize, a->per_vertex_storage_stride_bytes, (void*)(long)a->per_vertex_storage_offset_bytes); 4082 + glVertexAttribPointer(a->attribute.location, a->attribute.format.num_elems_per_value, a->attribute.format.type, a->attribute.format.normalize, a->per_vertex_storage_stride_bytes, (void*)(intptr_t)a->per_vertex_storage_offset_bytes); 4074 4083 4075 4084 a->enabled = 1; 4076 4085 // Move the data along so we use the next values for the next flush