@@ -589,6 +589,7 @@ static SDL_RenderCommand *PrepQueueCmdDraw(SDL_Renderer *renderer, const SDL_Ren
589
589
if (renderer -> gpu_render_state ) {
590
590
renderer -> gpu_render_state -> last_command_generation = renderer -> render_command_generation ;
591
591
}
592
+ cmd -> data .draw .tentatively_named_rendergeometry_position_coordinate_count = 2 ;
592
593
}
593
594
}
594
595
return cmd ;
@@ -722,7 +723,7 @@ static bool QueueCmdCopyEx(SDL_Renderer *renderer, SDL_Texture *texture,
722
723
}
723
724
724
725
static bool QueueCmdGeometry (SDL_Renderer * renderer , SDL_Texture * texture ,
725
- const float * xy , int xy_stride ,
726
+ const float * pos , int pos_stride , Uint8 pos_len ,
726
727
const SDL_FColor * color , int color_stride ,
727
728
const float * uv , int uv_stride ,
728
729
int num_vertices ,
@@ -734,8 +735,9 @@ static bool QueueCmdGeometry(SDL_Renderer *renderer, SDL_Texture *texture,
734
735
cmd = PrepQueueCmdDraw (renderer , SDL_RENDERCMD_GEOMETRY , texture );
735
736
if (cmd ) {
736
737
cmd -> data .draw .texture_address_mode = texture_address_mode ;
738
+ cmd -> data .draw .tentatively_named_rendergeometry_position_coordinate_count = pos_len ;
737
739
result = renderer -> QueueGeometry (renderer , cmd , texture ,
738
- xy , xy_stride ,
740
+ pos , pos_stride ,
739
741
color , color_stride , uv , uv_stride ,
740
742
num_vertices , indices , num_indices , size_indices ,
741
743
scale_x , scale_y );
@@ -3737,7 +3739,8 @@ bool SDL_RenderLines(SDL_Renderer *renderer, const SDL_FPoint *points, int count
3737
3739
}
3738
3740
3739
3741
result = QueueCmdGeometry (renderer , NULL ,
3740
- xy , xy_stride , & renderer -> color , 0 /* color_stride */ , NULL , 0 ,
3742
+ xy , xy_stride , 2 ,
3743
+ & renderer -> color , 0 /* color_stride */ , NULL , 0 ,
3741
3744
num_vertices , indices , num_indices , size_indices ,
3742
3745
1.0f , 1.0f , SDL_TEXTURE_ADDRESS_CLAMP );
3743
3746
}
@@ -3918,7 +3921,8 @@ static bool SDL_RenderTextureInternal(SDL_Renderer *renderer, SDL_Texture *textu
3918
3921
xy [7 ] = maxy ;
3919
3922
3920
3923
result = QueueCmdGeometry (renderer , texture ,
3921
- xy , xy_stride , & texture -> color , 0 /* color_stride */ , uv , uv_stride ,
3924
+ xy , xy_stride , 2 ,
3925
+ & texture -> color , 0 /* color_stride */ , uv , uv_stride ,
3922
3926
num_vertices , indices , num_indices , size_indices ,
3923
3927
scale_x , scale_y , SDL_TEXTURE_ADDRESS_CLAMP );
3924
3928
} else {
@@ -4079,7 +4083,7 @@ bool SDL_RenderTextureAffine(SDL_Renderer *renderer, SDL_Texture *texture,
4079
4083
4080
4084
result = QueueCmdGeometry (
4081
4085
renderer , texture ,
4082
- xy , xy_stride ,
4086
+ xy , xy_stride , 2 ,
4083
4087
& texture -> color , 0 /* color_stride */ ,
4084
4088
uv , uv_stride ,
4085
4089
num_vertices , indices , num_indices , size_indices ,
@@ -4231,7 +4235,8 @@ bool SDL_RenderTextureRotated(SDL_Renderer *renderer, SDL_Texture *texture,
4231
4235
xy [7 ] = (s_minx + c_maxy ) + centery ;
4232
4236
4233
4237
result = QueueCmdGeometry (renderer , texture ,
4234
- xy , xy_stride , & texture -> color , 0 /* color_stride */ , uv , uv_stride ,
4238
+ xy , xy_stride , 2 ,
4239
+ & texture -> color , 0 /* color_stride */ , uv , uv_stride ,
4235
4240
num_vertices , indices , num_indices , size_indices ,
4236
4241
scale_x , scale_y , SDL_TEXTURE_ADDRESS_CLAMP );
4237
4242
} else {
@@ -4283,7 +4288,8 @@ static bool SDL_RenderTextureTiled_Wrap(SDL_Renderer *renderer, SDL_Texture *tex
4283
4288
4284
4289
const SDL_RenderViewState * view = renderer -> view ;
4285
4290
return QueueCmdGeometry (renderer , texture ,
4286
- xy , xy_stride , & texture -> color , 0 /* color_stride */ , uv , uv_stride ,
4291
+ xy , xy_stride , 2 ,
4292
+ & texture -> color , 0 /* color_stride */ , uv , uv_stride ,
4287
4293
num_vertices , indices , num_indices , size_indices ,
4288
4294
view -> current_scale .x , view -> current_scale .y , SDL_TEXTURE_ADDRESS_WRAP );
4289
4295
}
@@ -5030,7 +5036,8 @@ static bool SDLCALL SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer,
5030
5036
SDL_Log ("Triangle %d %d %d - is_uniform:%d is_rectangle:%d" , prev [0 ], prev [1 ], prev [2 ], is_uniform , is_rectangle );
5031
5037
#endif
5032
5038
result = QueueCmdGeometry (renderer , texture ,
5033
- xy , xy_stride , color , color_stride , uv , uv_stride ,
5039
+ xy , xy_stride , 2 ,
5040
+ color , color_stride , uv , uv_stride ,
5034
5041
num_vertices , prev , 3 , 4 ,
5035
5042
scale_x , scale_y , SDL_TEXTURE_ADDRESS_CLAMP );
5036
5043
if (!result ) {
@@ -5050,7 +5057,8 @@ static bool SDLCALL SDL_SW_RenderGeometryRaw(SDL_Renderer *renderer,
5050
5057
SDL_Log ("Last triangle %d %d %d" , prev [0 ], prev [1 ], prev [2 ]);
5051
5058
#endif
5052
5059
result = QueueCmdGeometry (renderer , texture ,
5053
- xy , xy_stride , color , color_stride , uv , uv_stride ,
5060
+ xy , xy_stride , 2 ,
5061
+ color , color_stride , uv , uv_stride ,
5054
5062
num_vertices , prev , 3 , 4 ,
5055
5063
scale_x , scale_y , SDL_TEXTURE_ADDRESS_CLAMP );
5056
5064
if (!result ) {
@@ -5074,6 +5082,22 @@ bool SDL_RenderGeometryRaw(SDL_Renderer *renderer,
5074
5082
const float * uv , int uv_stride ,
5075
5083
int num_vertices ,
5076
5084
const void * indices , int num_indices , int size_indices )
5085
+ {
5086
+ return SDL_RenderGeometryRawEx (renderer , texture ,
5087
+ xy , xy_stride , 2 ,
5088
+ color , color_stride ,
5089
+ uv , uv_stride ,
5090
+ num_vertices ,
5091
+ indices , num_indices , size_indices );
5092
+ }
5093
+
5094
+ bool SDL_RenderGeometryRawEx (SDL_Renderer * renderer ,
5095
+ SDL_Texture * texture ,
5096
+ const float * xy , int xy_stride , Uint8 pos_len ,
5097
+ const SDL_FColor * color , int color_stride ,
5098
+ const float * uv , int uv_stride ,
5099
+ int num_vertices ,
5100
+ const void * indices , int num_indices , int size_indices )
5077
5101
{
5078
5102
int i ;
5079
5103
int count = indices ? num_indices : num_vertices ;
@@ -5177,7 +5201,8 @@ bool SDL_RenderGeometryRaw(SDL_Renderer *renderer,
5177
5201
5178
5202
const SDL_RenderViewState * view = renderer -> view ;
5179
5203
return QueueCmdGeometry (renderer , texture ,
5180
- xy , xy_stride , color , color_stride , uv , uv_stride ,
5204
+ xy , xy_stride , pos_len ,
5205
+ color , color_stride , uv , uv_stride ,
5181
5206
num_vertices , indices , num_indices , size_indices ,
5182
5207
view -> current_scale .x , view -> current_scale .y ,
5183
5208
texture_address_mode );
0 commit comments