dip::viewer::GLFWManager class

Simple GLFW window manager.

Base classes

class Manager
Simple window manager.

Public functions

void createWindow(WindowPtr window) override
Create a window.
auto activeWindows() -> size_t override
Returns the number of managed windows.
void destroyWindows() override
Destroys all windows.
void processEvents() override
Processes event queue.

Protected functions

void swapBuffers(Window* window) override
Swap display buffers.
void setWindowTitle(Window* window, const char* name) override
Sets a Window's title.
void refreshWindow(Window* window) override
Refresh a Window's contents.
void setWindowPosition(Window* window, int x, int y) override
Set a Window's screen position.
void setWindowSize(Window* window, int width, int height) override
Set a Window's size.

Function documentation

void dip::viewer::GLFWManager::createWindow(WindowPtr window) override

Create a window.

Example usage:

manager.createWindow( dip::viewer::SliceViewer::Create( image ));

void dip::viewer::GLFWManager::processEvents() override

Processes event queue.

This function must be periodically called to allow user interaction. Example usage:

while ( manager.activeWindows()) {
   manager.processEvents();
   std::this_thread::sleep_for( std::chrono::microseconds( 1000 ) );
}

void dip::viewer::GLFWManager::swapBuffers(Window* window) override protected

Swap display buffers.

Must be called from the specified Window's callback.

void dip::viewer::GLFWManager::setWindowTitle(Window* window, const char* name) override protected

Sets a Window's title.

Must be called from the specified Window's callback.