6#ifndef MATERIALX_WINDOWWRAPPER_H
7#define MATERIALX_WINDOWWRAPPER_H
10#define WIN32_LEAN_AND_MEAN
13#elif defined(__linux__) || defined(__FreeBSD__)
16using Widget =
struct _WidgetRec*;
22MATERIALX_NAMESPACE_BEGIN
26using ExternalWindowHandle = HWND;
28using InternalWindowHandle = HDC;
30using DisplayHandle =
void*;
31#elif defined(__linux__) || defined(__FreeBSD__)
33using ExternalWindowHandle = Widget;
35using InternalWindowHandle = Window;
37using DisplayHandle = Display*;
39using Widget =
struct _WidgetRec*;
40#elif defined(__APPLE__)
42using ExternalWindowHandle =
void*;
44using InternalWindowHandle =
void*;
46using DisplayHandle =
void*;
49using ExternalWindowHandle =
void*;
50using InternalWindowHandle =
void*;
51using DisplayHandle =
void*;
55using WindowWrapperPtr = std::shared_ptr<class WindowWrapper>;
67 DisplayHandle display = {});
75 return _externalHandle;
81 return _internalHandle;
88 return _internalHandle != 0;
94#if defined(__linux__) || defined(__FreeBSD__)
96 Display* getXDisplay()
const
105 DisplayHandle display);
108 ExternalWindowHandle _externalHandle;
109 InternalWindowHandle _internalHandle;
111#if defined(__linux__) || defined(__FreeBSD__)
113 Window _framebufferWindow;
119MATERIALX_NAMESPACE_END
Library-wide includes and types.
Generic wrapper for encapsulating a "window" construct.
Definition: WindowWrapper.h:62
static WindowWrapperPtr create(ExternalWindowHandle externalHandle={}, InternalWindowHandle internalHandle={}, DisplayHandle display={})
Create a new WindowWrapper.
void release()
Release resources stored in wrapper.
bool isValid() const
Check that there is a valid OS handle set.
Definition: WindowWrapper.h:86
ExternalWindowHandle externalHandle() const
Return "external" handle.
Definition: WindowWrapper.h:73
InternalWindowHandle internalHandle() const
Return "internal" handle.
Definition: WindowWrapper.h:79