Răsfoiți Sursa

Updating SDL

Panagiotis Christopoulos Charitos 15 ani în urmă
părinte
comite
e3bb87942f
49 a modificat fișierele cu 1718 adăugiri și 2425 ștergeri
  1. 4 6
      extern/include/SDL/SDL.h
  2. 4 3
      extern/include/SDL/SDL_assert.h
  3. 219 116
      extern/include/SDL/SDL_atomic.h
  4. 1 1
      extern/include/SDL/SDL_audio.h
  5. 61 0
      extern/include/SDL/SDL_blendmode.h
  6. 1 1
      extern/include/SDL/SDL_clipboard.h
  7. 31 8
      extern/include/SDL/SDL_compat.h
  8. 12 26
      extern/include/SDL/SDL_config.h
  9. 26 15
      extern/include/SDL/SDL_cpuinfo.h
  10. 1 1
      extern/include/SDL/SDL_endian.h
  11. 2 2
      extern/include/SDL/SDL_error.h
  12. 22 10
      extern/include/SDL/SDL_events.h
  13. 1 1
      extern/include/SDL/SDL_gesture.h
  14. 4 0
      extern/include/SDL/SDL_haptic.h
  15. 170 0
      extern/include/SDL/SDL_hints.h
  16. 1 1
      extern/include/SDL/SDL_input.h
  17. 1 1
      extern/include/SDL/SDL_joystick.h
  18. 16 16
      extern/include/SDL/SDL_keyboard.h
  19. 3 3
      extern/include/SDL/SDL_keysym.h
  20. 1 1
      extern/include/SDL/SDL_loadso.h
  21. 207 0
      extern/include/SDL/SDL_log.h
  22. 3 2
      extern/include/SDL/SDL_main.h
  23. 1 1
      extern/include/SDL/SDL_mouse.h
  24. 27 1
      extern/include/SDL/SDL_mutex.h
  25. 5 3
      extern/include/SDL/SDL_opengl.h
  26. 26 1026
      extern/include/SDL/SDL_opengles.h
  27. 52 33
      extern/include/SDL/SDL_pixels.h
  28. 11 9
      extern/include/SDL/SDL_platform.h
  29. 1 1
      extern/include/SDL/SDL_power.h
  30. 1 1
      extern/include/SDL/SDL_quit.h
  31. 1 1
      extern/include/SDL/SDL_rect.h
  32. 609 0
      extern/include/SDL/SDL_render.h
  33. 1 1
      extern/include/SDL/SDL_revision.h
  34. 7 7
      extern/include/SDL/SDL_rwops.h
  35. 3 3
      extern/include/SDL/SDL_scancode.h
  36. 1 1
      extern/include/SDL/SDL_stdinc.h
  37. 30 242
      extern/include/SDL/SDL_surface.h
  38. 32 7
      extern/include/SDL/SDL_syswm.h
  39. 1 1
      extern/include/SDL/SDL_thread.h
  40. 17 71
      extern/include/SDL/SDL_timer.h
  41. 1 1
      extern/include/SDL/SDL_touch.h
  42. 1 1
      extern/include/SDL/SDL_types.h
  43. 1 2
      extern/include/SDL/SDL_version.h
  44. 92 793
      extern/include/SDL/SDL_video.h
  45. 1 1
      extern/include/SDL/begin_code.h
  46. 1 1
      extern/include/SDL/close_code.h
  47. BIN
      extern/lib-x86-64-linux/libSDL-1.3.so.0.0.0
  48. 1 1
      src/Main.cpp
  49. 3 2
      src/Scene/Scene.cpp

+ 4 - 6
extern/include/SDL/SDL.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -37,10 +37,6 @@
  *  level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
  *  level access to audio, keyboard, mouse, joystick, 3D hardware via OpenGL,
  *  and 2D framebuffer across multiple platforms.
  *  and 2D framebuffer across multiple platforms.
  *  
  *  
- *  The current version supports Windows, Windows CE, Mac OS X, Linux,
- *  FreeBSD, NetBSD, OpenBSD, BSD/OS, Solaris, and QNX. The code contains
- *  support for other operating systems but those are not officially supported. 
- *  
  *  SDL is written in C, but works with C++ natively, and has bindings to
  *  SDL is written in C, but works with C++ natively, and has bindings to
  *  several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
  *  several other languages, including Ada, C#, Eiffel, Erlang, Euphoria,
  *  Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
  *  Guile, Haskell, Java, Lisp, Lua, ML, Objective C, Pascal, Perl, PHP,
@@ -83,9 +79,12 @@
 #include "SDL_endian.h"
 #include "SDL_endian.h"
 #include "SDL_error.h"
 #include "SDL_error.h"
 #include "SDL_events.h"
 #include "SDL_events.h"
+#include "SDL_hints.h"
 #include "SDL_loadso.h"
 #include "SDL_loadso.h"
+#include "SDL_log.h"
 #include "SDL_mutex.h"
 #include "SDL_mutex.h"
 #include "SDL_power.h"
 #include "SDL_power.h"
+#include "SDL_render.h"
 #include "SDL_rwops.h"
 #include "SDL_rwops.h"
 #include "SDL_thread.h"
 #include "SDL_thread.h"
 #include "SDL_timer.h"
 #include "SDL_timer.h"
@@ -116,7 +115,6 @@ extern "C" {
 #define SDL_INIT_JOYSTICK       0x00000200
 #define SDL_INIT_JOYSTICK       0x00000200
 #define SDL_INIT_HAPTIC         0x00001000
 #define SDL_INIT_HAPTIC         0x00001000
 #define SDL_INIT_NOPARACHUTE    0x00100000      /**< Don't catch fatal signals */
 #define SDL_INIT_NOPARACHUTE    0x00100000      /**< Don't catch fatal signals */
-#define SDL_INIT_EVENTTHREAD    0x01000000      /**< Not supported on all OS's */
 #define SDL_INIT_EVERYTHING     0x0000FFFF
 #define SDL_INIT_EVERYTHING     0x0000FFFF
 /*@}*/
 /*@}*/
 
 

+ 4 - 3
extern/include/SDL/SDL_assert.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -50,8 +50,9 @@ on the assertion line and not in some random guts of SDL, and so each
 assert can have unique static variables associated with it.
 assert can have unique static variables associated with it.
 */
 */
 
 
-#if (defined(_MSC_VER) && ((_M_IX86) || (_M_X64)))
-    #define SDL_TriggerBreakpoint() __asm { int 3 }
+#if defined(_MSC_VER) && !defined(_WIN32_WCE)
+#include <intrin.h>
+    #define SDL_TriggerBreakpoint() __debugbreak()
 #elif (defined(__GNUC__) && ((__i386__) || (__x86_64__)))
 #elif (defined(__GNUC__) && ((__i386__) || (__x86_64__)))
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
     #define SDL_TriggerBreakpoint() __asm__ __volatile__ ( "int $3\n\t" )
 #elif defined(HAVE_SIGNAL_H)
 #elif defined(HAVE_SIGNAL_H)

+ 219 - 116
extern/include/SDL/SDL_atomic.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -18,24 +18,42 @@
 
 
     Sam Lantinga
     Sam Lantinga
     [email protected]
     [email protected]
-
-    Contributed by Bob Pendleton, [email protected]
  */
  */
 
 
 /**
 /**
- *  \file SDL_atomic.h
- *  
- *  Atomic operations.
- *  
- *  These operations may, or may not, actually be implemented using
- *  processor specific atomic operations. When possible they are
- *  implemented as true processor specific atomic operations. When that
- *  is not possible the are implemented using locks that *do* use the
- *  available atomic operations.
- *  
- *  At the very minimum spin locks must be implemented. Without spin
- *  locks it is not possible (AFAICT) to emulate the rest of the atomic
- *  operations.
+ * \file SDL_atomic.h
+ * 
+ * Atomic operations.
+ * 
+ * IMPORTANT:
+ * If you are not an expert in concurrent lockless programming, you should
+ * only be using the atomic lock and reference counting functions in this
+ * file.  In all other cases you should be protecting your data structures
+ * with full mutexes.
+ * 
+ * The list of "safe" functions to use are:
+ *  SDL_AtomicLock()
+ *  SDL_AtomicUnlock()
+ *  SDL_AtomicIncRef()
+ *  SDL_AtomicDecRef()
+ * 
+ * Seriously, here be dragons!
+ * ^^^^^^^^^^^^^^^^^^^^^^^^^^^
+ *
+ * You can find out a little more about lockless programming and the 
+ * subtle issues that can arise here:
+ * http://msdn.microsoft.com/en-us/library/ee418650%28v=vs.85%29.aspx
+ *
+ * There's also lots of good information here:
+ * http://www.1024cores.net/home/lock-free-algorithms
+ *
+ * These operations may or may not actually be implemented using
+ * processor specific atomic operations. When possible they are
+ * implemented as true processor specific atomic operations. When that
+ * is not possible the are implemented using locks that *do* use the
+ * available atomic operations.
+ *
+ * All of the atomic operations that modify memory are full memory barriers.
  */
  */
 
 
 #ifndef _SDL_atomic_h_
 #ifndef _SDL_atomic_h_
@@ -46,6 +64,13 @@
 
 
 #include "begin_code.h"
 #include "begin_code.h"
 
 
+/* Need to do this here because intrin.h has C++ code in it */
+/* Visual Studio 2005 has a bug where intrin.h conflicts with winnt.h */
+#if defined(_MSC_VER) && (_MSC_VER >= 1500) && !defined(_WIN32_WCE)
+#include <intrin.h>
+#define HAVE_MSC_ATOMICS 1
+#endif
+
 /* Set up for C function definitions, even when using C++ */
 /* Set up for C function definitions, even when using C++ */
 #ifdef __cplusplus
 #ifdef __cplusplus
 /* *INDENT-OFF* */
 /* *INDENT-OFF* */
@@ -53,154 +78,232 @@ extern "C" {
 /* *INDENT-ON* */
 /* *INDENT-ON* */
 #endif
 #endif
 
 
-/* Function prototypes */
-
 /**
 /**
- *  \name SDL AtomicLock
- *  
- *  The spin lock functions and type are required and can not be
- *  emulated because they are used in the emulation code.
+ * \name SDL AtomicLock
+ * 
+ * The atomic locks are efficient spinlocks using CPU instructions,
+ * but are vulnerable to starvation and can spin forever if a thread
+ * holding a lock has been terminated.  For this reason you should
+ * minimize the code executed inside an atomic lock and never do
+ * expensive things like API or system calls while holding them.
+ *
+ * The atomic locks are not safe to lock recursively.
+ *
+ * Porting Note:
+ * The spin lock functions and type are required and can not be
+ * emulated because they are used in the atomic emulation code.
  */
  */
 /*@{*/
 /*@{*/
 
 
-typedef volatile Uint32 SDL_SpinLock;
+typedef int SDL_SpinLock;
 
 
 /**
 /**
- *  \brief Lock a spin lock by setting it to a none zero value.
- *  
- *  \param lock Points to the lock.
+ * \brief Try to lock a spin lock by setting it to a non-zero value.
+ * 
+ * \param lock Points to the lock.
+ *
+ * \return SDL_TRUE if the lock succeeded, SDL_FALSE if the lock is already held.
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTryLock(SDL_SpinLock *lock);
+
+/**
+ * \brief Lock a spin lock by setting it to a non-zero value.
+ * 
+ * \param lock Points to the lock.
  */
  */
 extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
 extern DECLSPEC void SDLCALL SDL_AtomicLock(SDL_SpinLock *lock);
 
 
 /**
 /**
- *  \brief Unlock a spin lock by setting it to 0. Always returns immediately
+ * \brief Unlock a spin lock by setting it to 0. Always returns immediately
  *
  *
- *  \param lock Points to the lock.
+ * \param lock Points to the lock.
  */
  */
 extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
 extern DECLSPEC void SDLCALL SDL_AtomicUnlock(SDL_SpinLock *lock);
 
 
 /*@}*//*SDL AtomicLock*/
 /*@}*//*SDL AtomicLock*/
 
 
+
 /**
 /**
- *  \name 32 bit atomic operations
+ * The compiler barrier prevents the compiler from reordering
+ * reads and writes to globally visible variables across the call.
  */
  */
-/*@{*/
+#ifdef _MSC_VER
+void _ReadWriteBarrier(void);
+#pragma intrinsic(_ReadWriteBarrier)
+#define SDL_CompilerBarrier()   _ReadWriteBarrier()
+#elif defined(__GNUC__)
+#define SDL_CompilerBarrier()   __asm__ __volatile__ ("" : : : "memory")
+#else
+#define SDL_CompilerBarrier()   \
+({ SDL_SpinLock _tmp = 0; SDL_AtomicLock(&_tmp); SDL_AtomicUnlock(&_tmp); })
+#endif
 
 
-/**
- *  \brief Check to see if \c *ptr == 0 and set it to 1.
- *  
- *  \return SDL_True if the value pointed to by \c ptr was zero and
- *          SDL_False if it was not zero
- *  
- *  \param ptr Points to the value to be tested and set.
+/* Platform specific optimized versions of the atomic functions,
+ * you can disable these by defining SDL_DISABLE_ATOMIC_INLINE
  */
  */
-extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTestThenSet32(volatile Uint32 * ptr);
+#if SDL_ATOMIC_DISABLED
+#define SDL_DISABLE_ATOMIC_INLINE
+#endif
+#ifndef SDL_DISABLE_ATOMIC_INLINE
+
+#ifdef HAVE_MSC_ATOMICS
+
+#define SDL_AtomicSet(a, v)     _InterlockedExchange((long*)&(a)->value, (v))
+#define SDL_AtomicAdd(a, v)     _InterlockedExchangeAdd((long*)&(a)->value, (v))
+#define SDL_AtomicCAS(a, oldval, newval) (_InterlockedCompareExchange((long*)&(a)->value, (newval), (oldval)) == (oldval))
+#define SDL_AtomicSetPtr(a, v)  _InterlockedExchangePointer((a), (v))
+#if _M_IX86
+#define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchange((long*)(a), (long)(newval), (long)(oldval)) == (long)(oldval))
+#else
+#define SDL_AtomicCASPtr(a, oldval, newval) (_InterlockedCompareExchangePointer((a), (newval), (oldval)) == (oldval))
+#endif
+
+#elif defined(__MACOSX__)
+#include <libkern/OSAtomic.h>
+
+#define SDL_AtomicCAS(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((oldval), (newval), &(a)->value)
+#if SIZEOF_VOIDP == 4
+#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap32Barrier((int32_t)(oldval), (int32_t)(newval), (int32_t*)(a))
+#elif SIZEOF_VOIDP == 8
+#define SDL_AtomicCASPtr(a, oldval, newval) OSAtomicCompareAndSwap64Barrier((int64_t)(oldval), (int64_t)(newval), (int64_t*)(a))
+#endif
+
+#elif defined(HAVE_GCC_ATOMICS)
+
+#define SDL_AtomicSet(a, v)     __sync_lock_test_and_set(&(a)->value, v)
+#define SDL_AtomicAdd(a, v)     __sync_fetch_and_add(&(a)->value, v)
+#define SDL_AtomicSetPtr(a, v)  __sync_lock_test_and_set(a, v)
+#define SDL_AtomicCAS(a, oldval, newval) __sync_bool_compare_and_swap(&(a)->value, oldval, newval)
+#define SDL_AtomicCASPtr(a, oldval, newval) __sync_bool_compare_and_swap(a, oldval, newval)
+
+#endif
+
+#endif /* !SDL_DISABLE_ATOMIC_INLINE */
+
 
 
 /**
 /**
- *  \brief Set the value pointed to by \c ptr to be zero.
- *  
- *  \param ptr Address of the value to be set to zero
+ * \brief A type representing an atomic integer value.  It is a struct
+ *        so people don't accidentally use numeric operations on it.
  */
  */
-extern DECLSPEC void SDLCALL SDL_AtomicClear32(volatile Uint32 * ptr);
+#ifndef SDL_atomic_t_defined
+typedef struct { int value; } SDL_atomic_t;
+#endif
 
 
 /**
 /**
- *  \brief Fetch the current value of \c *ptr and then increment that
- *         value in place.
- *  
- *  \return The value before it was incremented.
- *  
- *  \param ptr Address of the value to fetch and increment
- */
-extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenIncrement32(volatile Uint32 * ptr);
+ * \brief Set an atomic variable to a new value if it is currently an old value.
+ *
+ * \return SDL_TRUE if the atomic variable was set, SDL_FALSE otherwise.
+ *
+ * \note If you don't know what this function is for, you shouldn't use it!
+*/
+#ifndef SDL_AtomicCAS
+#define SDL_AtomicCAS SDL_AtomicCAS_
+#endif
+extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCAS_(SDL_atomic_t *a, int oldval, int newval);
 
 
 /**
 /**
- *  \brief Fetch \c *ptr and then decrement the value in place.
- *  
- *  \return The value before it was decremented.
- *  
- *  \param ptr Address of the value to fetch and decrement
+ * \brief Set an atomic variable to a value.
+ *
+ * \return The previous value of the atomic variable.
  */
  */
-extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenDecrement32(volatile Uint32 * ptr);
+#ifndef SDL_AtomicSet
+static __inline__ int SDL_AtomicSet(SDL_atomic_t *a, int v)
+{
+    int value;
+    do {
+        value = a->value;
+    } while (!SDL_AtomicCAS(a, value, v));
+    return value;
+}
+#endif
 
 
 /**
 /**
- *  \brief Fetch the current value at \c ptr and then add \c value to \c *ptr.
- *  
- *  \return \c *ptr before the addition took place.
- *  
- *  \param ptr The address of data we are changing.
- *  \param value The value to add to \c *ptr. 
+ * \brief Get the value of an atomic variable
  */
  */
-extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenAdd32(volatile Uint32 * ptr, Uint32 value);
+#ifndef SDL_AtomicGet
+static __inline__ int SDL_AtomicGet(SDL_atomic_t *a)
+{
+    int value = a->value;
+    SDL_CompilerBarrier();
+    return value;
+}
+#endif
 
 
 /**
 /**
- *  \brief Fetch \c *ptr and then subtract \c value from it.
- *  
- *  \return \c *ptr before the subtraction took place.
- *  
- *  \param ptr The address of the data being changed.
- *  \param value The value to subtract from \c *ptr.
+ * \brief Add to an atomic variable.
+ *
+ * \return The previous value of the atomic variable.
+ *
+ * \note This same style can be used for any number operation
  */
  */
-extern DECLSPEC Uint32 SDLCALL SDL_AtomicFetchThenSubtract32(volatile Uint32 * ptr, Uint32 value);
+#ifndef SDL_AtomicAdd
+static __inline__ int SDL_AtomicAdd(SDL_atomic_t *a, int v)
+{
+    int value;
+    do {
+        value = a->value;
+    } while (!SDL_AtomicCAS(a, value, (value + v)));
+    return value;
+}
+#endif
 
 
 /**
 /**
- *  \brief Add one to the data pointed to by \c ptr and return that value.
- *  
- *  \return The incremented value.
- *  
- *  \param ptr The address of the data to increment.
+ * \brief Increment an atomic variable used as a reference count.
  */
  */
-extern DECLSPEC Uint32 SDLCALL SDL_AtomicIncrementThenFetch32(volatile Uint32 * ptr);
+#ifndef SDL_AtomicIncRef
+#define SDL_AtomicIncRef(a)    SDL_AtomicAdd(a, 1)
+#endif
 
 
 /**
 /**
- *  \brief Subtract one from data pointed to by \c ptr and return the new value.
- *  
- *  \return The decremented value.
- *  
- *  \param ptr The address of the data to decrement.
+ * \brief Decrement an atomic variable used as a reference count.
+ *
+ * \return SDL_TRUE if the variable reached zero after decrementing,
+ *         SDL_FALSE otherwise
  */
  */
-extern DECLSPEC Uint32 SDLCALL SDL_AtomicDecrementThenFetch32(volatile Uint32 * ptr);
+#ifndef SDL_AtomicDecRef
+#define SDL_AtomicDecRef(a)    (SDL_AtomicAdd(a, -1) == 1)
+#endif
 
 
 /**
 /**
- *  \brief Add \c value to the data pointed to by \c ptr and return result.
- *  
- *  \return The sum of \c *ptr and \c value.
- *  
- *  \param ptr The address of the data to be modified.
- *  \param value The value to be added.
- */
-extern DECLSPEC Uint32 SDLCALL SDL_AtomicAddThenFetch32(volatile Uint32 * ptr, Uint32 value);
+ * \brief Set a pointer to a new value if it is currently an old value.
+ *
+ * \return SDL_TRUE if the pointer was set, SDL_FALSE otherwise.
+ *
+ * \note If you don't know what this function is for, you shouldn't use it!
+*/
+#ifndef SDL_AtomicCASPtr
+#define SDL_AtomicCASPtr SDL_AtomicCASPtr_
+#endif
+extern DECLSPEC SDL_bool SDLCALL SDL_AtomicCASPtr_(void* *a, void *oldval, void *newval);
 
 
 /**
 /**
- *  \brief Subtract \c value from the data pointed to by \c ptr and return the result.
- *  
- *  \return The difference between \c *ptr and \c value.
- *  
- *  \param ptr The address of the data to be modified.
- *  \param value The value to be subtracted.
+ * \brief Set a pointer to a value atomically.
+ *
+ * \return The previous value of the pointer.
  */
  */
-extern DECLSPEC Uint32 SDLCALL SDL_AtomicSubtractThenFetch32(volatile Uint32 * ptr, Uint32 value);
-
-/*@}*//*32 bit atomic operations*/
+#ifndef SDL_AtomicSetPtr
+static __inline__ void* SDL_AtomicSetPtr(void* *a, void* v)
+{
+    void* value;
+    do {
+        value = *a;
+    } while (!SDL_AtomicCASPtr(a, value, v));
+    return value;
+}
+#endif
 
 
 /**
 /**
- *  \name 64 bit atomic operations
+ * \brief Get the value of a pointer atomically.
  */
  */
-/*@{*/
-#ifdef SDL_HAS_64BIT_TYPE
-
-extern DECLSPEC SDL_bool SDLCALL SDL_AtomicTestThenSet64(volatile Uint64 * ptr);
-extern DECLSPEC void SDLCALL SDL_AtomicClear64(volatile Uint64 * ptr);
-extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenIncrement64(volatile Uint64 * ptr);
-extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenDecrement64(volatile Uint64 * ptr);
-extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenAdd64(volatile Uint64 * ptr, Uint64 value);
-extern DECLSPEC Uint64 SDLCALL SDL_AtomicFetchThenSubtract64(volatile Uint64 * ptr, Uint64 value);
-extern DECLSPEC Uint64 SDLCALL SDL_AtomicIncrementThenFetch64(volatile Uint64 * ptr);
-extern DECLSPEC Uint64 SDLCALL SDL_AtomicDecrementThenFetch64(volatile Uint64 * ptr);
-extern DECLSPEC Uint64 SDLCALL SDL_AtomicAddThenFetch64(volatile Uint64 * ptr, Uint64 value);
-extern DECLSPEC Uint64 SDLCALL SDL_AtomicSubtractThenFetch64(volatile Uint64 * ptr, Uint64 value);
-#endif /*  SDL_HAS_64BIT_TYPE */
-
-/*@}*//*64 bit atomic operations*/
+#ifndef SDL_AtomicGetPtr
+static __inline__ void* SDL_AtomicGetPtr(void* *a)
+{
+    void* value = *a;
+    SDL_CompilerBarrier();
+    return value;
+}
+#endif
+
 
 
 /* Ends C function definitions when using C++ */
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 #ifdef __cplusplus

+ 1 - 1
extern/include/SDL/SDL_audio.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 61 - 0
extern/include/SDL/SDL_blendmode.h

@@ -0,0 +1,61 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2011 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    [email protected]
+*/
+
+/**
+ *  \file SDL_blendmode.h
+ *  
+ *  Header file declaring the SDL_BlendMode enumeration
+ */
+
+#ifndef _SDL_blendmode_h
+#define _SDL_blendmode_h
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+/**
+ *  \brief The blend mode used in SDL_RenderCopy() and drawing operations.
+ */
+typedef enum
+{
+    SDL_BLENDMODE_NONE = 0x00000000,     /**< No blending */
+    SDL_BLENDMODE_BLEND = 0x00000001,    /**< dst = (src * A) + (dst * (1-A)) */
+    SDL_BLENDMODE_ADD = 0x00000002,      /**< dst = (src * A) + dst */
+    SDL_BLENDMODE_MOD = 0x00000004       /**< dst = src * dst */
+} SDL_BlendMode;
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_video_h */
+
+/* vi: set ts=4 sw=4 expandtab: */

+ 1 - 1
extern/include/SDL/SDL_clipboard.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 31 - 8
extern/include/SDL/SDL_compat.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -64,6 +64,12 @@ extern "C" {
  */
  */
 /*@{*/
 /*@{*/
 
 
+/* Platform */
+#ifdef __WIN32__
+#undef __WIN32__
+#define __WIN32__   1
+#endif
+
 /**
 /**
  *  \name Surface flags
  *  \name Surface flags
  */
  */
@@ -209,6 +215,13 @@ struct SDL_SysWMinfo;
  */
  */
 /*@{*/
 /*@{*/
 
 
+#define SDL_keysym		SDL_Keysym
+#define SDL_KeySym		SDL_Keysym
+#define SDL_scancode	SDL_Scancode
+#define SDL_ScanCode	SDL_Scancode
+#define SDLKey          SDL_Keycode
+#define SDLMod          SDL_Keymod
+
 /** 
 /** 
  *  \name Renamed keys
  *  \name Renamed keys
  *
  *
@@ -264,8 +277,8 @@ struct SDL_SysWMinfo;
 #define SDL_AllocSurface    SDL_CreateRGBSurface
 #define SDL_AllocSurface    SDL_CreateRGBSurface
 
 
 extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version(void);
 extern DECLSPEC const SDL_version *SDLCALL SDL_Linked_Version(void);
-extern DECLSPEC char *SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
-extern DECLSPEC char *SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
+extern DECLSPEC const char *SDLCALL SDL_AudioDriverName(char *namebuf, int maxlen);
+extern DECLSPEC const char *SDLCALL SDL_VideoDriverName(char *namebuf, int maxlen);
 extern DECLSPEC const SDL_VideoInfo *SDLCALL SDL_GetVideoInfo(void);
 extern DECLSPEC const SDL_VideoInfo *SDLCALL SDL_GetVideoInfo(void);
 extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width,
 extern DECLSPEC int SDLCALL SDL_VideoModeOK(int width,
                                             int height,
                                             int height,
@@ -315,17 +328,27 @@ extern DECLSPEC int SDLCALL SDL_DisplayYUVOverlay(SDL_Overlay * overlay,
                                                   SDL_Rect * dstrect);
                                                   SDL_Rect * dstrect);
 extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay);
 extern DECLSPEC void SDLCALL SDL_FreeYUVOverlay(SDL_Overlay * overlay);
 extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
 extern DECLSPEC void SDLCALL SDL_GL_SwapBuffers(void);
+extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
+extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 * red,
+                                             const Uint16 * green,
+                                             const Uint16 * blue);
+extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 * red, Uint16 * green,
+                                             Uint16 * blue);
 extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
 extern DECLSPEC int SDLCALL SDL_EnableKeyRepeat(int delay, int interval);
 extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
 extern DECLSPEC void SDLCALL SDL_GetKeyRepeat(int *delay, int *interval);
 extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
 extern DECLSPEC int SDLCALL SDL_EnableUNICODE(int enable);
 
 
-#define SDL_TextureID SDL_Texture*
-#define SDL_WindowID SDL_Window*
-#define SDL_RenderPoint SDL_RenderDrawPoint
-#define SDL_RenderLine SDL_RenderDrawLine
-#define SDL_RenderFill(X)  (X) ? SDL_RenderFillRect(X) : SDL_RenderClear()
+typedef SDL_Window* SDL_WindowID;
+
 #define SDL_KillThread(X)
 #define SDL_KillThread(X)
 
 
+/* The timeslice and timer resolution are no longer relevant */
+#define SDL_TIMESLICE		10
+#define TIMER_RESOLUTION	10
+
+typedef Uint32 (SDLCALL * SDL_OldTimerCallback) (Uint32 interval);
+extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval, SDL_OldTimerCallback callback);
+
 extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
 extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
 
 
 /*@}*//*Compatibility*/
 /*@}*//*Compatibility*/

+ 12 - 26
extern/include/SDL/SDL_config.h

@@ -1,7 +1,7 @@
 /* include/SDL_config.h.  Generated from SDL_config.h.in by configure.  */
 /* include/SDL_config.h.  Generated from SDL_config.h.in by configure.  */
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2009 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -59,6 +59,8 @@
 
 
 #define SIZEOF_VOIDP 8
 #define SIZEOF_VOIDP 8
 #define SDL_HAS_64BIT_TYPE 1
 #define SDL_HAS_64BIT_TYPE 1
+#define HAVE_GCC_ATOMICS 1
+/* #undef HAVE_GCC_SYNC_LOCK_TEST_AND_SET */
 
 
 /* Comment this if you want to build without any C library requirements */
 /* Comment this if you want to build without any C library requirements */
 #define HAVE_LIBC 1
 #define HAVE_LIBC 1
@@ -81,7 +83,6 @@
 #define HAVE_MATH_H 1
 #define HAVE_MATH_H 1
 #define HAVE_ICONV_H 1
 #define HAVE_ICONV_H 1
 #define HAVE_SIGNAL_H 1
 #define HAVE_SIGNAL_H 1
-/* #undef HAVE_ALTIVEC_H */
 
 
 /* C library functions */
 /* C library functions */
 #define HAVE_MALLOC 1
 #define HAVE_MALLOC 1
@@ -89,7 +90,7 @@
 #define HAVE_REALLOC 1
 #define HAVE_REALLOC 1
 #define HAVE_FREE 1
 #define HAVE_FREE 1
 #define HAVE_ALLOCA 1
 #define HAVE_ALLOCA 1
-#ifndef _WIN32 /* Don't use C runtime versions of these on Windows */
+#ifndef __WIN32__ /* Don't use C runtime versions of these on Windows */
 #define HAVE_GETENV 1
 #define HAVE_GETENV 1
 #define HAVE_SETENV 1
 #define HAVE_SETENV 1
 #define HAVE_PUTENV 1
 #define HAVE_PUTENV 1
@@ -159,6 +160,7 @@
 /* #undef HAVE_CLOCK_GETTIME */
 /* #undef HAVE_CLOCK_GETTIME */
 /* #undef HAVE_GETPAGESIZE */
 /* #undef HAVE_GETPAGESIZE */
 #define HAVE_MPROTECT 1
 #define HAVE_MPROTECT 1
+#define HAVE_ICONV 1
 
 
 #else
 #else
 /* We may need some replacement for stdarg.h here */
 /* We may need some replacement for stdarg.h here */
@@ -169,6 +171,7 @@
 /* #undef SDL_DEFAULT_ASSERT_LEVEL */
 /* #undef SDL_DEFAULT_ASSERT_LEVEL */
 
 
 /* Allow disabling of core subsystems */
 /* Allow disabling of core subsystems */
+/* #undef SDL_ATOMIC_DISABLED */
 /* #undef SDL_AUDIO_DISABLED */
 /* #undef SDL_AUDIO_DISABLED */
 /* #undef SDL_CPUINFO_DISABLED */
 /* #undef SDL_CPUINFO_DISABLED */
 /* #undef SDL_EVENTS_DISABLED */
 /* #undef SDL_EVENTS_DISABLED */
@@ -176,6 +179,7 @@
 /* #undef SDL_JOYSTICK_DISABLED */
 /* #undef SDL_JOYSTICK_DISABLED */
 /* #undef SDL_HAPTIC_DISABLED */
 /* #undef SDL_HAPTIC_DISABLED */
 /* #undef SDL_LOADSO_DISABLED */
 /* #undef SDL_LOADSO_DISABLED */
+/* #undef SDL_RENDER_DISABLED */
 /* #undef SDL_THREADS_DISABLED */
 /* #undef SDL_THREADS_DISABLED */
 /* #undef SDL_TIMERS_DISABLED */
 /* #undef SDL_TIMERS_DISABLED */
 /* #undef SDL_VIDEO_DISABLED */
 /* #undef SDL_VIDEO_DISABLED */
@@ -219,7 +223,6 @@
 /* #undef SDL_JOYSTICK_IOKIT */
 /* #undef SDL_JOYSTICK_IOKIT */
 #define SDL_JOYSTICK_LINUX 1
 #define SDL_JOYSTICK_LINUX 1
 /* #undef SDL_JOYSTICK_NDS */
 /* #undef SDL_JOYSTICK_NDS */
-/* #undef SDL_JOYSTICK_RISCOS */
 /* #undef SDL_JOYSTICK_WINMM */
 /* #undef SDL_JOYSTICK_WINMM */
 /* #undef SDL_JOYSTICK_USBHID */
 /* #undef SDL_JOYSTICK_USBHID */
 /* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
 /* #undef SDL_JOYSTICK_USBHID_MACHINE_JOYSTICK_H */
@@ -234,7 +237,7 @@
 #define SDL_LOADSO_DLOPEN 1
 #define SDL_LOADSO_DLOPEN 1
 /* #undef SDL_LOADSO_DUMMY */
 /* #undef SDL_LOADSO_DUMMY */
 /* #undef SDL_LOADSO_LDG */
 /* #undef SDL_LOADSO_LDG */
-/* #undef SDL_LOADSO_WIN32 */
+/* #undef SDL_LOADSO_WINDOWS */
 
 
 /* Enable various threading systems */
 /* Enable various threading systems */
 /* #undef SDL_THREAD_BEOS */
 /* #undef SDL_THREAD_BEOS */
@@ -243,15 +246,14 @@
 #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
 #define SDL_THREAD_PTHREAD_RECURSIVE_MUTEX 1
 /* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */
 /* #undef SDL_THREAD_PTHREAD_RECURSIVE_MUTEX_NP */
 /* #undef SDL_THREAD_SPROC */
 /* #undef SDL_THREAD_SPROC */
-/* #undef SDL_THREAD_WIN32 */
+/* #undef SDL_THREAD_WINDOWS */
 
 
 /* Enable various timer systems */
 /* Enable various timer systems */
 /* #undef SDL_TIMER_BEOS */
 /* #undef SDL_TIMER_BEOS */
 /* #undef SDL_TIMER_DUMMY */
 /* #undef SDL_TIMER_DUMMY */
 /* #undef SDL_TIMER_NDS */
 /* #undef SDL_TIMER_NDS */
-/* #undef SDL_TIMER_RISCOS */
 #define SDL_TIMER_UNIX 1
 #define SDL_TIMER_UNIX 1
-/* #undef SDL_TIMER_WIN32 */
+/* #undef SDL_TIMER_WINDOWS */
 /* #undef SDL_TIMER_WINCE */
 /* #undef SDL_TIMER_WINCE */
 
 
 /* Enable various video drivers */
 /* Enable various video drivers */
@@ -260,41 +262,26 @@
 /* #undef SDL_VIDEO_DRIVER_DIRECTFB */
 /* #undef SDL_VIDEO_DRIVER_DIRECTFB */
 /* #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC */
 /* #undef SDL_VIDEO_DRIVER_DIRECTFB_DYNAMIC */
 #define SDL_VIDEO_DRIVER_DUMMY 1
 #define SDL_VIDEO_DRIVER_DUMMY 1
-/* #undef SDL_VIDEO_DRIVER_FBCON */
 /* #undef SDL_VIDEO_DRIVER_NDS */
 /* #undef SDL_VIDEO_DRIVER_NDS */
-/* #undef SDL_VIDEO_DRIVER_PHOTON */
-/* #undef SDL_VIDEO_DRIVER_QNXGF */
-/* #undef SDL_VIDEO_DRIVER_PS3 */
-/* #undef SDL_VIDEO_DRIVER_RISCOS */
-/* #undef SDL_VIDEO_DRIVER_SVGALIB */
-/* #undef SDL_VIDEO_DRIVER_WIN32 */
+/* #undef SDL_VIDEO_DRIVER_WINDOWS */
 #define SDL_VIDEO_DRIVER_X11 1
 #define SDL_VIDEO_DRIVER_X11 1
 #define SDL_VIDEO_DRIVER_X11_DYNAMIC "libX11.so.6"
 #define SDL_VIDEO_DRIVER_X11_DYNAMIC "libX11.so.6"
 #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "libXext.so.6"
 #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT "libXext.so.6"
 #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "libXrandr.so.2"
 #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR "libXrandr.so.2"
-#define SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER "libXrender.so.1"
 #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT "libXi.so.6"
 #define SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT "libXi.so.6"
 /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS */
 /* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XSS */
-/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XDAMAGE */
-/* #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XFIXES */
 #define SDL_VIDEO_DRIVER_X11_VIDMODE 1
 #define SDL_VIDEO_DRIVER_X11_VIDMODE 1
 #define SDL_VIDEO_DRIVER_X11_XINERAMA 1
 #define SDL_VIDEO_DRIVER_X11_XINERAMA 1
 #define SDL_VIDEO_DRIVER_X11_XRANDR 1
 #define SDL_VIDEO_DRIVER_X11_XRANDR 1
 #define SDL_VIDEO_DRIVER_X11_XINPUT 1
 #define SDL_VIDEO_DRIVER_X11_XINPUT 1
 /* #undef SDL_VIDEO_DRIVER_X11_SCRNSAVER */
 /* #undef SDL_VIDEO_DRIVER_X11_SCRNSAVER */
 #define SDL_VIDEO_DRIVER_X11_XV 1
 #define SDL_VIDEO_DRIVER_X11_XV 1
-#define SDL_VIDEO_DRIVER_X11_XRENDER 1
-/* #undef SDL_VIDEO_DRIVER_X11_XDAMAGE */
-/* #undef SDL_VIDEO_DRIVER_X11_XFIXES */
 #define SDL_VIDEO_DRIVER_X11_XSHAPE 1
 #define SDL_VIDEO_DRIVER_X11_XSHAPE 1
 
 
 /* #undef SDL_VIDEO_RENDER_D3D */
 /* #undef SDL_VIDEO_RENDER_D3D */
-/* #undef SDL_VIDEO_RENDER_GDI */
 #define SDL_VIDEO_RENDER_OGL 1
 #define SDL_VIDEO_RENDER_OGL 1
 /* #undef SDL_VIDEO_RENDER_OGL_ES */
 /* #undef SDL_VIDEO_RENDER_OGL_ES */
-#define SDL_VIDEO_RENDER_X11 1
-/* #undef SDL_VIDEO_RENDER_GAPI */
-/* #undef SDL_VIDEO_RENDER_DDRAW */
+/* #undef SDL_VIDEO_RENDER_DIRECTFB */
 
 
 /* Enable OpenGL support */
 /* Enable OpenGL support */
 #define SDL_VIDEO_OPENGL 1
 #define SDL_VIDEO_OPENGL 1
@@ -316,6 +303,5 @@
 
 
 /* Enable assembly routines */
 /* Enable assembly routines */
 #define SDL_ASSEMBLY_ROUTINES 1
 #define SDL_ASSEMBLY_ROUTINES 1
-/* #undef SDL_ALTIVEC_BLITTERS */
 
 
 #endif /* _SDL_config_h */
 #endif /* _SDL_config_h */

+ 26 - 15
extern/include/SDL/SDL_cpuinfo.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -39,11 +39,26 @@ extern "C" {
 /* *INDENT-ON* */
 /* *INDENT-ON* */
 #endif
 #endif
 
 
+/* This is a guess for the cacheline size used for padding.
+ * Most x86 processors have a 64 byte cache line.
+ * The 64-bit PowerPC processors have a 128 byte cache line.
+ * We'll use the larger value to be generally safe.
+ */
+#define SDL_CACHELINE_SIZE  128
+
 /**
 /**
  *  This function returns the number of CPU cores available.
  *  This function returns the number of CPU cores available.
  */
  */
 extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
 extern DECLSPEC int SDLCALL SDL_GetCPUCount(void);
 
 
+/**
+ *  This function returns the L1 cache line size of the CPU
+ *
+ *  This is useful for determining multi-threaded structure padding
+ *  or SIMD prefetch sizes.
+ */
+extern DECLSPEC int SDLCALL SDL_GetCPUCacheLineSize(void);
+
 /**
 /**
  *  This function returns true if the CPU has the RDTSC instruction.
  *  This function returns true if the CPU has the RDTSC instruction.
  */
  */
@@ -55,34 +70,30 @@ extern DECLSPEC SDL_bool SDLCALL SDL_HasRDTSC(void);
 extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
 extern DECLSPEC SDL_bool SDLCALL SDL_HasMMX(void);
 
 
 /**
 /**
- *  This function returns true if the CPU has MMX Ext.\ features.
+ *  This function returns true if the CPU has SSE features.
  */
  */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasMMXExt(void);
+extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
 
 
 /**
 /**
- *  This function returns true if the CPU has 3DNow!\ features.
+ *  This function returns true if the CPU has SSE2 features.
  */
  */
-extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNow(void);
+extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
 
 
 /**
 /**
- *  This function returns true if the CPU has 3DNow!\ Ext.\ features.
+ *  This function returns true if the CPU has SSE3 features.
  */
  */
-extern DECLSPEC SDL_bool SDLCALL SDL_Has3DNowExt(void);
+extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE3(void);
 
 
 /**
 /**
- *  This function returns true if the CPU has SSE features.
+ *  This function returns true if the CPU has SSE4.1 features.
  */
  */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE(void);
+extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE41(void);
 
 
 /**
 /**
- *  This function returns true if the CPU has SSE2 features.
+ *  This function returns true if the CPU has SSE4.2 features.
  */
  */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE2(void);
+extern DECLSPEC SDL_bool SDLCALL SDL_HasSSE42(void);
 
 
-/**
- *  This function returns true if the CPU has AltiVec features.
- */
-extern DECLSPEC SDL_bool SDLCALL SDL_HasAltiVec(void);
 
 
 /* Ends C function definitions when using C++ */
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 #ifdef __cplusplus

+ 1 - 1
extern/include/SDL/SDL_endian.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 2 - 2
extern/include/SDL/SDL_error.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -48,7 +48,7 @@ extern DECLSPEC void SDLCALL SDL_ClearError(void);
  *  \name Internal error functions
  *  \name Internal error functions
  *  
  *  
  *  \internal 
  *  \internal 
- *  Private error message function - used internally.
+ *  Private error reporting function - used internally.
  */
  */
 /*@{*/
 /*@{*/
 #define SDL_OutOfMemory()	SDL_Error(SDL_ENOMEM)
 #define SDL_OutOfMemory()	SDL_Error(SDL_ENOMEM)

+ 22 - 10
extern/include/SDL/SDL_events.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -66,8 +66,8 @@ typedef enum
     SDL_SYSWMEVENT,             /**< System specific event */
     SDL_SYSWMEVENT,             /**< System specific event */
 
 
     /* Keyboard events */
     /* Keyboard events */
-    SDL_KEYDOWN        = 0x300, /**< Keys pressed */
-    SDL_KEYUP,                  /**< Keys released */
+    SDL_KEYDOWN        = 0x300, /**< Key pressed */
+    SDL_KEYUP,                  /**< Key released */
     SDL_TEXTEDITING,            /**< Keyboard text editing (composition) */
     SDL_TEXTEDITING,            /**< Keyboard text editing (composition) */
     SDL_TEXTINPUT,              /**< Keyboard text input */
     SDL_TEXTINPUT,              /**< Keyboard text input */
 
 
@@ -151,7 +151,7 @@ typedef struct SDL_KeyboardEvent
     Uint8 repeat;       /**< Non-zero if this is a key repeat */
     Uint8 repeat;       /**< Non-zero if this is a key repeat */
     Uint8 padding2;
     Uint8 padding2;
     Uint8 padding3;
     Uint8 padding3;
-    SDL_keysym keysym;  /**< The key that was pressed or released */
+    SDL_Keysym keysym;  /**< The key that was pressed or released */
 } SDL_KeyboardEvent;
 } SDL_KeyboardEvent;
 
 
 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
 #define SDL_TEXTEDITINGEVENT_TEXT_SIZE (32)
@@ -317,9 +317,8 @@ typedef struct SDL_TouchButtonEvent
 } SDL_TouchButtonEvent;
 } SDL_TouchButtonEvent;
 
 
 
 
-
 /**
 /**
- *  \brief Multiple Finger Gesture Event
+ *  \brief Multiple Finger Gesture Event (event.mgesture.*)
  */
  */
 typedef struct SDL_MultiGestureEvent
 typedef struct SDL_MultiGestureEvent
 {
 {
@@ -334,6 +333,7 @@ typedef struct SDL_MultiGestureEvent
     Uint16 padding;
     Uint16 padding;
 } SDL_MultiGestureEvent;
 } SDL_MultiGestureEvent;
 
 
+/* (event.dgesture.*) */
 typedef struct SDL_DollarGestureEvent
 typedef struct SDL_DollarGestureEvent
 {
 {
     Uint32 type;        /**< ::SDL_DOLLARGESTURE */
     Uint32 type;        /**< ::SDL_DOLLARGESTURE */
@@ -350,8 +350,6 @@ typedef struct SDL_DollarGestureEvent
 } SDL_DollarGestureEvent;
 } SDL_DollarGestureEvent;
 
 
 
 
-
-
 /**
 /**
  *  \brief The "quit requested" event
  *  \brief The "quit requested" event
  */
  */
@@ -360,6 +358,7 @@ typedef struct SDL_QuitEvent
     Uint32 type;        /**< ::SDL_QUIT */
     Uint32 type;        /**< ::SDL_QUIT */
 } SDL_QuitEvent;
 } SDL_QuitEvent;
 
 
+
 /**
 /**
  *  \brief A user-defined event type (event.user.*)
  *  \brief A user-defined event type (event.user.*)
  */
  */
@@ -372,6 +371,7 @@ typedef struct SDL_UserEvent
     void *data2;        /**< User defined data pointer */
     void *data2;        /**< User defined data pointer */
 } SDL_UserEvent;
 } SDL_UserEvent;
 
 
+
 struct SDL_SysWMmsg;
 struct SDL_SysWMmsg;
 typedef struct SDL_SysWMmsg SDL_SysWMmsg;
 typedef struct SDL_SysWMmsg SDL_SysWMmsg;
 
 
@@ -436,8 +436,8 @@ typedef union SDL_Event
     SDL_SysWMEvent syswm;           /**< System dependent window event data */
     SDL_SysWMEvent syswm;           /**< System dependent window event data */
     SDL_TouchFingerEvent tfinger;   /**< Touch finger event data */
     SDL_TouchFingerEvent tfinger;   /**< Touch finger event data */
     SDL_TouchButtonEvent tbutton;   /**< Touch button event data */
     SDL_TouchButtonEvent tbutton;   /**< Touch button event data */
-    SDL_MultiGestureEvent mgesture; /**< Multi Finger Gesture data*/
-    SDL_DollarGestureEvent dgesture; /**< Multi Finger Gesture data*/
+    SDL_MultiGestureEvent mgesture; /**< Multi Finger Gesture data */
+    SDL_DollarGestureEvent dgesture; /**< Multi Finger Gesture data */
 
 
     /** Temporarily here for backwards compatibility */
     /** Temporarily here for backwards compatibility */
     /*@{*/
     /*@{*/
@@ -580,6 +580,18 @@ extern DECLSPEC void SDLCALL SDL_SetEventFilter(SDL_EventFilter filter,
 extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
 extern DECLSPEC SDL_bool SDLCALL SDL_GetEventFilter(SDL_EventFilter * filter,
                                                     void **userdata);
                                                     void **userdata);
 
 
+/**
+ *  Add a function which is called when an event is added to the queue.
+ */
+extern DECLSPEC void SDLCALL SDL_AddEventWatch(SDL_EventFilter filter,
+                                               void *userdata);
+
+/**
+ *  Remove an event watch function added with SDL_AddEventWatch()
+ */
+extern DECLSPEC void SDLCALL SDL_DelEventWatch(SDL_EventFilter filter,
+                                               void *userdata);
+
 /**
 /**
  *  Run the filter function on the current event queue, removing any
  *  Run the filter function on the current event queue, removing any
  *  events for which the filter returns 0.
  *  events for which the filter returns 0.

+ 1 - 1
extern/include/SDL/SDL_gesture.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 4 - 0
extern/include/SDL/SDL_haptic.h

@@ -81,6 +81,10 @@
  *    return 0; // Success
  *    return 0; // Success
  * }
  * }
  * \endcode
  * \endcode
+ *
+ * You can also find out more information on my blog:
+ * http://bobbens.dyndns.org/journal/2010/sdl_haptic/
+ *
  * \author Edgar Simo Serra
  * \author Edgar Simo Serra
  */
  */
 
 

+ 170 - 0
extern/include/SDL/SDL_hints.h

@@ -0,0 +1,170 @@
+/*
+    SDL - Simple DihintsMedia Layer
+    Copyright (C) 1997-2011 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    [email protected]
+*/
+
+/**
+ *  \file SDL_hints.h
+ *  
+ *  Official documentation for SDL configuration variables
+ *
+ *  This file contains functions to set and get configuration hints,
+ *  as well as listing each of them alphabetically.
+ *
+ *  The convention for naming hints is SDL_HINT_X, where "SDL_X" is
+ *  the environment variable that can be used to override the default.
+ *
+ *  In general these hints are just that - they may or may not be
+ *  supported or applicable on any given platform, but they provide
+ *  a way for an application or user to give the library a hint as
+ *  to how they would like the library to work.
+ */
+
+#ifndef _SDL_hints_h
+#define _SDL_hints_h
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+/**
+ *  \brief  A variable controlling how 3D acceleration is used to accelerate the SDL 1.2 screen surface. 
+ *
+ *  SDL can try to accelerate the SDL 1.2 screen surface by using streaming
+ *  textures with a 3D rendering engine.  This variable controls whether and
+ *  how this is done.
+ *
+ *  This variable can be set to the following values:
+ *    "0"       - Disable 3D acceleration
+ *    "1"       - Enable 3D acceleration, using the default renderer.
+ *    "X"       - Enable 3D acceleration, using X where X is one of the valid rendering drivers.  (e.g. "direct3d", "opengl", etc.)
+ *
+ *  By default SDL tries to make a best guess for each platform whether
+ *  to use acceleration or not.
+ */
+#define SDL_HINT_FRAMEBUFFER_ACCELERATION   "SDL_FRAMEBUFFER_ACCELERATION"
+
+/**
+ *  \brief  A variable specifying which render driver to use.
+ *
+ *  If the application doesn't pick a specific renderer to use, this variable
+ *  specifies the name of the preferred renderer.  If the preferred renderer
+ *  can't be initialized, the normal default renderer is used.
+ *
+ *  This variable is case insensitive and can be set to the following values:
+ *    "direct3d"
+ *    "opengl"
+ *    "opengles2"
+ *    "opengles"
+ *    "software"
+ *
+ *  The default varies by platform, but it's the first one in the list that
+ *  is available on the current platform.
+ */
+#define SDL_HINT_RENDER_DRIVER              "SDL_RENDER_DRIVER"
+
+/**
+ *  \brief  A variable controlling whether the OpenGL render driver uses shaders if they are available.
+ *
+ *  This variable can be set to the following values:
+ *    "0"       - Disable shaders
+ *    "1"       - Enable shaders
+ *
+ *  By default shaders are used if OpenGL supports them.
+ */
+#define SDL_HINT_RENDER_OPENGL_SHADERS      "SDL_RENDER_OPENGL_SHADERS"
+
+/**
+ *  \brief  A variable controlling whether updates to the SDL 1.2 screen surface should be synchronized with the vertical refresh, to avoid tearing.
+ *
+ *  This variable can be set to the following values:
+ *    "0"       - Disable vsync
+ *    "1"       - Enable vsync
+ *
+ *  By default SDL does not sync screen surface updates with vertical refresh.
+ */
+#define SDL_HINT_RENDER_VSYNC               "SDL_RENDER_VSYNC"
+
+
+/**
+ *  \brief  An enumeration of hint priorities
+ */
+typedef enum
+{
+    SDL_HINT_DEFAULT,
+    SDL_HINT_NORMAL,
+    SDL_HINT_OVERRIDE
+} SDL_HintPriority;
+
+
+/**
+ *  \brief Set a hint with a specific priority
+ *
+ *  The priority controls the behavior when setting a hint that already
+ *  has a value.  Hints will replace existing hints of their priority and
+ *  lower.  Environment variables are considered to have override priority.
+ * 
+ *  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_SetHintWithPriority(const char *name,
+                                                         const char *value,
+                                                         SDL_HintPriority priority);
+
+/**
+ *  \brief Set a hint with normal priority
+ * 
+ *  \return SDL_TRUE if the hint was set, SDL_FALSE otherwise
+ */
+extern DECLSPEC SDL_bool SDLCALL SDL_SetHint(const char *name,
+                                             const char *value);
+
+
+/**
+ *  \brief Get a hint
+ *  
+ *  \return The string value of a hint variable.
+ */
+extern DECLSPEC const char * SDLCALL SDL_GetHint(const char *name);
+
+/**
+ *  \brief  Clear all hints
+ *
+ *  This function is called during SDL_Quit() to free stored hints.
+ */
+extern DECLSPEC void SDLCALL SDL_ClearHints(void);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_hints_h */
+
+/* vi: set ts=4 sw=4 expandtab: */

+ 1 - 1
extern/include/SDL/SDL_input.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 1 - 1
extern/include/SDL/SDL_joystick.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 16 - 16
extern/include/SDL/SDL_keyboard.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -45,13 +45,13 @@ extern "C" {
 /**
 /**
  *  \brief The SDL keysym structure, used in key events.
  *  \brief The SDL keysym structure, used in key events.
  */
  */
-typedef struct SDL_keysym
+typedef struct SDL_Keysym
 {
 {
-    SDL_scancode scancode;      /**< SDL physical key code - see ::SDL_scancode for details */
-    SDLKey sym;                 /**< SDL virtual key code - see ::SDLKey for details */
+    SDL_Scancode scancode;      /**< SDL physical key code - see ::SDL_Scancode for details */
+    SDL_Keycode sym;            /**< SDL virtual key code - see ::SDL_Keycode for details */
     Uint16 mod;                 /**< current key modifiers */
     Uint16 mod;                 /**< current key modifiers */
     Uint32 unicode;             /**< \deprecated use SDL_TextInputEvent instead */
     Uint32 unicode;             /**< \deprecated use SDL_TextInputEvent instead */
-} SDL_keysym;
+} SDL_Keysym;
 
 
 /* Function prototypes */
 /* Function prototypes */
 
 
@@ -65,7 +65,7 @@ extern DECLSPEC SDL_Window * SDLCALL SDL_GetKeyboardFocus(void);
  *  
  *  
  *  \param numkeys if non-NULL, receives the length of the returned array.
  *  \param numkeys if non-NULL, receives the length of the returned array.
  *  
  *  
- *  \return An array of key states. Indexes into this array are obtained by using ::SDL_scancode values.
+ *  \return An array of key states. Indexes into this array are obtained by using ::SDL_Scancode values.
  *  
  *  
  *  \b Example:
  *  \b Example:
  *  \code
  *  \code
@@ -80,34 +80,34 @@ extern DECLSPEC Uint8 *SDLCALL SDL_GetKeyboardState(int *numkeys);
 /**
 /**
  *  \brief Get the current key modifier state for the keyboard.
  *  \brief Get the current key modifier state for the keyboard.
  */
  */
-extern DECLSPEC SDLMod SDLCALL SDL_GetModState(void);
+extern DECLSPEC SDL_Keymod SDLCALL SDL_GetModState(void);
 
 
 /**
 /**
  *  \brief Set the current key modifier state for the keyboard.
  *  \brief Set the current key modifier state for the keyboard.
  *  
  *  
  *  \note This does not change the keyboard state, only the key modifier flags.
  *  \note This does not change the keyboard state, only the key modifier flags.
  */
  */
-extern DECLSPEC void SDLCALL SDL_SetModState(SDLMod modstate);
+extern DECLSPEC void SDLCALL SDL_SetModState(SDL_Keymod modstate);
 
 
 /**
 /**
  *  \brief Get the key code corresponding to the given scancode according
  *  \brief Get the key code corresponding to the given scancode according
  *         to the current keyboard layout.
  *         to the current keyboard layout.
  *  
  *  
- *  See ::SDLKey for details.
+ *  See ::SDL_Keycode for details.
  *  
  *  
  *  \sa SDL_GetKeyName()
  *  \sa SDL_GetKeyName()
  */
  */
-extern DECLSPEC SDLKey SDLCALL SDL_GetKeyFromScancode(SDL_scancode scancode);
+extern DECLSPEC SDL_Keycode SDLCALL SDL_GetKeyFromScancode(SDL_Scancode scancode);
 
 
 /**
 /**
  *  \brief Get the scancode corresponding to the given key code according to the
  *  \brief Get the scancode corresponding to the given key code according to the
  *         current keyboard layout.
  *         current keyboard layout.
  *  
  *  
- *  See ::SDL_scancode for details.
+ *  See ::SDL_Scancode for details.
  *  
  *  
  *  \sa SDL_GetScancodeName()
  *  \sa SDL_GetScancodeName()
  */
  */
-extern DECLSPEC SDL_scancode SDLCALL SDL_GetScancodeFromKey(SDLKey key);
+extern DECLSPEC SDL_Scancode SDLCALL SDL_GetScancodeFromKey(SDL_Keycode key);
 
 
 /**
 /**
  *  \brief Get a human-readable name for a scancode.
  *  \brief Get a human-readable name for a scancode.
@@ -117,9 +117,9 @@ extern DECLSPEC SDL_scancode SDLCALL SDL_GetScancodeFromKey(SDLKey key);
  *          copy it.  If the scancode doesn't have a name, this function returns
  *          copy it.  If the scancode doesn't have a name, this function returns
  *          an empty string ("").
  *          an empty string ("").
  *
  *
- *  \sa SDL_scancode
+ *  \sa SDL_Scancode
  */
  */
-extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_scancode
+extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_Scancode
                                                         scancode);
                                                         scancode);
 
 
 /**
 /**
@@ -130,9 +130,9 @@ extern DECLSPEC const char *SDLCALL SDL_GetScancodeName(SDL_scancode
  *          copy it.  If the key doesn't have a name, this function returns an 
  *          copy it.  If the key doesn't have a name, this function returns an 
  *          empty string ("").
  *          empty string ("").
  *  
  *  
- *  \sa SDLKey
+ *  \sa SDL_Key
  */
  */
-extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDLKey key);
+extern DECLSPEC const char *SDLCALL SDL_GetKeyName(SDL_Keycode key);
 
 
 /**
 /**
  *  \brief Start accepting Unicode text input events.
  *  \brief Start accepting Unicode text input events.

+ 3 - 3
extern/include/SDL/SDL_keysym.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -40,7 +40,7 @@
  *  the unmodified character that would be generated by pressing the key, or
  *  the unmodified character that would be generated by pressing the key, or
  *  an SDLK_* constant for those keys that do not generate characters.
  *  an SDLK_* constant for those keys that do not generate characters.
  */
  */
-typedef Sint32 SDLKey;
+typedef Sint32 SDL_Keycode;
 
 
 #define SDLK_SCANCODE_MASK (1<<30)
 #define SDLK_SCANCODE_MASK (1<<30)
 #define SDL_SCANCODE_TO_KEYCODE(X)	(X | SDLK_SCANCODE_MASK)
 #define SDL_SCANCODE_TO_KEYCODE(X)	(X | SDLK_SCANCODE_MASK)
@@ -330,7 +330,7 @@ typedef enum
     KMOD_CAPS = 0x2000,
     KMOD_CAPS = 0x2000,
     KMOD_MODE = 0x4000,
     KMOD_MODE = 0x4000,
     KMOD_RESERVED = 0x8000
     KMOD_RESERVED = 0x8000
-} SDLMod;
+} SDL_Keymod;
 
 
 #define KMOD_CTRL	(KMOD_LCTRL|KMOD_RCTRL)
 #define KMOD_CTRL	(KMOD_LCTRL|KMOD_RCTRL)
 #define KMOD_SHIFT	(KMOD_LSHIFT|KMOD_RSHIFT)
 #define KMOD_SHIFT	(KMOD_LSHIFT|KMOD_RSHIFT)

+ 1 - 1
extern/include/SDL/SDL_loadso.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 207 - 0
extern/include/SDL/SDL_log.h

@@ -0,0 +1,207 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2011 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    [email protected]
+*/
+
+/**
+ *  \file SDL_log.h
+ *  
+ *  Simple log messages with categories and priorities.
+ *
+ *  By default logs are quiet, but if you're debugging SDL you might want:
+ *
+ *      SDL_LogSetAllPriority(SDL_LOG_PRIORITY_WARN);
+ *
+ *  Here's where the messages go on different platforms:
+ *      Windows: debug output stream
+ *      Android: log output
+ *      Others: standard error output (stderr)
+ */
+
+#ifndef _SDL_log_h
+#define _SDL_log_h
+
+#include "SDL_stdinc.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+
+/**
+ *  \brief The maximum size of a log message
+ *
+ *  Messages longer than the maximum size will be truncated
+ */
+#define SDL_MAX_LOG_MESSAGE 4096
+
+/**
+ *  \brief The predefined log categories
+ *
+ *  By default the application category is enabled at the INFO level,
+ *  and all other categories are enabled at the CRITICAL level.
+ */
+enum
+{
+    SDL_LOG_CATEGORY_APPLICATION,
+    SDL_LOG_CATEGORY_ERROR,
+    SDL_LOG_CATEGORY_SYSTEM,
+    SDL_LOG_CATEGORY_AUDIO,
+    SDL_LOG_CATEGORY_VIDEO,
+    SDL_LOG_CATEGORY_RENDER,
+    SDL_LOG_CATEGORY_INPUT,
+
+    /* Reserved for future SDL library use */
+    SDL_LOG_CATEGORY_RESERVED1,
+    SDL_LOG_CATEGORY_RESERVED2,
+    SDL_LOG_CATEGORY_RESERVED3,
+    SDL_LOG_CATEGORY_RESERVED4,
+    SDL_LOG_CATEGORY_RESERVED5,
+    SDL_LOG_CATEGORY_RESERVED6,
+    SDL_LOG_CATEGORY_RESERVED7,
+    SDL_LOG_CATEGORY_RESERVED8,
+    SDL_LOG_CATEGORY_RESERVED9,
+    SDL_LOG_CATEGORY_RESERVED10,
+
+    /* Beyond this point is reserved for application use, e.g.
+       enum {
+           MYAPP_CATEGORY_AWESOME1 = SDL_LOG_CATEGORY_CUSTOM,
+           MYAPP_CATEGORY_AWESOME2,
+           MYAPP_CATEGORY_AWESOME3,
+           ...
+       };
+     */
+    SDL_LOG_CATEGORY_CUSTOM
+};
+
+/**
+ *  \brief The predefined log priorities
+ */
+typedef enum
+{
+    SDL_LOG_PRIORITY_VERBOSE = 1,
+    SDL_LOG_PRIORITY_DEBUG,
+    SDL_LOG_PRIORITY_INFO,
+    SDL_LOG_PRIORITY_WARN,
+    SDL_LOG_PRIORITY_ERROR,
+    SDL_LOG_PRIORITY_CRITICAL,
+    SDL_NUM_LOG_PRIORITIES
+} SDL_LogPriority;
+
+
+/**
+ *  \brief Set the priority of all log categories
+ */
+extern DECLSPEC void SDLCALL SDL_LogSetAllPriority(SDL_LogPriority priority);
+
+/**
+ *  \brief Set the priority of a particular log category
+ */
+extern DECLSPEC void SDLCALL SDL_LogSetPriority(int category,
+                                                SDL_LogPriority priority);
+
+/**
+ *  \brief Set the priority of a particular log category
+ */
+extern DECLSPEC SDL_LogPriority SDLCALL SDL_LogGetPriority(int category);
+
+/**
+ *  \brief Reset all priorities to default.
+ *
+ *  \note This is called in SDL_Quit().
+ */
+extern DECLSPEC void SDLCALL SDL_LogResetPriorities(void);
+
+/**
+ *  \brief Log a message with SDL_LOG_CATEGORY_APPLICATION and SDL_LOG_PRIORITY_INFO
+ */
+extern DECLSPEC void SDLCALL SDL_Log(const char *fmt, ...);
+
+/**
+ *  \brief Log a message with SDL_LOG_PRIORITY_VERBOSE
+ */
+extern DECLSPEC void SDLCALL SDL_LogVerbose(int category, const char *fmt, ...);
+
+/**
+ *  \brief Log a message with SDL_LOG_PRIORITY_INFO
+ */
+extern DECLSPEC void SDLCALL SDL_LogInfo(int category, const char *fmt, ...);
+
+/**
+ *  \brief Log a message with SDL_LOG_PRIORITY_WARN
+ */
+extern DECLSPEC void SDLCALL SDL_LogWarn(int category, const char *fmt, ...);
+
+/**
+ *  \brief Log a message with SDL_LOG_PRIORITY_ERROR
+ */
+extern DECLSPEC void SDLCALL SDL_LogError(int category, const char *fmt, ...);
+
+/**
+ *  \brief Log a message with SDL_LOG_PRIORITY_CRITICAL
+ */
+extern DECLSPEC void SDLCALL SDL_LogCritical(int category, const char *fmt, ...);
+
+/**
+ *  \brief Log a message with the specified category and priority.
+ */
+extern DECLSPEC void SDLCALL SDL_LogMessage(int category,
+                                            SDL_LogPriority priority,
+                                            const char *fmt, ...);
+
+/**
+ *  \brief Log a message with the specified category and priority.
+ */
+extern DECLSPEC void SDLCALL SDL_LogMessageV(int category,
+                                             SDL_LogPriority priority,
+                                             const char *fmt, va_list ap);
+
+/**
+ *  \brief The prototype for the log output function
+ */
+typedef void (*SDL_LogOutputFunction)(void *userdata, int category, SDL_LogPriority priority, const char *message);
+
+/**
+ *  \brief Get the current log output function.
+ */
+extern DECLSPEC void SDLCALL SDL_LogGetOutputFunction(SDL_LogOutputFunction *callback, void **userdata);
+
+/**
+ *  \brief This function allows you to replace the default log output
+ *         function with one of your own.
+ */
+extern DECLSPEC void SDLCALL SDL_LogSetOutputFunction(SDL_LogOutputFunction callback, void *userdata);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_log_h */
+
+/* vi: set ts=4 sw=4 expandtab: */

+ 3 - 2
extern/include/SDL/SDL_main.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -33,7 +33,8 @@
 
 
 #if defined(__WIN32__) || \
 #if defined(__WIN32__) || \
     (defined(__MWERKS__) && !defined(__BEOS__)) || \
     (defined(__MWERKS__) && !defined(__BEOS__)) || \
-    defined(__SYMBIAN32__) || defined(__IPHONEOS__)
+    defined(__SYMBIAN32__) || defined(__IPHONEOS__) || \
+    defined(__ANDROID__)
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus
 #define C_LINKAGE	"C"
 #define C_LINKAGE	"C"

+ 1 - 1
extern/include/SDL/SDL_mouse.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 27 - 1
extern/include/SDL/SDL_mutex.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -164,6 +164,31 @@ typedef struct SDL_cond SDL_cond;
 
 
 /**
 /**
  *  Create a condition variable.
  *  Create a condition variable.
+ *
+ *  Typical use of condition variables:
+ *
+ *  Thread A:
+ *    SDL_LockMutex(lock);
+ *    while ( ! condition ) {
+ *        SDL_CondWait(cond, lock);
+ *    }
+ *    SDL_UnlockMutex(lock);
+ *
+ *  Thread B:
+ *    SDL_LockMutex(lock);
+ *    ...
+ *    condition = true;
+ *    ...
+ *    SDL_CondSignal(cond);
+ *    SDL_UnlockMutex(lock);
+ *
+ *  There is some discussion whether to signal the condition variable
+ *  with the mutex locked or not.  There is some potential performance
+ *  benefit to unlocking first on some platforms, but there are some
+ *  potential race conditions depending on how your code is structured.
+ *
+ *  In general it's safer to signal the condition variable while the
+ *  mutex is locked.
  */
  */
 extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void);
 extern DECLSPEC SDL_cond *SDLCALL SDL_CreateCond(void);
 
 
@@ -181,6 +206,7 @@ extern DECLSPEC int SDLCALL SDL_CondSignal(SDL_cond * cond);
 
 
 /**
 /**
  *  Restart all threads that are waiting on the condition variable.
  *  Restart all threads that are waiting on the condition variable.
+ *
  *  \return 0 or -1 on error.
  *  \return 0 or -1 on error.
  */
  */
 extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond);
 extern DECLSPEC int SDLCALL SDL_CondBroadcast(SDL_cond * cond);

+ 5 - 3
extern/include/SDL/SDL_opengl.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -38,16 +38,18 @@
 #endif
 #endif
 #include <windows.h>
 #include <windows.h>
 #endif
 #endif
+#ifdef __glext_h_
+/* Someone has already included glext.h */
+#define NO_SDL_GLEXT
+#endif
 #ifndef NO_SDL_GLEXT
 #ifndef NO_SDL_GLEXT
 #define __glext_h_              /* Don't let gl.h include glext.h */
 #define __glext_h_              /* Don't let gl.h include glext.h */
 #endif
 #endif
 #if defined(__MACOSX__)
 #if defined(__MACOSX__)
 #include <OpenGL/gl.h>          /* Header File For The OpenGL Library */
 #include <OpenGL/gl.h>          /* Header File For The OpenGL Library */
-#include <OpenGL/glu.h>         /* Header File For The GLU Library */
 #define __X_GL_H
 #define __X_GL_H
 #else
 #else
 #include <GL/gl.h>              /* Header File For The OpenGL Library */
 #include <GL/gl.h>              /* Header File For The OpenGL Library */
-#include <GL/glu.h>             /* Header File For The GLU Library */
 #endif
 #endif
 #ifndef NO_SDL_GLEXT
 #ifndef NO_SDL_GLEXT
 #undef __glext_h_
 #undef __glext_h_

+ 26 - 1026
extern/include/SDL/SDL_opengles.h

@@ -1,1039 +1,39 @@
 /*
 /*
- SDL - Simple DirectMedia Layer
- Copyright (C) 1997-2010 Sam Lantinga
- 
- This library is free software; you can redistribute it and/or
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- 
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- Lesser General Public License for more details.
- 
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- 
- Sam Lantinga
- [email protected]
- */
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2011 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    [email protected]
+*/
 
 
 /**
 /**
  *  \file SDL_opengles.h
  *  \file SDL_opengles.h
  *  
  *  
- *  This is a simple file to encapsulate the OpenGL ES API headers.
- *  
- *  Headers copied from The Kronos Group website.
- *  	http://www.khronos.org/opengles/
+ *  This is a simple file to encapsulate the OpenGL ES 1.X API headers.
  */
  */
 
 
-#ifndef __gles_h_
-#define __gles_h_
-
-/* $Id: gl.h 4533 2007-11-26 11:19:35Z markc $ */
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
 #ifdef __IPHONEOS__
 #ifdef __IPHONEOS__
-#include <OpenGLES/ES1/gl.h>    /* Header File For The OpenGL ES Library */
+#include <OpenGLES/ES1/gl.h>
+#include <OpenGLES/ES1/glext.h>
+#else
+#include <GLES/gl.h>
+#include <GLES/glext.h>
 #endif
 #endif
 
 
 #ifndef APIENTRY
 #ifndef APIENTRY
 #define APIENTRY
 #define APIENTRY
 #endif
 #endif
-
-#ifndef GL_APIENTRY
-#define GL_APIENTRY
-#endif
-
-#ifndef GL_API
-#define GL_API
-#endif                          /* GL_API */
-
-/*
-** License Applicability. Except to the extent portions of this file are
-** made subject to an alternative license as permitted in the SGI Free
-** Software License B, Version 1.0 (the "License"), the contents of this
-** file are subject only to the provisions of the License. You may not use
-** this file except in compliance with the License. You may obtain a copy
-** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
-** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
-**
-** http://oss.sgi.com/projects/FreeB
-**
-** Note that, as provided in the License, the Software is distributed on an
-** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
-** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
-** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
-** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
-**
-** Original Code. The Original Code is: OpenGL Sample Implementation,
-** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
-** Inc. The Original Code is Copyright (c) 1991-2000 Silicon Graphics, Inc.
-** Copyright in any portions created by third parties is as indicated
-** elsewhere herein. All Rights Reserved.
-**
-** Additional Notice Provisions: The application programming interfaces
-** established by SGI in conjunction with the Original Code are The
-** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
-** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
-** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
-** Window System(R) (Version 1.3), released October 19, 1998. This software
-** was created using the OpenGL(R) version 1.2.1 Sample Implementation
-** published by SGI, but has not been independently verified as being
-** compliant with the OpenGL(R) version 1.2.1 Specification.
-*/
-
-    typedef unsigned int GLenum;
-    typedef unsigned char GLboolean;
-    typedef unsigned int GLbitfield;
-    typedef signed char GLbyte;
-    typedef short GLshort;
-    typedef int GLint;
-    typedef int GLsizei;
-    typedef unsigned char GLubyte;
-    typedef unsigned short GLushort;
-    typedef unsigned int GLuint;
-    typedef float GLfloat;
-    typedef float GLclampf;
-    typedef void GLvoid;
-    typedef int GLfixed;
-    typedef int GLclampx;
-
-    typedef int GLintptr;
-    typedef int GLsizeiptr;
-
-
-/*************************************************************/
-
-/* OpenGL ES core versions */
-#define GL_VERSION_ES_CM_1_0		  1
-#define GL_VERSION_ES_CL_1_0		  1
-#define GL_VERSION_ES_CM_1_1		  1
-#define GL_VERSION_ES_CL_1_1		  1
-
-/* ClearBufferMask */
-#define GL_DEPTH_BUFFER_BIT               0x00000100
-#define GL_STENCIL_BUFFER_BIT             0x00000400
-#define GL_COLOR_BUFFER_BIT               0x00004000
-
-/* Boolean */
-#define GL_FALSE                          0
-#define GL_TRUE                           1
-
-/* BeginMode */
-#define GL_POINTS                         0x0000
-#define GL_LINES                          0x0001
-#define GL_LINE_LOOP                      0x0002
-#define GL_LINE_STRIP                     0x0003
-#define GL_TRIANGLES                      0x0004
-#define GL_TRIANGLE_STRIP                 0x0005
-#define GL_TRIANGLE_FAN                   0x0006
-
-/* AlphaFunction */
-#define GL_NEVER                          0x0200
-#define GL_LESS                           0x0201
-#define GL_EQUAL                          0x0202
-#define GL_LEQUAL                         0x0203
-#define GL_GREATER                        0x0204
-#define GL_NOTEQUAL                       0x0205
-#define GL_GEQUAL                         0x0206
-#define GL_ALWAYS                         0x0207
-
-/* BlendingFactorDest */
-#define GL_ZERO                           0
-#define GL_ONE                            1
-#define GL_SRC_COLOR                      0x0300
-#define GL_ONE_MINUS_SRC_COLOR            0x0301
-#define GL_SRC_ALPHA                      0x0302
-#define GL_ONE_MINUS_SRC_ALPHA            0x0303
-#define GL_DST_ALPHA                      0x0304
-#define GL_ONE_MINUS_DST_ALPHA            0x0305
-
-/* BlendingFactorSrc */
-/*      GL_ZERO */
-/*      GL_ONE */
-#define GL_DST_COLOR                      0x0306
-#define GL_ONE_MINUS_DST_COLOR            0x0307
-#define GL_SRC_ALPHA_SATURATE             0x0308
-/*      GL_SRC_ALPHA */
-/*      GL_ONE_MINUS_SRC_ALPHA */
-/*      GL_DST_ALPHA */
-/*      GL_ONE_MINUS_DST_ALPHA */
-
-/* ClipPlaneName */
-#define GL_CLIP_PLANE0                    0x3000
-#define GL_CLIP_PLANE1                    0x3001
-#define GL_CLIP_PLANE2                    0x3002
-#define GL_CLIP_PLANE3                    0x3003
-#define GL_CLIP_PLANE4                    0x3004
-#define GL_CLIP_PLANE5                    0x3005
-
-/* ColorMaterialFace */
-/*      GL_FRONT_AND_BACK */
-
-/* ColorMaterialParameter */
-/*      GL_AMBIENT_AND_DIFFUSE */
-
-/* ColorPointerType */
-/*      GL_UNSIGNED_BYTE */
-/*      GL_FLOAT */
-/*      GL_FIXED */
-
-/* CullFaceMode */
-#define GL_FRONT                          0x0404
-#define GL_BACK                           0x0405
-#define GL_FRONT_AND_BACK                 0x0408
-
-/* DepthFunction */
-/*      GL_NEVER */
-/*      GL_LESS */
-/*      GL_EQUAL */
-/*      GL_LEQUAL */
-/*      GL_GREATER */
-/*      GL_NOTEQUAL */
-/*      GL_GEQUAL */
-/*      GL_ALWAYS */
-
-/* EnableCap */
-#define GL_FOG                            0x0B60
-#define GL_LIGHTING                       0x0B50
-#define GL_TEXTURE_2D                     0x0DE1
-#define GL_CULL_FACE                      0x0B44
-#define GL_ALPHA_TEST                     0x0BC0
-#define GL_BLEND                          0x0BE2
-#define GL_COLOR_LOGIC_OP                 0x0BF2
-#define GL_DITHER                         0x0BD0
-#define GL_STENCIL_TEST                   0x0B90
-#define GL_DEPTH_TEST                     0x0B71
-/*      GL_LIGHT0 */
-/*      GL_LIGHT1 */
-/*      GL_LIGHT2 */
-/*      GL_LIGHT3 */
-/*      GL_LIGHT4 */
-/*      GL_LIGHT5 */
-/*      GL_LIGHT6 */
-/*      GL_LIGHT7 */
-#define GL_POINT_SMOOTH                   0x0B10
-#define GL_LINE_SMOOTH                    0x0B20
-#define GL_SCISSOR_TEST                   0x0C11
-#define GL_COLOR_MATERIAL                 0x0B57
-#define GL_NORMALIZE                      0x0BA1
-#define GL_RESCALE_NORMAL                 0x803A
-#define GL_POLYGON_OFFSET_FILL            0x8037
-#define GL_VERTEX_ARRAY                   0x8074
-#define GL_NORMAL_ARRAY                   0x8075
-#define GL_COLOR_ARRAY                    0x8076
-#define GL_TEXTURE_COORD_ARRAY            0x8078
-#define GL_MULTISAMPLE                    0x809D
-#define GL_SAMPLE_ALPHA_TO_COVERAGE       0x809E
-#define GL_SAMPLE_ALPHA_TO_ONE            0x809F
-#define GL_SAMPLE_COVERAGE                0x80A0
-
-/* ErrorCode */
-#define GL_NO_ERROR                       0
-#define GL_INVALID_ENUM                   0x0500
-#define GL_INVALID_VALUE                  0x0501
-#define GL_INVALID_OPERATION              0x0502
-#define GL_STACK_OVERFLOW                 0x0503
-#define GL_STACK_UNDERFLOW                0x0504
-#define GL_OUT_OF_MEMORY                  0x0505
-
-/* FogMode */
-/*      GL_LINEAR */
-#define GL_EXP                            0x0800
-#define GL_EXP2                           0x0801
-
-/* FogParameter */
-#define GL_FOG_DENSITY                    0x0B62
-#define GL_FOG_START                      0x0B63
-#define GL_FOG_END                        0x0B64
-#define GL_FOG_MODE                       0x0B65
-#define GL_FOG_COLOR                      0x0B66
-
-/* FrontFaceDirection */
-#define GL_CW                             0x0900
-#define GL_CCW                            0x0901
-
-/* GetPName */
-#define GL_CURRENT_COLOR                  0x0B00
-#define GL_CURRENT_NORMAL                 0x0B02
-#define GL_CURRENT_TEXTURE_COORDS         0x0B03
-#define GL_POINT_SIZE                     0x0B11
-#define GL_POINT_SIZE_MIN                 0x8126
-#define GL_POINT_SIZE_MAX                 0x8127
-#define GL_POINT_FADE_THRESHOLD_SIZE      0x8128
-#define GL_POINT_DISTANCE_ATTENUATION     0x8129
-#define GL_SMOOTH_POINT_SIZE_RANGE        0x0B12
-#define GL_LINE_WIDTH                     0x0B21
-#define GL_SMOOTH_LINE_WIDTH_RANGE        0x0B22
-#define GL_ALIASED_POINT_SIZE_RANGE       0x846D
-#define GL_ALIASED_LINE_WIDTH_RANGE       0x846E
-#define GL_CULL_FACE_MODE                 0x0B45
-#define GL_FRONT_FACE                     0x0B46
-#define GL_SHADE_MODEL                    0x0B54
-#define GL_DEPTH_RANGE                    0x0B70
-#define GL_DEPTH_WRITEMASK                0x0B72
-#define GL_DEPTH_CLEAR_VALUE              0x0B73
-#define GL_DEPTH_FUNC                     0x0B74
-#define GL_STENCIL_CLEAR_VALUE            0x0B91
-#define GL_STENCIL_FUNC                   0x0B92
-#define GL_STENCIL_VALUE_MASK             0x0B93
-#define GL_STENCIL_FAIL                   0x0B94
-#define GL_STENCIL_PASS_DEPTH_FAIL        0x0B95
-#define GL_STENCIL_PASS_DEPTH_PASS        0x0B96
-#define GL_STENCIL_REF                    0x0B97
-#define GL_STENCIL_WRITEMASK              0x0B98
-#define GL_MATRIX_MODE                    0x0BA0
-#define GL_VIEWPORT                       0x0BA2
-#define GL_MODELVIEW_STACK_DEPTH          0x0BA3
-#define GL_PROJECTION_STACK_DEPTH         0x0BA4
-#define GL_TEXTURE_STACK_DEPTH            0x0BA5
-#define GL_MODELVIEW_MATRIX               0x0BA6
-#define GL_PROJECTION_MATRIX              0x0BA7
-#define GL_TEXTURE_MATRIX                 0x0BA8
-#define GL_ALPHA_TEST_FUNC                0x0BC1
-#define GL_ALPHA_TEST_REF                 0x0BC2
-#define GL_BLEND_DST                      0x0BE0
-#define GL_BLEND_SRC                      0x0BE1
-#define GL_LOGIC_OP_MODE                  0x0BF0
-#define GL_SCISSOR_BOX                    0x0C10
-#define GL_SCISSOR_TEST                   0x0C11
-#define GL_COLOR_CLEAR_VALUE              0x0C22
-#define GL_COLOR_WRITEMASK                0x0C23
-#define GL_UNPACK_ALIGNMENT               0x0CF5
-#define GL_PACK_ALIGNMENT                 0x0D05
-#define GL_MAX_LIGHTS                     0x0D31
-#define GL_MAX_CLIP_PLANES                0x0D32
-#define GL_MAX_TEXTURE_SIZE               0x0D33
-#define GL_MAX_MODELVIEW_STACK_DEPTH      0x0D36
-#define GL_MAX_PROJECTION_STACK_DEPTH     0x0D38
-#define GL_MAX_TEXTURE_STACK_DEPTH        0x0D39
-#define GL_MAX_VIEWPORT_DIMS              0x0D3A
-#define GL_MAX_TEXTURE_UNITS              0x84E2
-#define GL_SUBPIXEL_BITS                  0x0D50
-#define GL_RED_BITS                       0x0D52
-#define GL_GREEN_BITS                     0x0D53
-#define GL_BLUE_BITS                      0x0D54
-#define GL_ALPHA_BITS                     0x0D55
-#define GL_DEPTH_BITS                     0x0D56
-#define GL_STENCIL_BITS                   0x0D57
-#define GL_POLYGON_OFFSET_UNITS           0x2A00
-#define GL_POLYGON_OFFSET_FILL            0x8037
-#define GL_POLYGON_OFFSET_FACTOR          0x8038
-#define GL_TEXTURE_BINDING_2D             0x8069
-#define GL_VERTEX_ARRAY_SIZE              0x807A
-#define GL_VERTEX_ARRAY_TYPE              0x807B
-#define GL_VERTEX_ARRAY_STRIDE            0x807C
-#define GL_NORMAL_ARRAY_TYPE              0x807E
-#define GL_NORMAL_ARRAY_STRIDE            0x807F
-#define GL_COLOR_ARRAY_SIZE               0x8081
-#define GL_COLOR_ARRAY_TYPE               0x8082
-#define GL_COLOR_ARRAY_STRIDE             0x8083
-#define GL_TEXTURE_COORD_ARRAY_SIZE       0x8088
-#define GL_TEXTURE_COORD_ARRAY_TYPE       0x8089
-#define GL_TEXTURE_COORD_ARRAY_STRIDE     0x808A
-#define GL_VERTEX_ARRAY_POINTER           0x808E
-#define GL_NORMAL_ARRAY_POINTER           0x808F
-#define GL_COLOR_ARRAY_POINTER            0x8090
-#define GL_TEXTURE_COORD_ARRAY_POINTER    0x8092
-#define GL_SAMPLE_BUFFERS                 0x80A8
-#define GL_SAMPLES                        0x80A9
-#define GL_SAMPLE_COVERAGE_VALUE          0x80AA
-#define GL_SAMPLE_COVERAGE_INVERT         0x80AB
-
-/* OpenGL ES 1.0 defines, they gone in 1.1 and 2.0 */
-#ifndef GL_MAX_ELEMENTS_VERTICES
-#define GL_MAX_ELEMENTS_VERTICES          0x80E8
-#endif                          /* GL_MAX_ELEMENTS_VERTICES */
-#ifndef GL_MAX_ELEMENTS_INDICES
-#define GL_MAX_ELEMENTS_INDICES           0x80E9
-#endif                          /* GL_MAX_ELEMENTS_INDICES */
-
-/* GetTextureParameter */
-/*      GL_TEXTURE_MAG_FILTER */
-/*      GL_TEXTURE_MIN_FILTER */
-/*      GL_TEXTURE_WRAP_S */
-/*      GL_TEXTURE_WRAP_T */
-
-#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
-#define GL_COMPRESSED_TEXTURE_FORMATS     0x86A3
-
-/* HintMode */
-#define GL_DONT_CARE                      0x1100
-#define GL_FASTEST                        0x1101
-#define GL_NICEST                         0x1102
-
-/* HintTarget */
-#define GL_PERSPECTIVE_CORRECTION_HINT    0x0C50
-#define GL_POINT_SMOOTH_HINT              0x0C51
-#define GL_LINE_SMOOTH_HINT               0x0C52
-#define GL_FOG_HINT                       0x0C54
-#define GL_GENERATE_MIPMAP_HINT           0x8192
-
-/* LightModelParameter */
-#define GL_LIGHT_MODEL_AMBIENT            0x0B53
-#define GL_LIGHT_MODEL_TWO_SIDE           0x0B52
-
-/* LightParameter */
-#define GL_AMBIENT                        0x1200
-#define GL_DIFFUSE                        0x1201
-#define GL_SPECULAR                       0x1202
-#define GL_POSITION                       0x1203
-#define GL_SPOT_DIRECTION                 0x1204
-#define GL_SPOT_EXPONENT                  0x1205
-#define GL_SPOT_CUTOFF                    0x1206
-#define GL_CONSTANT_ATTENUATION           0x1207
-#define GL_LINEAR_ATTENUATION             0x1208
-#define GL_QUADRATIC_ATTENUATION          0x1209
-
-/* DataType */
-#define GL_BYTE                           0x1400
-#define GL_UNSIGNED_BYTE                  0x1401
-#define GL_SHORT                          0x1402
-#define GL_UNSIGNED_SHORT                 0x1403
-#define GL_FLOAT                          0x1406
-#define GL_FIXED                          0x140C
-
-/* LogicOp */
-#define GL_CLEAR                          0x1500
-#define GL_AND                            0x1501
-#define GL_AND_REVERSE                    0x1502
-#define GL_COPY                           0x1503
-#define GL_AND_INVERTED                   0x1504
-#define GL_NOOP                           0x1505
-#define GL_XOR                            0x1506
-#define GL_OR                             0x1507
-#define GL_NOR                            0x1508
-#define GL_EQUIV                          0x1509
-#define GL_INVERT                         0x150A
-#define GL_OR_REVERSE                     0x150B
-#define GL_COPY_INVERTED                  0x150C
-#define GL_OR_INVERTED                    0x150D
-#define GL_NAND                           0x150E
-#define GL_SET                            0x150F
-
-/* MaterialFace */
-/*      GL_FRONT_AND_BACK */
-
-/* MaterialParameter */
-#define GL_EMISSION                       0x1600
-#define GL_SHININESS                      0x1601
-#define GL_AMBIENT_AND_DIFFUSE            0x1602
-/*      GL_AMBIENT */
-/*      GL_DIFFUSE */
-/*      GL_SPECULAR */
-
-/* MatrixMode */
-#define GL_MODELVIEW                      0x1700
-#define GL_PROJECTION                     0x1701
-#define GL_TEXTURE                        0x1702
-
-/* NormalPointerType */
-/*      GL_BYTE */
-/*      GL_SHORT */
-/*      GL_FLOAT */
-/*      GL_FIXED */
-
-/* PixelFormat */
-#define GL_ALPHA                          0x1906
-#define GL_RGB                            0x1907
-#define GL_RGBA                           0x1908
-#define GL_LUMINANCE                      0x1909
-#define GL_LUMINANCE_ALPHA                0x190A
-
-/* PixelStoreParameter */
-#define GL_UNPACK_ALIGNMENT               0x0CF5
-#define GL_PACK_ALIGNMENT                 0x0D05
-
-/* PixelType */
-/*      GL_UNSIGNED_BYTE */
-#define GL_UNSIGNED_SHORT_4_4_4_4         0x8033
-#define GL_UNSIGNED_SHORT_5_5_5_1         0x8034
-#define GL_UNSIGNED_SHORT_5_6_5           0x8363
-
-/* ShadingModel */
-#define GL_FLAT                           0x1D00
-#define GL_SMOOTH                         0x1D01
-
-/* StencilFunction */
-/*      GL_NEVER */
-/*      GL_LESS */
-/*      GL_EQUAL */
-/*      GL_LEQUAL */
-/*      GL_GREATER */
-/*      GL_NOTEQUAL */
-/*      GL_GEQUAL */
-/*      GL_ALWAYS */
-
-/* StencilOp */
-/*      GL_ZERO */
-#define GL_KEEP                           0x1E00
-#define GL_REPLACE                        0x1E01
-#define GL_INCR                           0x1E02
-#define GL_DECR                           0x1E03
-/*      GL_INVERT */
-
-/* StringName */
-#define GL_VENDOR                         0x1F00
-#define GL_RENDERER                       0x1F01
-#define GL_VERSION                        0x1F02
-#define GL_EXTENSIONS                     0x1F03
-
-/* TexCoordPointerType */
-/*      GL_SHORT */
-/*      GL_FLOAT */
-/*      GL_FIXED */
-/*      GL_BYTE */
-
-/* TextureEnvMode */
-#define GL_MODULATE                       0x2100
-#define GL_DECAL                          0x2101
-/*      GL_BLEND */
-#define GL_ADD                            0x0104
-/*      GL_REPLACE */
-
-/* TextureEnvParameter */
-#define GL_TEXTURE_ENV_MODE               0x2200
-#define GL_TEXTURE_ENV_COLOR              0x2201
-
-/* TextureEnvTarget */
-#define GL_TEXTURE_ENV                    0x2300
-
-/* TextureMagFilter */
-#define GL_NEAREST                        0x2600
-#define GL_LINEAR                         0x2601
-
-/* TextureMinFilter */
-/*      GL_NEAREST */
-/*      GL_LINEAR */
-#define GL_NEAREST_MIPMAP_NEAREST         0x2700
-#define GL_LINEAR_MIPMAP_NEAREST          0x2701
-#define GL_NEAREST_MIPMAP_LINEAR          0x2702
-#define GL_LINEAR_MIPMAP_LINEAR           0x2703
-
-/* TextureParameterName */
-#define GL_TEXTURE_MAG_FILTER             0x2800
-#define GL_TEXTURE_MIN_FILTER             0x2801
-#define GL_TEXTURE_WRAP_S                 0x2802
-#define GL_TEXTURE_WRAP_T                 0x2803
-#define GL_GENERATE_MIPMAP                0x8191
-
-/* TextureTarget */
-/*      GL_TEXTURE_2D */
-
-/* TextureUnit */
-#define GL_TEXTURE0                       0x84C0
-#define GL_TEXTURE1                       0x84C1
-#define GL_TEXTURE2                       0x84C2
-#define GL_TEXTURE3                       0x84C3
-#define GL_TEXTURE4                       0x84C4
-#define GL_TEXTURE5                       0x84C5
-#define GL_TEXTURE6                       0x84C6
-#define GL_TEXTURE7                       0x84C7
-#define GL_TEXTURE8                       0x84C8
-#define GL_TEXTURE9                       0x84C9
-#define GL_TEXTURE10                      0x84CA
-#define GL_TEXTURE11                      0x84CB
-#define GL_TEXTURE12                      0x84CC
-#define GL_TEXTURE13                      0x84CD
-#define GL_TEXTURE14                      0x84CE
-#define GL_TEXTURE15                      0x84CF
-#define GL_TEXTURE16                      0x84D0
-#define GL_TEXTURE17                      0x84D1
-#define GL_TEXTURE18                      0x84D2
-#define GL_TEXTURE19                      0x84D3
-#define GL_TEXTURE20                      0x84D4
-#define GL_TEXTURE21                      0x84D5
-#define GL_TEXTURE22                      0x84D6
-#define GL_TEXTURE23                      0x84D7
-#define GL_TEXTURE24                      0x84D8
-#define GL_TEXTURE25                      0x84D9
-#define GL_TEXTURE26                      0x84DA
-#define GL_TEXTURE27                      0x84DB
-#define GL_TEXTURE28                      0x84DC
-#define GL_TEXTURE29                      0x84DD
-#define GL_TEXTURE30                      0x84DE
-#define GL_TEXTURE31                      0x84DF
-#define GL_ACTIVE_TEXTURE                 0x84E0
-#define GL_CLIENT_ACTIVE_TEXTURE          0x84E1
-
-/* TextureWrapMode */
-#define GL_REPEAT                         0x2901
-#define GL_CLAMP_TO_EDGE                  0x812F
-
-/* VertexPointerType */
-/*      GL_SHORT */
-/*      GL_FLOAT */
-/*      GL_FIXED */
-/*      GL_BYTE */
-
-/* LightName */
-#define GL_LIGHT0                         0x4000
-#define GL_LIGHT1                         0x4001
-#define GL_LIGHT2                         0x4002
-#define GL_LIGHT3                         0x4003
-#define GL_LIGHT4                         0x4004
-#define GL_LIGHT5                         0x4005
-#define GL_LIGHT6                         0x4006
-#define GL_LIGHT7                         0x4007
-
-/* Buffer Objects */
-#define GL_ARRAY_BUFFER                   0x8892
-#define GL_ELEMENT_ARRAY_BUFFER           0x8893
-
-#define GL_ARRAY_BUFFER_BINDING               0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING       0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING        0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING        0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING         0x8898
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
-
-#define GL_STATIC_DRAW                    0x88E4
-#define GL_DYNAMIC_DRAW                   0x88E8
-
-#define GL_BUFFER_SIZE                    0x8764
-#define GL_BUFFER_USAGE                   0x8765
-
-/* Texture combine + dot3 */
-#define GL_SUBTRACT                       0x84E7
-#define GL_COMBINE                        0x8570
-#define GL_COMBINE_RGB                    0x8571
-#define GL_COMBINE_ALPHA                  0x8572
-#define GL_RGB_SCALE                      0x8573
-#define GL_ADD_SIGNED                     0x8574
-#define GL_INTERPOLATE                    0x8575
-#define GL_CONSTANT                       0x8576
-#define GL_PRIMARY_COLOR                  0x8577
-#define GL_PREVIOUS                       0x8578
-#define GL_OPERAND0_RGB                   0x8590
-#define GL_OPERAND1_RGB                   0x8591
-#define GL_OPERAND2_RGB                   0x8592
-#define GL_OPERAND0_ALPHA                 0x8598
-#define GL_OPERAND1_ALPHA                 0x8599
-#define GL_OPERAND2_ALPHA                 0x859A
-
-#define GL_ALPHA_SCALE                    0x0D1C
-
-#define GL_SRC0_RGB                       0x8580
-#define GL_SRC1_RGB                       0x8581
-#define GL_SRC2_RGB                       0x8582
-#define GL_SRC0_ALPHA                     0x8588
-#define GL_SRC1_ALPHA                     0x8589
-#define GL_SRC2_ALPHA                     0x858A
-
-#define GL_DOT3_RGB                       0x86AE
-#define GL_DOT3_RGBA                      0x86AF
-
-/*------------------------------------------------------------------------*
- * required OES extension tokens
- *------------------------------------------------------------------------*/
-
-/* OES_read_format */
-#ifndef GL_OES_read_format
-#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES                   0x8B9A
-#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES                 0x8B9B
-#endif
-
-/* GL_OES_compressed_paletted_texture */
-#ifndef GL_OES_compressed_paletted_texture
-#define GL_PALETTE4_RGB8_OES                                    0x8B90
-#define GL_PALETTE4_RGBA8_OES                                   0x8B91
-#define GL_PALETTE4_R5_G6_B5_OES                                0x8B92
-#define GL_PALETTE4_RGBA4_OES                                   0x8B93
-#define GL_PALETTE4_RGB5_A1_OES                                 0x8B94
-#define GL_PALETTE8_RGB8_OES                                    0x8B95
-#define GL_PALETTE8_RGBA8_OES                                   0x8B96
-#define GL_PALETTE8_R5_G6_B5_OES                                0x8B97
-#define GL_PALETTE8_RGBA4_OES                                   0x8B98
-#define GL_PALETTE8_RGB5_A1_OES                                 0x8B99
-#endif
-
-/* OES_point_size_array */
-#ifndef GL_OES_point_size_array
-#define GL_POINT_SIZE_ARRAY_OES                                 0x8B9C
-#define GL_POINT_SIZE_ARRAY_TYPE_OES                            0x898A
-#define GL_POINT_SIZE_ARRAY_STRIDE_OES                          0x898B
-#define GL_POINT_SIZE_ARRAY_POINTER_OES                         0x898C
-#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES                  0x8B9F
-#endif
-
-/* GL_OES_point_sprite */
-#ifndef GL_OES_point_sprite
-#define GL_POINT_SPRITE_OES                                     0x8861
-#define GL_COORD_REPLACE_OES                                    0x8862
-#endif
-
-/* GL_OES_draw_texture */
-#ifndef GL_OES_draw_texture
-#define GL_TEXTURE_CROP_RECT_OES                                0x8B9D
-#endif                          /* GL_OES_draw_texture */
-
-/*  GL_OES_vertex_buffer_object */
-#ifndef GL_OES_vertex_buffer_object
-#define GL_ARRAY_BUFFER_OES                                     0x8892
-#define GL_ELEMENT_ARRAY_BUFFER_OES                             0x8893
-#define GL_ARRAY_BUFFER_BINDING_OES                             0x8894
-#define GL_ELEMENT_ARRAY_BUFFER_BINDING_OES                     0x8895
-#define GL_VERTEX_ARRAY_BUFFER_BINDING_OES                      0x8896
-#define GL_NORMAL_ARRAY_BUFFER_BINDING_OES                      0x8897
-#define GL_COLOR_ARRAY_BUFFER_BINDING_OES                       0x8898
-#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_OES               0x889A
-#define GL_STATIC_DRAW_OES                                      0x88E4
-#define GL_DYNAMIC_DRAW_OES                                     0x88E8
-#define GL_WRITE_ONLY_OES                                       0x88B9
-#define GL_BUFFER_SIZE_OES                                      0x8764
-#define GL_BUFFER_USAGE_OES                                     0x8765
-#define GL_BUFFER_ACCESS_OES                                    0x88BB
-#endif                          /* GL_OES_vertex_buffer_object */
-
-/*************************************************************/
-
-/* Available only in Common profile */
-    GL_API void GL_APIENTRY glAlphaFunc(GLenum func, GLclampf ref);
-    GL_API void GL_APIENTRY glClearColor(GLclampf red, GLclampf green,
-                                         GLclampf blue, GLclampf alpha);
-    GL_API void GL_APIENTRY glClearDepthf(GLclampf depth);
-    GL_API void GL_APIENTRY glClipPlanef(GLenum plane,
-                                         const GLfloat * equation);
-    GL_API void GL_APIENTRY glColor4f(GLfloat red, GLfloat green,
-                                      GLfloat blue, GLfloat alpha);
-    GL_API void GL_APIENTRY glDepthRangef(GLclampf zNear, GLclampf zFar);
-    GL_API void GL_APIENTRY glFogf(GLenum pname, GLfloat param);
-    GL_API void GL_APIENTRY glFogfv(GLenum pname, const GLfloat * params);
-    GL_API void GL_APIENTRY glFrustumf(GLfloat left, GLfloat right,
-                                       GLfloat bottom, GLfloat top,
-                                       GLfloat zNear, GLfloat zFar);
-    GL_API void GL_APIENTRY glGetClipPlanef(GLenum pname, GLfloat eqn[4]);
-    GL_API void GL_APIENTRY glGetFloatv(GLenum pname, GLfloat * params);
-    GL_API void GL_APIENTRY glGetLightfv(GLenum light, GLenum pname,
-                                         GLfloat * params);
-    GL_API void GL_APIENTRY glGetMaterialfv(GLenum face, GLenum pname,
-                                            GLfloat * params);
-    GL_API void GL_APIENTRY glGetTexEnvfv(GLenum env, GLenum pname,
-                                          GLfloat * params);
-    GL_API void GL_APIENTRY glGetTexParameterfv(GLenum target, GLenum pname,
-                                                GLfloat * params);
-    GL_API void GL_APIENTRY glLightModelf(GLenum pname, GLfloat param);
-    GL_API void GL_APIENTRY glLightModelfv(GLenum pname,
-                                           const GLfloat * params);
-    GL_API void GL_APIENTRY glLightf(GLenum light, GLenum pname,
-                                     GLfloat param);
-    GL_API void GL_APIENTRY glLightfv(GLenum light, GLenum pname,
-                                      const GLfloat * params);
-    GL_API void GL_APIENTRY glLineWidth(GLfloat width);
-    GL_API void GL_APIENTRY glLoadMatrixf(const GLfloat * m);
-    GL_API void GL_APIENTRY glMaterialf(GLenum face, GLenum pname,
-                                        GLfloat param);
-    GL_API void GL_APIENTRY glMaterialfv(GLenum face, GLenum pname,
-                                         const GLfloat * params);
-    GL_API void GL_APIENTRY glMultMatrixf(const GLfloat * m);
-    GL_API void GL_APIENTRY glMultiTexCoord4f(GLenum target, GLfloat s,
-                                              GLfloat t, GLfloat r,
-                                              GLfloat q);
-    GL_API void GL_APIENTRY glNormal3f(GLfloat nx, GLfloat ny, GLfloat nz);
-    GL_API void GL_APIENTRY glOrthof(GLfloat left, GLfloat right,
-                                     GLfloat bottom, GLfloat top,
-                                     GLfloat zNear, GLfloat zFar);
-    GL_API void GL_APIENTRY glPointParameterf(GLenum pname, GLfloat param);
-    GL_API void GL_APIENTRY glPointParameterfv(GLenum pname,
-                                               const GLfloat * params);
-    GL_API void GL_APIENTRY glPointSize(GLfloat size);
-    GL_API void GL_APIENTRY glPolygonOffset(GLfloat factor, GLfloat units);
-    GL_API void GL_APIENTRY glRotatef(GLfloat angle, GLfloat x, GLfloat y,
-                                      GLfloat z);
-    GL_API void GL_APIENTRY glScalef(GLfloat x, GLfloat y, GLfloat z);
-    GL_API void GL_APIENTRY glTexEnvf(GLenum target, GLenum pname,
-                                      GLfloat param);
-    GL_API void GL_APIENTRY glTexEnvfv(GLenum target, GLenum pname,
-                                       const GLfloat * params);
-    GL_API void GL_APIENTRY glTexParameterf(GLenum target, GLenum pname,
-                                            GLfloat param);
-    GL_API void GL_APIENTRY glTexParameterfv(GLenum target, GLenum pname,
-                                             const GLfloat * params);
-    GL_API void GL_APIENTRY glTranslatef(GLfloat x, GLfloat y, GLfloat z);
-
-/* Available in both Common and Common-Lite profiles */
-    GL_API void GL_APIENTRY glActiveTexture(GLenum texture);
-    GL_API void GL_APIENTRY glAlphaFuncx(GLenum func, GLclampx ref);
-    GL_API void GL_APIENTRY glBindBuffer(GLenum target, GLuint buffer);
-    GL_API void GL_APIENTRY glBindTexture(GLenum target, GLuint texture);
-    GL_API void GL_APIENTRY glBlendFunc(GLenum sfactor, GLenum dfactor);
-    GL_API void GL_APIENTRY glBufferData(GLenum target, GLsizeiptr size,
-                                         const GLvoid * data, GLenum usage);
-    GL_API void GL_APIENTRY glBufferSubData(GLenum target, GLintptr offset,
-                                            GLsizeiptr size,
-                                            const GLvoid * data);
-    GL_API void GL_APIENTRY glClear(GLbitfield mask);
-    GL_API void GL_APIENTRY glClearColorx(GLclampx red, GLclampx green,
-                                          GLclampx blue, GLclampx alpha);
-    GL_API void GL_APIENTRY glClearDepthx(GLclampx depth);
-    GL_API void GL_APIENTRY glClearStencil(GLint s);
-    GL_API void GL_APIENTRY glClientActiveTexture(GLenum texture);
-    GL_API void GL_APIENTRY glClipPlanex(GLenum plane,
-                                         const GLfixed * equation);
-    GL_API void GL_APIENTRY glColor4ub(GLubyte red, GLubyte green,
-                                       GLubyte blue, GLubyte alpha);
-    GL_API void GL_APIENTRY glColor4x(GLfixed red, GLfixed green,
-                                      GLfixed blue, GLfixed alpha);
-    GL_API void GL_APIENTRY glColorMask(GLboolean red, GLboolean green,
-                                        GLboolean blue, GLboolean alpha);
-    GL_API void GL_APIENTRY glColorPointer(GLint size, GLenum type,
-                                           GLsizei stride,
-                                           const GLvoid * pointer);
-    GL_API void GL_APIENTRY glCompressedTexImage2D(GLenum target, GLint level,
-                                                   GLenum internalformat,
-                                                   GLsizei width,
-                                                   GLsizei height,
-                                                   GLint border,
-                                                   GLsizei imageSize,
-                                                   const GLvoid * data);
-    GL_API void GL_APIENTRY glCompressedTexSubImage2D(GLenum target,
-                                                      GLint level,
-                                                      GLint xoffset,
-                                                      GLint yoffset,
-                                                      GLsizei width,
-                                                      GLsizei height,
-                                                      GLenum format,
-                                                      GLsizei imageSize,
-                                                      const GLvoid * data);
-    GL_API void GL_APIENTRY glCopyTexImage2D(GLenum target, GLint level,
-                                             GLenum internalformat, GLint x,
-                                             GLint y, GLsizei width,
-                                             GLsizei height, GLint border);
-    GL_API void GL_APIENTRY glCopyTexSubImage2D(GLenum target, GLint level,
-                                                GLint xoffset, GLint yoffset,
-                                                GLint x, GLint y,
-                                                GLsizei width,
-                                                GLsizei height);
-    GL_API void GL_APIENTRY glCullFace(GLenum mode);
-    GL_API void GL_APIENTRY glDeleteBuffers(GLsizei n,
-                                            const GLuint * buffers);
-    GL_API void GL_APIENTRY glDeleteTextures(GLsizei n,
-                                             const GLuint * textures);
-    GL_API void GL_APIENTRY glDepthFunc(GLenum func);
-    GL_API void GL_APIENTRY glDepthMask(GLboolean flag);
-    GL_API void GL_APIENTRY glDepthRangex(GLclampx zNear, GLclampx zFar);
-    GL_API void GL_APIENTRY glDisable(GLenum cap);
-    GL_API void GL_APIENTRY glDisableClientState(GLenum array);
-    GL_API void GL_APIENTRY glDrawArrays(GLenum mode, GLint first,
-                                         GLsizei count);
-    GL_API void GL_APIENTRY glDrawElements(GLenum mode, GLsizei count,
-                                           GLenum type,
-                                           const GLvoid * indices);
-    GL_API void GL_APIENTRY glEnable(GLenum cap);
-    GL_API void GL_APIENTRY glEnableClientState(GLenum array);
-    GL_API void GL_APIENTRY glFinish(void);
-    GL_API void GL_APIENTRY glFlush(void);
-    GL_API void GL_APIENTRY glFogx(GLenum pname, GLfixed param);
-    GL_API void GL_APIENTRY glFogxv(GLenum pname, const GLfixed * params);
-    GL_API void GL_APIENTRY glFrontFace(GLenum mode);
-    GL_API void GL_APIENTRY glFrustumx(GLfixed left, GLfixed right,
-                                       GLfixed bottom, GLfixed top,
-                                       GLfixed zNear, GLfixed zFar);
-    GL_API void GL_APIENTRY glGetBooleanv(GLenum pname, GLboolean * params);
-    GL_API void GL_APIENTRY glGetBufferParameteriv(GLenum target,
-                                                   GLenum pname,
-                                                   GLint * params);
-    GL_API void GL_APIENTRY glGetClipPlanex(GLenum pname, GLfixed eqn[4]);
-    GL_API void GL_APIENTRY glGenBuffers(GLsizei n, GLuint * buffers);
-    GL_API void GL_APIENTRY glGenTextures(GLsizei n, GLuint * textures);
-    GL_API GLenum GL_APIENTRY glGetError(void);
-    GL_API void GL_APIENTRY glGetFixedv(GLenum pname, GLfixed * params);
-    GL_API void GL_APIENTRY glGetIntegerv(GLenum pname, GLint * params);
-    GL_API void GL_APIENTRY glGetLightxv(GLenum light, GLenum pname,
-                                         GLfixed * params);
-    GL_API void GL_APIENTRY glGetMaterialxv(GLenum face, GLenum pname,
-                                            GLfixed * params);
-    GL_API void GL_APIENTRY glGetPointerv(GLenum pname, void **params);
-    GL_API const GLubyte *GL_APIENTRY glGetString(GLenum name);
-    GL_API void GL_APIENTRY glGetTexEnviv(GLenum env, GLenum pname,
-                                          GLint * params);
-    GL_API void GL_APIENTRY glGetTexEnvxv(GLenum env, GLenum pname,
-                                          GLfixed * params);
-    GL_API void GL_APIENTRY glGetTexParameteriv(GLenum target, GLenum pname,
-                                                GLint * params);
-    GL_API void GL_APIENTRY glGetTexParameterxv(GLenum target, GLenum pname,
-                                                GLfixed * params);
-    GL_API void GL_APIENTRY glHint(GLenum target, GLenum mode);
-    GL_API GLboolean GL_APIENTRY glIsBuffer(GLuint buffer);
-    GL_API GLboolean GL_APIENTRY glIsEnabled(GLenum cap);
-    GL_API GLboolean GL_APIENTRY glIsTexture(GLuint texture);
-    GL_API void GL_APIENTRY glLightModelx(GLenum pname, GLfixed param);
-    GL_API void GL_APIENTRY glLightModelxv(GLenum pname,
-                                           const GLfixed * params);
-    GL_API void GL_APIENTRY glLightx(GLenum light, GLenum pname,
-                                     GLfixed param);
-    GL_API void GL_APIENTRY glLightxv(GLenum light, GLenum pname,
-                                      const GLfixed * params);
-    GL_API void GL_APIENTRY glLineWidthx(GLfixed width);
-    GL_API void GL_APIENTRY glLoadIdentity(void);
-    GL_API void GL_APIENTRY glLoadMatrixx(const GLfixed * m);
-    GL_API void GL_APIENTRY glLogicOp(GLenum opcode);
-    GL_API void GL_APIENTRY glMaterialx(GLenum face, GLenum pname,
-                                        GLfixed param);
-    GL_API void GL_APIENTRY glMaterialxv(GLenum face, GLenum pname,
-                                         const GLfixed * params);
-    GL_API void GL_APIENTRY glMatrixMode(GLenum mode);
-    GL_API void GL_APIENTRY glMultMatrixx(const GLfixed * m);
-    GL_API void GL_APIENTRY glMultiTexCoord4x(GLenum target, GLfixed s,
-                                              GLfixed t, GLfixed r,
-                                              GLfixed q);
-    GL_API void GL_APIENTRY glNormal3x(GLfixed nx, GLfixed ny, GLfixed nz);
-    GL_API void GL_APIENTRY glNormalPointer(GLenum type, GLsizei stride,
-                                            const GLvoid * pointer);
-    GL_API void GL_APIENTRY glOrthox(GLfixed left, GLfixed right,
-                                     GLfixed bottom, GLfixed top,
-                                     GLfixed zNear, GLfixed zFar);
-    GL_API void GL_APIENTRY glPixelStorei(GLenum pname, GLint param);
-    GL_API void GL_APIENTRY glPointParameterx(GLenum pname, GLfixed param);
-    GL_API void GL_APIENTRY glPointParameterxv(GLenum pname,
-                                               const GLfixed * params);
-    GL_API void GL_APIENTRY glPointSizex(GLfixed size);
-    GL_API void GL_APIENTRY glPolygonOffsetx(GLfixed factor, GLfixed units);
-    GL_API void GL_APIENTRY glPopMatrix(void);
-    GL_API void GL_APIENTRY glPushMatrix(void);
-    GL_API void GL_APIENTRY glReadPixels(GLint x, GLint y, GLsizei width,
-                                         GLsizei height, GLenum format,
-                                         GLenum type, GLvoid * pixels);
-    GL_API void GL_APIENTRY glRotatex(GLfixed angle, GLfixed x, GLfixed y,
-                                      GLfixed z);
-    GL_API void GL_APIENTRY glSampleCoverage(GLclampf value,
-                                             GLboolean invert);
-    GL_API void GL_APIENTRY glSampleCoveragex(GLclampx value,
-                                              GLboolean invert);
-    GL_API void GL_APIENTRY glScalex(GLfixed x, GLfixed y, GLfixed z);
-    GL_API void GL_APIENTRY glScissor(GLint x, GLint y, GLsizei width,
-                                      GLsizei height);
-    GL_API void GL_APIENTRY glShadeModel(GLenum mode);
-    GL_API void GL_APIENTRY glStencilFunc(GLenum func, GLint ref,
-                                          GLuint mask);
-    GL_API void GL_APIENTRY glStencilMask(GLuint mask);
-    GL_API void GL_APIENTRY glStencilOp(GLenum fail, GLenum zfail,
-                                        GLenum zpass);
-    GL_API void GL_APIENTRY glTexCoordPointer(GLint size, GLenum type,
-                                              GLsizei stride,
-                                              const GLvoid * pointer);
-    GL_API void GL_APIENTRY glTexEnvi(GLenum target, GLenum pname,
-                                      GLint param);
-    GL_API void GL_APIENTRY glTexEnvx(GLenum target, GLenum pname,
-                                      GLfixed param);
-    GL_API void GL_APIENTRY glTexEnviv(GLenum target, GLenum pname,
-                                       const GLint * params);
-    GL_API void GL_APIENTRY glTexEnvxv(GLenum target, GLenum pname,
-                                       const GLfixed * params);
-    GL_API void GL_APIENTRY glTexImage2D(GLenum target, GLint level,
-                                         GLint internalformat, GLsizei width,
-                                         GLsizei height, GLint border,
-                                         GLenum format, GLenum type,
-                                         const GLvoid * pixels);
-    GL_API void GL_APIENTRY glTexParameteri(GLenum target, GLenum pname,
-                                            GLint param);
-    GL_API void GL_APIENTRY glTexParameterx(GLenum target, GLenum pname,
-                                            GLfixed param);
-    GL_API void GL_APIENTRY glTexParameteriv(GLenum target, GLenum pname,
-                                             const GLint * params);
-    GL_API void GL_APIENTRY glTexParameterxv(GLenum target, GLenum pname,
-                                             const GLfixed * params);
-    GL_API void GL_APIENTRY glTexSubImage2D(GLenum target, GLint level,
-                                            GLint xoffset, GLint yoffset,
-                                            GLsizei width, GLsizei height,
-                                            GLenum format, GLenum type,
-                                            const GLvoid * pixels);
-    GL_API void GL_APIENTRY glTranslatex(GLfixed x, GLfixed y, GLfixed z);
-    GL_API void GL_APIENTRY glVertexPointer(GLint size, GLenum type,
-                                            GLsizei stride,
-                                            const GLvoid * pointer);
-    GL_API void GL_APIENTRY glViewport(GLint x, GLint y, GLsizei width,
-                                       GLsizei height);
-
-/*------------------------------------------------------------------------*
- * Required OES extension functions
- *------------------------------------------------------------------------*/
-
-/* GL_OES_read_format */
-#ifndef GL_OES_read_format
-#define GL_OES_read_format 1
-#endif
-
-/* GL_OES_compressed_paletted_texture */
-#ifndef GL_OES_compressed_paletted_texture
-#define GL_OES_compressed_paletted_texture 1
-#endif
-
-/* GL_OES_point_size_array */
-#ifndef GL_OES_point_size_array
-#define GL_OES_point_size_array 1
-    GL_API void GL_APIENTRY glPointSizePointerOES(GLenum type, GLsizei stride,
-                                                  const GLvoid * pointer);
-#endif
-
-/* GL_OES_query_matrix */
-#ifndef GL_OES_query_matrix
-#define GL_OES_query_matrix 1
-    GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES(GLfixed mantissa[16],
-                                                    GLint exponent[16]);
-#endif                          /* GL_OES_query_matrix */
-
-/* GL_OES_point_sprite */
-#ifndef GL_OES_point_sprite
-#define GL_OES_point_sprite 1
-#endif
-
-/* GL_OES_draw_texture */
-#ifndef GL_OES_draw_texture
-#define GL_OES_draw_texture 1
-    GL_API void GL_APIENTRY glDrawTexsOES(GLshort x, GLshort y, GLshort z,
-                                          GLshort width, GLshort height);
-    GL_API void GL_APIENTRY glDrawTexiOES(GLint x, GLint y, GLint z,
-                                          GLint width, GLint height);
-    GL_API void GL_APIENTRY glDrawTexxOES(GLfixed x, GLfixed y, GLfixed z,
-                                          GLfixed width, GLfixed height);
-    GL_API void GL_APIENTRY glDrawTexsvOES(const GLshort * coords);
-    GL_API void GL_APIENTRY glDrawTexivOES(const GLint * coords);
-    GL_API void GL_APIENTRY glDrawTexxvOES(const GLfixed * coords);
-    GL_API void GL_APIENTRY glDrawTexfOES(GLfloat x, GLfloat y, GLfloat z,
-                                          GLfloat width, GLfloat height);
-    GL_API void GL_APIENTRY glDrawTexfvOES(const GLfloat * coords);
-#endif                          /* GL_OES_draw_texture */
-
-/* GL_OES_single_precision */
-#ifndef GL_OES_single_precision
-#define GL_OES_single_precision 1
-    GL_API void GL_APIENTRY glDepthRangefOES(GLclampf zNear, GLclampf zFar);
-    GL_API void GL_APIENTRY glFrustumfOES(GLfloat left, GLfloat right,
-                                          GLfloat bottom, GLfloat top,
-                                          GLfloat zNear, GLfloat zFar);
-    GL_API void GL_APIENTRY glOrthofOES(GLfloat left, GLfloat right,
-                                        GLfloat bottom, GLfloat top,
-                                        GLfloat zNear, GLfloat zFar);
-    GL_API void GL_APIENTRY glClipPlanefOES(GLenum plane,
-                                            const GLfloat * equation);
-    GL_API void GL_APIENTRY glGetClipPlanefOES(GLenum pname, GLfloat eqn[4]);
-    GL_API void GL_APIENTRY glClearDepthfOES(GLclampf depth);
-#endif                          /* GL_OES_single_precision */
-
-/* GL_OES_vertex_buffer_object */
-#ifndef GL_OES_vertex_buffer_object
-#define GL_OES_vertex_buffer_object 1
-    GL_API void APIENTRY glBindBufferOES(GLenum, GLuint);
-    GL_API void APIENTRY glDeleteBuffersOES(GLsizei, const GLuint *);
-    GL_API void APIENTRY glGenBuffersOES(GLsizei, GLuint *);
-    GL_API GLboolean APIENTRY glIsBufferOES(GLuint);
-    GL_API void APIENTRY glBufferDataOES(GLenum, GLsizeiptr, const GLvoid *,
-                                         GLenum);
-    GL_API void APIENTRY glBufferSubDataOES(GLenum, GLintptr, GLsizeiptr,
-                                            const GLvoid *);
-    GL_API void APIENTRY glGetBufferParameterivOES(GLenum, GLenum, GLint *);
-#endif                          /* GL_OES_vertex_buffer_object */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif                          /* __gles_h_ */

+ 52 - 33
extern/include/SDL/SDL_pixels.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -122,22 +122,29 @@ enum
 #define SDL_PIXELORDER(X)	(((X) >> 20) & 0x0F)
 #define SDL_PIXELORDER(X)	(((X) >> 20) & 0x0F)
 #define SDL_PIXELLAYOUT(X)	(((X) >> 16) & 0x0F)
 #define SDL_PIXELLAYOUT(X)	(((X) >> 16) & 0x0F)
 #define SDL_BITSPERPIXEL(X)	(((X) >> 8) & 0xFF)
 #define SDL_BITSPERPIXEL(X)	(((X) >> 8) & 0xFF)
-#define SDL_BYTESPERPIXEL(X)	(((X) >> 0) & 0xFF)
+#define SDL_BYTESPERPIXEL(X) \
+    (SDL_ISPIXELFORMAT_FOURCC(X) ? \
+        ((((X) == SDL_PIXELFORMAT_YUY2) || \
+          ((X) == SDL_PIXELFORMAT_UYVY) || \
+          ((X) == SDL_PIXELFORMAT_YVYU)) ? 2 : 1) : (((X) >> 0) & 0xFF))
 
 
 #define SDL_ISPIXELFORMAT_INDEXED(format)   \
 #define SDL_ISPIXELFORMAT_INDEXED(format)   \
-    ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
-     (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
-     (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8))
+    (!SDL_ISPIXELFORMAT_FOURCC(format) && \
+     ((SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX1) || \
+      (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX4) || \
+      (SDL_PIXELTYPE(format) == SDL_PIXELTYPE_INDEX8)))
 
 
 #define SDL_ISPIXELFORMAT_ALPHA(format)   \
 #define SDL_ISPIXELFORMAT_ALPHA(format)   \
-    ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
-     (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
-     (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
-     (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA))
+    (!SDL_ISPIXELFORMAT_FOURCC(format) && \
+     ((SDL_PIXELORDER(format) == SDL_PACKEDORDER_ARGB) || \
+      (SDL_PIXELORDER(format) == SDL_PACKEDORDER_RGBA) || \
+      (SDL_PIXELORDER(format) == SDL_PACKEDORDER_ABGR) || \
+      (SDL_PIXELORDER(format) == SDL_PACKEDORDER_BGRA)))
 
 
 #define SDL_ISPIXELFORMAT_FOURCC(format)    \
 #define SDL_ISPIXELFORMAT_FOURCC(format)    \
     ((format) && !((format) & 0x80000000))
     ((format) && !((format) & 0x80000000))
 
 
+/* Note: If you modify this list, update SDL_GetPixelFormatName() */
 enum
 enum
 {
 {
     SDL_PIXELFORMAT_UNKNOWN,
     SDL_PIXELFORMAT_UNKNOWN,
@@ -170,15 +177,27 @@ enum
     SDL_PIXELFORMAT_ARGB4444 =
     SDL_PIXELFORMAT_ARGB4444 =
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
                                SDL_PACKEDLAYOUT_4444, 16, 2),
                                SDL_PACKEDLAYOUT_4444, 16, 2),
+    SDL_PIXELFORMAT_RGBA4444 =
+        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
+                               SDL_PACKEDLAYOUT_4444, 16, 2),
     SDL_PIXELFORMAT_ABGR4444 =
     SDL_PIXELFORMAT_ABGR4444 =
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
                                SDL_PACKEDLAYOUT_4444, 16, 2),
                                SDL_PACKEDLAYOUT_4444, 16, 2),
+    SDL_PIXELFORMAT_BGRA4444 =
+        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
+                               SDL_PACKEDLAYOUT_4444, 16, 2),
     SDL_PIXELFORMAT_ARGB1555 =
     SDL_PIXELFORMAT_ARGB1555 =
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ARGB,
                                SDL_PACKEDLAYOUT_1555, 16, 2),
                                SDL_PACKEDLAYOUT_1555, 16, 2),
+    SDL_PIXELFORMAT_RGBA5551 =
+        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_RGBA,
+                               SDL_PACKEDLAYOUT_5551, 16, 2),
     SDL_PIXELFORMAT_ABGR1555 =
     SDL_PIXELFORMAT_ABGR1555 =
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_ABGR,
                                SDL_PACKEDLAYOUT_1555, 16, 2),
                                SDL_PACKEDLAYOUT_1555, 16, 2),
+    SDL_PIXELFORMAT_BGRA5551 =
+        SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_BGRA,
+                               SDL_PACKEDLAYOUT_5551, 16, 2),
     SDL_PIXELFORMAT_RGB565 =
     SDL_PIXELFORMAT_RGB565 =
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
         SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_PACKED16, SDL_PACKEDORDER_XRGB,
                                SDL_PACKEDLAYOUT_565, 16, 2),
                                SDL_PACKEDLAYOUT_565, 16, 2),
@@ -234,24 +253,20 @@ typedef struct SDL_Color
 } SDL_Color;
 } SDL_Color;
 #define SDL_Colour SDL_Color
 #define SDL_Colour SDL_Color
 
 
-typedef struct SDL_Palette SDL_Palette;
-typedef int (*SDL_PaletteChangedFunc) (void *userdata, SDL_Palette * palette);
-typedef struct SDL_PaletteWatch SDL_PaletteWatch;
-
-struct SDL_Palette
+typedef struct SDL_Palette
 {
 {
     int ncolors;
     int ncolors;
     SDL_Color *colors;
     SDL_Color *colors;
-
+    Uint32 version;
     int refcount;
     int refcount;
-    SDL_PaletteWatch *watch;
-};
+} SDL_Palette;
 
 
 /**
 /**
  *  \note Everything in the pixel format structure is read-only.
  *  \note Everything in the pixel format structure is read-only.
  */
  */
 typedef struct SDL_PixelFormat
 typedef struct SDL_PixelFormat
 {
 {
+    Uint32 format;
     SDL_Palette *palette;
     SDL_Palette *palette;
     Uint8 BitsPerPixel;
     Uint8 BitsPerPixel;
     Uint8 BytesPerPixel;
     Uint8 BytesPerPixel;
@@ -267,8 +282,15 @@ typedef struct SDL_PixelFormat
     Uint32 Gmask;
     Uint32 Gmask;
     Uint32 Bmask;
     Uint32 Bmask;
     Uint32 Amask;
     Uint32 Amask;
+    int refcount;
+    struct SDL_PixelFormat *next;
 } SDL_PixelFormat;
 } SDL_PixelFormat;
 
 
+/**
+ * \brief Get the human readable name of a pixel format
+ */
+extern DECLSPEC const char* SDLCALL SDL_GetPixelFormatName(Uint32 format);
+
 /**
 /**
  *  \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
  *  \brief Convert one of the enumerated pixel formats to a bpp and RGBA masks.
  *  
  *  
@@ -297,6 +319,16 @@ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
                                                           Uint32 Bmask,
                                                           Uint32 Bmask,
                                                           Uint32 Amask);
                                                           Uint32 Amask);
 
 
+/**
+ *  \brief Create an SDL_PixelFormat structure from a pixel format enum.
+ */
+extern DECLSPEC SDL_PixelFormat * SDLCALL SDL_AllocFormat(Uint32 pixel_format);
+
+/**
+ *  \brief Free an SDL_PixelFormat structure.
+ */
+extern DECLSPEC void SDLCALL SDL_FreeFormat(SDL_PixelFormat *format);
+
 /**
 /**
  *  \brief Create a palette structure with the specified number of color 
  *  \brief Create a palette structure with the specified number of color 
  *         entries.
  *         entries.
@@ -310,23 +342,10 @@ extern DECLSPEC Uint32 SDLCALL SDL_MasksToPixelFormatEnum(int bpp,
 extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
 extern DECLSPEC SDL_Palette *SDLCALL SDL_AllocPalette(int ncolors);
 
 
 /**
 /**
- *  \brief Add a callback function which is called when the palette changes.
- *  
- *  \sa SDL_DelPaletteWatch()
- */
-extern DECLSPEC int SDLCALL SDL_AddPaletteWatch(SDL_Palette * palette,
-                                                SDL_PaletteChangedFunc
-                                                callback, void *userdata);
-
-/**
- *  \brief Remove a callback function previously added with 
- *         SDL_AddPaletteWatch().
- *  
- *  \sa SDL_AddPaletteWatch()
+ *  \brief Set the palette for a pixel format structure.
  */
  */
-extern DECLSPEC void SDLCALL SDL_DelPaletteWatch(SDL_Palette * palette,
-                                                 SDL_PaletteChangedFunc
-                                                 callback, void *userdata);
+extern DECLSPEC int SDLCALL SDL_SetPixelFormatPalette(SDL_PixelFormat * format,
+                                                      SDL_Palette *palette);
 
 
 /**
 /**
  *  \brief Set a range of colors in a palette.
  *  \brief Set a range of colors in a palette.

+ 11 - 9
extern/include/SDL/SDL_platform.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -74,8 +74,16 @@
 #if defined(__APPLE__)
 #if defined(__APPLE__)
 /* lets us know what version of Mac OS X we're compiling on */
 /* lets us know what version of Mac OS X we're compiling on */
 #include "AvailabilityMacros.h"
 #include "AvailabilityMacros.h"
-#ifdef MAC_OS_X_VERSION_10_3
-#include "TargetConditionals.h" /* this header is in 10.3 or later */
+#include "TargetConditionals.h"
+#ifndef MAC_OS_X_VERSION_10_4
+#define MAC_OS_X_VERSION_10_4 1040
+#endif
+#ifndef MAC_OS_X_VERSION_10_5
+#define MAC_OS_X_VERSION_10_5 1050
+#endif
+#ifndef MAC_OS_X_VERSION_10_6
+#define MAC_OS_X_VERSION_10_6 1060
+#endif
 #if TARGET_OS_IPHONE
 #if TARGET_OS_IPHONE
 /* if compiling for iPhone */
 /* if compiling for iPhone */
 #undef __IPHONEOS__
 #undef __IPHONEOS__
@@ -86,12 +94,6 @@
 #undef __MACOSX__
 #undef __MACOSX__
 #define __MACOSX__	1
 #define __MACOSX__	1
 #endif /* TARGET_OS_IPHONE */
 #endif /* TARGET_OS_IPHONE */
-#else
-/* if earlier verion of Mac OS X than version 10.3 */
-#undef __MACOSX__
-#define __MACOSX__	1
-#endif
-
 #endif /* defined(__APPLE__) */
 #endif /* defined(__APPLE__) */
 
 
 #if defined(__NetBSD__)
 #if defined(__NetBSD__)

+ 1 - 1
extern/include/SDL/SDL_power.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 1 - 1
extern/include/SDL/SDL_quit.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 1 - 1
extern/include/SDL/SDL_rect.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 609 - 0
extern/include/SDL/SDL_render.h

@@ -0,0 +1,609 @@
+/*
+    SDL - Simple DirectMedia Layer
+    Copyright (C) 1997-2011 Sam Lantinga
+
+    This library is free software; you can redistribute it and/or
+    modify it under the terms of the GNU Lesser General Public
+    License as published by the Free Software Foundation; either
+    version 2.1 of the License, or (at your option) any later version.
+
+    This library is distributed in the hope that it will be useful,
+    but WITHOUT ANY WARRANTY; without even the implied warranty of
+    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+    Lesser General Public License for more details.
+
+    You should have received a copy of the GNU Lesser General Public
+    License along with this library; if not, write to the Free Software
+    Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+
+    Sam Lantinga
+    [email protected]
+*/
+
+/**
+ *  \file SDL_render.h
+ *  
+ *  Header file for SDL 2D rendering functions.
+ *
+ *  This API supports the following features:
+ *      * single pixel points
+ *      * single pixel lines
+ *      * filled rectangles
+ *      * texture images
+ *
+ *  The primitives may be drawn in opaque, blended, or additive modes.
+ *
+ *  The texture images may be drawn in opaque, blended, or additive modes.
+ *  They can have an additional color tint or alpha modulation applied to
+ *  them, and may also be stretched with linear interpolation.
+ *
+ *  This API is designed to accelerate simple 2D operations. You may
+ *  want more functionality such as rotation and particle effects and
+ *  in that case you should use SDL's OpenGL/Direct3D support or one
+ *  of the many good 3D engines.
+ */
+
+#ifndef _SDL_render_h
+#define _SDL_render_h
+
+#include "SDL_stdinc.h"
+#include "SDL_rect.h"
+#include "SDL_video.h"
+
+#include "begin_code.h"
+/* Set up for C function definitions, even when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+extern "C" {
+/* *INDENT-ON* */
+#endif
+
+/**
+ *  \brief Flags used when creating a rendering context
+ */
+typedef enum
+{
+    SDL_RENDERER_ACCELERATED = 0x00000001,      /**< The renderer uses hardware 
+                                                     acceleration */
+    SDL_RENDERER_PRESENTVSYNC = 0x00000002      /**< Present is synchronized 
+                                                     with the refresh rate */
+} SDL_RendererFlags;
+
+/**
+ *  \brief Information on the capabilities of a render driver or context.
+ */
+typedef struct SDL_RendererInfo
+{
+    const char *name;           /**< The name of the renderer */
+    Uint32 flags;               /**< Supported ::SDL_RendererFlags */
+    Uint32 num_texture_formats; /**< The number of available texture formats */
+    Uint32 texture_formats[16]; /**< The available texture formats */
+    int max_texture_width;      /**< The maximimum texture width */
+    int max_texture_height;     /**< The maximimum texture height */
+} SDL_RendererInfo;
+
+/**
+ *  \brief The access pattern allowed for a texture.
+ */
+typedef enum
+{
+    SDL_TEXTUREACCESS_STATIC,    /**< Changes rarely, not lockable */
+    SDL_TEXTUREACCESS_STREAMING  /**< Changes frequently, lockable */
+} SDL_TextureAccess;
+
+/**
+ *  \brief The texture channel modulation used in SDL_RenderCopy().
+ */
+typedef enum
+{
+    SDL_TEXTUREMODULATE_NONE = 0x00000000,     /**< No modulation */
+    SDL_TEXTUREMODULATE_COLOR = 0x00000001,    /**< srcC = srcC * color */
+    SDL_TEXTUREMODULATE_ALPHA = 0x00000002     /**< srcA = srcA * alpha */
+} SDL_TextureModulate;
+
+/**
+ *  \brief A structure representing rendering state
+ */
+struct SDL_Renderer;
+typedef struct SDL_Renderer SDL_Renderer;
+
+/**
+ *  \brief An efficient driver-specific representation of pixel data
+ */
+struct SDL_Texture;
+typedef struct SDL_Texture SDL_Texture;
+
+
+/* Function prototypes */
+
+/**
+ *  \brief Get the number of 2D rendering drivers available for the current 
+ *         display.
+ *  
+ *  A render driver is a set of code that handles rendering and texture
+ *  management on a particular display.  Normally there is only one, but
+ *  some drivers may have several available with different capabilities.
+ *  
+ *  \sa SDL_GetRenderDriverInfo()
+ *  \sa SDL_CreateRenderer()
+ */
+extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
+
+/**
+ *  \brief Get information about a specific 2D rendering driver for the current 
+ *         display.
+ *  
+ *  \param index The index of the driver to query information about.
+ *  \param info  A pointer to an SDL_RendererInfo struct to be filled with 
+ *               information on the rendering driver.
+ *  
+ *  \return 0 on success, -1 if the index was out of range.
+ *  
+ *  \sa SDL_CreateRenderer()
+ */
+extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
+                                                    SDL_RendererInfo * info);
+
+/**
+ *  \brief Create a 2D rendering context for a window.
+ *  
+ *  \param window The window where rendering is displayed.
+ *  \param index    The index of the rendering driver to initialize, or -1 to 
+ *                  initialize the first one supporting the requested flags.
+ *  \param flags    ::SDL_RendererFlags.
+ *  
+ *  \return A valid rendering context or NULL if there was an error.
+ *  
+ *  \sa SDL_CreateSoftwareRenderer()
+ *  \sa SDL_GetRendererInfo()
+ *  \sa SDL_DestroyRenderer()
+ */
+extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateRenderer(SDL_Window * window,
+                                               int index, Uint32 flags);
+
+/**
+ *  \brief Create a 2D software rendering context for a surface.
+ *  
+ *  \param surface The surface where rendering is done.
+ *  
+ *  \return A valid rendering context or NULL if there was an error.
+ *  
+ *  \sa SDL_CreateRenderer()
+ *  \sa SDL_DestroyRenderer()
+ */
+extern DECLSPEC SDL_Renderer * SDLCALL SDL_CreateSoftwareRenderer(SDL_Surface * surface);
+
+/**
+ *  \brief Get information about a rendering context.
+ */
+extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_Renderer * renderer,
+                                                SDL_RendererInfo * info);
+
+/**
+ *  \brief Create a texture for a rendering context.
+ *  
+ *  \param format The format of the texture.
+ *  \param access One of the enumerated values in ::SDL_TextureAccess.
+ *  \param w      The width of the texture in pixels.
+ *  \param h      The height of the texture in pixels.
+ *  
+ *  \return The created texture is returned, or 0 if no rendering context was 
+ *          active,  the format was unsupported, or the width or height were out
+ *          of range.
+ *  
+ *  \sa SDL_QueryTexture()
+ *  \sa SDL_UpdateTexture()
+ *  \sa SDL_DestroyTexture()
+ */
+extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(SDL_Renderer * renderer,                                                        Uint32 format,
+                                                        int access, int w,
+                                                        int h);
+
+/**
+ *  \brief Create a texture from an existing surface.
+ *  
+ *  \param surface The surface containing pixel data used to fill the texture.
+ *  
+ *  \return The created texture is returned, or 0 on error.
+ *  
+ *  \note The surface is not modified or freed by this function.
+ *  
+ *  \sa SDL_QueryTexture()
+ *  \sa SDL_DestroyTexture()
+ */
+extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(SDL_Renderer * renderer, SDL_Surface * surface);
+
+/**
+ *  \brief Query the attributes of a texture
+ *  
+ *  \param texture A texture to be queried.
+ *  \param format  A pointer filled in with the raw format of the texture.  The 
+ *                 actual format may differ, but pixel transfers will use this 
+ *                 format.
+ *  \param access  A pointer filled in with the actual access to the texture.
+ *  \param w       A pointer filled in with the width of the texture in pixels.
+ *  \param h       A pointer filled in with the height of the texture in pixels.
+ *  
+ *  \return 0 on success, or -1 if the texture is not valid.
+ */
+extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
+                                             Uint32 * format, int *access,
+                                             int *w, int *h);
+
+/**
+ *  \brief Set an additional color value used in render copy operations.
+ *  
+ *  \param texture The texture to update.
+ *  \param r       The red color value multiplied into copy operations.
+ *  \param g       The green color value multiplied into copy operations.
+ *  \param b       The blue color value multiplied into copy operations.
+ *  
+ *  \return 0 on success, or -1 if the texture is not valid or color modulation 
+ *          is not supported.
+ *  
+ *  \sa SDL_GetTextureColorMod()
+ */
+extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
+                                                   Uint8 r, Uint8 g, Uint8 b);
+
+
+/**
+ *  \brief Get the additional color value used in render copy operations.
+ *  
+ *  \param texture The texture to query.
+ *  \param r         A pointer filled in with the current red color value.
+ *  \param g         A pointer filled in with the current green color value.
+ *  \param b         A pointer filled in with the current blue color value.
+ *  
+ *  \return 0 on success, or -1 if the texture is not valid.
+ *  
+ *  \sa SDL_SetTextureColorMod()
+ */
+extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
+                                                   Uint8 * r, Uint8 * g,
+                                                   Uint8 * b);
+
+/**
+ *  \brief Set an additional alpha value used in render copy operations.
+ *  
+ *  \param texture The texture to update.
+ *  \param alpha     The alpha value multiplied into copy operations.
+ *  
+ *  \return 0 on success, or -1 if the texture is not valid or alpha modulation 
+ *          is not supported.
+ *  
+ *  \sa SDL_GetTextureAlphaMod()
+ */
+extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
+                                                   Uint8 alpha);
+
+/**
+ *  \brief Get the additional alpha value used in render copy operations.
+ *  
+ *  \param texture The texture to query.
+ *  \param alpha     A pointer filled in with the current alpha value.
+ *  
+ *  \return 0 on success, or -1 if the texture is not valid.
+ *  
+ *  \sa SDL_SetTextureAlphaMod()
+ */
+extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
+                                                   Uint8 * alpha);
+
+/**
+ *  \brief Set the blend mode used for texture copy operations.
+ *  
+ *  \param texture The texture to update.
+ *  \param blendMode ::SDL_BlendMode to use for texture blending.
+ *  
+ *  \return 0 on success, or -1 if the texture is not valid or the blend mode is
+ *          not supported.
+ *  
+ *  \note If the blend mode is not supported, the closest supported mode is
+ *        chosen.
+ *  
+ *  \sa SDL_GetTextureBlendMode()
+ */
+extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
+                                                    SDL_BlendMode blendMode);
+
+/**
+ *  \brief Get the blend mode used for texture copy operations.
+ *  
+ *  \param texture   The texture to query.
+ *  \param blendMode A pointer filled in with the current blend mode.
+ *  
+ *  \return 0 on success, or -1 if the texture is not valid.
+ *  
+ *  \sa SDL_SetTextureBlendMode()
+ */
+extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
+                                                    SDL_BlendMode *blendMode);
+
+/**
+ *  \brief Update the given texture rectangle with new pixel data.
+ *  
+ *  \param texture   The texture to update
+ *  \param rect      A pointer to the rectangle of pixels to update, or NULL to 
+ *                   update the entire texture.
+ *  \param pixels    The raw pixel data.
+ *  \param pitch     The number of bytes between rows of pixel data.
+ *  
+ *  \return 0 on success, or -1 if the texture is not valid.
+ *  
+ *  \note This is a fairly slow function.
+ */
+extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
+                                              const SDL_Rect * rect,
+                                              const void *pixels, int pitch);
+
+/**
+ *  \brief Lock a portion of the texture for pixel access.
+ *  
+ *  \param texture   The texture to lock for access, which was created with 
+ *                   ::SDL_TEXTUREACCESS_STREAMING.
+ *  \param rect      A pointer to the rectangle to lock for access. If the rect 
+ *                   is NULL, the entire texture will be locked.
+ *  \param pixels    This is filled in with a pointer to the locked pixels, 
+ *                   appropriately offset by the locked area.
+ *  \param pitch     This is filled in with the pitch of the locked pixels.
+ *  
+ *  \return 0 on success, or -1 if the texture is not valid or was not created with ::SDL_TEXTUREACCESS_STREAMING.
+ *  
+ *  \sa SDL_UnlockTexture()
+ */
+extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
+                                            const SDL_Rect * rect,
+                                            void **pixels, int *pitch);
+
+/**
+ *  \brief Unlock a texture, uploading the changes to video memory, if needed.
+ *  
+ *  \sa SDL_LockTexture()
+ */
+extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
+
+/**
+ *  \brief Set the drawing area for rendering on the current target.
+ *
+ *  \param rect The rectangle representing the drawing area, or NULL to set the viewport to the entire target.
+ *
+ *  The x,y of the viewport rect represents the origin for rendering.
+ *
+ *  \note When the window is resized, the current viewport is automatically
+ *        centered within the new window size.
+ */
+extern DECLSPEC int SDLCALL SDL_RenderSetViewport(SDL_Renderer * renderer,
+                                                  const SDL_Rect * rect);
+
+/**
+ *  \brief Get the drawing area for the current target.
+ */
+extern DECLSPEC void SDLCALL SDL_RenderGetViewport(SDL_Renderer * renderer,
+                                                   SDL_Rect * rect);
+
+/**
+ *  \brief Set the color used for drawing operations (Fill and Line).
+ *  
+ *  \param r The red value used to draw on the rendering target.
+ *  \param g The green value used to draw on the rendering target.
+ *  \param b The blue value used to draw on the rendering target.
+ *  \param a The alpha value used to draw on the rendering target, usually 
+ *           ::SDL_ALPHA_OPAQUE (255).
+ *  
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDL_SetRenderDrawColor(SDL_Renderer * renderer,
+                                           Uint8 r, Uint8 g, Uint8 b,
+                                           Uint8 a);
+
+/**
+ *  \brief Get the color used for drawing operations (Fill and Line).
+ *  
+ *  \param r A pointer to the red value used to draw on the rendering target.
+ *  \param g A pointer to the green value used to draw on the rendering target.
+ *  \param b A pointer to the blue value used to draw on the rendering target.
+ *  \param a A pointer to the alpha value used to draw on the rendering target, 
+ *           usually ::SDL_ALPHA_OPAQUE (255).
+ *  
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDL_GetRenderDrawColor(SDL_Renderer * renderer,
+                                           Uint8 * r, Uint8 * g, Uint8 * b,
+                                           Uint8 * a);
+
+/**
+ *  \brief Set the blend mode used for drawing operations (Fill and Line).
+ *  
+ *  \param blendMode ::SDL_BlendMode to use for blending.
+ *  
+ *  \return 0 on success, or -1 on error
+ *  
+ *  \note If the blend mode is not supported, the closest supported mode is 
+ *        chosen.
+ *  
+ *  \sa SDL_GetRenderDrawBlendMode()
+ */
+extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(SDL_Renderer * renderer,
+                                                       SDL_BlendMode blendMode);
+
+/**
+ *  \brief Get the blend mode used for drawing operations.
+ *  
+ *  \param blendMode A pointer filled in with the current blend mode.
+ *  
+ *  \return 0 on success, or -1 on error
+ *  
+ *  \sa SDL_SetRenderDrawBlendMode()
+ */
+extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(SDL_Renderer * renderer,
+                                                       SDL_BlendMode *blendMode);
+
+/**
+ *  \brief Clear the current rendering target with the drawing color
+ *
+ *  This function clears the entire rendering target, ignoring the viewport.
+ */
+extern DECLSPEC int SDLCALL SDL_RenderClear(SDL_Renderer * renderer);
+
+/**
+ *  \brief Draw a point on the current rendering target.
+ *  
+ *  \param x The x coordinate of the point.
+ *  \param y The y coordinate of the point.
+ *  
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(SDL_Renderer * renderer,
+                                                int x, int y);
+
+/**
+ *  \brief Draw multiple points on the current rendering target.
+ *  
+ *  \param points The points to draw
+ *  \param count The number of points to draw
+ *  
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(SDL_Renderer * renderer,
+                                                 const SDL_Point * points,
+                                                 int count);
+
+/**
+ *  \brief Draw a line on the current rendering target.
+ *  
+ *  \param x1 The x coordinate of the start point.
+ *  \param y1 The y coordinate of the start point.
+ *  \param x2 The x coordinate of the end point.
+ *  \param y2 The y coordinate of the end point.
+ *  
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawLine(SDL_Renderer * renderer,
+                                               int x1, int y1, int x2, int y2);
+
+/**
+ *  \brief Draw a series of connected lines on the current rendering target.
+ *  
+ *  \param points The points along the lines
+ *  \param count The number of points, drawing count-1 lines
+ *  
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawLines(SDL_Renderer * renderer,
+                                                const SDL_Point * points,
+                                                int count);
+
+/**
+ *  \brief Draw a rectangle on the current rendering target.
+ *  
+ *  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
+ *  
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawRect(SDL_Renderer * renderer,
+                                               const SDL_Rect * rect);
+
+/**
+ *  \brief Draw some number of rectangles on the current rendering target.
+ *  
+ *  \param rects A pointer to an array of destination rectangles.
+ *  \param count The number of rectangles.
+ *  
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderDrawRects(SDL_Renderer * renderer,
+                                                const SDL_Rect * rects,
+                                                int count);
+
+/**
+ *  \brief Fill a rectangle on the current rendering target with the drawing color.
+ *  
+ *  \param rect A pointer to the destination rectangle, or NULL for the entire 
+ *              rendering target.
+ *  
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderFillRect(SDL_Renderer * renderer,
+                                               const SDL_Rect * rect);
+
+/**
+ *  \brief Fill some number of rectangles on the current rendering target with the drawing color.
+ *  
+ *  \param rects A pointer to an array of destination rectangles.
+ *  \param count The number of rectangles.
+ *  
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderFillRects(SDL_Renderer * renderer,
+                                                const SDL_Rect * rect,
+                                                int count);
+
+/**
+ *  \brief Copy a portion of the texture to the current rendering target.
+ *  
+ *  \param texture The source texture.
+ *  \param srcrect   A pointer to the source rectangle, or NULL for the entire 
+ *                   texture.
+ *  \param dstrect   A pointer to the destination rectangle, or NULL for the 
+ *                   entire rendering target.
+ *  
+ *  \return 0 on success, or -1 on error
+ */
+extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Renderer * renderer,
+                                           SDL_Texture * texture,
+                                           const SDL_Rect * srcrect,
+                                           const SDL_Rect * dstrect);
+
+/**
+ *  \brief Read pixels from the current rendering target.
+ *  
+ *  \param rect   A pointer to the rectangle to read, or NULL for the entire 
+ *                render target.
+ *  \param format The desired format of the pixel data, or 0 to use the format
+ *                of the rendering target
+ *  \param pixels A pointer to be filled in with the pixel data
+ *  \param pitch  The pitch of the pixels parameter.
+ *  
+ *  \return 0 on success, or -1 if pixel reading is not supported.
+ *  
+ *  \warning This is a very slow operation, and should not be used frequently.
+ */
+extern DECLSPEC int SDLCALL SDL_RenderReadPixels(SDL_Renderer * renderer,
+                                                 const SDL_Rect * rect,
+                                                 Uint32 format,
+                                                 void *pixels, int pitch);
+
+/**
+ *  \brief Update the screen with rendering performed.
+ */
+extern DECLSPEC void SDLCALL SDL_RenderPresent(SDL_Renderer * renderer);
+
+/**
+ *  \brief Destroy the specified texture.
+ *  
+ *  \sa SDL_CreateTexture()
+ *  \sa SDL_CreateTextureFromSurface()
+ */
+extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
+
+/**
+ *  \brief Destroy the rendering context for a window and free associated
+ *         textures.
+ *  
+ *  \sa SDL_CreateRenderer()
+ */
+extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Renderer * renderer);
+
+
+/* Ends C function definitions when using C++ */
+#ifdef __cplusplus
+/* *INDENT-OFF* */
+}
+/* *INDENT-ON* */
+#endif
+#include "close_code.h"
+
+#endif /* _SDL_render_h */
+
+/* vi: set ts=4 sw=4 expandtab: */

+ 1 - 1
extern/include/SDL/SDL_revision.h

@@ -1 +1 @@
-#define SDL_REVISION "hg-4906:67acc9ab60ff"
+#define SDL_REVISION "hg-5313:7a569d09a682"

+ 7 - 7
extern/include/SDL/SDL_rwops.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -24,7 +24,7 @@
  *  \file SDL_rwops.h
  *  \file SDL_rwops.h
  *  
  *  
  *  This file provides a general interface for SDL to read and write
  *  This file provides a general interface for SDL to read and write
- *  data sources.  It can easily be extended to files, memory, etc.
+ *  data streams.  It can easily be extended to files, memory, etc.
  */
  */
 
 
 #ifndef _SDL_rwops_h
 #ifndef _SDL_rwops_h
@@ -50,14 +50,14 @@ typedef struct SDL_RWops
      *  Seek to \c offset relative to \c whence, one of stdio's whence values:
      *  Seek to \c offset relative to \c whence, one of stdio's whence values:
      *  RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
      *  RW_SEEK_SET, RW_SEEK_CUR, RW_SEEK_END
      *  
      *  
-     *  \return the final offset in the data source.
+     *  \return the final offset in the data stream.
      */
      */
     long (SDLCALL * seek) (struct SDL_RWops * context, long offset,
     long (SDLCALL * seek) (struct SDL_RWops * context, long offset,
                            int whence);
                            int whence);
 
 
     /**
     /**
      *  Read up to \c maxnum objects each of size \c size from the data
      *  Read up to \c maxnum objects each of size \c size from the data
-     *  source to the area pointed at by \c ptr.
+     *  stream to the area pointed at by \c ptr.
      *  
      *  
      *  \return the number of objects read, or 0 at error or end of file.
      *  \return the number of objects read, or 0 at error or end of file.
      */
      */
@@ -66,7 +66,7 @@ typedef struct SDL_RWops
 
 
     /**
     /**
      *  Write exactly \c num objects each of size \c size from the area
      *  Write exactly \c num objects each of size \c size from the area
-     *  pointed at by \c ptr to data source.
+     *  pointed at by \c ptr to data stream.
      *  
      *  
      *  \return the number of objects written, or 0 at error or end of file.
      *  \return the number of objects written, or 0 at error or end of file.
      */
      */
@@ -94,7 +94,7 @@ typedef struct SDL_RWops
                 size_t size;
                 size_t size;
                 size_t left;
                 size_t left;
             } buffer;
             } buffer;
-        } win32io;
+        } windowsio;
 #endif
 #endif
 #ifdef HAVE_STDIO_H
 #ifdef HAVE_STDIO_H
         struct
         struct
@@ -121,7 +121,7 @@ typedef struct SDL_RWops
 /**
 /**
  *  \name RWFrom functions
  *  \name RWFrom functions
  *  
  *  
- *  Functions to create SDL_RWops structures from various data sources.
+ *  Functions to create SDL_RWops structures from various data streams.
  */
  */
 /*@{*/
 /*@{*/
 
 

+ 3 - 3
extern/include/SDL/SDL_scancode.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -35,7 +35,7 @@
  *  \brief The SDL keyboard scancode representation.
  *  \brief The SDL keyboard scancode representation.
  *  
  *  
  *  Values of this type are used to represent keyboard keys, among other places
  *  Values of this type are used to represent keyboard keys, among other places
- *  in the \link SDL_keysym::scancode key.keysym.scancode \endlink field of the
+ *  in the \link SDL_Keysym::scancode key.keysym.scancode \endlink field of the
  *  SDL_Event structure.
  *  SDL_Event structure.
  *  
  *  
  *  The values in this enumeration are based on the USB usage page standard:
  *  The values in this enumeration are based on the USB usage page standard:
@@ -392,7 +392,7 @@ typedef enum
 
 
     SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes 
     SDL_NUM_SCANCODES = 512 /**< not a key, just marks the number of scancodes 
                                  for array bounds */
                                  for array bounds */
-} SDL_scancode;
+} SDL_Scancode;
 
 
 #endif /* _SDL_scancode_h */
 #endif /* _SDL_scancode_h */
 
 

+ 1 - 1
extern/include/SDL/SDL_stdinc.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 30 - 242
extern/include/SDL/SDL_surface.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -32,6 +32,7 @@
 #include "SDL_stdinc.h"
 #include "SDL_stdinc.h"
 #include "SDL_pixels.h"
 #include "SDL_pixels.h"
 #include "SDL_rect.h"
 #include "SDL_rect.h"
+#include "SDL_blendmode.h"
 #include "SDL_rwops.h"
 #include "SDL_rwops.h"
 
 
 #include "begin_code.h"
 #include "begin_code.h"
@@ -53,6 +54,7 @@ extern "C" {
 /*@{*/
 /*@{*/
 #define SDL_PREALLOC        0x00000001  /**< Surface uses preallocated memory */
 #define SDL_PREALLOC        0x00000001  /**< Surface uses preallocated memory */
 #define SDL_RLEACCEL        0x00000002  /**< Surface is RLE encoded */
 #define SDL_RLEACCEL        0x00000002  /**< Surface is RLE encoded */
+#define SDL_DONTFREE        0x00000004  /**< Surface is referenced internally */
 /*@}*//*Surface flags*/
 /*@}*//*Surface flags*/
 
 
 /**
 /**
@@ -87,9 +89,6 @@ typedef struct SDL_Surface
     /** info for fast blit mapping to other surfaces */
     /** info for fast blit mapping to other surfaces */
     struct SDL_BlitMap *map;    /**< Private */
     struct SDL_BlitMap *map;    /**< Private */
 
 
-    /** format version, bumped at every change to invalidate blit maps */
-    unsigned int format_version;        /**< Private */
-
     /** Reference count -- used when freeing surface */
     /** Reference count -- used when freeing surface */
     int refcount;               /**< Read-mostly */
     int refcount;               /**< Read-mostly */
 } SDL_Surface;
 } SDL_Surface;
@@ -159,9 +158,9 @@ extern DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface * surface);
 extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
 extern DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface * surface);
 
 
 /**
 /**
- *  Load a surface from a seekable SDL data source (memory or file).
+ *  Load a surface from a seekable SDL data stream (memory or file).
  *  
  *  
- *  If \c freesrc is non-zero, the source will be closed after being read.
+ *  If \c freesrc is non-zero, the stream will be closed after being read.
  *  
  *  
  *  The new surface should be freed with SDL_FreeSurface().
  *  The new surface should be freed with SDL_FreeSurface().
  *  
  *  
@@ -178,9 +177,9 @@ extern DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops * src,
 #define SDL_LoadBMP(file)	SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
 #define SDL_LoadBMP(file)	SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
 
 
 /**
 /**
- *  Save a surface to a seekable SDL data source (memory or file).
+ *  Save a surface to a seekable SDL data stream (memory or file).
  *  
  *  
- *  If \c freedst is non-zero, the source will be closed after being written.
+ *  If \c freedst is non-zero, the stream will be closed after being written.
  *  
  *  
  *  \return 0 if successful or -1 if there was an error.
  *  \return 0 if successful or -1 if there was an error.
  */
  */
@@ -235,9 +234,9 @@ extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface,
  *  \brief Set an additional color value used in blit operations.
  *  \brief Set an additional color value used in blit operations.
  *  
  *  
  *  \param surface The surface to update.
  *  \param surface The surface to update.
- *  \param r The red source color value multiplied into blit operations.
- *  \param g The green source color value multiplied into blit operations.
- *  \param b The blue source color value multiplied into blit operations.
+ *  \param r The red color value multiplied into blit operations.
+ *  \param g The green color value multiplied into blit operations.
+ *  \param b The blue color value multiplied into blit operations.
  *  
  *  
  *  \return 0 on success, or -1 if the surface is not valid.
  *  \return 0 on success, or -1 if the surface is not valid.
  *  
  *  
@@ -251,9 +250,9 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface * surface,
  *  \brief Get the additional color value used in blit operations.
  *  \brief Get the additional color value used in blit operations.
  *  
  *  
  *  \param surface The surface to query.
  *  \param surface The surface to query.
- *  \param r A pointer filled in with the source red color value.
- *  \param g A pointer filled in with the source green color value.
- *  \param b A pointer filled in with the source blue color value.
+ *  \param r A pointer filled in with the current red color value.
+ *  \param g A pointer filled in with the current green color value.
+ *  \param b A pointer filled in with the current blue color value.
  *  
  *  
  *  \return 0 on success, or -1 if the surface is not valid.
  *  \return 0 on success, or -1 if the surface is not valid.
  *  
  *  
@@ -267,7 +266,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface * surface,
  *  \brief Set an additional alpha value used in blit operations.
  *  \brief Set an additional alpha value used in blit operations.
  *  
  *  
  *  \param surface The surface to update.
  *  \param surface The surface to update.
- *  \param alpha The source alpha value multiplied into blit operations.
+ *  \param alpha The alpha value multiplied into blit operations.
  *  
  *  
  *  \return 0 on success, or -1 if the surface is not valid.
  *  \return 0 on success, or -1 if the surface is not valid.
  *  
  *  
@@ -280,7 +279,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface * surface,
  *  \brief Get the additional alpha value used in blit operations.
  *  \brief Get the additional alpha value used in blit operations.
  *  
  *  
  *  \param surface The surface to query.
  *  \param surface The surface to query.
- *  \param alpha A pointer filled in with the source alpha value.
+ *  \param alpha A pointer filled in with the current alpha value.
  *  
  *  
  *  \return 0 on success, or -1 if the surface is not valid.
  *  \return 0 on success, or -1 if the surface is not valid.
  *  
  *  
@@ -300,7 +299,7 @@ extern DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface * surface,
  *  \sa SDL_GetSurfaceBlendMode()
  *  \sa SDL_GetSurfaceBlendMode()
  */
  */
 extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
 extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
-                                                    int blendMode);
+                                                    SDL_BlendMode blendMode);
 
 
 /**
 /**
  *  \brief Get the blend mode used for blit operations.
  *  \brief Get the blend mode used for blit operations.
@@ -313,38 +312,7 @@ extern DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface * surface,
  *  \sa SDL_SetSurfaceBlendMode()
  *  \sa SDL_SetSurfaceBlendMode()
  */
  */
 extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
 extern DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface * surface,
-                                                    int *blendMode);
-
-/**
- *  \brief Set the scale mode used for blit operations.
- *  
- *  \param surface   The surface to update.
- *  \param scaleMode ::SDL_TextureScaleMode to use for blit scaling.
- *  
- *  \return 0 on success, or -1 if the surface is not valid or the scale mode is
- *          not supported.
- *  
- *  \note If the scale mode is not supported, the closest supported mode is 
- *        chosen.  Currently only ::SDL_TEXTURESCALEMODE_FAST is supported on 
- *        surfaces.
- *  
- *  \sa SDL_GetSurfaceScaleMode()
- */
-extern DECLSPEC int SDLCALL SDL_SetSurfaceScaleMode(SDL_Surface * surface,
-                                                    int scaleMode);
-
-/**
- *  \brief Get the scale mode used for blit operations.
- *  
- *  \param surface   The surface to query.
- *  \param scaleMode A pointer filled in with the current scale mode.
- *  
- *  \return 0 on success, or -1 if the surface is not valid.
- *  
- *  \sa SDL_SetSurfaceScaleMode()
- */
-extern DECLSPEC int SDLCALL SDL_GetSurfaceScaleMode(SDL_Surface * surface,
-                                                    int *scaleMode);
+                                                    SDL_BlendMode *blendMode);
 
 
 /**
 /**
  *  Sets the clipping rectangle for the destination surface in a blit.
  *  Sets the clipping rectangle for the destination surface in a blit.
@@ -393,85 +361,6 @@ extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
                                               Uint32 dst_format,
                                               Uint32 dst_format,
                                               void * dst, int dst_pitch);
                                               void * dst, int dst_pitch);
 
 
-/**
- *  Draws a point with \c color.
- *
- *  The color should be a pixel of the format used by the surface, and 
- *  can be generated by the SDL_MapRGB() function.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_DrawPoint
-    (SDL_Surface * dst, int x, int y, Uint32 color);
-extern DECLSPEC int SDLCALL SDL_DrawPoints
-    (SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
-
-/**
- *  Blends a point with an RGBA value.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_BlendPoint
-    (SDL_Surface * dst, int x, int y,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-extern DECLSPEC int SDLCALL SDL_BlendPoints
-    (SDL_Surface * dst, const SDL_Point * points, int count,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-/**
- *  Draws a line with \c color.
- *  
- *  The color should be a pixel of the format used by the surface, and 
- *  can be generated by the SDL_MapRGB() function.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_DrawLine
-    (SDL_Surface * dst, int x1, int y1, int x2, int y2, Uint32 color);
-extern DECLSPEC int SDLCALL SDL_DrawLines
-    (SDL_Surface * dst, const SDL_Point * points, int count, Uint32 color);
-
-/**
- *  Blends an RGBA value along a line.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_BlendLine
-    (SDL_Surface * dst, int x1, int y1, int x2, int y2,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-extern DECLSPEC int SDLCALL SDL_BlendLines
-    (SDL_Surface * dst, const SDL_Point * points, int count,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-/**
- *  Draws the given rectangle with \c color.
- *  
- *  If \c rect is NULL, the whole surface will be outlined with \c color.
- *  
- *  The color should be a pixel of the format used by the surface, and 
- *  can be generated by the SDL_MapRGB() function.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_DrawRect
-    (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
-extern DECLSPEC int SDLCALL SDL_DrawRects
-    (SDL_Surface * dst, const SDL_Rect ** rects, int count, Uint32 color);
-
-/**
- *  Blends an RGBA value into the outline of the given rectangle.
- *  
- *  If \c rect is NULL, the whole surface will have a blended outline.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_BlendRect
-    (SDL_Surface * dst, const SDL_Rect * rect,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-extern DECLSPEC int SDLCALL SDL_BlendRects
-    (SDL_Surface * dst, const SDL_Rect ** rects, int count,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
 /**
 /**
  *  Performs a fast fill of the given rectangle with \c color.
  *  Performs a fast fill of the given rectangle with \c color.
  *  
  *  
@@ -485,103 +374,7 @@ extern DECLSPEC int SDLCALL SDL_BlendRects
 extern DECLSPEC int SDLCALL SDL_FillRect
 extern DECLSPEC int SDLCALL SDL_FillRect
     (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
     (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
 extern DECLSPEC int SDLCALL SDL_FillRects
 extern DECLSPEC int SDLCALL SDL_FillRects
-    (SDL_Surface * dst, const SDL_Rect ** rects, int count, Uint32 color);
-
-/**
- *  Blends an RGBA value into the given rectangle.
- *  
- *  If \c rect is NULL, the whole surface will be blended with the color.
- *  
- *  \return This function returns 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_BlendFillRect
-    (SDL_Surface * dst, const SDL_Rect * rect,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-extern DECLSPEC int SDLCALL SDL_BlendFillRects
-    (SDL_Surface * dst, const SDL_Rect ** rects, int count,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-#if 0
-/**
- *  Draws the given circle with \c color.
- *  
- *  The color should be a pixel of the format used by the surface, and 
- *  can be generated by the SDL_MapRGB() function.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_DrawCircle
-    (SDL_Surface * dst, int x, int y, int radius, Uint32 color);
-
-/**
- *  Blends an RGBA value into the outline of the given circle.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_BlendCircle
-    (SDL_Surface * dst, int x, int y, int radius,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-/**
- *  Fills the given circle with \c color.
- *  
- *  The color should be a pixel of the format used by the surface, and 
- *  can be generated by the SDL_MapRGB() function.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_FillCircle
-    (SDL_Surface * dst, int x, int y, int radius, Uint32 color);
-
-/**
- *  Blends an RGBA value into the given circle.
- *  
- *  \return This function returns 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_BlendFillCircle
-    (SDL_Surface * dst, int x, int y, int radius,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-/**
- *  Draws the given ellipse with \c color.
- *  
- *  The color should be a pixel of the format used by the surface, and 
- *  can be generated by the SDL_MapRGB() function.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_DrawEllipse
-    (SDL_Surface * dst, int x, int y, int w, int h, Uint32 color);
-
-/**
- *  Blends an RGBA value into the outline of the given ellipse.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_BlendEllipse
-    (SDL_Surface * dst, int x, int y, int w, int h,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-
-/**
- *  Fills the given ellipse with \c color.
- *  
- *  The color should be a pixel of the format used by the surface, and 
- *  can be generated by the SDL_MapRGB() function.
- *  
- *  \return 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_FillEllipse
-    (SDL_Surface * dst, int x, int y, int w, int h, Uint32 color);
-
-/**
- *  Blends an RGBA value into the given ellipse.
- *  
- *  \return This function returns 0 on success, or -1 on error.
- */
-extern DECLSPEC int SDLCALL SDL_BlendFillEllipse
-    (SDL_Surface * dst, int x, int y, int w, int h,
-     int blendMode, Uint8 r, Uint8 g, Uint8 b, Uint8 a);
-#endif // 0
+    (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
 
 
 /**
 /**
  *  Performs a fast blit from the source surface to the destination surface.
  *  Performs a fast blit from the source surface to the destination surface.
@@ -639,22 +432,6 @@ extern DECLSPEC int SDLCALL SDL_BlendFillEllipse
         source colour key.
         source colour key.
     \endverbatim
     \endverbatim
  *  
  *  
- *  If either of the surfaces were in video memory, and the blit returns -2,
- *  the video memory was lost, so it should be reloaded with artwork and 
- *  re-blitted:
- *  @code
- *  while ( SDL_BlitSurface(image, imgrect, screen, dstrect) == -2 ) {
- *      while ( SDL_LockSurface(image) < 0 )
- *          Sleep(10);
- *      -- Write image pixels to image->pixels --
- *      SDL_UnlockSurface(image);
- *  }
- *  @endcode
- *  
- *  This happens under DirectX 5.0 when the system switches away from your
- *  fullscreen application.  The lock will also fail until you have access
- *  to the video memory again.
- *  
  *  You should call SDL_BlitSurface() unless you know exactly how SDL
  *  You should call SDL_BlitSurface() unless you know exactly how SDL
  *  blitting works internally and how to use the other blit functions.
  *  blitting works internally and how to use the other blit functions.
  */
  */
@@ -665,7 +442,7 @@ extern DECLSPEC int SDLCALL SDL_BlendFillEllipse
  *  rectangle validation and clipping before passing it to SDL_LowerBlit()
  *  rectangle validation and clipping before passing it to SDL_LowerBlit()
  */
  */
 extern DECLSPEC int SDLCALL SDL_UpperBlit
 extern DECLSPEC int SDLCALL SDL_UpperBlit
-    (SDL_Surface * src, SDL_Rect * srcrect,
+    (SDL_Surface * src, const SDL_Rect * srcrect,
      SDL_Surface * dst, SDL_Rect * dstrect);
      SDL_Surface * dst, SDL_Rect * dstrect);
 
 
 /**
 /**
@@ -687,6 +464,17 @@ extern DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface * src,
                                             SDL_Surface * dst,
                                             SDL_Surface * dst,
                                             const SDL_Rect * dstrect);
                                             const SDL_Rect * dstrect);
 
 
+/**
+ *  \brief Perform a fast, low quality, stretch blit between two surfaces of the
+ *         different pixel formats.
+ *  
+ *  \note This function calls SDL_SoftStretch or SDL_LowerBlit.
+ */
+extern DECLSPEC int SDLCALL SDL_BlitScaled
+    (SDL_Surface * src, const SDL_Rect * srcrect,
+    SDL_Surface * dst, const SDL_Rect * dstrect);
+
+
 /* Ends C function definitions when using C++ */
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 #ifdef __cplusplus
 /* *INDENT-OFF* */
 /* *INDENT-OFF* */

+ 32 - 7
extern/include/SDL/SDL_syswm.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -54,7 +54,7 @@ extern "C" {
 struct SDL_SysWMinfo;
 struct SDL_SysWMinfo;
 #else
 #else
 
 
-#if defined(SDL_VIDEO_DRIVER_WIN32)
+#if defined(SDL_VIDEO_DRIVER_WINDOWS)
 #define WIN32_LEAN_AND_MEAN
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 #include <windows.h>
 #endif
 #endif
@@ -77,7 +77,7 @@ struct SDL_SysWMinfo;
 #endif /* defined(SDL_VIDEO_DRIVER_X11) */
 #endif /* defined(SDL_VIDEO_DRIVER_X11) */
 
 
 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
 #if defined(SDL_VIDEO_DRIVER_DIRECTFB)
-#include <directfb/directfb.h>
+#include <directfb.h>
 #endif
 #endif
 
 
 #if defined(SDL_VIDEO_DRIVER_COCOA)
 #if defined(SDL_VIDEO_DRIVER_COCOA)
@@ -88,6 +88,14 @@ typedef struct _NSWindow NSWindow;
 #endif
 #endif
 #endif
 #endif
 
 
+#if defined(SDL_VIDEO_DRIVER_UIKIT)
+#ifdef __OBJC__
+#include <UIKit/UIKit.h>
+#else
+typedef struct _UIWindow UIWindow;
+#endif
+#endif
+
 /** 
 /** 
  *  These are the various supported windowing subsystems
  *  These are the various supported windowing subsystems
  */
  */
@@ -98,6 +106,7 @@ typedef enum
     SDL_SYSWM_X11,
     SDL_SYSWM_X11,
     SDL_SYSWM_DIRECTFB,
     SDL_SYSWM_DIRECTFB,
     SDL_SYSWM_COCOA,
     SDL_SYSWM_COCOA,
+    SDL_SYSWM_UIKIT,
 } SDL_SYSWM_TYPE;
 } SDL_SYSWM_TYPE;
 
 
 /**
 /**
@@ -109,7 +118,7 @@ struct SDL_SysWMmsg
     SDL_SYSWM_TYPE subsystem;
     SDL_SYSWM_TYPE subsystem;
     union
     union
     {
     {
-#if defined(SDL_VIDEO_DRIVER_WIN32)
+#if defined(SDL_VIDEO_DRIVER_WINDOWS)
         struct {
         struct {
             HWND hwnd;                  /**< The window for the message */
             HWND hwnd;                  /**< The window for the message */
             UINT msg;                   /**< The type of message */
             UINT msg;                   /**< The type of message */
@@ -133,7 +142,15 @@ struct SDL_SysWMmsg
             /* No Cocoa window events yet */
             /* No Cocoa window events yet */
         } cocoa;
         } cocoa;
 #endif
 #endif
-    } /*msg*/;
+#if defined(SDL_VIDEO_DRIVER_UIKIT)
+        struct
+        {
+            /* No UIKit window events yet */
+        } uikit;
+#endif
+        /* Can't have an empty union */
+        int dummy;
+    } msg;
 };
 };
 
 
 /**
 /**
@@ -148,7 +165,7 @@ struct SDL_SysWMinfo
     SDL_SYSWM_TYPE subsystem;
     SDL_SYSWM_TYPE subsystem;
     union
     union
     {
     {
-#if defined(SDL_VIDEO_DRIVER_WIN32)
+#if defined(SDL_VIDEO_DRIVER_WINDOWS)
         struct
         struct
         {
         {
             HWND window;                /**< The window handle */
             HWND window;                /**< The window handle */
@@ -175,7 +192,15 @@ struct SDL_SysWMinfo
             NSWindow *window;           /* The Cocoa window */
             NSWindow *window;           /* The Cocoa window */
         } cocoa;
         } cocoa;
 #endif
 #endif
-    } /*info*/;
+#if defined(SDL_VIDEO_DRIVER_UIKIT)
+        struct
+        {
+            UIWindow *window;           /* The UIKit window */
+        } uikit;
+#endif
+        /* Can't have an empty union */
+        int dummy;
+    } info;
 };
 };
 
 
 #endif /* SDL_PROTOTYPES_ONLY */
 #endif /* SDL_PROTOTYPES_ONLY */

+ 1 - 1
extern/include/SDL/SDL_thread.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 17 - 71
extern/include/SDL/SDL_timer.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -41,104 +41,50 @@ extern "C" {
 #endif
 #endif
 
 
 /**
 /**
- *  This is the OS scheduler timeslice, in milliseconds.
- */
-#define SDL_TIMESLICE		10
-
-/**
- *  This is the maximum resolution of the SDL timer on all platforms.
- */
-#define TIMER_RESOLUTION	10      /**< Experimentally determined */
-
-/**
- *  Get the number of milliseconds since the SDL library initialization.
+ * \brief Get the number of milliseconds since the SDL library initialization.
  *  
  *  
- *  Note that this value wraps if the program runs for more than ~49 days.
+ * \note This value wraps if the program runs for more than ~49 days.
  */
  */
 extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
 extern DECLSPEC Uint32 SDLCALL SDL_GetTicks(void);
 
 
 /**
 /**
- *  Wait a specified number of milliseconds before returning.
+ * \brief Wait a specified number of milliseconds before returning.
  */
  */
 extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
 extern DECLSPEC void SDLCALL SDL_Delay(Uint32 ms);
 
 
 /**
 /**
  *  Function prototype for the timer callback function.
  *  Function prototype for the timer callback function.
- */
-typedef Uint32(SDLCALL * SDL_TimerCallback) (Uint32 interval);
-
-/**
- *  Set a callback to run after the specified number of milliseconds has
- *  elapsed. The callback function is passed the current timer interval
- *  and returns the next timer interval.  If the returned value is the 
- *  same as the one passed in, the periodic alarm continues, otherwise a
- *  new alarm is scheduled.  If the callback returns 0, the periodic alarm
- *  is cancelled.
- *  
- *  To cancel a currently running timer, call 
- *  \code SDL_SetTimer(0, NULL); \endcode
- *  
- *  The timer callback function may run in a different thread than your
- *  main code, and so shouldn't call any functions from within itself.
- *  
- *  The maximum resolution of this timer is 10 ms, which means that if
- *  you request a 16 ms timer, your callback will run approximately 20 ms
- *  later on an unloaded system.  If you wanted to set a flag signaling
- *  a frame update at 30 frames per second (every 33 ms), you might set a 
- *  timer for 30 ms:
- *  \code
- *    SDL_SetTimer((33/10)*10, flag_update);
- *  \endcode
- *  
- *  If you use this function, you need to pass ::SDL_INIT_TIMER to SDL_Init().
- *  
- *  Under UNIX, you should not use raise or use SIGALRM and this function
- *  in the same program, as it is implemented using setitimer().  You also
- *  should not use this function in multi-threaded applications as signals
- *  to multi-threaded apps have undefined behavior in some implementations.
- *  
- *  \return 0 if successful, or -1 if there was an error.
- */
-extern DECLSPEC int SDLCALL SDL_SetTimer(Uint32 interval,
-                                         SDL_TimerCallback callback);
-
-/**
- *  \name Peter timers
- *  New timer API, supports multiple timers
- *  Written by Stephane Peter <[email protected]>
- */
-/*@{*/
-
-/**
- *  Function prototype for the new timer callback function.
  *  
  *  
  *  The callback function is passed the current timer interval and returns
  *  The callback function is passed the current timer interval and returns
  *  the next timer interval.  If the returned value is the same as the one
  *  the next timer interval.  If the returned value is the same as the one
  *  passed in, the periodic alarm continues, otherwise a new alarm is
  *  passed in, the periodic alarm continues, otherwise a new alarm is
  *  scheduled.  If the callback returns 0, the periodic alarm is cancelled.
  *  scheduled.  If the callback returns 0, the periodic alarm is cancelled.
  */
  */
-typedef Uint32(SDLCALL * SDL_NewTimerCallback) (Uint32 interval, void *param);
+typedef Uint32 (SDLCALL * SDL_TimerCallback) (Uint32 interval, void *param);
 
 
 /**
 /**
- *  Definition of the timer ID type.
+ * Definition of the timer ID type.
  */
  */
-typedef struct _SDL_TimerID *SDL_TimerID;
+typedef int SDL_TimerID;
 
 
 /**
 /**
- *  Add a new timer to the pool of timers already running.
- *  \return A timer ID, or NULL when an error occurs.
+ * \brief Add a new timer to the pool of timers already running.
+ *
+ * \return A timer ID, or NULL when an error occurs.
  */
  */
 extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
 extern DECLSPEC SDL_TimerID SDLCALL SDL_AddTimer(Uint32 interval,
-                                                 SDL_NewTimerCallback
-                                                 callback, void *param);
+                                                 SDL_TimerCallback callback,
+                                                 void *param);
 
 
 /**
 /**
- *  Remove one of the multiple timers knowing its ID.
- *  \return A boolean value indicating success or failure.
+ * \brief Remove a timer knowing its ID.
+ *
+ * \return A boolean value indicating success or failure.
+ *
+ * \warning It is not safe to remove a timer multiple times.
  */
  */
 extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
 extern DECLSPEC SDL_bool SDLCALL SDL_RemoveTimer(SDL_TimerID t);
 
 
-/*@}*//*Peter timers*/
 
 
 /* Ends C function definitions when using C++ */
 /* Ends C function definitions when using C++ */
 #ifdef __cplusplus
 #ifdef __cplusplus

+ 1 - 1
extern/include/SDL/SDL_touch.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 1 - 1
extern/include/SDL/SDL_types.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 1 - 2
extern/include/SDL/SDL_version.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -30,7 +30,6 @@
 #define _SDL_version_h
 #define _SDL_version_h
 
 
 #include "SDL_stdinc.h"
 #include "SDL_stdinc.h"
-#include "SDL_revision.h"
 
 
 #include "begin_code.h"
 #include "begin_code.h"
 /* Set up for C function definitions, even when using C++ */
 /* Set up for C function definitions, even when using C++ */

+ 92 - 793
extern/include/SDL/SDL_video.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public
@@ -113,12 +113,20 @@ typedef enum
 /**
 /**
  *  \brief Used to indicate that you don't care what the window position is.
  *  \brief Used to indicate that you don't care what the window position is.
  */
  */
-#define SDL_WINDOWPOS_UNDEFINED 0x7FFFFFF
+#define SDL_WINDOWPOS_UNDEFINED_MASK    0x1FFF0000
+#define SDL_WINDOWPOS_UNDEFINED_DISPLAY(X)  (SDL_WINDOWPOS_UNDEFINED_MASK|(X))
+#define SDL_WINDOWPOS_UNDEFINED         SDL_WINDOWPOS_UNDEFINED_DISPLAY(0)
+#define SDL_WINDOWPOS_ISUNDEFINED(X)    \
+            (((X)&0xFFFF0000) == SDL_WINDOWPOS_UNDEFINED_MASK)
 
 
 /**
 /**
  *  \brief Used to indicate that the window position should be centered.
  *  \brief Used to indicate that the window position should be centered.
  */
  */
-#define SDL_WINDOWPOS_CENTERED  0x7FFFFFE
+#define SDL_WINDOWPOS_CENTERED_MASK    0x2FFF0000
+#define SDL_WINDOWPOS_CENTERED_DISPLAY(X)  (SDL_WINDOWPOS_CENTERED_MASK|(X))
+#define SDL_WINDOWPOS_CENTERED         SDL_WINDOWPOS_CENTERED_DISPLAY(0)
+#define SDL_WINDOWPOS_ISCENTERED(X)    \
+            (((X)&0xFFFF0000) == SDL_WINDOWPOS_CENTERED_MASK)
 
 
 /**
 /**
  *  \brief Event subtype for window events
  *  \brief Event subtype for window events
@@ -132,7 +140,8 @@ typedef enum
                                          redrawn */
                                          redrawn */
     SDL_WINDOWEVENT_MOVED,          /**< Window has been moved to data1, data2 
     SDL_WINDOWEVENT_MOVED,          /**< Window has been moved to data1, data2 
                                      */
                                      */
-    SDL_WINDOWEVENT_RESIZED,        /**< Window size changed to data1xdata2 */
+    SDL_WINDOWEVENT_RESIZED,        /**< Window has been resized to data1xdata2 */
+    SDL_WINDOWEVENT_SIZE_CHANGED,   /**< The window size has changed, either as a result of an API call or through the system or user changing the window size. */
     SDL_WINDOWEVENT_MINIMIZED,      /**< Window has been minimized */
     SDL_WINDOWEVENT_MINIMIZED,      /**< Window has been minimized */
     SDL_WINDOWEVENT_MAXIMIZED,      /**< Window has been maximized */
     SDL_WINDOWEVENT_MAXIMIZED,      /**< Window has been maximized */
     SDL_WINDOWEVENT_RESTORED,       /**< Window has been restored to normal size
     SDL_WINDOWEVENT_RESTORED,       /**< Window has been restored to normal size
@@ -145,112 +154,6 @@ typedef enum
                                          window be closed */
                                          window be closed */
 } SDL_WindowEventID;
 } SDL_WindowEventID;
 
 
-/**
- *  \brief Flags used when creating a rendering context
- */
-typedef enum
-{
-    SDL_RENDERER_SINGLEBUFFER = 0x00000001,     /**< Render directly to the 
-                                                     window, if possible */
-    
-    SDL_RENDERER_PRESENTCOPY = 0x00000002,      /**< Present uses a copy from 
-                                                     back buffer to the front 
-                                                     buffer */
-    
-    SDL_RENDERER_PRESENTFLIP2 = 0x00000004,     /**< Present uses a flip, 
-                                                     swapping back buffer and 
-                                                     front buffer */
-    
-    SDL_RENDERER_PRESENTFLIP3 = 0x00000008,     /**< Present uses a flip, 
-                                                     rotating between two back 
-                                                     buffers and a front buffer
-                                                 */
-    
-    SDL_RENDERER_PRESENTDISCARD = 0x00000010,   /**< Present leaves the contents
-                                                     of the backbuffer undefined
-                                                 */
-    
-    SDL_RENDERER_PRESENTVSYNC = 0x00000020,     /**< Present is synchronized 
-                                                     with the refresh rate */
-    
-    SDL_RENDERER_ACCELERATED = 0x00000040       /**< The renderer uses hardware 
-                                                     acceleration */
-    
-    } SDL_RendererFlags;
-
-/**
- *  \brief Information on the capabilities of a render driver or context.
- */
-typedef struct SDL_RendererInfo
-{
-    const char *name;           /**< The name of the renderer */
-    Uint32 flags;               /**< Supported ::SDL_RendererFlags */
-    Uint32 mod_modes;           /**< A mask of supported channel modulation */
-    Uint32 blend_modes;         /**< A mask of supported blend modes */
-    Uint32 scale_modes;         /**< A mask of supported scale modes */
-    Uint32 num_texture_formats; /**< The number of available texture formats */
-    Uint32 texture_formats[50]; /**< The available texture formats */
-    int max_texture_width;      /**< The maximimum texture width */
-    int max_texture_height;     /**< The maximimum texture height */
-} SDL_RendererInfo;
-
-/**
- *  \brief The access pattern allowed for a texture.
- */
-typedef enum
-{
-    SDL_TEXTUREACCESS_STATIC,    /**< Changes rarely, not lockable */
-    SDL_TEXTUREACCESS_STREAMING  /**< Changes frequently, lockable */
-} SDL_TextureAccess;
-
-/**
- *  \brief The texture channel modulation used in SDL_RenderCopy().
- */
-typedef enum
-{
-    SDL_TEXTUREMODULATE_NONE = 0x00000000,     /**< No modulation */
-    SDL_TEXTUREMODULATE_COLOR = 0x00000001,    /**< srcC = srcC * color */
-    SDL_TEXTUREMODULATE_ALPHA = 0x00000002     /**< srcA = srcA * alpha */
-} SDL_TextureModulate;
-
-/**
- *  \brief The blend mode used in SDL_RenderCopy() and drawing operations.
- */
-typedef enum
-{
-    SDL_BLENDMODE_NONE = 0x00000000,     /**< No blending */
-    SDL_BLENDMODE_MASK = 0x00000001,     /**< dst = A ? src : dst 
-                                              (alpha is mask) */
-    
-    SDL_BLENDMODE_BLEND = 0x00000002,    /**< dst = (src * A) + (dst * (1-A)) */
-    SDL_BLENDMODE_ADD = 0x00000004,      /**< dst = (src * A) + dst */
-    SDL_BLENDMODE_MOD = 0x00000008       /**< dst = src * dst */
-} SDL_BlendMode;
-
-/**
- *  \brief The texture scale mode used in SDL_RenderCopy().
- */
-typedef enum
-{
-    SDL_TEXTURESCALEMODE_NONE = 0x00000000,     /**< No scaling, rectangles must
-                                                     match dimensions */
-    
-    SDL_TEXTURESCALEMODE_FAST = 0x00000001,     /**< Point sampling or 
-                                                     equivalent algorithm */
-    
-    SDL_TEXTURESCALEMODE_SLOW = 0x00000002,     /**< Linear filtering or 
-                                                     equivalent algorithm */
-    
-    SDL_TEXTURESCALEMODE_BEST = 0x00000004      /**< Bicubic filtering or 
-                                                     equivalent algorithm */
-} SDL_TextureScaleMode;
-
-/**
- *  \brief An efficient driver-specific representation of pixel data
- */
-struct SDL_Texture;
-typedef struct SDL_Texture SDL_Texture;
-
 /**
 /**
  *  \brief An opaque handle to an OpenGL context.
  *  \brief An opaque handle to an OpenGL context.
  */
  */
@@ -308,8 +211,6 @@ extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
  *  \param driver_name Initialize a specific driver by name, or NULL for the 
  *  \param driver_name Initialize a specific driver by name, or NULL for the 
  *                     default video driver.
  *                     default video driver.
  *  
  *  
- *  \param flags FIXME: Still needed?
- *  
  *  \return 0 on success, -1 on error
  *  \return 0 on success, -1 on error
  *  
  *  
  *  This function initializes the video subsystem; setting up a connection
  *  This function initializes the video subsystem; setting up a connection
@@ -318,8 +219,7 @@ extern DECLSPEC const char *SDLCALL SDL_GetVideoDriver(int index);
  *  
  *  
  *  \sa SDL_VideoQuit()
  *  \sa SDL_VideoQuit()
  */
  */
-extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name,
-                                          Uint32 flags);
+extern DECLSPEC int SDLCALL SDL_VideoInit(const char *driver_name);
 
 
 /**
 /**
  *  \brief Shuts down the video subsystem.
  *  \brief Shuts down the video subsystem.
@@ -345,7 +245,6 @@ extern DECLSPEC const char *SDLCALL SDL_GetCurrentVideoDriver(void);
  *  \brief Returns the number of available video displays.
  *  \brief Returns the number of available video displays.
  *  
  *  
  *  \sa SDL_GetDisplayBounds()
  *  \sa SDL_GetDisplayBounds()
- *  \sa SDL_SelectVideoDisplay()
  */
  */
 extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
 extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
 
 
@@ -357,34 +256,14 @@ extern DECLSPEC int SDLCALL SDL_GetNumVideoDisplays(void);
  *  
  *  
  *  \sa SDL_GetNumVideoDisplays()
  *  \sa SDL_GetNumVideoDisplays()
  */
  */
-extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int index, SDL_Rect * rect);
-
-/**
- *  \brief Set the index of the currently selected display.
- *  
- *  \return 0 on success, or -1 if the index is out of range.
- *  
- *  \sa SDL_GetNumVideoDisplays()
- *  \sa SDL_GetCurrentVideoDisplay()
- */
-extern DECLSPEC int SDLCALL SDL_SelectVideoDisplay(int index);
-
-/**
- *  \brief Get the index of the currently selected display.
- *  
- *  \return The index of the currently selected display.
- *  
- *  \sa SDL_GetNumVideoDisplays()
- *  \sa SDL_SelectVideoDisplay()
- */
-extern DECLSPEC int SDLCALL SDL_GetCurrentVideoDisplay(void);
+extern DECLSPEC int SDLCALL SDL_GetDisplayBounds(int displayIndex, SDL_Rect * rect);
 
 
 /**
 /**
- *  \brief Returns the number of available display modes for the current display.
+ *  \brief Returns the number of available display modes.
  *  
  *  
  *  \sa SDL_GetDisplayMode()
  *  \sa SDL_GetDisplayMode()
  */
  */
-extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(void);
+extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(int displayIndex);
 
 
 /**
 /**
  *  \brief Fill in information about a specific display mode.
  *  \brief Fill in information about a specific display mode.
@@ -397,19 +276,18 @@ extern DECLSPEC int SDLCALL SDL_GetNumDisplayModes(void);
  *  
  *  
  *  \sa SDL_GetNumDisplayModes()
  *  \sa SDL_GetNumDisplayModes()
  */
  */
-extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int index,
+extern DECLSPEC int SDLCALL SDL_GetDisplayMode(int displayIndex, int modeIndex,
                                                SDL_DisplayMode * mode);
                                                SDL_DisplayMode * mode);
 
 
 /**
 /**
- *  \brief Fill in information about the desktop display mode for the current 
- *         display.
+ *  \brief Fill in information about the desktop display mode.
  */
  */
-extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(SDL_DisplayMode * mode);
+extern DECLSPEC int SDLCALL SDL_GetDesktopDisplayMode(int displayIndex, SDL_DisplayMode * mode);
 
 
 /**
 /**
  *  \brief Fill in information about the current display mode.
  *  \brief Fill in information about the current display mode.
  */
  */
-extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayMode * mode);
+extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(int displayIndex, SDL_DisplayMode * mode);
 
 
 
 
 /**
 /**
@@ -432,16 +310,21 @@ extern DECLSPEC int SDLCALL SDL_GetCurrentDisplayMode(SDL_DisplayMode * mode);
  *  \sa SDL_GetNumDisplayModes()
  *  \sa SDL_GetNumDisplayModes()
  *  \sa SDL_GetDisplayMode()
  *  \sa SDL_GetDisplayMode()
  */
  */
-extern DECLSPEC SDL_DisplayMode *SDLCALL SDL_GetClosestDisplayMode(const
-                                                                   SDL_DisplayMode
-                                                                   * mode,
-                                                                   SDL_DisplayMode
-                                                                   * closest);
+extern DECLSPEC SDL_DisplayMode * SDLCALL SDL_GetClosestDisplayMode(int displayIndex, const SDL_DisplayMode * mode, SDL_DisplayMode * closest);
+
+/**
+ *  \brief Get the display index associated with a window.
+ *  
+ *  \return the display index of the display containing the center of the
+ *          window, or -1 on error.
+ */
+extern DECLSPEC int SDLCALL SDL_GetWindowDisplay(SDL_Window * window);
 
 
 /**
 /**
- *  \brief Set the display mode used when a fullscreen window is visible
- *         on the currently selected display.  By default the window's
- *         dimensions and the desktop format and refresh rate are used.
+ *  \brief Set the display mode used when a fullscreen window is visible.
+ *
+ *  By default the window's dimensions and the desktop format and refresh rate
+ *  are used.
  *  
  *  
  *  \param mode The mode to use, or NULL for the default mode.
  *  \param mode The mode to use, or NULL for the default mode.
  *  
  *  
@@ -456,7 +339,7 @@ extern DECLSPEC int SDLCALL SDL_SetWindowDisplayMode(SDL_Window * window,
 
 
 /**
 /**
  *  \brief Fill in information about the display mode used when a fullscreen
  *  \brief Fill in information about the display mode used when a fullscreen
- *         window is visible on the currently selected display.
+ *         window is visible.
  *
  *
  *  \sa SDL_SetWindowDisplayMode()
  *  \sa SDL_SetWindowDisplayMode()
  *  \sa SDL_SetWindowFullscreen()
  *  \sa SDL_SetWindowFullscreen()
@@ -465,72 +348,9 @@ extern DECLSPEC int SDLCALL SDL_GetWindowDisplayMode(SDL_Window * window,
                                                      SDL_DisplayMode * mode);
                                                      SDL_DisplayMode * mode);
 
 
 /**
 /**
- *  \brief Set the palette entries for indexed display modes.
- *  
- *  \return 0 on success, or -1 if the display mode isn't palettized or the 
- *          colors couldn't be set.
- */
-extern DECLSPEC int SDLCALL SDL_SetDisplayPalette(const SDL_Color * colors,
-                                                  int firstcolor,
-                                                  int ncolors);
-
-/**
- *  \brief Gets the palette entries for indexed display modes.
- *  
- *  \return 0 on success, or -1 if the display mode isn't palettized
- */
-extern DECLSPEC int SDLCALL SDL_GetDisplayPalette(SDL_Color * colors,
-                                                  int firstcolor,
-                                                  int ncolors);
-
-/**
- *  \brief Set the gamma correction for each of the color channels on the 
- *         currently selected display.
- *  
- *  \return 0 on success, or -1 if setting the gamma isn't supported.
- *  
- *  \sa SDL_SetGammaRamp()
- */
-extern DECLSPEC int SDLCALL SDL_SetGamma(float red, float green, float blue);
-
-/**
- *  \brief Set the gamma ramp for the currently selected display.
- *  
- *  \param red The translation table for the red channel, or NULL.
- *  \param green The translation table for the green channel, or NULL.
- *  \param blue The translation table for the blue channel, or NULL.
- *  
- *  \return 0 on success, or -1 if gamma ramps are unsupported.
- *  
- *  Set the gamma translation table for the red, green, and blue channels
- *  of the video hardware.  Each table is an array of 256 16-bit quantities,
- *  representing a mapping between the input and output for that channel.
- *  The input is the index into the array, and the output is the 16-bit
- *  gamma value at that index, scaled to the output color precision.
- *  
- *  \sa SDL_GetGammaRamp()
- */
-extern DECLSPEC int SDLCALL SDL_SetGammaRamp(const Uint16 * red,
-                                             const Uint16 * green,
-                                             const Uint16 * blue);
-
-/**
- *  \brief Get the gamma ramp for the currently selected display.
- *  
- *  \param red   A pointer to a 256 element array of 16-bit quantities to hold 
- *               the translation table for the red channel, or NULL.
- *  \param green A pointer to a 256 element array of 16-bit quantities to hold 
- *               the translation table for the green channel, or NULL.
- *  \param blue  A pointer to a 256 element array of 16-bit quantities to hold 
- *               the translation table for the blue channel, or NULL.
- *   
- *  \return 0 on success, or -1 if gamma ramps are unsupported.
- *  
- *  \sa SDL_SetGammaRamp()
+ *  \brief Get the pixel format associated with the window.
  */
  */
-extern DECLSPEC int SDLCALL SDL_GetGammaRamp(Uint16 * red, Uint16 * green,
-                                             Uint16 * blue);
-
+extern DECLSPEC Uint32 SDLCALL SDL_GetWindowPixelFormat(SDL_Window * window);
 
 
 /**
 /**
  *  \brief Create a window with the specified position, dimensions, and flags.
  *  \brief Create a window with the specified position, dimensions, and flags.
@@ -606,24 +426,39 @@ extern DECLSPEC void SDLCALL SDL_SetWindowIcon(SDL_Window * window,
                                                SDL_Surface * icon);
                                                SDL_Surface * icon);
 
 
 /**
 /**
- *  \brief Associate an arbitrary pointer with a window.
+ *  \brief Associate an arbitrary named pointer with a window.
  *  
  *  
+ *  \param window   The window to associate with the pointer.
+ *  \param name     The name of the pointer.
+ *  \param userdata The associated pointer.
+ *
+ *  \return The previous value associated with 'name'
+ *
+ *  \note The name is case-sensitive.
+ *
  *  \sa SDL_GetWindowData()
  *  \sa SDL_GetWindowData()
  */
  */
-extern DECLSPEC void SDLCALL SDL_SetWindowData(SDL_Window * window,
-                                               void *userdata);
+extern DECLSPEC void* SDLCALL SDL_SetWindowData(SDL_Window * window,
+                                                const char *name,
+                                                void *userdata);
 
 
 /**
 /**
  *  \brief Retrieve the data pointer associated with a window.
  *  \brief Retrieve the data pointer associated with a window.
  *  
  *  
+ *  \param window   The window to query.
+ *  \param name     The name of the pointer.
+ *
+ *  \return The value associated with 'name'
+ *  
  *  \sa SDL_SetWindowData()
  *  \sa SDL_SetWindowData()
  */
  */
-extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window);
+extern DECLSPEC void *SDLCALL SDL_GetWindowData(SDL_Window * window,
+                                                const char *name);
 
 
 /**
 /**
  *  \brief Set the position of a window.
  *  \brief Set the position of a window.
  *  
  *  
- *  \param window The window to reposition.
+ *  \param window   The window to reposition.
  *  \param x        The x coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
  *  \param x        The x coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
                     ::SDL_WINDOWPOS_UNDEFINED.
                     ::SDL_WINDOWPOS_UNDEFINED.
  *  \param y        The y coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
  *  \param y        The y coordinate of the window, ::SDL_WINDOWPOS_CENTERED, or
@@ -713,7 +548,41 @@ extern DECLSPEC void SDLCALL SDL_RestoreWindow(SDL_Window * window);
  *  \sa SDL_GetWindowDisplayMode()
  *  \sa SDL_GetWindowDisplayMode()
  */
  */
 extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window,
 extern DECLSPEC int SDLCALL SDL_SetWindowFullscreen(SDL_Window * window,
-                                                    int fullscreen);
+                                                    SDL_bool fullscreen);
+
+/**
+ *  \brief Get an SDL surface associated with the window.
+ *
+ *  \return A surface in the optimal format for the window, or NULL on error.
+ *
+ *  \note You may not combine this with 3D or the rendering API on this window.
+ *
+ *  \sa SDL_UpdateWindowSurface()
+ *  \sa SDL_UpdateWindowSurfaceRects()
+ */
+extern DECLSPEC SDL_Surface * SDLCALL SDL_GetWindowSurface(SDL_Window * window);
+
+/**
+ *  \brief Copy the window surface to the screen.
+ *
+ *  \return 0 on success, or -1 on error.
+ *
+ *  \sa SDL_GetWindowSurface()
+ *  \sa SDL_UpdateWindowSurfaceRects()
+ */
+extern DECLSPEC int SDLCALL SDL_UpdateWindowSurface(SDL_Window * window);
+
+/**
+ *  \brief Copy a number of rectangles on the window surface to the screen.
+ *
+ *  \return 0 on success, or -1 on error.
+ *
+ *  \sa SDL_GetWindowSurface()
+ *  \sa SDL_UpdateWindowSurfaceRect()
+ */
+extern DECLSPEC int SDLCALL SDL_UpdateWindowSurfaceRects(SDL_Window * window,
+                                                         SDL_Rect * rects,
+                                                         int numrects);
 
 
 /**
 /**
  *  \brief Set a window's input grab mode.
  *  \brief Set a window's input grab mode.
@@ -734,581 +603,11 @@ extern DECLSPEC void SDLCALL SDL_SetWindowGrab(SDL_Window * window,
  */
  */
 extern DECLSPEC int SDLCALL SDL_GetWindowGrab(SDL_Window * window);
 extern DECLSPEC int SDLCALL SDL_GetWindowGrab(SDL_Window * window);
 
 
-/**
- *  \brief Get driver specific information about a window.
- *  
- *  \note Include SDL_syswm.h for the declaration of SDL_SysWMinfo.
- */
-struct SDL_SysWMinfo;
-extern DECLSPEC SDL_bool SDLCALL SDL_GetWindowWMInfo(SDL_Window * window,
-                                                     struct SDL_SysWMinfo
-                                                     *info);
-
 /**
 /**
  *  \brief Destroy a window.
  *  \brief Destroy a window.
  */
  */
 extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window);
 extern DECLSPEC void SDLCALL SDL_DestroyWindow(SDL_Window * window);
 
 
-/**
- *  \brief Get the number of 2D rendering drivers available for the current 
- *         display.
- *  
- *  A render driver is a set of code that handles rendering and texture
- *  management on a particular display.  Normally there is only one, but
- *  some drivers may have several available with different capabilities.
- *  
- *  \sa SDL_GetRenderDriverInfo()
- *  \sa SDL_CreateRenderer()
- */
-extern DECLSPEC int SDLCALL SDL_GetNumRenderDrivers(void);
-
-/**
- *  \brief Get information about a specific 2D rendering driver for the current 
- *         display.
- *  
- *  \param index The index of the driver to query information about.
- *  \param info  A pointer to an SDL_RendererInfo struct to be filled with 
- *               information on the rendering driver.
- *  
- *  \return 0 on success, -1 if the index was out of range.
- *  
- *  \sa SDL_CreateRenderer()
- */
-extern DECLSPEC int SDLCALL SDL_GetRenderDriverInfo(int index,
-                                                    SDL_RendererInfo * info);
-
-/**
- *  \brief Create and make active a 2D rendering context for a window.
- *  
- *  \param window The window where rendering is displayed.
- *  \param index    The index of the rendering driver to initialize, or -1 to 
- *                  initialize the first one supporting the requested flags.
- *  \param flags    ::SDL_RendererFlags.
- *  
- *  \return 0 on success, -1 if there was an error creating the renderer.
- *  
- *  \sa SDL_SelectRenderer()
- *  \sa SDL_GetRendererInfo()
- *  \sa SDL_DestroyRenderer()
- */
-extern DECLSPEC int SDLCALL SDL_CreateRenderer(SDL_Window * window,
-                                               int index, Uint32 flags);
-
-/**
- *  \brief Select the rendering context for a particular window.
- *  
- *  \return 0 on success, -1 if the selected window doesn't have a
- *          rendering context.
- */
-extern DECLSPEC int SDLCALL SDL_SelectRenderer(SDL_Window * window);
-
-/**
- *  \brief Get information about the current rendering context.
- */
-extern DECLSPEC int SDLCALL SDL_GetRendererInfo(SDL_RendererInfo * info);
-
-/**
- *  \brief Create a texture for the current rendering context.
- *  
- *  \param format The format of the texture.
- *  \param access One of the enumerated values in ::SDL_TextureAccess.
- *  \param w      The width of the texture in pixels.
- *  \param h      The height of the texture in pixels.
- *  
- *  \return The created texture is returned, or 0 if no rendering context was 
- *          active,  the format was unsupported, or the width or height were out
- *          of range.
- *  
- *  \sa SDL_QueryTexture()
- *  \sa SDL_DestroyTexture()
- */
-extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTexture(Uint32 format,
-                                                        int access, int w,
-                                                        int h);
-
-/**
- *  \brief Create a texture from an existing surface.
- *  
- *  \param format The format of the texture, or 0 to pick an appropriate format.
- *  \param surface The surface containing pixel data used to fill the texture.
- *  
- *  \return The created texture is returned, or 0 if no rendering context was 
- *          active,  the format was unsupported, or the surface width or height 
- *          were out of range.
- *  
- *  \note The surface is not modified or freed by this function.
- *  
- *  \sa SDL_QueryTexture()
- *  \sa SDL_DestroyTexture()
- */
-extern DECLSPEC SDL_Texture * SDLCALL SDL_CreateTextureFromSurface(Uint32
-                                                                   format,
-                                                                   SDL_Surface
-                                                                   * surface);
-
-/**
- *  \brief Query the attributes of a texture
- *  
- *  \param texture A texture to be queried.
- *  \param format  A pointer filled in with the raw format of the texture.  The 
- *                 actual format may differ, but pixel transfers will use this 
- *                 format.
- *  \param access  A pointer filled in with the actual access to the texture.
- *  \param w       A pointer filled in with the width of the texture in pixels.
- *  \param h       A pointer filled in with the height of the texture in pixels.
- *  
- *  \return 0 on success, or -1 if the texture is not valid.
- */
-extern DECLSPEC int SDLCALL SDL_QueryTexture(SDL_Texture * texture,
-                                             Uint32 * format, int *access,
-                                             int *w, int *h);
-
-/**
- *  \brief Query the pixels of a texture, if the texture does not need to be 
- *         locked for pixel access.
- *  
- *  \param texture A texture to be queried, which was created with 
- *                   ::SDL_TEXTUREACCESS_STREAMING.
- *  \param pixels    A pointer filled with a pointer to the pixels for the 
- *                   texture.
- *  \param pitch     A pointer filled in with the pitch of the pixel data.
- *  
- *  \return 0 on success, or -1 if the texture is not valid, or must be locked 
- *          for pixel access.
- */
-extern DECLSPEC int SDLCALL SDL_QueryTexturePixels(SDL_Texture * texture,
-                                                   void **pixels, int *pitch);
-
-/**
- *  \brief Set the color palette of an indexed texture.
- *  
- *  \param texture  The texture to update.
- *  \param colors     The array of RGB color data.
- *  \param firstcolor The first index to update.
- *  \param ncolors    The number of palette entries to fill with the color data.
- *  
- *  \return 0 on success, or -1 if the texture is not valid or not an indexed 
- *          texture.
- */
-extern DECLSPEC int SDLCALL SDL_SetTexturePalette(SDL_Texture * texture,
-                                                  const SDL_Color * colors,
-                                                  int firstcolor,
-                                                  int ncolors);
-
-/**
- *  \brief Get the color palette from an indexed texture if it has one.
- *  
- *  \param texture  The texture to update.
- *  \param colors     The array to fill with RGB color data.
- *  \param firstcolor The first index to retrieve.
- *  \param ncolors    The number of palette entries to retrieve.
- *  
- *  \return 0 on success, or -1 if the texture is not valid or not an indexed 
- *          texture.
- */
-extern DECLSPEC int SDLCALL SDL_GetTexturePalette(SDL_Texture * texture,
-                                                  SDL_Color * colors,
-                                                  int firstcolor,
-                                                  int ncolors);
-
-/**
- *  \brief Set an additional color value used in render copy operations.
- *  
- *  \param texture The texture to update.
- *  \param r       The red source color value multiplied into copy operations.
- *  \param g       The green source color value multiplied into copy operations.
- *  \param b       The blue source color value multiplied into copy operations.
- *  
- *  \return 0 on success, or -1 if the texture is not valid or color modulation 
- *          is not supported.
- *  
- *  \sa SDL_GetTextureColorMod()
- */
-extern DECLSPEC int SDLCALL SDL_SetTextureColorMod(SDL_Texture * texture,
-                                                   Uint8 r, Uint8 g, Uint8 b);
-
-
-/**
- *  \brief Get the additional color value used in render copy operations.
- *  
- *  \param texture The texture to query.
- *  \param r         A pointer filled in with the source red color value.
- *  \param g         A pointer filled in with the source green color value.
- *  \param b         A pointer filled in with the source blue color value.
- *  
- *  \return 0 on success, or -1 if the texture is not valid.
- *  
- *  \sa SDL_SetTextureColorMod()
- */
-extern DECLSPEC int SDLCALL SDL_GetTextureColorMod(SDL_Texture * texture,
-                                                   Uint8 * r, Uint8 * g,
-                                                   Uint8 * b);
-
-/**
- *  \brief Set an additional alpha value used in render copy operations.
- *  
- *  \param texture The texture to update.
- *  \param alpha     The source alpha value multiplied into copy operations.
- *  
- *  \return 0 on success, or -1 if the texture is not valid or alpha modulation 
- *          is not supported.
- *  
- *  \sa SDL_GetTextureAlphaMod()
- */
-extern DECLSPEC int SDLCALL SDL_SetTextureAlphaMod(SDL_Texture * texture,
-                                                   Uint8 alpha);
-
-/**
- *  \brief Get the additional alpha value used in render copy operations.
- *  
- *  \param texture The texture to query.
- *  \param alpha     A pointer filled in with the source alpha value.
- *  
- *  \return 0 on success, or -1 if the texture is not valid.
- *  
- *  \sa SDL_SetTextureAlphaMod()
- */
-extern DECLSPEC int SDLCALL SDL_GetTextureAlphaMod(SDL_Texture * texture,
-                                                   Uint8 * alpha);
-
-/**
- *  \brief Set the blend mode used for texture copy operations.
- *  
- *  \param texture The texture to update.
- *  \param blendMode ::SDL_BlendMode to use for texture blending.
- *  
- *  \return 0 on success, or -1 if the texture is not valid or the blend mode is
- *          not supported.
- *  
- *  \note If the blend mode is not supported, the closest supported mode is
- *        chosen.
- *  
- *  \sa SDL_GetTextureBlendMode()
- */
-extern DECLSPEC int SDLCALL SDL_SetTextureBlendMode(SDL_Texture * texture,
-                                                    int blendMode);
-
-/**
- *  \brief Get the blend mode used for texture copy operations.
- *  
- *  \param texture The texture to query.
- *  \param blendMode A pointer filled in with the current blend mode.
- *  
- *  \return 0 on success, or -1 if the texture is not valid.
- *  
- *  \sa SDL_SetTextureBlendMode()
- */
-extern DECLSPEC int SDLCALL SDL_GetTextureBlendMode(SDL_Texture * texture,
-                                                    int *blendMode);
-
-/**
- *  \brief Set the scale mode used for texture copy operations.
- *  
- *  \param texture The texture to update.
- *  \param scaleMode ::SDL_TextureScaleMode to use for texture scaling.
- *  
- *  \return 0 on success, or -1 if the texture is not valid or the scale mode is
- *          not supported.
- *  
- *  \note If the scale mode is not supported, the closest supported mode is
- *        chosen.
- *  
- *  \sa SDL_GetTextureScaleMode()
- */
-extern DECLSPEC int SDLCALL SDL_SetTextureScaleMode(SDL_Texture * texture,
-                                                    int scaleMode);
-
-/**
- *  \brief Get the scale mode used for texture copy operations.
- *  
- *  \param texture The texture to query.
- *  \param scaleMode A pointer filled in with the current scale mode.
- *  
- *  \return 0 on success, or -1 if the texture is not valid.
- *  
- *  \sa SDL_SetTextureScaleMode()
- */
-extern DECLSPEC int SDLCALL SDL_GetTextureScaleMode(SDL_Texture * texture,
-                                                    int *scaleMode);
-
-/**
- *  \brief Update the given texture rectangle with new pixel data.
- *  
- *  \param texture The texture to update
- *  \param rect      A pointer to the rectangle of pixels to update, or NULL to 
- *                   update the entire texture.
- *  \param pixels    The raw pixel data.
- *  \param pitch     The number of bytes between rows of pixel data.
- *  
- *  \return 0 on success, or -1 if the texture is not valid.
- *  
- *  \note This is a fairly slow function.
- */
-extern DECLSPEC int SDLCALL SDL_UpdateTexture(SDL_Texture * texture,
-                                              const SDL_Rect * rect,
-                                              const void *pixels, int pitch);
-
-/**
- *  \brief Lock a portion of the texture for pixel access.
- *  
- *  \param texture The texture to lock for access, which was created with 
- *                   ::SDL_TEXTUREACCESS_STREAMING.
- *  \param rect      A pointer to the rectangle to lock for access. If the rect 
- *                   is NULL, the entire texture will be locked.
- *  \param markDirty If this is nonzero, the locked area will be marked dirty 
- *                   when the texture is unlocked.
- *  \param pixels    This is filled in with a pointer to the locked pixels, 
- *                   appropriately offset by the locked area.
- *  \param pitch     This is filled in with the pitch of the locked pixels.
- *  
- *  \return 0 on success, or -1 if the texture is not valid or was created with 
- *          ::SDL_TEXTUREACCESS_STATIC.
- *  
- *  \sa SDL_DirtyTexture()
- *  \sa SDL_UnlockTexture()
- */
-extern DECLSPEC int SDLCALL SDL_LockTexture(SDL_Texture * texture,
-                                            const SDL_Rect * rect,
-                                            int markDirty, void **pixels,
-                                            int *pitch);
-
-/**
- *  \brief Unlock a texture, uploading the changes to video memory, if needed.
- *  
- *  \sa SDL_LockTexture()
- *  \sa SDL_DirtyTexture()
- */
-extern DECLSPEC void SDLCALL SDL_UnlockTexture(SDL_Texture * texture);
-
-/**
- *  \brief Mark the specified rectangles of the texture as dirty.
- *  
- *  \param texture The texture to mark dirty, which was created with 
- *                   ::SDL_TEXTUREACCESS_STREAMING.
- *  \param numrects  The number of rectangles pointed to by rects.
- *  \param rects     The pointer to an array of dirty rectangles.
- *  
- *  \sa SDL_LockTexture()
- *  \sa SDL_UnlockTexture()
- */
-extern DECLSPEC void SDLCALL SDL_DirtyTexture(SDL_Texture * texture,
-                                              int numrects,
-                                              const SDL_Rect * rects);
-
-/**
- *  \brief Set the color used for drawing operations (Fill and Line).
- *  
- *  \param r The red value used to draw on the rendering target.
- *  \param g The green value used to draw on the rendering target.
- *  \param b The blue value used to draw on the rendering target.
- *  \param a The alpha value used to draw on the rendering target, usually 
- *           ::SDL_ALPHA_OPAQUE (255).
- *  
- *  \return 0 on success, or -1 if there is no rendering context current.
- */
-extern DECLSPEC int SDL_SetRenderDrawColor(Uint8 r, Uint8 g, Uint8 b,
-                                           Uint8 a);
-
-/**
- *  \brief Get the color used for drawing operations (Fill and Line).
- *  
- *  \param r A pointer to the red value used to draw on the rendering target.
- *  \param g A pointer to the green value used to draw on the rendering target.
- *  \param b A pointer to the blue value used to draw on the rendering target.
- *  \param a A pointer to the alpha value used to draw on the rendering target, 
- *           usually ::SDL_ALPHA_OPAQUE (255).
- *  
- *  \return 0 on success, or -1 if there is no rendering context current.
- */
-extern DECLSPEC int SDL_GetRenderDrawColor(Uint8 * r, Uint8 * g, Uint8 * b,
-                                           Uint8 * a);
-
-/**
- *  \brief Set the blend mode used for drawing operations (Fill and Line).
- *  
- *  \param blendMode ::SDL_BlendMode to use for blending.
- *  
- *  \return 0 on success, or -1 if there is no rendering context current.
- *  
- *  \note If the blend mode is not supported, the closest supported mode is 
- *        chosen.
- *  
- *  \sa SDL_GetRenderDrawBlendMode()
- */
-extern DECLSPEC int SDLCALL SDL_SetRenderDrawBlendMode(int blendMode);
-
-/**
- *  \brief Get the blend mode used for drawing operations.
- *  
- *  \param blendMode A pointer filled in with the current blend mode.
- *  
- *  \return 0 on success, or -1 if there is no rendering context current.
- *  
- *  \sa SDL_SetRenderDrawBlendMode()
- */
-extern DECLSPEC int SDLCALL SDL_GetRenderDrawBlendMode(int *blendMode);
-
-/**
- *  \brief Clear the current rendering target with the drawing color
- */
-extern DECLSPEC int SDLCALL SDL_RenderClear(void);
-
-/**
- *  \brief Draw a point on the current rendering target.
- *  
- *  \param x The x coordinate of the point.
- *  \param y The y coordinate of the point.
- *  
- *  \return 0 on success, or -1 if there is no rendering context current.
- */
-extern DECLSPEC int SDLCALL SDL_RenderDrawPoint(int x, int y);
-
-/**
- *  \brief Draw multiple points on the current rendering target.
- *  
- *  \param points The points to draw
- *  \param count The number of points to draw
- *  
- *  \return 0 on success, or -1 if there is no rendering context current.
- */
-extern DECLSPEC int SDLCALL SDL_RenderDrawPoints(const SDL_Point * points,
-                                                 int count);
-
-/**
- *  \brief Draw a line on the current rendering target.
- *  
- *  \param x1 The x coordinate of the start point.
- *  \param y1 The y coordinate of the start point.
- *  \param x2 The x coordinate of the end point.
- *  \param y2 The y coordinate of the end point.
- *  
- *  \return 0 on success, or -1 if there is no rendering context current.
- */
-extern DECLSPEC int SDLCALL SDL_RenderDrawLine(int x1, int y1, int x2, int y2);
-
-/**
- *  \brief Draw a series of connected lines on the current rendering target.
- *  
- *  \param points The points along the lines
- *  \param count The number of points, drawing count-1 lines
- *  
- *  \return 0 on success, or -1 if there is no rendering context current.
- */
-extern DECLSPEC int SDLCALL SDL_RenderDrawLines(const SDL_Point * points,
-                                                int count);
-
-/**
- *  \brief Draw a rectangle on the current rendering target.
- *  
- *  \param rect A pointer to the destination rectangle, or NULL to outline the entire rendering target.
- *  
- *  \return 0 on success, or -1 if there is no rendering context current.
- */
-extern DECLSPEC int SDLCALL SDL_RenderDrawRect(const SDL_Rect * rect);
-
-/**
- *  \brief Draw some number of rectangles on the current rendering target.
- *  
- *  \param rects A pointer to an array of destination rectangles.
- *  \param count The number of rectangles.
- *  
- *  \return 0 on success, or -1 if there is no rendering context current.
- */
-extern DECLSPEC int SDLCALL SDL_RenderDrawRects(const SDL_Rect ** rects, int count);
-
-/**
- *  \brief Fill a rectangle on the current rendering target with the drawing color.
- *  
- *  \param rect A pointer to the destination rectangle, or NULL for the entire 
- *              rendering target.
- *  
- *  \return 0 on success, or -1 if there is no rendering context current.
- */
-extern DECLSPEC int SDLCALL SDL_RenderFillRect(const SDL_Rect * rect);
-
-/**
- *  \brief Fill some number of rectangles on the current rendering target with the drawing color.
- *  
- *  \param rects A pointer to an array of destination rectangles.
- *  \param count The number of rectangles.
- *  
- *  \return 0 on success, or -1 if there is no rendering context current.
- */
-extern DECLSPEC int SDLCALL SDL_RenderFillRects(const SDL_Rect ** rect, int count);
-
-/**
- *  \brief Copy a portion of the texture to the current rendering target.
- *  
- *  \param texture The source texture.
- *  \param srcrect   A pointer to the source rectangle, or NULL for the entire 
- *                   texture.
- *  \param dstrect   A pointer to the destination rectangle, or NULL for the 
- *                   entire rendering target.
- *  
- *  \return 0 on success, or -1 if there is no rendering context current, or the
- *          driver doesn't support the requested operation.
- */
-extern DECLSPEC int SDLCALL SDL_RenderCopy(SDL_Texture * texture,
-                                           const SDL_Rect * srcrect,
-                                           const SDL_Rect * dstrect);
-
-/**
- *  \brief Read pixels from the current rendering target.
- *  
- *  \param rect   A pointer to the rectangle to read, or NULL for the entire 
- *                render target.
- *  \param format The desired format of the pixel data, or 0 to use the format
- *                of the rendering target
- *  \param pixels A pointer to be filled in with the pixel data
- *  \param pitch  The pitch of the pixels parameter.
- *  
- *  \return 0 on success, or -1 if pixel reading is not supported.
- *  
- *  \warning This is a very slow operation, and should not be used frequently.
- */
-extern DECLSPEC int SDLCALL SDL_RenderReadPixels(const SDL_Rect * rect,
-                                                 Uint32 format,
-                                                 void *pixels, int pitch);
-
-/**
- *  \brief Write pixels to the current rendering target.
- *  
- *  \param rect   A pointer to the rectangle to write, or NULL for the entire 
- *                render target.
- *  \param format The format of the pixel data, or 0 to use the format
- *                of the rendering target
- *  \param pixels A pointer to the pixel data to write.
- *  \param pitch  The pitch of the pixels parameter.
- *  
- *  \return 0 on success, or -1 if pixel writing is not supported.
- *  
- *  \warning This is a very slow operation, and should not be used frequently.
- */
-extern DECLSPEC int SDLCALL SDL_RenderWritePixels(const SDL_Rect * rect,
-                                                  Uint32 format,
-                                                  const void *pixels,
-                                                  int pitch);
-
-/**
- *  \brief Update the screen with rendering performed.
- */
-extern DECLSPEC void SDLCALL SDL_RenderPresent(void);
-
-/**
- *  \brief Destroy the specified texture.
- *  
- *  \sa SDL_CreateTexture()
- *  \sa SDL_CreateTextureFromSurface()
- */
-extern DECLSPEC void SDLCALL SDL_DestroyTexture(SDL_Texture * texture);
-
-/**
- *  \brief Destroy the rendering context for a window and free associated
- *         textures.
- *  
- *  \sa SDL_CreateRenderer()
- */
-extern DECLSPEC void SDLCALL SDL_DestroyRenderer(SDL_Window * window);
 
 
 /**
 /**
  *  \brief Returns whether the screensaver is currently enabled (default on).
  *  \brief Returns whether the screensaver is currently enabled (default on).

+ 1 - 1
extern/include/SDL/begin_code.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

+ 1 - 1
extern/include/SDL/close_code.h

@@ -1,6 +1,6 @@
 /*
 /*
     SDL - Simple DirectMedia Layer
     SDL - Simple DirectMedia Layer
-    Copyright (C) 1997-2010 Sam Lantinga
+    Copyright (C) 1997-2011 Sam Lantinga
 
 
     This library is free software; you can redistribute it and/or
     This library is free software; you can redistribute it and/or
     modify it under the terms of the GNU Lesser General Public
     modify it under the terms of the GNU Lesser General Public

BIN
extern/lib-x86-64-linux/libSDL-1.3.so.0.0.0


+ 1 - 1
src/Main.cpp

@@ -327,8 +327,8 @@ void mainLoop()
 
 
 		AppSingleton::getInstance().execStdinScpripts();
 		AppSingleton::getInstance().execStdinScpripts();
 		SceneSingleton::getInstance().getPhysics().update(timer.getCrntTime());
 		SceneSingleton::getInstance().getPhysics().update(timer.getCrntTime());
-		SceneSingleton::getInstance().updateAllControllers();
 		SceneSingleton::getInstance().updateAllWorldStuff();
 		SceneSingleton::getInstance().updateAllWorldStuff();
+		SceneSingleton::getInstance().updateAllControllers();
 		SceneSingleton::getInstance().doVisibilityTests(*AppSingleton::getInstance().getActiveCam());
 		SceneSingleton::getInstance().doVisibilityTests(*AppSingleton::getInstance().getActiveCam());
 
 
 		MainRendererSingleton::getInstance().render(*AppSingleton::getInstance().getActiveCam());
 		MainRendererSingleton::getInstance().render(*AppSingleton::getInstance().getActiveCam());

+ 3 - 2
src/Scene/Scene.cpp

@@ -1,3 +1,4 @@
+#include <boost/foreach.hpp>
 #include <algorithm>
 #include <algorithm>
 #include "Exception.h"
 #include "Exception.h"
 #include "Scene.h"
 #include "Scene.h"
@@ -152,8 +153,8 @@ void Scene::updateAllWorldStuff()
 //======================================================================================================================
 //======================================================================================================================
 void Scene::updateAllControllers()
 void Scene::updateAllControllers()
 {
 {
-	for(Vec<Controller*>::iterator it=controllers.begin(); it!=controllers.end(); it++)
+	BOOST_FOREACH(Controller* ctl, controllers)
 	{
 	{
-		(*it)->update(0.0);
+		ctl->update(0.0);
 	}
 	}
 }
 }