Commit Graph

60 Commits

Author SHA1 Message Date
Sam Lantinga
a9072159b2 Updated copyright for 2018 2018-01-03 10:03:25 -08:00
Sam Lantinga
4365b10afb Added SDL_RenderGetMetalLayer() and SDL_RenderGetMetalCommandEncoder() 2017-12-08 14:30:10 -08:00
Sam Lantinga
d8de59f544 Note that texture contents are undefined when the texture is created. 2017-08-12 13:05:26 -07:00
Sam Lantinga
0863cc53e3 Fixed bug 3492 - SDL_RenderCopyEx angle direction not documented
xyzdragon

Reading https://wiki.libsdl.org/SDL_RenderCopyEx there is no mention what the angle means. Normally in a mathematically environment positive angles translate to counter-clockwise rotations, but in SDL positive angles means clockwise rotation.
2017-08-11 13:24:18 -07:00
Sam Lantinga
3b038e314a Fixed bug 3681 - SDL_UpateTexture documentation not specific enough about format requirement
Simon Hug

The documentation of SDL_UpateTexture does not say that the pixel data has to be in the format of the texture.
2017-08-10 11:57:19 -07:00
Sam Lantinga
d77ab77a7a Updated copyright for 2017 2017-01-01 18:33:28 -08:00
Sam Lantinga
9cc7ce9008 Renaming of guard header names to quiet -Wreserved-id-macro
Patch contributed by Sylvain
2016-11-20 21:34:54 -08:00
Sam Lantinga
8543766a5b Fixed bug 3345 - SDL_RenderClear inconsistency with ClipRect
Simon Hug

The description of the SDL_RenderClear function in the SDL_render.h header says the following:

"This function clears the entire rendering target, ignoring the viewport."

The word "entire" implies that the clipping rectangle set with SDL_RenderSetClipRect also gets ignored. This is left somewhat ambiguous if only the viewport is mentioned. Minor thing, but let's see what the implementations actually do.

The software renderer ignores the clipping rectangle when clearing. It even has a comment on this: /* By definition the clear ignores the clip rect */

Most other render drivers (opengl, opengles, opengles2, direct3d, and psp [I assume. Can't test it.]) use the scissor test for the ClipRect and don't disable it when clearing. Clearing will only happen within the clipping rectangle for these drivers.

An exception is direct3d11 which uses a clear function that ignores the scissor test.
2016-10-01 11:46:32 -07:00
Ethan Lee
90917e91c8 SDL_RenderSetIntegerScale 2016-01-05 16:39:18 -05:00
Sam Lantinga
255c182471 Updated copyright to 2016 2016-01-02 10:10:34 -08:00
Alex Szpakowski
d95053a6c6 Updated some header comments and iOS documentation to better clarify high-dpi / retina support and screen-coordinate sizes versus pixel sizes. 2015-12-31 21:16:43 -04:00
Philipp Wiesemann
5e56ebe954 Corrected documentation of the SDL_CreateTexture() functions in header file. 2015-08-21 23:50:59 +02:00
Sam Lantinga
78f2198e6c Updated the copyright year to 2015 2015-05-26 06:27:46 -07:00
Philipp Wiesemann
a4adcf6da5 Fix typos in header file documentation comments. 2015-01-30 23:20:15 +01:00
Sam Lantinga
f8a0a64490 Improved the pitch variable description 2014-11-29 11:18:49 -08:00
Philipp Wiesemann
fd34672a70 Fixed two typos in header file comment. 2014-10-27 12:53:47 +01:00
Jørgen P. Tjernø
4d68f8c53e Render: Allow empty cliprect.
This fixes an issue where an empty cliprect is treated the same as a NULL
cliprect, causing the render backends to disable clipping.

Also adds a new API, SDL_RenderIsClipEnabled(render) that allows you to
differentiate between:
 - SDL_RenderSetClipRect(render, NULL)
 - SDL_Rect r = {0,0,0,0}; SDL_RenderSetClipRect(render, &r);

Fixes https://bugzilla.libsdl.org/show_bug.cgi?id=2504
2014-04-19 13:15:41 -07:00
Sam Lantinga
dba255c1e5 Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Ryan C. Gordon
b6c28469d6 Fixed a few public APIs that we accidentally neglected to mark as SDLCALL.
Fixes Bugzilla #2262.
2013-11-23 15:52:49 -05:00
Sam Lantinga
b7d5ed3b6f Added optimized YUV texture upload path with SDL_UpdateYUVTexture() 2013-09-28 14:06:47 -07:00
Sam Lantinga
1d3d9d10fb Added documentation saying the render API isn't for multi-threading. 2013-07-28 11:24:16 -07:00
Sam Lantinga
028c19b92b When the window is resized, the viewport is automatically reset.
This resolves lots of confusion around resizable windows.  Most people don't expect a viewport to be implicitly set when the renderer is created and then not to be reset to the window size if the window is resized.

Added common test command line parameters --logical WxH and --scale N to test the render logical size and scaling APIs.
2013-05-29 03:22:19 -07:00
Sam Lantinga
23f33cb76c Fixed bug 1622 - SDL_RenderSetViewport with empty SDL_Rect raises wrong error for OpenGL rendering backend
It's now legal to set an empty viewport rect - it will prevent any rendering.

Also added an API to query the output size: SDL_GetRendererOutputSize()
2013-05-29 03:07:55 -07:00
Sam Lantinga
0d9b661db8 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Philipp Wiesemann
27e1a7ca41 Fixed Doxygen warnings. 2013-05-18 14:48:19 +02:00
Philipp Wiesemann
f9a69af2f0 Fixed Doxygen warnings. 2013-05-15 22:00:28 +02:00
Philipp Wiesemann
f38eef4c83 Fixed bug 1843 - SDL_RenderClear prototype doxygen missing
Martin Gerhardy

SDL_RenderClear prototype misses documentation for the return value
2013-05-12 13:25:34 +02:00
Sam Lantinga
7253832be1 First pass on SDL render clip rect functionality 2013-05-04 04:46:00 -07:00
Sam Lantinga
019c60c1e8 Happy New Year! 2013-02-15 08:47:44 -08:00
Sam Lantinga
e070132e57 Fixed typo in documentation 2013-01-27 15:53:24 -08:00
Sam Lantinga
9a6b1c641a Added SDL_GetRenderTarget() API function
Also fixed a bug with setting logical size for a render target.
2012-10-12 02:20:10 -07:00
Sam Lantinga
aab04f8c71 Added SDL_RenderSetLogicalSize() and SDL_RenderGetLogicalSize() 2012-10-01 22:30:07 -07:00
Sam Lantinga
8e121270fa Added SDL_RenderSetScale() and SDL_RenderGetScale() 2012-10-01 20:59:33 -07:00
Sam Lantinga
ed4f2e1ccf Made it clear that locking a streaming texture is a write-only operation. 2012-09-28 03:29:36 -07:00
Gabriel Jacobo
ceaf031283 Implements SDL_GL_BindTexture and SDL_GL_UnbindTexture (#1576) 2012-09-03 11:16:12 -03:00
Gabriel Jacobo
2e96488df0 RenderCopyEx,rotation and flipping for all hardware/software backends (#1308) 2012-06-01 19:51:08 -03:00
Sam Lantinga
b5844a1c07 Added a convenience function SDL_CreateWindowAndRenderer() 2012-01-22 19:22:53 -05:00
Sam Lantinga
c5b09f0da7 You need to create the texture with the SDL_TEXTUREACCESS_TARGET flag. 2012-01-22 01:29:26 -05:00
Sam Lantinga
b291116502 Renamed SetTargetTexture() to SetRenderTarget() 2012-01-22 01:26:28 -05:00
Sam Lantinga
1af7c2fe96 Added a renderer flag to expose whether a renderer supports render to texture. 2012-01-19 21:06:47 -05:00
Sam Lantinga
9e37906060 Implementation of render targets, by Mason Wheeler and Gabriel Jacobo
Thanks guys!
2012-01-18 22:45:49 -05:00
Sam Lantinga
e256711bb9 Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
c2a6df6073 The draw color affects RenderClear() as well. (thanks to the feedback form to whoever pointed this out) 2011-10-30 17:53:54 -04:00
Sam Lantinga
6196aa221e SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
a46d9b6758 Added SDL_GetRenderer() 2011-04-04 09:29:13 -07:00
Sam Lantinga
3f21fa761c Fixed typo 2011-03-14 10:58:35 -07:00
Sam Lantinga
594e403a0f Whoops, the format parameter was off the page. 2011-02-18 09:30:09 -08:00
Sam Lantinga
b807895313 Allow the application to explicitly request a software renderer. 2011-02-17 12:03:48 -08:00
Sam Lantinga
b59da3ffdc Changed the concept of a render clip rect to a render viewport.
The render viewport is automatically re-centered when the window changes size, so applications that don't care will not have to handle recalculating their rendering coordinates.

Fixed API for drawing and filling multiple rectangles - the parameter should be an array of rects, not an array of pointers to rects.

Fixed API for updating window rects for consistency with other APIs - the order is pointer to array followed by count in array.
2011-02-15 13:59:59 -08:00
Sam Lantinga
a2cdcf5486 Happy 2011! :) 2011-02-11 22:37:15 -08:00