QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Q::Screen Struct Reference
[User Interface]

The display mechanism. More...

#include <Q/q.h>

Inheritance diagram for Q::Screen:

Q::ObjectBase List of all members.

Public Types

enum  PerformanceCounter {
  triangle,
  update,
  shader,
  matrix,
  texture
}
enum  MouseFocusChange {
  mouseFocusNone,
  mouseFocusOver,
  mouseFocusClick,
  mouseFocusOverClick
}
enum  KeyFocusChange {
  keyFocusNone,
  keyFocusFollowMouse
}

Public Member Functions

 Screen ()
 ~Screen ()
Maths::Vec2f virtualExtent () const
Maths::Vec2f physicalExtent () const
Maths::Vec2f physicalAspect () const
Layer keyboardFocus () const
KeyFocusChange keyboardFocusChange () const
Layer mouseFocus () const
MouseFocusChange mouseFocusChange () const
Layer alwaysTopLayer () const
SpeakerSet speakerSet () const
size_t renderCacheSize () const
size_t textureCacheSize () const
bool textureBitDepthClamp () const
Utils::Result setPhysicalExtent (const Maths::Vec2f &box)
Utils::Result setKeyboardFocusChange (KeyFocusChange)
Utils::Result setMouseFocusChange (MouseFocusChange)
Utils::Result setSpeakerSet (const SpeakerSet &)
Utils::Result setRenderCacheSize (size_t)
Utils::Result setTextureCacheSize (size_t size)
Utils::Result setTextureBitDepthClamp (bool)
Utils::Result moveToTop (const Layer &layer)
Utils::Result moveToBottom (const Layer &layer)
Utils::Result moveLayerOver (const Layer &layer1, const Layer &layer2)
Utils::Result moveLayerUnder (const Layer &layer1, const Layer &layer2)
bool isLayerAbove (const Layer &layer1, const Layer &layer2)
Layer layerAbove (const Layer &l) const
Layer layerBelow (const Layer &l) const
Utils::Result setKeyboardFocus (const Layer &layer)
Utils::Result setMouseFocus (const Layer &layer)
unsigned int readCounter (PerformanceCounter) const
Utils::Result resetCounter (PerformanceCounter)
Utils::Result initMouse (const Maths::Vec2f sensitivity, bool allowPositionEvents, bool allowMoveEvents)
Utils::Result filterMouseEvents (bool allowPositionEvents, bool allowMoveEvents)
Maths::Vec2f mousePos () const
Utils::Result setMousePos (const Maths::Vec2f &virtPos)
Maths::Vec2f mouseSensitivity () const
Utils::Result setMouseSensitivity (const Maths::Vec2f sensitivity)

Static Public Member Functions

Screen create (const char *screenName, const char *inputName, const char *displayName, const Maths::Vec2f &physicalExtent, const Maths::Vec2f &virtualExtent, unsigned int depth, bool fullscreen)
Screen create (Draw::WindowInfo *winInfo, const char *inputName, const char *displayName, const Maths::Vec2f &physicalExtent, const Maths::Vec2f &virtualExtent, unsigned int depth)
ClassType classType ()
Screen cast (const ObjectBase &)

Detailed Description

The display mechanism.

The screen represents a physical output device. The screen contains a stack of two dimensional layers. The layers can range from simple colored or textured rectangles to full three-dimensional scenes. Typically, the user interface of an application is made up from a number of textured layers and one or more three-dimensional camera layers.


Member Enumeration Documentation

enum Q::Screen::KeyFocusChange
 

Define how keyboard focus is transitioned between layers.

enum Q::Screen::MouseFocusChange
 

Define how mouse focus is transitioned between layers.

The mode mouseFocusOverClick specifies that a layer gains focus when the mouse is placed over it but does not loose focus if any mouse button is down when the mouse leaves the layer boundary - only after all buttons are released does the layer loose focus.

enum Q::Screen::PerformanceCounter
 

The types of perfomance counters available on the screen.

Enumeration values:
triangle  The total number of triangles rendered.
update  The total number of frames that have been rendered.
shader  The total number of shaders that were set to the driver.
matrix  The total number of times that the matrix stacks were changed.
texture  The sum of the number of unique textures used per frame.


Constructor & Destructor Documentation

Q::Screen::Screen  ) 
 

Create a null Screen handle.

Q::Screen::~Screen  ) 
 

Destroy the screen.


Member Function Documentation

Layer Q::Screen::alwaysTopLayer  )  const
 

Return the current 'alwaysTop' layer, if any. This is the last layer having the 'alwaysTop' property which was added to the screen. This layer will always be rendered on top of any other layer.

Screen Q::Screen::cast const ObjectBase  )  [static]
 

If the object referenced by obj is a screen, then return a suitable reference to the object.

ClassType Q::Screen::classType  )  [static]
 

Return the type of this class.

Screen Q::Screen::create Draw::WindowInfo winInfo,
const char *  inputName,
const char *  displayName,
const Maths::Vec2f physicalExtent,
const Maths::Vec2f virtualExtent,
unsigned int  depth
[static]
 

Create a screen for the Q::Application. The underlying QDraw parameters for selecting input driver, display driver and window info are given by inputName, displayName and winInfo respectively. See the driver documentation for driver details. The winInfo parameter, if non-zero, can be used to specify platform-specific data, such as a pre-created window or a parameter controlling the display device.

See also:
draw_os.h
Two types of screen are supported - the first type, called 'fullscreen mode', changes mode to the closest supported screen mode to physicalExtent and supports rendering to the entire screen area. The second, 'windowed mode' creates a window with dimension physicalExtent and supports rendering into the client area of that window.

The parameters virtualExtent are used to specify a virtual two-dimensional coordinate system layered on top of the physical screen dimensions. This allows such things as screen layouts to be designed independently from the actual runtime screen mode and helps present a consistent look and feel whatever the selected screen mode. Coordinates in the virtual screen coordinate system have an origin at the bottom left of the screen with the Y axis pointing upwards and the X axis rightwards.

Only one screen can be created at a time. Any attempt to create another screen will return an invalid handle.

The current screen can be accessed by Application::app().screen().

Screen Q::Screen::create const char *  screenName,
const char *  inputName,
const char *  displayName,
const Maths::Vec2f physicalExtent,
const Maths::Vec2f virtualExtent,
unsigned int  depth,
bool  fullscreen
[static]
 

Create a screen for the Q::Application. The underlying QDraw parameters for selecting input driver and display driver are given by inputName, displayName respectively; see the driver documentation for more details. The screenName specifies the name to be used on the window that is created.

Two types of screen are supported - the first called 'fullscreen mode', changes mode to the closest supported screen mode to physicalExtent and supports rendering to the entire screen area. The second, 'windowed mode' creates a window with dimension physicalExtent and supports rendering into the client area of that window.

The parameters virtualExtent are used to specify a virtual two-dimensional coordinate system layered on top of the physical screen dimensions. This allows such things as screen layouts to be designed independently from the actual runtime screen mode and helps present a consistent look and feel whatever the selected screen mode. Coordinates in the virtual screen coordinate system have an origin at the bottom left of the screen with the Y axis pointing upwards and the X axis rightwards.

Only one screen can be created at a time. Any attempt to create another screen will return an invalid handle.

The current screen can be accessed by Q::Application::app().screen().

Utils::Result Q::Screen::filterMouseEvents bool  allowPositionEvents,
bool  allowMoveEvents
 

Block or allow the transmission of MouseMove and MousePosition events to the layer listeners.

Utils::Result Q::Screen::initMouse const Maths::Vec2f  sensitivity,
bool  allowPositionEvents,
bool  allowMoveEvents
 

Allow the Screen to manage mouse positions. This allows registered layers to receive both position events and relative mouse move events.

Calling initMouse enables various "managed mouse" features in Screen and is designed for apps that wish to use a mouse cursor consistently in both windowed and fullscreen mode.

It switches the input driver over into a mode which sends mouse delta information.

If you configure Screen to use the DX7 input driver, this works well as mouse delta information is sent direct from the device. If however you use the win32 driver, mouse delta information is derived from the raw win32 mouse position information, so you may see bad clipping behaviour if the win32 mouse reaches the edges of the screen (as mouse deltas are derived from the position of the win32 cursor rather than direct from the mouse movement).

After a call to initMouse, the following features become valid: filterMouseEvents, mousePos, setMousePos, mouseSensitivity, setMouseSensitivity

Warning:
initMouse and its associated features have only been tested with the DX7 input drivers. win32 input has not been thoroughly tested in conjunction with initMouse. Using this system is not advised unless you really know what you want from it.

bool Q::Screen::isLayerAbove const Layer layer1,
const Layer layer2
 

Return true if layer1 is somewhere above layer2.

Layer Q::Screen::keyboardFocus  )  const
 

Return the layer which currently holds the keyboard focus.

KeyFocusChange Q::Screen::keyboardFocusChange  )  const
 

Return the current policy for arbitrating keyboard focus between layers.

Layer Q::Screen::layerAbove const Layer l  )  const
 

Return the layer directly above the given layer. Return a null layer if the layer is at the top of the stack.

Layer Q::Screen::layerBelow const Layer l  )  const
 

Return the layer directly below the given layer. Return a null layer if the layer is at the bottom of the stack.

Layer Q::Screen::mouseFocus  )  const
 

Return the layer which currently holds the mouse focus.

MouseFocusChange Q::Screen::mouseFocusChange  )  const
 

Return the current policy for arbitrating mouse focus between layers.

Maths::Vec2f Q::Screen::mousePos  )  const
 

Valid only after a call to initMouse. Return the current mouse position in the screen's virtual coordinate system.

Maths::Vec2f Q::Screen::mouseSensitivity  )  const
 

Valid only after a call to initMouse. Return the mouse sensitivity parameters. The mousemove delta values read from the input device are scaled by this factor before calculating the mouse screen position.

Utils::Result Q::Screen::moveLayerOver const Layer layer1,
const Layer layer2
 

Move layer1 directly over layer2. If layer2 is null, move layer1 to the bottom of the stack. The value of layer2::depth() becomes the same as layer1::depth() afterwards.

Utils::Result Q::Screen::moveLayerUnder const Layer layer1,
const Layer layer2
 

Move layer1 directly under layer2. If layer2 is null, move layer1 to the top of the stack. The value of layer2::depth() becomes the same as layer1::depth() afterwards.

Utils::Result Q::Screen::moveToBottom const Layer layer  ) 
 

Move a layer to the bottom of the stack of layers.

Utils::Result Q::Screen::moveToTop const Layer layer  ) 
 

Move a layer to the top of the stack of layers.

Maths::Vec2f Q::Screen::physicalAspect  )  const
 

Return the physical aspect ratio of the screen.

Maths::Vec2f Q::Screen::physicalExtent  )  const
 

Return the physical extent of the screen.

unsigned int Q::Screen::readCounter PerformanceCounter   )  const
 

Read the value of a performance counter.

size_t Q::Screen::renderCacheSize  )  const
 

Return the size of the memory cache used to store optimised renderer data structures for visible objects.

See also:
setRenderCacheSize.

Utils::Result Q::Screen::resetCounter PerformanceCounter   ) 
 

Reset the value of a performance counter.

Utils::Result Q::Screen::setKeyboardFocus const Layer layer  ) 
 

Set the keyboard focus to the given layer.

Utils::Result Q::Screen::setKeyboardFocusChange KeyFocusChange   ) 
 

Set the policy used for managing the keyboard focus.

Utils::Result Q::Screen::setMouseFocus const Layer layer  ) 
 

Set the mouse focus to the given layer.

Utils::Result Q::Screen::setMouseFocusChange MouseFocusChange   ) 
 

Set the policy used for managing the mouse focus.

Utils::Result Q::Screen::setMousePos const Maths::Vec2f virtPos  ) 
 

For use only after a call to initMouse. Set the position of the mouse in the screen's virtual coordinate system. Sends a MousePosition event to layer listeners if allowPositionEvents is set true.

Utils::Result Q::Screen::setMouseSensitivity const Maths::Vec2f  sensitivity  ) 
 

Valid only after a call to . Set the mouse sensitivity. The mousemove delta values read from the input device are scaled by this factor before calculating the mouse screen position.

Utils::Result Q::Screen::setPhysicalExtent const Maths::Vec2f box  ) 
 

Set the extent of the screen's physical coordinate system.

Utils::Result Q::Screen::setRenderCacheSize size_t   ) 
 

Set the size in bytes of the memory cache used to store optimised renderer data structures for visible objects. The default size is 8MB.

Utils::Result Q::Screen::setSpeakerSet const SpeakerSet  ) 
 

Set the speaker set associated with the screen. The speaker set is initialised at that point.

Utils::Result Q::Screen::setTextureBitDepthClamp bool   ) 
 

Enable the clamping of textures to 16 bit pixel formats.

Utils::Result Q::Screen::setTextureCacheSize size_t  size  ) 
 

Set the size in bytes of the system memory cache used for textures. The texture cache is irrelevant on PC. The default value on Xbox and PS2 is 2MB.

See also:
Draw::Renderer::setTextureCacheSize

SpeakerSet Q::Screen::speakerSet  )  const
 

Return the speaker set associated with the screen

bool Q::Screen::textureBitDepthClamp  )  const
 

Return true if textures are clamped to 16 bit pixel formats.

size_t Q::Screen::textureCacheSize  )  const
 

Return the size of the memory cache used for textures.

See also:
setTextureCacheSize.

Maths::Vec2f Q::Screen::virtualExtent  )  const
 

Return the virtual extent of the screen.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004