Commit graph

4803 commits

Author SHA1 Message Date
Sam Lantinga
45d3f30eea Fixed running on iPhone 3G 2012-01-07 22:20:15 -05:00
Sam Lantinga
c160c5c596 Updated SDL test projects 2012-01-07 17:08:17 -05:00
Sam Lantinga
e9cad496a6 Added testnative to the Makefile and fixed building on Mac OS X 2012-01-07 16:57:09 -05:00
Sam Lantinga
d0375e624c Better error messaging when SDL can't create a window surface. 2012-01-07 14:21:22 -05:00
Sam Lantinga
0de29d8f1a Use version B instead of A until we switch SDL 1.3 to SDL2
C.W. Betts 2012-01-06 22:58:41 PST
I would NOT use A. SDL 1.2 uses A, and if I understand correctly, SDL 1.3 and
SDL 1.2 are not binary compatible. Having a different link path for 1.2 and 1.3
will solve any runtime linking errors that might occur.

Sam Lantinga 2012-01-07 00:22:09 PST
Good point.  Until we switch SDL 1.3 to SDL2, we shouldn't use the same link
path.
2012-01-07 03:22:47 -05:00
Sam Lantinga
8bf062f32b Fixed bug 1256 - Invalid window warning in GL_CreateRenderer
Martin Gerhardy 2011-07-27 02:26:06 PDT
the window reference is lost in the GL_CreateRenderer function. The attached
patch should fix this error.

#0  SDLSystem_LogOutputFunction (userdata=0x63b010, category=1,
priority=SDL_LOG_PRIORITY_ERROR, message=0x7fffffffcd00 "Invalid window") at
src/system/sdl/SDLSystem.cpp:8
#1  0x00007ffff7b1ddb3 in SDL_LogMessageV (category=1,
priority=SDL_LOG_PRIORITY_ERROR, fmt=<value optimized out>, ap=<value optimized
out>) at src/SDL_log.c:275
#2  0x00007ffff7b1df7c in SDL_LogError (category=<value optimized out>,
fmt=<value optimized out>) at src/SDL_log.c:212
#3  0x00007ffff7b1d582 in SDL_SetError (fmt=0x7ffff7baaff0 "") at
src/SDL_error.c:111
#4  0x00007ffff7b96f9e in SDL_GL_MakeCurrent (window=0x0, ctx=0xa62ce0) at
src/video/SDL_video.c:2484
#5  0x00007ffff7b4ba0c in GL_ActivateRenderer (renderer=0xa8f680) at
src/render/opengl/SDL_render_gl.c:195
#6  0x00007ffff7b4c59a in GL_ResetState (window=0x918010, flags=<value
optimized out>) at src/render/opengl/SDL_render_gl.c:214
#7  GL_CreateRenderer (window=0x918010, flags=<value optimized out>) at
src/render/opengl/SDL_render_gl.c:343
#8  0x00007ffff7b48053 in SDL_CreateRenderer (window=0x918010, index=<value
optimized out>, flags=2) at src/render/SDL_render.c:166
2012-01-07 02:32:08 -05:00
Sam Lantinga
10b5183a80 Added X11 dynamic loading support for XSetWMProperties() 2012-01-07 02:04:38 -05:00
Marco Trevisan (Treviño)
8279896de9 X11: Move to XSetWMProperties and add support to _NET_WM_PID
Use the convenience function XSetWMProperties to set size, input
and class hints, it also automatically sets the WM_CLIENT_MACHINE
(this one needed by _NET_WM_PID) and WM_LOCALE_NAME windows hints.

Plus we add support to the _NET_WM_PID atom which is needed by many
windows managers to correctly associate a SDL window to its process
and to related .desktop file and icon for the given host.
2011-06-27 19:30:52 +02:00
Sam Lantinga
0108ce2260 Fixed bug 1224 - Blit map not updated if source palette changed
bastien.bouclet@gmail.com 2011-06-12 11:08:58 PDT

SDL_LowerBlit doesn't update the blit color map if the source surface has
changed.

A proposed fix is attached, storing the source palette version in the color
map.
2012-01-07 01:28:06 -05:00
Sam Lantinga
f6bf85902d Fixed bug 1225 - Altivec blitters broken due to SDL_PixelFormat
bastien.bouclet@gmail.com 2011-06-13 05:50:58 PDT

Static pixel format initialization has not been updated to reflect header
changes in SDL_blit_N.c

The attached patch fixes Altivec support for me. altivec.h is needed for some
systems.
2012-01-07 01:25:55 -05:00
Sam Lantinga
de93e295ce Fixed bug 1239 - Crash in iPad with iOS 3.2 because of missing contentScaleFactor support
Joseba García Echebarria 2011-06-30 19:03:56 PDT
I just found that SDL is crashing in the iPad simulator for iOS 3.2 but not for
iOS 4.2 or over when compiling with Xcode 4.0.2.
The Xcode debugger points to line 127 in video/uikit/SDL_uikitopenglview.m as
the line that triggers the crash.
On those lines one can find:

        /* Use the main screen scale (for retina display support) */
        if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)])
                self.contentScaleFactor = [UIScreen mainScreen].scale;

I believe the problem to be that the "scale" selector is supported in iOS 3.2
in the iPad, but contentScaleFactor is not.
I'm no expert in Objective-C, but I believe the following code to be more
correct (it doesn't crash for me):
        /* Use the main screen scale (for retina display support) */
        if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)] &&
[self respondsToSelector:@selector(contentScaleFactor)])
                self.contentScaleFactor = [UIScreen mainScreen].scale;

The same check is being performed in line 155 so I imagine it will crash there,
too.

Vittorio Giovara 2011-08-22 17:58:20 PDT

yeah, -scale was introduced in 3.2 but made available only in 4.0, weird
anyways we just need to check against contentScaleFactor as we can be sure that
both are availble starting from 4.0

the attached patch addresses this
2012-01-07 01:21:50 -05:00
Sam Lantinga
3b5d79f407 Fixed bug 1344 - No OpenGL headers when compiling -> no working Software renderer at runtime neither
Make sure we have at least one render driver.
2012-01-07 01:13:15 -05:00
Sam Lantinga
842e2046ae Switched back to version A, since we don't actually have a version A for SDL 1.3.
It would only be meaningful if we were planning to ship 1.2 as A, and 1.3 as B, which is completely worthless given the headers will be for 1.3 and the API is completely different.
2012-01-07 01:03:54 -05:00
Sam Lantinga
bc63cb4ee4 Fixed bug 1362 - SDL Fails to compile with Visual C++ Express 2008 with Feb 2007 DirectX SDK
Pallav Nawani 2012-01-04 00:48:29 PST
Issue:
Attempted to compile SDL as a static library.

DirectX SDK: Feb 2007
OS: Win 7
Visual C++ Express 2008
Compliation Mode: Static (Changed project settings from dll to lib)

Error:
C1021: invalid preprocessor command 'warning'

It seems that the #warning directive does not exist in Vc++ Express 2008.
2012-01-07 00:57:24 -05:00
Sam Lantinga
12c990f0f8 The symbols should be private 2012-01-07 00:56:21 -05:00
Sam Lantinga
ec033a1da4 Updated iOS projects and renamed iPhoneOS to iOS
--HG--
rename : README.iphoneos => README.iOS
rename : Xcode-iPhoneOS/Demos/Default.png => Xcode-iOS/Demos/Default.png
rename : Xcode-iPhoneOS/Demos/DemosiPhoneOS.xcodeproj/project.pbxproj => Xcode-iOS/Demos/Demos.xcodeproj/project.pbxproj
rename : Xcode-iPhoneOS/Demos/Icon.png => Xcode-iOS/Demos/Icon.png
rename : Xcode-iPhoneOS/Demos/Info.plist => Xcode-iOS/Demos/Info.plist
rename : Xcode-iPhoneOS/Demos/README => Xcode-iOS/Demos/README
rename : Xcode-iPhoneOS/Demos/data/bitmapfont/kromasky_16x16.bmp => Xcode-iOS/Demos/data/bitmapfont/kromasky_16x16.bmp
rename : Xcode-iPhoneOS/Demos/data/bitmapfont/license.txt => Xcode-iOS/Demos/data/bitmapfont/license.txt
rename : Xcode-iPhoneOS/Demos/data/drums/ds_brush_snare.wav => Xcode-iOS/Demos/data/drums/ds_brush_snare.wav
rename : Xcode-iPhoneOS/Demos/data/drums/ds_china.wav => Xcode-iOS/Demos/data/drums/ds_china.wav
rename : Xcode-iPhoneOS/Demos/data/drums/ds_kick_big_amb.wav => Xcode-iOS/Demos/data/drums/ds_kick_big_amb.wav
rename : Xcode-iPhoneOS/Demos/data/drums/ds_loose_skin_mute.wav => Xcode-iOS/Demos/data/drums/ds_loose_skin_mute.wav
rename : Xcode-iPhoneOS/Demos/data/icon.bmp => Xcode-iOS/Demos/data/icon.bmp
rename : Xcode-iPhoneOS/Demos/data/ship.bmp => Xcode-iOS/Demos/data/ship.bmp
rename : Xcode-iPhoneOS/Demos/data/space.bmp => Xcode-iOS/Demos/data/space.bmp
rename : Xcode-iPhoneOS/Demos/data/stroke.bmp => Xcode-iOS/Demos/data/stroke.bmp
rename : Xcode-iPhoneOS/Demos/src/accelerometer.c => Xcode-iOS/Demos/src/accelerometer.c
rename : Xcode-iPhoneOS/Demos/src/common.c => Xcode-iOS/Demos/src/common.c
rename : Xcode-iPhoneOS/Demos/src/common.h => Xcode-iOS/Demos/src/common.h
rename : Xcode-iPhoneOS/Demos/src/fireworks.c => Xcode-iOS/Demos/src/fireworks.c
rename : Xcode-iPhoneOS/Demos/src/happy.c => Xcode-iOS/Demos/src/happy.c
rename : Xcode-iPhoneOS/Demos/src/keyboard.c => Xcode-iOS/Demos/src/keyboard.c
rename : Xcode-iPhoneOS/Demos/src/mixer.c => Xcode-iOS/Demos/src/mixer.c
rename : Xcode-iPhoneOS/Demos/src/rectangles.c => Xcode-iOS/Demos/src/rectangles.c
rename : Xcode-iPhoneOS/Demos/src/touch.c => Xcode-iOS/Demos/src/touch.c
rename : Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj => Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
rename : Xcode-iPhoneOS/SDL/testsdl-Info.plist => Xcode-iOS/SDL/testsdl-Info.plist
rename : Xcode-iPhoneOS/Template/SDL iOS Application/Default.png => Xcode-iOS/Template/SDL iOS Application/Default.png
rename : Xcode-iPhoneOS/Template/SDL iOS Application/Icon.png => Xcode-iOS/Template/SDL iOS Application/Icon.png
rename : Xcode-iPhoneOS/Template/SDL iOS Application/Info.plist => Xcode-iOS/Template/SDL iOS Application/Info.plist
rename : Xcode-iPhoneOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns => Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateIcon.icns
rename : Xcode-iPhoneOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist => Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/TemplateInfo.plist
rename : Xcode-iPhoneOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj => Xcode-iOS/Template/SDL iOS Application/___PROJECTNAME___.xcodeproj/project.pbxproj
rename : Xcode-iPhoneOS/Template/SDL iOS Application/main.c => Xcode-iOS/Template/SDL iOS Application/main.c
rename : Xcode-iPhoneOS/Test/Info.plist => Xcode-iOS/Test/Info.plist
rename : Xcode-iPhoneOS/Test/README => Xcode-iOS/Test/README
rename : Xcode-iPhoneOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj => Xcode-iOS/Test/TestiPhoneOS.xcodeproj/project.pbxproj
2012-01-05 21:41:55 -05:00
Sam Lantinga
da1a15e058 This file keeps getting clobbered... *sigh* 2012-01-03 01:46:52 -05:00
Ryan C. Gordon
5fa2cb67e2 Use arts_suspend() in a loop to wait for arts to become ready.
(Transplanted from hg changeset 331f27f01cdb to the 1.3 branch.)
2012-01-02 15:16:45 -05:00
Sam Lantinga
eb81637ac2 Switched to @rpath for the install path and switched minimum OS to 10.5
Removed extra build configurations
2012-01-02 00:47:54 -05:00
Sam Lantinga
5ef6f8e30f Fixed bug 1337 - joystick crash due to heap corruption with btnx 2012-01-01 16:58:00 -05:00
Sam Lantinga
6f8f49c27a Upgraded SDL Xcode project for XCode 4.2, including switching Framework Version to "B", which is required by the Apple Store. 2011-12-31 13:29:09 -05:00
Sam Lantinga
75ecf04ad9 Check return value, not unsigned "supported" flags 2011-12-31 13:28:07 -05:00
Sam Lantinga
028e5dcdbd Happy New Year! 2011-12-31 09:28:07 -05:00
Sam Lantinga
5e38454931 Added the ability to update a subrect of a YV12/IYUV texture. 2011-12-30 18:19:35 -05:00
Sam Lantinga
98615b55aa Fixed bug 1315 - Greenish video when video size smaller than texture
The incoming pixels are contiguous for the update rectangle.
2011-12-30 18:18:42 -05:00
Sam Lantinga
b7323989e9 Initialize timers first so the tick counter is valid by the time the audio and video systems initialize. 2011-12-30 06:41:41 -05:00
Sam Lantinga
c40aed2a52 Fixed documentation typo 2011-12-29 13:54:22 -05:00
Sam Lantinga
a468f9967b Fixed so the header is consistent with the source 2011-12-29 13:51:42 -05:00
Sam Lantinga
f5c28b2406 Fixes bug 1296 - SDL_SetVideoMode crashes because of unaligned MOVAPS instruction
t.grundner@goto3d.de 2011-09-01 03:59:17 PDT
I figured out what is going on. GCC 4.5.2 assumes the stack is 16 byte aligned
by default. Therefore there are no AND alignment corrections necessary if we
wish to align a stack variable to a 16 byte boundary. That is bad if your OS
ABI is not 16 byte aligned. Windows 32 bit stacks are 4 byte aligned. This
results in the above mentioned SIGSEGV. This is also no problem if I compile
both SDL.dll and my app with MingW because MinGW/GCC inserts a

        andl    $-16, %esp

instruction right in the beginning of the main function. So at least the stack
of the thread calling the main function is 16 byte aligned. But as soon as I
start to use the SDL.dll from an application not compiled by MinGW there is no
ANDL safing my app.

However there is a GCC option that can change the default stack alignment:

        -mpreferred-stack-boundary=num

Setting num=2 assumes a the stack is aligned to a 4 byte boundary. This results
in GCC inserting the necessary

        andl    $-16, %esp

into SDL_FillRect. Rebuilding SDL with

       ./configure "CFLAGS=-mpreferred-stack-boundary=2 -g -O3"

solved the problem.

IMHO this should also be a problem on Solaris.

The following links contain further information:

http://gcc.gnu.org/onlinedocs/gcc-4.5.2/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options

http://www.agner.org/optimize/calling_conventions.pdf
2011-12-29 05:36:39 -05:00
Sam Lantinga
ad85c9da0e Fixed bug 1338 - Direct3D renderer should set D3DCREATE_FPU_PRESERVE for not behaving vastly different on doubles (causes 3rd party lib crashes!)
Jonas Thiem 2011-11-29 12:28:02 PST
Direct3D renderer should set D3DCREATE_FPU_PRESERVE for not behaving vastly
different to OpenGL/software rendering on doubles and break some libraries
really badly.

Most notable affected example: Lua, which does the most unpredictable things
which are really almost impossible to debug/find out for beginners who never
heard this culprit exists.

Since I believe all renderers should behave the same on that doubles simply
work as expected in a program, this should really be changed! (also this wasted
a few days of my life wondering why everything in my program was so broken)
2011-12-29 05:18:16 -05:00
Sam Lantinga
3a7d58ddf8 Fixed bug 1336 - Added a timestamp on all SDL events
Gueniffey 2011-11-23 04:11:31 PST

The attached simple patch adds a timestamp to all SDL events. It is useful to
dismiss old events and add UI responsiveness (my application does some
extensive tasks that creates a delay in the event queue handling. With this
patch, I can deal only with the most recent events.
2011-12-29 05:13:55 -05:00
Sam Lantinga
a76f024ea9 Fixed bug 1335 - Added support for different pixel formats in OpenGL ES 2 renderer
Gueniffey 2011-11-23 04:06:31 PST

The attached patch adds native support for
SDL_PIXELFORMAT_ARGB8888, SDL_PIXELFORMAT_RGB888, SDL_PIXELFORMAT_BGR888
2011-12-29 05:11:33 -05:00
Ryan C. Gordon
7023079a50 Don't call -[NSView setAcceptsTouchEvents] if the OS doesn't provide it.
Thanks to Dimiter 'malkia' Stanev for the fix!
2011-12-09 02:32:21 -05:00
Sam Lantinga
f1b292b5fd Ryan gets fewer nuts. :) 2011-12-07 20:34:43 -05:00
Ryan C. Gordon
ab7c9fe945 Added SDL_dropevents to the Xcode project files.
Fixes build.
2011-12-06 21:46:19 -05:00
Ryan C. Gordon
6f62ce7bcc More work to clean up compiler warnings. 2011-12-05 16:45:32 -05:00
Ryan C. Gordon
f98e22682f Patched to compile. 2011-12-05 13:17:57 -05:00
Ryan C. Gordon
5c8b76f6a9 Fixed a tabstop. 2011-12-05 13:13:32 -05:00
Ryan C. Gordon
95de92cbf2 Backed out most of changeset 4b88086910d3, at Andreas's request. 2011-12-05 12:43:50 -05:00
Andreas Schiffler
a6b353dfa5 Fix buildbot sdl-macosx-unix-x86 and sdl-macosx-amd64 compiler warnings 2011-12-05 07:41:20 -08:00
Andreas Schiffler
4d6a742cd1 Updated VS2010 project files 2011-12-04 21:45:34 -08:00
Sam Lantinga
29177954e7 It works better if you compile it. 2011-11-29 02:28:34 -05:00
Sam Lantinga
f98e88676c Better fix, iterate backwards over the array so we don't care whether the close code shuffles things down. 2011-11-29 02:27:34 -05:00
Sam Lantinga
22e0d6fa53 Closing the joystick removes it from the list. 2011-11-29 02:15:39 -05:00
Sam Lantinga
10823d6065 Invalid assert. It's perfectly legit to initialize the joystick subsystem and get no joysticks. 2011-11-29 02:12:24 -05:00
Sam Lantinga
dd506a225a Yes, let's save 32-bit BMP files, very useful for you know, making a game... 2011-11-29 02:11:39 -05:00
Ryan C. Gordon
c06f45e2ba Another iOS 3.1 compatibility fix.
Thanks to Vittorio Giovara for the patch!
2011-11-27 23:30:02 -05:00
Sam Lantinga
6182eb372a No man pages for SDL 1.3 2011-11-23 13:25:45 -05:00
Sam Lantinga
f52f040b3d First pass at a simple drag and drop API, allowing you to accept files dropped into your application. 2011-11-20 19:38:18 -05:00
Ryan C. Gordon
269da4cbfb Make +sharedAppDelegate return a generic object instead of a SDLUIKitDelegate.
This way subclasses can use it without a lot of casting.

Thanks to Vittorio Giovara for the patch!
2011-11-19 19:23:33 -05:00