Class SDL_Texture
- java.lang.Object
-
- com.sun.jna.PointerType
-
- io.github.libsdl4j.api.render.SDL_Texture
-
- All Implemented Interfaces:
com.sun.jna.NativeMapped
public final class SDL_Texture extends com.sun.jna.PointerType
An efficient driver-specific representation of pixel data.SDL_Texture
is used in a hardware rendering and textures are stored in GPU memory (where available). Therefore the program doesn't have access to it directly, unlike inSDL_Surface
. The rendering operations are accelerated by GPU (where available), using, internally, either OpenGL or DirectX (available only on Windows) API, which in turn are using your video hardware, hence the hardware rendering.SDL_Surface
, on the other hand, stores pixel data in the regular RAM and in most cases you can access data buffer associated with surface directly, modifying its content, i.e. it is using CPU, hence the software rendering.SDL_Surface
is the original image data structure from SDL 1.x.SDL_Texture
was added in SDL 2.x for hardware optimized rendering.You can convert
SDL_Surface
toSDL_Texture
usingSDL_CreateTextureFromSurface(...)
, after which you can release the SDL_Surface memory bySDL_FreeSurface(...)
-
-
Constructor Summary
Constructors Constructor Description SDL_Texture()
SDL_Texture(com.sun.jna.Pointer p)
-