Commit graph

4925 commits

Author SHA1 Message Date
Sam Lantinga
ee38b15029 Updated Android Makefile for SDL2 2012-01-30 20:09:50 -05:00
Sam Lantinga
d74752d82f Added glGenFramebuffers() to the function pointer list 2012-01-28 14:53:23 -05:00
Sam Lantinga
114800d3e6 Fixed setting the orthographic projection when the viewport changes. 2012-01-28 14:05:48 -05:00
Tim Angus
effddab35f * 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
173c6abcd0 Sanity check the window width and height 2012-01-22 23:51:46 -05:00
Sam Lantinga
96c0686983 Successfully built an SDL 2.0 RPM 2012-01-22 23:36:59 -05:00
Sam Lantinga
7f5ba0ca08 Updated the README and removed the old graywin test 2012-01-22 22:30:27 -05:00
Sam Lantinga
ef9497a138 Removed old SDL 1.2 tests from the iOS test projects 2012-01-22 22:29:50 -05:00
Sam Lantinga
c43e4bf999 Fixed setting the window visibility on iOS and Android 2012-01-22 22:19:08 -05:00
Sam Lantinga
08e3824fa0 Removed old compat files from Visual Studio and Xcode projects 2012-01-22 22:09:29 -05:00
Sam Lantinga
aaf23fe8af 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
f1b459aaf7 Have testspriteminimal use the new simple API 2012-01-22 19:47:33 -05:00
Sam Lantinga
39b2ae4a20 Added a convenience function SDL_CreateWindowAndRenderer() 2012-01-22 19:22:53 -05:00
Sam Lantinga
4f6d606c93 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
5ef4144446 Removed the SDL 1.2 compatibility API... we'll see how painful this is. 2012-01-22 18:11:41 -05:00
Sam Lantinga
cb74808ecb Switched the RPM spec file to SDL 2.0
--HG--
rename : SDL.spec.in => SDL2.spec.in
2012-01-22 17:50:35 -05:00
Sam Lantinga
f84b2f8c6d Removed unsupported Watcom files 2012-01-22 17:41:33 -05:00
Sam Lantinga
51019eddd0 BeOS is no longer a going concern. ;) 2012-01-22 17:33:44 -05:00
Sam Lantinga
136979d3b5 Removed unsupported Borland related files 2012-01-22 17:32:50 -05:00
Sam Lantinga
3ad2c65336 Removing some more references to SDL 1.3 2012-01-22 17:26:45 -05:00
Sam Lantinga
d71e0546a9 Updated to SDL 2.0, and SDL 2.0 can now be installed coexisting with SDL 1.2
--HG--
rename : sdl-config.in => sdl2-config.in
rename : sdl.m4 => sdl2.m4
rename : sdl.pc.in => sdl2.pc.in
2012-01-22 17:21:00 -05:00
Sam Lantinga
8d3c63045f You need to create the texture with the SDL_TEXTUREACCESS_TARGET flag. 2012-01-22 01:29:26 -05:00
Sam Lantinga
0458fa488a Renamed SetTargetTexture() to SetRenderTarget() 2012-01-22 01:26:28 -05:00
Sam Lantinga
da686e5bd4 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
fb87e98b8a Sorted the source files 2012-01-21 22:14:38 -05:00
Sam Lantinga
f64b376d9a Cleaned up the iOS test project and added testscale and testrendertarget 2012-01-21 22:13:20 -05:00
Sam Lantinga
7eefd495d2 Added testscale and testrendertarget projects 2012-01-21 21:50:28 -05:00
Sam Lantinga
301928014c 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
d64668508c Added the correct version.rc to the Visual Studio build. 2012-01-21 12:10:14 -05:00
Sam Lantinga
23b96d3406 Added a renderer flag to expose whether a renderer supports render to texture. 2012-01-19 21:06:47 -05:00
Sam Lantinga
320c59b387 Fix for building with Visual Studio 2012-01-19 20:25:09 -05:00
Sam Lantinga
5546f5ad65 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.

--HG--
rename : include/SDL_config_generated.h.in => include/SDL_config.h.in
2012-01-19 01:55:51 -05:00
Sam Lantinga
a49a88676f Implementation of render targets, by Mason Wheeler and Gabriel Jacobo
Thanks guys!
2012-01-18 22:45:49 -05:00
Sam Lantinga
2e70e7f3cb 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
ec7e4ac7a7 Added spaces for the include path 2012-01-16 20:40:10 -05:00
Sam Lantinga
c1a974dae5 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
d8630c8b10 Fixed configure build 2012-01-16 19:21:07 -05:00
Sam Lantinga
68b32846b8 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
6654546b2a Check for sem_timedwait(), which isn't available on some systems (including OpenBSD 2012-01-15 03:34:14 -05:00
Sam Lantinga
9033bb050f 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

--HG--
rename : include/SDL_config.h.in => include/SDL_config_generated.h.in
2012-01-14 13:21:19 -05:00
Sam Lantinga
db165a81bc 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
185bcb6114 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
41b2fc0189 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
40c6294290 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
3fe05cfb55 Better interpolation for the x4 upsampling case 2012-01-12 22:54:09 -05:00
Sam Lantinga
17d38b0d37 Fixed issue where there was a garbage sample at the end of the buffer. 2012-01-12 21:42:35 -05:00
Sam Lantinga
a9eeb84da2 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
7083b58688 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
b628aa46c5 Fixed bug 1366 - SDL_opengles2.h is not installed in "include/SDL" under Linux 2012-01-09 21:11:11 -05:00
Sam Lantinga
fc8603b5d6 Fixed structure alignment mismatch between Visual Studio and gcc on 64-bit architectures. 2012-01-09 07:07:43 -05:00