Isle
Loading...
Searching...
No Matches
TglImpl::RendererImpl Class Reference

[AI] Implements Tgl::MeshBuilder; facilitates mesh construction [AI] More...

#include <impl.h>

Inheritance diagram for TglImpl::RendererImpl:
Collaboration diagram for TglImpl::RendererImpl:

Public Types

typedef IDirect3DRM2 * RendererDataType
 [AI] Internal data type for renderer (Direct3DRM2*) [AI] More...
 

Public Member Functions

 RendererImpl ()
 [AI] Initializes renderer data to null. [AI] More...
 
 ~RendererImpl () override
 [AI] Destructor ensures Direct3DRM2 resources are freed. [AI] More...
 
void * ImplementationDataPtr () override
 Returns implementation-specific data pointer (Direct3DRM2) [AI]. More...
 
DeviceCreateDevice (const DeviceDirectDrawCreateData &) override
 Creates a device from DirectDraw configuration [AI]. More...
 
DeviceCreateDevice (const DeviceDirect3DCreateData &) override
 Creates a device from Direct3D configuration [AI]. More...
 
ViewCreateView (const Device *, const Camera *, unsigned long x, unsigned long y, unsigned long width, unsigned long height) override
 Creates a view using provided device and camera [AI]. More...
 
CameraCreateCamera () override
 Creates a camera object [AI]. More...
 
LightCreateLight (LightType, float r, float g, float b) override
 Creates a light source with color and type [AI]. More...
 
GroupCreateGroup (const Group *pParent) override
 Creates a new group under parent group [AI]. More...
 
MeshBuilderCreateMeshBuilder () override
 Creates a mesh builder for assembling geometry [AI]. More...
 
TextureCreateTexture (int width, int height, int bitsPerTexel, const void *pTexels, int pTexelsArePersistent, int paletteEntryCount, const PaletteEntry *pEntries) override
 Creates a texture from buffer data and palette [AI]. More...
 
TextureCreateTexture () override
 Creates an empty texture [AI]. More...
 
Result SetTextureDefaultShadeCount (unsigned long) override
 Sets the number of default texture shades used [AI]. More...
 
Result SetTextureDefaultColorCount (unsigned long) override
 Sets the number of default texture colors used [AI]. More...
 
HRESULT CreateTextureFromSurface (LPDIRECTDRAWSURFACE pSurface, LPDIRECT3DRMTEXTURE2 *pTexture2)
 Creates a Direct3DRM texture from a DirectDraw surface [AI]. More...
 
const RendererDataTypeImplementationData () const
 Retrieves the Direct3DRM2 pointer (const) [AI]. More...
 
RendererDataTypeImplementationData ()
 Retrieves the Direct3DRM2 pointer (mutable) [AI]. More...
 
Result Create ()
 Initializes Direct3DRM2 [AI]. More...
 
void Destroy ()
 Frees Direct3DRM2 resources [AI]. More...
 
Result CreateLight (LightType type, float r, float g, float b, LightImpl &rLight)
 Helper for light creation with explicit output parameter [AI]. More...
 
Result CreateView (const DeviceImpl &rDevice, const CameraImpl &rCamera, unsigned long x, unsigned long y, unsigned long width, unsigned long height, ViewImpl &rView)
 Helper for view creation [AI]. More...
 
Result CreateMeshBuilder (MeshBuilderImpl &rMesh)
 Helper for mesh builder creation [AI]. More...
 
Result CreateCamera (CameraImpl &rCamera)
 Helper for camera creation [AI]. More...
 
Result CreateTexture (TextureImpl &rTexture)
 Helper for texture creation (empty) [AI]. More...
 
Result CreateTexture (TextureImpl &rTexture, int width, int height, int bitsPerTexel, const void *pTexels, int texelsArePersistent, int paletteEntryCount, const PaletteEntry *pEntries)
 Helper for texture creation with buffer [AI]. More...
 
Result CreateDevice (const DeviceDirect3DCreateData &rCreateData, DeviceImpl &rDevice)
 Helper for device creation (Direct3D) [AI]. More...
 
Result CreateDevice (const DeviceDirectDrawCreateData &rCreateData, DeviceImpl &rDevice)
 Helper for device creation (DirectDraw) [AI]. More...
 
virtual DeviceCreateDevice (const DeviceDirectDrawCreateData &)=0
 [AI] Creates a rendering device using DirectDraw parameters. More...
 
virtual DeviceCreateDevice (const DeviceDirect3DCreateData &)=0
 [AI] Creates a rendering device using Direct3D parameters. More...
 
virtual ViewCreateView (const Device *, const Camera *, unsigned long x, unsigned long y, unsigned long width, unsigned long height)=0
 [AI] Creates a rendering view associated with the given device and camera. More...
 
virtual CameraCreateCamera ()=0
 [AI] Creates a new camera. More...
 
virtual LightCreateLight (LightType, float r, float g, float b)=0
 [AI] Creates a new light of the given type and color. More...
 
virtual GroupCreateGroup (const Group *pParent=0)=0
 [AI] Creates a new group (scene graph node), optionally parented. More...
 
virtual MeshBuilderCreateMeshBuilder ()=0
 [AI] Creates a new mesh builder. More...
 
virtual TextureCreateTexture (int width, int height, int bitsPerTexel, const void *pTexels, int pTexelsArePersistent, int paletteEntryCount, const PaletteEntry *pEntries)=0
 [AI] Creates a new texture from raw texel buffer and optional palette. More...
 
virtual TextureCreateTexture ()=0
 [AI] Creates an (empty) texture. More...
 
virtual Result SetTextureDefaultShadeCount (unsigned long)=0
 [AI] Sets the default number of shades to generate for textures. More...
 
virtual Result SetTextureDefaultColorCount (unsigned long)=0
 [AI] Sets the default number of colors to use for textures (likely palette size). More...
 
- Public Member Functions inherited from Tgl::Object
virtual ~Object ()
 [AI] Destructor; releases resources. More...
 
virtual void * ImplementationDataPtr ()=0
 [AI] Returns a pointer to internal/implementation data, if any. More...
 

Detailed Description

[AI] Implements Tgl::MeshBuilder; facilitates mesh construction [AI]

[AI] Implements the Tgl::Renderer interface with Direct3DRM2 as backend. Handles creation of rendering devices, cameras, lights, and scene graph objects. [AI]

Definition at line 55 of file impl.h.

Member Typedef Documentation

◆ RendererDataType

[AI] Internal data type for renderer (Direct3DRM2*) [AI]

Definition at line 185 of file impl.h.

Constructor & Destructor Documentation

◆ RendererImpl()

TglImpl::RendererImpl::RendererImpl ( )
inline

[AI] Initializes renderer data to null. [AI]

Definition at line 58 of file impl.h.

◆ ~RendererImpl()

TglImpl::RendererImpl::~RendererImpl ( )
inlineoverride

[AI] Destructor ensures Direct3DRM2 resources are freed. [AI]

Definition at line 61 of file impl.h.

Member Function Documentation

◆ Create()

Result RendererImpl::Create ( )
inline

Initializes Direct3DRM2 [AI].

Definition at line 25 of file renderer.cpp.

◆ CreateCamera() [1/2]

Camera * RendererImpl::CreateCamera ( )
overridevirtual

Creates a camera object [AI].

Returns
Newly created Camera [AI]

Implements Tgl::Renderer.

Definition at line 264 of file renderer.cpp.

◆ CreateCamera() [2/2]

Result RendererImpl::CreateCamera ( CameraImpl rCamera)
inline

Helper for camera creation [AI].

Parameters
rCameraOutput CameraImpl [AI]

Definition at line 254 of file renderer.cpp.

◆ CreateDevice() [1/4]

Device * RendererImpl::CreateDevice ( const DeviceDirect3DCreateData data)
overridevirtual

Creates a device from Direct3D configuration [AI].

Parameters
dataDevice configuration for Direct3D [AI]
Returns
Newly created Device [AI]

Implements Tgl::Renderer.

Definition at line 62 of file renderer.cpp.

◆ CreateDevice() [2/4]

Result RendererImpl::CreateDevice ( const DeviceDirect3DCreateData rCreateData,
DeviceImpl rDevice 
)
inline

Helper for device creation (Direct3D) [AI].

Parameters
rCreateDataCreation params [AI]
rDeviceOutput DeviceImpl [AI]

Definition at line 52 of file renderer.cpp.

◆ CreateDevice() [3/4]

Device * RendererImpl::CreateDevice ( const DeviceDirectDrawCreateData data)
overridevirtual

Creates a device from DirectDraw configuration [AI].

Parameters
dataDevice configuration for DirectDraw [AI]
Returns
Newly created Device [AI]

Implements Tgl::Renderer.

Definition at line 115 of file renderer.cpp.

◆ CreateDevice() [4/4]

Result RendererImpl::CreateDevice ( const DeviceDirectDrawCreateData rCreateData,
DeviceImpl rDevice 
)
inline

Helper for device creation (DirectDraw) [AI].

Parameters
rCreateDataCreation params [AI]
rDeviceOutput DeviceImpl [AI]

Definition at line 105 of file renderer.cpp.

◆ CreateGroup()

Group * RendererImpl::CreateGroup ( const Group pParent)
overridevirtual

Creates a new group under parent group [AI].

Parameters
pParentParent group [AI]
Returns
Newly created Group [AI]

Implements Tgl::Renderer.

Definition at line 235 of file renderer.cpp.

◆ CreateLight() [1/2]

Result RendererImpl::CreateLight ( LightType  type,
float  r,
float  g,
float  b,
LightImpl rLight 
)
inline

Helper for light creation with explicit output parameter [AI].

Parameters
typeLightType [AI]
rRed [AI]
gGreen [AI]
bBlue [AI]
rLightOutput LightImpl [AI]

Definition at line 331 of file renderer.cpp.

◆ CreateLight() [2/2]

Light * RendererImpl::CreateLight ( LightType  type,
float  r,
float  g,
float  b 
)
overridevirtual

Creates a light source with color and type [AI].

Parameters
typeLight type (ambient, point, etc.) [AI]
rRed component [AI]
gGreen component [AI]
bBlue component [AI]
Returns
Newly created Light [AI]

Implements Tgl::Renderer.

Definition at line 341 of file renderer.cpp.

◆ CreateMeshBuilder() [1/2]

MeshBuilder * RendererImpl::CreateMeshBuilder ( )
overridevirtual

Creates a mesh builder for assembling geometry [AI].

Returns
Newly created MeshBuilder [AI]

Implements Tgl::Renderer.

Definition at line 372 of file renderer.cpp.

◆ CreateMeshBuilder() [2/2]

Result RendererImpl::CreateMeshBuilder ( MeshBuilderImpl rMesh)
inline

Helper for mesh builder creation [AI].

Parameters
rMeshOutput MeshBuilderImpl [AI]

Definition at line 362 of file renderer.cpp.

◆ CreateTexture() [1/4]

Texture * RendererImpl::CreateTexture ( )
overridevirtual

Creates an empty texture [AI].

Returns
Newly created Texture [AI]

Implements Tgl::Renderer.

Definition at line 501 of file renderer.cpp.

◆ CreateTexture() [2/4]

Texture * RendererImpl::CreateTexture ( int  width,
int  height,
int  bitsPerTexel,
const void *  pTexels,
int  pTexelsArePersistent,
int  paletteEntryCount,
const PaletteEntry pEntries 
)
overridevirtual

Creates a texture from buffer data and palette [AI].

Parameters
widthTexture width [AI]
heightTexture height [AI]
bitsPerTexelBits per texel [AI]
pTexelsTexel data pointer [AI]
pTexelsArePersistentFlag for texel data persistence [AI]
paletteEntryCountNumber of palette entries [AI]
pEntriesPalette entries [AI]
Returns
Newly created Texture [AI]

Implements Tgl::Renderer.

Definition at line 455 of file renderer.cpp.

◆ CreateTexture() [3/4]

Result RendererImpl::CreateTexture ( TextureImpl rTexture)
inline

Helper for texture creation (empty) [AI].

Parameters
rTextureOutput TextureImpl [AI]

Definition at line 491 of file renderer.cpp.

◆ CreateTexture() [4/4]

Result RendererImpl::CreateTexture ( TextureImpl rTexture,
int  width,
int  height,
int  bitsPerTexel,
const void *  pTexels,
int  texelsArePersistent,
int  paletteEntryCount,
const PaletteEntry pEntries 
)
inline

Helper for texture creation with buffer [AI].

Parameters
rTextureOutput TextureImpl [AI]
widthTexture width [AI]
heightTexture height [AI]
bitsPerTexelBits per texel [AI]
pTexelsBuffer pointer [AI]
texelsArePersistentPersistence flag [AI]
paletteEntryCountPalette entries [AI]
pEntriesPalette data [AI]

Definition at line 426 of file renderer.cpp.

◆ CreateTextureFromSurface()

HRESULT TglImpl::RendererImpl::CreateTextureFromSurface ( LPDIRECTDRAWSURFACE  pSurface,
LPDIRECT3DRMTEXTURE2 *  pTexture2 
)
inline

Creates a Direct3DRM texture from a DirectDraw surface [AI].

Parameters
pSurfacePointer to DirectDraw surface [AI]
pTexture2Output pointer for created Direct3DRM texture [AI]
Returns
HRESULT from Direct3DRM [AI]

Definition at line 180 of file impl.h.

◆ CreateView() [1/2]

View * RendererImpl::CreateView ( const Device pDevice,
const Camera pCamera,
unsigned long  x,
unsigned long  y,
unsigned long  width,
unsigned long  height 
)
overridevirtual

Creates a view using provided device and camera [AI].

Parameters
DeviceRendering device [AI]
CameraCamera to view scene through [AI]
xViewport x position [AI]
yViewport y position [AI]
widthViewport width [AI]
heightViewport height [AI]
Returns
Newly created View [AI]

Implements Tgl::Renderer.

Definition at line 191 of file renderer.cpp.

◆ CreateView() [2/2]

Result RendererImpl::CreateView ( const DeviceImpl rDevice,
const CameraImpl rCamera,
unsigned long  x,
unsigned long  y,
unsigned long  width,
unsigned long  height,
ViewImpl rView 
)
inline

Helper for view creation [AI].

Parameters
rDeviceDeviceImpl [AI]
rCameraCameraImpl [AI]
xX position [AI]
yY position [AI]
widthWidth [AI]
heightHeight [AI]
rViewOutput ViewImpl [AI]

Definition at line 162 of file renderer.cpp.

◆ Destroy()

void TglImpl::RendererImpl::Destroy ( )
inline

Frees Direct3DRM2 resources [AI].

Destroy and cleanup Direct3DRM2 resources for the renderer [AI].

Definition at line 310 of file impl.h.

◆ ImplementationData() [1/2]

RendererDataType & TglImpl::RendererImpl::ImplementationData ( )
inline

Retrieves the Direct3DRM2 pointer (mutable) [AI].

Returns
Reference to Direct3DRM2 pointer [AI]

Definition at line 198 of file impl.h.

◆ ImplementationData() [2/2]

const RendererDataType & TglImpl::RendererImpl::ImplementationData ( ) const
inline

Retrieves the Direct3DRM2 pointer (const) [AI].

Returns
Reference to Direct3DRM2 pointer [AI]

Definition at line 191 of file impl.h.

◆ ImplementationDataPtr()

void * RendererImpl::ImplementationDataPtr ( )
overridevirtual

Returns implementation-specific data pointer (Direct3DRM2) [AI].

Returns
void pointer to implementation data [AI]

Implements Tgl::Object.

Definition at line 528 of file renderer.cpp.

◆ SetTextureDefaultColorCount()

Result RendererImpl::SetTextureDefaultColorCount ( unsigned long  colorCount)
overridevirtual

Sets the number of default texture colors used [AI].

Parameters
valueNumber of default colors [AI]

Implements Tgl::Renderer.

Definition at line 521 of file renderer.cpp.

◆ SetTextureDefaultShadeCount()

Result RendererImpl::SetTextureDefaultShadeCount ( unsigned long  shadeCount)
overridevirtual

Sets the number of default texture shades used [AI].

Parameters
valueNumber of default shades [AI]

Implements Tgl::Renderer.

Definition at line 515 of file renderer.cpp.


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