Debian Codegraph @

src/derelict/sdl2/internal/gpu_static.d

raw
1 /*
2
3 Boost Software License - Version 1.0 - August 17th,2003
4
5 Permission is hereby granted,free of charge,to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license(the "Software") to use,reproduce,display,distribute,
8 execute,and transmit the Software,and to prepare derivative works of the
9 Software,and to permit third-parties to whom the Software is furnished to
10 do so,all subject to the following:
11
12 The copyright notices in the Software and this entire statement,including
13 the above license grant,this restriction and the following disclaimer,
14 must be included in all copies of the Software,in whole or in part,and
15 all derivative works of the Software,unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
18
19 THE SOFTWARE IS PROVIDED "AS IS",WITHOUT WARRANTY OF ANY KIND,EXPRESS OR
20 IMPLIED,INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE,TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY,WHETHER IN CONTRACT,TORT OR OTHERWISE,
24 ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
26
27 */
28 module derelict.sdl2.internal.gpu_static;
29
30 import derelict.sdl2.config;
31 static if(staticGPU) {
32 import core.stdc.config,
33 core.stdc.stdarg;
34 import derelict.sdl2.internal.gpu_types,
35 derelict.sdl2.internal.sdl_types;
36
37 extern(C) @nogc nothrow {
38 SDL_version GPU_GetLinkedVersion();
39 uint GPU_GetInitWindow();
40 void GPU_SetPreInitFlags(GPU_InitFlagEnum);
41 GPU_InitFlagEnum GPU_GetPreInitFlags();
42 void GPU_SetRequiredFeatures(GPU_FeatureEnum);
43 GPU_FeatureEnum GPU_GetRequiredFeatures();
44 void GPU_GetDefaultRendererOrder(int*,GPU_RendererID*);
45 void GPU_GetRendererOrder(int*,GPU_RendererID);
46 void GPU_SetRendererOrder(int*,GPU_RendererID);
47 GPU_Target* GPU_Init(ushort,ushort,GPU_WindowFlagEnum);
48 GPU_Target* GPU_InitRenderer(GPU_RendererEnum,ushort,ushort,GPU_WindowFlagEnum);
49 GPU_Target* GPU_InitRendererByID(GPU_RendererID,ushort,ushort,GPU_WindowFlagEnum);
50 GPU_bool GPU_IsFeatureEnabled(GPU_FeatureEnum);
51 void GPU_CloseCurrentRenderer();
52 void GPU_Quit();
53 void GPU_SetDebugLevel(GPU_DebugLevelEnum);
54 GPU_DebugLevelEnum GPU_GetDebugLevel();
55 void GPU_LogInfo(const(char)*,...);
56 void GPU_LogWarning(const(char)*,...);
57 void GPU_LogError(const(char)*,...);
58 void GPU_SetLogCallback(LogCallback);
59 void GPU_PushErrorCode(const(char)*,GPU_ErrorEnum,const(char)*,...);
60 GPU_ErrorObject GPU_PopErrorCode();
61 const(char)* GPU_GetErrorString(GPU_ErrorEnum);
62 void GPU_SetErrorQueueMax(uint);
63 GPU_RendererID GPU_MakeRendererID(const(char)*,GPU_RendererEnum,int,int);
64 GPU_RendererID GPU_GetRendererID(GPU_RendererEnum);
65 int GPU_GetNumRegisteredRenderers();
66 void GPU_GetRegisteredRendererList(GPU_RendererID*);
67 void GPU_RegisterRenderer(GPU_RendererID,RendererConstructor,RendererDestructor);
68 GPU_RendererEnum GPU_ReserveNextRendererEnum();
69 int GPU_GetNumActiveRenderers();
70 void GPU_GetActiveRendererList(GPU_RendererID*);
71 GPU_Renderer* GPU_GetCurrentRenderer();
72 void GPU_SetCurrentRenderer(GPU_RendererID);
73 GPU_Renderer* GPU_GetRenderer(GPU_RendererID);
74 void GPU_FreeRenderer(GPU_Renderer*);
75 void GPU_ResetRendererState();
76 void GPU_SetCoordinateMode(GPU_bool);
77 GPU_bool GPU_GetCoordinateMode();
78 void GPU_SetDefaultAnchor(float,float);
79 void GPU_GetDefaultAnchor(float*,float*);
80 GPU_Target* GPU_GetContextTarget();
81 GPU_Target* GPU_GetWindowTarget(uint);
82 GPU_Target* GPU_CreateTargetFromWindow(uint);
83 void GPU_MakeCurrent(GPU_Target*,uint);
84 GPU_bool GPU_SetWindowResolution(ushort,ushort);
85 GPU_bool GPU_SetFullscreen(GPU_bool,GPU_bool);
86 GPU_bool GPU_GetFullscreen();
87 void GPU_SetShapeBlending(GPU_bool);
88 GPU_BlendMode GPU_GetBlendModeFromPreset(GPU_BlendPresetEnum);
89 void GPU_SetShapeBlendFunction(GPU_BlendFuncEnum,GPU_BlendFuncEnum,GPU_BlendFuncEnum,GPU_BlendFuncEnum);
90 void GPU_SetShapeBlendEquation(GPU_BlendEqEnum,GPU_BlendEqEnum);
91 void GPU_SetShapeBlendMode(GPU_BlendPresetEnum);
92 float GPU_SetLineThickness(float);
93 float GPU_GetLineThickness();
94 GPU_Target* GPU_CreateAliasTarget(GPU_Target*);
95 GPU_Target* GPU_LoadTarget(GPU_Image*);
96 void GPU_FreeTarget(GPU_Target*);
97 void GPU_SetVirtualResolution(GPU_Target*,ushort,ushort);
98 void GPU_GetVirtualResolution(GPU_Target*,ushort*,ushort*);
99 void GPU_GetVirtualCoords(GPU_Target*,float*,float*,float,float);
100 void GPU_UnsetVirtualResolution(GPU_Target*);
101 GPU_Rect GPU_MakeRect(float,float,float,float);
102 SDL_Color GPU_MakeColor(ubyte,ubyte,ubyte,ubyte);
103 void GPU_SetViewport(GPU_Target*,GPU_Rect);
104 void GPU_UnsetViewport(GPU_Target*);
105 GPU_Camera GPU_GetDefaultCamera();
106 GPU_Camera GPU_GetCamera(GPU_Target*);
107 GPU_Camera GPU_SetCamera(GPU_Target*,GPU_Camera);
108 void GPU_EnableCamera(GPU_Target*,GPU_bool);
109 GPU_bool GPU_IsCameraEnabled(GPU_Target*);
110 SDL_Color GPU_GetPixel(GPU_Target*,short,short);
111 GPU_Rect GPU_SetClipRect(GPU_Target*,GPU_Rect);
112 GPU_Rect GPU_SetClip(short,short,ushort,ushort);
113 void GPU_UnsetClip(GPU_Target*);
114 GPU_bool GPU_IntersectRect(GPU_Rect,GPU_Rect,GPU_Rect*);
115 GPU_bool GPU_IntersectClipRect(GPU_Target*,GPU_Rect);
116 void GPU_SetTargetColor(GPU_Target*,SDL_Color);
117 void GPU_SetTargetRGB(GPU_Target*,ubyte,ubyte,ubyte);
118 void GPU_SetTargetRGBA(GPU_Target*,ubyte,ubyte,ubyte,ubyte);
119 void GPU_UnsetTargetColor(GPU_Target*);
120 SDL_Surface* GPU_LoadSurface(const(char*));
121 SDL_Surface* GPU_LoadSurface_RW(SDL_RWops*,GPU_bool);
122 GPU_bool GPU_SaveSurface(SDL_Surface*,const(char)*,GPU_FileFormatEnum);
123 GPU_bool GPU_SaveSurface_RW(SDL_Surface*,SDL_RWops*,GPU_bool,GPU_FileFormatEnum);
124 GPU_Image* GPU_CreateImage(ushort,ushort,GPU_FormatEnum);
125 GPU_Image* GPU_CreateImageUsingTexture(uint,GPU_bool);
126 GPU_Image* GPU_LoadImage(const(char)*);
127 GPU_Image* GPU_LoadImage_RW(SDL_RWops*,GPU_bool);
128 GPU_Image* GPU_CreateAliasImage(GPU_Image*);
129 GPU_Image* GPU_CopyImage(GPU_Image*);
130 void GPU_FreeImage(GPU_Image*);
131 void GPU_SetImageVirtualResolution(GPU_Image*,ushort,ushort);
132 void GPU_UnsetImageVirtualResolution(GPU_Image*);
133 void GPU_UpdateImage(GPU_Image*,const(GPU_Rect)*,SDL_Surface*,const(GPU_Rect)*);
134 void GPU_UpdateImageBytes(GPU_Image*,const(GPU_Rect)*,const(ubyte)*,int);
135 GPU_bool GPU_ReplaceImage(GPU_Image*,SDL_Surface*,const(GPU_Rect)*);
136 GPU_bool GPU_SaveImage(GPU_Image*,const(char)*,GPU_FileFormatEnum);
137 GPU_bool GPU_SaveImage_RW(GPU_Image*,SDL_RWops*,GPU_bool,GPU_FileFormatEnum);
138 void GPU_GenerateMipmaps(GPU_Image*);
139 void GPU_SetColor(GPU_Image*,SDL_Color);
140 void GPU_SetRGB(GPU_Image*,ubyte,ubyte,ubyte);
141 void GPU_SetRGBA(GPU_Image*,ubyte,ubyte,ubyte,ubyte);
142 GPU_bool GPU_GetBlending(GPU_Image*);
143 void GPU_SetBlending(GPU_Image*,GPU_bool);
144 void GPU_SetBlendFunction(GPU_Image*,GPU_BlendFuncEnum,GPU_BlendFuncEnum,GPU_BlendFuncEnum,GPU_BlendFuncEnum);
145 void GPU_SetBlendEquation(GPU_Image*,GPU_BlendEqEnum,GPU_BlendEqEnum);
146 void GPU_SetBlendMode(GPU_Image*,GPU_BlendPresetEnum);
147 void GPU_SetImageFilter(GPU_Image*,GPU_FilterEnum);
148 void GPU_SetAnchor(GPU_Image*,float,float);
149 void GPU_GetAnchor(GPU_Image*,float*,float*);
150 GPU_SnapEnum GPU_GetSnapMode(GPU_Image*);
151 void GPU_SetSnapMode(GPU_Image*,GPU_SnapEnum);
152 void GPU_SetWrapMode(GPU_Image*,GPU_WrapEnum,GPU_WrapEnum);
153 GPU_Image* GPU_CopyImageFromSurface(SDL_Surface*);
154 GPU_Image* GPU_CopyImageFromTarget(GPU_Target*);
155 SDL_Surface* GPU_CopySurfaceFromTarget(GPU_Target*);
156 SDL_Surface* GPU_CopySurfaceFromImage(GPU_Image*);
157 float GPU_VectorLength(float*);
158 void GPU_VectorNormalize(float*);
159 float GPU_VectorDot(float*,float*);
160 void GPU_VectorCross(float*,float*,float*);
161 void GPU_VectorCopy(float*,float*);
162 void GPU_VectorApplyMatrix(float*,float*);
163 void GPU_MatrixCopy(float*,float*);
164 void GPU_MatrixIdentity(float*);
165 void GPU_MatrixOrtho(float*,float,float,float,float,float,float);
166 void GPU_MatrixFrustum(float*,float,float,float,float,float,float);
167 void GPU_MatrixPerspective(float*,float,float,float,float);
168 void GPU_MatrixLookAt(float*,float,float,float,float,float,float,float,float,float);
169 void GPU_MatrixTranslate(float*,float,float,float);
170 void GPU_MatrixScale(float*,float,float,float);
171 void GPU_MatrixRotate(float*,float,float,float,float);
172 void GPU_MatrixMultiply(float*,const(float)*,const(float)*);
173 void GPU_MultiplyAndAssign(float*,float*);
174 const(char)* GPU_GetMatrixString(float*);
175 float* GPU_GetCurrentMatrix();
176 float* GPU_GetModelView();
177 float* GPU_GetProjection();
178 void GPU_GetModelViewProjection(float*);
179 void GPU_MatrixMode(int);
180 void GPU_PushMatrix();
181 void GPU_PopMatrix();
182 void GPU_LoadIdentity();
183 void GPU_Ortho(float,float,float,float,float,float);
184 void GPU_Frustum(float,float,float,float,float,float);
185 void GPU_Translate(float,float,float);
186 void GPU_Scale(float,float,float);
187 void GPU_Rotate(float,float,float,float);
188 void GPU_MultMatrix(float*);
189 void GPU_Clear(GPU_Target*);
190 void GPU_ClearColor(GPU_Target*,SDL_Color);
191 void GPU_ClearRGB(GPU_Target*,ubyte,ubyte,ubyte);
192 void GPU_ClearRGBA(GPU_Target*,ubyte,ubyte,ubyte,ubyte);
193 void GPU_Blit(GPU_Image*,GPU_Rect*,GPU_Target*,float,float);
194 void GPU_BlitRotate(GPU_Image*,GPU_Rect*,GPU_Target*,float,float,float);
195 void GPU_BlitScale(GPU_Image*,GPU_Rect*,GPU_Target*,float,float,float,float);
196 void GPU_BlitTransform(GPU_Image*,GPU_Rect*,GPU_Target*,float,float,float,float,float);
197 void GPU_BlitTransformX(GPU_Image*,GPU_Rect*,GPU_Target*,float,float,float,float,float,float,float);
198 void GPU_BlitRect(GPU_Image*,GPU_Rect*,GPU_Target*,GPU_Rect*);
199 void GPU_BlitRectX(GPU_Image*,GPU_Rect*,GPU_Target*,GPU_Rect*,float,float,float,GPU_FlipEnum);
200 void GPU_TriangleBatch(GPU_Image*,GPU_Target*,ushort,float*,uint,ushort*,GPU_BatchFlagEnum);
201 void GPU_TriangleBatchX(GPU_Image*,GPU_Target*,ushort,void*,uint,ushort*,GPU_BatchFlagEnum);
202 void GPU_FlushBlitBuffer();
203 void GPU_Flip(GPU_Target*);
204 void GPU_Pixel(GPU_Target*,float,float,SDL_Color);
205 void GPU_Line(GPU_Target*,float,float,float,float,SDL_Color);
206 void GPU_Arc(GPU_Target*,float,float,float,float,float,SDL_Color);
207 void GPU_ArcFilled(GPU_Target*,float,float,float,float,float,SDL_Color);
208 void GPU_Circle(GPU_Target*,float,float,float,SDL_Color);
209 void GPU_CircleFilled(GPU_Target*,float,float,float,SDL_Color);
210 void GPU_Ellipse(GPU_Target*,float,float,float,float,float,SDL_Color);
211 void GPU_EllipseFilled(GPU_Target*,float,float,float,float,float,SDL_Color);
212 void GPU_Sector(GPU_Target*,float,float,float,float,float,float,SDL_Color);
213 void GPU_SectorFilled(GPU_Target*,float,float,float,float,float,float,SDL_Color);
214 void GPU_Tri(GPU_Target*,float,float,float,float,float,float,SDL_Color);
215 void GPU_TriFilled(GPU_Target*,float,float,float,float,float,float,SDL_Color);
216 void GPU_Rectangle(GPU_Target*,float,float,float,float,SDL_Color);
217 void GPU_Rectangle2(GPU_Target*,GPU_Rect,SDL_Color);
218 void GPU_RectangleFilled(GPU_Target*,float,float,float,float,SDL_Color);
219 void GPU_RectangleFilled2(GPU_Target*,GPU_Rect,SDL_Color);
220 void GPU_RectangleRound(GPU_Target*,float,float,float,float,float,SDL_Color);
221 void GPU_RectangleRound2(GPU_Target*,GPU_Rect,float,SDL_Color);
222 void GPU_RectangleRoundFilled(GPU_Target*,float,float,float,float,float,SDL_Color);
223 void GPU_RectangleRoundFilled2(GPU_Target*,GPU_Rect,float,SDL_Color);
224 void GPU_Polygon(GPU_Target*,uint,float*,SDL_Color);
225 void GPU_PolygonFilled(GPU_Target*,uint,float*,SDL_Color);
226 uint GPU_CreateShaderProgram();
227 void GPU_FreeShaderProgram(uint);
228 uint GPU_CompileShader_RW(GPU_ShaderEnum,SDL_RWops*,GPU_bool);
229 uint GPU_CompileShader(GPU_ShaderEnum,const(char)*);
230 uint GPU_LoadShader(GPU_ShaderEnum,const(char)*);
231 uint GPU_LinkShaders(uint,uint);
232 uint GPU_LinkManyShaders(uint*,int);
233 void GPU_FreeShader(uint);
234 void GPU_AttachShader(uint,uint);
235 void GPU_DetachShader(uint,uint);
236 GPU_bool GPU_LinkShaderProgram(uint);
237 uint GPU_GetCurrentShaderProgram();
238 GPU_bool GPU_IsDefaultShaderProgram(uint);
239 void GPU_ActivateShaderProgram(uint,GPU_ShaderBlock*);
240 void GPU_DeactivateShaderProgram();
241 const(char)* GPU_GetShaderMessage();
242 int GPU_GetAttributeLocation(uint,const(char)*);
243 GPU_AttributeFormat GPU_MakeAttributeFormat(int,GPU_TypeEnum,GPU_bool,int,int);
244 GPU_Attribute GPU_MakeAttribute(int,void*,GPU_AttributeFormat);
245 int GPU_GetUniformLocation(uint,const(char)*);
246 GPU_ShaderBlock GPU_LoadShaderBlock(uint,const(char)*,const(char)*,const(char)*,const(char)*);
247 void GPU_SetShaderBlock(GPU_ShaderBlock);
248 GPU_ShaderBlock GPU_GetShaderBlock();
249 void GPU_SetShaderImage(GPU_Image*,int,int);
250 void GPU_GetUniformiv(uint,int,int*);
251 void GPU_SetUniformi(int,int);
252 void GPU_SetUniformiv(int,int,int,int*);
253 void GPU_GetUniformuiv(uint,int,uint*);
254 void GPU_SetUniformui(int,uint);
255 void GPU_SetUniformuiv(int,int,int,uint*);
256 void GPU_GetUniformfv(uint,int,float*);
257 void GPU_SetUniformf(int,float);
258 void GPU_SetUniformfv(int,int,int,float*);
259 void GPU_GetUniformMatrixfv(uint,int,float*);
260 void GPU_SetUniformMatrixfv(int,int,int,int,GPU_bool,float*);
261 void GPU_SetAttributef(int,float);
262 void GPU_SetAttributei(int,int);
263 void GPU_SetAttributeui(int,uint);
264 void GPU_SetAttributefv(int,int,float*);
265 void GPU_SetAttributeiv(int,int,int*);
266 void GPU_SetAttributeuiv(int,int,uint*);
267 void GPU_SetAttributeSource(int,GPU_Attribute);
268 }
269 }