VTK  9.3.20240418
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 #include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
26 
27 VTK_ABI_NAMESPACE_BEGIN
28 class vtkIdList;
29 
30 class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkEGLRenderWindow : public vtkOpenGLRenderWindow
31 {
32 public:
35  void PrintSelf(ostream& os, vtkIndent indent) override;
36 
40  void Frame() override;
41 
42  // override as some EGL systems cannot show the window
43  void SetShowWindow(bool) override;
44 
48  virtual void WindowInitialize();
49 
56  void Initialize() override;
57 
63  void Finalize() override;
64 
68  void SetFullScreen(vtkTypeBool) override;
69 
73  void WindowRemap() override;
74 
78  virtual void PrefFullScreen();
79 
88  void SetSize(int width, int height) override;
89  void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
90 
97  void SetStereoCapableWindow(vtkTypeBool capable) override;
98 
102  void MakeCurrent() override;
103 
107  void ReleaseCurrent() override;
108 
112  bool IsCurrent() override;
113 
117  vtkTypeBool IsDirect() override { return 1; }
118 
123  int* GetScreenSize() VTK_SIZEHINT(2) override;
124 
129  int* GetPosition() VTK_SIZEHINT(2) override;
130 
132 
135  void SetDisplayId(void*) override {}
136  void SetWindowId(void* window) override;
137  void SetNextWindowId(void*) override {}
138  void SetParentId(void*) override {}
139  void* GetGenericDisplayId() override;
140  void* GetGenericWindowId() override { return nullptr; }
141  void* GetGenericParentId() override { return nullptr; }
142  void* GetGenericContext() override;
143  void* GetGenericDrawable() override { return nullptr; }
144  void SetWindowInfo(const char*) override;
145  void SetNextWindowInfo(const char*) override {}
146  void SetParentInfo(const char*) override {}
148 
149  void SetWindowName(const char*) override;
150 
152 
157  void SetPosition(int x, int y) override;
158  void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
160 
162 
166  void HideCursor() override;
167  void ShowCursor() override;
169 
174  void Render() override;
175 
182  vtkTypeBool GetEventPending() override { return 0; }
183 
184  vtkTypeBool GetOwnWindow() { return this->OwnWindow; }
185 
190  void GetEGLSurfaceSize(int* width, int* height);
194  int GetNumberOfDevices() override;
201  bool IsPointSpriteBugPresent() override;
202 
203 protected:
206 
210  class vtkInternals;
211  vtkInternals* Internals;
212 
213  void CreateAWindow() override;
214  void DestroyWindow() override;
215  void ResizeWindow(int width, int height);
216 
222  bool SetDeviceAsDisplay(int deviceIndex);
223 
224 private:
225  vtkEGLRenderWindow(const vtkEGLRenderWindow&) = delete;
226  void operator=(const vtkEGLRenderWindow&) = delete;
227 
228  bool DeviceExtensionsPresent;
229 };
230 
231 VTK_ABI_NAMESPACE_END
232 #endif
OpenGL rendering window.
void * GetGenericContext() override
Dummy stubs for vtkWindow API.
void SetParentId(void *) override
Dummy stubs for vtkWindow API.
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
void ReleaseCurrent() override
Release the current context.
void WindowRemap() override
Resize the window.
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
virtual void PrefFullScreen()
Set the preferred window size to full screen.
vtkTypeBool GetEventPending() override
Check to see if a mouse button has been pressed.
void SetFullScreen(vtkTypeBool) override
Change the window to fill the entire screen.
void MakeCurrent() override
Make this window the current OpenGL context.
void SetShowWindow(bool) override
Show or not Show the window.
void SetPosition(int x, int y) override
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
bool SetDeviceAsDisplay(int deviceIndex)
Use EGL_EXT_device_base, EGL_EXT_platform_device and EGL_EXT_platform_base extensions to set the disp...
void SetPosition(int a[2]) override
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
bool IsPointSpriteBugPresent() override
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
void ResizeWindow(int width, int height)
vtkInternals * Internals
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...
void SetParentInfo(const char *) override
Dummy stubs for vtkWindow API.
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
void CreateAWindow() override
Create a not-off-screen window.
static vtkEGLRenderWindow * New()
void SetSize(int a[2]) override
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
vtkTypeBool IsDirect() override
Is this render window using hardware acceleration? 0-false, 1-true.
void SetSize(int width, int height) override
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
void GetEGLSurfaceSize(int *width, int *height)
Returns the width and height of the allocated EGL surface.
void * GetGenericDisplayId() override
Dummy stubs for vtkWindow API.
void Initialize() override
Initialize the rendering window.
bool IsCurrent() override
Tells if this window is the current OpenGL context for the calling thread.
void SetWindowName(const char *) override
Get name of rendering window.
void Frame() override
End the rendering process and display the image.
void SetNextWindowId(void *) override
Dummy stubs for vtkWindow API.
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...
void * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
int * GetScreenSize() override
Get the current size of the screen in pixels.
void SetWindowId(void *window) override
Dummy stubs for vtkWindow API.
void Render() override
This computes the size of the render window before calling the supper classes render.
void Finalize() override
"Deinitialize" the rendering window.
~vtkEGLRenderWindow() override
void SetNextWindowInfo(const char *) override
Dummy stubs for vtkWindow API.
int GetNumberOfDevices() override
Returns the number of devices (graphics cards) on a system.
vtkTypeBool GetOwnWindow()
void SetStereoCapableWindow(vtkTypeBool capable) override
Prescribe that the window be created in a stereo-capable mode.
void SetWindowInfo(const char *) override
Dummy stubs for vtkWindow API.
virtual void WindowInitialize()
Initialize the window for rendering.
void DestroyWindow() override
Destroy a not-off-screen window.
list of point or cell ids
Definition: vtkIdList.h:133
a simple class to control print indentation
Definition: vtkIndent.h:108
OpenGL rendering window.
@ height
Definition: vtkX3D.h:254
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO