@@ -288,14 +288,14 @@ void RasterizerCanvasGLES2::_draw_polygon(const int *p_indices, int p_index_coun
288
288
} else {
289
289
glBufferSubData (GL_ARRAY_BUFFER, buffer_ofs, sizeof (Color) * p_vertex_count, p_colors);
290
290
glEnableVertexAttribArray (VS::ARRAY_COLOR);
291
- glVertexAttribPointer (VS::ARRAY_COLOR, 4 , GL_FLOAT, GL_FALSE, sizeof (Color), (( uint8_t *) 0 ) + buffer_ofs);
291
+ glVertexAttribPointer (VS::ARRAY_COLOR, 4 , GL_FLOAT, GL_FALSE, sizeof (Color), CAST_INT_TO_UCHAR_PTR ( buffer_ofs) );
292
292
buffer_ofs += sizeof (Color) * p_vertex_count;
293
293
}
294
294
295
295
if (p_uvs) {
296
296
glBufferSubData (GL_ARRAY_BUFFER, buffer_ofs, sizeof (Vector2) * p_vertex_count, p_uvs);
297
297
glEnableVertexAttribArray (VS::ARRAY_TEX_UV);
298
- glVertexAttribPointer (VS::ARRAY_TEX_UV, 2 , GL_FLOAT, GL_FALSE, sizeof (Vector2), (( uint8_t *) 0 ) + buffer_ofs);
298
+ glVertexAttribPointer (VS::ARRAY_TEX_UV, 2 , GL_FLOAT, GL_FALSE, sizeof (Vector2), CAST_INT_TO_UCHAR_PTR ( buffer_ofs) );
299
299
buffer_ofs += sizeof (Vector2) * p_vertex_count;
300
300
} else {
301
301
glDisableVertexAttribArray (VS::ARRAY_TEX_UV);
@@ -304,12 +304,12 @@ void RasterizerCanvasGLES2::_draw_polygon(const int *p_indices, int p_index_coun
304
304
if (p_weights && p_bones) {
305
305
glBufferSubData (GL_ARRAY_BUFFER, buffer_ofs, sizeof (float ) * 4 * p_vertex_count, p_weights);
306
306
glEnableVertexAttribArray (VS::ARRAY_WEIGHTS);
307
- glVertexAttribPointer (VS::ARRAY_WEIGHTS, 4 , GL_FLOAT, GL_FALSE, sizeof (float ) * 4 , (( uint8_t *) 0 ) + buffer_ofs);
307
+ glVertexAttribPointer (VS::ARRAY_WEIGHTS, 4 , GL_FLOAT, GL_FALSE, sizeof (float ) * 4 , CAST_INT_TO_UCHAR_PTR ( buffer_ofs) );
308
308
buffer_ofs += sizeof (float ) * 4 * p_vertex_count;
309
309
310
310
glBufferSubData (GL_ARRAY_BUFFER, buffer_ofs, sizeof (int ) * 4 * p_vertex_count, p_bones);
311
311
glEnableVertexAttribArray (VS::ARRAY_BONES);
312
- glVertexAttribPointer (VS::ARRAY_BONES, 4 , GL_UNSIGNED_INT, GL_FALSE, sizeof (int ) * 4 , (( uint8_t *) 0 ) + buffer_ofs);
312
+ glVertexAttribPointer (VS::ARRAY_BONES, 4 , GL_UNSIGNED_INT, GL_FALSE, sizeof (int ) * 4 , CAST_INT_TO_UCHAR_PTR ( buffer_ofs) );
313
313
buffer_ofs += sizeof (int ) * 4 * p_vertex_count;
314
314
315
315
} else {
@@ -342,7 +342,7 @@ void RasterizerCanvasGLES2::_draw_generic(GLuint p_primitive, int p_vertex_count
342
342
343
343
glBufferSubData (GL_ARRAY_BUFFER, 0 , sizeof (Vector2) * p_vertex_count, p_vertices);
344
344
glEnableVertexAttribArray (VS::ARRAY_VERTEX);
345
- glVertexAttribPointer (VS::ARRAY_VERTEX, 2 , GL_FLOAT, GL_FALSE, sizeof (Vector2), ( uint8_t *) 0 );
345
+ glVertexAttribPointer (VS::ARRAY_VERTEX, 2 , GL_FLOAT, GL_FALSE, sizeof (Vector2), NULL );
346
346
buffer_ofs += sizeof (Vector2) * p_vertex_count;
347
347
348
348
if (p_singlecolor) {
@@ -355,14 +355,14 @@ void RasterizerCanvasGLES2::_draw_generic(GLuint p_primitive, int p_vertex_count
355
355
} else {
356
356
glBufferSubData (GL_ARRAY_BUFFER, buffer_ofs, sizeof (Color) * p_vertex_count, p_colors);
357
357
glEnableVertexAttribArray (VS::ARRAY_COLOR);
358
- glVertexAttribPointer (VS::ARRAY_COLOR, 4 , GL_FLOAT, GL_FALSE, sizeof (Color), (( uint8_t *) 0 ) + buffer_ofs);
358
+ glVertexAttribPointer (VS::ARRAY_COLOR, 4 , GL_FLOAT, GL_FALSE, sizeof (Color), CAST_INT_TO_UCHAR_PTR ( buffer_ofs) );
359
359
buffer_ofs += sizeof (Color) * p_vertex_count;
360
360
}
361
361
362
362
if (p_uvs) {
363
363
glBufferSubData (GL_ARRAY_BUFFER, buffer_ofs, sizeof (Vector2) * p_vertex_count, p_uvs);
364
364
glEnableVertexAttribArray (VS::ARRAY_TEX_UV);
365
- glVertexAttribPointer (VS::ARRAY_TEX_UV, 2 , GL_FLOAT, GL_FALSE, sizeof (Vector2), (( uint8_t *) 0 ) + buffer_ofs);
365
+ glVertexAttribPointer (VS::ARRAY_TEX_UV, 2 , GL_FLOAT, GL_FALSE, sizeof (Vector2), CAST_INT_TO_UCHAR_PTR ( buffer_ofs) );
366
366
} else {
367
367
glDisableVertexAttribArray (VS::ARRAY_TEX_UV);
368
368
}
@@ -419,12 +419,12 @@ void RasterizerCanvasGLES2::_draw_gui_primitive(int p_points, const Vector2 *p_v
419
419
glVertexAttribPointer (VS::ARRAY_VERTEX, 2 , GL_FLOAT, GL_FALSE, stride * sizeof (float ), NULL );
420
420
421
421
if (p_colors) {
422
- glVertexAttribPointer (VS::ARRAY_COLOR, 4 , GL_FLOAT, GL_FALSE, stride * sizeof (float ), ( uint8_t *) 0 + color_offset * sizeof (float ));
422
+ glVertexAttribPointer (VS::ARRAY_COLOR, 4 , GL_FLOAT, GL_FALSE, stride * sizeof (float ), CAST_INT_TO_UCHAR_PTR ( color_offset * sizeof (float ) ));
423
423
glEnableVertexAttribArray (VS::ARRAY_COLOR);
424
424
}
425
425
426
426
if (p_uvs) {
427
- glVertexAttribPointer (VS::ARRAY_TEX_UV, 2 , GL_FLOAT, GL_FALSE, stride * sizeof (float ), ( uint8_t *) 0 + uv_offset * sizeof (float ));
427
+ glVertexAttribPointer (VS::ARRAY_TEX_UV, 2 , GL_FLOAT, GL_FALSE, stride * sizeof (float ), CAST_INT_TO_UCHAR_PTR ( uv_offset * sizeof (float ) ));
428
428
glEnableVertexAttribArray (VS::ARRAY_TEX_UV);
429
429
}
430
430
@@ -840,7 +840,7 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
840
840
glEnableVertexAttribArray (VS::ARRAY_TEX_UV);
841
841
842
842
glVertexAttribPointer (VS::ARRAY_VERTEX, 2 , GL_FLOAT, GL_FALSE, 4 * sizeof (float ), NULL );
843
- glVertexAttribPointer (VS::ARRAY_TEX_UV, 2 , GL_FLOAT, GL_FALSE, 4 * sizeof (float ), ( uint8_t *) 0 + (sizeof (float ) * 2 ));
843
+ glVertexAttribPointer (VS::ARRAY_TEX_UV, 2 , GL_FLOAT, GL_FALSE, 4 * sizeof (float ), CAST_INT_TO_UCHAR_PTR ( (sizeof (float ) * 2 ) ));
844
844
845
845
glDrawElements (GL_TRIANGLES, 18 * 3 - (np->draw_center ? 0 : 6 ), GL_UNSIGNED_BYTE, NULL );
846
846
@@ -932,7 +932,7 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
932
932
for (int k = 0 ; k < VS::ARRAY_MAX - 1 ; k++) {
933
933
if (s->attribs [k].enabled ) {
934
934
glEnableVertexAttribArray (k);
935
- glVertexAttribPointer (s->attribs [k].index , s->attribs [k].size , s->attribs [k].type , s->attribs [k].normalized , s->attribs [k].stride , ( uint8_t *) 0 + s->attribs [k].offset );
935
+ glVertexAttribPointer (s->attribs [k].index , s->attribs [k].size , s->attribs [k].type , s->attribs [k].normalized , s->attribs [k].stride , CAST_INT_TO_UCHAR_PTR ( s->attribs [k].offset ) );
936
936
} else {
937
937
glDisableVertexAttribArray (k);
938
938
switch (k) {
@@ -1021,7 +1021,7 @@ void RasterizerCanvasGLES2::_canvas_item_render_commands(Item *p_item, Item *cur
1021
1021
for (int k = 0 ; k < VS::ARRAY_MAX - 1 ; k++) {
1022
1022
if (s->attribs [k].enabled ) {
1023
1023
glEnableVertexAttribArray (k);
1024
- glVertexAttribPointer (s->attribs [k].index , s->attribs [k].size , s->attribs [k].type , s->attribs [k].normalized , s->attribs [k].stride , ( uint8_t *) 0 + s->attribs [k].offset );
1024
+ glVertexAttribPointer (s->attribs [k].index , s->attribs [k].size , s->attribs [k].type , s->attribs [k].normalized , s->attribs [k].stride , CAST_INT_TO_UCHAR_PTR ( s->attribs [k].offset ) );
1025
1025
} else {
1026
1026
glDisableVertexAttribArray (k);
1027
1027
switch (k) {
0 commit comments