MaterialX 1.38.2
SimpleWindow.h
1//
2// TM & (c) 2019 Lucasfilm Entertainment Company Ltd. and Lucasfilm Ltd.
3// All rights reserved. See LICENSE.txt for license.
4//
5
6#ifndef MATERIALX_SIMPLEWINDOW_H
7#define MATERIALX_SIMPLEWINDOW_H
8
10
12#include <MaterialXRenderHw/WindowWrapper.h>
13
14namespace MaterialX
15{
16
18using SimpleWindowPtr = std::shared_ptr<class SimpleWindow>;
19
24class MX_RENDERHW_API SimpleWindow
25{
26 public:
28 static SimpleWindowPtr create() { return SimpleWindowPtr(new SimpleWindow); }
29
31 virtual ~SimpleWindow();
32
34 bool initialize(const char* title, unsigned int width, unsigned int height, void *applicationShell);
35
37 WindowWrapperPtr getWindowWrapper()
38 {
39 return _windowWrapper;
40 }
41
43 unsigned int width() const
44 {
45 return _width;
46 }
47
49 unsigned int height() const
50 {
51 return _height;
52 }
53
55 bool isValid() const
56 {
57 return _windowWrapper && _windowWrapper->isValid();
58 }
59
60 protected:
61 // Default constructor
63
64 // Clear internal state information
65 void clearInternalState()
66 {
67 _width = _height = 0;
68 _id = 0;
69 }
70
71 // Wrapper for platform specific window resources
72 WindowWrapperPtr _windowWrapper;
73
74 // Window dimensions
75 unsigned int _width;
76 unsigned int _height;
77
78 // Unique window identifier generated dynamically at creation time.
79 unsigned int _id;
80
81#if defined(_WIN32)
82 // Window class name for window generated at creation time.
83 char _windowClassName[128];
84#endif
85};
86
87} // namespace MaterialX
88
89#endif
Library-wide includes and types.
Macros for declaring imported and exported symbols.
A platform-independent window class.
Definition: SimpleWindow.h:25
bool isValid() const
Check for validity.
Definition: SimpleWindow.h:55
WindowWrapperPtr getWindowWrapper()
Return our platform-specific resource wrapper.
Definition: SimpleWindow.h:37
unsigned int width() const
Return width of window.
Definition: SimpleWindow.h:43
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:49
static SimpleWindowPtr create()
Static instance create function.
Definition: SimpleWindow.h:28