Class representing a 2D image.
More...
|
| | Texture2D (int width, int height, SurfaceFormat surfaceFormat, PixelFormat pixelFormat) |
| | Creates a new Texture2D.
|
| |
| void | GetData (in Span< byte > data) |
| | Get the surface data for this texture.
|
| |
| void | SetData (in ReadOnlySpan< byte > data) |
| | Set the surface data for this texture.
|
| |
| void | SetData (in ReadOnlySpan< byte > data, Rectangle region) |
| | Set the surface data of the given region within the texture.
|
| |
|
void | SetData (in ReadOnlySpan< float > data) |
| |
|
void | SetData (in ReadOnlySpan< uint > data) |
| |
|
void | SetData (in ReadOnlySpan< int > data) |
| |
|
void | SetData (in ReadOnlySpan< float > data, Rectangle region) |
| |
|
void | SetData (in ReadOnlySpan< uint > data, Rectangle region) |
| |
|
void | SetData (in ReadOnlySpan< int > data, Rectangle region) |
| |
|
void | SetData (in ReadOnlySpan< Color > data) |
| |
|
void | SetData (in ReadOnlySpan< Color > data, Rectangle region) |
| |
|
void | Dispose () |
| |
|
| override void | Dispose (bool disposing) |
| | Called when it's time to throw out the trash.- Parameters
-
| disposing | If true, please throw away your trash. Skunks! |
|
| |
| | GraphicsObject () |
| | Creates a new GraphicsObject instance.
|
| |
Class representing a 2D image.
◆ Texture2D()
Creates a new Texture2D.
- Parameters
-
| width | The width of the texture in pixels. |
| height | The height of the texture in pixels. |
| surfaceFormat | |
| pixelFormat | |
◆ Dispose()
| override void Dispose |
( |
bool | disposing | ) |
|
|
inlineprotectedvirtual |
Called when it's time to throw out the trash.
- Parameters
-
| disposing | If true, please throw away your trash. Skunks! |
Reimplemented from GraphicsObject.
◆ FromStream()
Creates a Texture2D by reading image data from the supplied stream.
- Parameters
-
| stream | Any readable stream. |
- Returns
- A new Texture2D containing pixel data decoded from the image stream.
If all you want to do is load a PNG or JPEG image from disk and get it on the GPU, this is the function for you.
Simple and speedy functionality brought to you in part by every engine dev's first choice, the library that makes your computer go vroom vroom, stb_image.
◆ GetData()
| void GetData |
( |
in Span< byte > | data | ) |
|
|
inline |
Get the surface data for this texture.
- Parameters
-
| data | A slice of memory to store the surface data of the texture. Must be exactly Width * Height * BytesPerPixel bytes in size. |
◆ SetData() [1/2]
| void SetData |
( |
in ReadOnlySpan< byte > | data | ) |
|
|
inline |
Set the surface data for this texture.
- Parameters
-
| data | A slice of memory containing the surface data of the texture. Must be exactly Width * Height * BytesPerPixel bytes in size. |
◆ SetData() [2/2]
| void SetData |
( |
in ReadOnlySpan< byte > | data, |
|
|
Rectangle | region ) |
|
inline |
Set the surface data of the given region within the texture.
- Parameters
-
| data | A slice of memory containing the data to upload to the surface. Must be region.Width * region.Height * BytesPerPixel bytes long. |
| region | A rectangular region within the texture where the given surface data should be uploaded. |
The documentation for this class was generated from the following file:
- /builds/universe/graphics/src/Inertia.Platform/Texture2D.cs