9 return reinterpret_cast<void*
>(&m_data);
28 if (*
reinterpret_cast<int*
>(&a) > 0) {
30 return ResultVal(m_data->SetColor(color));
33 return ResultVal(m_data->SetColorRGB(r, a, b));
41 return ResultVal(m_data->SetTexture(pD3DTexture));
47 IDirect3DRMTexture* pD3DTexture;
79 return ResultVal(m_data->SetMaterialMode(d3dMode));
86 return ResultVal(m_data->AddVisual(pGroupImpl->m_data));
107 return ResultVal(m_data->DeleteVisual(pGroupImpl->m_data));
113 IDirect3DRMVisualArray* visuals;
114 IDirect3DRMFrame2* frame = m_data;
115 Result result = (
Result) SUCCEEDED(frame->GetVisuals(&visuals));
118 for (
int i = 0; i < (int) visuals->GetSize(); i++) {
119 IDirect3DRMVisual* visual;
121 result = (
Result) SUCCEEDED(visuals->GetElement(i, &visual));
122 frame->DeleteVisual(visual);
136 IDirect3DRMFrame2* frame = m_data;
138 size.
min.
x = 88888.f;
139 size.
min.
y = 88888.f;
140 size.
min.
z = 88888.f;
141 size.
max.
x = -88888.f;
142 size.
max.
y = -88888.f;
143 size.
max.
z = -88888.f;
145 IDirect3DRMVisualArray* visuals;
146 Result result = (
Result) SUCCEEDED(frame->GetVisuals(&visuals));
150 for (i = 0; i < (int) visuals->GetSize(); i++) {
151 IDirect3DRMVisual* visual;
152 visuals->GetElement(i, &visual);
153 IDirect3DRMMesh* mesh;
158 result = (
Result) SUCCEEDED(visual->QueryInterface(IID_IDirect3DRMMeshBuilder, (
void**) &mesh));
162 result = (
Result) SUCCEEDED(mesh->GetBox(&box));
[AI] Implementation of Tgl::Group, wraps a Direct3DRMFrame2 and provides scene graph and transformati...
Result SetTransformation(FloatMatrix4 &) override
Sets transformation matrix for group [AI].
Result Add(const Group *) override
Adds a child group [AI].
Result Bounds(D3DVECTOR *p_min, D3DVECTOR *p_max) override
Returns bounding box in world space [AI].
const GroupDataType & ImplementationData() const
Gets internal group/frame pointer, const [AI].
Result GetTexture(Texture *&) override
Gets texture from group [AI].
Result SetTexture(const Texture *) override
Sets texture for all group geometry [AI].
Result SetMaterialMode(MaterialMode) override
Sets usage/staging of group as a material [AI].
Result Remove(const Group *) override
Removes a child group [AI].
Result SetColor(float r, float g, float b, float a) override
Sets color and alpha for the group [AI].
Result RemoveAll() override
Removes all contained groups and meshes [AI].
void * ImplementationDataPtr() override
Returns group implementation pointer [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::Texture using a Direct3DRMTexture; provides upload and palette control [AI]
void SetImplementation(IDirect3DRMTexture *pData)
Replaces implementation pointer [AI].
[AI] Scene graph node for parental transforms/color/material/texture; can hold meshes or other groups...
[AI] Builder class for assembling mesh data and extracting mesh objects.
[AI] Represents a GPU or system memory texture for use in rendering.
enum _D3DRMMATERIALMODE D3DRMMATERIALMODE
D3DVALUE D3DRMMATRIX4D[4][4]
D3DCOLOR D3DRMAPI D3DRMCreateColorRGBA(D3DVALUE red, D3DVALUE green, D3DVALUE blue, D3DVALUE alpha)
@ D3DRMMATERIAL_FROMPARENT
@ D3DRMMATERIAL_FROMFRAME
#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].
Result
[AI] Result type used throughout the Tgl API to report operation success or failure.
@ Success
[AI] Operation succeeded. [AI]
float FloatMatrix4[4][4]
[AI] Represents a 4x4 matrix of single-precision floating point values.
MaterialMode
[AI] Determines how material properties are sourced for a group/mesh.
@ FromMesh
[AI] Use material specified at the mesh level. [AI]
@ FromFrame
[AI] Use material from the current frame. [AI]
@ FromParent
[AI] Inherit material from parent. [AI]