omegalib
13.1
|
Contains information about the context in which drawing operations take place. More...
#include <DrawContext.h>
Public Types | |
enum | Eye { EyeLeft, EyeRight, EyeCyclop } |
enum | Task { SceneDrawTask, OverlayDrawTask } |
Public Member Functions | |
DrawContext () | |
void | prepare (uint64 frameNum) |
void | drawFrame (uint64 frameNum) |
The drawFrame method is the 'entry point' called by the display system to render a full frame. More... | |
void | updateViewport () |
Updates the pixel viewport of this context, based on the actual tile viewport, active eye and stereo settings. More... | |
void | setupInterleaver () |
void | setupStereo () |
void | initializeStencilInterleaver () |
void | initializeQuad () |
DisplayTileConfig::StereoMode | getCurrentStereoMode () |
bool | isSideBySideStereoEnabled () |
Utility method: returns true if side by side stereo is enabled in this context. More... | |
void | updateTransforms (const AffineTransform3 &head, const AffineTransform3 &view, float eyeSeparation, float nearZ, float farZ) |
Updates the viewport based on the view size and position an the size of the overall canvas. More... | |
Public Attributes | |
uint64 | frameNum |
AffineTransform3 | modelview |
Transform3 | projection |
Rect | viewport |
The viewMin and viewMax are normalized coordinates of the view bounds on the current tile (that is, the size of the current rendered view on the current tile). More... | |
Eye | eye |
The eye being rendered for this context. More... | |
Task | task |
The current draw task. More... | |
DisplayTileConfig * | tile |
Information about the drawing channel associated with this context. More... | |
RenderTarget * | drawBuffer |
GpuContext * | gpuContext |
Renderer * | renderer |
DrawInterface * | drawInterface |
Camera * | camera |
The camera currently rendering this context. More... | |
short | stencilInitialized |
Stencil initialization value. More... | |
short | quadInitialized |
int | stencilMaskWidth |
int | stencilMaskHeight |
Queue< DisplayTileConfig * > | tileStack |
Tile stack Lets cameras push/pop tiles, to support rendering with custom tile definitions. More... | |
void | pushTileConfig (DisplayTileConfig *newtile) |
void | popTileConfig () |
Contains information about the context in which drawing operations take place.
DrawContext is a fully self-contained description of rendering operations that make up a full frame.
omega::DrawContext::DrawContext | ( | ) |
void omega::DrawContext::drawFrame | ( | uint64 | frameNum | ) |
The drawFrame method is the 'entry point' called by the display system to render a full frame.
drawFrame does all required setup operations (viewport, stereo mode etc), and calls the Renderer draw method mltiple times to draw active eyes for the scene and overlay layers. The renderer draw method in turn renders secondary cameras and performs drawing with all the active render passes.
DisplayTileConfig::StereoMode omega::DrawContext::getCurrentStereoMode | ( | ) |
void omega::DrawContext::initializeQuad | ( | ) |
void omega::DrawContext::initializeStencilInterleaver | ( | ) |
|
inline |
Utility method: returns true if side by side stereo is enabled in this context.
void omega::DrawContext::popTileConfig | ( | ) |
void omega::DrawContext::prepare | ( | uint64 | frameNum | ) |
void omega::DrawContext::pushTileConfig | ( | DisplayTileConfig * | newtile | ) |
void omega::DrawContext::setupInterleaver | ( | ) |
void omega::DrawContext::setupStereo | ( | ) |
void omega::DrawContext::updateTransforms | ( | const AffineTransform3 & | head, |
const AffineTransform3 & | view, | ||
float | eyeSeparation, | ||
float | nearZ, | ||
float | farZ | ||
) |
Updates the viewport based on the view size and position an the size of the overall canvas.
Updates the modelview and projection matrices based on head / view transform and eye separation. Crrent eye is read from context.
void omega::DrawContext::updateViewport | ( | ) |
Updates the pixel viewport of this context, based on the actual tile viewport, active eye and stereo settings.
Camera* omega::DrawContext::camera |
The camera currently rendering this context.
RenderTarget* omega::DrawContext::drawBuffer |
DrawInterface* omega::DrawContext::drawInterface |
Eye omega::DrawContext::eye |
The eye being rendered for this context.
uint64 omega::DrawContext::frameNum |
GpuContext* omega::DrawContext::gpuContext |
AffineTransform3 omega::DrawContext::modelview |
Transform3 omega::DrawContext::projection |
short omega::DrawContext::quadInitialized |
Renderer* omega::DrawContext::renderer |
short omega::DrawContext::stencilInitialized |
Stencil initialization value.
If = 1, stencil has been initialized if = 0, stencil will be initialized this frame. If = -N, stencil will be initialized in N frames. The frame delay is useful to make sure OS windows and frame buffers have been updated before a stencil mask update.
int omega::DrawContext::stencilMaskHeight |
int omega::DrawContext::stencilMaskWidth |
Task omega::DrawContext::task |
The current draw task.
DisplayTileConfig* omega::DrawContext::tile |
Information about the drawing channel associated with this context.
Queue<DisplayTileConfig*> omega::DrawContext::tileStack |
Tile stack Lets cameras push/pop tiles, to support rendering with custom tile definitions.
Rect omega::DrawContext::viewport |
The viewMin and viewMax are normalized coordinates of the view bounds on the current tile (that is, the size of the current rendered view on the current tile).
These values are computed intersecting the tile position and size on the global canvas with the active camera view position and size. The view minimum and maximum bounds influence the frustum shape and pixel viewport. The pixel viewport coordinates of this context with respect to the owner window of the context.