268 int pTexelsArePersistent,
269 int paletteEntryCount,
434 virtual Result SetFrustrum(
float frontClippingDistance,
float backClippingDistance,
float degrees) = 0;
475 virtual Result ForceUpdate(
unsigned long x,
unsigned long y,
unsigned long width,
unsigned long height) = 0;
506 const Group** ppGroupsToPickFrom,
507 int groupsToPickFromCount,
508 const Group**& rppPickedGroups,
509 int& rPickedGroupCount
783 unsigned long faceCount,
784 unsigned long vertexCount,
785 float (*pPositions)[3],
786 float (*pNormals)[3],
787 float (*pTextureCoordinates)[2],
788 unsigned long (*pFaceIndices)[3],
789 unsigned long (*pTextureIndices)[3],
[AI] Represents a viewpoint in the 3D scene.
virtual Result SetTransformation(FloatMatrix4 &)=0
[AI] Sets the transformation matrix for the camera.
[AI] Represents a rendering device/context for the Tgl renderer.
virtual Result Update()=0
[AI] Performs a device update/synchronization.
virtual Result SetShadeCount(unsigned long)=0
[AI] Specifies the number of shades for rendering (possibly for palette/ramp mode).
virtual Result SetDither(int)=0
[AI] Enables/disables dithering in the renderer.
virtual void HandlePaint(HDC)=0
[AI] Handles window repaint events (e.g., WM_PAINT) with a device context.
virtual Result SetColorModel(ColorModel)=0
[AI] Sets the color model for rendering.
virtual void HandleActivate(WORD)=0
[AI] Handles window activation events (e.g., WM_ACTIVATE).
virtual unsigned long GetWidth()=0
[AI] Gets the output width in pixels.
virtual Result SetShadingModel(ShadingModel)=0
[AI] Sets the shading model (e.g., Gouraud, flat).
virtual unsigned long GetHeight()=0
[AI] Gets the output height in pixels.
[AI] Scene graph node for parental transforms/color/material/texture; can hold meshes or other groups...
virtual Result SetMaterialMode(MaterialMode)=0
[AI] Sets material mode for the group (e.g., inherit vs.
virtual Result Remove(const Group *)=0
[AI] Removes a child group from this group.
virtual Result GetTexture(Texture *&)=0
[AI] Gets the group's texture (if any).
virtual Result Bounds(D3DVECTOR *, D3DVECTOR *)=0
[AI] Computes an axis-aligned bounding box for the group in world space.
virtual Result Add(const Group *)=0
[AI] Adds a child group to this group.
virtual Result SetColor(float r, float g, float b, float a)=0
[AI] Sets color (and alpha) for all geometry in the group.
virtual Result Remove(const MeshBuilder *)=0
[AI] Removes a mesh builder's mesh from group.
virtual Result SetTexture(const Texture *)=0
[AI] Sets a texture for the entire group.
virtual Result Add(const MeshBuilder *)=0
[AI] Adds a mesh builder's mesh to the group.
virtual Result SetTransformation(FloatMatrix4 &)=0
[AI] Sets the group's transformation matrix.
virtual Result RemoveAll()=0
[AI] Removes all children and meshes from the group.
[AI] Represents a source of lighting in the 3D scene.
virtual Result SetTransformation(FloatMatrix4 &)=0
[AI] Sets the transformation matrix for the light source.
virtual Result SetColor(float r, float g, float b)=0
[AI] Sets the light's color.
[AI] Builder class for assembling mesh data and extracting mesh objects.
virtual Result GetBoundingBox(float min[3], float max[3]) const =0
[AI] Gets the bounding box for the constructed mesh geometry.
virtual MeshBuilder * Clone()=0
[AI] Makes a copy of the mesh builder instance (deep copy).
virtual Mesh * CreateMesh(unsigned long faceCount, unsigned long vertexCount, float(*pPositions)[3], float(*pNormals)[3], float(*pTextureCoordinates)[2], unsigned long(*pFaceIndices)[3], unsigned long(*pTextureIndices)[3], ShadingModel shadingModel)=0
[AI] Creates a mesh from supplied geometry data.
[AI] Represents a renderable 3D mesh.
virtual Result SetShadingModel(ShadingModel)=0
[AI] Sets the mesh's shading model (e.g., Gouraud, Phong).
virtual Result SetTexture(const Texture *)=0
[AI] Sets the texture to use.
virtual Result SetTextureMappingMode(TextureMappingMode)=0
[AI] Sets how texture coordinates are mapped (linear or perspective correct).
virtual Mesh * DeepClone(MeshBuilder *)=0
[AI] Performs a deep clone—copying all mesh and group data.
virtual Mesh * ShallowClone(MeshBuilder *)=0
[AI] Performs a shallow clone—new wrapper, same mesh data.
virtual Result GetTexture(Texture *&)=0
[AI] Retrieves the currently set texture.
virtual Result SetColor(float r, float g, float b, float a)=0
[AI] Sets the color and transparency for the mesh.
[AI] Utility for mesh data construction and conversion. [AI]
virtual ~Object()
[AI] Destructor; releases resources.
virtual void * ImplementationDataPtr()=0
[AI] Returns a pointer to internal/implementation data, if any.
[AI] Main interface/factory for rendering resources and scene graphs.
virtual Texture * CreateTexture()=0
[AI] Creates an (empty) texture.
virtual Device * CreateDevice(const DeviceDirectDrawCreateData &)=0
[AI] Creates a rendering device using DirectDraw parameters.
virtual MeshBuilder * CreateMeshBuilder()=0
[AI] Creates a new mesh builder.
virtual Result SetTextureDefaultShadeCount(unsigned long)=0
[AI] Sets the default number of shades to generate for textures.
virtual View * CreateView(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.
virtual Texture * CreateTexture(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.
virtual Light * CreateLight(LightType, float r, float g, float b)=0
[AI] Creates a new light of the given type and color.
virtual Camera * CreateCamera()=0
[AI] Creates a new camera.
virtual Result SetTextureDefaultColorCount(unsigned long)=0
[AI] Sets the default number of colors to use for textures (likely palette size).
virtual Device * CreateDevice(const DeviceDirect3DCreateData &)=0
[AI] Creates a rendering device using Direct3D parameters.
virtual Group * CreateGroup(const Group *pParent=0)=0
[AI] Creates a new group (scene graph node), optionally parented.
[AI] Represents a GPU or system memory texture for use in rendering.
virtual Result SetTexels(int width, int height, int bitsPerTexel, void *pTexels)=0
[AI] Sets the texture image data (texels and size).
virtual void FillRowsOfTexture(int y, int height, void *pBuffer)=0
[AI] Fills lines of texel data in the image buffer.
virtual Result Changed(int texelsChanged, int paletteChanged)=0
[AI] Notifies of changes to texels or palette.
virtual Result SetPalette(int entryCount, PaletteEntry *pEntries)=0
[AI] Assigns a palette to the texture.
virtual Result GetBufferAndPalette(int *pWidth, int *pHeight, int *pDepth, void **ppBuffer, int *pPaletteSize, PaletteEntry **ppPalette)=0
[AI] Retrieves texture buffer and palette for external access.
[AI] Represents a rendering viewport and drawing context.
virtual Result Render(const Group *)=0
[AI] Renders a group hierarchy to the view.
virtual Result SetCamera(const Camera *)=0
[AI] Sets the camera used by the view.
virtual Result SetBackgroundColor(float r, float g, float b)=0
[AI] Sets the background color for the view.
virtual Result Pick(unsigned long x, unsigned long y, const Group **ppGroupsToPickFrom, int groupsToPickFromCount, const Group **&rppPickedGroups, int &rPickedGroupCount)=0
[AI] Picks the group under screen coordinates, searching specific group trees.
virtual Result Remove(const Light *)=0
[AI] Removes a light from the view.
virtual Result TransformScreenToWorld(const float screen[4], float world[3])=0
[AI] Converts screen coordinate back to world position.
virtual Result SetProjection(ProjectionType)=0
[AI] Sets projection type for the view (e.g., perspective/orthographic).
virtual Result TransformWorldToScreen(const float world[3], float screen[4])=0
[AI] Transforms a world-space position to screen coordinates.
virtual Result SetFrustrum(float frontClippingDistance, float backClippingDistance, float degrees)=0
[AI] Sets front and back clipping planes and view field in degrees.
virtual Result Clear()=0
[AI] Clears the current contents of the view.
virtual Result Add(const Light *)=0
[AI] Adds a light to the view for rendering.
virtual Result ForceUpdate(unsigned long x, unsigned long y, unsigned long width, unsigned long height)=0
[AI] Forces update/redraw of a region in the view.
virtual Result GetBackgroundColor(float *r, float *g, float *b)=0
[AI] Retrieves the current background color.
[AI] Namespace containing all classes related to the 3D graphics abstraction/rendering engine.
Renderer * CreateRenderer()
[AI] Instantiates and returns a new Tgl::Renderer implementation.
int Succeeded(Result result)
[AI] Returns whether a Tgl::Result indicates success.
ShadingModel
[AI] Represents shading models available for rendering geometry.
@ UnlitFlat
[AI] Flat shading without lighting calculations. [AI]
@ Flat
[AI] Flat shaded, possibly single color per polygon with lighting. [AI]
@ Phong
[AI] Phong (pixel-level) shading, if supported. [AI]
@ Gouraud
[AI] Gouraud (vertex-interpolated) shading. [AI]
@ Wireframe
[AI] No shading; renders only mesh edges. [AI]
TextureMappingMode
[AI] Methods for mapping textures onto geometry.
@ PerspectiveCorrect
[AI] Perspective-correct mapping (higher quality). [AI]
@ Linear
[AI] Linear interpolation (faster, less accurate). [AI]
ProjectionType
[AI] Projection modes for camera/view transforms.
@ Perspective
[AI] Distant objects appear smaller. [AI]
@ Orthographic
[AI] Objects keep constant size regardless of distance. [AI]
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]
ColorModel
[AI] Represents available color models for rendering.
@ RGB
[AI] Uses direct RGB color values. [AI]
@ Ramp
[AI] Uses a color ramp (palette/indexed color). [AI]
float FloatMatrix4[4][4]
[AI] Represents a 4x4 matrix of single-precision floating point values.
LightType
[AI] Types of lights supported in the renderer.
@ Point
[AI] Light emitted from a point in all directions. [AI]
@ ParallelPoint
[AI] Similar to point, but with parallel rays. [AI]
@ Directional
[AI] Parallel light rays, such as sunlight. [AI]
@ Ambient
[AI] Non-directional lighting applied equally everywhere. [AI]
@ Spot
[AI] Light that emits a cone-shaped beam from a point. [AI]
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]
[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_pFrontBuffer
[AI] Primary output surface. [AI]
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]
HWND m_hWnd
[AI] Window handle for display output. [AI]
[AI] Represents a single color entry in a palette.
unsigned char m_blue
[AI] Blue component. [AI]
unsigned char m_green
[AI] Green component. [AI]
unsigned char m_red
[AI] Red component. [AI]