- buildCompositor
ICompositor buildCompositor(CompositorCreationContext* context)
Undocumented in source. Be warned that the author may not have intended to support it.
- closeUI
void closeUI()
Undocumented in source. Be warned that the author may not have intended to support it.
- compositeGUI
void compositeGUI(ImageRef!RGBA wfb)
Do the PBR compositing step. This is the most expensive step in the UI.
- compositor
ICompositor compositor()
Undocumented in source. Be warned that the author may not have intended to support it.
- convertLogicalRectToUserRect
box2i convertLogicalRectToUserRect(box2i b)
Undocumented in source. Be warned that the author may not have intended to support it.
- convertPBRLayerRectToRawLayerRect
box2i convertPBRLayerRectToRawLayerRect(box2i rect, int width, int height)
Undocumented in source. Be warned that the author may not have intended to support it.
- convertUserRectToLogicalRect
box2i convertUserRectToLogicalRect(box2i b)
Undocumented in source. Be warned that the author may not have intended to support it.
- 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 widthLogicalPixels, int heightLogicalPixels)
Undocumented in source. Be warned that the author may not have intended to support it.
- getDefaultUISizeInPixels
vec2i getDefaultUISizeInPixels()
Undocumented in source. Be warned that the author may not have intended to support it.
- getDesiredGUISize
void getDesiredGUISize(int* widthLogicalPixels, int* heightLogicalPixels)
Undocumented in source. Be warned that the author may not have intended to support it.
- getGUISize
void getGUISize(int* widthLogicalPixels, int* heightLogicalPixels)
Undocumented in source. Be warned that the author may not have intended to support it.
- getMaxSmallerValidSize
void getMaxSmallerValidSize(int* inoutWidth, int* inoutHeight)
Undocumented in source. Be warned that the author may not have intended to support it.
- getNearestValidSize
void getNearestValidSize(int* inoutWidth, int* inoutHeight)
Undocumented in source. Be warned that the author may not have intended to support it.
- getPreservedAspectRatio
int[2] getPreservedAspectRatio()
Undocumented in source. Be warned that the author may not have intended to support it.
- getUINearestValidSize
void getUINearestValidSize(int* widthLogicalPixels, int* heightLogicalPixels)
Undocumented in source. Be warned that the author may not have intended to support it.
- getUIScale
float getUIScale()
Undocumented in source. Be warned that the author may not have intended to support it.
- getUISizeInPixelsLogical
vec2i getUISizeInPixelsLogical()
Undocumented in source. Be warned that the author may not have intended to support it.
- getUISizeInPixelsPhysical
vec2i getUISizeInPixelsPhysical()
Undocumented in source. Be warned that the author may not have intended to support it.
- getUISizeInPixelsUser
vec2i getUISizeInPixelsUser()
Undocumented in source. Be warned that the author may not have intended to support it.
- getUserScale
float getUserScale()
Undocumented in source. Be warned that the author may not have intended to support it.
- isAspectRatioPreserved
bool isAspectRatioPreserved()
Undocumented in source. Be warned that the author may not have intended to support it.
- isResizeable
bool isResizeable()
Undocumented in source. Be warned that the author may not have intended to support it.
- isResizeableHorizontally
bool isResizeableHorizontally()
Undocumented in source. Be warned that the author may not have intended to support it.
- isResizeableVertically
bool isResizeableVertically()
Undocumented in source. Be warned that the author may not have intended to support it.
- isUIResizable
bool isUIResizable()
Undocumented in source. Be warned that the author may not have intended to support it.
- nativeWindowResize
bool nativeWindowResize(int newWidthLogicalPixels, int newHeightLogicalPixels)
Undocumented in source. Be warned that the author may not have intended to support it.
- onScreenshot
void onScreenshot(ImageRef!RGBA finalRender, WindowPixelFormat pixelFormat, ImageRef!RGBA diffuseMap, ImageRef!L16 depthMap, ImageRef!RGBA materialMap)
Want a screenshot? Want to generate a mesh or a voxel out of your render?
Override this function and call IUIContext.requestUIScreenshot()
- openUI
void* openUI(void* parentInfo, void* controlInfo, IClient client, GraphicsBackend backend)
Undocumented in source. Be warned that the author may not have intended to support it.
- profiler
IProfiler profiler()
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.
- recomputeDrawLists
void recomputeDrawLists()
Undocumented in source. Be warned that the author may not have intended to support it.
- recomputePurelyDerivedRectangles
void recomputePurelyDerivedRectangles()
Undocumented in source. Be warned that the author may not have intended to support it.
- redrawElementsPBR
void redrawElementsPBR()
Draw the PBR layer of UIElement widgets
- redrawElementsRaw
void redrawElementsRaw()
Draw the Raw layer of UIElement widgets
- 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.
- reorderComponents
void reorderComponents(WindowPixelFormat pf)
Undocumented in source. Be warned that the author may not have intended to support it.
- requestUIResize
bool requestUIResize(int widthLogicalPixels, int heightLogicalPixels)
Undocumented in source. Be warned that the author may not have intended to support it.
- requestUIScreenshot
void requestUIScreenshot()
Undocumented in source. Be warned that the author may not have intended to support it.
- resizeContent
void resizeContent(WindowPixelFormat pf)
Undocumented in source. Be warned that the author may not have intended to support it.
- 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 more expensive.
Too little and the ligth decay doesn't feel natural.
IMPORTANT: This should be called only inside your main reflow() or at UI creation time.
- toImageRef
ImageRef!RGBA toImageRef(ubyte* alignedBuffer, int width, int height)
Undocumented in source. Be warned that the author may not have intended to support it.
- _client
IClient _client;
Undocumented in source.
- _compositedBuffer
OwnedImage!RGBA _compositedBuffer;
The composited buffer, before the Raw layer is applied.
- _compositor
ICompositor _compositor;
Undocumented in source.
- _currentLogicalHeight
int _currentLogicalHeight;
Undocumented in source.
- _currentLogicalWidth
int _currentLogicalWidth;
Undocumented in source.
- _currentUserHeight
int _currentUserHeight;
Undocumented in source.
- _currentUserWidth
int _currentUserWidth;
Undocumented in source.
- _depthMap
Mipmap!L16 _depthMap;
Undocumented in source.
- _desiredLogicalHeight
int _desiredLogicalHeight;
Undocumented in source.
- _desiredLogicalWidth
int _desiredLogicalWidth;
Undocumented in source.
- _diffuseMap
Mipmap!RGBA _diffuseMap;
Undocumented in source.
- _elemsToDrawPBR
Vec!UIElement _elemsToDrawPBR;
The list of UIElement to potentially call onDrawPBR on.
- _elemsToDrawRaw
Vec!UIElement _elemsToDrawRaw;
The list of UIElement to potentially call onDrawPBR on.
- _firstResize
bool _firstResize;
Undocumented in source.
- _materialMap
Mipmap!RGBA _materialMap;
Undocumented in source.
- _rectsTemp
Vec!box2i _rectsTemp;
Undocumented in source.
- _rectsToComposite
Vec!box2i _rectsToComposite;
Undocumented in source.
- _rectsToCompositeDisjointed
Vec!box2i _rectsToCompositeDisjointed;
Undocumented in source.
- _rectsToCompositeDisjointedTiled
Vec!box2i _rectsToCompositeDisjointedTiled;
Undocumented in source.
- _rectsToDisplay
Vec!box2i _rectsToDisplay;
Undocumented in source.
- _rectsToDisplayDisjointed
Vec!box2i _rectsToDisplayDisjointed;
Undocumented in source.
- _rectsToResize
Vec!box2i _rectsToResize;
Undocumented in source.
- _rectsToResizeDisjointed
Vec!box2i _rectsToResizeDisjointed;
Undocumented in source.
- _rectsToUpdateDisjointedPBR
Vec!box2i _rectsToUpdateDisjointedPBR;
The list of areas to be redrawn at the Raw and PBR levels (composited).
These are accumulated over possibly several calls of recomputeDirtyRects
and cleared by a call to onDraw.
Other lists of areas are purely derived from _rectsToUpdateDisjointedRaw
and _rectsToUpdateDisjointedPBR.
- _rectsToUpdateDisjointedRaw
Vec!box2i _rectsToUpdateDisjointedRaw;
The list of areas to be redrawn at the Raw and PBR levels (composited).
These are accumulated over possibly several calls of recomputeDirtyRects
and cleared by a call to onDraw.
Other lists of areas are purely derived from _rectsToUpdateDisjointedRaw
and _rectsToUpdateDisjointedPBR.
- _redrawBlackBordersAndResizedArea
bool _redrawBlackBordersAndResizedArea;
Undocumented in source.
- _renderedBuffer
OwnedImage!RGBA _renderedBuffer;
The rendered framebuffer.
This is copied from _compositedBuffer, then Raw layer is drawn on top.
Components are reordered there.
It must be possible to use a Canvas on it.
- _reportBlackBordersAndResizedAreaAsDirty
bool _reportBlackBordersAndResizedAreaAsDirty;
Undocumented in source.
- _resizedBuffer
ubyte* _resizedBuffer;
The final framebuffer.
It is the only buffer to have a size in logical pixels.
Internally the UI has an "user" size.
FUTURE: resize from user size to logical size using a resizer,
to allow better looking DPI without the OS blurry resizing.
Or to allow higher internal pixel count.
- _screenShotRequested
shared(bool) _screenShotRequested;
If a screenshot was requested by user widget.
- _sizeConstraints
SizeConstraints _sizeConstraints;
Undocumented in source.
- _sortScratchBuf
Vec!UIElement _sortScratchBuf;
The scratch buffer used to sort the two above list.
- _threadPool
ThreadPool _threadPool;
Undocumented in source.
- _uiContext
UIContext _uiContext;
Undocumented in source.
- _updateMargin
int _updateMargin;
Amount of pixels dirty rectangles are extended with.
- _updateRectScratch
Vec!box2i[2] _updateRectScratch;
Undocumented in source.
- _userArea
box2i _userArea;
the area in logical area where the user area is drawn.
- _window
IWindow _window;
Undocumented in source.
- _windowListener
WindowListener _windowListener;
Undocumented in source.
- ~this
~this()
Destroy a UIElement.
Normally this happens naturally, since each widget
owns its children.
- position
box2i position()
Get widget position in the window (absolute).
- position
void position(box2i p)
void position(box2f p)
Set widget position in the window (absolute).
- context
UIContext context()
Get the UI context, which is an additional API for
widgets to use (though quite a bit of methods are
internals there).
- parent
UIElement parent()
Get parent widget, if any.
- topLevelParent
UIElement topLevelParent()
Get top-level parent, if any.
- child
UIElement child(int n)
- addChild
void addChild(UIElement element)
Add a UIElement as child to another.
- removeChild
void removeChild(UIElement element)
Removes a child from its parent.
Useful for creating dynamic UI's.
- setDirtyWhole
void setDirtyWhole(UILayer layer)
Mark this element as "dirty" on its whole position.
- setDirty
void setDirty(box2i rect, UILayer layer)
Mark a sub-part of the element "dirty".
- isVisible
bool isVisible()
A widget is "visible" when it has a true visibility
flag, and its parent is itself visible.
- visibility
bool visibility()
Get visibility flag of the widget.
- visibility
void visibility(bool visible)
Change visibility flag of the widget. Show or hide
all children of this UIElement, regardless of
their position on screen, invalidating their
graphics if need be (much like a position change).
- zOrder
int zOrder()
void zOrder(int zOrder)
Set/get widget Z-order (default = 0).
- setZOrder
alias setZOrder = zOrder
Undocumented in source.
- setId
void setId(const(char)[] identifier)
- id
void id(const(char)[] identifier)
- getId
const(char)[] getId()
- id
const(char)[] id()
- hasId
bool hasId()
Has this widget an identifier?
- getElementById
UIElement getElementById(const(char)* id)
Search subtree for an UIElement with ID id.
Undefined Behaviour if ID are not unique.
- reflow
void reflow()
The .reflow() callback is called whenver the
.position of a widget changes.
- isMouseOver
bool isMouseOver()
- isDragged
bool isDragged()
- isFocused
bool isFocused()
Widget has keyboard focused? (last clicked)
- drawsToPBR
bool drawsToPBR()
Widget draws on the PBR layer?
- drawsToRaw
bool drawsToRaw()
Widget draws on the Raw layer?
- isAnimated
bool isAnimated()
Is widget animated? (onAnimate called)
- isDrawAloneRaw
bool isDrawAloneRaw()
Should widget be drawn alone in Raw layer?
- isDrawAlonePBR
bool isDrawAlonePBR()
Should widget be drawn alone in PBR layer?
- cursorWhenDragged
MouseCursor cursorWhenDragged()
- setCursorWhenDragged
void setCursorWhenDragged(MouseCursor mouseCursor)
- cursorWhenMouseOver
MouseCursor cursorWhenMouseOver()
- setCursorWhenMouseOver
void setCursorWhenMouseOver(MouseCursor mouseCursor)
- getUserPointer
void* getUserPointer(int pointerID)
- setUserPointer
void setUserPointer(int pointerID, void* user)
Set/Get a user pointer.
This allow dplug:gui extensions.
- contains
bool contains(int x, int y)
Check if given point is considered in the widget,
for clicks, mouse moves, etc.
This function is meant to be overridden.
- onMouseEnter
void onMouseEnter()
- onMouseExit
void onMouseExit()
Called when mouse enter or exits a widget.
This function is meant to be overridden.
- onMouseClick
Click onMouseClick(int x, int y, int button, bool isDoubleClick, MouseState mstate)
.onMouseClick() is called for every new click.
- onMouseWheel
bool onMouseWheel(int x, int y, int wheelDeltaX, int wheelDeltaY, MouseState mstate)
Mouse wheel was turned.
This function is meant to be overridden.
- onMouseMove
void onMouseMove(int x, int y, int dx, int dy, MouseState mstate)
Called when the mouse moves over this widget area.
This function is meant to be overridden.
- onBeginDrag
void onBeginDrag()
- onStopDrag
void onStopDrag()
Called when a drag operation starts or ends.
This function is meant to be overridden.
- onMouseDrag
void onMouseDrag(int x, int y, int dx, int dy, MouseState mstate)
Called when the mouse moves while dragging this
widget.
- onFocusEnter
void onFocusEnter()
Called when this widget is clicked and get the
"focus" (ie. meaning the keyboard focus).
This function is meant to be overridden.
- onFocusExit
void onFocusExit()
This widget lost the keyboard focus.
This function is meant to be overridden.
- onKeyDown
bool onKeyDown(Key key)
- onKeyUp
bool onKeyUp(Key key)
Called when a key is pressed/released.
Functiosn meant to be overridden.
- onDrawRaw
void onDrawRaw(ImageRef!RGBA rawMap, box2i[] dirtyRects)
Raw layer draw method.
This function is meant to be overridden.
- onDrawPBR
void onDrawPBR(ImageRef!RGBA diffuse, ImageRef!L16 depth, ImageRef!RGBA material, box2i[] dirtyRects)
PBR layer draw method.
This function is meant to be overridden.
- onAnimate
void onAnimate(double dt, double time)
Called periodically for every UIElement that has
flagAnimated.
Override this to create animations.
- renderRaw
void renderRaw(ImageRef!RGBA rawMap, box2i[] areasToUpdate)
Undocumented in source. Be warned that the author may not have intended to support it.
- renderPBR
void renderPBR(ImageRef!RGBA diffuse, ImageRef!L16 depth, ImageRef!RGBA material, box2i[] areasToUpdate)
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
bool mouseMove(int x, int y, int dx, int dy, MouseState mstate, bool alreadyFoundMouseOver)
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.
- getDrawLists
void getDrawLists(Vec!UIElement listRaw, Vec!UIElement listPBR)
Undocumented in source. Be warned that the author may not have intended to support it.
- _parent
UIElement _parent;
Undocumented in source.
- _position
box2i _position;
Undocumented in source.
- _children
Vec!UIElement _children;
Undocumented in source.
- _flags
immutable(uint) _flags;
Undocumented in source.
- _zOrder
int _zOrder;
Undocumented in source.