VTK  9.5.20250812
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
24#include "vtkRenderingOpenGL2Module.h" // For export macro
25#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
26
27#include <memory> // for unique_ptr
28
29VTK_ABI_NAMESPACE_BEGIN
30
31class vtkIdList;
33
34class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkEGLRenderWindow : public vtkOpenGLRenderWindow
35{
36public:
39 void PrintSelf(ostream& os, vtkIndent indent) override;
40
44 void Frame() override;
45
50 void SetShowWindow(bool) override;
51
55 virtual void WindowInitialize();
56
63 void Initialize() override;
64
70 void Finalize() override;
71
75 void SetFullScreen(vtkTypeBool) override;
76
80 void WindowRemap() override;
81
85 virtual void PrefFullScreen();
86
95 void SetSize(int width, int height) override;
96 void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
97
104 void SetStereoCapableWindow(vtkTypeBool capable) override;
105
109 void MakeCurrent() override;
110
114 void ReleaseCurrent() override;
115
119 bool IsCurrent() override;
120
124 vtkTypeBool IsDirect() override { return 1; }
125
130 int* GetScreenSize() VTK_SIZEHINT(2) override;
131
136 int* GetPosition() VTK_SIZEHINT(2) override;
137
139
142 void SetDisplayId(void*) override {}
143 void SetWindowId(void* window) override;
144 void SetNextWindowId(void*) override {}
145 void SetParentId(void*) override {}
146 void* GetGenericDisplayId() override;
147 void* GetGenericWindowId() override { return nullptr; }
148 void* GetGenericParentId() override { return nullptr; }
149 void* GetGenericContext() override;
150 void* GetGenericDrawable() override { return nullptr; }
151 void SetWindowInfo(const char*) override;
152 void SetNextWindowInfo(const char*) override {}
153 void SetParentInfo(const char*) override {}
155
156 void SetWindowName(const char*) override;
157
159
164 void SetPosition(int x, int y) override;
165 void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
167
169
173 void HideCursor() override;
174 void ShowCursor() override;
176
181 void Render() override;
182
189 vtkTypeBool GetEventPending() override { return 0; }
190
191 vtkTypeBool GetOwnWindow() { return this->OwnWindow; }
192
197 void GetEGLSurfaceSize(int* width, int* height);
201 int GetNumberOfDevices() override;
208 bool IsPointSpriteBugPresent() override;
209
210 const char* ReportCapabilities() override;
211
212protected:
215
219
220 void CreateAWindow() override;
221 void DestroyWindow() override;
222 void ResizeWindow(int width, int height);
223
229 bool SetDeviceAsDisplay(int deviceIndex);
230
231private:
232 vtkEGLRenderWindow(const vtkEGLRenderWindow&) = delete;
233 void operator=(const vtkEGLRenderWindow&) = delete;
234
235 std::unique_ptr<vtkEGLRenderWindowInternals> Internals;
236};
237
238VTK_ABI_NAMESPACE_END
239#endif
Internal class used to store and control EGL state.
OpenGL rendering window.
void SetParentId(void *) override
Dummy stubs for vtkWindow API.
void * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
void ReleaseCurrent() override
Release the current context.
void WindowRemap() override
Resize the window.
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
Overridden because vtkEGLRenderWindow window cannot be shown onscreen, except on android and wayland.
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...
int * GetScreenSize() override
Get the current size of the screen in pixels.
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)
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...
static vtkEGLRenderWindow * New()
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.
const char * ReportCapabilities() override
Get report of capabilities for the render window.
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
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 Initialize() override
Initialize the rendering window.
bool IsCurrent() override
Tells if this window is the current OpenGL context for the calling thread.
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
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 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 * GetGenericDisplayId() override
Dummy stubs for vtkWindow API.
void Finalize() override
"Deinitialize" the rendering window.
~vtkEGLRenderWindow() override
void * GetGenericContext() override
Dummy stubs for vtkWindow API.
void SetNextWindowInfo(const char *) override
Dummy stubs for vtkWindow API.
int GetNumberOfDevices() override
Returns the number of devices (graphics cards) on a system.
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.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO