Class GLCanvas¶
Defined in File glcanvas.h
Page Contents
Inheritance Relationships¶
Base Type¶
public nanogui::Widget
(Class Widget)
Class Documentation¶
-
class
GLCanvas
: public nanogui::Widget¶ Canvas widget for rendering OpenGL content. This widget was contributed by Jan Winkler.
Canvas widget that can be used to display arbitrary OpenGL content. This is useful to display and manipulate 3D objects as part of an interactive application. The implementation uses scissoring to ensure that rendered objects don’t spill into neighboring widgets.
- Usage
Override
nanogui::GLCanvas::drawGL()
in subclasses to provide custom drawing code. See Example 4.
Public Functions
-
void
setDrawBorder
(const bool bDrawBorder)¶ Set whether to draw the widget border or not.
-
const bool &
drawBorder
() const¶ Return whether the widget border gets drawn or not.
-
virtual void
draw
(NVGcontext *ctx)¶ Draw the canvas.
-
virtual void
drawGL
()¶ Draw the GL scene. Override this method to draw the actual GL content.
-
virtual void
save
(Serializer &s) const¶ Save the state of this GLCanvas to the specified Serializer.
-
virtual bool
load
(Serializer &s)¶ Set the state of this GLCanvas from the specified Serializer.
Protected Functions
-
void
drawWidgetBorder
(NVGcontext *ctx) const¶ Internal helper function for drawing the widget border.