2 Simple DirectMedia Layer
3 Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
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.
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:
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.
25 * Header file for SDL 2D rendering functions.
27 * This API supports the following features:
28 * * single pixel points
29 * * single pixel lines
33 * The primitives may be drawn in opaque, blended, or additive modes.
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.
39 * This API is designed to accelerate simple 2D operations. You may
40 * want more functionality such as rotation 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.
48 #include "SDL_stdinc.h"
50 #include "SDL_video.h"
52 #include "begin_code.h"
53 /* Set up for C function definitions, even when using C++ */
61 * \brief Flags used when creating a rendering context
65 SDL_RENDERER_SOFTWARE = 0x00000001, /**< The renderer is a software fallback */
66 SDL_RENDERER_ACCELERATED = 0x00000002, /**< The renderer uses hardware
68 SDL_RENDERER_PRESENTVSYNC = 0x00000004, /**< Present is synchronized
69 with the refresh rate */
70 SDL_RENDERER_TARGETTEXTURE = 0x00000008 /**< The renderer supports
71 rendering to texture */
75 * \brief Information on the capabilities of a render driver or context.
77 typedef struct SDL_RendererInfo
79 const char *name; /**< The name of the renderer */
80 Uint32 flags; /**< Supported ::SDL_RendererFlags */
81 Uint32 num_texture_formats; /**< The number of available texture formats */
82 Uint32 texture_formats[16]; /**< The available texture formats */
83 int max_texture_width; /**< The maximimum texture width */
84 int max_texture_height; /**< The maximimum texture height */
88 * \brief The access pattern allowed for a texture.
92 SDL_TEXTUREACCESS_STATIC, /**< Changes rarely, not lockable */
93 SDL_TEXTUREACCESS_STREAMING, /**< Changes frequently, lockable */
94 SDL_TEXTUREACCESS_TARGET /**< Texture can be used as a render target */
98 * \brief The texture channel modulation used in SDL_RenderCopy().
102 SDL_TEXTUREMODULATE_NONE = 0x00000000, /**< No modulation */
103 SDL_TEXTUREMODULATE_COLOR = 0x00000001, /**< srcC = srcC * color */
104 SDL_TEXTUREMODULATE_ALPHA = 0x00000002 /**< srcA = srcA * alpha */
105 } SDL_TextureModulate;
108 * \brief Flip constants for SDL_RenderCopyEx
112 SDL_FLIP_NONE = 0x00000000, /**< Do not flip */
113 SDL_FLIP_HORIZONTAL = 0x00000001, /**< flip horizontally */
114 SDL_FLIP_VERTICAL = 0x00000002 /**< flip vertically */
118 * \brief A structure representing rendering state
121 typedef struct SDL_Renderer SDL_Renderer;
124 * \brief An efficient driver-specific representation of pixel data
127 typedef struct SDL_Texture SDL_Texture;
130 /* Function prototypes */
133 * \brief Get the number of 2D rendering drivers available for the current
136 * A render driver is a set of code that handles rendering and texture
137 * management on a particular display. Normally there is only one, but
138 * some drivers may have several available with different capabilities.
140 * \sa SDL_GetRenderDriverInfo()
141 * \sa SDL_CreateRenderer()
143 extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
146 * \brief Get information about a specific 2D rendering driver for the current
149 * \param index The index of the driver to query information about.
150 * \param info A pointer to an SDL_RendererInfo struct to be filled with
151 * information on the rendering driver.
153 * \return 0 on success, -1 if the index was out of range.
155 * \sa SDL_CreateRenderer()
157 extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
158 SDL_RendererInfo * info);
161 * \brief Create a window and default renderer
163 * \param width The width of the window
164 * \param height The height of the window
165 * \param window_flags The flags used to create the window
166 * \param window A pointer filled with the window, or NULL on error
167 * \param renderer A pointer filled with the renderer, or NULL on error
169 * \return 0 on success, or -1 on error
171 extern DECLSPEC int SDLCALL SDL_CreateWindowAndRenderer(
172 int width, int height, Uint32 window_flags,
173 SDL_Window **window, SDL_Renderer **renderer);
177 * \brief Create a 2D rendering context for a window.
179 * \param window The window where rendering is displayed.
180 * \param index The index of the rendering driver to initialize, or -1 to
181 * initialize the first one supporting the requested flags.
182 * \param flags ::SDL_RendererFlags.
184 * \return A valid rendering context or NULL if there was an error.
186 * \sa SDL_CreateSoftwareRenderer()
187 * \sa SDL_GetRendererInfo()
188 * \sa SDL_DestroyRenderer()
190 extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window,
191 int index, Uint32 flags);
194 * \brief Create a 2D software rendering context for a surface.
196 * \param surface The surface where rendering is done.
198 * \return A valid rendering context or NULL if there was an error.
200 * \sa SDL_CreateRenderer()
201 * \sa SDL_DestroyRenderer()
203 extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface);
206 * \brief Get the renderer associated with a window.
208 extern DECLSPEC SDL_Renderer * SDLCALL SDL_GetRenderer(SDL_Window * window);
211 * \brief Get information about a rendering context.
213 extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer,
214 SDL_RendererInfo * info);
217 * \brief Create a texture for a rendering context.
219 * \param format The format of the texture.
220 * \param access One of the enumerated values in ::SDL_TextureAccess.
221 * \param w The width of the texture in pixels.
222 * \param h The height of the texture in pixels.
224 * \return The created texture is returned, or 0 if no rendering context was
225 * active, the format was unsupported, or the width or height were out
228 * \sa SDL_QueryTexture()
229 * \sa SDL_UpdateTexture()
230 * \sa SDL_DestroyTexture()
232 extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer,
238 * \brief Create a texture from an existing surface.
240 * \param surface The surface containing pixel data used to fill the texture.
242 * \return The created texture is returned, or 0 on error.
244 * \note The surface is not modified or freed by this function.
246 * \sa SDL_QueryTexture()
247 * \sa SDL_DestroyTexture()
249 extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface);
252 * \brief Query the attributes of a texture
254 * \param texture A texture to be queried.
255 * \param format A pointer filled in with the raw format of the texture. The
256 * actual format may differ, but pixel transfers will use this
258 * \param access A pointer filled in with the actual access to the texture.
259 * \param w A pointer filled in with the width of the texture in pixels.
260 * \param h A pointer filled in with the height of the texture in pixels.
262 * \return 0 on success, or -1 if the texture is not valid.
264 extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
265 Uint32 * format, int *access,
269 * \brief Set an additional color value used in render copy operations.
271 * \param texture The texture to update.
272 * \param r The red color value multiplied into copy operations.
273 * \param g The green color value multiplied into copy operations.
274 * \param b The blue color value multiplied into copy operations.
276 * \return 0 on success, or -1 if the texture is not valid or color modulation
279 * \sa SDL_GetTextureColorMod()
281 extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
282 Uint8 r, Uint8 g, Uint8 b);
286 * \brief Get the additional color value used in render copy operations.
288 * \param texture The texture to query.
289 * \param r A pointer filled in with the current red color value.
290 * \param g A pointer filled in with the current green color value.
291 * \param b A pointer filled in with the current blue color value.
293 * \return 0 on success, or -1 if the texture is not valid.
295 * \sa SDL_SetTextureColorMod()
297 extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
298 Uint8 * r, Uint8 * g,
302 * \brief Set an additional alpha value used in render copy operations.
304 * \param texture The texture to update.
305 * \param alpha The alpha value multiplied into copy operations.
307 * \return 0 on success, or -1 if the texture is not valid or alpha modulation
310 * \sa SDL_GetTextureAlphaMod()
312 extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
316 * \brief Get the additional alpha value used in render copy operations.
318 * \param texture The texture to query.
319 * \param alpha A pointer filled in with the current alpha value.
321 * \return 0 on success, or -1 if the texture is not valid.
323 * \sa SDL_SetTextureAlphaMod()
325 extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
329 * \brief Set the blend mode used for texture copy operations.
331 * \param texture The texture to update.
332 * \param blendMode ::SDL_BlendMode to use for texture blending.
334 * \return 0 on success, or -1 if the texture is not valid or the blend mode is
337 * \note If the blend mode is not supported, the closest supported mode is
340 * \sa SDL_GetTextureBlendMode()
342 extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
343 SDL_BlendMode blendMode);
346 * \brief Get the blend mode used for texture copy operations.
348 * \param texture The texture to query.
349 * \param blendMode A pointer filled in with the current blend mode.
351 * \return 0 on success, or -1 if the texture is not valid.
353 * \sa SDL_SetTextureBlendMode()
355 extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
356 SDL_BlendMode *blendMode);
359 * \brief Update the given texture rectangle with new pixel data.
361 * \param texture The texture to update
362 * \param rect A pointer to the rectangle of pixels to update, or NULL to
363 * update the entire texture.
364 * \param pixels The raw pixel data.
365 * \param pitch The number of bytes between rows of pixel data.
367 * \return 0 on success, or -1 if the texture is not valid.
369 * \note This is a fairly slow function.
371 extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
372 const SDL_Rect * rect,
373 const void *pixels, int pitch);
376 * \brief Lock a portion of the texture for write-only pixel access.
378 * \param texture The texture to lock for access, which was created with
379 * ::SDL_TEXTUREACCESS_STREAMING.
380 * \param rect A pointer to the rectangle to lock for access. If the rect
381 * is NULL, the entire texture will be locked.
382 * \param pixels This is filled in with a pointer to the locked pixels,
383 * appropriately offset by the locked area.
384 * \param pitch This is filled in with the pitch of the locked pixels.
386 * \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
388 * \sa SDL_UnlockTexture()
390 extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
391 const SDL_Rect * rect,
392 void **pixels, int *pitch);
395 * \brief Unlock a texture, uploading the changes to video memory, if needed.
397 * \sa SDL_LockTexture()
399 extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
402 * \brief Determines whether a window supports the use of render targets
404 * \param renderer The renderer that will be checked
406 * \return SDL_TRUE if supported, SDL_FALSE if not.
408 extern DECLSPEC SDL_bool SDLCALL SDL_RenderTargetSupported(SDL_Renderer *renderer);
411 * \brief Set a texture as the current rendering target.
413 * \param texture The targeted texture, which must be created with the SDL_TEXTUREACCESS_TARGET flag, or NULL for the default render target
415 * \return 0 on success, or -1 on error
417 * \sa SDL_GetRenderTarget()
419 extern DECLSPEC int SDLCALL SDL_SetRenderTarget(SDL_Renderer *renderer,
420 SDL_Texture *texture);
423 * \brief Get the current render target or NULL for the default render target.
425 * \return The current render target
427 * \sa SDL_SetRenderTarget()
429 extern DECLSPEC SDL_Texture * SDLCALL SDL_GetRenderTarget(SDL_Renderer *renderer);
432 * \brief Set device independent resolution for rendering
434 * \param w The width of the logical resolution
435 * \param h The height of the logical resolution
437 * This function uses the viewport and scaling functionality to allow a fixed logical
438 * resolution for rendering, regardless of the actual output resolution. If the actual
439 * output resolution doesn't have the same aspect ratio the output rendering will be
440 * centered within the output display.
442 * If the output display is a window, mouse events in the window will be filtered
443 * and scaled so they seem to arrive within the logical resolution.
445 * \note If this function results in scaling or subpixel drawing by the
446 * rendering backend, it will be handled using the appropriate
449 * \sa SDL_RenderGetLogicalSize()
450 * \sa SDL_RenderSetScale()
451 * \sa SDL_RenderSetViewport()
453 extern DECLSPEC int SDLCALL SDL_RenderSetLogicalSize(SDL_Renderer * renderer, int w, int h);
456 * \brief Get device independent resolution for rendering
458 * \param w A pointer filled with the width of the logical resolution
459 * \param h A pointer filled with the height of the logical resolution
461 * \sa SDL_RenderSetLogicalSize()
463 extern DECLSPEC void SDLCALL SDL_RenderGetLogicalSize(SDL_Renderer * renderer, int *w, int *y);
466 * \brief Set the drawing area for rendering on the current target.
468 * \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
470 * The x,y of the viewport rect represents the origin for rendering.
472 * \return 0 on success, or -1 on error
474 * \note When the window is resized, the current viewport is automatically
475 * centered within the new window size.
477 * \sa SDL_RenderGetViewport()
478 * \sa SDL_RenderSetLogicalSize()
480 extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer,
481 const SDL_Rect * rect);
484 * \brief Get the drawing area for the current target.
486 * \sa SDL_RenderSetViewport()
488 extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer,
492 * \brief Set the clip rectangle for the current target.
494 * \param rect A pointer to the rectangle to set as the clip rectangle, or
495 * NULL to disable clipping.
497 * \return 0 on success, or -1 on error
499 * \sa SDL_RenderGetClipRect()
501 extern DECLSPEC int SDLCALL SDL_RenderSetClipRect(SDL_Renderer * renderer,
502 const SDL_Rect * rect);
505 * \brief Get the clip rectangle for the current target.
507 * \param rect A pointer filled in with the current clip rectangle, or
508 * an empty rectangle if clipping is disabled.
510 * \sa SDL_RenderSetClipRect()
512 extern DECLSPEC void SDLCALL SDL_RenderGetClipRect(SDL_Renderer * renderer,
516 * \brief Set the drawing scale for rendering on the current target.
518 * \param scaleX The horizontal scaling factor
519 * \param scaleY The vertical scaling factor
521 * The drawing coordinates are scaled by the x/y scaling factors
522 * before they are used by the renderer. This allows resolution
523 * independent drawing with a single coordinate system.
525 * \note If this results in scaling or subpixel drawing by the
526 * rendering backend, it will be handled using the appropriate
527 * quality hints. For best results use integer scaling factors.
529 * \sa SDL_RenderGetScale()
530 * \sa SDL_RenderSetLogicalSize()
532 extern DECLSPEC int SDLCALL SDL_RenderSetScale(SDL_Renderer * renderer,
533 float scaleX, float scaleY);
536 * \brief Get the drawing scale for the current target.
538 * \param scaleX A pointer filled in with the horizontal scaling factor
539 * \param scaleY A pointer filled in with the vertical scaling factor
541 * \sa SDL_RenderSetScale()
543 extern DECLSPEC void SDLCALL SDL_RenderGetScale(SDL_Renderer * renderer,
544 float *scaleX, float *scaleY);
547 * \brief Set the color used for drawing operations (Rect, Line and Clear).
549 * \param r The red value used to draw on the rendering target.
550 * \param g The green value used to draw on the rendering target.
551 * \param b The blue value used to draw on the rendering target.
552 * \param a The alpha value used to draw on the rendering target, usually
553 * ::SDL_ALPHA_OPAQUE (255).
555 * \return 0 on success, or -1 on error
557 extern DECLSPEC int SDL_SetRenderDrawColor(SDL_Renderer * renderer,
558 Uint8 r, Uint8 g, Uint8 b,
562 * \brief Get the color used for drawing operations (Rect, Line and Clear).
564 * \param r A pointer to the red value used to draw on the rendering target.
565 * \param g A pointer to the green value used to draw on the rendering target.
566 * \param b A pointer to the blue value used to draw on the rendering target.
567 * \param a A pointer to the alpha value used to draw on the rendering target,
568 * usually ::SDL_ALPHA_OPAQUE (255).
570 * \return 0 on success, or -1 on error
572 extern DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer * renderer,
573 Uint8 * r, Uint8 * g, Uint8 * b,
577 * \brief Set the blend mode used for drawing operations (Fill and Line).
579 * \param blendMode ::SDL_BlendMode to use for blending.
581 * \return 0 on success, or -1 on error
583 * \note If the blend mode is not supported, the closest supported mode is
586 * \sa SDL_GetRenderDrawBlendMode()
588 extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer,
589 SDL_BlendMode blendMode);
592 * \brief Get the blend mode used for drawing operations.
594 * \param blendMode A pointer filled in with the current blend mode.
596 * \return 0 on success, or -1 on error
598 * \sa SDL_SetRenderDrawBlendMode()
600 extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer,
601 SDL_BlendMode *blendMode);
604 * \brief Clear the current rendering target with the drawing color
606 * This function clears the entire rendering target, ignoring the viewport.
608 * \return 0 on success, or -1 on error
610 extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer);
613 * \brief Draw a point on the current rendering target.
615 * \param x The x coordinate of the point.
616 * \param y The y coordinate of the point.
618 * \return 0 on success, or -1 on error
620 extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer,
624 * \brief Draw multiple points on the current rendering target.
626 * \param points The points to draw
627 * \param count The number of points to draw
629 * \return 0 on success, or -1 on error
631 extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer,
632 const SDL_Point * points,
636 * \brief Draw a line on the current rendering target.
638 * \param x1 The x coordinate of the start point.
639 * \param y1 The y coordinate of the start point.
640 * \param x2 The x coordinate of the end point.
641 * \param y2 The y coordinate of the end point.
643 * \return 0 on success, or -1 on error
645 extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer,
646 int x1, int y1, int x2, int y2);
649 * \brief Draw a series of connected lines on the current rendering target.
651 * \param points The points along the lines
652 * \param count The number of points, drawing count-1 lines
654 * \return 0 on success, or -1 on error
656 extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer,
657 const SDL_Point * points,
661 * \brief Draw a rectangle on the current rendering target.
663 * \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
665 * \return 0 on success, or -1 on error
667 extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer,
668 const SDL_Rect * rect);
671 * \brief Draw some number of rectangles on the current rendering target.
673 * \param rects A pointer to an array of destination rectangles.
674 * \param count The number of rectangles.
676 * \return 0 on success, or -1 on error
678 extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer,
679 const SDL_Rect * rects,
683 * \brief Fill a rectangle on the current rendering target with the drawing color.
685 * \param rect A pointer to the destination rectangle, or NULL for the entire
688 * \return 0 on success, or -1 on error
690 extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer,
691 const SDL_Rect * rect);
694 * \brief Fill some number of rectangles on the current rendering target with the drawing color.
696 * \param rects A pointer to an array of destination rectangles.
697 * \param count The number of rectangles.
699 * \return 0 on success, or -1 on error
701 extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer,
702 const SDL_Rect * rects,
706 * \brief Copy a portion of the texture to the current rendering target.
708 * \param texture The source texture.
709 * \param srcrect A pointer to the source rectangle, or NULL for the entire
711 * \param dstrect A pointer to the destination rectangle, or NULL for the
712 * entire rendering target.
714 * \return 0 on success, or -1 on error
716 extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer,
717 SDL_Texture * texture,
718 const SDL_Rect * srcrect,
719 const SDL_Rect * dstrect);
722 * \brief Copy a portion of the source texture to the current rendering target, rotating it by angle around the given center
724 * \param texture The source texture.
725 * \param srcrect A pointer to the source rectangle, or NULL for the entire
727 * \param dstrect A pointer to the destination rectangle, or NULL for the
728 * entire rendering target.
729 * \param angle An angle in degrees that indicates the rotation that will be applied to dstrect
730 * \param 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)
731 * \param flip An SDL_RendererFlip value stating which flipping actions should be performed on the texture
733 * \return 0 on success, or -1 on error
735 extern DECLSPEC int SDLCALL SDL_RenderCopyEx(SDL_Renderer * renderer,
736 SDL_Texture * texture,
737 const SDL_Rect * srcrect,
738 const SDL_Rect * dstrect,
740 const SDL_Point *center,
741 const SDL_RendererFlip flip);
744 * \brief Read pixels from the current rendering target.
746 * \param rect A pointer to the rectangle to read, or NULL for the entire
748 * \param format The desired format of the pixel data, or 0 to use the format
749 * of the rendering target
750 * \param pixels A pointer to be filled in with the pixel data
751 * \param pitch The pitch of the pixels parameter.
753 * \return 0 on success, or -1 if pixel reading is not supported.
755 * \warning This is a very slow operation, and should not be used frequently.
757 extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer,
758 const SDL_Rect * rect,
760 void *pixels, int pitch);
763 * \brief Update the screen with rendering performed.
765 extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer);
768 * \brief Destroy the specified texture.
770 * \sa SDL_CreateTexture()
771 * \sa SDL_CreateTextureFromSurface()
773 extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
776 * \brief Destroy the rendering context for a window and free associated
779 * \sa SDL_CreateRenderer()
781 extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer);
785 * \brief Bind the texture to the current OpenGL/ES/ES2 context for use with
786 * OpenGL instructions.
788 * \param texture The SDL texture to bind
789 * \param texw A pointer to a float that will be filled with the texture width
790 * \param texh A pointer to a float that will be filled with the texture height
792 * \return 0 on success, or -1 if the operation is not supported
794 extern DECLSPEC int SDLCALL SDL_GL_BindTexture(SDL_Texture *texture, float *texw, float *texh);
797 * \brief Unbind a texture from the current OpenGL/ES/ES2 context.
799 * \param texture The SDL texture to unbind
801 * \return 0 on success, or -1 if the operation is not supported
803 extern DECLSPEC int SDLCALL SDL_GL_UnbindTexture(SDL_Texture *texture);
806 /* Ends C function definitions when using C++ */
812 #include "close_code.h"
814 #endif /* _SDL_render_h */
816 /* vi: set ts=4 sw=4 expandtab: */