@@ -132,10 +132,10 @@ void DrawPixel(int posX, int posY, Color color)
132132void DrawPixelV (Vector2 position , Color color )
133133{
134134#if defined(SUPPORT_QUADS_DRAW_MODE )
135- rlSetTexture (GetShapesTexture ().id );
136- Rectangle shapeRect = GetShapesTextureRectangle ();
137135
138136 rlBegin (RL_QUADS );
137+ rlSetTexture (GetShapesTexture ().id );
138+ Rectangle shapeRect = GetShapesTextureRectangle ();
139139
140140 rlNormal3f (0.0f , 0.0f , 1.0f );
141141 rlColor4ub (color .r , color .g , color .b , color .a );
@@ -311,10 +311,10 @@ void DrawCircleSector(Vector2 center, float radius, float startAngle, float endA
311311 float angle = startAngle ;
312312
313313#if defined(SUPPORT_QUADS_DRAW_MODE )
314- rlSetTexture (GetShapesTexture ().id );
315- Rectangle shapeRect = GetShapesTextureRectangle ();
316314
317315 rlBegin (RL_QUADS );
316+ rlSetTexture (GetShapesTexture ().id );
317+ Rectangle shapeRect = GetShapesTextureRectangle ();
318318
319319 // NOTE: Every QUAD actually represents two segments
320320 for (int i = 0 ; i < segments /2 ; i ++ )
@@ -552,10 +552,10 @@ void DrawRing(Vector2 center, float innerRadius, float outerRadius, float startA
552552 float angle = startAngle ;
553553
554554#if defined(SUPPORT_QUADS_DRAW_MODE )
555- rlSetTexture (GetShapesTexture ().id );
556- Rectangle shapeRect = GetShapesTextureRectangle ();
557555
558556 rlBegin (RL_QUADS );
557+ rlSetTexture (GetShapesTexture ().id );
558+ Rectangle shapeRect = GetShapesTextureRectangle ();
559559 for (int i = 0 ; i < segments ; i ++ )
560560 {
561561 rlColor4ub (color .r , color .g , color .b , color .a );
@@ -732,10 +732,10 @@ void DrawRectanglePro(Rectangle rec, Vector2 origin, float rotation, Color color
732732 }
733733
734734#if defined(SUPPORT_QUADS_DRAW_MODE )
735- rlSetTexture (GetShapesTexture ().id );
736- Rectangle shapeRect = GetShapesTextureRectangle ();
737735
738736 rlBegin (RL_QUADS );
737+ rlSetTexture (GetShapesTexture ().id );
738+ Rectangle shapeRect = GetShapesTextureRectangle ();
739739
740740 rlNormal3f (0.0f , 0.0f , 1.0f );
741741 rlColor4ub (color .r , color .g , color .b , color .a );
@@ -787,10 +787,10 @@ void DrawRectangleGradientH(int posX, int posY, int width, int height, Color lef
787787// Draw a gradient-filled rectangle
788788void DrawRectangleGradientEx (Rectangle rec , Color topLeft , Color bottomLeft , Color bottomRight , Color topRight )
789789{
790- rlSetTexture (GetShapesTexture ().id );
791- Rectangle shapeRect = GetShapesTextureRectangle ();
792790
793791 rlBegin (RL_QUADS );
792+ rlSetTexture (GetShapesTexture ().id );
793+ Rectangle shapeRect = GetShapesTextureRectangle ();
794794 rlNormal3f (0.0f , 0.0f , 1.0f );
795795
796796 // NOTE: Default raylib font character 95 is a white square
@@ -952,10 +952,10 @@ void DrawRectangleRounded(Rectangle rec, float roundness, int segments, Color co
952952 const float angles [4 ] = { 180.0f , 270.0f , 0.0f , 90.0f };
953953
954954#if defined(SUPPORT_QUADS_DRAW_MODE )
955- rlSetTexture (GetShapesTexture ().id );
956- Rectangle shapeRect = GetShapesTextureRectangle ();
957955
958956 rlBegin (RL_QUADS );
957+ rlSetTexture (GetShapesTexture ().id );
958+ Rectangle shapeRect = GetShapesTextureRectangle ();
959959 // Draw all the 4 corners: [1] Upper Left Corner, [3] Upper Right Corner, [5] Lower Right Corner, [7] Lower Left Corner
960960 for (int k = 0 ; k < 4 ; ++ k ) // Hope the compiler is smart enough to unroll this loop
961961 {
@@ -1206,10 +1206,10 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f
12061206 if (lineThick > 1 )
12071207 {
12081208#if defined(SUPPORT_QUADS_DRAW_MODE )
1209- rlSetTexture (GetShapesTexture ().id );
1210- Rectangle shapeRect = GetShapesTextureRectangle ();
12111209
12121210 rlBegin (RL_QUADS );
1211+ rlSetTexture (GetShapesTexture ().id );
1212+ Rectangle shapeRect = GetShapesTextureRectangle ();
12131213
12141214 // Draw all the 4 corners first: Upper Left Corner, Upper Right Corner, Lower Right Corner, Lower Left Corner
12151215 for (int k = 0 ; k < 4 ; ++ k ) // Hope the compiler is smart enough to unroll this loop
@@ -1382,10 +1382,10 @@ void DrawRectangleRoundedLinesEx(Rectangle rec, float roundness, int segments, f
13821382void DrawTriangle (Vector2 v1 , Vector2 v2 , Vector2 v3 , Color color )
13831383{
13841384#if defined(SUPPORT_QUADS_DRAW_MODE )
1385- rlSetTexture (GetShapesTexture ().id );
1386- Rectangle shapeRect = GetShapesTextureRectangle ();
13871385
13881386 rlBegin (RL_QUADS );
1387+ rlSetTexture (GetShapesTexture ().id );
1388+ Rectangle shapeRect = GetShapesTextureRectangle ();
13891389 rlColor4ub (color .r , color .g , color .b , color .a );
13901390
13911391 rlTexCoord2f (shapeRect .x /texShapes .width , shapeRect .y /texShapes .height );
@@ -1436,10 +1436,10 @@ void DrawTriangleFan(const Vector2 *points, int pointCount, Color color)
14361436{
14371437 if (pointCount >= 3 )
14381438 {
1439- rlSetTexture (GetShapesTexture ().id );
1440- Rectangle shapeRect = GetShapesTextureRectangle ();
14411439
14421440 rlBegin (RL_QUADS );
1441+ rlSetTexture (GetShapesTexture ().id );
1442+ Rectangle shapeRect = GetShapesTextureRectangle ();
14431443 rlColor4ub (color .r , color .g , color .b , color .a );
14441444
14451445 for (int i = 1 ; i < pointCount - 1 ; i ++ )
@@ -1497,10 +1497,10 @@ void DrawPoly(Vector2 center, int sides, float radius, float rotation, Color col
14971497 float angleStep = 360.0f /(float )sides * DEG2RAD ;
14981498
14991499#if defined(SUPPORT_QUADS_DRAW_MODE )
1500- rlSetTexture (GetShapesTexture ().id );
1501- Rectangle shapeRect = GetShapesTextureRectangle ();
15021500
15031501 rlBegin (RL_QUADS );
1502+ rlSetTexture (GetShapesTexture ().id );
1503+ Rectangle shapeRect = GetShapesTextureRectangle ();
15041504 for (int i = 0 ; i < sides ; i ++ )
15051505 {
15061506 rlColor4ub (color .r , color .g , color .b , color .a );
@@ -1566,10 +1566,10 @@ void DrawPolyLinesEx(Vector2 center, int sides, float radius, float rotation, fl
15661566 float innerRadius = radius - (lineThick * cosf (DEG2RAD * exteriorAngle /2.0f ));
15671567
15681568#if defined(SUPPORT_QUADS_DRAW_MODE )
1569- rlSetTexture (GetShapesTexture ().id );
1570- Rectangle shapeRect = GetShapesTextureRectangle ();
15711569
15721570 rlBegin (RL_QUADS );
1571+ rlSetTexture (GetShapesTexture ().id );
1572+ Rectangle shapeRect = GetShapesTextureRectangle ();
15731573 for (int i = 0 ; i < sides ; i ++ )
15741574 {
15751575 rlColor4ub (color .r , color .g , color .b , color .a );
0 commit comments