dip::viewer::Window class

Simple GL window.

Derived classes

class Viewer
A Window for viewing a dip::Image

Public functions

void refresh()
Refresh window contents.
void destroy()
Marks the window for destruction.
auto destroyed() -> bool
Returns whether the window is marked for destruction.
auto drawString(const char* string) -> size_t
Draw a string onto the window.
auto width() -> int
Returns the window's width.
auto height() -> int
Returns the window's height.
void setPosition(int x, int y)
Set the window's screen position.
void setSize(int width, int height)
Set the window's size.

Protected functions

auto manager() -> Manager*
Returns the dip::viewer::Manager that manages this window.
auto id() -> void*
Returns the window's identity.
void title(const char* name)
Sets the window's title.
void swap()
Swaps display buffers.
void requestSize(size_t width, size_t height)
Suggests a window's size.
void draw() virtual
Overridable callback that draws the visualization.
void idle() virtual
Overridable callback that is called periodically to allow for animation.
void reshape(int, int) virtual
Overridable callback that is called when the window shape is changed.
void visible(int) virtual
Overridable callback that is called when the window visibility changes.
void create() virtual
Overridable callback that is called when the window is created.
void close() virtual
Overridable callback that is called when the window is closed.
void key(unsigned char k, int x, int y, int mods) virtual
Overridable callback that is called when a key is pressed.
void click(int, int, int, int, int) virtual
Overridable callback that is called when a mouse button is clicked.
void motion(int, int) virtual
Overridable callback that is called when the mouse is moved while a button is clicked.

Function documentation

bool dip::viewer::Window::destroyed()

Returns whether the window is marked for destruction.

This is set either from a callback, or by calling destroy().

size_t dip::viewer::Window::drawString(const char* string)

Draw a string onto the window.

Must be called from a callback.

void dip::viewer::Window::title(const char* name) protected

Sets the window's title.

Must be called from a callback.

void dip::viewer::Window::swap() protected

Swaps display buffers.

Must be called from a callback.

void dip::viewer::Window::requestSize(size_t width, size_t height) protected

Suggests a window's size.

*** Note *** that this function must be called before the create() callback is called.