VTK  9.3.0
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:
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:
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
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:23
a simple class to control print indentation
Definition: vtkIndent.h:29
OpenGL rendering window.
@ height
Definition: vtkX3D.h:254
int vtkTypeBool
Definition: vtkABI.h:64
#define VTK_SIZEHINT(...)