public SDLTexture(SDLRenderer renderer, SDLSurface surface, int width, int height) { SDLSurface target = new SDLSurface(width, height); surface.ScaleTo(target, width, height); texture = SDL_CreateTextureFromSurface(renderer, target); }
public void ScaleTo(SDLSurface target, int width, int height) { SDL_Rect rect = new SDL_Rect() { x = 0, y = 0, w = width, h = height }; SDL_BlitScaled(surface, IntPtr.Zero, target, ref rect); }
public SDLTexture GetTexture(string file, int w, int h) { SDLSurface surface = IMG_Load(file); return(new SDLTexture(this, surface, w, h)); }