1 
2 //          Copyright 2018 - 2021 Michael D. Parker
3 // Distributed under the Boost Software License, Version 1.0.
4 //    (See accompanying file LICENSE_1_0.txt or copy at
5 //          http://www.boost.org/LICENSE_1_0.txt)
6 
7 module bindbc.sdl.bind.sdlrender;
8 
9 import bindbc.sdl.config;
10 import bindbc.sdl.bind.sdlblendmode : SDL_BlendMode;
11 import bindbc.sdl.bind.sdlrect;
12 import bindbc.sdl.bind.sdlstdinc : SDL_bool;
13 import bindbc.sdl.bind.sdlsurface : SDL_Surface;
14 import bindbc.sdl.bind.sdlvideo : SDL_Window;
15 
16 enum : uint {
17     SDL_RENDERER_SOFTWARE = 0x00000001,
18     SDL_RENDERER_ACCELERATED = 0x00000002,
19     SDL_RENDERER_PRESENTVSYNC = 0x00000004,
20     SDL_RENDERER_TARGETTEXTURE = 0x00000008,
21 }
22 alias SDL_RendererFlags = uint;
23 
24 struct SDL_RendererInfo {
25     const(char)* name;
26     SDL_RendererFlags flags;
27     uint num_texture_formats;
28     uint[16] texture_formats;
29     int max_texture_width;
30     int max_texture_height;
31 }
32 
33 static if(sdlSupport >= SDLSupport.sdl2012) {
34     enum SDL_ScaleMode {
35         SDL_ScaleModeNearest,
36         SDL_ScaleModeLinear,
37         SDL_ScaleModeBest,
38     }
39     mixin(expandEnum!SDL_ScaleMode);
40 }
41 
42 enum SDL_TextureAccess {
43     SDL_TEXTUREACCESS_STATIC,
44     SDL_TEXTUREACCESS_STREAMING,
45     SDL_TEXTUREACCESS_TARGET,
46 }
47 mixin(expandEnum!SDL_TextureAccess);
48 
49 enum SDL_TextureModulate {
50     SDL_TEXTUREMODULATE_NONE = 0x00000000,
51     SDL_TEXTUREMODULATE_COLOR = 0x00000001,
52     SDL_TEXTUREMODULATE_ALPHA = 0x00000002
53 }
54 mixin(expandEnum!SDL_TextureModulate);
55 
56 enum SDL_RendererFlip {
57     SDL_FLIP_NONE = 0x00000000,
58     SDL_FLIP_HORIZONTAL = 0x00000001,
59     SDL_FLIP_VERTICAL = 0x00000002,
60 }
61 mixin(expandEnum!SDL_RendererFlip);
62 
63 struct SDL_Renderer;
64 struct SDL_Texture;
65 
66 static if(staticBinding) {
67     extern(C) @nogc nothrow {
68         int SDL_GetNumRenderDrivers();
69         int SDL_GetRenderDriverInfo(int index, SDL_RendererInfo* info);
70         int SDL_CreateWindowAndRenderer(int width, int height, uint window_flags, SDL_Window** window, SDL_Renderer** renderer);
71         SDL_Renderer* SDL_CreateRenderer(SDL_Window* window, int index, SDL_RendererFlags flags);
72         SDL_Renderer* SDL_CreateSoftwareRenderer(SDL_Surface* surface);
73         SDL_Renderer* SDL_GetRenderer(SDL_Window* window);
74         int SDL_GetRendererInfo(SDL_Renderer* renderer, SDL_RendererInfo* info);
75         int SDL_GetRendererOutputSize(SDL_Renderer* renderer, int* w, int* h);
76         SDL_Texture* SDL_CreateTexture(SDL_Renderer* renderer, uint format, SDL_TextureAccess access, int w, int h);
77         SDL_Texture* SDL_CreateTextureFromSurface(SDL_Renderer* renderer, SDL_Surface* surface);
78         int SDL_QueryTexture(SDL_Texture* texture, uint* format, SDL_TextureAccess* access, int* w, int* h);
79         int SDL_SetTextureColorMod(SDL_Texture* texture, ubyte r, ubyte g, ubyte b);
80         int SDL_GetTextureColorMod(SDL_Texture* texture, ubyte* r, ubyte* g, ubyte* b);
81         int SDL_SetTextureAlphaMod(SDL_Texture* texture, ubyte alpha);
82         int SDL_GetTextureAlphaMod(SDL_Texture* texture, ubyte* alpha);
83         int SDL_SetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode blendMode);
84         int SDL_GetTextureBlendMode(SDL_Texture* texture, SDL_BlendMode* blendMode);
85         int SDL_UpdateTexture(SDL_Texture* texture, const(SDL_Rect)* rect, const(void)* pixels, int pitch);
86         int SDL_LockTexture(SDL_Texture* texture, const(SDL_Rect)* rect, void** pixels, int* pitch);
87         void SDL_UnlockTexture(SDL_Texture* texture);
88         SDL_bool SDL_RenderTargetSupported(SDL_Renderer* renderer);
89         int SDL_SetRenderTarget(SDL_Renderer* renderer, SDL_Texture* texture);
90         SDL_Texture* SDL_GetRenderTarget(SDL_Renderer* renderer);
91         int SDL_RenderSetClipRect(SDL_Renderer* renderer, const(SDL_Rect)* rect);
92         void SDL_RenderGetClipRect(SDL_Renderer* renderer, SDL_Rect* rect);
93         int SDL_RenderSetLogicalSize(SDL_Renderer* renderer, int w, int h);
94         void SDL_RenderGetLogicalSize(SDL_Renderer* renderer, int* w, int* h);
95         int SDL_RenderSetViewport(SDL_Renderer* renderer, const(SDL_Rect)* rect);
96         void SDL_RenderGetViewport(SDL_Renderer* renderer, SDL_Rect* rect);
97         int SDL_RenderSetScale(SDL_Renderer* renderer, float scaleX, float scaleY);
98         int SDL_RenderGetScale(SDL_Renderer* renderer, float* scaleX, float* scaleY);
99         int SDL_SetRenderDrawColor(SDL_Renderer* renderer, ubyte r, ubyte g, ubyte b, ubyte a);
100         int SDL_GetRenderDrawColor(SDL_Renderer* renderer, ubyte* r, ubyte* g, ubyte* b, ubyte* a);
101         int SDL_SetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode blendMode);
102         int SDL_GetRenderDrawBlendMode(SDL_Renderer* renderer, SDL_BlendMode* blendMode);
103         int SDL_RenderClear(SDL_Renderer* renderer);
104         int SDL_RenderDrawPoint(SDL_Renderer* renderer, int x, int y);
105         int SDL_RenderDrawPoints(SDL_Renderer* renderer, const(SDL_Point)* points, int count);
106         int SDL_RenderDrawLine(SDL_Renderer* renderer, int x1, int y1, int x2, int y2);
107         int SDL_RenderDrawLines(SDL_Renderer* renderer, const(SDL_Point)* points, int count);
108         int SDL_RenderDrawRect(SDL_Renderer* renderer, const(SDL_Rect)* rect);
109         int SDL_RenderDrawRects(SDL_Renderer* renderer, const(SDL_Rect)* rects, int count);
110         int SDL_RenderFillRect(SDL_Renderer* renderer, const(SDL_Rect)* rect);
111         int SDL_RenderFillRects(SDL_Renderer* renderer, const(SDL_Rect)* rects, int count);
112         int SDL_RenderCopy(SDL_Renderer* renderer, SDL_Texture* texture, const(SDL_Rect)* srcrect, const(SDL_Rect)* dstrect);
113         int SDL_RenderCopyEx(SDL_Renderer* renderer, SDL_Texture* texture, const(SDL_Rect)* srcrect, const(SDL_Rect)* dstrect, const(double) angle, const(SDL_Point)* center, const(SDL_RendererFlip) flip);
114         int SDL_RenderReadPixels(SDL_Renderer* renderer, const(SDL_Rect)* rect,uint,void*,int);
115         void SDL_RenderPresent(SDL_Renderer* renderer);
116         void SDL_DestroyTexture(SDL_Texture* texture);
117         void SDL_DestroyRenderer(SDL_Renderer* renderer);
118         int SDL_GL_BindTexture(SDL_Texture* texture, float* texw, float* texh);
119         int SDL_GL_UnbindTexture(SDL_Texture* texture);
120 
121         static if(sdlSupport >= SDLSupport.sdl201) {
122             int SDL_UpdateYUVTexture(SDL_Texture* texture ,const(SDL_Rect)* rect, const(ubyte)* Yplane, int Ypitch, const(ubyte)* Uplane, int Upitch, const(ubyte)* Vplane, int Vpitch);
123         }
124         static if(sdlSupport >= SDLSupport.sdl204) {
125             SDL_bool SDL_RenderIsClipEnabled(SDL_Renderer* renderer);
126         }
127         static if(sdlSupport >= SDLSupport.sdl205) {
128             SDL_bool SDL_RenderGetIntegerScale(SDL_Renderer* renderer);
129             int SDL_RenderSetIntegerScale(SDL_Renderer* renderer,SDL_bool);
130         }
131         static if(sdlSupport >= SDLSupport.sdl208) {
132             void* SDL_RenderGetMetalLayer(SDL_Renderer* renderer);
133             void* SDL_RenderGetMetalCommandEncoder(SDL_Renderer* renderer);
134         }
135         static if(sdlSupport >= SDLSupport.sdl2010) {
136             int SDL_RenderDrawPointF(SDL_Renderer* renderer, float x, float y);
137             int SDL_RenderDrawPointsF(SDL_Renderer* renderer, const(SDL_FPoint)* points, int count);
138             int SDL_RenderDrawLineF(SDL_Renderer* renderer, float x1, float y1, float x2, float y2);
139             int SDL_RenderDrawLinesF(SDL_Renderer* renderer, const(SDL_FPoint)* points, int count);
140             int SDL_RenderDrawRectF(SDL_Renderer* renderer, const(SDL_FRect)* rect);
141             int SDL_RenderDrawRectsF(SDL_Renderer* renderer, const(SDL_FRect)* rects, int count);
142             int SDL_RenderFillRectF(SDL_Renderer* renderer, const(SDL_FRect)* rect);
143             int SDL_RenderFillRectsF(SDL_Renderer* renderer, const(SDL_FRect)* rects, int count);
144             int SDL_RenderCopyF(SDL_Renderer* renderer, SDL_Texture* texture, const(SDL_FRect)* srcrect, const(SDL_FRect)* dstrect);
145             int SDL_RenderCopyExF(SDL_Renderer* renderer, SDL_Texture* texture, const(SDL_FRect)* srcrect, const(SDL_FRect)* dstrect, const(double) angle, const(SDL_FPoint)* center, const(SDL_RendererFlip) flip);
146             int SDL_RenderFlush(SDL_Renderer* renderer);
147         }
148         static if(sdlSupport >= SDLSupport.sdl2012) {
149             int SDL_SetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode scaleMode);
150             int SDL_GetTextureScaleMode(SDL_Texture* texture, SDL_ScaleMode* scaleMode);
151             int SDL_LockTextureToSurface(SDL_Texture* texture, const(SDL_Rect)* rect,SDL_Surface** surface);
152         }
153     }
154 }
155 else {
156     extern(C) @nogc nothrow {
157         alias pSDL_GetNumRenderDrivers = int function();
158         alias pSDL_GetRenderDriverInfo = int function(int index, SDL_RendererInfo* info);
159         alias pSDL_CreateWindowAndRenderer = int function(int width, int height, uint window_flags, SDL_Window** window, SDL_Renderer** renderer);
160         alias pSDL_CreateRenderer = SDL_Renderer* function(SDL_Window* window, int index, SDL_RendererFlags flags);
161         alias pSDL_CreateSoftwareRenderer = SDL_Renderer* function(SDL_Surface* surface);
162         alias pSDL_GetRenderer = SDL_Renderer* function(SDL_Window* window);
163         alias pSDL_GetRendererInfo = int function(SDL_Renderer* renderer, SDL_RendererInfo* info);
164         alias pSDL_GetRendererOutputSize = int function(SDL_Renderer* renderer, int* w, int* h);
165         alias pSDL_CreateTexture = SDL_Texture* function(SDL_Renderer* renderer, uint format, SDL_TextureAccess access, int w, int h);
166         alias pSDL_CreateTextureFromSurface = SDL_Texture* function(SDL_Renderer* renderer, SDL_Surface* surface);
167         alias pSDL_QueryTexture = int function(SDL_Texture* texture, uint* format, SDL_TextureAccess* access, int* w, int* h);
168         alias pSDL_SetTextureColorMod = int function(SDL_Texture* texture, ubyte r, ubyte g, ubyte b);
169         alias pSDL_GetTextureColorMod = int function(SDL_Texture* texture, ubyte* r, ubyte* g, ubyte* b);
170         alias pSDL_SetTextureAlphaMod = int function(SDL_Texture* texture, ubyte alpha);
171         alias pSDL_GetTextureAlphaMod = int function(SDL_Texture* texture, ubyte* alpha);
172         alias pSDL_SetTextureBlendMode = int function(SDL_Texture* texture, SDL_BlendMode blendMode);
173         alias pSDL_GetTextureBlendMode = int function(SDL_Texture* texture, SDL_BlendMode* blendMode);
174         alias pSDL_UpdateTexture = int function(SDL_Texture* texture, const(SDL_Rect)* rect, const(void)* pixels, int pitch);
175         alias pSDL_LockTexture = int function(SDL_Texture* texture, const(SDL_Rect)* rect, void** pixels, int* pitch);
176         alias pSDL_UnlockTexture = void function(SDL_Texture* texture);
177         alias pSDL_RenderTargetSupported = SDL_bool function(SDL_Renderer* renderer);
178         alias pSDL_SetRenderTarget = int function(SDL_Renderer* renderer, SDL_Texture* texture);
179         alias pSDL_GetRenderTarget = SDL_Texture* function(SDL_Renderer* renderer);
180         alias pSDL_RenderSetClipRect = int function(SDL_Renderer* renderer, const(SDL_Rect)* rect);
181         alias pSDL_RenderGetClipRect = void function(SDL_Renderer* renderer, SDL_Rect* rect);
182         alias pSDL_RenderSetLogicalSize = int function(SDL_Renderer* renderer, int w, int h);
183         alias pSDL_RenderGetLogicalSize = void function(SDL_Renderer* renderer, int* w, int* h);
184         alias pSDL_RenderSetViewport = int function(SDL_Renderer* renderer, const(SDL_Rect)* rect);
185         alias pSDL_RenderGetViewport = void function(SDL_Renderer* renderer, SDL_Rect* rect);
186         alias pSDL_RenderSetScale = int function(SDL_Renderer* renderer, float scaleX, float scaleY);
187         alias pSDL_RenderGetScale = int function(SDL_Renderer* renderer, float* scaleX, float* scaleY);
188         alias pSDL_SetRenderDrawColor = int function(SDL_Renderer* renderer, ubyte r, ubyte g, ubyte b, ubyte a);
189         alias pSDL_GetRenderDrawColor = int function(SDL_Renderer* renderer, ubyte* r, ubyte* g, ubyte* b, ubyte* a);
190         alias pSDL_SetRenderDrawBlendMode = int function(SDL_Renderer* renderer, SDL_BlendMode blendMode);
191         alias pSDL_GetRenderDrawBlendMode = int function(SDL_Renderer* renderer, SDL_BlendMode* blendMode);
192         alias pSDL_RenderClear = int function(SDL_Renderer* renderer);
193         alias pSDL_RenderDrawPoint = int function(SDL_Renderer* renderer, int x, int y);
194         alias pSDL_RenderDrawPoints = int function(SDL_Renderer* renderer, const(SDL_Point)* points, int count);
195         alias pSDL_RenderDrawLine = int function(SDL_Renderer* renderer, int x1, int y1, int x2, int y2);
196         alias pSDL_RenderDrawLines = int function(SDL_Renderer* renderer, const(SDL_Point)* points, int count);
197         alias pSDL_RenderDrawRect = int function(SDL_Renderer* renderer, const(SDL_Rect)* rect);
198         alias pSDL_RenderDrawRects = int function(SDL_Renderer* renderer, const(SDL_Rect)* rects, int count);
199         alias pSDL_RenderFillRect = int function(SDL_Renderer* renderer, const(SDL_Rect)* rect);
200         alias pSDL_RenderFillRects = int function(SDL_Renderer* renderer, const(SDL_Rect)* rects, int count);
201         alias pSDL_RenderCopy = int function(SDL_Renderer* renderer, SDL_Texture* texture, const(SDL_Rect)* srcrect, const(SDL_Rect)* dstrect);
202         alias pSDL_RenderCopyEx = int function(SDL_Renderer* renderer, SDL_Texture* texture, const(SDL_Rect)* srcrect, const(SDL_Rect)* dstrect, const(double) angle, const(SDL_Point)* center, const(SDL_RendererFlip) flip);
203         alias pSDL_RenderReadPixels = int function(SDL_Renderer* renderer, const(SDL_Rect)* rect,uint,void*,int);
204         alias pSDL_RenderPresent = void function(SDL_Renderer* renderer);
205         alias pSDL_DestroyTexture = void function(SDL_Texture* texture);
206         alias pSDL_DestroyRenderer = void function(SDL_Renderer* renderer);
207         alias pSDL_GL_BindTexture = int function(SDL_Texture* texture, float* texw, float* texh);
208         alias pSDL_GL_UnbindTexture = int function(SDL_Texture* texture);
209     }
210 
211     __gshared {
212         pSDL_GetNumRenderDrivers SDL_GetNumRenderDrivers;
213         pSDL_GetRenderDriverInfo SDL_GetRenderDriverInfo;
214         pSDL_CreateWindowAndRenderer SDL_CreateWindowAndRenderer;
215         pSDL_CreateRenderer SDL_CreateRenderer;
216         pSDL_CreateSoftwareRenderer SDL_CreateSoftwareRenderer;
217         pSDL_GetRenderer SDL_GetRenderer;
218         pSDL_GetRendererInfo SDL_GetRendererInfo;
219         pSDL_GetRendererOutputSize SDL_GetRendererOutputSize;
220         pSDL_CreateTexture SDL_CreateTexture;
221         pSDL_CreateTextureFromSurface SDL_CreateTextureFromSurface;
222         pSDL_QueryTexture SDL_QueryTexture;
223         pSDL_SetTextureColorMod SDL_SetTextureColorMod;
224         pSDL_GetTextureColorMod SDL_GetTextureColorMod;
225         pSDL_SetTextureAlphaMod SDL_SetTextureAlphaMod;
226         pSDL_GetTextureAlphaMod SDL_GetTextureAlphaMod;
227         pSDL_SetTextureBlendMode SDL_SetTextureBlendMode;
228         pSDL_GetTextureBlendMode SDL_GetTextureBlendMode;
229         pSDL_UpdateTexture SDL_UpdateTexture;
230         pSDL_LockTexture SDL_LockTexture;
231         pSDL_UnlockTexture SDL_UnlockTexture;
232         pSDL_RenderTargetSupported SDL_RenderTargetSupported;
233         pSDL_SetRenderTarget SDL_SetRenderTarget;
234         pSDL_GetRenderTarget SDL_GetRenderTarget;
235         pSDL_RenderSetClipRect SDL_RenderSetClipRect;
236         pSDL_RenderGetClipRect SDL_RenderGetClipRect;
237         pSDL_RenderSetLogicalSize SDL_RenderSetLogicalSize;
238         pSDL_RenderGetLogicalSize SDL_RenderGetLogicalSize;
239         pSDL_RenderSetViewport SDL_RenderSetViewport;
240         pSDL_RenderGetViewport SDL_RenderGetViewport;
241         pSDL_RenderSetScale SDL_RenderSetScale;
242         pSDL_RenderGetScale SDL_RenderGetScale;
243         pSDL_SetRenderDrawColor SDL_SetRenderDrawColor;
244         pSDL_GetRenderDrawColor SDL_GetRenderDrawColor;
245         pSDL_SetRenderDrawBlendMode SDL_SetRenderDrawBlendMode;
246         pSDL_GetRenderDrawBlendMode SDL_GetRenderDrawBlendMode;
247         pSDL_RenderClear SDL_RenderClear;
248         pSDL_RenderDrawPoint SDL_RenderDrawPoint;
249         pSDL_RenderDrawPoints SDL_RenderDrawPoints;
250         pSDL_RenderDrawLine SDL_RenderDrawLine;
251         pSDL_RenderDrawLines SDL_RenderDrawLines;
252         pSDL_RenderDrawRect SDL_RenderDrawRect;
253         pSDL_RenderDrawRects SDL_RenderDrawRects;
254         pSDL_RenderFillRect SDL_RenderFillRect;
255         pSDL_RenderFillRects SDL_RenderFillRects;
256         pSDL_RenderCopy SDL_RenderCopy;
257         pSDL_RenderCopyEx SDL_RenderCopyEx;
258         pSDL_RenderReadPixels SDL_RenderReadPixels;
259         pSDL_RenderPresent SDL_RenderPresent;
260         pSDL_DestroyTexture SDL_DestroyTexture;
261         pSDL_DestroyRenderer SDL_DestroyRenderer;
262         pSDL_GL_BindTexture SDL_GL_BindTexture;
263         pSDL_GL_UnbindTexture SDL_GL_UnbindTexture;
264     }
265     static if(sdlSupport >= SDLSupport.sdl201) {
266         extern(C) @nogc nothrow {
267             alias pSDL_UpdateYUVTexture = int function(SDL_Texture* texture ,const(SDL_Rect)* rect, const(ubyte)* Yplane, int Ypitch, const(ubyte)* Uplane, int Upitch, const(ubyte)* Vplane, int Vpitch);
268         }
269         __gshared {
270             pSDL_UpdateYUVTexture SDL_UpdateYUVTexture;
271         }
272     }
273     static if(sdlSupport >= SDLSupport.sdl204) {
274         extern(C) @nogc nothrow {
275             alias pSDL_RenderIsClipEnabled = SDL_bool function(SDL_Renderer*);
276         }
277         __gshared {
278             pSDL_RenderIsClipEnabled SDL_RenderIsClipEnabled;
279         }
280     }
281     static if(sdlSupport >= SDLSupport.sdl205) {
282         extern(C) @nogc nothrow {
283             alias pSDL_RenderGetIntegerScale = SDL_bool function(SDL_Renderer*);
284             alias pSDL_RenderSetIntegerScale = int function(SDL_Renderer*,SDL_bool);
285         }
286         __gshared {
287             pSDL_RenderGetIntegerScale SDL_RenderGetIntegerScale;
288             pSDL_RenderSetIntegerScale SDL_RenderSetIntegerScale;
289         }
290     }
291     static if(sdlSupport >= SDLSupport.sdl208) {
292         extern(C) @nogc nothrow {
293             alias pSDL_RenderGetMetalLayer = void* function(SDL_Renderer*);
294             alias pSDL_RenderGetMetalCommandEncoder = void* function(SDL_Renderer*);
295         }
296         __gshared {
297             pSDL_RenderGetMetalLayer SDL_RenderGetMetalLayer;
298             pSDL_RenderGetMetalCommandEncoder SDL_RenderGetMetalCommandEncoder;
299         }
300     }
301     static if(sdlSupport >= SDLSupport.sdl2010) {
302         extern(C) @nogc nothrow {
303             alias pSDL_RenderDrawPointF = int function(SDL_Renderer* renderer, float x, float y);
304             alias pSDL_RenderDrawPointsF = int function(SDL_Renderer* renderer, const(SDL_FPoint)* points, int count);
305             alias pSDL_RenderDrawLineF = int function(SDL_Renderer* renderer, float x1, float y1, float x2, float y2);
306             alias pSDL_RenderDrawLinesF = int function(SDL_Renderer* renderer, const(SDL_FPoint)* points, int count);
307             alias pSDL_RenderDrawRectF = int function(SDL_Renderer* renderer, const(SDL_FRect)* rect);
308             alias pSDL_RenderDrawRectsF = int function(SDL_Renderer* renderer, const(SDL_FRect)* rects, int count);
309             alias pSDL_RenderFillRectF = int function(SDL_Renderer* renderer, const(SDL_FRect)* rect);
310             alias pSDL_RenderFillRectsF = int function(SDL_Renderer* renderer, const(SDL_FRect)* rects, int count);
311             alias pSDL_RenderCopyF = int function(SDL_Renderer* renderer, SDL_Texture* texture, const(SDL_FRect)* srcrect, const(SDL_FRect)* dstrect);
312             alias pSDL_RenderCopyExF = int function(SDL_Renderer* renderer, SDL_Texture* texture, const(SDL_FRect)* srcrect, const(SDL_FRect)* dstrect, const(double) angle, const(SDL_FPoint)* center, const(SDL_RendererFlip) flip);
313             alias pSDL_RenderFlush = int function(SDL_Renderer* renderer);
314         }
315         __gshared {
316             pSDL_RenderDrawPointF SDL_RenderDrawPointF;
317             pSDL_RenderDrawPointsF SDL_RenderDrawPointsF;
318             pSDL_RenderDrawLineF SDL_RenderDrawLineF;
319             pSDL_RenderDrawLinesF SDL_RenderDrawLinesF;
320             pSDL_RenderDrawRectF SDL_RenderDrawRectF;
321             pSDL_RenderDrawRectsF SDL_RenderDrawRectsF;
322             pSDL_RenderFillRectF SDL_RenderFillRectF;
323             pSDL_RenderFillRectsF SDL_RenderFillRectsF;
324             pSDL_RenderCopyF SDL_RenderCopyF;
325             pSDL_RenderCopyExF SDL_RenderCopyExF;
326             pSDL_RenderFlush SDL_RenderFlush;
327         }
328     }
329     static if(sdlSupport >= SDLSupport.sdl2012) {
330         extern(C) @nogc nothrow {
331             alias pSDL_SetTextureScaleMode = int function(SDL_Texture* texture, SDL_ScaleMode scaleMode);
332             alias pSDL_GetTextureScaleMode = int function(SDL_Texture* texture, SDL_ScaleMode* scaleMode);
333             alias pSDL_LockTextureToSurface = int function(SDL_Texture* texture, const(SDL_Rect)* rect,SDL_Surface** surface);
334         }
335         __gshared {
336             pSDL_SetTextureScaleMode SDL_SetTextureScaleMode;
337             pSDL_GetTextureScaleMode SDL_GetTextureScaleMode;
338             pSDL_LockTextureToSurface SDL_LockTextureToSurface;
339         }
340     }
341 }