RenderWare::Raster struct

Low-level representation of a game texture.

Its high-level equivalent is Graphics::Texture. Rasters can be loaded into shaders and materials using the TextureSlot structure. For more information, check the official Direct3D 9 documentation:

Public types

enum Flags: uint16_t { kTypeDepthStencilSurface = 2, kTypeTexture = 8, kTypeRenderTarget = 9, kTypeDepthStencilTexture = 10, kFlagDynamicUsage = 0x10, kFlagAutoGenMipap = 0x200, kFlagCubeTexture = 0x1000, kFlagVolumeTexture = 0x2000 }

Public static variables

static const uint32_t RW_TYPE

Public static functions

static auto CreateRaster(Raster*& pDst, uint16_t width, uint16_t height, uint8_t levels, int flagsDepth, D3DFORMAT format) -> Raster*

Constructors, destructors, conversion operators

Raster()
~Raster()

Public functions

auto Delete() -> void
auto Create() -> void
Creates the corresponding Direct3D object for this raster, depending on the format and flags.
auto CreateTexture(DWORD usage = NULL, D3DPOOL pool = D3DPOOL_DEFAULT) -> HRESULT
auto D3D9AddToUnmanagedList() -> void
auto D3D9GetStreamedMipLevelSize(int mipLevel = 0) -> int
Returns how many bytes are needed to store one raw mip level of the raster.
auto CopyRaster(Raster* other) -> bool
auto Fill(int8_t* data, int mipLevel = 0) -> bool
Sets the raw contents of a mip level of the raster.
auto Extract(int8_t* dstData, int mipLevel = 0) -> bool
Extracts the raw contents of a mip level of the raster, and saves it in a byte array.
auto UNNAMED(RasterDirect3dData) -> union

Public variables

D3DFORMAT format
uint16_t flags
uint16_t volumeDepth
uint16_t width
uint16_t height
uint8_t depth
uint8_t levels
uint16_t cubeFaces
Raster* pNextParent
void* pSwapChain
void* pTextureData

Function documentation

int RenderWare::Raster::D3D9GetStreamedMipLevelSize(int mipLevel = 0)

Returns how many bytes are needed to store one raw mip level of the raster.

Parameters
mipLevel

bool RenderWare::Raster::Fill(int8_t* data, int mipLevel = 0)

Sets the raw contents of a mip level of the raster.

Parameters
data
mipLevel

bool RenderWare::Raster::Extract(int8_t* dstData, int mipLevel = 0)

Extracts the raw contents of a mip level of the raster, and saves it in a byte array.

Parameters
dstData out
mipLevel

The byte array must be of size returned by D3D9GetStreamedMipLevelSize()