GUIGraphics

Undocumented in source.
class GUIGraphics : UIElement , IGraphics {}

Constructors

this
this(int initialWidth, int initialHeight)
Undocumented in source.

Destructor

~this
~this()
Undocumented in source.

Members

Classes

StopWatch
class StopWatch
Undocumented in source.
WindowListener
class WindowListener
Undocumented in source.

Functions

closeUI
void closeUI()
Undocumented in source. Be warned that the author may not have intended to support it.
compositeGUI
void compositeGUI(ImageRef!RGBA wfb, WindowPixelFormat pf)

Compose lighting effects from depth and diffuse into a result. takes output image and non-overlapping areas as input Useful multithreading code.

doDraw
void doDraw(WindowPixelFormat pf)
Undocumented in source. Be warned that the author may not have intended to support it.
doResize
ImageRef!RGBA doResize(int width, int height)
Undocumented in source. Be warned that the author may not have intended to support it.
extendsDirtyRect
box2i extendsDirtyRect(box2i rect, int width, int height)
Undocumented in source. Be warned that the author may not have intended to support it.
getGUISize
void getGUISize(int* width, int* height)
Undocumented in source. Be warned that the author may not have intended to support it.
openUI
void* openUI(void* parentInfo, void* controlInfo, DAW daw, GraphicsBackend backend)
Undocumented in source. Be warned that the author may not have intended to support it.
recomputeDirtyAreas
void recomputeDirtyAreas()
Undocumented in source. Be warned that the author may not have intended to support it.
regenerateMipmaps
void regenerateMipmaps()

Compose lighting effects from depth and diffuse into a result. takes output image and non-overlapping areas as input Useful multithreading code.

renderElements
void renderElements()

Redraw UIElements

setUpdateMargin
void setUpdateMargin(int margin)

Tune this to tune the trade-off between light quality and speed. The default value was tuned by hand on very shiny light sources. Too high and processing becomes very expensive. Too little and the ligth decay doesn't feel natural.

Variables

_areasToRender
AlignedBuffer!box2i _areasToRender;
Undocumented in source.
_areasToRenderNonOverlapping
AlignedBuffer!box2i _areasToRenderNonOverlapping;
Undocumented in source.
_areasToRenderNonOverlappingTiled
AlignedBuffer!box2i _areasToRenderNonOverlappingTiled;
Undocumented in source.
_areasToUpdateNonOverlapping
AlignedBuffer!box2i _areasToUpdateNonOverlapping;
Undocumented in source.
_areasToUpdateTemp
AlignedBuffer!box2i _areasToUpdateTemp;
Undocumented in source.
_askedHeight
int _askedHeight;
Undocumented in source.
_askedWidth
int _askedWidth;
Undocumented in source.
_compositingWatch
StopWatch _compositingWatch;
Undocumented in source.
_depthMap
Mipmap!L16 _depthMap;
Undocumented in source.
_diffuseMap
Mipmap!RGBA _diffuseMap;
Undocumented in source.
_drawWatch
StopWatch _drawWatch;
Undocumented in source.
_elemsToDraw
AlignedBuffer!UIElement _elemsToDraw;
Undocumented in source.
_elemsToDrawScratch
AlignedBuffer!UIElement _elemsToDrawScratch;

Temporary buffer for stable sorting of _elemsToDraw

_materialMap
Mipmap!RGBA _materialMap;
Undocumented in source.
_mipmapWatch
StopWatch _mipmapWatch;
Undocumented in source.
_renderedBuffer
ubyte* _renderedBuffer;
Undocumented in source.
_threadPool
ThreadPool _threadPool;
Undocumented in source.
_uiContext
UIContext _uiContext;
Undocumented in source.
_updateMargin
int _updateMargin;

Amount of pixels dirty rectangles are extended with.

_updateRectScratch
AlignedBuffer!box2i[2] _updateRectScratch;
Undocumented in source.
_window
IWindow _window;
Undocumented in source.
_windowListener
WindowListener _windowListener;
Undocumented in source.
compositor
ICompositor compositor;
Undocumented in source.

Inherited Members

From UIElement

~this
~this()
Undocumented in source.
render
void render(ImageRef!RGBA diffuseMap, ImageRef!L16 depthMap, ImageRef!RGBA materialMap, box2i[] areasToUpdate)
reflow
void reflow(box2i availableSpace)

Meant to be overriden almost everytime for custom behaviour. Default behaviour is to span the whole area and reflow children. Any layout algorithm is up to you. Children elements don't need to be inside their parent.

position
box2i position()
position
box2i position(box2i p)

Forces the position of the element. It is typically used in the parent reflow() method

child
UIElement child(int n)
Undocumented in source. Be warned that the author may not have intended to support it.
addChild
void addChild(UIElement element)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseClick
bool onMouseClick(int x, int y, int button, bool isDoubleClick, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseWheel
bool onMouseWheel(int x, int y, int wheelDeltaX, int wheelDeltaY, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseMove
void onMouseMove(int x, int y, int dx, int dy, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
onBeginDrag
void onBeginDrag()
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseDrag
void onMouseDrag(int x, int y, int dx, int dy, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
onStopDrag
void onStopDrag()
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseEnter
void onMouseEnter()
Undocumented in source. Be warned that the author may not have intended to support it.
onMouseExit
void onMouseExit()
Undocumented in source. Be warned that the author may not have intended to support it.
onKeyDown
bool onKeyDown(Key key)
Undocumented in source. Be warned that the author may not have intended to support it.
onKeyUp
bool onKeyUp(Key key)
Undocumented in source. Be warned that the author may not have intended to support it.
mouseClick
bool mouseClick(int x, int y, int button, bool isDoubleClick, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
mouseRelease
void mouseRelease(int x, int y, int button, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
mouseWheel
bool mouseWheel(int x, int y, int wheelDeltaX, int wheelDeltaY, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
mouseMove
void mouseMove(int x, int y, int dx, int dy, MouseState mstate)
Undocumented in source. Be warned that the author may not have intended to support it.
keyDown
bool keyDown(Key key)
Undocumented in source. Be warned that the author may not have intended to support it.
keyUp
bool keyUp(Key key)
Undocumented in source. Be warned that the author may not have intended to support it.
animate
void animate(double dt, double time)
Undocumented in source. Be warned that the author may not have intended to support it.
context
UIContext context()
Undocumented in source. Be warned that the author may not have intended to support it.
isVisible
bool isVisible()
Undocumented in source. Be warned that the author may not have intended to support it.
setVisible
void setVisible(bool visible)
Undocumented in source. Be warned that the author may not have intended to support it.
zOrder
int zOrder()
Undocumented in source. Be warned that the author may not have intended to support it.
setZOrder
void setZOrder(int zOrder)
Undocumented in source. Be warned that the author may not have intended to support it.
setDirtyWhole
void setDirtyWhole()

Mark this element as wholly dirty.

setDirty
void setDirty(box2i rect)

Mark a part of the element dirty. This part must be a subrect of the _position.

parent
UIElement parent()
topLevelParent
UIElement topLevelParent()
isMouseOver
bool isMouseOver()
Undocumented in source. Be warned that the author may not have intended to support it.
isDragged
bool isDragged()
Undocumented in source. Be warned that the author may not have intended to support it.
isFocused
bool isFocused()
Undocumented in source. Be warned that the author may not have intended to support it.
getDrawList
void getDrawList(AlignedBuffer!UIElement list)

Appends the Elements that should be drawn, in order. You should empty it before calling this function. Everything visible get into the draw list, but that doesn't mean they will get drawn if they don't overlap with a dirty area.

onDraw
void onDraw(ImageRef!RGBA diffuseMap, ImageRef!L16 depthMap, ImageRef!RGBA materialMap, box2i[] dirtyRects)

Draw method. You should redraw the area there. For better efficiency, you may only redraw the part in _dirtyRect. diffuseMap and depthMap are made to span _position exactly, so you can draw in the area (0 .. _position.width, 0 .. _position.height)

onAnimate
void onAnimate(double dt, double time)

Called periodically. Override this to create animations. Using setDirty there allows to redraw an element continuously (like a meter or an animated object). Warning: Summing dt will not lead to a time that increase like time. time can go backwards if the window was reopen. time is guaranteed to increase as fast as system time but is not synced to audio time.

_parent
UIElement _parent;

Parent element. Following this chain gets to the root element.

_position
box2i _position;

Position is the graphical extent An Element is not allowed though to draw further than its _position.

_children
AlignedBuffer!UIElement _children;
Undocumented in source.
_visible
bool _visible;

If _visible is false, neither the Element nor its children are drawn.

_zOrder
int _zOrder;

By default, every Element have the same z-order Because the sort is stable, tree traversal order is the default order (depth first).

From IGraphics

openUI
void* openUI(void* parentInfo, void* controlInfo, DAW daw, GraphicsBackend backend)

Create an UI, return a system-specific handle for the window/view

closeUI
void closeUI()
Undocumented in source.
getGUISize
void getGUISize(int* width, int* height)
Undocumented in source.

Meta