Esempio n. 1
0
        public bool CreateBlank(int width, int height, SDL.SDL_TextureAccess access)
        {
            //Create uninitialized texture
            texturePtr = SDL.SDL_CreateTexture(rendererPtr, SDL.SDL_PIXELFORMAT_RGBA8888, (int)access, width, height);

            if (texturePtr == IntPtr.Zero)
            {
                Debug.Print($"Unable to create blank texture! SDL Error: {SDL.SDL_GetError()}\n");
            }
            else
            {
                Width  = width;
                Height = height;
            }

            return(texturePtr != IntPtr.Zero);
        }
Esempio n. 2
0
        /// <summary>
        /// Create a blank texture.
        /// </summary>
        public Texture(Renderer renderer, int width, int height,
                       SDL.SDL_TextureAccess access)
        {
            IntPtr texture = SDL.SDL_CreateTexture(
                renderer.RenPtr,
                SDL.SDL_PIXELFORMAT_RGBA8888,
                (int)access,
                width,
                height
                );

            if (texture == IntPtr.Zero)
            {
                throw new SDLException("SDL_CreateTexture");
            }

            TexPtr = texture;
        }
Esempio n. 3
0
 public IntPtr CreateTexture(uint format, SDL.SDL_TextureAccess access, int width, int height)
 {
     return(SDL.SDL_CreateTexture(_sdlRenderer, format, (int)access, width, height));
 }
Esempio n. 4
0
        public SDLTexture(SDLRenderer Renderer, ref SDL.SDL_PixelFormat Format, SDL.SDL_TextureAccess Access, int W, int H)
        {
            myPtr = SDL.SDL_CreateTexture(Renderer.Ptr, Format.format, (int)Access, W, H);

            CheckPtr();
        }