Class Texture
java.lang.Object
com.codename1.gpu.Texture
A GPU texture. Instances are created by a
GraphicsDevice from a Codename
One Image or from raw ARGB pixel data and then referenced by a Material.
The class itself is a lightweight handle; the pixel storage lives on the GPU.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe sampling filter applied when the texture is scaled.static enumThe texture coordinate wrapping behavior outside the 0..1 range. -
Constructor Summary
ConstructorsConstructorDescriptionTexture(int width, int height) Creates a texture handle of the given dimensions. -
Method Summary
Modifier and TypeMethodDescriptionReturns the configured sampling filter.Returns the opaque backend GPU handle.intReturns the texture height in pixels.intgetWidth()Returns the texture width in pixels.getWrap()Returns the configured wrapping mode.setFilter(Texture.Filter filter) Sets the sampling filter.voidStores the opaque backend GPU handle.setWrap(Texture.Wrap wrap) Sets the wrapping mode.
-
Constructor Details
-
Texture
public Texture(int width, int height) Creates a texture handle of the given dimensions. Intended for backend use; applications create textures via
GraphicsDevice.Parameters
-
width: the texture width in pixels -
height: the texture height in pixels
-
-
-
Method Details
-
getWidth
public int getWidth()Returns the texture width in pixels. -
getHeight
public int getHeight()Returns the texture height in pixels. -
getWrap
Returns the configured wrapping mode. -
setWrap
Sets the wrapping mode. Takes effect on the next bind by the backend.
Parameters
wrap: the wrapping mode
Returns
this texture for chaining
-
getFilter
Returns the configured sampling filter. -
setFilter
Sets the sampling filter. Takes effect on the next bind by the backend.
Parameters
filter: the sampling filter
Returns
this texture for chaining
-
getHandle
Returns the opaque backend GPU handle. Intended for backend use. -
setHandle
Stores the opaque backend GPU handle. Intended for backend use.
Parameters
handle: the backend specific GPU resource handle
-