Commit Graph

880 Commits

Author SHA1 Message Date
Sam Lantinga
017bece619 We might actually have PI 2012-11-01 00:12:57 -07:00
Sam Lantinga
4bbe3a7073 Added an assert log category, and NSLog support on Mac OS X and iOS 2012-10-30 12:30:02 -07:00
Sam Lantinga
07f0419650 Added some documentation on the behavior of SDL_ShowMessageBox() 2012-10-30 10:07:32 -07:00
Sam Lantinga
35feaaaf51 It turns out that UCS2 and UCS4 are defined as big-endian encodings 2012-10-28 13:03:45 -07:00
Sam Lantinga
82f91da2d0 Added API for simple messagebox, courtesy of Mike Sartain 2012-10-23 17:11:22 -07:00
Sam Lantinga
93902fa034 Updated the copyright date on the default config file 2012-10-23 15:59:07 -07:00
Sam Lantinga
73c7d679a0 Switch C++ comment to C comment 2012-10-21 22:18:36 -07:00
Sam Lantinga
49796bf2b6 Fixed another gcc <-> Visual C++ ABI issue 2012-10-20 00:49:08 -07:00
Sam Lantinga
9090fb9b4c Make it possible to build a DLL with mingw that's ABI compatible with Visual C++ built applications 2012-10-20 00:14:58 -07: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
a1f39a5854 I'm becoming more and more convinced that the application should never use XRandR, and it's the window manager's responsibility to track and manage display modes for fullscreen windows.
Because it's so broken, I'm going to disable XRandR by default.  You can still enable it via environment variable or application hint (SDL_HINT_VIDEO_X11_XRANDR)
2012-10-04 13:50:41 -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
Sam Lantinga
225faf6595 Turned the X11 mode extension environment variables into hints so they can be more easily set from applications. 2012-09-27 11:29:13 -07:00
Gabriel Jacobo
8408ace068 Make SDL_atomic.h depend on the void pointer size determined at compile time
rather than at configure time. As OS X supports lipo'ed versions of SDL for i386
and x86_64, a single set of headers that work for both architectures is desired.
2012-09-26 15:57:28 -03:00
Sam Lantinga
e52130b426 Fixed bug 1606 - SDL does not implement SDL_GetPowerInfo() for Android.
Philipp Wiesemann 2012-09-22 05:26:11 PDT

currently SDL (HG) does not implement the power management functionality of
SDL_GetPowerInfo() for Android.

I attached a patch which tries to implement this functionality (JNI only, API
5). It supports plugged state and battery percent return values but not
remaining seconds (which are not available on Android).
2012-09-23 01:37:44 -07:00
Ryan C. Gordon
b3b40aac16 Removed Windows CE support from SDL 2.0.
It's a long-dead platform, and we don't have any way to build for, test, or
maintain it, so there's no sense in doing acrobatics to support it.

If you need Windows CE support, use SDL 1.2. If you need Windows Phone support,
send SDL 2.0 patches for the newer Windows Mobile platform.
2012-09-15 10:59:39 -04:00
Ryan C. Gordon
0c926d9aea Fixed a typo in the docs. 2012-09-14 18:18:38 -04:00
Ryan C. Gordon
49d8c6fb12 Added SDL_SetWindowBordered() API. 2012-09-13 01:43:53 -04:00
Gabriel Jacobo
ceaf031283 Implements SDL_GL_BindTexture and SDL_GL_UnbindTexture (#1576) 2012-09-03 11:16:12 -03:00
Sam Lantinga
03410caaaf Renamed SDL_GL_CONTEXT_PROFILE_ES2 to SDL_GL_CONTEXT_PROFILE_ES 2012-08-12 23:10:16 -07:00
Sam Lantinga
c5eed5e522 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
Sam Lantinga
e6d37e6522 Fixed bug 1564 - SDL has no function to open a screen keyboard on Android.
Philipp Wiesemann implemented a general on-screen keyboard API for SDL, and I switched iOS code over to use it.
2012-08-11 10:15:59 -07:00
Ryan C. Gordon
4abe53d466 Fixed building on Mac OS X with Xcode 4.4 (OS X 10.8 SDK).
I think you'll need to install Xquartz, the external-but-official replacement
 for Apple's X11, to get the Xlib headers: http://support.apple.com/kb/HT5293
2012-08-09 15:43:39 -04:00
Ryan C. Gordon
f32956dc1b 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
5fd86fdeac Fixed bug 1542 - SDL_Touch should reserve tilt_x and tilt_y
Gerry JJ 2012-07-14 19:42:23 PDT
The SDL_Touch structure currently reserves fields for tablet tilt and rotation
(marked "for future use"), but a tablet stylus can tilt in both x and y
directions in addition to rotation around itself (or, put another way, it can
rotate in x, y and z). So, the struct should probably reserve fields for both
tilt_x and tilt_y, not just tilt.
2012-07-18 15:53:33 -07:00
Sam Lantinga
719eabe5ee 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
Ryan C. Gordon
641161f677 Patched to compile on FreeBSD 8.2. 2012-07-11 22:20:02 -04:00
Ryan C. Gordon
0cdd02b4de Patched to compile on Mac OS X with Xcode (Unix configure already worked). 2012-07-11 20:40:02 -04:00
Sam Lantinga
c45ef572c4 Disable the SDL event pump after the SDL main routine returns, since events will be dispatched by the Cocoa event loop. 2012-06-25 11:10:34 -04:00
Sam Lantinga
5160c3d202 Created a header file for system dependent API functions, and added SDL_iPhoneSetAnimationCallback() 2012-06-22 19:19:18 -04:00
Sam Lantinga
3da89b1dd0 Updated Mac OS X and iOS projects 2012-06-21 10:41:25 -04:00
Gabriel Jacobo
2e96488df0 RenderCopyEx,rotation and flipping for all hardware/software backends (#1308) 2012-06-01 19:51:08 -03:00
Dimitris Zenios
e387df94fc 1.Fixed a memory leak inside XInput2 code
2.Replaced XKeycodeToKeysym with XkbKeycodeToKeysym since XKeycodeToKeysym is deprecated in newer X11 version
3.Rewrote testime.c since it was disabled after SDL_compat.c removal
4.Take into account common arguments also in testrelative.c
2012-05-31 19:23:30 +03:00
Dimitris Zenios
689dd07956 1.Moved all xinput2 functionality to its own file
2.Implement touch events using Xinput2.Leave evtouch as a fallback when xinput2 is not supported
2012-05-31 13:37:02 +03:00
Sam Lantinga
ff4a156632 Fixed define for consistency 2012-05-30 11:45:09 -04:00
Sam Lantinga
94597260b7 Fixed compile error with both new and old Xext headers (bug 1498) 2012-05-30 11:44:57 -04:00
Sam Lantinga
a74c7583bc Initial support for XInput2 by Dimitris Zenios
1.initial work on XInput2 support
2.Implemented relative mouse motion when XInput2 is enabled
3.Created a test app to test relative mouse motion
4.Fixed Bug #1498
2012-05-30 11:25:35 -04:00
Gabriel Jacobo
a6c03533e0 Fixes issue #1500 "SDL_RWops fails under Android 4" by removing stale Local Refs
and replacing them for their global equivalents.
2012-05-25 15:35:41 -03:00
Sam Lantinga
c24538ae24 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
Ryan C. Gordon
a6a93eaeae Check for _STDINT_H in SDL_config_minimal.h 2012-02-07 01:26:00 -05:00
Sam Lantinga
b5844a1c07 Added a convenience function SDL_CreateWindowAndRenderer() 2012-01-22 19:22:53 -05:00
Sam Lantinga
07b8dc102e Re-added SDL_SWSURFACE, because it looks silly to always pass 0 to SDL_CreateRGBSurface() 2012-01-22 18:37:46 -05:00
Sam Lantinga
9c4c023744 Removed the SDL 1.2 compatibility API... we'll see how painful this is. 2012-01-22 18:11:41 -05:00
Sam Lantinga
128821901c Removing some more references to SDL 1.3 2012-01-22 17:26:45 -05:00
Sam Lantinga
c484f884c5 Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2 2012-01-22 17:21:00 -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