Example #1
0
        /// <summary>Gets the clipping rectangle for the destination surface in a blit.</summary>
/// <remarks>
/// <para>must be a pointer to a valid rectangle which will be filled</para>
/// <para>with the correct values.</para>
/// </remarks>
        public static void GetClipRect(global::SharpSDL.Surface surface, global::SharpSDL.Rect rect)
        {
            var __arg0 = ReferenceEquals(surface, null) ? global::System.IntPtr.Zero : surface.__Instance;
            var __arg1 = ReferenceEquals(rect, null) ? global::System.IntPtr.Zero : rect.__Instance;

            __Internal.GetClipRect(__arg0, __arg1);
        }
Example #2
0
        /// <summary>Get the additional alpha value used in blit operations.</summary>
/// <param name="surface">The surface to query.</param>
/// <param name="alpha">A pointer filled in with the current alpha value.</param>
/// <returns>0 on success, or -1 if the surface is not valid.</returns>
/// <remarks>SDL_SetSurfaceAlphaMod()</remarks>
        public static int GetSurfaceAlphaMod(global::SharpSDL.Surface surface, byte *alpha)
        {
            var __arg0 = ReferenceEquals(surface, null) ? global::System.IntPtr.Zero : surface.__Instance;
            var __ret  = __Internal.GetSurfaceAlphaMod(__arg0, alpha);

            return(__ret);
        }
Example #3
0
        /// <summary>Get the blend mode used for blit operations.</summary>
/// <param name="surface">The surface to query.</param>
/// <param name="blendMode">A pointer filled in with the current blend mode.</param>
/// <returns>0 on success, or -1 if the surface is not valid.</returns>
/// <remarks>SDL_SetSurfaceBlendMode()</remarks>
        public static int GetSurfaceBlendMode(global::SharpSDL.Surface surface, global::SharpSDL.BlendMode *blendMode)
        {
            var __arg0 = ReferenceEquals(surface, null) ? global::System.IntPtr.Zero : surface.__Instance;
            var __ret  = __Internal.GetSurfaceBlendMode(__arg0, blendMode);

            return(__ret);
        }
Example #4
0
        /// <summary>Sets up a surface for directly accessing the pixels.</summary>
/// <remarks>
/// <para>Between calls to SDL_LockSurface() / SDL_UnlockSurface(), you can write</para>
/// <para>to and read fromusing the pixel format stored in</para>
/// <para>Once you are done accessing the surface, you should</para>
/// <para>use SDL_UnlockSurface() to release it.</para>
/// <para>Not all surfaces require locking.  If SDL_MUSTLOCK(surface) evaluates</para>
/// <para>to 0, then you can read and write to the surface at any time, and the</para>
/// <para>pixel format of the surface will not change.</para>
/// <para>No operating system or library calls should be made between lock/unlock</para>
/// <para>pairs, as critical system locks may be held during this time.</para>
/// <para>SDL_LockSurface() returns 0, or -1 if the surface couldn't be locked.</para>
/// <para>SDL_UnlockSurface()</para>
/// </remarks>
        public static int LockSurface(global::SharpSDL.Surface surface)
        {
            var __arg0 = ReferenceEquals(surface, null) ? global::System.IntPtr.Zero : surface.__Instance;
            var __ret  = __Internal.LockSurface(__arg0);

            return(__ret);
        }
Example #5
0
        /// <summary>Set an additional color value used in blit operations.</summary>
/// <param name="surface">The surface to update.</param>
/// <param name="r">The red color value multiplied into blit operations.</param>
/// <param name="g">The green color value multiplied into blit operations.</param>
/// <param name="b">The blue color value multiplied into blit operations.</param>
/// <returns>0 on success, or -1 if the surface is not valid.</returns>
/// <remarks>SDL_GetSurfaceColorMod()</remarks>
        public static int SetSurfaceColorMod(global::SharpSDL.Surface surface, byte r, byte g, byte b)
        {
            var __arg0 = ReferenceEquals(surface, null) ? global::System.IntPtr.Zero : surface.__Instance;
            var __ret  = __Internal.SetSurfaceColorMod(__arg0, r, g, b);

            return(__ret);
        }
Example #6
0
        /// <summary>Sets the color key (transparent pixel) in a blittable surface.</summary>
/// <param name="surface">The surface to update</param>
/// <param name="flag">Non-zero to enable colorkey and 0 to disable colorkey</param>
/// <param name="key">The transparent pixel in the native surface format</param>
/// <returns>
/// <para>0 on success, or -1 if the surface is not valid</para>
/// <para>You can pass SDL_RLEACCEL to enable RLE accelerated blits.</para>
/// </returns>
        public static int SetColorKey(global::SharpSDL.Surface surface, int flag, uint key)
        {
            var __arg0 = ReferenceEquals(surface, null) ? global::System.IntPtr.Zero : surface.__Instance;
            var __ret  = __Internal.SetColorKey(__arg0, flag, key);

            return(__ret);
        }
Example #7
0
 public Surface(global::SharpSDL.Surface _0)
 {
     __Instance                     = Marshal.AllocHGlobal(sizeof(global::SharpSDL.Surface.__Internal));
     __ownsNativeInstance           = true;
     NativeToManagedMap[__Instance] = this;
     *((global::SharpSDL.Surface.__Internal *)__Instance) = *((global::SharpSDL.Surface.__Internal *)_0.__Instance);
 }
Example #8
0
        public static int FillRects(global::SharpSDL.Surface dst, global::SharpSDL.Rect rects, int count, uint color)
        {
            var __arg0 = ReferenceEquals(dst, null) ? global::System.IntPtr.Zero : dst.__Instance;
            var __arg1 = ReferenceEquals(rects, null) ? global::System.IntPtr.Zero : rects.__Instance;
            var __ret  = __Internal.FillRects(__arg0, __arg1, count, color);

            return(__ret);
        }
Example #9
0
        /// <summary>Set the palette used by a surface.</summary>
/// <returns>0, or -1 if the surface format doesn't use a palette.</returns>
/// <remarks>A single palette can be shared with many surfaces.</remarks>
        public static int SetSurfacePalette(global::SharpSDL.Surface surface, global::SharpSDL.Palette palette)
        {
            var __arg0 = ReferenceEquals(surface, null) ? global::System.IntPtr.Zero : surface.__Instance;
            var __arg1 = ReferenceEquals(palette, null) ? global::System.IntPtr.Zero : palette.__Instance;
            var __ret  = __Internal.SetSurfacePalette(__arg0, __arg1);

            return(__ret);
        }
Example #10
0
        /// <summary>Set the shape and parameters of a shaped window.</summary>
/// <param name="window">The shaped window whose parameters should be set.</param>
/// <param name="shape">A surface encoding the desired shape for the window.</param>
/// <param name="shape_mode">The parameters to set for the shaped window.</param>
/// <returns>
/// <para>0 on success, SDL_INVALID_SHAPE_ARGUMENT on an invalid shape argument, or SDL_NONSHAPEABLE_WINDOW</para>
/// <para>if the SDL_Window given does not reference a valid shaped window.</para>
/// </returns>
/// <remarks>
/// <para>SDL_WindowShapeMode</para>
/// <para>SDL_GetShapedWindowMode.</para>
/// </remarks>
        public static int SetWindowShape(global::SharpSDL.Window window, global::SharpSDL.Surface shape, global::SharpSDL.SDL_WindowShapeMode shape_mode)
        {
            var __arg0 = ReferenceEquals(window, null) ? global::System.IntPtr.Zero : window.__Instance;
            var __arg1 = ReferenceEquals(shape, null) ? global::System.IntPtr.Zero : shape.__Instance;
            var __arg2 = ReferenceEquals(shape_mode, null) ? global::System.IntPtr.Zero : shape_mode.__Instance;
            var __ret  = __Internal.SetWindowShape(__arg0, __arg1, __arg2);

            return(__ret);
        }
Example #11
0
        /// <summary>
/// <para>Perform a fast, low quality, stretch blit between two surfaces of the</para>
/// <para>same pixel format.</para>
/// </summary>
/// <remarks>This function uses a static buffer, and is not thread-safe.</remarks>
        public static int SoftStretch(global::SharpSDL.Surface src, global::SharpSDL.Rect srcrect, global::SharpSDL.Surface dst, global::SharpSDL.Rect dstrect)
        {
            var __arg0 = ReferenceEquals(src, null) ? global::System.IntPtr.Zero : src.__Instance;
            var __arg1 = ReferenceEquals(srcrect, null) ? global::System.IntPtr.Zero : srcrect.__Instance;
            var __arg2 = ReferenceEquals(dst, null) ? global::System.IntPtr.Zero : dst.__Instance;
            var __arg3 = ReferenceEquals(dstrect, null) ? global::System.IntPtr.Zero : dstrect.__Instance;
            var __ret  = __Internal.SoftStretch(__arg0, __arg1, __arg2, __arg3);

            return(__ret);
        }
Example #12
0
        /// <summary>Gets the color key (transparent pixel) in a blittable surface.</summary>
/// <param name="surface">The surface to update</param>
/// <param name="key">
/// <para>A pointer filled in with the transparent pixel in the native</para>
/// <para>surface format</para>
/// </param>
/// <returns>
/// <para>0 on success, or -1 if the surface is not valid or colorkey is not</para>
/// <para>enabled.</para>
/// </returns>
        public static int GetColorKey(global::SharpSDL.Surface surface, ref uint key)
        {
            var __arg0 = ReferenceEquals(surface, null) ? global::System.IntPtr.Zero : surface.__Instance;

            fixed(uint *__key1 = &key)
            {
                var __arg1 = __key1;
                var __ret  = __Internal.GetColorKey(__arg0, __arg1);

                return(__ret);
            }
        }
Example #13
0
        public static global::SharpSDL.Surface ConvertSurfaceFormat(global::SharpSDL.Surface src, uint pixel_format, uint flags)
        {
            var __arg0 = ReferenceEquals(src, null) ? global::System.IntPtr.Zero : src.__Instance;
            var __ret  = __Internal.ConvertSurfaceFormat(__arg0, pixel_format, flags);

            global::SharpSDL.Surface __result0;
            if (__ret == IntPtr.Zero)
            {
                __result0 = null;
            }
            else if (global::SharpSDL.Surface.NativeToManagedMap.ContainsKey(__ret))
            {
                __result0 = (global::SharpSDL.Surface)global::SharpSDL.Surface.NativeToManagedMap[__ret];
            }
            else
            {
                __result0 = global::SharpSDL.Surface.__CreateInstance(__ret);
            }
            return(__result0);
        }
Example #14
0
        public static global::SharpSDL.Surface DuplicateSurface(global::SharpSDL.Surface surface)
        {
            var __arg0 = ReferenceEquals(surface, null) ? global::System.IntPtr.Zero : surface.__Instance;
            var __ret  = __Internal.DuplicateSurface(__arg0);

            global::SharpSDL.Surface __result0;
            if (__ret == IntPtr.Zero)
            {
                __result0 = null;
            }
            else if (global::SharpSDL.Surface.NativeToManagedMap.ContainsKey(__ret))
            {
                __result0 = (global::SharpSDL.Surface)global::SharpSDL.Surface.NativeToManagedMap[__ret];
            }
            else
            {
                __result0 = global::SharpSDL.Surface.__CreateInstance(__ret);
            }
            return(__result0);
        }
Example #15
0
        /// <summary>Create a color cursor.</summary>
/// <remarks>SDL_FreeCursor()</remarks>
        public static global::SharpSDL.Cursor CreateColorCursor(global::SharpSDL.Surface surface, int hot_x, int hot_y)
        {
            var __arg0 = ReferenceEquals(surface, null) ? global::System.IntPtr.Zero : surface.__Instance;
            var __ret  = __Internal.CreateColorCursor(__arg0, hot_x, hot_y);

            global::SharpSDL.Cursor __result0;
            if (__ret == IntPtr.Zero)
            {
                __result0 = null;
            }
            else if (global::SharpSDL.Cursor.NativeToManagedMap.ContainsKey(__ret))
            {
                __result0 = (global::SharpSDL.Cursor)global::SharpSDL.Cursor.NativeToManagedMap[__ret];
            }
            else
            {
                __result0 = global::SharpSDL.Cursor.__CreateInstance(__ret);
            }
            return(__result0);
        }
Example #16
0
        /// <remarks>SDL_LockSurface()</remarks>
        public static void UnlockSurface(global::SharpSDL.Surface surface)
        {
            var __arg0 = ReferenceEquals(surface, null) ? global::System.IntPtr.Zero : surface.__Instance;

            __Internal.UnlockSurface(__arg0);
        }