DEADSOFTWARE

migrating from PanelIDs to panel GUIDs; part two
[d2df-sdl.git] / src / lib / sdl2 / sdlrenderer.inc
1 //from "sdl_renderer.h"
3 {**
4 * Flags used when creating a rendering context
5 *}
6 const
7 SDL_RENDERER_SOFTWARE = $00000001; {**< The renderer is a software fallback *}
8 SDL_RENDERER_ACCELERATED = $00000002; {**< The renderer uses hardware
9 acceleration *}
10 SDL_RENDERER_PRESENTVSYNC = $00000004; {**< Present is synchronized
11 with the refresh rate *}
12 SDL_RENDERER_TARGETTEXTURE = $00000008; {**< The renderer supports
13 rendering to texture *}
15 type
16 PSDL_RendererFlags = ^TSDL_RendererFlags;
17 TSDL_RendererFlags = Word;
19 {**
20 * Information on the capabilities of a render driver or context.
21 *}
22 PSDL_RendererInfo = ^TSDL_RendererInfo;
23 TSDL_RendererInfo = record
24 name: PAnsiChar; {**< The name of the renderer *}
25 flags: UInt32; {**< Supported ::SDL_RendererFlags *}
26 num_texture_formats: UInt32; {**< The number of available texture formats *}
27 texture_formats: array[0..15] of UInt32; {**< The available texture formats *}
28 max_texture_width: SInt32; {**< The maximimum texture width *}
29 max_texture_height: SInt32; {**< The maximimum texture height *}
30 end;
32 {**
33 * The access pattern allowed for a texture.
34 *}
35 type
36 PSDL_TextureAccess = ^TSDL_TextureAccess;
37 TSDL_TextureAccess = SInt32;
39 const
40 SDL_TEXTUREACCESS_STATIC = 0; {**< Changes rarely, not lockable *}
41 SDL_TEXTUREACCESS_STREAMING = 1; {**< Changes frequently, lockable *}
42 SDL_TEXTUREACCESS_TARGET = 2; {**< Texture can be used as a render target *}
44 type
45 {**
46 * The texture channel modulation used in SDL_RenderCopy().
47 *}
48 PSDL_TextureModulate = ^TSDL_TextureModulate;
49 TSDL_TextureModulate = (
50 SDL_TEXTUREMODULATE_NONE, {**< No modulation *}
51 SDL_TEXTUREMODULATE_COLOR, {**< srcC = srcC * color *}
52 SDL_TEXTUREMODULATE_ALPHA {**< srcA = srcA * alpha *}
53 );
55 {**
56 * Flip constants for SDL_RenderCopyEx
57 *}
58 type
59 PSDL_RendererFlip = ^TSDL_RendererFlip;
60 TSDL_RendererFlip = (SDL_FLIP_NONE, {**< Do not flip *}
61 SDL_FLIP_HORIZONTAL, {**< flip horizontally *}
62 SDL_FLIP_VERTICAL {**< flip vertically *}
63 );
65 {**
66 * A structure representing rendering state
67 *}
69 PPSDL_Renderer = ^PSDL_Renderer;
70 PSDL_Renderer = ^TSDL_Renderer;
71 TSDL_Renderer = record
72 end;
74 {**
75 * An efficient driver-specific representation of pixel data
76 *}
77 PSDL_Texture = ^TSDL_Texture;
78 TSDL_Texture = record
79 end;
81 {* Function prototypes *}
83 {**
84 * Get the number of 2D rendering drivers available for the current
85 * display.
86 *
87 * A render driver is a set of code that handles rendering and texture
88 * management on a particular display. Normally there is only one, but
89 * some drivers may have several available with different capabilities.
90 *
91 * SDL_GetRenderDriverInfo()
92 * SDL_CreateRenderer()
93 *}
94 function SDL_GetNumRenderDrivers: SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetNumRenderDrivers' {$ENDIF} {$ENDIF};
96 {**
97 * Get information about a specific 2D rendering driver for the current
98 * display.
99 *
100 * index The index of the driver to query information about.
101 * info A pointer to an SDL_RendererInfo struct to be filled with
102 * information on the rendering driver.
104 * 0 on success, -1 if the index was out of range.
106 * SDL_CreateRenderer()
107 *}
108 function SDL_GetRenderDriverInfo(index: SInt32; info: PSDL_RendererInfo): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetRenderDriverInfo' {$ENDIF} {$ENDIF};
110 {**
111 * Create a window and default renderer
113 * width The width of the window
114 * height The height of the window
115 * window_flags The flags used to create the window
116 * window A pointer filled with the window, or NULL on error
117 * renderer A pointer filled with the renderer, or NULL on error
119 * 0 on success, or -1 on error
120 *}
121 function SDL_CreateWindowAndRenderer(width: SInt32; height: SInt32; window_flags: UInt32; window: PPSDL_Window; renderer: PPSDL_Renderer): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_CreateWindowAndRenderer' {$ENDIF} {$ENDIF};
123 {**
124 * Create a 2D rendering context for a window.
126 * window The window where rendering is displayed.
127 * index The index of the rendering driver to initialize, or -1 to
128 * initialize the first one supporting the requested flags.
129 * flags ::SDL_RendererFlags.
131 * A valid rendering context or NULL if there was an error.
133 * SDL_CreateSoftwareRenderer()
134 * SDL_GetRendererInfo()
135 * SDL_DestroyRenderer()
136 *}
137 function SDL_CreateRenderer(window: PSDL_Window; index: SInt32; flags: UInt32): PSDL_Renderer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_CreateRenderer' {$ENDIF} {$ENDIF};
139 {**
140 * Create a 2D software rendering context for a surface.
142 * surface The surface where rendering is done.
144 * A valid rendering context or NULL if there was an error.
146 * SDL_CreateRenderer()
147 * SDL_DestroyRenderer()
148 *}
149 function SDL_CreateSoftwareRenderer(surface: PSDL_Surface): PSDL_Renderer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_CreateSoftwareRenderer' {$ENDIF} {$ENDIF};
151 {**
152 * Get the renderer associated with a window.
153 *}
154 function SDL_GetRenderer(window: PSDL_Window): PSDL_Renderer cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetRenderer' {$ENDIF} {$ENDIF};
156 {**
157 * Get information about a rendering context.
158 *}
159 function SDL_GetRendererInfo(renderer: PSDL_Renderer; info: PSDL_RendererInfo): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetRendererInfo' {$ENDIF} {$ENDIF};
161 {**
162 * Get the output size of a rendering context.
163 *}
164 function SDL_GetRendererOutputSize(renderer: PSDL_Renderer; w: PInt; h: PInt): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetRendererOutputSize' {$ENDIF} {$ENDIF};
166 {**
167 * Create a texture for a rendering context.
169 * renderer The renderer.
170 * format The format of the texture.
171 * access One of the enumerated values in ::SDL_TextureAccess.
172 * w The width of the texture in pixels.
173 * h The height of the texture in pixels.
175 * The created texture is returned, or 0 if no rendering context was
176 * active, the format was unsupported, or the width or height were out
177 * of range.
179 * SDL_QueryTexture()
180 * SDL_UpdateTexture()
181 * SDL_DestroyTexture()
182 *}
183 function SDL_CreateTexture(renderer: PSDL_Renderer; format: UInt32; access: SInt32; w: SInt32; h: SInt32): PSDL_Texture cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_CreateTexture' {$ENDIF} {$ENDIF};
185 {**
186 * Create a texture from an existing surface.
188 * renderer The renderer.
189 * surface The surface containing pixel data used to fill the texture.
191 * The created texture is returned, or 0 on error.
193 * The surface is not modified or freed by this function.
195 * SDL_QueryTexture()
196 * SDL_DestroyTexture()
197 *}
198 function SDL_CreateTextureFromSurface(renderer: PSDL_Renderer; surface: PSDL_Surface): PSDL_Texture cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_CreateTextureFromSurface' {$ENDIF} {$ENDIF};
200 {**
201 * Query the attributes of a texture
203 * texture A texture to be queried.
204 * format A pointer filled in with the raw format of the texture. The
205 * actual format may differ, but pixel transfers will use this
206 * format.
207 * access A pointer filled in with the actual access to the texture.
208 * w A pointer filled in with the width of the texture in pixels.
209 * h A pointer filled in with the height of the texture in pixels.
211 * 0 on success, or -1 if the texture is not valid.
212 *}
213 function SDL_QueryTexture(texture: PSDL_Texture; format: PUInt32; access: PInt; w: PInt; h: PInt): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_QueryTexture' {$ENDIF} {$ENDIF};
215 {**
216 * Set an additional color value used in render copy operations.
218 * texture The texture to update.
219 * r The red color value multiplied into copy operations.
220 * g The green color value multiplied into copy operations.
221 * b The blue color value multiplied into copy operations.
223 * 0 on success, or -1 if the texture is not valid or color modulation
224 * is not supported.
226 * SDL_GetTextureColorMod()
227 *}
228 function SDL_SetTextureColorMod(texture: PSDL_Texture; r: UInt8; g: UInt8; b: UInt8): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetTextureColorMod' {$ENDIF} {$ENDIF};
230 {**
231 * Get the additional color value used in render copy operations.
233 * texture The texture to query.
234 * r A pointer filled in with the current red color value.
235 * g A pointer filled in with the current green color value.
236 * b A pointer filled in with the current blue color value.
238 * 0 on success, or -1 if the texture is not valid.
240 * SDL_SetTextureColorMod()
241 *}
242 function SDL_GetTextureColorMod(texture: PSDL_Texture; r: PUInt8; g: PUInt8; b: PUInt8): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetTextureColorMod' {$ENDIF} {$ENDIF};
244 {**
245 * Set an additional alpha value used in render copy operations.
247 * texture The texture to update.
248 * alpha The alpha value multiplied into copy operations.
250 * 0 on success, or -1 if the texture is not valid or alpha modulation
251 * is not supported.
253 * SDL_GetTextureAlphaMod()
254 *}
255 function SDL_SetTextureAlphaMod(texture: PSDL_Texture; alpha: UInt8): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetTextureAlphaMod' {$ENDIF} {$ENDIF};
257 {**
258 * Get the additional alpha value used in render copy operations.
260 * texture The texture to query.
261 * alpha A pointer filled in with the current alpha value.
263 * 0 on success, or -1 if the texture is not valid.
265 * SDL_SetTextureAlphaMod()
266 *}
267 function SDL_GetTextureAlphaMod(texture: PSDL_Texture; alpha: PUInt8): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetTextureAlphaMod' {$ENDIF} {$ENDIF};
269 {**
270 * Set the blend mode used for texture copy operations.
272 * texture The texture to update.
273 * blendMode ::SDL_BlendMode to use for texture blending.
275 * 0 on success, or -1 if the texture is not valid or the blend mode is
276 * not supported.
278 * If the blend mode is not supported, the closest supported mode is
279 * chosen.
281 * SDL_GetTextureBlendMode()
282 *}
283 function SDL_SetTextureBlendMode(texture: PSDL_Texture; blendMode: TSDL_BlendMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetTextureBlendMode' {$ENDIF} {$ENDIF};
285 {**
286 * Get the blend mode used for texture copy operations.
288 * texture The texture to query.
289 * blendMode A pointer filled in with the current blend mode.
291 * 0 on success, or -1 if the texture is not valid.
293 * SDL_SetTextureBlendMode()
294 *}
295 function SDL_GetTextureBlendMode(texture: PSDL_Texture; blendMode: PSDL_BlendMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetTextureBlendMode' {$ENDIF} {$ENDIF};
297 {**
298 * Update the given texture rectangle with new pixel data.
300 * texture The texture to update
301 * rect A pointer to the rectangle of pixels to update, or NULL to
302 * update the entire texture.
303 * pixels The raw pixel data.
304 * pitch The number of bytes between rows of pixel data.
306 * 0 on success, or -1 if the texture is not valid.
308 * This is a fairly slow function.
309 *}
310 function SDL_UpdateTexture(texture: PSDL_Texture; rect: PSDL_Rect; pixels: Pointer; pitch: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_UpdateTexture' {$ENDIF} {$ENDIF};
312 {**
313 * Lock a portion of the texture for write-only pixel access.
315 * texture The texture to lock for access, which was created with
316 * SDL_TEXTUREACCESS_STREAMING.
317 * rect A pointer to the rectangle to lock for access. If the rect
318 * is NULL, the entire texture will be locked.
319 * pixels This is filled in with a pointer to the locked pixels,
320 * appropriately offset by the locked area.
321 * pitch This is filled in with the pitch of the locked pixels.
323 * 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
325 * SDL_UnlockTexture()
326 *}
327 function SDL_LockTexture(texture: PSDL_Texture; rect: PSDL_Rect; pixels: PPointer; pitch: PInt): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LockTexture' {$ENDIF} {$ENDIF};
329 {**
330 * Unlock a texture, uploading the changes to video memory, if needed.
332 * SDL_LockTexture()
333 *}
334 procedure SDL_UnlockTexture(texture: PSDL_Texture) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_LockTexture' {$ENDIF} {$ENDIF};
336 {**
337 * Determines whether a window supports the use of render targets
339 * renderer The renderer that will be checked
341 * SDL_TRUE if supported, SDL_FALSE if not.
342 *}
343 function SDL_RenderTargetSupported(renderer: PSDL_Renderer): Boolean cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderTargetSupported' {$ENDIF} {$ENDIF};
345 {**
346 * Set a texture as the current rendering target.
348 * renderer The renderer.
349 * texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
351 * 0 on success, or -1 on error
353 * SDL_GetRenderTarget()
354 *}
355 function SDL_SetRenderTarget(renderer: PSDL_Renderer; texture: PSDL_Texture): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetRenderTarget' {$ENDIF} {$ENDIF};
357 {**
358 * Get the current render target or NULL for the default render target.
360 * The current render target
362 * SDL_SetRenderTarget()
363 *}
364 function SDL_GetRenderTarget(renderer: PSDL_Renderer): PSDL_Texture cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetRenderTarget' {$ENDIF} {$ENDIF};
366 {**
367 * Set device independent resolution for rendering
369 * renderer The renderer for which resolution should be set.
370 * w The width of the logical resolution
371 * h The height of the logical resolution
373 * This function uses the viewport and scaling functionality to allow a fixed logical
374 * resolution for rendering, regardless of the actual output resolution. If the actual
375 * output resolution doesn't have the same aspect ratio the output rendering will be
376 * centered within the output display.
378 * If the output display is a window, mouse events in the window will be filtered
379 * and scaled so they seem to arrive within the logical resolution.
381 * If this function results in scaling or subpixel drawing by the
382 * rendering backend, it will be handled using the appropriate
383 * quality hints.
385 * SDL_RenderGetLogicalSize()
386 * SDL_RenderSetScale()
387 * SDL_RenderSetViewport()
388 *}
389 function SDL_RenderSetLogicalSize(renderer: PSDL_Renderer; w: SInt32; h: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderSetLogicalSize' {$ENDIF} {$ENDIF};
391 {**
392 * Get device independent resolution for rendering
394 * renderer The renderer from which resolution should be queried.
395 * w A pointer filled with the width of the logical resolution
396 * h A pointer filled with the height of the logical resolution
398 * SDL_RenderSetLogicalSize()
399 *}
400 procedure SDL_RenderGetLogicalSize(renderer: PSDL_Renderer; w: PInt; h: PInt) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderGetLogicalSize' {$ENDIF} {$ENDIF};
402 {**
403 * Set the drawing area for rendering on the current target.
405 * renderer The renderer for which the drawing area should be set.
406 * rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
408 * The x,y of the viewport rect represents the origin for rendering.
410 * 0 on success, or -1 on error
412 * If the window associated with the renderer is resized, the viewport is automatically reset.
414 * SDL_RenderGetViewport()
415 * SDL_RenderSetLogicalSize()
416 *}
417 function SDL_RenderSetViewport(renderer: PSDL_Renderer; const rect: PSDL_Rect): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderSetViewport' {$ENDIF} {$ENDIF};
419 {**
420 * Get the drawing area for the current target.
422 * SDL_RenderSetViewport()
423 *}
424 procedure SDL_RenderGetViewport(renderer: PSDL_Renderer; rect: PSDL_Rect) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderGetViewport' {$ENDIF} {$ENDIF};
426 {**
427 * Set the clip rectangle for the current target.
429 * renderer The renderer for which clip rectangle should be set.
430 * rect A pointer to the rectangle to set as the clip rectangle, or
431 * NULL to disable clipping.
433 * 0 on success, or -1 on error
435 * SDL_RenderGetClipRect()
436 *}
437 function SDL_RenderSetClipRect(renderer: PSDL_Renderer; rect: PSDL_Rect): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderSetClipRect' {$ENDIF} {$ENDIF};
439 {**
440 * Get the clip rectangle for the current target.
442 * renderer The renderer from which clip rectangle should be queried.
443 * rect A pointer filled in with the current clip rectangle, or
444 * an empty rectangle if clipping is disabled.
446 * SDL_RenderSetClipRect()
447 *}
448 procedure SDL_RenderGetClipRect(renderer: PSDL_Renderer; rect: PSDL_Rect) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderGetClipRect' {$ENDIF} {$ENDIF};
450 {**
451 * Set the drawing scale for rendering on the current target.
453 * renderer The renderer for which the drawing scale should be set.
454 * scaleX The horizontal scaling factor
455 * scaleY The vertical scaling factor
457 * The drawing coordinates are scaled by the x/y scaling factors
458 * before they are used by the renderer. This allows resolution
459 * independent drawing with a single coordinate system.
461 * If this results in scaling or subpixel drawing by the
462 * rendering backend, it will be handled using the appropriate
463 * quality hints. For best results use integer scaling factors.
465 * SDL_RenderGetScale()
466 * SDL_RenderSetLogicalSize()
467 *}
468 function SDL_RenderSetScale(renderer: PSDL_Renderer; scaleX: Float; scaleY: Float): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderSetScale' {$ENDIF} {$ENDIF};
470 {**
471 * Get the drawing scale for the current target.
473 * renderer The renderer from which drawing scale should be queried.
474 * scaleX A pointer filled in with the horizontal scaling factor
475 * scaleY A pointer filled in with the vertical scaling factor
477 * SDL_RenderSetScale()
478 *}
479 procedure SDL_RenderGetScale(renderer: PSDL_Renderer; scaleX: PFloat; scaleY: PFloat) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderGetScale' {$ENDIF} {$ENDIF};
481 {**
482 * Set the color used for drawing operations (Rect, Line and Clear).
484 * renderer The renderer for which drawing color should be set.
485 * r The red value used to draw on the rendering target.
486 * g The green value used to draw on the rendering target.
487 * b The blue value used to draw on the rendering target.
488 * a The alpha value used to draw on the rendering target, usually
489 * SDL_ALPHA_OPAQUE (255).
491 * 0 on success, or -1 on error
492 *}
493 function SDL_SetRenderDrawColor(renderer: PSDL_Renderer; r: UInt8; g: UInt8; b: UInt8; a: UInt8): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetRenderDrawColor' {$ENDIF} {$ENDIF};
495 {**
496 * Get the color used for drawing operations (Rect, Line and Clear).
498 * renderer The renderer from which drawing color should be queried.
499 * r A pointer to the red value used to draw on the rendering target.
500 * g A pointer to the green value used to draw on the rendering target.
501 * b A pointer to the blue value used to draw on the rendering target.
502 * a A pointer to the alpha value used to draw on the rendering target,
503 * usually SDL_ALPHA_OPAQUE (255).
505 * 0 on success, or -1 on error
506 *}
507 function SDL_GetRenderDrawColor(renderer: PSDL_Renderer; r: PUInt8; g: PUInt8; b: PUInt8; a: PUInt8): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetRenderDrawColor' {$ENDIF} {$ENDIF};
509 {**
510 * Set the blend mode used for drawing operations (Fill and Line).
512 * renderer The renderer for which blend mode should be set.
513 * blendMode SDL_BlendMode to use for blending.
515 * 0 on success, or -1 on error
517 * If the blend mode is not supported, the closest supported mode is
518 * chosen.
520 * SDL_GetRenderDrawBlendMode()
521 *}
522 function SDL_SetRenderDrawBlendMode(renderer: PSDL_Renderer; blendMode: TSDL_BlendMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_SetRenderDrawBlendMode' {$ENDIF} {$ENDIF};
524 {**
525 * Get the blend mode used for drawing operations.
527 * renderer The renderer from which blend mode should be queried.
528 * blendMode A pointer filled in with the current blend mode.
530 * 0 on success, or -1 on error
532 * SDL_SetRenderDrawBlendMode()
533 *}
534 function SDL_GetRenderDrawBlendMode(renderer: PSDL_Renderer; blendMode: PSDL_BlendMode): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GetRenderDrawBlendMode' {$ENDIF} {$ENDIF};
536 {**
537 * Clear the current rendering target with the drawing color
539 * This function clears the entire rendering target, ignoring the viewport.
541 * 0 on success, or -1 on error
542 *}
543 function SDL_RenderClear(renderer: PSDL_Renderer): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderClear' {$ENDIF} {$ENDIF};
545 {**
546 * Draw a point on the current rendering target.
548 * renderer The renderer which should draw a point.
549 * x The x coordinate of the point.
550 * y The y coordinate of the point.
552 * 0 on success, or -1 on error
553 *}
554 function SDL_RenderDrawPoint(renderer: PSDL_Renderer; x: SInt32; y: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawPoint' {$ENDIF} {$ENDIF};
556 {**
557 * Draw multiple points on the current rendering target.
559 * renderer The renderer which should draw multiple points.
560 * points The points to draw
561 * count The number of points to draw
563 * 0 on success, or -1 on error
564 *}
565 function SDL_RenderDrawPoints(renderer: PSDL_Renderer; points: PSDL_Point; count: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawPoints' {$ENDIF} {$ENDIF};
567 {**
568 * Draw a line on the current rendering target.
570 * renderer The renderer which should draw a line.
571 * x1 The x coordinate of the start point.
572 * y1 The y coordinate of the start point.
573 * x2 The x coordinate of the end point.
574 * y2 The y coordinate of the end point.
576 * 0 on success, or -1 on error
577 *}
578 function SDL_RenderDrawLine(renderer: PSDL_Renderer; x1: SInt32; y1: SInt32; x2: SInt32; y2: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawLine' {$ENDIF} {$ENDIF};
580 {**
581 * \brief Draw a series of connected lines on the current rendering target.
583 * \param renderer The renderer which should draw multiple lines.
584 * \param points The points along the lines
585 * \param count The number of points, drawing count-1 lines
587 * \return 0 on success, or -1 on error
588 *}
589 function SDL_RenderDrawLines(renderer: PSDL_Renderer; points: PSDL_Point; count: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawLines' {$ENDIF} {$ENDIF};
591 {**
592 * Draw a rectangle on the current rendering target.
594 * renderer The renderer which should draw a rectangle.
595 * rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
597 * 0 on success, or -1 on error
598 *}
599 function SDL_RenderDrawRect(renderer: PSDL_Renderer; rect: PSDL_Rect): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawRect' {$ENDIF} {$ENDIF};
601 {**
602 * Draw some number of rectangles on the current rendering target.
604 * renderer The renderer which should draw multiple rectangles.
605 * rects A pointer to an array of destination rectangles.
606 * count The number of rectangles.
608 * 0 on success, or -1 on error
609 *}
610 function SDL_RenderDrawRects(renderer: PSDL_Renderer; rects: PSDL_Rect; count: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderDrawRects' {$ENDIF} {$ENDIF};
612 {**
613 * Fill a rectangle on the current rendering target with the drawing color.
615 * renderer The renderer which should fill a rectangle.
616 * rect A pointer to the destination rectangle, or NULL for the entire
617 * rendering target.
619 * 0 on success, or -1 on error
620 *}
621 function SDL_RenderFillRect(renderer: PSDL_Renderer; rect: PSDL_Rect): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderFillRect' {$ENDIF} {$ENDIF};
623 {**
624 * Fill some number of rectangles on the current rendering target with the drawing color.
626 * renderer The renderer which should fill multiple rectangles.
627 * rects A pointer to an array of destination rectangles.
628 * count The number of rectangles.
630 * 0 on success, or -1 on error
631 *}
632 function SDL_RenderFillRects(renderer: PSDL_Renderer; rects: PSDL_Rect; count: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderFillRects' {$ENDIF} {$ENDIF};
634 {**
635 * Copy a portion of the texture to the current rendering target.
637 * renderer The renderer which should copy parts of a texture.
638 * texture The source texture.
639 * srcrect A pointer to the source rectangle, or NULL for the entire
640 * texture.
641 * dstrect A pointer to the destination rectangle, or NULL for the
642 * entire rendering target.
644 * 0 on success, or -1 on error
645 *}
646 function SDL_RenderCopy(renderer: PSDL_Renderer; texture: PSDL_Texture; srcrect: PSDL_Rect; dstrect: PSDL_Rect): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderCopy' {$ENDIF} {$ENDIF};
648 {**
649 * Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
651 * renderer The renderer which should copy parts of a texture.
652 * texture The source texture.
653 * srcrect A pointer to the source rectangle, or NULL for the entire
654 * texture.
655 * dstrect A pointer to the destination rectangle, or NULL for the
656 * entire rendering target.
657 * angle An angle in degrees that indicates the rotation that will be applied to dstrect
658 * center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done aroud dstrect.w/2, dstrect.h/2)
659 * flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture
661 * 0 on success, or -1 on error
662 *}
663 function SDL_RenderCopyEx(renderer: PSDL_Renderer; texture: PSDL_Texture; const srcrect: PSDL_Rect; dstrect: PSDL_Rect; angle: Double; center: PSDL_Point; flip: TSDL_RendererFlip): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderCopyEx' {$ENDIF} {$ENDIF};
665 {**
666 * Read pixels from the current rendering target.
668 * renderer The renderer from which pixels should be read.
669 * rect A pointer to the rectangle to read, or NULL for the entire
670 * render target.
671 * format The desired format of the pixel data, or 0 to use the format
672 * of the rendering target
673 * pixels A pointer to be filled in with the pixel data
674 * pitch The pitch of the pixels parameter.
676 * 0 on success, or -1 if pixel reading is not supported.
678 * This is a very slow operation, and should not be used frequently.
679 *}
680 function SDL_RenderReadPixels(renderer: PSDL_Renderer; rect: PSDL_Rect; format: UInt32; pixels: Pointer; pitch: SInt32): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderReadPixels' {$ENDIF} {$ENDIF};
682 {**
683 * Update the screen with rendering performed.
684 *}
685 procedure SDL_RenderPresent(renderer: PSDL_Renderer) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_RenderPresent' {$ENDIF} {$ENDIF};
687 {**
688 * Destroy the specified texture.
690 * SDL_CreateTexture()
691 * SDL_CreateTextureFromSurface()
692 *}
693 procedure SDL_DestroyTexture(texture: PSDL_Texture) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DestroyTexture' {$ENDIF} {$ENDIF};
695 {**
696 * Destroy the rendering context for a window and free associated
697 * textures.
699 * SDL_CreateRenderer()
700 *}
701 procedure SDL_DestroyRenderer(renderer: PSDL_Renderer) cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_DestroyRenderer' {$ENDIF} {$ENDIF};
703 {**
704 * Bind the texture to the current OpenGL/ES/ES2 context for use with
705 * OpenGL instructions.
707 * texture The SDL texture to bind
708 * texw A pointer to a float that will be filled with the texture width
709 * texh A pointer to a float that will be filled with the texture height
711 * 0 on success, or -1 if the operation is not supported
712 *}
713 function SDL_GL_BindTexture(texture: PSDL_Texture; texw: PFloat; texh: PFloat): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_BindTexture' {$ENDIF} {$ENDIF};
715 {**
716 * Unbind a texture from the current OpenGL/ES/ES2 context.
718 * texture The SDL texture to unbind
720 * 0 on success, or -1 if the operation is not supported
721 *}
722 function SDL_GL_UnbindTexture(texture: PSDL_Texture): SInt32 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_GL_UnbindTexture' {$ENDIF} {$ENDIF};
724 {**
725 * Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
727 * texture The texture to update
728 * rect A pointer to the rectangle of pixels to update, or NULL to update the entire texture.
729 * Yplane The raw pixel data for the Y plane.
730 * Ypitch The number of bytes between rows of pixel data for the Y plane.
731 * Uplane The raw pixel data for the U plane.
732 * Upitch The number of bytes between rows of pixel data for the U plane.
733 * Vplane The raw pixel data for the V plane.
734 * Vpitch The number of bytes between rows of pixel data for the V plane.
736 * 0 on success, or -1 if the texture is not valid.
738 * You can use SDL_UpdateTexture() as long as your pixel data is
739 * a contiguous block of Y and U/V planes in the proper order, but
740 * this function is available if your pixel data is not contiguous.
741 *}
742 function SDL_UpdateYUVTexture(texture: PSDL_Texture; rect: PSDL_Rect; Yplane: PUInt8; Ypitch: SInt32; Uplane: PUInt8; UPitch: SInt32; Vplane: UInt8; VPitch: SInt32):SInt32;
743 cdecl; external SDL_LibName {$IFDEF DELPHI} {$IFDEF MACOS} name '_SDL_UpdateYUVTexture' {$ENDIF} {$ENDIF};