this repo has no description
0
fork

Configure Feed

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

Changed GPU_Line() to use triangles instead of lines.

+14 -3
+14 -3
SDL_gpu/GL_common/SDL_gpuShapes_GL_common.inl
··· 113 113 114 114 static void Line(GPU_Renderer* renderer, GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color) 115 115 { 116 - BEGIN_UNTEXTURED("GPU_Line", GL_LINES, 2, 2); 116 + BEGIN_UNTEXTURED("GPU_Line", GL_TRIANGLES, 4, 6); 117 + 118 + float thickness = renderer->GetLineThickness(renderer); 119 + 120 + float t = thickness/2; 121 + float line_angle = atan2f(y2 - y1, x2 - x1); 122 + float tc = t*cosf(line_angle); 123 + float ts = t*sinf(line_angle); 124 + SET_UNTEXTURED_VERTEX(x1 + ts, y1 - tc, r, g, b, a); 125 + SET_UNTEXTURED_VERTEX(x1 - ts, y1 + tc, r, g, b, a); 126 + SET_UNTEXTURED_VERTEX(x2 + ts, y2 - tc, r, g, b, a); 117 127 118 - SET_UNTEXTURED_VERTEX(x1, y1, r, g, b, a); 119 - SET_UNTEXTURED_VERTEX(x2, y2, r, g, b, a); 128 + SET_INDEXED_VERTEX(1); 129 + SET_INDEXED_VERTEX(2); 130 + SET_UNTEXTURED_VERTEX(x2 - ts, y2 + tc, r, g, b, a); 120 131 } 121 132 122 133 // Arc() might call Circle()