public static extern Int32 GetDisplayBounds(Int32 displayIndex, SDL_Rect* rect);
public static Int32 BlitScaled(SDL_Surface_Native* src, SDL_Rect* srcrect, SDL_Surface_Native* dst, SDL_Rect* dstrect) { return UpperBlitScaled(src, srcrect, dst, dstrect); }
private static extern Int32 UpperBlitScaled(SDL_Surface_Native* src, SDL_Rect* srcrect, SDL_Surface_Native* dst, SDL_Rect* dstrect);
public static extern void SetTextInputRect(SDL_Rect* rect);
/// <summary> /// Blits the surface onto the specified destination surface. /// </summary> /// <param name="src">The source surface.</param> /// <param name="srcRect">The area of this surface that will be copied to the destination surface.</param> /// <param name="dst">The destination surface.</param> /// <param name="dstRect">The area on the destination surface to which this surface will be copied.</param> private static void BlitInternal(OpenGLSurface2D src, Rectangle srcRect, OpenGLSurface2D dst, Rectangle dstRect) { var sdlSrcRect = new SDL_Rect() { x = srcRect.X, y = srcRect.Y, w = srcRect.Width, h = srcRect.Height }; var sdlDstRect = new SDL_Rect() { x = dstRect.X, y = dstRect.Y, w = dstRect.Width, h = dstRect.Height }; if (SDL.SetSurfaceBlendMode(src.nativesurf.Native, SDL_BlendMode.NONE) < 0) throw new SDL2Exception(); if (srcRect.Width != dstRect.Width || srcRect.Height != dstRect.Height) { if (SDL.BlitScaled(src.nativesurf.Native, &sdlSrcRect, dst.nativesurf.Native, &sdlDstRect) < 0) throw new SDL2Exception(); } else { if (SDL.BlitSurface(src.nativesurf.Native, &sdlSrcRect, dst.nativesurf.Native, &sdlDstRect) < 0) throw new SDL2Exception(); } }
/// <summary> /// Creates a copy of a region of this surface. /// </summary> /// <param name="region">The region of this surface to copy.</param> /// <returns>A new surface which is a copy of the specified region of this surface.</returns> public override Surface2D CreateSurface(Rectangle region) { Contract.EnsureNotDisposed(this, Disposed); if (region.Left < 0 || region.Top < 0 || region.Right > Width || region.Bottom > Height || region.Width <= 0 || region.Height <= 0) throw new ArgumentOutOfRangeException("region"); var copysurf = new SDL_Surface(region.Width, region.Height); var srcrect = new SDL_Rect() { x = region.X, y = region.Y, w = region.Width, h = region.Height }; var dstrect = new SDL_Rect() { x = 0, y = 0, w = region.Width, h = region.Height }; if (SDL.BlitSurface(nativesurf.Native, &srcrect, copysurf.Native, &dstrect) < 0) throw new SDL2Exception(); return new OpenGLSurface2D(Ultraviolet, copysurf); }