MaterialX 1.39.1
Loading...
Searching...
No Matches
SimpleWindow.h
1//
2// Copyright Contributors to the MaterialX Project
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#ifndef MATERIALX_SIMPLEWINDOW_H
7#define MATERIALX_SIMPLEWINDOW_H
8
10
12#include <MaterialXRenderHw/WindowWrapper.h>
13
14MATERIALX_NAMESPACE_BEGIN
15
17using SimpleWindowPtr = std::shared_ptr<class SimpleWindow>;
18
23class MX_RENDERHW_API SimpleWindow
24{
25 public:
27 static SimpleWindowPtr create() { return SimpleWindowPtr(new SimpleWindow); }
28
30 virtual ~SimpleWindow();
31
33 bool initialize(const char* title, unsigned int width, unsigned int height, void* applicationShell);
34
36 WindowWrapperPtr getWindowWrapper()
37 {
38 return _windowWrapper;
39 }
40
42 unsigned int width() const
43 {
44 return _width;
45 }
46
48 unsigned int height() const
49 {
50 return _height;
51 }
52
54 bool isValid() const
55 {
56 return _windowWrapper && _windowWrapper->isValid();
57 }
58
59 protected:
60 // Default constructor
62
63 // Wrapper for platform specific window resources
64 WindowWrapperPtr _windowWrapper;
65
66 // Window dimensions
67 unsigned int _width;
68 unsigned int _height;
69
70 // Unique window identifier generated dynamically at creation time.
71 unsigned int _id;
72
73#if defined(_WIN32)
74 // Window class name for window generated at creation time.
75 char _windowClassName[128];
76#endif
77};
78
79MATERIALX_NAMESPACE_END
80
81#endif
Library-wide includes and types.
Macros for declaring imported and exported symbols.
A platform-independent window class.
Definition: SimpleWindow.h:24
bool isValid() const
Check for validity.
Definition: SimpleWindow.h:54
WindowWrapperPtr getWindowWrapper()
Return our platform-specific resource wrapper.
Definition: SimpleWindow.h:36
unsigned int width() const
Return width of window.
Definition: SimpleWindow.h:42
virtual ~SimpleWindow()
Default destructor.
bool initialize(const char *title, unsigned int width, unsigned int height, void *applicationShell)
Window initialization.
unsigned int height() const
Return height of window.
Definition: SimpleWindow.h:48
static SimpleWindowPtr create()
Static instance create function.
Definition: SimpleWindow.h:27