···77#include <math.h>
88#include <string.h>
991010+// Check for C99 support
1111+// We'll use it for intptr_t which is used to suppress warnings about converting an int to a ptr for GL calls.
1212+#if __STDC_VERSION__ >= 199901L
1313+ #include <stdint.h>
1414+#else
1515+ #define intptr_t long
1616+#endif
1717+1018#include "stb_image.h"
1119#include "stb_image_write.h"
1220···12701278 const char* untextured_fragment_shader_source = GPU_DEFAULT_UNTEXTURED_FRAGMENT_SHADER_SOURCE;
1271127912721280 #ifdef SDL_GPU_ENABLE_CORE_SHADERS
12731273- if(renderer->id.major_version == 3 && renderer->id.minor_version >= 2)
12811281+ // Use core shaders only when supported by the actual context we got
12821282+ if(renderer->id.major_version > 3 || (renderer->id.major_version == 3 && renderer->id.minor_version >= 2))
12741283 {
12751284 textured_vertex_shader_source = GPU_DEFAULT_TEXTURED_VERTEX_SHADER_SOURCE_CORE;
12761285 textured_fragment_shader_source = GPU_DEFAULT_TEXTURED_FRAGMENT_SHADER_SOURCE_CORE;
···40704079 glBufferData(GL_ARRAY_BUFFER, bytes_used, a->next_value, GL_STREAM_DRAW);
4071408040724081 glEnableVertexAttribArray(a->attribute.location);
40734073- 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);
40824082+ 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);
4074408340754084 a->enabled = 1;
40764085 // Move the data along so we use the next values for the next flush