Author: dhudson
Date: 2006-05-19 12:10:16 -0400 (Fri, 19 May 2006)
New Revision: 60870
Modified:
trunk/tao/src/Tao.Sdl/Sdl.cs
trunk/tao/src/Tao.Sdl/SdlImage.cs
trunk/tao/src/Tao.Sdl/SdlMixer.cs
trunk/tao/src/Tao.Sdl/SdlNet.cs
trunk/tao/src/Tao.Sdl/SdlTtf.cs
Log:
update to 1.2.10. more to do.
Modified: trunk/tao/src/Tao.Sdl/Sdl.cs
===================================================================
--- trunk/tao/src/Tao.Sdl/Sdl.cs 2006-05-19 15:29:58 UTC (rev 60869)
+++ trunk/tao/src/Tao.Sdl/Sdl.cs 2006-05-19 16:10:16 UTC (rev 60870)
@@ -250,7 +250,7 @@
#endregion SDL_MIX_MAXVOLUME
#endregion SDL_audio.h
- #region SDL_byteorder.h
+ #region SDL_endian.h
#region SDL_LIL_ENDIAN
/// <summary>
/// Little Endian
@@ -269,7 +269,7 @@
/// </remarks>
public const int SDL_BIG_ENDIAN = 4321;
#endregion SDL_BIG_ENDIAN
- #endregion SDL_byteorder.h
+ #endregion SDL_endian.h
#region SDL_cdrom.h
#region SDL_MAX_TRACKS
@@ -436,6 +436,10 @@
/// <summary>
///
/// </summary>
+ public const int SDL_KEYEVENTMASK = (1 << SDL_KEYUP | 1 <<
SDL_KEYDOWN);
+ /// <summary>
+ ///
+ /// </summary>
public const int SDL_MOUSEMOTIONMASK = 1 << SDL_MOUSEMOTION;
/// <summary>
///
@@ -678,12 +682,12 @@
#endregion TIMER_RESOLUTION
#endregion SDL_timer.h
- #region SDL_types.h
+ #region SDL_events.h
/// <summary>
/// Button in pressed state.
/// </summary>
/// <remarks>
- /// SDL_types.h defines SDL_PRESSED and <see
cref="SDL_RELEASED"/>
+ /// SDL_events.h defines SDL_PRESSED and <see
cref="SDL_RELEASED"/>
/// in a nameless enum. Defining SDL_PRESSED as a const works
/// better for Tao.SDL purposes</remarks>
/// <seealso cref="SDL_RELEASED"/>
@@ -692,12 +696,12 @@
/// Button in released state.
/// </summary>
/// <remarks>
- /// SDL_types.h defines <see cref="SDL_PRESSED"/> and
SDL_RELEASED
+ /// SDL_events.h defines <see cref="SDL_PRESSED"/> and
SDL_RELEASED
/// in a nameless enum. Defining SDL_RELEASED as a const works
/// better for Tao.SDL purposes</remarks>
/// <seealso cref="SDL_PRESSED"/>
public const byte SDL_RELEASED = 0x00;
- #endregion SDL_types.h
+ #endregion SDL_events.h
// SDL_version -- none
@@ -2363,6 +2367,32 @@
/// <seealso cref="SDL_GL_SetAttribute"/>
/// <seealso cref="SDL_GL_GetAttribute"/>
public const int SDL_GL_MULTISAMPLESAMPLES = 14;
+ /// <summary>
+ /// Public enumeration for setting the OpenGL window Attributes
+ /// </summary>
+ /// <remarks>
+ /// While you can set most OpenGL attributes normally,
+ /// the attributes list above must be known before SDL
+ /// sets the video mode. These attributes a set and read
+ /// with <see cref="SDL_GL_SetAttribute"/> and
+ /// <see cref="SDL_GL_GetAttribute"/>.
+ /// </remarks>
+ /// <seealso cref="SDL_GL_SetAttribute"/>
+ /// <seealso cref="SDL_GL_GetAttribute"/>
+ public const int SDL_GL_ACCELERATED_VISUAL = 15;
+ /// <summary>
+ /// Public enumeration for setting the OpenGL window Attributes
+ /// </summary>
+ /// <remarks>
+ /// While you can set most OpenGL attributes normally,
+ /// the attributes list above must be known before SDL
+ /// sets the video mode. These attributes a set and read
+ /// with <see cref="SDL_GL_SetAttribute"/> and
+ /// <see cref="SDL_GL_GetAttribute"/>.
+ /// </remarks>
+ /// <seealso cref="SDL_GL_SetAttribute"/>
+ /// <seealso cref="SDL_GL_GetAttribute"/>
+ public const int SDL_GL_SWAP_CONTROL = 16;
#endregion SDL_GLattr
#region SDL_GrabMode
@@ -4914,6 +4944,16 @@
public IntPtr vfmt;
/// <summary>
+ /// Value: The current video mode width
+ /// </summary>
+ public int current_w;
+
+ /// <summary>
+ /// Value: The current video mode height
+ /// </summary>
+ public int current_h;
+
+ /// <summary>
/// Is it possible to create hardware surfaces?
/// </summary>
public int hw_available
@@ -6658,7 +6698,7 @@
/// </summary>
/// <remarks>
/// <p>Binds to C-function call in SDL_cpuinfo.h:
- /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_HasRDTSC()</code>
+ /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_HasRDTSC(void)</code>
/// </p>
/// </remarks>
/// <returns>Returns SDL_TRUE if the CPU has the RDTSC
instruction.</returns>
@@ -6672,7 +6712,7 @@
/// </summary>
/// <remarks>
/// <p>Binds to C-function call in SDL_cpuinfo.h:
- /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_HasMMX()</code>
+ /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_HasMMX(void)</code>
/// </p>
/// </remarks>
/// <returns>Returns SDL_TRUE if the CPU has MMX
features.</returns>
@@ -6686,7 +6726,7 @@
/// </summary>
/// <remarks>
/// <p>Binds to C-function call in SDL_cpuinfo.h:
- /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_HasMMXExt()</code>
+ /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_HasMMXExt(void)</code>
/// </p>
/// </remarks>
/// <returns>Returns SDL_TRUE if the CPU has MMX Ext.
features.</returns>
@@ -6700,7 +6740,7 @@
/// </summary>
/// <remarks>
/// <p>Binds to C-function call in SDL_cpuinfo.h:
- /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_SDL_Has3DNow()</code>
+ /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_SDL_Has3DNow(void)</code>
/// </p>
/// </remarks>
/// <returns>Returns SDL_TRUE if the CPU has 3DNow
features.</returns>
@@ -6714,7 +6754,7 @@
/// </summary>
/// <remarks>
/// <p>Binds to C-function call in SDL_cpuinfo.h:
- /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_SDL_HasSSE()</code>
+ /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_SDL_HasSSE(void)</code>
/// </p>
/// </remarks>
/// <returns>Returns SDL_TRUE if the CPU has SSE
features.</returns>
@@ -6728,7 +6768,7 @@
/// </summary>
/// <remarks>
/// <p>Binds to C-function call in SDL_cpuinfo.h:
- /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_SDL_HasSSE2()</code>
+ /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_SDL_HasSSE2void()</code>
/// </p>
/// </remarks>
/// <returns>Returns SDL_TRUE if the CPU has SSE2
features.</returns>
@@ -6742,7 +6782,7 @@
/// </summary>
/// <remarks>
/// <p>Binds to C-function call in SDL_cpuinfo.h:
- /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_SDL_HasAltiVec()</code>
+ /// <code>extern DECLSPEC SDL_bool SDLCALL
SDL_SDL_HasAltiVec(void)</code>
/// </p>
/// </remarks>
/// <returns>Returns SDL_TRUE if the CPU has AltiVec
features.</returns>
@@ -7622,6 +7662,31 @@
int delay);
#endregion int SDL_EnableKeyRepeat(int rate, int delay)
+ #region int SDL_GetKeyRepeat(out int rate, out int delay)
+ /// <summary>
+ /// Get keyboard repeat rate.
+ /// </summary>
+ /// <remarks>
+ /// Gets the keyboard repeat rate.
+ /// delay specifies how long the key must be pressed before it
+ /// begins repeating, it then repeats at the speed specified by
+ /// interval. Both delay and interval are expressed in
milliseconds.
+ /// <p>Setting delay to 0 disables key repeating completely.
Good
+ /// default values are SDL_DEFAULT_REPEAT_DELAY and
+ /// SDL_DEFAULT_REPEAT_INTERVAL.</p>
+ ///<p>Binds to C-function in SDL_keyboard.h
+ ///<code>int SDL_GetKeyRepeat(int delay, int interval);
+ ///</code></p>
+ /// </remarks>
+ /// <param name="rate"></param>
+ /// <param name="delay"></param>
+ /// <returns>Returns 0 on success and -1 on failure.</returns>
+ [DllImport(SDL_NATIVE_LIBRARY,
CallingConvention=CALLING_CONVENTION),
+ SuppressUnmanagedCodeSecurity]
+ public static extern int SDL_GetKeyRepeat(out int rate,
+ out int delay);
+ #endregion int SDL_GetKeyRepeat(out int rate, out int delay)
+
#region IntPtr SDL_GetKeyStateInternal(out int numkeys)
/// <summary>
/// Get a snapshot of the current keyboard state.
@@ -8045,7 +8110,7 @@
/// <returns></returns>
public static byte SDL_BUTTON(byte x)
{
- return (byte)(Sdl.SDL_PRESSED<<(x-1));
+ return (byte)(1<<(x-1));
}
#endregion SDL_mouse.h
Modified: trunk/tao/src/Tao.Sdl/SdlImage.cs
===================================================================
--- trunk/tao/src/Tao.Sdl/SdlImage.cs 2006-05-19 15:29:58 UTC (rev 60869)
+++ trunk/tao/src/Tao.Sdl/SdlImage.cs 2006-05-19 16:10:16 UTC (rev 60870)
@@ -421,6 +421,42 @@
public static extern IntPtr IMG_isXPM(IntPtr src);
#endregion IntPtr IMG_isXPM(IntPtr src)
+ #region IntPtr IMG_isXV(IntPtr src)
+ /// <summary>
+ /// Test for valid, supported XV file.
+ /// </summary>
+ /// <remarks>
+ /// If the XV format is supported,
+ /// then the image data is tested to see if it is readable as a
XV,
+ /// otherwise it returns false (Zero).
+ /// <p>Binds to C-function in SDL_image.h
+ /// <code>
+ /// int IMG_isXV(SDL_RWops *src)
+ /// </code>
+ /// </p>
+ /// </remarks>
+ /// <param name="src"></param>
+ /// <returns>
+ /// 1 if the image is a XV and the XV format support is
+ /// compiled into SDL_image. 0 is returned otherwise.
+ /// </returns>
+ /// <example>
+ /// <code>
+ /// // Test sample.xv to see if it is a XV
+ /// SDL_RWops *rwop;
+ /// rwop=SDL_RWFromFile("sample.xv", "rb");
+ /// if(IMG_isXPM(rwop))
+ /// printf("sample.xpm is a XV file.\n");
+ /// else
+ /// printf("sample.xpm is not a XV file, or XV
support is not available.\n");
+ /// </code></example>
+ /// <seealso cref="IMG_LoadTyped_RW"/>
+ [DllImport(SDL_IMAGE_NATIVE_LIBRARY,
+ CallingConvention=CALLING_CONVENTION),
+ SuppressUnmanagedCodeSecurity]
+ public static extern IntPtr IMG_isXV(IntPtr src);
+ #endregion IntPtr IMG_isXV(IntPtr src)
+
#region IntPtr IMG_isXCF(IntPtr src)
/// <summary>
/// Test for valid, supported XCF file.
@@ -847,6 +883,49 @@
SuppressUnmanagedCodeSecurity]
public static extern IntPtr IMG_LoadXCF_RW(IntPtr src);
#endregion IntPtr IMG_LoadXCF_RW(IntPtr src)
+
+ #region IntPtr IMG_LoadXV_RW(IntPtr src)
+ /// <summary>
+ /// Load a .XV image.
+ /// </summary>
+ /// <param name="src">
+ /// The XV image is loaded from this
+ /// </param>
+ /// <returns>
+ /// a pointer to the image as a new SDL_Surface.
+ /// NULL is returned on errors, like if XV is not supported,
+ /// or a read error.
+ /// </returns>
+ /// <remarks>
+ /// Load src as a XV image for use as a surface,
+ /// if XV support is compiled into the SDL_image library.
+ /// <p>Binds to C-function in SDL_image.h
+ /// <code>
+ /// SDL_Surface *IMG_LoadXV_RW(SDL_RWops *src)
+ /// </code>
+ /// </p>
+ /// </remarks>
+ /// <example>
+ /// <code>
+ /// // load sample.xv into image
+ /// SDL_Surface *image;
+ /// SDL_RWops *rwop;
+ /// rwop=SDL_RWFromFile("sample.xv", "rb");
+ /// image=IMG_LoadXV_RW(rwop);
+ /// if(!image)
+ /// {
+ /// printf("IMG_LoadXV_RW: %s\n", IMG_GetError());
+ /// // handle error
+ /// }
+ /// </code>
+ /// </example>
+ /// <seealso cref="IMG_LoadTyped_RW"/>
+ /// <seealso cref="IMG_isXV"/>
+ [DllImport(SDL_IMAGE_NATIVE_LIBRARY,
+ CallingConvention=CALLING_CONVENTION),
+ SuppressUnmanagedCodeSecurity]
+ public static extern IntPtr IMG_LoadXV_RW(IntPtr src);
+ #endregion IntPtr IMG_LoadXV_RW(IntPtr src)
#region IntPtr IMG_LoadPCX_RW(IntPtr src)
/// <summary>
Modified: trunk/tao/src/Tao.Sdl/SdlMixer.cs
===================================================================
--- trunk/tao/src/Tao.Sdl/SdlMixer.cs 2006-05-19 15:29:58 UTC (rev 60869)
+++ trunk/tao/src/Tao.Sdl/SdlMixer.cs 2006-05-19 16:10:16 UTC (rev 60870)
@@ -798,8 +798,20 @@
public static extern IntPtr Mix_LoadMUS(string file);
#endregion IntPtr Mix_LoadMUS(string file)
- // Mix_Music * Mix_LoadMUS_RW(SDL_RWOps *rw); is not part of
the public api
- // and will not be implemented
+ #region IntPtr Mix_LoadMUS_RW(IntPtr rw)
+ /// <summary>
+ /// Load a music file from an SDL_RWop object (Ogg and MikMod
specific currently)
+ /// </summary>
+ /// <remarks>
+ /// <p>Binds to C-function in SDL_mixer.h
+ /// <code>Mix_Music *Mix_LoadMUS_RW(SDL_RWops *rw)
+ /// </code></p>
+ /// </remarks>
+ [DllImport(SDL_MIXER_NATIVE_LIBRARY,
+ CallingConvention=CALLING_CONVENTION),
+ SuppressUnmanagedCodeSecurity]
+ public static extern IntPtr Mix_LoadMUS_RW(IntPtr rw);
+ #endregion IntPtr Mix_LoadMUS_RW(IntPtr rw)
#region IntPtr Mix_QuickLoad_WAV(IntPtr mem)
/// <summary>
Modified: trunk/tao/src/Tao.Sdl/SdlNet.cs
===================================================================
--- trunk/tao/src/Tao.Sdl/SdlNet.cs 2006-05-19 15:29:58 UTC (rev 60869)
+++ trunk/tao/src/Tao.Sdl/SdlNet.cs 2006-05-19 16:10:16 UTC (rev 60870)
@@ -293,6 +293,35 @@
#region SdlNet Methods
#region General
+ #region IntPtr SDLNet_Linked_VersionInternal()
+ // const SDL_version * SDLNet_Linked_Version(void)
+ [DllImport(SDL_NET_NATIVE_LIBRARY,
CallingConvention=CALLING_CONVENTION, EntryPoint="SDLNet_Linked_Version"),
SuppressUnmanagedCodeSecurity]
+ private static extern IntPtr SDLNet_Linked_VersionInternal();
+ #endregion IntPtr SDLNet_Linked_VersionInternal()
+
+ #region SDL_version SDLNet_Linked_Version()
+ /// <summary>
+ /// Using this you can compare the runtime version to the
+ /// version that you compiled with.
+ /// </summary>
+ /// <returns>
+ /// This function gets the version of the dynamically
+ /// linked SDL_net library in an <see cref="Sdl.SDL_version"/>
struct.
+ /// </returns>
+ /// <remarks>
+ /// <p>
+ /// Binds to C-function call in SDL_net.h:
+ /// <code>const SDL_version *
SDLNet_Linked_Version(void)</code>
+ /// </p>
+ /// </remarks>
+ public static Sdl.SDL_version SDLNet_Linked_Version()
+ {
+ return (Sdl.SDL_version)Marshal.PtrToStructure(
+ SDLNet_Linked_VersionInternal(),
+ typeof(Sdl.SDL_version));
+ }
+ #endregion SDL_version SDLNet_Linked_Version()
+
#region int SDLNet_Init()
/// <summary>
/// Initialize the network API.
@@ -767,7 +796,7 @@
/// This routine is not used for server sockets.
/// <p>Binds to C-function call in SDL_net.h:
/// <code>
- /// extern DECLSPEC int SDLCALL SDLNet_TCP_Send(TCPsocket
sock, void *data, int len)
+ /// extern DECLSPEC int SDLCALL SDLNet_TCP_Send(TCPsocket
sock, const void *data, int len)
/// </code>
/// </p>
/// </remarks>
Modified: trunk/tao/src/Tao.Sdl/SdlTtf.cs
===================================================================
--- trunk/tao/src/Tao.Sdl/SdlTtf.cs 2006-05-19 15:29:58 UTC (rev 60869)
+++ trunk/tao/src/Tao.Sdl/SdlTtf.cs 2006-05-19 16:10:16 UTC (rev 60870)
@@ -34,6 +34,7 @@
{
#region Class Documentation
/// <summary>
+ /// This library supports Sdl_ttf 2.0.8.
/// This library is a wrapper around the excellent FreeType 1.2 library,
/// available at: http://www.freetype.org
/// <p>
_______________________________________________
Mono-patches maillist - [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches