コード例 #1
0
ファイル: CSDL.cs プロジェクト: nobbele/SoteriaEngine
        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
ファイル: CSDL.cs プロジェクト: nobbele/SoteriaEngine
        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
ファイル: CSDL.cs プロジェクト: nobbele/SoteriaEngine
        public SDLTexture GetTexture(string file, int w, int h)
        {
            SDLSurface surface = IMG_Load(file);

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