VTK  9.7.1
vtkOSOpenGLRenderWindow.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
2 // SPDX-License-Identifier: BSD-3-Clause
17 #ifndef vtkOSOpenGLRenderWindow_h
18 #define vtkOSOpenGLRenderWindow_h
19 
20 #include "vtkOpenGLRenderWindow.h"
21 #include "vtkRenderingOpenGL2Module.h" // For export macro
22 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
23 
24 VTK_ABI_NAMESPACE_BEGIN
25 class vtkIdList;
26 class vtkOSOpenGLRenderWindowInternal;
28 
29 class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkOSOpenGLRenderWindow
30  : public vtkOpenGLRenderWindow
31 {
32 public:
33  static vtkOSOpenGLRenderWindow* New();
37  void PrintSelf(ostream& os, vtkIndent indent) override;
38 
42  void Frame() override;
43 
47  virtual void WindowInitialize();
48 
55  void Initialize() override;
56 
62  void Finalize() override;
63 
67  void SetFullScreen(vtkTypeBool) override;
68 
70 
77  void SetSize(int width, int height) override;
78  void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
80 
85  int* GetScreenSize() VTK_SIZEHINT(2) override;
86 
91  int* GetPosition() VTK_SIZEHINT(2) override;
92 
94 
97  void SetPosition(int x, int y) override;
98  void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
100 
107  void SetStereoCapableWindow(vtkTypeBool capable) override;
108 
112  void MakeCurrent() override;
113 
117  bool IsCurrent() override;
118 
124  void SetForceMakeCurrent() override;
125 
129  const char* ReportCapabilities() override;
130 
134  int SupportsOpenGL() override;
135 
139  vtkTypeBool IsDirect() override;
140 
144  void WindowRemap() override;
145 
147 
150  void* GetGenericDisplayId() override { return nullptr; }
151  void* GetGenericWindowId() override;
152  void* GetGenericParentId() override { return nullptr; }
153  void* GetGenericContext() override;
154  void* GetGenericDrawable() override { return nullptr; }
156 
161  void SetDisplayId(void*) override {}
162 
166  void SetParentId(void*) override;
167 
171  void SetWindowId(void*) override;
172 
178  void SetNextWindowId(void*) override;
179 
180  void SetWindowName(const char*) override;
181 
186  void HideCursor() override {}
187  void ShowCursor() override {}
188 
194  vtkTypeBool GetEventPending() override;
195 
199  void SetWindowInfo(const char* info) override;
200 
204  void SetNextWindowInfo(const char* info) override;
205 
209  void SetParentInfo(const char* info) override;
210 
211 protected:
213  ~vtkOSOpenGLRenderWindow() override;
214 
215  vtkOSOpenGLRenderWindowInternal* Internal;
216 
221 
222  void CreateAWindow() override;
223  void DestroyWindow() override;
224  void CreateOffScreenWindow(int width, int height);
225  void DestroyOffScreenWindow();
226  void ResizeOffScreenWindow(int width, int height);
227 
228 private:
230  void operator=(const vtkOSOpenGLRenderWindow&) = delete;
231 };
232 
233 #define vtkOSOpenGLRenderWindow_OVERRIDE_ATTRIBUTES \
234  vtkOSOpenGLRenderWindow::CreateOverrideAttributes()
235 VTK_ABI_NAMESPACE_END
236 #endif
OpenGL rendering window.
virtual void SetForceMakeCurrent()
If called, allow MakeCurrent() to skip cache-check when called.
Attribute for vtkObjectFactory overrides.
virtual void SetFullScreen(vtkTypeBool)
Turn on/off rendering full screen window size.
void * GetGenericContext() override
Dummy stubs for vtkWindow API.
virtual void WindowRemap()
Remap the rendering window.
virtual void SetNextWindowId(void *)
Dummy stubs for vtkWindow API.
void * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
vtkOSOpenGLRenderWindowInternal * Internal
void HideCursor() override
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
OffScreen Mesa rendering window.
void SetWindowInfo(const char *) override
Dummy stubs for vtkWindow API.
virtual bool IsCurrent()
Tells if this window is the current graphics context for the calling thread.
virtual void Finalize()
Finalize the rendering process.
void * GetGenericDrawable() override
Xwindow get set functions.
void SetParentId(void *) override
Dummy stubs for vtkWindow API.
void SetDisplayId(void *) override
Set the X display id for this RenderWindow to use to a pre-existing X display id. ...
void * GetGenericDisplayId() override
Xwindow get set functions.
int vtkTypeBool
Definition: vtkABI.h:64
void SetPosition(int a[2]) override
Move the window to a new position on the display.
virtual void SetStereoCapableWindow(vtkTypeBool capable)
Prescribe that the window be created in a stereo-capable mode.
virtual void SetNextWindowInfo(const char *)
Dummy stubs for vtkWindow API.
static vtkOpenGLRenderWindow * New()
virtual void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels)...
void SetWindowId(void *) override
Dummy stubs for vtkWindow API.
a simple class to control print indentation
Definition: vtkIndent.h:28
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
list of point or cell ids
Definition: vtkIdList.h:25
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
Definition: vtkWindow.h:110
void Initialize() override
Initialize the rendering window.
void ShowCursor() override
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
int SupportsOpenGL() override
Does this render window support OpenGL? 0-false, 1-true.
static vtkOverrideAttribute * CreateOverrideAttributes()
virtual void MakeCurrent()
Make the window current.
Definition: vtkWindow.h:255
#define VTK_SIZEHINT(...)
const char * ReportCapabilities() override
Get report of capabilities for the render window.
#define VTK_NEWINSTANCE
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
virtual vtkTypeBool GetEventPending()
Check to see if a mouse button has been pressed.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
virtual void SetWindowName(const char *)
Get name of rendering window.
#define VTK_MARSHALAUTO
void SetParentInfo(const char *) override
Dummy stubs for vtkWindow API.
virtual void CreateAWindow()=0
Create a not-off-screen window.
void SetSize(int a[2]) override
Set the size of the window in screen coordinates in pixels.
void * GetGenericParentId() override
Xwindow get set functions.
virtual vtkTypeBool IsDirect()
Is this render window using hardware acceleration? 0-false, 1-true.