coastline 0.0.4
Loading...
Searching...
No Matches
D3DTexture Class Reference

A texture of Direct3D created from an image in memory. More...

#include <renderer.h>

Public Member Functions

D3DTEXTUREHANDLE GetTextureHandle () const
bool CreateD3DTexture (IDirect3DDevice2 *pDevice, void *pImage, int nWidth, int nHeight, int nPixelFormatId, DWORD dwColorKey)
 Create the texture from an image.
bool CreateD3DTextureDefault (IDirect3DDevice2 *pDevice, void *pImage, int nWidth, int nHeight, int nPixelFormatId)
 Create the texture from an image with no transparent colour.
bool UploadSurfaceToTexture (const void *pImage, int nWidth, int nHeight)
 Copy an image into the surface in system memory and load the texture surface from it.
bool LoadSysMemTextureToDevice ()
 Restore the texture surface and load it from the surface in system memory.
void ReleaseD3DTextureInterfaces ()
 Release the interfaces of the texture and clear its handle.

Detailed Description

A texture of Direct3D created from an image in memory.

Member Function Documentation

◆ GetTextureHandle()

D3DTEXTUREHANDLE D3DTexture::GetTextureHandle ( ) const
inline
Returns
The texture handle for the device.

◆ CreateD3DTexture()

bool D3DTexture::CreateD3DTexture ( IDirect3DDevice2 * pDevice,
void * pImage,
int nWidth,
int nHeight,
int nPixelFormatId,
DWORD dwColorKey )

Create the texture from an image.

A device of hardware gets a texture surface in video memory loaded from a surface in system memory, and a device of software uses one surface in system memory for both.

Parameters
pDeviceThe device the texture belongs to.
pImageThe pixels of the image, in the pixel format of the texture.
nWidthThe width of the texture.
nHeightThe height of the texture.
nPixelFormatIdThe pixel format of the texture.
dwColorKeyThe colour that is transparent, or 0 for none.
Returns
Whether the texture was created.
Ghidra address:
BRD3D: 0x10009c40

◆ CreateD3DTextureDefault()

bool D3DTexture::CreateD3DTextureDefault ( IDirect3DDevice2 * pDevice,
void * pImage,
int nWidth,
int nHeight,
int nPixelFormatId )

Create the texture from an image with no transparent colour.

Parameters
pDeviceThe device the texture belongs to.
pImageThe pixels of the image.
nWidthThe width of the texture.
nHeightThe height of the texture.
nPixelFormatIdThe pixel format of the texture.
Returns
Whether the texture was created.
Ghidra address:
BRD3D: 0x10009ea0

◆ UploadSurfaceToTexture()

bool D3DTexture::UploadSurfaceToTexture ( const void * pImage,
int nWidth,
int nHeight )

Copy an image into the surface in system memory and load the texture surface from it.

Parameters
pImageThe pixels, packed row after row.
nWidthThe width of the image.
nHeightThe height of the image.
Returns
Whether the image was copied and loaded.
Ghidra address:
BRD3D: 0x10009ed0

◆ LoadSysMemTextureToDevice()

bool D3DTexture::LoadSysMemTextureToDevice ( )

Restore the texture surface and load it from the surface in system memory.

Returns
Whether the texture was loaded, true at once when one surface serves both.
Ghidra address:
BRD3D: 0x1000a020

◆ ReleaseD3DTextureInterfaces()

void D3DTexture::ReleaseD3DTextureInterfaces ( )

Release the interfaces of the texture and clear its handle.

Ghidra address:
BRD3D: 0x1000a0b0

The documentation for this class was generated from the following file: