Commit Graph

4873 Commits

Author SHA1 Message Date
Sam Lantinga
55ea8bdfd4 Fixed setting the orthographic projection when the viewport changes. 2012-01-28 14:05:48 -05:00
Tim Angus
b2029b6a66 * On iOS, fix support for the case where [UIScreen scale] is not 1.0 (retina)
* Allow selection of non-retina modes on retina devices
2012-01-25 14:29:56 +00:00
Sam Lantinga
f4c0910b5b Sanity check the window width and height 2012-01-22 23:51:46 -05:00
Sam Lantinga
e2e9ecfa1f Successfully built an SDL 2.0 RPM 2012-01-22 23:36:59 -05:00
Sam Lantinga
24472a0309 Updated the README and removed the old graywin test 2012-01-22 22:30:27 -05:00
Sam Lantinga
36dbd7c7ca Removed old SDL 1.2 tests from the iOS test projects 2012-01-22 22:29:50 -05:00
Sam Lantinga
fac9ba080a Fixed setting the window visibility on iOS and Android 2012-01-22 22:19:08 -05:00
Sam Lantinga
254cf2c53c Removed old compat files from Visual Studio and Xcode projects 2012-01-22 22:09:29 -05:00
Sam Lantinga
f14f70bc64 Fixed loading textures when the window starts hidden.
The viewport automatically resets to the window size when you programmatically resize the window.
2012-01-22 21:46:06 -05:00
Sam Lantinga
3c87570c58 Have testspriteminimal use the new simple API 2012-01-22 19:47:33 -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
0b021e1de9 Switched the RPM spec file to SDL 2.0 2012-01-22 17:50:35 -05:00
Sam Lantinga
56d871b599 Removed unsupported Watcom files 2012-01-22 17:41:33 -05:00
Sam Lantinga
aaae96a5cb BeOS is no longer a going concern. ;) 2012-01-22 17:33:44 -05:00
Sam Lantinga
115347e976 Removed unsupported Borland related files 2012-01-22 17:32:50 -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
dba1ccf43b Reorganized the render target code, moving the viewport handling to the general code and adding software implementation. 2012-01-21 22:22:30 -05:00
Sam Lantinga
c255ba9a14 Sorted the source files 2012-01-21 22:14:38 -05:00
Sam Lantinga
e5e57bf7e8 Cleaned up the iOS test project and added testscale and testrendertarget 2012-01-21 22:13:20 -05:00
Sam Lantinga
a2c8422c6c Added testscale and testrendertarget projects 2012-01-21 21:50:28 -05:00
Sam Lantinga
7f8f4956c3 We've already crashed by this point if we don't have a renderer. The calling code should check this. 2012-01-21 18:30:50 -05:00
Sam Lantinga
27f336ae6e Added the correct version.rc to the Visual Studio build. 2012-01-21 12:10:14 -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
096d218036 Fix for building with Visual Studio 2012-01-19 20:25:09 -05:00
Sam Lantinga
9853ab62c8 Switched back to configure generating SDL_config.h
It was very confusing to have configure generate an SDL_config.h and then not have it be used when building on Mac OS X or Windows.  I'll just have to remember to use SDL_config_windows.h when building official releases that are supposed to be ABI compatible with Visual Studio.
2012-01-19 01:55:51 -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
f36a10c448 Fixed bug 1372 - OSX Window Maximize/Resize Doesn't Update Window Position
Alex Nankervis 2012-01-15 14:20:01 PST

SDL_cocoawindow.m, windowDidResize needs to also send a window move event.
Depending on the corner you resize a window from, or when maximizing a window,
the window position will change. Discovered this when creating a maximized
window and found that the window position was stuck at the un-maximized
window's value.

Diff with fix attached.
2012-01-18 22:22:54 -05:00
Sam Lantinga
ce42b7c89d Added spaces for the include path 2012-01-16 20:40:10 -05:00
Sam Lantinga
552c799620 Fixed blit mapping problem when surfaces are freed and then newly allocated at the same address.
Tim Angus to SDL

void function( SDL_Surface* surface )
{
 SDL_Surface* anotherSurface =
   SDL_ConvertSurfaceFormat( surface, ... );

 // surface->map->dst is now equal to anotherSurface

 // Do some stuff with anotherSurface

 SDL_FreeSurface( anotherSurface );

 // anotherSurface is now a dead pointer,
 // but surface->map->dst still points to it
}

int main( )
{
 SDL_Surface* surface = CreateAValidSurface( );

 function( surface );
}

At this point blit something from surface. SDL_LowerBlit is called, which checks surface->map->dst against the blit destination. If the pointers happen to match (not that unlikely), the map is decided to be valid and bad things happen.

It seems to me like the whole idea of caching the blit mapping is fundamentally flawed in that the source surface has no knowledge of the lifetime of the destination surface.
2012-01-16 19:46:40 -05:00
Sam Lantinga
47034fa31b Fixed configure build 2012-01-16 19:21:07 -05:00
Sam Lantinga
31a92e8e9f Fixed bug 1371 - DX joystick axis ordering fix
Alex Nankervis 2012-01-15 11:19:45 PST

DirectX joysticks can enumerate their axis out of order. This results in some
joysticks having vertical/horizontal swapped, for example (vertical axis gets
assigned to axis0). Joysticks that I've tested with this problem: XBOX 360
controller, Logitech Extreme 3D Pro.

Attached is a diff that fixes this by sorting the DX joystick objects by their
data offsets into the DX data structs. This puts the joystick objects into a
standard ordering (X axis -> axis0, Y axis -> axis1, and so on).
2012-01-15 15:48:27 -05:00
Sam Lantinga
243a72784f Check for sem_timedwait(), which isn't available on some systems (including OpenBSD 2012-01-15 03:34:14 -05:00
Sam Lantinga
d4c4a98f59 Make sure that we use consistent configuration options on platforms like Windows so that command line builds and IDE builds have ABI compatibility.
Make sure we don't clobber SDL_revision.h when building from Mercurial
2012-01-14 13:21:19 -05:00
Sam Lantinga
59f51ede60 Unofficial builds should have a 0 revision number - if this accidentally gets checked in with a different revision, this file should be reverted to this content. 2012-01-14 13:17:01 -05:00
Sam Lantinga
81b963b31b Fixed bug 1238 - SDL_SetKeyboardFocus may send events to already destroyed windows
bastien.bouclet@gmail.com 2011-06-26 02:15:36 PDT

SDL_Keyboard::focus does not seem to be reset when the window that has focus is
destroyed, resulting in the following crash :

#0  X11_SetWindowGammaRamp (_this=0x8ed9cb0, window=0x91f25c0, ramp=0x0) at
src/video/x11/SDL_x11window.c:948
#1  0x001bd15e in SDL_OnWindowFocusLost (window=0x91f25c0) at
src/video/SDL_video.c:1900
#2  0x00168a2e in SDL_SendWindowEvent (window=0x91f25c0, windowevent=<value
optimized out>, data1=0, data2=0)
    at src/events/SDL_windowevents.c:157
#3  0x00166454 in SDL_SetKeyboardFocus (window=0x9678a08) at
src/events/SDL_keyboard.c:612
2012-01-14 01:38:11 -05:00
Sam Lantinga
e2df95c6f2 Fixed inline assembly warning for PPC
input constraint with a matching output constraint of incompatible type
2012-01-14 00:49:25 -05:00
Sam Lantinga
a1d5bd8db6 Fixed bug 1368 - Enabling joystick subsystem cause an infinite loop
morgan.devel@gmail.com 2012-01-13 00:32:23 PST

The android version of SDL_SYS_JoystickUpdate doesn't check if there is
actually new data and always generate the SDL_JOYAXISMOTION event.
Consequently, doing a while(SDL_PollEvent()) will result in an endless loop.

The attached patch fix this issue.

It also scale the incoming values properly in the Sint16 range. The scale from
[-gravity;+gravity] is done directly in the java part because one may want to
map the sensor values with a non-linear method for example.
2012-01-13 20:57:35 -05:00
Sam Lantinga
1653c59262 Better interpolation for the x4 upsampling case 2012-01-12 22:54:09 -05:00
Sam Lantinga
e3d3970d6f Fixed issue where there was a garbage sample at the end of the buffer. 2012-01-12 21:42:35 -05:00
Sam Lantinga
9dc3474805 David Carre cpasjuste@gmail.com
I'm playing with SDL on android, and did notice a problem in latest sources ( branch "default" ) :

SDL/src/render/opengles/SDL_glesfuncs.h:10: error: 'glDrawTexiOES' undeclared (first use in this function)
SDL/src/render/opengles/SDL_glesfuncs.h:10: error: (Each undeclared identifier is reported only once

If it can help you win some time here is the fix, applied to the "Android.mk" file :

LOCAL_CFLAGS += -D GL_GLEXT_PROTOTYPES
2012-01-10 21:07:09 -05:00
Sam Lantinga
d06d970095 Fixed bug 1331 - SDL_CreateTextureFromSurface fails for OpenGL + Win XP 64 NVidia 285.58 with GL_INVALID_ENUM
I think this fixes the bug.  I'm not sure why it would fail, and it may have something to do with the version of OpenGL that we initialize and use by default. Regardless, this should take care of the problem.
2012-01-10 21:00:47 -05:00
Sam Lantinga
f6d0ae76e7 Fixed bug 1366 - SDL_opengles2.h is not installed in "include/SDL" under Linux 2012-01-09 21:11:11 -05:00
Sam Lantinga
1781323edc Fixed structure alignment mismatch between Visual Studio and gcc on 64-bit architectures. 2012-01-09 07:07:43 -05:00
Sam Lantinga
094db18796 Don't hardcode output paths, Visual Studio does the right thing. 2012-01-09 04:53:58 -05:00
Sam Lantinga
91c26c9eb7 Removing test projects for Visual Studio 2005 2012-01-09 04:39:55 -05:00