HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SimpleWindow.h
Go to the documentation of this file.
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 
13 
15 
16 /// SimpleWindow shared pointer
17 using SimpleWindowPtr = std::shared_ptr<class SimpleWindow>;
18 
19 /// @class SimpleWindow
20 /// A platform-independent window class.
21 ///
22 /// Plaform-specific resources are encapsulated by a WindowWrapper instance.
24 {
25  public:
26  /// Static instance create function
28 
29  /// Default destructor
30  virtual ~SimpleWindow();
31 
32  /// Window initialization
33  bool initialize(const char* title, unsigned int width, unsigned int height, void *applicationShell);
34 
35  /// Return our platform-specific resource wrapper
37  {
38  return _windowWrapper;
39  }
40 
41  /// Return width of window
42  unsigned int width() const
43  {
44  return _width;
45  }
46 
47  /// Return height of window
48  unsigned int height() const
49  {
50  return _height;
51  }
52 
53  /// Check for validity
54  bool isValid() const
55  {
56  return _windowWrapper && _windowWrapper->isValid();
57  }
58 
59  protected:
60  // Default constructor
61  SimpleWindow();
62 
63  // Wrapper for platform specific window resources
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 
80 
81 #endif
unsigned int _width
Definition: SimpleWindow.h:67
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
WindowWrapperPtr _windowWrapper
Definition: SimpleWindow.h:64
GLint GLsizei GLsizei height
Definition: glcorearb.h:103
std::shared_ptr< class WindowWrapper > WindowWrapperPtr
WindowWrapper shared pointer.
Definition: WindowWrapper.h:55
std::shared_ptr< class SimpleWindow > SimpleWindowPtr
SimpleWindow shared pointer.
Definition: GLContext.h:34
static SimpleWindowPtr create()
Static instance create function.
Definition: SimpleWindow.h:27
unsigned int width() const
Return width of window.
Definition: SimpleWindow.h:42
OPENVDB_API void initialize()
Global registration of native Grid, Transform, Metadata and Point attribute types. Also initializes blosc (if enabled).
Definition: logging.h:294
unsigned int height() const
Return height of window.
Definition: SimpleWindow.h:48
bool isValid() const
Check for validity.
Definition: SimpleWindow.h:54
GLint GLsizei width
Definition: glcorearb.h:103
unsigned int _height
Definition: SimpleWindow.h:68
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26
std::shared_ptr< class SimpleWindow > SimpleWindowPtr
SimpleWindow shared pointer.
Definition: SimpleWindow.h:17
#define MX_RENDERHW_API
Definition: Export.h:18
WindowWrapperPtr getWindowWrapper()
Return our platform-specific resource wrapper.
Definition: SimpleWindow.h:36
unsigned int _id
Definition: SimpleWindow.h:71