VTK  9.7.1
vtkEGLRenderWindow.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
23 #ifndef vtkEGLRenderWindow_h
24 #define vtkEGLRenderWindow_h
25 
26 #include "vtkOpenGLRenderWindow.h"
27 #include "vtkRenderingOpenGL2Module.h" // For export macro
28 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
29 
30 #include <memory> // for unique_ptr
31 
32 VTK_ABI_NAMESPACE_BEGIN
33 
34 class vtkIdList;
37 
38 class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkEGLRenderWindow : public vtkOpenGLRenderWindow
39 {
40 public:
41  static vtkEGLRenderWindow* New();
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  void Frame() override;
51 
56  void SetShowWindow(bool) override;
57 
61  virtual void WindowInitialize();
62 
69  void Initialize() override;
70 
76  void Finalize() override;
77 
81  void SetFullScreen(vtkTypeBool) override;
82 
86  void WindowRemap() override;
87 
91  virtual void PrefFullScreen();
92 
101  void SetSize(int width, int height) override;
102  void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
103 
110  void SetStereoCapableWindow(vtkTypeBool capable) override;
111 
115  void MakeCurrent() override;
116 
120  void ReleaseCurrent() override;
121 
125  bool IsCurrent() override;
126 
130  vtkTypeBool IsDirect() override { return 1; }
131 
136  int* GetScreenSize() VTK_SIZEHINT(2) override;
137 
142  int* GetPosition() VTK_SIZEHINT(2) override;
143 
145 
148  void SetDisplayId(void*) override {}
149  void SetWindowId(void* window) override;
150  void SetNextWindowId(void*) override {}
151  void SetParentId(void*) override {}
152  void* GetGenericDisplayId() override;
153  void* GetGenericWindowId() override { return nullptr; }
154  void* GetGenericParentId() override { return nullptr; }
155  void* GetGenericContext() override;
156  void* GetGenericDrawable() override { return nullptr; }
157  void SetWindowInfo(const char*) override;
158  void SetNextWindowInfo(const char*) override {}
159  void SetParentInfo(const char*) override {}
161 
162  void SetWindowName(const char*) override;
163 
165 
170  void SetPosition(int x, int y) override;
171  void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
173 
175 
179  void HideCursor() override;
180  void ShowCursor() override;
182 
187  void Render() override;
188 
195  vtkTypeBool GetEventPending() override { return 0; }
196 
197  vtkTypeBool GetOwnWindow() { return this->OwnWindow; }
198 
203  void GetEGLSurfaceSize(int* width, int* height);
207  int GetNumberOfDevices() override;
214  bool IsPointSpriteBugPresent() override;
215 
216  const char* ReportCapabilities() override;
217 
218 protected:
220  ~vtkEGLRenderWindow() override;
221 
225 
226  void CreateAWindow() override;
227  void DestroyWindow() override;
228  void ResizeWindow(int width, int height);
229 
235  bool SetDeviceAsDisplay(int deviceIndex);
236 
237 private:
238  vtkEGLRenderWindow(const vtkEGLRenderWindow&) = delete;
239  void operator=(const vtkEGLRenderWindow&) = delete;
240 
241  std::unique_ptr<vtkEGLRenderWindowInternals> Internals;
242 };
243 
244 #define vtkEGLRenderWindow_OVERRIDE_ATTRIBUTES vtkEGLRenderWindow::CreateOverrideAttributes()
245 VTK_ABI_NAMESPACE_END
246 #endif
vtkTypeBool GetOwnWindow()
OpenGL rendering window.
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
Attribute for vtkObjectFactory overrides.
virtual void HideCursor()
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
Definition: vtkWindow.h:295
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
virtual void SetFullScreen(vtkTypeBool)
Turn on/off rendering full screen window size.
void * GetGenericDisplayId() override
Dummy stubs for vtkWindow API.
void * GetGenericContext() override
Dummy stubs for vtkWindow API.
virtual void WindowRemap()
Remap the rendering window.
void Render() override
Handle opengl specific code and calls superclass.
void SetWindowInfo(const char *) override
Dummy stubs for vtkWindow API.
void SetParentInfo(const char *) override
Dummy stubs for vtkWindow API.
virtual void SetPosition(int x, int y)
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
virtual bool IsCurrent()
Tells if this window is the current graphics context for the calling thread.
virtual void Finalize()
Finalize the rendering process.
virtual void SetShowWindow(bool)
Show or not Show the window.
void * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
int vtkTypeBool
Definition: vtkABI.h:64
virtual void SetStereoCapableWindow(vtkTypeBool capable)
Prescribe that the window be created in a stereo-capable mode.
void SetSize(int a[2]) override
Get the size (width and height) of the rendering window in screen coordinates (in pixels)...
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.
void SetParentId(void *) override
Dummy stubs for vtkWindow API.
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.
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 SetNextWindowInfo(const char *) override
Dummy stubs for vtkWindow API.
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
Internal class used to store and control EGL state.
void SetPosition(int a[2]) override
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
virtual void ReleaseCurrent()
Release the current context.
Definition: vtkWindow.h:261
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void SetNextWindowId(void *) override
Dummy stubs for vtkWindow API.
virtual void SetWindowName(const char *)
Get name of rendering window.
virtual void ShowCursor()
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
Definition: vtkWindow.h:296
#define VTK_MARSHALAUTO
virtual bool IsPointSpriteBugPresent()
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
virtual void CreateAWindow()=0
Create a not-off-screen window.
vtkTypeBool GetEventPending() override
Check to see if a mouse button has been pressed.
OpenGL rendering window.
virtual int GetNumberOfDevices()
Returns the number of devices (graphics cards) on a system.
vtkTypeBool IsDirect() override
Is this render window using hardware acceleration? 0-false, 1-true.