Commit graph

161 commits

Author SHA1 Message Date
Ionut Leonte
3465f8e461 Added SDL_HITTEST_RESIZE_*, and implemented for X11. 2014-06-05 00:45:16 -04:00
Ryan C. Gordon
c6b34e9e1e Tweaked hit-testing documentation.
--HG--
extra : rebase_source : df2f9ccdddf408e5aaf7e788a1983ce8fef13d46
2014-05-29 13:38:39 -04:00
Ryan C. Gordon
9e98d09104 Changed drag area API to a hit-testing API.
There were several good arguments for this: it's how Windows works with
 WM_NCHITTEST, SDL doesn't need to manage a list of rects, it allows more
 control over the regions (how do you use rects to cleanly surround a circular
 button?), the callback can be more optimized than a iterating a list of
 rects, and you don't have to send an updated list of rects whenever the
 window resizes or layout changes.

--HG--
rename : test/testdragareas.c => test/testhittesting.c
2014-05-28 01:22:47 -04:00
Ryan C. Gordon
cce4ce44d4 First shot at SDL_SetWindowDragAreas().
Only Cocoa implemented right now.

--HG--
extra : amend_source : b178ad0ae25b933b284ed1bda89df750ddd27fb3
2014-05-27 01:27:42 -04:00
Ryan C. Gordon
67f246e568 Implemented SDL_CaptureMouse(). 2014-05-24 01:30:37 -04:00
Philipp Wiesemann
8cc5275bde Fixed typo in header comment. 2014-05-18 21:05:39 +02:00
Sam Lantinga
d7940a513e Fixed bug 2374 - Update copyright for 2014...
Is it that time already??
2014-02-02 00:53:27 -08:00
Jørgen P. Tjernø
d17c440442 Add SDL_GL_ResetAttributes.
--HG--
extra : rebase_source : 0a6fd1c977ab93ba651adaae3fa5a71d7c69fa8e
2014-01-29 18:38:13 -08:00
Ryan C. Gordon
7a0350ba09 Added SDL_GL_FRAMEBUFFER_SRGB_CAPABLE (thanks, David!).
Fixes Bugzilla #1985.
2013-10-20 21:18:05 -04:00
Sam Lantinga
0a805ff137 Fixed bug 2119 - compiler warnings (-pedantic) SDL_video.h:111:42 2013-09-30 21:57:03 -07:00
Philipp Wiesemann
e0b5831e14 Fixed doxygen warning. 2013-09-28 12:55:32 +02:00
Edward Rudd
3a11d95444 add in High DPI support (aka Retina)
- based on Jørgen's patch with a few bug fixes
2013-09-20 13:43:00 -04:00
Gabriel Jacobo
298ce1c1a7 OCD fixes: Adds a space after /* (glory to regular expressions!) 2013-08-21 09:47:10 -03:00
Gabriel Jacobo
271e0d67c4 OCD fixes: Adds a space before */ 2013-08-21 09:43:09 -03:00
Gabriel Jacobo
ef4a588d99 Fixes bug #2037, common EGL code for Android and X11 2013-08-19 16:29:46 -03:00
Jørgen P. Tjernø
e5ffe6b633 Fix #1667: Docs about SDL_CreateWindow and flags.
Updates the docs to say you can use SDL_WINDOW_HIDDEN, instead of (the ignored)
SDL_WINDOW_SHOWN.
2013-07-14 15:46:43 -07:00
Sam Lantinga
35275fc714 Fixed bug 1946 - OpenGL contexts in threads
The SDL OpenGL context code is now properly thread aware.  There are two new functions which return the current OpenGL window and context for the current thread.

There are still places in the cocoa driver where the OpenGL context needs to be updated when the view changes.  These will need a different solution and still use the last globally set context to avoid changing behavior.
2013-07-11 22:59:20 -07:00
Sam Lantinga
0cb6385637 File style cleanup for the SDL 2.0 release 2013-05-18 14:17:52 -07:00
Philipp Wiesemann
f86b25c56e Fixed Doxygen warnings. 2013-05-18 14:48:19 +02:00
Philipp Wiesemann
74047a3267 Fixed Doxygen warnings. 2013-05-15 22:00:28 +02:00
Sam Lantinga
fecccf1718 Fixed bug 1763 - Constify SDL_UpdateWindowSurfaceRects()
Ryan C. Gordon

With this function...
   SDL_UpdateWindowSurfaceRects(SDL_Window * window, SDL_Rect * rects, int numrects);
...is there any reason rects isn't "const SDL_Rect *" ?
2013-03-19 21:53:33 -07:00
Andreas Schiffler
edbf26b139 Add parameter checking to SetWindowSize functions; add tests to video suite 2013-03-08 23:33:07 -08:00
Sam Lantinga
95dcfa4c28 Happy New Year! 2013-02-15 08:47:44 -08:00
Sam Lantinga
1a92f18381 Added SDL_SetWindowMaximumSize() and SDL_GetWindowMaximumSize()
Also fixed Cocoa implementation so that it affects client area, not the whole window area.
2012-12-31 12:15:25 -08:00
Sam Lantinga
ce28a79602 Added SDL_GetDisplayName(), with implementation for Mac OS X 2012-12-31 11:07:46 -08:00
Sam Lantinga
5e519b21ed Renamed SDL_GetWindowDisplay() to SDL_GetWindowDisplayIndex() 2012-12-31 10:29:17 -08:00
Sam Lantinga
dfe7f2bc59 Improvements from Alfred:
- Add new SDL_WINDOW_FULLSCREEN_DESKTOP video mode, makes a fullscreen window the size of the desktop (i.e no window manager mode change)
- Fix crash in warp mouse if you specified null as the window
- Added new SDL_VIDEO_MINIMIZE_ON_FOCUS_LOSS Hint, if set to 0 then don't minimize a fullscreen window on focus lost (if not set or set to non-zero then minimize on focus loss)
2012-12-15 00:30:17 +00:00
stopiccot
de7aeffa50 SetMinimumWindowSize for OS X 2012-11-18 15:45:12 +03:00
Ryan C. Gordon
8253567b09 Fixed a typo in the docs. 2012-09-14 18:18:38 -04:00
Ryan C. Gordon
8835a0dacb Added SDL_SetWindowBordered() API.
--HG--
extra : rebase_source : 11750f0d8e7b59af26d97c778a332c0b4b72ea4b
2012-09-13 01:43:53 -04:00
Sam Lantinga
973aecd57a Renamed SDL_GL_CONTEXT_PROFILE_ES2 to SDL_GL_CONTEXT_PROFILE_ES 2012-08-12 23:10:16 -07:00
Sam Lantinga
99502c82fd Fixed bug 1565 - some small GL context creation enhancements
Matthias Bentrup 2012-08-09 12:53:17 PDT

With OpenGL 4.3 the ARB added a new context flag for context reset isolation
and renamed the existing ES2 profile bit to ES profile bit, as it can be used
to request GLES 3 compatible contexts, too.

This patch adds these changes to SDL on Linux and Windows.

Also SDL lacks the ability to create shared contexts. This patch also adds a
new GL attribute to enable context sharing. As casting a GL context to int is
not portable, I added only a boolean attribute
SDL_GL_SHARE_WITH_CURRENT_CONTEXT, which makes the new context share resources
with the context current on the creating thread.
2012-08-12 11:16:24 -07:00
Ryan C. Gordon
2cd5fc4e97 Add support for (GLX|WGL)_EXT_swap_control_tear.
This required a small public API change: SDL_GL_SetSwapInterval() now accepts
 negative values, and SDL_GL_GetSwapInterval() doesn't report errors anymore
 (if it can't work, it'll return zero as a reasonable default).

If you need to test for errors, such as a lack of swap_control_tear support,
 check the results of SDL_GL_SetSwapInterval() when you set your desired
 value.
2012-08-01 20:29:36 -04:00
Sam Lantinga
b3219a6db1 Improved simultaneous support for OpenGL and OpenGL ES
From Scott Percival

Okay, I think I have something for this. Tested it on GL and GLES
machines, it seems to work okay.

- Add a new SDL GL attribute SDL_GL_CONTEXT_EGL:
        - Only useful for the X11 video driver at the moment
        - Set to 1 for an EGL context, 0 to use the default for the video driver
        - Default is 0, unless library is built for EGL only
        - Should be set after SDL init, but before window/context
creation (i.e. same place you'd specify attributes for major/minor GL
version)
- After a lot of agony pondering the least-terrible way to go about
it, made it so that X11_GL_LoadLibrary and X11_GLES_LoadLibrary check
SDL_GL_CONTEXT_EGL. If no GL context exists yet, and the attribute
choice doesn't match with the checking function, then it changes all
the function pointers in the video driver and passes control on to the
new LoadLibrary method.
- Likewise, make X11_CreateWindow check this attribute before firing
off a call to X11_GL_GetVisual/X11_GLES_GetVisual
- Added a sanity check to the start of X11_GL_LoadLibrary
- Tidied up SDL_x11opengles.h
- Moved ownership of the gles_data structure over to
X11_GLES_LoadLibrary/UnloadLibrary
- Should incorporate the 3 fixes posted by Andre Heider

This is obviously quite a bit to take in, but is (at least) a proof of
concept for the approach I think EGL/GLX mingling should take. Any
comments/criticism is much appreciated.
2012-07-18 15:17:27 -07:00
Sam Lantinga
38463b3a0c Add OpenGL 3.X context creation support
Matthias Bentrup 2011-10-30 03:58:24 PDT

I've updated the context creation patch to include the bugfixes by Martin
Schreiber and also included a profile bit to request a ES2 compatible profile.

The wgl context creation may use 2 call to wglChoosePixelFormat if no
acceleration attribute is selected, this should work around a bug with buggy
AMD drivers (see #1254).
2012-02-20 23:37:57 -05:00
Sam Lantinga
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
b62273437c Clarified SDL_GetWindowSurface() documentation
Matthew Orlando to Sam

Someone asked in IRC whether they should free the surface from SDL_GetWindowSurface. The doc comment is a bit vague so i checked the code and revised the comment.
2011-04-22 09:06:29 -07:00
Sam Lantinga
b0660ba5ff SDL 1.3 is now under the zlib license. 2011-04-08 13:03:26 -07:00
Sam Lantinga
7472736e2d Fixed related function documentation 2011-03-22 10:48:33 -07:00
Sam Lantinga
7dd0385c57 Gamma support is back!
New API functions:
	SDL_SetWindowBrightness()
	SDL_GetWindowBrightness()
	SDL_SetWindowGammaRamp()
	SDL_GetWindowGammaRamp()
	SDL_CalculateGammaRamp()
2011-03-11 08:49:20 -08:00
Sam Lantinga
ade868c17f Use boolean value for input grab mode, like we do for fullscreen mode. 2011-02-27 20:06:45 -08:00
Sam Lantinga
f8481050cd Simplified and unified the window creation process a little. 2011-02-21 22:03:39 -08:00
Sam Lantinga
c804b92b9e 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
93ab733085 Fixed bug #1117
There's a new event that's always sent when the window changes size, and that event is what the renderers listen for to determine if they need to rebind their context.
2011-02-12 19:02:14 -08:00
Sam Lantinga
52df6c6092 changeset: 5272:cb08ef104ac4
tag: tip
user: Martin Decky <martin@decky.cz>
date: Sat Feb 12 20:53:06 2011 +0100
summary: improve header files compatibility with SDL 1.2 applications (namely QEMU)
2011-02-12 12:04:00 -08:00
Sam Lantinga
e5803d148c Happy 2011! :) 2011-02-11 22:37:15 -08:00
Sam Lantinga
018af55e16 Window coordinates are in the global space and windows are not tied to a particular display.
Also added Ctrl-Enter keybinding to the test code to toggle fullscreen mode for testing.
2011-02-10 14:44:25 -08:00
Sam Lantinga
e9689c29d5 Be explicit about what display you're querying. The default display is 0. 2011-02-10 12:14:37 -08:00
Sam Lantinga
e0f869b698 Removed gamma support since it wasn't widely used and not well supported. 2011-02-10 11:39:08 -08:00
Sam Lantinga
052351dbe2 Added a way to get a framebuffer interface for a window, and also a way to create a software renderer for an arbitrary surface.
The software renderer has been re-routed to use the framebuffer interface, which makes it possible to have software rendering available even on simple ports.
2011-02-03 15:49:37 -08:00