#include <W3DDisplay.h>
Inherits Display.
Public Member Functions | |
| W3DDisplay () | |
| ~W3DDisplay () | |
| virtual void | init (void) |
| initialize or re-initialize the sytsem | |
| virtual void | reset (void) |
| Reset system. | |
| virtual void | setWidth (UnsignedInt width) |
| virtual void | setHeight (UnsignedInt height) |
| virtual Bool | setDisplayMode (UnsignedInt xres, UnsignedInt yres, UnsignedInt bitdepth, Bool windowed) |
| virtual Int | getDisplayModeCount (void) |
| return number of display modes/resolutions supported by video card. | |
| virtual void | getDisplayModeDescription (Int modeIndex, Int *xres, Int *yres, Int *bitDepth) |
| return description of mode | |
| virtual void | setGamma (Real gamma, Real bright, Real contrast, Bool calibrate) |
| virtual void | doSmartAssetPurgeAndPreload (const char *usageFileName) |
| virtual void | setClipRegion (IRegion2D *region) |
| Set clip rectangle for 2D draw operations. | |
| virtual Bool | isClippingEnabled (void) |
| virtual void | enableClipping (Bool onoff) |
| virtual void | draw (void) |
| redraw the entire display | |
| virtual void | createLightPulse (const Coord3D *pos, const RGBColor *color, Real innerRadius, Real outerRadius, UnsignedInt increaseFrameTime, UnsignedInt decayFrameTime) |
| virtual void | setTimeOfDay (TimeOfDay tod) |
| Set the time of day for this display. | |
| virtual void | drawLine (Int startX, Int startY, Int endX, Int endY, Real lineWidth, UnsignedInt lineColor) |
| draw a line on the display in screen coordinates | |
| virtual void | drawLine (Int startX, Int startY, Int endX, Int endY, Real lineWidth, UnsignedInt lineColor1, UnsignedInt lineColor2) |
| draw a line on the display in screen coordinates | |
| virtual void | drawOpenRect (Int startX, Int startY, Int width, Int height, Real lineWidth, UnsignedInt lineColor) |
| draw a rect border on the display in pixel coordinates with the specified color | |
| virtual void | drawFillRect (Int startX, Int startY, Int width, Int height, UnsignedInt color) |
| draw a filled rect on the display in pixel coords with the specified color | |
| virtual void | drawRectClock (Int startX, Int startY, Int width, Int height, Int percent, UnsignedInt color) |
| Draw a percentage of a rectangle, much like a clock (0 to x%) | |
| virtual void | drawRemainingRectClock (Int startX, Int startY, Int width, Int height, Int percent, UnsignedInt color) |
| Draw's the remaining percentage of a rectangle (x% to 100) | |
| virtual void | drawImage (const Image *image, Int startX, Int startY, Int endX, Int endY, Color color=0xFFFFFFFF, DrawImageMode mode=DRAW_IMAGE_ALPHA) |
| draw an image fit within the screen coordinates | |
| virtual void | drawVideoBuffer (VideoBuffer *buffer, Int startX, Int startY, Int endX, Int endY) |
| draw a video buffer fit within the screen coordinates | |
| virtual VideoBuffer * | createVideoBuffer (void) |
| Create a video buffer that can be used for this display. | |
| virtual void | takeScreenShot (void) |
| Save Screen Capture to a file. | |
| virtual void | toggleMovieCapture (void) |
| virtual void | toggleLetterBox (void) |
| enabled letter-boxed display | |
| virtual void | enableLetterBox (Bool enable) |
| forces letter-boxed display on/off | |
| virtual Bool | isLetterBoxFading (void) |
| returns true while letterbox fades in/out | |
| virtual Bool | isLetterBoxed (void) |
| virtual void | clearShroud () |
| empty the entire shroud | |
| virtual void | setShroudLevel (Int x, Int y, CellShroudStatus setting) |
| set shroud | |
| virtual void | setBorderShroudLevel (UnsignedByte level) |
| color that will appear in unused border terrain. | |
| virtual void | preloadModelAssets (AsciiString model) |
| preload model asset | |
| virtual void | preloadTextureAssets (AsciiString texture) |
| preload texture asset | |
| void | drawFPSStats (void) |
| draw the fps on the screen | |
| virtual Real | getAverageFPS (void) |
| return the average FPS. | |
| virtual Int | getLastFrameDrawCalls (void) |
| returns the number of draw calls issued in the previous frame | |
Public Member Functions inherited from Display | |
| Display () | |
| virtual | ~Display () |
| virtual void | update (void) |
| Update system. | |
| virtual UnsignedInt | getWidth (void) |
| Returns the width of the display. | |
| virtual UnsignedInt | getHeight (void) |
| Returns the height of the display. | |
| virtual void | setBitDepth (UnsignedInt bitDepth) |
| virtual UnsignedInt | getBitDepth (void) |
| virtual void | setWindowed (Bool windowed) |
| set windowd/fullscreen flag | |
| virtual Bool | getWindowed (void) |
| return widowed/fullscreen flag | |
| virtual Bool | testMinSpecRequirements (Bool *videoPassed, Bool *cpuPassed, Bool *memPassed, StaticGameLODLevel *idealVideoLevel=NULL, Real *cpuTime=NULL) |
| virtual void | attachView (View *view) |
| Attach the given view to the world. | |
| virtual View * | getFirstView (void) |
| Return the first view of the world. | |
| virtual View * | getNextView (View *view) |
| virtual void | drawViews (void) |
| Render all views of the world. | |
| virtual void | updateViews (void) |
| Updates state of world views. | |
| virtual void | playLogoMovie (AsciiString movieName, Int minMovieLength, Int minCopyrightLength) |
| FullScreen video playback. | |
| virtual void | playMovie (AsciiString movieName) |
| virtual void | stopMovie (void) |
| virtual Bool | isMoviePlaying (void) |
| virtual void | setDebugDisplayCallback (DebugDisplayCallback *callback, void *userData=NULL) |
| Register debug display callback. | |
| virtual DebugDisplayCallback * | getDebugDisplayCallback () |
| virtual void | setCinematicText (AsciiString string) |
| virtual void | setCinematicFont (GameFont *font) |
| virtual void | setCinematicTextFrames (Int frames) |
Public Member Functions inherited from SubsystemInterface | |
| SubsystemInterface () | |
| virtual | ~SubsystemInterface () |
| virtual void | postProcessLoad () |
| void | UPDATE (void) |
| void | DRAW (void) |
| AsciiString | getName (void) |
| void | setName (AsciiString name) |
Static Public Attributes | |
| static RTS3DScene * | m_3DScene = NULL |
| our 3d scene representation | |
| static RTS2DScene * | m_2DScene = NULL |
| our 2d scene representation | |
| static RTS3DInterfaceScene * | m_3DInterfaceScene = NULL |
| our 3d interface scene that draws last (for 3d mouse cursor, etc) | |
| static W3DAssetManager * | m_assetManager = NULL |
| W3D asset manager. | |
Protected Types | |
| enum | { FPS , Frame , Polygons , Vertices , VideoRam , DebugInfo , KEY_MOUSE_STATES , MousePosition , Particles , Objects , NetIncoming , NetOutgoing , NetStats , NetFPSAverages , SelectedInfo , TerrainStats , DisplayStringCount } |
Protected Member Functions | |
| void | initAssets (void) |
| init assets for WW3D | |
| void | init3DScene (void) |
| init 3D scene for WW3D | |
| void | init2DScene (void) |
| init 2D scene for WW3D | |
| void | gatherDebugStats (void) |
| compute debug stats | |
| void | drawDebugStats (void) |
| display debug stats | |
| void | drawCurrentDebugDisplay (void) |
| draws current debug display | |
| void | calculateTerrainLOD (void) |
| Calculate terrain LOD. | |
| void | renderLetterBox (UnsignedInt time) |
| draw letter box border | |
| void | updateAverageFPS (void) |
| figure out the average fps over the last 30 frames. | |
Protected Member Functions inherited from Display | |
| virtual void | deleteViews (void) |
| delete all views | |
Protected Attributes | |
| Byte | m_initialized |
| TRUE when system is initialized. | |
| LightClass * | m_myLight [LightEnvironmentClass::MAX_LIGHTS] |
| light hack for now | |
| Render2DClass * | m_2DRender |
| interface for common 2D functions | |
| IRegion2D | m_clipRegion |
| the clipping region for images | |
| Bool | m_isClippedEnabled |
| used by 2D drawing operations to define clip re | |
| Real | m_averageFPS |
| average fps over the last 30 frames. | |
| DisplayString * | m_displayStrings [DisplayStringCount] |
| DisplayString * | m_benchmarkDisplayString |
| W3DDebugDisplay * | m_nativeDebugDisplay |
| W3D specific debug display interface. | |
Protected Attributes inherited from Display | |
| UnsignedInt | m_width |
| UnsignedInt | m_height |
| Dimensions of the display. | |
| UnsignedInt | m_bitDepth |
| bit depth of the display | |
| Bool | m_windowed |
| TRUE when windowed, FALSE when fullscreen. | |
| View * | m_viewList |
| All of the views into the world. | |
| AsciiString | m_cinematicText |
| string of the cinematic text that should be displayed | |
| GameFont * | m_cinematicFont |
| font for cinematic text | |
| Int | m_cinematicTextFrames |
| count of how long the cinematic text should be displayed | |
| VideoBuffer * | m_videoBuffer |
| Video playback buffer. | |
| VideoStreamInterface * | m_videoStream |
| Video stream;. | |
| AsciiString | m_currentlyPlayingMovie |
| The currently playing video. Used to notify TheScriptEngine of completed videos. | |
| DebugDisplayInterface * | m_debugDisplay |
| Actual debug display. | |
| DebugDisplayCallback * | m_debugDisplayCallback |
| Code to update the debug display. | |
| void * | m_debugDisplayUserData |
| Data for debug display update handler. | |
| Real | m_letterBoxFadeLevel |
| tracks the current alpha level for fading letter-boxed mode in/out. | |
| Bool | m_letterBoxEnabled |
| current state of letterbox | |
| UnsignedInt | m_letterBoxFadeStartTime |
| time of letterbox fade start | |
| Int | m_movieHoldTime |
| time that we hold on the last frame of the movie | |
| Int | m_copyrightHoldTime |
| time that the copyright must be on the screen | |
| UnsignedInt | m_elapsedMovieTime |
| used to make sure we show the stuff long enough | |
| UnsignedInt | m_elapsedCopywriteTime |
| Hold on the last frame until both have expired. | |
| DisplayString * | m_copyrightDisplayString |
| this'll hold the display string | |
Protected Attributes inherited from SubsystemInterface | |
| AsciiString | m_name |
Additional Inherited Members | |
Public Types inherited from Display | |
| enum | DrawImageMode { DRAW_IMAGE_SOLID , DRAW_IMAGE_GRAYSCALE , DRAW_IMAGE_ALPHA , DRAW_IMAGE_ADDITIVE } |
| typedef void | DebugDisplayCallback(DebugDisplayInterface *debugDisplay, void *userData, FILE *fp=NULL) |
W3D implementation of the game display which is responsible for creating all interaction with the screen and updating the display
Definition at line 57 of file W3DDisplay.h.
|
protected |
Definition at line 174 of file W3DDisplay.h.
| W3DDisplay::W3DDisplay | ( | ) |
Definition at line 394 of file W3DDisplay.cpp.
| W3DDisplay::~W3DDisplay | ( | ) |
Definition at line 424 of file W3DDisplay.cpp.
|
protected |
Calculate terrain LOD.
Calculates an adequately speedy terrain Level Of Detail.
Definition at line 1568 of file W3DDisplay.cpp.
|
virtual |
|
virtual |
Create a "light pulse" which is a dynamic light that grows, decays and vanishes over several frames
Implements Display.
Definition at line 2079 of file W3DDisplay.cpp.
|
virtual |
Create a video buffer that can be used for this display.
Implements Display.
Definition at line 2800 of file W3DDisplay.cpp.
|
virtual |
Implements Display.
Definition at line 3249 of file W3DDisplay.cpp.
|
virtual |
redraw the entire display
Draw the entire W3D Display
Reimplemented from Display.
Definition at line 1664 of file W3DDisplay.cpp.
|
protected |
draws current debug display
Draw current debug display
Definition at line 1549 of file W3DDisplay.cpp.
|
protected |
|
virtual |
draw a filled rect on the display in pixel coords with the specified color
Implements Display.
Definition at line 2271 of file W3DDisplay.cpp.
| void W3DDisplay::drawFPSStats | ( | void | ) |
draw the fps on the screen
Draw the FPS on the screen
Definition at line 1524 of file W3DDisplay.cpp.
|
virtual |
draw an image fit within the screen coordinates
Draws an images at the screen coordinates and keeps it within the end screen coords specified
Implements Display.
Definition at line 2627 of file W3DDisplay.cpp.
|
virtual |
draw a line on the display in screen coordinates
draw a line on the display in pixel coordinates with the specified color
Implements Display.
Definition at line 2183 of file W3DDisplay.cpp.
|
virtual |
draw a line on the display in screen coordinates
draw a line on the display in pixel coordinates with the specified color
Implements Display.
Definition at line 2201 of file W3DDisplay.cpp.
|
virtual |
draw a rect border on the display in pixel coordinates with the specified color
Implements Display.
Definition at line 2219 of file W3DDisplay.cpp.
|
virtual |
Draw a percentage of a rectangle, much like a clock (0 to x%)
Implements Display.
Definition at line 2287 of file W3DDisplay.cpp.
|
virtual |
Draw's the remaining percentage of a rectangle (x% to 100)
Implements Display.
Definition at line 2451 of file W3DDisplay.cpp.
|
virtual |
draw a video buffer fit within the screen coordinates
Implements Display.
Definition at line 2853 of file W3DDisplay.cpp.
|
inlinevirtual |
Implements Display.
Definition at line 82 of file W3DDisplay.h.
|
virtual |
forces letter-boxed display on/off
Implements Display.
Definition at line 2116 of file W3DDisplay.cpp.
|
protected |
compute debug stats
Compute and display debug stats on screen
Definition at line 936 of file W3DDisplay.cpp.
|
virtual |
|
virtual |
return number of display modes/resolutions supported by video card.
Reimplemented from Display.
Definition at line 487 of file W3DDisplay.cpp.
|
virtual |
return description of mode
Reimplemented from Display.
Definition at line 519 of file W3DDisplay.cpp.
|
virtual |
returns the number of draw calls issued in the previous frame
Implements Display.
Definition at line 1653 of file W3DDisplay.cpp.
|
virtual |
initialize or re-initialize the sytsem
Initialize or re-initialize the W3D display system. Here we need to create our window, and get our 3D hardware setup and online
<set to 0xff to make collision boxes visible
< this makes text look good :)
Reimplemented from Display.
Definition at line 655 of file W3DDisplay.cpp.
|
protected |
init 2D scene for WW3D
This is the 2D scene, you can use it to draw on a 2D plane over the 3D background
Definition at line 646 of file W3DDisplay.cpp.
|
protected |
init 3D scene for WW3D
Definition at line 637 of file W3DDisplay.cpp.
|
protected |
init assets for WW3D
Definition at line 629 of file W3DDisplay.cpp.
|
inlinevirtual |
Implements Display.
Definition at line 81 of file W3DDisplay.h.
|
virtual |
Reimplemented from Display.
Definition at line 2070 of file W3DDisplay.cpp.
|
virtual |
returns true while letterbox fades in/out
Reimplemented from Display.
Definition at line 2060 of file W3DDisplay.cpp.
|
virtual |
preload model asset
Preload using the W3D asset manager the model referenced by the string parameter
Implements Display.
Definition at line 3219 of file W3DDisplay.cpp.
|
virtual |
preload texture asset
Preload using the W3D asset manager the texture referenced by the string parameter
Implements Display.
Definition at line 3236 of file W3DDisplay.cpp.
|
protected |
draw letter box border
Render letter-box border at top/bottom of display
Definition at line 2011 of file W3DDisplay.cpp.
|
virtual |
Reset system.
Reset the W3D display system. Here we need to remove the objects from the previous map.
Reimplemented from Display.
Definition at line 841 of file W3DDisplay.cpp.
|
virtual |
color that will appear in unused border terrain.
Implements Display.
Definition at line 2888 of file W3DDisplay.cpp.
|
virtual |
Set clip rectangle for 2D draw operations.
Set the clipping region for images.
Implements Display.
Definition at line 2870 of file W3DDisplay.cpp.
|
virtual |
Set resolution of display
Reimplemented from Display.
Definition at line 581 of file W3DDisplay.cpp.
Reimplemented from Display.
Definition at line 543 of file W3DDisplay.cpp.
|
virtual |
|
virtual |
set shroud
<
Implements Display.
Definition at line 2897 of file W3DDisplay.cpp.
|
virtual |
Set the time of day for this display.
Implements Display.
Definition at line 2151 of file W3DDisplay.cpp.
|
virtual |
|
virtual |
|
virtual |
|
virtual |
Start/Stop campturing an AVI movie
Implements Display.
Definition at line 3123 of file W3DDisplay.cpp.
|
protected |
figure out the average fps over the last 30 frames.
Update a moving average of the last 30 fps measurements. Also try to filter out temporary spikes. This code is designed to be used by the GameLOD sytems to determine the correct dynamic LOD setting.
Definition at line 874 of file W3DDisplay.cpp.
|
protected |
interface for common 2D functions
Definition at line 166 of file W3DDisplay.h.
|
static |
our 2d scene representation
Definition at line 144 of file W3DDisplay.h.
|
static |
our 3d interface scene that draws last (for 3d mouse cursor, etc)
Definition at line 145 of file W3DDisplay.h.
|
static |
our 3d scene representation
Definition at line 143 of file W3DDisplay.h.
|
static |
W3D asset manager.
Definition at line 146 of file W3DDisplay.h.
|
protected |
average fps over the last 30 frames.
Definition at line 169 of file W3DDisplay.h.
|
protected |
Definition at line 197 of file W3DDisplay.h.
|
protected |
the clipping region for images
Definition at line 167 of file W3DDisplay.h.
|
protected |
Definition at line 196 of file W3DDisplay.h.
|
protected |
TRUE when system is initialized.
Definition at line 164 of file W3DDisplay.h.
|
protected |
used by 2D drawing operations to define clip re
Definition at line 168 of file W3DDisplay.h.
|
protected |
light hack for now
Definition at line 165 of file W3DDisplay.h.
|
protected |
W3D specific debug display interface.
Definition at line 199 of file W3DDisplay.h.