HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
glDebugWindow.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_IMAGING_GARCH_GL_DEBUG_WINDOW_H
8 #define PXR_IMAGING_GARCH_GL_DEBUG_WINDOW_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/imaging/garch/api.h"
12 #include <string>
13 
15 
16 
17 class Garch_GLPlatformDebugWindow;
18 
19 /// \class GarchGLDebugWindow
20 ///
21 /// Platform specific minimum GL widget for unit tests.
22 ///
24 public:
25  GARCH_API
26  GarchGLDebugWindow(const char *title, int width, int height);
27  GARCH_API
28  virtual ~GarchGLDebugWindow();
29 
30  GARCH_API
31  void Init();
32  GARCH_API
33  void Run();
34  GARCH_API
35  void ExitApp();
36 
37  int GetWidth() const { return _width; }
38  int GetHeight() const { return _height; }
39 
40  enum Buttons {
41  MyButton1 = 0,
42  MyButton2 = 1,
44  };
45  enum ModifierKeys {
47  Shift = 1,
48  Alt = 2,
49  Ctrl = 4
50  };
51 
52  GARCH_API
53  virtual void OnInitializeGL();
54  GARCH_API
55  virtual void OnUninitializeGL();
56  GARCH_API
57  virtual void OnResize(int w, int h);
58  GARCH_API
59  virtual void OnIdle();
60  GARCH_API
61  virtual void OnPaintGL();
62  GARCH_API
63  virtual void OnKeyRelease(int key);
64  GARCH_API
65  virtual void OnMousePress(int button, int x, int y, int modKeys);
66  GARCH_API
67  virtual void OnMouseRelease(int button, int x, int y, int modKeys);
68  GARCH_API
69  virtual void OnMouseMove(int x, int y, int modKeys);
70 
71 private:
72  Garch_GLPlatformDebugWindow *_private;
73  std::string _title;
74  int _width, _height;
75 };
76 
77 
79 
80 #endif // PXR_IMAGING_GARCH_GL_DEBUG_WINDOW_H
virtual GARCH_API void OnUninitializeGL()
virtual GARCH_API void OnMouseMove(int x, int y, int modKeys)
virtual GARCH_API ~GarchGLDebugWindow()
virtual GARCH_API void OnMousePress(int button, int x, int y, int modKeys)
virtual GARCH_API void OnKeyRelease(int key)
int GetWidth() const
Definition: glDebugWindow.h:37
GARCH_API void Init()
GLint y
Definition: glcorearb.h:103
int GetHeight() const
Definition: glDebugWindow.h:38
GLint GLsizei GLsizei height
Definition: glcorearb.h:103
GARCH_API void ExitApp()
virtual GARCH_API void OnPaintGL()
virtual GARCH_API void OnResize(int w, int h)
GLint GLenum GLint x
Definition: glcorearb.h:409
virtual GARCH_API void OnIdle()
#define GARCH_API
Definition: api.h:23
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
GARCH_API GarchGLDebugWindow(const char *title, int width, int height)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
virtual GARCH_API void OnMouseRelease(int button, int x, int y, int modKeys)
GARCH_API void Run()
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
GLint GLsizei width
Definition: glcorearb.h:103
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
virtual GARCH_API void OnInitializeGL()