src/render/SDL_render.c
changeset 12383 f6430feceeda
parent 12382 03d0bddca61b
child 12447 0844007ea1c2
equal deleted inserted replaced
12382:03d0bddca61b 12383:f6430feceeda
  2163    !!! FIXME:  making the floating point versions the only available APIs. */
  2163    !!! FIXME:  making the floating point versions the only available APIs. */
  2164 
  2164 
  2165 int
  2165 int
  2166 SDL_RenderDrawPoint(SDL_Renderer * renderer, int x, int y)
  2166 SDL_RenderDrawPoint(SDL_Renderer * renderer, int x, int y)
  2167 {
  2167 {
  2168     const SDL_FPoint fpoint = { (float) x, (float) y };
  2168     SDL_FPoint fpoint;
       
  2169     fpoint.x = (float) x;
       
  2170     fpoint.y = (float) y;
  2169     return SDL_RenderDrawPointsF(renderer, &fpoint, 1);
  2171     return SDL_RenderDrawPointsF(renderer, &fpoint, 1);
  2170 }
  2172 }
  2171 
  2173 
  2172 int
  2174 int
  2173 SDL_RenderDrawPointF(SDL_Renderer * renderer, float x, float y)
  2175 SDL_RenderDrawPointF(SDL_Renderer * renderer, float x, float y)
  2174 {
  2176 {
  2175     const SDL_FPoint fpoint = { x, y };
  2177     SDL_FPoint fpoint;
       
  2178     fpoint.x = x;
       
  2179     fpoint.y = y;
  2176     return SDL_RenderDrawPointsF(renderer, &fpoint, 1);
  2180     return SDL_RenderDrawPointsF(renderer, &fpoint, 1);
  2177 }
  2181 }
  2178 
  2182 
  2179 static int
  2183 static int
  2180 RenderDrawPointsWithRects(SDL_Renderer * renderer,
  2184 RenderDrawPointsWithRects(SDL_Renderer * renderer,
  2317 }
  2321 }
  2318 
  2322 
  2319 int
  2323 int
  2320 SDL_RenderDrawLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)
  2324 SDL_RenderDrawLine(SDL_Renderer * renderer, int x1, int y1, int x2, int y2)
  2321 {
  2325 {
  2322     const SDL_FPoint points[2] = { { (float) x1, (float) y1 }, { (float) x2, (float) y2 } };
  2326     SDL_FPoint points[2];
       
  2327     points[0].x = (float) x1;
       
  2328     points[0].y = (float) y1;
       
  2329     points[1].x = (float) x2;
       
  2330     points[1].y = (float) y2;
  2323     return SDL_RenderDrawLinesF(renderer, points, 2);
  2331     return SDL_RenderDrawLinesF(renderer, points, 2);
  2324 }
  2332 }
  2325 
  2333 
  2326 int
  2334 int
  2327 SDL_RenderDrawLineF(SDL_Renderer * renderer, float x1, float y1, float x2, float y2)
  2335 SDL_RenderDrawLineF(SDL_Renderer * renderer, float x1, float y1, float x2, float y2)
  2328 {
  2336 {
  2329     const SDL_FPoint points[2] = { { x1, y1 }, { x2, y2 } };
  2337     SDL_FPoint points[2];
       
  2338     points[0].x = x1;
       
  2339     points[0].y = y1;
       
  2340     points[1].x = x2;
       
  2341     points[1].y = y2;
  2330     return SDL_RenderDrawLinesF(renderer, points, 2);
  2342     return SDL_RenderDrawLinesF(renderer, points, 2);
  2331 }
  2343 }
  2332 
  2344 
  2333 static int
  2345 static int
  2334 RenderDrawLinesWithRects(SDL_Renderer * renderer,
  2346 RenderDrawLinesWithRects(SDL_Renderer * renderer,