Isle
|
[AI] Encapsulates a rendering surface, its associated hardware device, renderer, and view. More...
#include <tglsurface.h>
Classes | |
struct | CreateStruct |
[AI] Contains initialization parameters for creating a TglSurface and its underlying DDraw/D3D resources. More... | |
Public Member Functions | |
TglSurface () | |
[AI] Constructs a new TglSurface instance with members initialized to their default state. More... | |
virtual | ~TglSurface () |
[AI] Virtual destructor also triggers Destroy(). More... | |
virtual BOOL | Create (const CreateStruct &, Tgl::Renderer *, Tgl::Group *pScene) |
[AI] Creates and initializes the surface, rendering device, and optionally installs scene graph. More... | |
virtual void | Destroy () |
[AI] Destroys all resources (view, device), releasing scene and renderer references. More... | |
virtual double | Render () |
[AI] Renders a single frame and returns the render time for that frame. More... | |
Tgl::Renderer * | GetRenderer () const |
[AI] Gets the active renderer for this surface. More... | |
Tgl::Device * | GetDevice () const |
[AI] Returns the graphics device used by this surface, e.g. More... | |
Tgl::View * | GetView () const |
[AI] Gets the current view/camera for this surface. More... | |
Tgl::Group * | GetScene () const |
[AI] Returns the currently attached 3D scene root/group. More... | |
unsigned long | GetWidth () const |
[AI] Returns the width (in pixels) of the rendered surface. More... | |
unsigned long | GetHeight () const |
[AI] Returns the height (in pixels) of the rendered surface. More... | |
double | GetRenderingRate () const |
[AI] Returns the measured rendering rate (frames per second) for the rendering routine. More... | |
double | GetFrameRate () const |
[AI] Returns the measured frame rate (frames per second) for the current surface. More... | |
unsigned long | GetFrameCount () const |
[AI] Returns the frame count since creation or since last meter reset. More... | |
Protected Member Functions | |
virtual Tgl::View * | CreateView (Tgl::Renderer *, Tgl::Device *)=0 |
[AI] Abstract view creation. More... | |
virtual void | DestroyView () |
[AI] Destroys (deletes) the surface's view/camera, and resets the pointer to null. More... | |
[AI] Encapsulates a rendering surface, its associated hardware device, renderer, and view.
[AI] TglSurface is the main representation of a 3D rendering target, managing the renderer, device, viewport, and main scene group. It handles initialization, device creation, rendering timing/statistics, and render loop operations for LEGO Island's DirectX-based renderer. [AI]
Advanced users may subclass this to customize viewport creation or device handling. [AI]
Definition at line 32 of file tglsurface.h.
TglSurface::TglSurface | ( | ) |
[AI] Constructs a new TglSurface instance with members initialized to their default state.
Definition at line 16 of file tglsurface.cpp.
|
virtual |
[AI] Virtual destructor also triggers Destroy().
Frees device, view, and related resources.
Definition at line 38 of file tglsurface.cpp.
|
virtual |
[AI] Creates and initializes the surface, rendering device, and optionally installs scene graph.
[AI] This function selects the appropriate color, shading and texturing models for the provided DDraw surfaces, configures texture and color settings based on device format, and initializes the view/camera and rendering statistics. Subclassed implementations will usually handle advanced device and scene graph setup.
rCreateStruct | [AI] Initialization parameters (window, buffers, palette etc.). |
pRenderer | [AI] Renderer used to create and manage 3D device and scene. |
pScene | [AI] Top-level Tgl::Group representing the 3D scene graph root. |
TRUE | [AI] On successful device/view/scene setup. |
FALSE | [AI] If device/view failed to create/setup. |
Definition at line 76 of file tglsurface.cpp.
|
protectedpure virtual |
[AI] Abstract view creation.
Subclasses must override to provide appropriate view/camera for the surface.
pRenderer | [AI] The renderer with which to associate the new view. |
pDevice | [AI] The device on which this view will be rendered. |
Implemented in LegoView.
|
virtual |
[AI] Destroys all resources (view, device), releasing scene and renderer references.
[AI] Safe to call multiple times, always results in idle/inert surface.
Reimplemented in Lego3DView, LegoView, and LegoView1.
Definition at line 45 of file tglsurface.cpp.
|
protectedvirtual |
[AI] Destroys (deletes) the surface's view/camera, and resets the pointer to null.
[AI] Provided for use in cleanup and destruction workflows. Safe to call if view is null. [AI]
Definition at line 171 of file tglsurface.cpp.
|
inline |
[AI] Returns the graphics device used by this surface, e.g.
hardware or software abstraction.
Definition at line 102 of file tglsurface.h.
|
inline |
[AI] Returns the frame count since creation or since last meter reset.
[AI] Used for diagnostics, animation timing, or display statistics.
Definition at line 144 of file tglsurface.h.
|
inline |
[AI] Returns the measured frame rate (frames per second) for the current surface.
[AI] Uses the frame rate frequency meter to report the last few frames' average rate. [AI]
Definition at line 138 of file tglsurface.h.
|
inline |
[AI] Returns the height (in pixels) of the rendered surface.
Definition at line 126 of file tglsurface.h.
|
inline |
[AI] Gets the active renderer for this surface.
Definition at line 96 of file tglsurface.h.
|
inline |
[AI] Returns the measured rendering rate (frames per second) for the rendering routine.
[AI] Uses the rendering rate frequency meter to report recent rendering rate. [AI]
Definition at line 132 of file tglsurface.h.
|
inline |
[AI] Returns the currently attached 3D scene root/group.
Definition at line 114 of file tglsurface.h.
|
inline |
[AI] Gets the current view/camera for this surface.
Definition at line 108 of file tglsurface.h.
|
inline |
[AI] Returns the width (in pixels) of the rendered surface.
Definition at line 120 of file tglsurface.h.
|
virtual |
[AI] Renders a single frame and returns the render time for that frame.
[AI] Uses and updates the statistics meters for framerate and rendering time monitoring. Handles view-calling and statistics upkeep.
Definition at line 179 of file tglsurface.cpp.