VTK  9.3.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
20 #ifndef vtkEGLRenderWindow_h
21 #define vtkEGLRenderWindow_h
22 
23 #include "vtkOpenGLRenderWindow.h"
24 #include "vtkRenderingOpenGL2Module.h" // For export macro
25 
26 VTK_ABI_NAMESPACE_BEGIN
27 class vtkIdList;
28 
29 class VTKRENDERINGOPENGL2_EXPORT vtkEGLRenderWindow : public vtkOpenGLRenderWindow
30 {
31 public:
32  static vtkEGLRenderWindow* New();
34  void PrintSelf(ostream& os, vtkIndent indent) override;
35 
39  void Frame() override;
40 
41  // override as some EGL systems cannot show the window
42  void SetShowWindow(bool) override;
43 
47  virtual void WindowInitialize();
48 
55  void Initialize() override;
56 
62  void Finalize() override;
63 
67  void SetFullScreen(vtkTypeBool) override;
68 
72  void WindowRemap() override;
73 
77  virtual void PrefFullScreen();
78 
87  void SetSize(int width, int height) override;
88  void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
89 
96  void SetStereoCapableWindow(vtkTypeBool capable) override;
97 
101  void MakeCurrent() override;
102 
106  void ReleaseCurrent() override;
107 
111  bool IsCurrent() override;
112 
116  vtkTypeBool IsDirect() override { return 1; }
117 
122  int* GetScreenSize() VTK_SIZEHINT(2) override;
123 
128  int* GetPosition() VTK_SIZEHINT(2) override;
129 
131 
134  void SetDisplayId(void*) override {}
135  void SetWindowId(void* window) override;
136  void SetNextWindowId(void*) override {}
137  void SetParentId(void*) override {}
138  void* GetGenericDisplayId() override;
139  void* GetGenericWindowId() override { return nullptr; }
140  void* GetGenericParentId() override { return nullptr; }
141  void* GetGenericContext() override;
142  void* GetGenericDrawable() override { return nullptr; }
143  void SetWindowInfo(const char*) override;
144  void SetNextWindowInfo(const char*) override {}
145  void SetParentInfo(const char*) override {}
147 
148  void SetWindowName(const char*) override;
149 
151 
156  void SetPosition(int x, int y) override;
157  void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
159 
161 
165  void HideCursor() override;
166  void ShowCursor() override;
168 
173  void Render() override;
174 
181  vtkTypeBool GetEventPending() override { return 0; }
182 
183  vtkTypeBool GetOwnWindow() { return this->OwnWindow; }
184 
189  void GetEGLSurfaceSize(int* width, int* height);
193  int GetNumberOfDevices() override;
200  bool IsPointSpriteBugPresent() override;
201 
202 protected:
204  ~vtkEGLRenderWindow() override;
205 
209  class vtkInternals;
210  vtkInternals* Internals;
211 
212  void CreateAWindow() override;
213  void DestroyWindow() override;
214  void ResizeWindow(int width, int height);
215 
221  bool SetDeviceAsDisplay(int deviceIndex);
222 
223 private:
224  vtkEGLRenderWindow(const vtkEGLRenderWindow&) = delete;
225  void operator=(const vtkEGLRenderWindow&) = delete;
226 
227  bool DeviceExtensionsPresent;
228 };
229 
230 VTK_ABI_NAMESPACE_END
231 #endif
vtkTypeBool GetOwnWindow()
OpenGL rendering window.
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
vtkInternals * Internals
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.
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...
void Render() override
Handle opengl specific code and calls superclass.
static vtkRenderWindow * New()
Construct an instance of vtkRenderWindow with its screen size set to 300x300, borders turned on...
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)...
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:22
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...
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
Definition: vtkWindow.h:94
virtual void Initialize()
Initialize the rendering window.
virtual void MakeCurrent()
Make the window current.
Definition: vtkWindow.h:235
#define VTK_SIZEHINT(...)
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...
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:241
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 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.