43 IDirect3DRMDevice2*& rpDevice
79 IDirect3DRMDevice2*& rpDevice
93 static int g_setBufferCount = 1;
94 if (g_setBufferCount) {
130 IDirect3DRM2* pRenderer,
131 const IDirect3DRMDevice2* pDevice,
132 const IDirect3DRMFrame2* pCamera,
136 unsigned long height,
137 IDirect3DRMViewport*& rpView
141 const_cast<IDirect3DRMDevice2*
>(pDevice),
142 const_cast<IDirect3DRMFrame2*
>(pCamera),
168 unsigned long height,
225 result =
ResultVal(pParent->AddVisual(rpGroup));
279 IDirect3DRM2* pD3DRM,
284 IDirect3DRMFrame2*& rpLight
288 IDirect3DRMFrame2* pLightFrame;
289 IDirect3DRMLight* pLight;
298 assert((pLightFrame->AddRef(), pLightFrame->Release()) == 1);
303 pLightFrame->Release();
307 assert((pLight->AddRef(), pLight->Release()) == 1);
309 result =
ResultVal(pLightFrame->AddLight(pLight));
312 pLightFrame->Release();
317 assert((pLightFrame->AddRef(), pLightFrame->Release()) == 1);
320 assert((pLight->AddRef(), pLight->Release()) == 2);
325 rpLight = pLightFrame;
358 return ResultVal(pD3DRM->CreateMesh(&rpMesh));
387 IDirect3DRM2* pRenderer,
395 IDirect3DRMTexture*& rpTexture
404 result =
ResultVal(pRenderer->CreateTexture(&pImage->
m_image, (LPDIRECT3DRMTEXTURE2*) &rpTexture));
406 assert((rpTexture->AddRef(), rpTexture->Release()) == 1);
413 rpTexture->Release();
432 int texelsArePersistent,
433 int paletteEntryCount,
445 const_cast<void*
>(pTexels),
460 int texelsArePersistent,
461 int paletteEntryCount,
473 const_cast<void*
>(pTexels),
517 return ResultVal(m_data->SetDefaultTextureShades(shadeCount));
523 return ResultVal(m_data->SetDefaultTextureColors(colorCount));
530 return reinterpret_cast<void*
>(&m_data);
[AI] Implementation of Tgl::Camera, wraps a Direct3DRMFrame2 and provides transformation management [...
const CameraDataType & ImplementationData() const
Retrieves camera pointer (const) [AI].
[AI] Implements the Tgl::Device interface, encapsulates Direct3DRMDevice2 and provides rendering devi...
const DeviceDataType & ImplementationData() const
Retrieves the device pointer (const) [AI].
[AI] Implementation of Tgl::Group, wraps a Direct3DRMFrame2 and provides scene graph and transformati...
[AI] Implementation of Tgl::Light, wraps a Direct3DRMFrame2 and color data [AI]
const LightDataType & ImplementationData() const
Retrieves light pointer (const) [AI].
[AI] Implements Tgl::MeshBuilder, manages mesh construction and provides the interface for creating g...
const MeshBuilderDataType & ImplementationData() const
Gets mesh builder pointer (const) [AI].
[AI] Implements Tgl::MeshBuilder; facilitates mesh construction [AI]
Device * CreateDevice(const DeviceDirectDrawCreateData &) override
Creates a device from DirectDraw configuration [AI].
Result SetTextureDefaultShadeCount(unsigned long) override
Sets the number of default texture shades used [AI].
Camera * CreateCamera() override
Creates a camera object [AI].
MeshBuilder * CreateMeshBuilder() override
Creates a mesh builder for assembling geometry [AI].
Light * CreateLight(LightType, float r, float g, float b) override
Creates a light source with color and type [AI].
Texture * CreateTexture() override
Creates an empty texture [AI].
void * ImplementationDataPtr() override
Returns implementation-specific data pointer (Direct3DRM2) [AI].
View * CreateView(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].
Group * CreateGroup(const Group *pParent) override
Creates a new group under parent group [AI].
Result SetTextureDefaultColorCount(unsigned long) override
Sets the number of default texture colors used [AI].
Result Create()
Initializes Direct3DRM2 [AI].
[AI] Implements Tgl::Texture using a Direct3DRMTexture; provides upload and palette control [AI]
static Result SetImage(IDirect3DRMTexture *pSelf, TglD3DRMIMAGE *pImage)
Copies palette/texel data from TglD3DRMIMAGE to Direct3DRMTexture [AI].
const TextureDataType & ImplementationData() const
Gets Direct3DRMTexture pointer (const) [AI].
[AI] Simple wrapper for D3DRMIMAGE; manages pixel buffer and palette for Direct3DRM textures [AI]
D3DRMIMAGE m_image
[AI] Underlying D3DRM image struct [AI]
[AI] Implementation of Tgl::View backed by Direct3DRMViewport, handles scene rendering,...
static Result ViewportCreateAppData(IDirect3DRM2 *, IDirect3DRMViewport *, IDirect3DRMFrame2 *)
Associates user app data with a viewport/frame [AI].
const ViewDataType & ImplementationData() const
Gets internal viewport pointer, const [AI].
[AI] Represents a viewpoint in the 3D scene.
[AI] Represents a rendering device/context for the Tgl renderer.
[AI] Scene graph node for parental transforms/color/material/texture; can hold meshes or other groups...
[AI] Represents a source of lighting in the 3D scene.
[AI] Builder class for assembling mesh data and extracting mesh objects.
[AI] Main interface/factory for rendering resources and scene graphs.
[AI] Represents a GPU or system memory texture for use in rendering.
[AI] Represents a rendering viewport and drawing context.
STDAPI Direct3DRMCreate(LPDIRECT3DRM FAR *lplpDirect3DRM)
enum _D3DRMLIGHTTYPE D3DRMLIGHTTYPE
#define NULL
[AI] Null pointer value (C/C++ semantics).
[AI] Forward declaration for Direct3DRMTexture interface [AI]
Result ResultVal(HRESULT result)
Returns a Tgl Result value for HRESULT [AI].
D3DRMRENDERQUALITY Translate(ShadingModel tglShadingModel)
Converts Tgl shading model enum to D3DRM enum [AI].
IDirect3DRM2 * g_pD3DRM
[AI] Global pointer to Direct3DRM2, used to manage lifecycle [AI]
Renderer * CreateRenderer()
[AI] Instantiates and returns a new Tgl::Renderer implementation.
int Succeeded(Result result)
[AI] Returns whether a Tgl::Result indicates success.
Result
[AI] Result type used throughout the Tgl API to report operation success or failure.
@ Success
[AI] Operation succeeded. [AI]
@ Error
[AI] Operation failed. [AI]
LightType
[AI] Types of lights supported in the renderer.
Result RendererCreateView(IDirect3DRM2 *pRenderer, const IDirect3DRMDevice2 *pDevice, const IDirect3DRMFrame2 *pCamera, unsigned long x, unsigned long y, unsigned long width, unsigned long height, IDirect3DRMViewport *&rpView)
Result RendererCreateCamera(IDirect3DRM2 *pD3DRM, IDirect3DRMFrame2 *&rpCamera)
Result RendererCreateMeshBuilder(IDirect3DRM2 *pD3DRM, IDirect3DRMMesh *&rpMesh)
Result RendererCreateDevice(IDirect3DRM2 *pD3DRM, const DeviceDirect3DCreateData &rCreateData, IDirect3DRMDevice2 *&rpDevice)
Result RendererCreateGroup(IDirect3DRM2 *pRenderer, IDirect3DRMFrame2 *pParent, IDirect3DRMFrame2 *&rpGroup)
Result RendererCreateTexture(IDirect3DRM2 *pRenderer, int width, int height, int bytesPerPixel, void *pBuffer, int useBuffer, int paletteSize, PaletteEntry *pEntries, IDirect3DRMTexture *&rpTexture)
Result RendererCreateLight(IDirect3DRM2 *pD3DRM, LightType type, float r, float g, float b, IDirect3DRMFrame2 *&rpLight)
[AI] Contains Direct3D-specific data needed to create a rendering device.
IDirect3D2 * m_pDirect3D
[AI] Direct3D interface pointer. [AI]
IDirect3DDevice2 * m_pDirect3DDevice
[AI] Direct3D device interface pointer. [AI]
[AI] Contains DirectDraw-specific params for creating a rendering device.
IDirectDrawSurface * m_pBackBuffer
[AI] Secondary (offscreen) buffer for flipping/rendering. [AI]
IDirectDraw * m_pDirectDraw
[AI] DirectDraw interface pointer. [AI]
const GUID * m_driverGUID
[AI] GUID of the DirectDraw driver to use. [AI]
[AI] Represents a single color entry in a palette.