this repo has no description
at GLES_3 137 lines 4.5 kB view raw
1#include "SDL_gpu.h" 2#include "SDL_gpu_RendererImpl.h" 3#include <string.h> 4 5#define CHECK_RENDERER() \ 6GPU_Renderer* renderer = GPU_GetCurrentRenderer(); \ 7if(renderer == NULL) \ 8 return; 9 10#define CHECK_RENDERER_1(ret) \ 11GPU_Renderer* renderer = GPU_GetCurrentRenderer(); \ 12if(renderer == NULL) \ 13 return ret; 14 15 16float GPU_SetLineThickness(float thickness) 17{ 18 CHECK_RENDERER_1(1.0f); 19 return renderer->impl->SetLineThickness(renderer, thickness); 20} 21 22float GPU_GetLineThickness(void) 23{ 24 CHECK_RENDERER_1(1.0f); 25 return renderer->impl->GetLineThickness(renderer); 26} 27 28void GPU_Pixel(GPU_Target* target, float x, float y, SDL_Color color) 29{ 30 CHECK_RENDERER(); 31 renderer->impl->Pixel(renderer, target, x, y, color); 32} 33 34void GPU_Line(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color) 35{ 36 CHECK_RENDERER(); 37 renderer->impl->Line(renderer, target, x1, y1, x2, y2, color); 38} 39 40 41void GPU_Arc(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color) 42{ 43 CHECK_RENDERER(); 44 renderer->impl->Arc(renderer, target, x, y, radius, start_angle, end_angle, color); 45} 46 47 48void GPU_ArcFilled(GPU_Target* target, float x, float y, float radius, float start_angle, float end_angle, SDL_Color color) 49{ 50 CHECK_RENDERER(); 51 renderer->impl->ArcFilled(renderer, target, x, y, radius, start_angle, end_angle, color); 52} 53 54void GPU_Circle(GPU_Target* target, float x, float y, float radius, SDL_Color color) 55{ 56 CHECK_RENDERER(); 57 renderer->impl->Circle(renderer, target, x, y, radius, color); 58} 59 60void GPU_CircleFilled(GPU_Target* target, float x, float y, float radius, SDL_Color color) 61{ 62 CHECK_RENDERER(); 63 renderer->impl->CircleFilled(renderer, target, x, y, radius, color); 64} 65 66void GPU_Ellipse(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color) 67{ 68 CHECK_RENDERER(); 69 renderer->impl->Ellipse(renderer, target, x, y, rx, ry, degrees, color); 70} 71 72void GPU_EllipseFilled(GPU_Target* target, float x, float y, float rx, float ry, float degrees, SDL_Color color) 73{ 74 CHECK_RENDERER(); 75 renderer->impl->EllipseFilled(renderer, target, x, y, rx, ry, degrees, color); 76} 77 78void GPU_Sector(GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color) 79{ 80 CHECK_RENDERER(); 81 renderer->impl->Sector(renderer, target, x, y, inner_radius, outer_radius, start_angle, end_angle, color); 82} 83 84void GPU_SectorFilled(GPU_Target* target, float x, float y, float inner_radius, float outer_radius, float start_angle, float end_angle, SDL_Color color) 85{ 86 CHECK_RENDERER(); 87 renderer->impl->SectorFilled(renderer, target, x, y, inner_radius, outer_radius, start_angle, end_angle, color); 88} 89 90void GPU_Tri(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color) 91{ 92 CHECK_RENDERER(); 93 renderer->impl->Tri(renderer, target, x1, y1, x2, y2, x3, y3, color); 94} 95 96void GPU_TriFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float x3, float y3, SDL_Color color) 97{ 98 CHECK_RENDERER(); 99 renderer->impl->TriFilled(renderer, target, x1, y1, x2, y2, x3, y3, color); 100} 101 102void GPU_Rectangle(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color) 103{ 104 CHECK_RENDERER(); 105 renderer->impl->Rectangle(renderer, target, x1, y1, x2, y2, color); 106} 107 108void GPU_RectangleFilled(GPU_Target* target, float x1, float y1, float x2, float y2, SDL_Color color) 109{ 110 CHECK_RENDERER(); 111 renderer->impl->RectangleFilled(renderer, target, x1, y1, x2, y2, color); 112} 113 114void GPU_RectangleRound(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color) 115{ 116 CHECK_RENDERER(); 117 renderer->impl->RectangleRound(renderer, target, x1, y1, x2, y2, radius, color); 118} 119 120void GPU_RectangleRoundFilled(GPU_Target* target, float x1, float y1, float x2, float y2, float radius, SDL_Color color) 121{ 122 CHECK_RENDERER(); 123 renderer->impl->RectangleRoundFilled(renderer, target, x1, y1, x2, y2, radius, color); 124} 125 126void GPU_Polygon(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color) 127{ 128 CHECK_RENDERER(); 129 renderer->impl->Polygon(renderer, target, num_vertices, vertices, color); 130} 131 132void GPU_PolygonFilled(GPU_Target* target, unsigned int num_vertices, float* vertices, SDL_Color color) 133{ 134 CHECK_RENDERER(); 135 renderer->impl->PolygonFilled(renderer, target, num_vertices, vertices, color); 136} 137