SDL  2.0
SDL_render.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2019 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
22 /**
23  * \file SDL_render.h
24  *
25  * Header file for SDL 2D rendering functions.
26  *
27  * This API supports the following features:
28  * * single pixel points
29  * * single pixel lines
30  * * filled rectangles
31  * * texture images
32  *
33  * The primitives may be drawn in opaque, blended, or additive modes.
34  *
35  * The texture images may be drawn in opaque, blended, or additive modes.
36  * They can have an additional color tint or alpha modulation applied to
37  * them, and may also be stretched with linear interpolation.
38  *
39  * This API is designed to accelerate simple 2D operations. You may
40  * want more functionality such as polygons and particle effects and
41  * in that case you should use SDL's OpenGL/Direct3D support or one
42  * of the many good 3D engines.
43  *
44  * These functions must be called from the main thread.
45  * See this bug for details: http://bugzilla.libsdl.org/show_bug.cgi?id=1995
46  */
47 
48 #ifndef SDL_render_h_
49 #define SDL_render_h_
50 
51 #include "SDL_stdinc.h"
52 #include "SDL_rect.h"
53 #include "SDL_video.h"
54 
55 #include "begin_code.h"
56 /* Set up for C function definitions, even when using C++ */
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 /**
62  * \brief Flags used when creating a rendering context
63  */
64 typedef enum
65 {
66  SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */
67  SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware
68  acceleration */
69  SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized
70  with the refresh rate */
71  SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports
72  rendering to texture */
74 
75 /**
76  * \brief Information on the capabilities of a render driver or context.
77  */
78 typedef struct SDL_RendererInfo
79 {
80  const char *name; /**< The name of the renderer */
81  Uint32 flags; /**< Supported ::SDL_RendererFlags */
82  Uint32 num_texture_formats; /**< The number of available texture formats */
83  Uint32 texture_formats[16]; /**< The available texture formats */
84  int max_texture_width; /**< The maximum texture width */
85  int max_texture_height; /**< The maximum texture height */
87 
88 /**
89  * \brief The access pattern allowed for a texture.
90  */
91 typedef enum
92 {
93  SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */
94  SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */
95  SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */
97 
98 /**
99  * \brief The texture channel modulation used in SDL_RenderCopy().
100  */
101 typedef enum
102 {
103  SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */
104  SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */
105  SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */
107 
108 /**
109  * \brief Flip constants for SDL_RenderCopyEx
110  */
111 typedef enum
112 {
113  SDL_FLIP_NONE = 0x00000000, /**< Do not flip */
114  SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */
115  SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */
117 
118 /**
119  * \brief A structure representing rendering state
120  */
121 struct SDL_Renderer;
122 typedef struct SDL_Renderer SDL_Renderer;
123 
124 /**
125  * \brief An efficient driver-specific representation of pixel data
126  */
127 struct SDL_Texture;
128 typedef struct SDL_Texture SDL_Texture;
129 
130 
131 /* Function prototypes */
132 
133 /**
134  * \brief Get the number of 2D rendering drivers available for the current
135  * display.
136  *
137  * A render driver is a set of code that handles rendering and texture
138  * management on a particular display. Normally there is only one, but
139  * some drivers may have several available with different capabilities.
140  *
141  * \sa SDL_GetRenderDriverInfo()
142  * \sa SDL_CreateRenderer()
143  */
144 extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
145 
146 /**
147  * \brief Get information about a specific 2D rendering driver for the current
148  * display.
149  *
150  * \param index The index of the driver to query information about.
151  * \param info A pointer to an SDL_RendererInfo struct to be filled with
152  * information on the rendering driver.
153  *
154  * \return 0 on success, -1 if the index was out of range.
155  *
156  * \sa SDL_CreateRenderer()
157  */
159  SDL_RendererInfo * info);
160 
161 /**
162  * \brief Create a window and default renderer
163  *
164  * \param width The width of the window
165  * \param height The height of the window
166  * \param window_flags The flags used to create the window
167  * \param window A pointer filled with the window, or NULL on error
168  * \param renderer A pointer filled with the renderer, or NULL on error
169  *
170  * \return 0 on success, or -1 on error
171  */
173  int width, int height, Uint32 window_flags,
175 
176 
177 /**
178  * \brief Create a 2D rendering context for a window.
179  *
180  * \param window The window where rendering is displayed.
181  * \param index The index of the rendering driver to initialize, or -1 to
182  * initialize the first one supporting the requested flags.
183  * \param flags ::SDL_RendererFlags.
184  *
185  * \return A valid rendering context or NULL if there was an error.
186  *
187  * \sa SDL_CreateSoftwareRenderer()
188  * \sa SDL_GetRendererInfo()
189  * \sa SDL_DestroyRenderer()
190  */
192  int index, Uint32 flags);
193 
194 /**
195  * \brief Create a 2D software rendering context for a surface.
196  *
197  * \param surface The surface where rendering is done.
198  *
199  * \return A valid rendering context or NULL if there was an error.
200  *
201  * \sa SDL_CreateRenderer()
202  * \sa SDL_DestroyRenderer()
203  */
205 
206 /**
207  * \brief Get the renderer associated with a window.
208  */
210 
211 /**
212  * \brief Get information about a rendering context.
213  */
215  SDL_RendererInfo * info);
216 
217 /**
218  * \brief Get the output size in pixels of a rendering context.
219  */
221  int *w, int *h);
222 
223 /**
224  * \brief Create a texture for a rendering context.
225  *
226  * \param renderer The renderer.
227  * \param format The format of the texture.
228  * \param access One of the enumerated values in ::SDL_TextureAccess.
229  * \param w The width of the texture in pixels.
230  * \param h The height of the texture in pixels.
231  *
232  * \return The created texture is returned, or NULL if no rendering context was
233  * active, the format was unsupported, or the width or height were out
234  * of range.
235  *
236  * \note The contents of the texture are not defined at creation.
237  *
238  * \sa SDL_QueryTexture()
239  * \sa SDL_UpdateTexture()
240  * \sa SDL_DestroyTexture()
241  */
243  Uint32 format,
244  int access, int w,
245  int h);
246 
247 /**
248  * \brief Create a texture from an existing surface.
249  *
250  * \param renderer The renderer.
251  * \param surface The surface containing pixel data used to fill the texture.
252  *
253  * \return The created texture is returned, or NULL on error.
254  *
255  * \note The surface is not modified or freed by this function.
256  *
257  * \sa SDL_QueryTexture()
258  * \sa SDL_DestroyTexture()
259  */
261 
262 /**
263  * \brief Query the attributes of a texture
264  *
265  * \param texture A texture to be queried.
266  * \param format A pointer filled in with the raw format of the texture. The
267  * actual format may differ, but pixel transfers will use this
268  * format.
269  * \param access A pointer filled in with the actual access to the texture.
270  * \param w A pointer filled in with the width of the texture in pixels.
271  * \param h A pointer filled in with the height of the texture in pixels.
272  *
273  * \return 0 on success, or -1 if the texture is not valid.
274  */
276  Uint32 * format, int *access,
277  int *w, int *h);
278 
279 /**
280  * \brief Set an additional color value used in render copy operations.
281  *
282  * \param texture The texture to update.
283  * \param r The red color value multiplied into copy operations.
284  * \param g The green color value multiplied into copy operations.
285  * \param b The blue color value multiplied into copy operations.
286  *
287  * \return 0 on success, or -1 if the texture is not valid or color modulation
288  * is not supported.
289  *
290  * \sa SDL_GetTextureColorMod()
291  */
293  Uint8 r, Uint8 g, Uint8 b);
294 
295 
296 /**
297  * \brief Get the additional color value used in render copy operations.
298  *
299  * \param texture The texture to query.
300  * \param r A pointer filled in with the current red color value.
301  * \param g A pointer filled in with the current green color value.
302  * \param b A pointer filled in with the current blue color value.
303  *
304  * \return 0 on success, or -1 if the texture is not valid.
305  *
306  * \sa SDL_SetTextureColorMod()
307  */
309  Uint8 * r, Uint8 * g,
310  Uint8 * b);
311 
312 /**
313  * \brief Set an additional alpha value used in render copy operations.
314  *
315  * \param texture The texture to update.
316  * \param alpha The alpha value multiplied into copy operations.
317  *
318  * \return 0 on success, or -1 if the texture is not valid or alpha modulation
319  * is not supported.
320  *
321  * \sa SDL_GetTextureAlphaMod()
322  */
324  Uint8 alpha);
325 
326 /**
327  * \brief Get the additional alpha value used in render copy operations.
328  *
329  * \param texture The texture to query.
330  * \param alpha A pointer filled in with the current alpha value.
331  *
332  * \return 0 on success, or -1 if the texture is not valid.
333  *
334  * \sa SDL_SetTextureAlphaMod()
335  */
337  Uint8 * alpha);
338 
339 /**
340  * \brief Set the blend mode used for texture copy operations.
341  *
342  * \param texture The texture to update.
343  * \param blendMode ::SDL_BlendMode to use for texture blending.
344  *
345  * \return 0 on success, or -1 if the texture is not valid or the blend mode is
346  * not supported.
347  *
348  * \note If the blend mode is not supported, the closest supported mode is
349  * chosen.
350  *
351  * \sa SDL_GetTextureBlendMode()
352  */
355 
356 /**
357  * \brief Get the blend mode used for texture copy operations.
358  *
359  * \param texture The texture to query.
360  * \param blendMode A pointer filled in with the current blend mode.
361  *
362  * \return 0 on success, or -1 if the texture is not valid.
363  *
364  * \sa SDL_SetTextureBlendMode()
365  */
368 
369 /**
370  * \brief Update the given texture rectangle with new pixel data.
371  *
372  * \param texture The texture to update
373  * \param rect A pointer to the rectangle of pixels to update, or NULL to
374  * update the entire texture.
375  * \param pixels The raw pixel data in the format of the texture.
376  * \param pitch The number of bytes in a row of pixel data, including padding between lines.
377  *
378  * The pixel data must be in the format of the texture. The pixel format can be
379  * queried with SDL_QueryTexture.
380  *
381  * \return 0 on success, or -1 if the texture is not valid.
382  *
383  * \note This is a fairly slow function.
384  */
386  const SDL_Rect * rect,
387  const void *pixels, int pitch);
388 
389 /**
390  * \brief Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
391  *
392  * \param texture The texture to update
393  * \param rect A pointer to the rectangle of pixels to update, or NULL to
394  * update the entire texture.
395  * \param Yplane The raw pixel data for the Y plane.
396  * \param Ypitch The number of bytes between rows of pixel data for the Y plane.
397  * \param Uplane The raw pixel data for the U plane.
398  * \param Upitch The number of bytes between rows of pixel data for the U plane.
399  * \param Vplane The raw pixel data for the V plane.
400  * \param Vpitch The number of bytes between rows of pixel data for the V plane.
401  *
402  * \return 0 on success, or -1 if the texture is not valid.
403  *
404  * \note You can use SDL_UpdateTexture() as long as your pixel data is
405  * a contiguous block of Y and U/V planes in the proper order, but
406  * this function is available if your pixel data is not contiguous.
407  */
409  const SDL_Rect * rect,
410  const Uint8 *Yplane, int Ypitch,
411  const Uint8 *Uplane, int Upitch,
412  const Uint8 *Vplane, int Vpitch);
413 
414 /**
415  * \brief Lock a portion of the texture for write-only pixel access.
416  *
417  * \param texture The texture to lock for access, which was created with
418  * ::SDL_TEXTUREACCESS_STREAMING.
419  * \param rect A pointer to the rectangle to lock for access. If the rect
420  * is NULL, the entire texture will be locked.
421  * \param pixels This is filled in with a pointer to the locked pixels,
422  * appropriately offset by the locked area.
423  * \param pitch This is filled in with the pitch of the locked pixels.
424  *
425  * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
426  *
427  * \sa SDL_UnlockTexture()
428  */
430  const SDL_Rect * rect,
431  void **pixels, int *pitch);
432 
433 /**
434  * \brief Unlock a texture, uploading the changes to video memory, if needed.
435  *
436  * \sa SDL_LockTexture()
437  */
439 
440 /**
441  * \brief Determines whether a window supports the use of render targets
442  *
443  * \param renderer The renderer that will be checked
444  *
445  * \return SDL_TRUE if supported, SDL_FALSE if not.
446  */
448 
449 /**
450  * \brief Set a texture as the current rendering target.
451  *
452  * \param renderer The renderer.
453  * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
454  *
455  * \return 0 on success, or -1 on error
456  *
457  * \sa SDL_GetRenderTarget()
458  */
461 
462 /**
463  * \brief Get the current render target or NULL for the default render target.
464  *
465  * \return The current render target
466  *
467  * \sa SDL_SetRenderTarget()
468  */
470 
471 /**
472  * \brief Set device independent resolution for rendering
473  *
474  * \param renderer The renderer for which resolution should be set.
475  * \param w The width of the logical resolution
476  * \param h The height of the logical resolution
477  *
478  * This function uses the viewport and scaling functionality to allow a fixed logical
479  * resolution for rendering, regardless of the actual output resolution. If the actual
480  * output resolution doesn't have the same aspect ratio the output rendering will be
481  * centered within the output display.
482  *
483  * If the output display is a window, mouse events in the window will be filtered
484  * and scaled so they seem to arrive within the logical resolution.
485  *
486  * \note If this function results in scaling or subpixel drawing by the
487  * rendering backend, it will be handled using the appropriate
488  * quality hints.
489  *
490  * \sa SDL_RenderGetLogicalSize()
491  * \sa SDL_RenderSetScale()
492  * \sa SDL_RenderSetViewport()
493  */
495 
496 /**
497  * \brief Get device independent resolution for rendering
498  *
499  * \param renderer The renderer from which resolution should be queried.
500  * \param w A pointer filled with the width of the logical resolution
501  * \param h A pointer filled with the height of the logical resolution
502  *
503  * \sa SDL_RenderSetLogicalSize()
504  */
506 
507 /**
508  * \brief Set whether to force integer scales for resolution-independent rendering
509  *
510  * \param renderer The renderer for which integer scaling should be set.
511  * \param enable Enable or disable integer scaling
512  *
513  * This function restricts the logical viewport to integer values - that is, when
514  * a resolution is between two multiples of a logical size, the viewport size is
515  * rounded down to the lower multiple.
516  *
517  * \sa SDL_RenderSetLogicalSize()
518  */
520  SDL_bool enable);
521 
522 /**
523  * \brief Get whether integer scales are forced for resolution-independent rendering
524  *
525  * \param renderer The renderer from which integer scaling should be queried.
526  *
527  * \sa SDL_RenderSetIntegerScale()
528  */
530 
531 /**
532  * \brief Set the drawing area for rendering on the current target.
533  *
534  * \param renderer The renderer for which the drawing area should be set.
535  * \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
536  *
537  * The x,y of the viewport rect represents the origin for rendering.
538  *
539  * \return 0 on success, or -1 on error
540  *
541  * \note If the window associated with the renderer is resized, the viewport is automatically reset.
542  *
543  * \sa SDL_RenderGetViewport()
544  * \sa SDL_RenderSetLogicalSize()
545  */
547  const SDL_Rect * rect);
548 
549 /**
550  * \brief Get the drawing area for the current target.
551  *
552  * \sa SDL_RenderSetViewport()
553  */
555  SDL_Rect * rect);
556 
557 /**
558  * \brief Set the clip rectangle for the current target.
559  *
560  * \param renderer The renderer for which clip rectangle should be set.
561  * \param rect A pointer to the rectangle to set as the clip rectangle, or
562  * NULL to disable clipping.
563  *
564  * \return 0 on success, or -1 on error
565  *
566  * \sa SDL_RenderGetClipRect()
567  */
569  const SDL_Rect * rect);
570 
571 /**
572  * \brief Get the clip rectangle for the current target.
573  *
574  * \param renderer The renderer from which clip rectangle should be queried.
575  * \param rect A pointer filled in with the current clip rectangle, or
576  * an empty rectangle if clipping is disabled.
577  *
578  * \sa SDL_RenderSetClipRect()
579  */
581  SDL_Rect * rect);
582 
583 /**
584  * \brief Get whether clipping is enabled on the given renderer.
585  *
586  * \param renderer The renderer from which clip state should be queried.
587  *
588  * \sa SDL_RenderGetClipRect()
589  */
591 
592 
593 /**
594  * \brief Set the drawing scale for rendering on the current target.
595  *
596  * \param renderer The renderer for which the drawing scale should be set.
597  * \param scaleX The horizontal scaling factor
598  * \param scaleY The vertical scaling factor
599  *
600  * The drawing coordinates are scaled by the x/y scaling factors
601  * before they are used by the renderer. This allows resolution
602  * independent drawing with a single coordinate system.
603  *
604  * \note If this results in scaling or subpixel drawing by the
605  * rendering backend, it will be handled using the appropriate
606  * quality hints. For best results use integer scaling factors.
607  *
608  * \sa SDL_RenderGetScale()
609  * \sa SDL_RenderSetLogicalSize()
610  */
612  float scaleX, float scaleY);
613 
614 /**
615  * \brief Get the drawing scale for the current target.
616  *
617  * \param renderer The renderer from which drawing scale should be queried.
618  * \param scaleX A pointer filled in with the horizontal scaling factor
619  * \param scaleY A pointer filled in with the vertical scaling factor
620  *
621  * \sa SDL_RenderSetScale()
622  */
624  float *scaleX, float *scaleY);
625 
626 /**
627  * \brief Set the color used for drawing operations (Rect, Line and Clear).
628  *
629  * \param renderer The renderer for which drawing color should be set.
630  * \param r The red value used to draw on the rendering target.
631  * \param g The green value used to draw on the rendering target.
632  * \param b The blue value used to draw on the rendering target.
633  * \param a The alpha value used to draw on the rendering target, usually
634  * ::SDL_ALPHA_OPAQUE (255).
635  *
636  * \return 0 on success, or -1 on error
637  */
639  Uint8 r, Uint8 g, Uint8 b,
640  Uint8 a);
641 
642 /**
643  * \brief Get the color used for drawing operations (Rect, Line and Clear).
644  *
645  * \param renderer The renderer from which drawing color should be queried.
646  * \param r A pointer to the red value used to draw on the rendering target.
647  * \param g A pointer to the green value used to draw on the rendering target.
648  * \param b A pointer to the blue value used to draw on the rendering target.
649  * \param a A pointer to the alpha value used to draw on the rendering target,
650  * usually ::SDL_ALPHA_OPAQUE (255).
651  *
652  * \return 0 on success, or -1 on error
653  */
655  Uint8 * r, Uint8 * g, Uint8 * b,
656  Uint8 * a);
657 
658 /**
659  * \brief Set the blend mode used for drawing operations (Fill and Line).
660  *
661  * \param renderer The renderer for which blend mode should be set.
662  * \param blendMode ::SDL_BlendMode to use for blending.
663  *
664  * \return 0 on success, or -1 on error
665  *
666  * \note If the blend mode is not supported, the closest supported mode is
667  * chosen.
668  *
669  * \sa SDL_GetRenderDrawBlendMode()
670  */
673 
674 /**
675  * \brief Get the blend mode used for drawing operations.
676  *
677  * \param renderer The renderer from which blend mode should be queried.
678  * \param blendMode A pointer filled in with the current blend mode.
679  *
680  * \return 0 on success, or -1 on error
681  *
682  * \sa SDL_SetRenderDrawBlendMode()
683  */
686 
687 /**
688  * \brief Clear the current rendering target with the drawing color
689  *
690  * This function clears the entire rendering target, ignoring the viewport and
691  * the clip rectangle.
692  *
693  * \return 0 on success, or -1 on error
694  */
696 
697 /**
698  * \brief Draw a point on the current rendering target.
699  *
700  * \param renderer The renderer which should draw a point.
701  * \param x The x coordinate of the point.
702  * \param y The y coordinate of the point.
703  *
704  * \return 0 on success, or -1 on error
705  */
707  int x, int y);
708 
709 /**
710  * \brief Draw multiple points on the current rendering target.
711  *
712  * \param renderer The renderer which should draw multiple points.
713  * \param points The points to draw
714  * \param count The number of points to draw
715  *
716  * \return 0 on success, or -1 on error
717  */
719  const SDL_Point * points,
720  int count);
721 
722 /**
723  * \brief Draw a line on the current rendering target.
724  *
725  * \param renderer The renderer which should draw a line.
726  * \param x1 The x coordinate of the start point.
727  * \param y1 The y coordinate of the start point.
728  * \param x2 The x coordinate of the end point.
729  * \param y2 The y coordinate of the end point.
730  *
731  * \return 0 on success, or -1 on error
732  */
734  int x1, int y1, int x2, int y2);
735 
736 /**
737  * \brief Draw a series of connected lines on the current rendering target.
738  *
739  * \param renderer The renderer which should draw multiple lines.
740  * \param points The points along the lines
741  * \param count The number of points, drawing count-1 lines
742  *
743  * \return 0 on success, or -1 on error
744  */
746  const SDL_Point * points,
747  int count);
748 
749 /**
750  * \brief Draw a rectangle on the current rendering target.
751  *
752  * \param renderer The renderer which should draw a rectangle.
753  * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
754  *
755  * \return 0 on success, or -1 on error
756  */
758  const SDL_Rect * rect);
759 
760 /**
761  * \brief Draw some number of rectangles on the current rendering target.
762  *
763  * \param renderer The renderer which should draw multiple rectangles.
764  * \param rects A pointer to an array of destination rectangles.
765  * \param count The number of rectangles.
766  *
767  * \return 0 on success, or -1 on error
768  */
770  const SDL_Rect * rects,
771  int count);
772 
773 /**
774  * \brief Fill a rectangle on the current rendering target with the drawing color.
775  *
776  * \param renderer The renderer which should fill a rectangle.
777  * \param rect A pointer to the destination rectangle, or NULL for the entire
778  * rendering target.
779  *
780  * \return 0 on success, or -1 on error
781  */
783  const SDL_Rect * rect);
784 
785 /**
786  * \brief Fill some number of rectangles on the current rendering target with the drawing color.
787  *
788  * \param renderer The renderer which should fill multiple rectangles.
789  * \param rects A pointer to an array of destination rectangles.
790  * \param count The number of rectangles.
791  *
792  * \return 0 on success, or -1 on error
793  */
795  const SDL_Rect * rects,
796  int count);
797 
798 /**
799  * \brief Copy a portion of the texture to the current rendering target.
800  *
801  * \param renderer The renderer which should copy parts of a texture.
802  * \param texture The source texture.
803  * \param srcrect A pointer to the source rectangle, or NULL for the entire
804  * texture.
805  * \param dstrect A pointer to the destination rectangle, or NULL for the
806  * entire rendering target.
807  *
808  * \return 0 on success, or -1 on error
809  */
812  const SDL_Rect * srcrect,
813  const SDL_Rect * dstrect);
814 
815 /**
816  * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
817  *
818  * \param renderer The renderer which should copy parts of a texture.
819  * \param texture The source texture.
820  * \param srcrect A pointer to the source rectangle, or NULL for the entire
821  * texture.
822  * \param dstrect A pointer to the destination rectangle, or NULL for the
823  * entire rendering target.
824  * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction
825  * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2).
826  * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture
827  *
828  * \return 0 on success, or -1 on error
829  */
832  const SDL_Rect * srcrect,
833  const SDL_Rect * dstrect,
834  const double angle,
835  const SDL_Point *center,
836  const SDL_RendererFlip flip);
837 
838 
839 /**
840  * \brief Draw a point on the current rendering target.
841  *
842  * \param renderer The renderer which should draw a point.
843  * \param x The x coordinate of the point.
844  * \param y The y coordinate of the point.
845  *
846  * \return 0 on success, or -1 on error
847  */
849  float x, float y);
850 
851 /**
852  * \brief Draw multiple points on the current rendering target.
853  *
854  * \param renderer The renderer which should draw multiple points.
855  * \param points The points to draw
856  * \param count The number of points to draw
857  *
858  * \return 0 on success, or -1 on error
859  */
861  const SDL_FPoint * points,
862  int count);
863 
864 /**
865  * \brief Draw a line on the current rendering target.
866  *
867  * \param renderer The renderer which should draw a line.
868  * \param x1 The x coordinate of the start point.
869  * \param y1 The y coordinate of the start point.
870  * \param x2 The x coordinate of the end point.
871  * \param y2 The y coordinate of the end point.
872  *
873  * \return 0 on success, or -1 on error
874  */
876  float x1, float y1, float x2, float y2);
877 
878 /**
879  * \brief Draw a series of connected lines on the current rendering target.
880  *
881  * \param renderer The renderer which should draw multiple lines.
882  * \param points The points along the lines
883  * \param count The number of points, drawing count-1 lines
884  *
885  * \return 0 on success, or -1 on error
886  */
888  const SDL_FPoint * points,
889  int count);
890 
891 /**
892  * \brief Draw a rectangle on the current rendering target.
893  *
894  * \param renderer The renderer which should draw a rectangle.
895  * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
896  *
897  * \return 0 on success, or -1 on error
898  */
900  const SDL_FRect * rect);
901 
902 /**
903  * \brief Draw some number of rectangles on the current rendering target.
904  *
905  * \param renderer The renderer which should draw multiple rectangles.
906  * \param rects A pointer to an array of destination rectangles.
907  * \param count The number of rectangles.
908  *
909  * \return 0 on success, or -1 on error
910  */
912  const SDL_FRect * rects,
913  int count);
914 
915 /**
916  * \brief Fill a rectangle on the current rendering target with the drawing color.
917  *
918  * \param renderer The renderer which should fill a rectangle.
919  * \param rect A pointer to the destination rectangle, or NULL for the entire
920  * rendering target.
921  *
922  * \return 0 on success, or -1 on error
923  */
925  const SDL_FRect * rect);
926 
927 /**
928  * \brief Fill some number of rectangles on the current rendering target with the drawing color.
929  *
930  * \param renderer The renderer which should fill multiple rectangles.
931  * \param rects A pointer to an array of destination rectangles.
932  * \param count The number of rectangles.
933  *
934  * \return 0 on success, or -1 on error
935  */
937  const SDL_FRect * rects,
938  int count);
939 
940 /**
941  * \brief Copy a portion of the texture to the current rendering target.
942  *
943  * \param renderer The renderer which should copy parts of a texture.
944  * \param texture The source texture.
945  * \param srcrect A pointer to the source rectangle, or NULL for the entire
946  * texture.
947  * \param dstrect A pointer to the destination rectangle, or NULL for the
948  * entire rendering target.
949  *
950  * \return 0 on success, or -1 on error
951  */
954  const SDL_Rect * srcrect,
955  const SDL_FRect * dstrect);
956 
957 /**
958  * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
959  *
960  * \param renderer The renderer which should copy parts of a texture.
961  * \param texture The source texture.
962  * \param srcrect A pointer to the source rectangle, or NULL for the entire
963  * texture.
964  * \param dstrect A pointer to the destination rectangle, or NULL for the
965  * entire rendering target.
966  * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect, rotating it in a clockwise direction
967  * \param center A pointer to a point indicating the point around which dstrect will be rotated (if NULL, rotation will be done around dstrect.w/2, dstrect.h/2).
968  * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture
969  *
970  * \return 0 on success, or -1 on error
971  */
974  const SDL_Rect * srcrect,
975  const SDL_FRect * dstrect,
976  const double angle,
977  const SDL_FPoint *center,
978  const SDL_RendererFlip flip);
979 
980 /**
981  * \brief Read pixels from the current rendering target.
982  *
983  * \param renderer The renderer from which pixels should be read.
984  * \param rect A pointer to the rectangle to read, or NULL for the entire
985  * render target.
986  * \param format The desired format of the pixel data, or 0 to use the format
987  * of the rendering target
988  * \param pixels A pointer to be filled in with the pixel data
989  * \param pitch The pitch of the pixels parameter.
990  *
991  * \return 0 on success, or -1 if pixel reading is not supported.
992  *
993  * \warning This is a very slow operation, and should not be used frequently.
994  */
996  const SDL_Rect * rect,
997  Uint32 format,
998  void *pixels, int pitch);
999 
1000 /**
1001  * \brief Update the screen with rendering performed.
1002  */
1004 
1005 /**
1006  * \brief Destroy the specified texture.
1007  *
1008  * \sa SDL_CreateTexture()
1009  * \sa SDL_CreateTextureFromSurface()
1010  */
1012 
1013 /**
1014  * \brief Destroy the rendering context for a window and free associated
1015  * textures.
1016  *
1017  * \sa SDL_CreateRenderer()
1018  */
1020 
1021 /**
1022  * \brief Force the rendering context to flush any pending commands to the
1023  * underlying rendering API.
1024  *
1025  * You do not need to (and in fact, shouldn't) call this function unless
1026  * you are planning to call into OpenGL/Direct3D/Metal/whatever directly
1027  * in addition to using an SDL_Renderer.
1028  *
1029  * This is for a very-specific case: if you are using SDL's render API,
1030  * you asked for a specific renderer backend (OpenGL, Direct3D, etc),
1031  * you set SDL_HINT_RENDER_BATCHING to "1", and you plan to make
1032  * OpenGL/D3D/whatever calls in addition to SDL render API calls. If all of
1033  * this applies, you should call SDL_RenderFlush() between calls to SDL's
1034  * render API and the low-level API you're using in cooperation.
1035  *
1036  * In all other cases, you can ignore this function. This is only here to
1037  * get maximum performance out of a specific situation. In all other cases,
1038  * SDL will do the right thing, perhaps at a performance loss.
1039  *
1040  * This function is first available in SDL 2.0.10, and is not needed in
1041  * 2.0.9 and earlier, as earlier versions did not queue rendering commands
1042  * at all, instead flushing them to the OS immediately.
1043  */
1045 
1046 
1047 /**
1048  * \brief Bind the texture to the current OpenGL/ES/ES2 context for use with
1049  * OpenGL instructions.
1050  *
1051  * \param texture The SDL texture to bind
1052  * \param texw A pointer to a float that will be filled with the texture width
1053  * \param texh A pointer to a float that will be filled with the texture height
1054  *
1055  * \return 0 on success, or -1 if the operation is not supported
1056  */
1057 extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh);
1058 
1059 /**
1060  * \brief Unbind a texture from the current OpenGL/ES/ES2 context.
1061  *
1062  * \param texture The SDL texture to unbind
1063  *
1064  * \return 0 on success, or -1 if the operation is not supported
1065  */
1067 
1068 /**
1069  * \brief Get the CAMetalLayer associated with the given Metal renderer
1070  *
1071  * \param renderer The renderer to query
1072  *
1073  * \return CAMetalLayer* on success, or NULL if the renderer isn't a Metal renderer
1074  *
1075  * \sa SDL_RenderGetMetalCommandEncoder()
1076  */
1078 
1079 /**
1080  * \brief Get the Metal command encoder for the current frame
1081  *
1082  * \param renderer The renderer to query
1083  *
1084  * \return id<MTLRenderCommandEncoder> on success, or NULL if the renderer isn't a Metal renderer
1085  *
1086  * \sa SDL_RenderGetMetalLayer()
1087  */
1089 
1090 /* Ends C function definitions when using C++ */
1091 #ifdef __cplusplus
1092 }
1093 #endif
1094 #include "close_code.h"
1095 
1096 #endif /* SDL_render_h_ */
1097 
1098 /* vi: set ts=4 sw=4 expandtab: */
SDL_RenderGetMetalCommandEncoder
void * SDL_RenderGetMetalCommandEncoder(SDL_Renderer *renderer)
Get the Metal command encoder for the current frame.
Definition: SDL_render.c:3283
format
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
Definition: SDL_opengl.h:1572
SDL_RenderFillRect
int SDL_RenderFillRect(SDL_Renderer *renderer, const SDL_Rect *rect)
Fill a rectangle on the current rendering target with the drawing color.
Definition: SDL_render.c:2726
points
GLfixed GLfixed GLint GLint GLfixed points
Definition: SDL_opengl_glext.h:4558
SDL_RenderSetClipRect
int SDL_RenderSetClipRect(SDL_Renderer *renderer, const SDL_Rect *rect)
Set the clip rectangle for the current target.
Definition: SDL_render.c:2113
SDL_RenderGetLogicalSize
void SDL_RenderGetLogicalSize(SDL_Renderer *renderer, int *w, int *h)
Get device independent resolution for rendering.
Definition: SDL_render.c:2047
SDL_RenderSetIntegerScale
int SDL_RenderSetIntegerScale(SDL_Renderer *renderer, SDL_bool enable)
Set whether to force integer scales for resolution-independent rendering.
Definition: SDL_render.c:2060
DECLSPEC
#define DECLSPEC
Definition: SDL_internal.h:48
Uint32
uint32_t Uint32
Definition: SDL_stdinc.h:203
SDL_RenderTargetSupported
SDL_bool SDL_RenderTargetSupported(SDL_Renderer *renderer)
Determines whether a window supports the use of render targets.
Definition: SDL_render.c:1824
blendMode
static SDL_BlendMode blendMode
Definition: testdraw2.c:34
SDL_Surface
A collection of pixels used in software blitting.
Definition: SDL_surface.h:70
SDL_CreateSoftwareRenderer
SDL_Renderer * SDL_CreateSoftwareRenderer(SDL_Surface *surface)
Create a 2D software rendering context for a surface.
Definition: SDL_render.c:980
SDL_GetRendererInfo
int SDL_GetRendererInfo(SDL_Renderer *renderer, SDL_RendererInfo *info)
Get information about a rendering context.
Definition: SDL_render.c:1013
SDL_rect.h
SDL_RenderGetIntegerScale
SDL_bool SDL_RenderGetIntegerScale(SDL_Renderer *renderer)
Get whether integer scales are forced for resolution-independent rendering.
Definition: SDL_render.c:2070
SDL_TEXTUREMODULATE_COLOR
@ SDL_TEXTUREMODULATE_COLOR
Definition: SDL_render.h:104
SDL_RendererFlags
SDL_RendererFlags
Flags used when creating a rendering context.
Definition: SDL_render.h:64
SDL_RenderGetViewport
void SDL_RenderGetViewport(SDL_Renderer *renderer, SDL_Rect *rect)
Get the drawing area for the current target.
Definition: SDL_render.c:2100
surface
EGLSurface surface
Definition: eglext.h:248
b
GLboolean GLboolean GLboolean b
Definition: SDL_opengl_glext.h:1109
enable
GLboolean enable
Definition: SDL_opengl_glext.h:4996
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
SDL_RenderDrawPointF
int SDL_RenderDrawPointF(SDL_Renderer *renderer, float x, float y)
Draw a point on the current rendering target.
Definition: SDL_render.c:2254
SDL_SetRenderDrawBlendMode
int SDL_SetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode blendMode)
Set the blend mode used for drawing operations (Fill and Line).
Definition: SDL_render.c:2211
SDL_RenderDrawLinesF
int SDL_RenderDrawLinesF(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
Draw a series of connected lines on the current rendering target.
Definition: SDL_render.c:2578
SDL_RenderFillRectF
int SDL_RenderFillRectF(SDL_Renderer *renderer, const SDL_FRect *rect)
Fill a rectangle on the current rendering target with the drawing color.
Definition: SDL_render.c:2751
g
GLboolean GLboolean g
Definition: SDL_opengl_glext.h:1109
access
GLuint GLint GLboolean GLint GLenum access
Definition: SDL_opengl_glext.h:2162
count
GLuint GLuint GLsizei count
Definition: SDL_opengl.h:1571
SDL_RenderCopyExF
int SDL_RenderCopyExF(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect, const double angle, const SDL_FPoint *center, const SDL_RendererFlip flip)
Copy a portion of the source texture to the current rendering target, rotating it by angle around the...
Definition: SDL_render.c:3010
SDL_DestroyRenderer
void SDL_DestroyRenderer(SDL_Renderer *renderer)
Destroy the rendering context for a window and free associated textures.
Definition: SDL_render.c:3177
SDL_RenderDrawLines
int SDL_RenderDrawLines(SDL_Renderer *renderer, const SDL_Point *points, int count)
Draw a series of connected lines on the current rendering target.
Definition: SDL_render.c:2535
SDL_GetRenderDrawColor
int SDL_GetRenderDrawColor(SDL_Renderer *renderer, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
Get the color used for drawing operations (Rect, Line and Clear).
Definition: SDL_render.c:2190
SDLCALL
#define SDLCALL
Definition: SDL_internal.h:49
r
GLdouble GLdouble GLdouble r
Definition: SDL_opengl.h:2079
SDL_RenderDrawLine
int SDL_RenderDrawLine(SDL_Renderer *renderer, int x1, int y1, int x2, int y2)
Draw a line on the current rendering target.
Definition: SDL_render.c:2403
SDL_RenderCopyF
int SDL_RenderCopyF(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_FRect *dstrect)
Copy a portion of the texture to the current rendering target.
Definition: SDL_render.c:2924
SDL_RenderDrawRectsF
int SDL_RenderDrawRectsF(SDL_Renderer *renderer, const SDL_FRect *rects, int count)
Draw some number of rectangles on the current rendering target.
Definition: SDL_render.c:2698
SDL_LockTexture
int SDL_LockTexture(SDL_Texture *texture, const SDL_Rect *rect, void **pixels, int *pitch)
Lock a portion of the texture for write-only pixel access.
Definition: SDL_render.c:1727
SDL_UnlockTexture
void SDL_UnlockTexture(SDL_Texture *texture)
Unlock a texture, uploading the changes to video memory, if needed.
Definition: SDL_render.c:1806
SDL_RenderSetLogicalSize
int SDL_RenderSetLogicalSize(SDL_Renderer *renderer, int w, int h)
Set device independent resolution for rendering.
Definition: SDL_render.c:2027
index
GLuint index
Definition: SDL_opengl_glext.h:660
x1
GLuint GLfloat GLfloat GLfloat x1
Definition: SDL_opengl_glext.h:8583
a
GLboolean GLboolean GLboolean GLboolean a
Definition: SDL_opengl_glext.h:1109
h
GLfloat GLfloat GLfloat GLfloat h
Definition: SDL_opengl_glext.h:1946
SDL_RendererFlip
SDL_RendererFlip
Flip constants for SDL_RenderCopyEx.
Definition: SDL_render.h:111
SDL_RenderPresent
void SDL_RenderPresent(SDL_Renderer *renderer)
Update the screen with rendering performed.
Definition: SDL_render.c:3126
SDL_RendererInfo
Information on the capabilities of a render driver or context.
Definition: SDL_render.h:78
SDL_RenderDrawRects
int SDL_RenderDrawRects(SDL_Renderer *renderer, const SDL_Rect *rects, int count)
Draw some number of rectangles on the current rendering target.
Definition: SDL_render.c:2670
close_code.h
SDL_RenderReadPixels
int SDL_RenderReadPixels(SDL_Renderer *renderer, const SDL_Rect *rect, Uint32 format, void *pixels, int pitch)
Read pixels from the current rendering target.
Definition: SDL_render.c:3087
SDL_UpdateTexture
int SDL_UpdateTexture(SDL_Texture *texture, const SDL_Rect *rect, const void *pixels, int pitch)
Update the given texture rectangle with new pixel data.
Definition: SDL_render.c:1555
SDL_GetTextureAlphaMod
int SDL_GetTextureAlphaMod(SDL_Texture *texture, Uint8 *alpha)
Get the additional alpha value used in render copy operations.
Definition: SDL_render.c:1428
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:73
SDL_RenderDrawPoints
int SDL_RenderDrawPoints(SDL_Renderer *renderer, const SDL_Point *points, int count)
Draw multiple points on the current rendering target.
Definition: SDL_render.c:2290
SDL_TEXTUREMODULATE_NONE
@ SDL_TEXTUREMODULATE_NONE
Definition: SDL_render.h:103
begin_code.h
SDL_TextureModulate
SDL_TextureModulate
The texture channel modulation used in SDL_RenderCopy().
Definition: SDL_render.h:101
alpha
GLfloat GLfloat GLfloat alpha
Definition: SDL_opengl_glext.h:412
SDL_RenderFillRectsF
int SDL_RenderFillRectsF(SDL_Renderer *renderer, const SDL_FRect *rects, int count)
Fill some number of rectangles on the current rendering target with the drawing color.
Definition: SDL_render.c:2813
SDL_RENDERER_SOFTWARE
@ SDL_RENDERER_SOFTWARE
Definition: SDL_render.h:66
SDL_RenderDrawLineF
int SDL_RenderDrawLineF(SDL_Renderer *renderer, float x1, float y1, float x2, float y2)
Draw a line on the current rendering target.
Definition: SDL_render.c:2414
SDL_RenderIsClipEnabled
SDL_bool SDL_RenderIsClipEnabled(SDL_Renderer *renderer)
Get whether clipping is enabled on the given renderer.
Definition: SDL_render.c:2147
SDL_Renderer
Definition: SDL_sysrender.h:122
SDL_FPoint
The structure that defines a point (floating point)
Definition: SDL_rect.h:60
SDL_RenderGetClipRect
void SDL_RenderGetClipRect(SDL_Renderer *renderer, SDL_Rect *rect)
Get the clip rectangle for the current target.
Definition: SDL_render.c:2134
SDL_CreateWindowAndRenderer
int SDL_CreateWindowAndRenderer(int width, int height, Uint32 window_flags, SDL_Window **window, SDL_Renderer **renderer)
Create a window and default renderer.
Definition: SDL_render.c:801
SDL_FLIP_HORIZONTAL
@ SDL_FLIP_HORIZONTAL
Definition: SDL_render.h:114
SDL_QueryTexture
int SDL_QueryTexture(SDL_Texture *texture, Uint32 *format, int *access, int *w, int *h)
Query the attributes of a texture.
Definition: SDL_render.c:1353
x
GLint GLint GLint GLint GLint x
Definition: SDL_opengl.h:1574
SDL_SetTextureColorMod
int SDL_SetTextureColorMod(SDL_Texture *texture, Uint8 r, Uint8 g, Uint8 b)
Set an additional color value used in render copy operations.
Definition: SDL_render.c:1374
window
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
SDL_GL_BindTexture
int SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh)
Bind the texture to the current OpenGL/ES/ES2 context for use with OpenGL instructions.
Definition: SDL_render.c:3238
SDL_RendererInfo::flags
Uint32 flags
Definition: SDL_render.h:81
SDL_DestroyTexture
void SDL_DestroyTexture(SDL_Texture *texture)
Destroy the specified texture.
Definition: SDL_render.c:3140
SDL_GetNumRenderDrivers
int SDL_GetNumRenderDrivers(void)
Get the number of 2D rendering drivers available for the current display.
Definition: SDL_dynapi_procs.h:329
SDL_RenderFlush
int SDL_RenderFlush(SDL_Renderer *renderer)
Force the rendering context to flush any pending commands to the underlying rendering API.
Definition: SDL_render.c:261
SDL_TEXTUREACCESS_STATIC
@ SDL_TEXTUREACCESS_STATIC
Definition: SDL_render.h:93
height
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572
SDL_GetTextureBlendMode
int SDL_GetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode *blendMode)
Get the blend mode used for texture copy operations.
Definition: SDL_render.c:1457
SDL_RENDERER_PRESENTVSYNC
@ SDL_RENDERER_PRESENTVSYNC
Definition: SDL_render.h:69
SDL_GetRenderer
SDL_Renderer * SDL_GetRenderer(SDL_Window *window)
Get the renderer associated with a window.
Definition: SDL_render.c:1007
rect
SDL_Rect rect
Definition: testrelative.c:27
SDL_UpdateYUVTexture
int SDL_UpdateYUVTexture(SDL_Texture *texture, const SDL_Rect *rect, const Uint8 *Yplane, int Ypitch, const Uint8 *Uplane, int Upitch, const Uint8 *Vplane, int Vpitch)
Update a rectangle within a planar YV12 or IYUV texture with new pixel data.
Definition: SDL_render.c:1644
SDL_RenderSetScale
int SDL_RenderSetScale(SDL_Renderer *renderer, float scaleX, float scaleY)
Set the drawing scale for rendering on the current target.
Definition: SDL_render.c:2154
SDL_CreateRenderer
SDL_Renderer * SDL_CreateRenderer(SDL_Window *window, int index, Uint32 flags)
Create a 2D rendering context for a window.
Definition: SDL_render.c:835
SDL_SetRenderTarget
int SDL_SetRenderTarget(SDL_Renderer *renderer, SDL_Texture *texture)
Set a texture as the current rendering target.
Definition: SDL_render.c:1833
SDL_TEXTUREMODULATE_ALPHA
@ SDL_TEXTUREMODULATE_ALPHA
Definition: SDL_render.h:105
SDL_RenderSetViewport
int SDL_RenderSetViewport(SDL_Renderer *renderer, const SDL_Rect *rect)
Set the drawing area for rendering on the current target.
Definition: SDL_render.c:2078
pixels
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: SDL_opengl.h:1572
y
GLint GLint GLint GLint GLint GLint y
Definition: SDL_opengl.h:1574
SDL_SetTextureBlendMode
int SDL_SetTextureBlendMode(SDL_Texture *texture, SDL_BlendMode blendMode)
Set the blend mode used for texture copy operations.
Definition: SDL_render.c:1439
SDL_RenderDrawPoint
int SDL_RenderDrawPoint(SDL_Renderer *renderer, int x, int y)
Draw a point on the current rendering target.
Definition: SDL_render.c:2245
SDL_GetRenderTarget
SDL_Texture * SDL_GetRenderTarget(SDL_Renderer *renderer)
Get the current render target or NULL for the default render target.
Definition: SDL_render.c:1912
SDL_Texture::pitch
int pitch
Definition: SDL_sysrender.h:61
renderer
static SDL_Renderer * renderer
Definition: testaudiocapture.c:21
SDL_Point
The structure that defines a point (integer)
Definition: SDL_rect.h:48
SDL_RenderFillRects
int SDL_RenderFillRects(SDL_Renderer *renderer, const SDL_Rect *rects, int count)
Fill some number of rectangles on the current rendering target with the drawing color.
Definition: SDL_render.c:2772
SDL_RENDERER_TARGETTEXTURE
@ SDL_RENDERER_TARGETTEXTURE
Definition: SDL_render.h:71
x2
GLfixed GLfixed x2
Definition: SDL_opengl_glext.h:4583
SDL_GetRenderDrawBlendMode
int SDL_GetRenderDrawBlendMode(SDL_Renderer *renderer, SDL_BlendMode *blendMode)
Get the blend mode used for drawing operations.
Definition: SDL_render.c:2223
SDL_Rect
A rectangle, with the origin at the upper left (integer).
Definition: SDL_rect.h:77
SDL_GetRenderDriverInfo
int SDL_GetRenderDriverInfo(int index, SDL_RendererInfo *info)
Get information about a specific 2D rendering driver for the current display.
Definition: SDL_render.c:637
SDL_RendererInfo::max_texture_width
int max_texture_width
Definition: SDL_render.h:84
SDL_Texture
Definition: SDL_sysrender.h:43
SDL_stdinc.h
SDL_CreateTextureFromSurface
SDL_Texture * SDL_CreateTextureFromSurface(SDL_Renderer *renderer, SDL_Surface *surface)
Create a texture from an existing surface.
Definition: SDL_render.c:1207
SDL_TEXTUREACCESS_TARGET
@ SDL_TEXTUREACCESS_TARGET
Definition: SDL_render.h:95
y1
GLfixed y1
Definition: SDL_opengl_glext.h:4583
SDL_RenderCopy
int SDL_RenderCopy(SDL_Renderer *renderer, SDL_Texture *texture, const SDL_Rect *srcrect, const SDL_Rect *dstrect)
Copy a portion of the texture to the current rendering target.
Definition: SDL_render.c:2908
SDL_FLIP_NONE
@ SDL_FLIP_NONE
Definition: SDL_render.h:113
SDL_RenderCopyEx
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)
Copy a portion of the source texture to the current rendering target, rotating it by angle around the...
Definition: SDL_render.c:2983
SDL_RenderDrawPointsF
int SDL_RenderDrawPointsF(SDL_Renderer *renderer, const SDL_FPoint *points, int count)
Draw multiple points on the current rendering target.
Definition: SDL_render.c:2360
SDL_RenderDrawRect
int SDL_RenderDrawRect(SDL_Renderer *renderer, const SDL_Rect *rect)
Draw a rectangle on the current rendering target.
Definition: SDL_render.c:2621
SDL_FRect
A rectangle, with the origin at the upper left (floating point).
Definition: SDL_rect.h:87
y2
GLfixed GLfixed GLfixed y2
Definition: SDL_opengl_glext.h:4583
SDL_CreateTexture
SDL_Texture * SDL_CreateTexture(SDL_Renderer *renderer, Uint32 format, int access, int w, int h)
Create a texture for a rendering context.
Definition: SDL_render.c:1112
angle
GLfloat angle
Definition: SDL_opengl_glext.h:6097
SDL_FLIP_VERTICAL
@ SDL_FLIP_VERTICAL
Definition: SDL_render.h:115
SDL_RenderClear
int SDL_RenderClear(SDL_Renderer *renderer)
Clear the current rendering target with the drawing color.
Definition: SDL_render.c:2232
SDL_GL_UnbindTexture
int SDL_GL_UnbindTexture(SDL_Texture *texture)
Unbind a texture from the current OpenGL/ES/ES2 context.
Definition: SDL_render.c:3254
SDL_RendererInfo::name
const char * name
Definition: SDL_render.h:80
SDL_video.h
SDL_SetRenderDrawColor
int SDL_SetRenderDrawColor(SDL_Renderer *renderer, Uint8 r, Uint8 g, Uint8 b, Uint8 a)
Set the color used for drawing operations (Rect, Line and Clear).
Definition: SDL_render.c:2177
SDL_RenderDrawRectF
int SDL_RenderDrawRectF(SDL_Renderer *renderer, const SDL_FRect *rect)
Draw a rectangle on the current rendering target.
Definition: SDL_render.c:2638
SDL_GetRendererOutputSize
int SDL_GetRendererOutputSize(SDL_Renderer *renderer, int *w, int *h)
Get the output size in pixels of a rendering context.
Definition: SDL_render.c:1022
SDL_RENDERER_ACCELERATED
@ SDL_RENDERER_ACCELERATED
Definition: SDL_render.h:67
SDL_RendererInfo::texture_formats
Uint32 texture_formats[16]
Definition: SDL_render.h:83
SDL_RendererInfo::max_texture_height
int max_texture_height
Definition: SDL_render.h:85
flags
GLbitfield flags
Definition: SDL_opengl_glext.h:1480
SDL_TEXTUREACCESS_STREAMING
@ SDL_TEXTUREACCESS_STREAMING
Definition: SDL_render.h:94
texture
GLenum GLenum GLuint texture
Definition: SDL_opengl_glext.h:1178
SDL_RenderGetMetalLayer
void * SDL_RenderGetMetalLayer(SDL_Renderer *renderer)
Get the CAMetalLayer associated with the given Metal renderer.
Definition: SDL_render.c:3271
rects
EGLSurface EGLint * rects
Definition: eglext.h:282
SDL_TextureAccess
SDL_TextureAccess
The access pattern allowed for a texture.
Definition: SDL_render.h:91
SDL_BlendMode
SDL_BlendMode
The blend mode used in SDL_RenderCopy() and drawing operations.
Definition: SDL_blendmode.h:40
SDL_SetTextureAlphaMod
int SDL_SetTextureAlphaMod(SDL_Texture *texture, Uint8 alpha)
Set an additional alpha value used in render copy operations.
Definition: SDL_render.c:1411
SDL_GetTextureColorMod
int SDL_GetTextureColorMod(SDL_Texture *texture, Uint8 *r, Uint8 *g, Uint8 *b)
Get the additional color value used in render copy operations.
Definition: SDL_render.c:1393
SDL_RenderGetScale
void SDL_RenderGetScale(SDL_Renderer *renderer, float *scaleX, float *scaleY)
Get the drawing scale for the current target.
Definition: SDL_render.c:2164
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:161
SDL_RendererInfo::num_texture_formats
Uint32 num_texture_formats
Definition: SDL_render.h:82
w
GLubyte GLubyte GLubyte GLubyte w
Definition: SDL_opengl_glext.h:731
Uint8
uint8_t Uint8
Definition: SDL_stdinc.h:179