Class window#
Defined in File window.h
Class Documentation#
-
class window#
Abstract class to render in a window or an image.
A class to render things in a window or an image. An icon and windowName can be set which can be shown by a window manager.
Public Types
-
enum class Type : unsigned char#
Enumeration of supported window types#
NONE: A mock window without rendering capabilities. EXTERNAL: An external window that assume the OpenGL context would have been created by another framework. GLX: A window using GLX. WGL: A window using WGL. COCOA: A window using COCOA. EGL: An offscreen window using hardware acceleration that can run headless. OSMESA: An offscreen window using software rendering that is always run headless. WASM: A webassembly window (when libf3d is built with emscripten). UNKNOWN: An unknown window (should not happen).
Values:
-
enumerator NONE#
-
enumerator EXTERNAL#
-
enumerator GLX#
-
enumerator WGL#
-
enumerator COCOA#
-
enumerator EGL#
-
enumerator OSMESA#
-
enumerator WASM#
-
enumerator UNKNOWN#
-
enumerator NONE#
Public Functions
-
virtual bool isOffscreen() = 0#
Is the window offscreen.
-
virtual bool render() = 0#
Perform a render of the window to the screen. All dynamic options are updated if needed. Return true on success, false otherwise.
-
virtual image renderToImage(bool noBackground = false) = 0#
Perform a render of the window to the screen and save the result in a f3d::image. of ChannelType BYTE and 3 or 4 components (RGB or RGBA). Set noBackground to true to have a transparent background. Return the resulting f3d::image.
-
virtual int getWidth() const = 0#
Get the width of the window.
-
virtual int getHeight() const = 0#
Get the height of the window.
-
virtual window &setIcon(const unsigned char *icon, size_t iconSize) = 0#
Set the icon to be shown by a window manager. icon should be an unsigned char array. iconSize should be the sizeof(icon).
-
virtual window &setWindowName(const std::string &windowName) = 0#
Set the window name to be shown by a window manager.
-
enum class Type : unsigned char#