this repo has no description
0
fork

Configure Feed

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

Merge pull request #117 from kirilledelman/master

Renamed GPU_Polygon2 to GPU_Polyline

authored by

Jonathan Dearborn and committed by
GitHub
72c3fe78 4c0c4abd

+11 -11
+3 -3
include/SDL_gpu.h
··· 1740 1740 */ 1741 1741 DECLSPEC void SDLCALL GPU_Polygon(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); 1742 1742 1743 - /*! Renders a colored polygon outline, optionally open or closed. 1743 + /*! Renders a colored sequence of line segments. 1744 1744 * \param target The destination render target 1745 1745 * \param num_vertices Number of vertices (x and y pairs) 1746 1746 * \param vertices An array of vertex positions stored as interlaced x and y coords, e.g. {x1, y1, x2, y2, ...} 1747 1747 * \param color The color of the shape to render 1748 - * \param open Skip last segment and draw an open polygon 1748 + * \param close_loop Make a closed polygon by drawing a line at the end back to the start point 1749 1749 */ 1750 - DECLSPEC void SDLCALL GPU_Polygon2(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color, GPU_bool open); 1750 + DECLSPEC void SDLCALL GPU_Polyline(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color, GPU_bool close_loop); 1751 1751 1752 1752 /*! Renders a colored filled polygon. The vertices are expected to define a convex polygon. 1753 1753 * \param target The destination render target
+2 -2
include/SDL_gpu_RendererImpl.h
··· 306 306 /*! \see GPU_Polygon() */ 307 307 void (SDLCALL *Polygon)(GPU_Renderer* renderer, GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color); 308 308 309 - /*! \see GPU_Polygon2() */ 310 - void (SDLCALL *Polygon2)(GPU_Renderer* renderer, GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color, GPU_bool open); 309 + /*! \see GPU_Polyline() */ 310 + void (SDLCALL *Polyline)(GPU_Renderer* renderer, GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color, GPU_bool close_loop); 311 311 312 312 /*! \see GPU_PolygonFilled() */ 313 313 void (SDLCALL *PolygonFilled)(GPU_Renderer* renderer, GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color);
+2 -2
src/SDL_gpu_shapes.c
··· 153 153 renderer->impl->Polygon(renderer, target, num_vertices, vertices, color); 154 154 } 155 155 156 - void GPU_Polygon2(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color, GPU_bool open) 156 + void GPU_Polyline(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color, GPU_bool close_loop) 157 157 { 158 158 CHECK_RENDERER(); 159 - renderer->impl->Polygon2(renderer, target, num_vertices, vertices, color, open ); 159 + renderer->impl->Polyline(renderer, target, num_vertices, vertices, color, close_loop ); 160 160 } 161 161 162 162 void GPU_PolygonFilled(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color)
+1 -1
src/renderer_GL_common.inl
··· 6971 6971 impl->RectangleRound = &RectangleRound; \ 6972 6972 impl->RectangleRoundFilled = &RectangleRoundFilled; \ 6973 6973 impl->Polygon = &Polygon; \ 6974 - impl->Polygon2 = &Polygon2; \ 6974 + impl->Polyline = &Polyline; \ 6975 6975 impl->PolygonFilled = &PolygonFilled; 6976 6976
+3 -3
src/renderer_shapes_GL_common.inl
··· 1014 1014 } 1015 1015 } 1016 1016 1017 - static void Polygon2(GPU_Renderer* renderer, GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color, GPU_bool open) 1017 + static void Polyline(GPU_Renderer* renderer, GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color, GPU_bool close_loop) 1018 1018 { 1019 1019 if (num_vertices < 2) return; 1020 1020 ··· 1025 1025 int num_i = num_v + 2; 1026 1026 int last_vert = num_vertices; 1027 1027 1028 - if ( open ) 1028 + if ( !close_loop ) 1029 1029 { 1030 1030 num_v -= 4; 1031 1031 num_i = num_v; ··· 1062 1062 1063 1063 } while ( i < last_vert ); 1064 1064 1065 - if ( !open ) // end cap for closed 1065 + if ( close_loop ) // end cap for closed 1066 1066 { 1067 1067 SET_INDEXED_VERTEX(0); 1068 1068 SET_INDEXED_VERTEX(1)