Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        public SDLTexture GetTexture(string file, int w, int h)
        {
            SDLSurface surface = IMG_Load(file);

            return(new SDLTexture(this, surface, w, h));
        }