VTK  9.7.20260805
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
32
33#ifndef vtkEGLRenderWindow_h
34#define vtkEGLRenderWindow_h
35
37#include "vtkRenderingOpenGL2Module.h" // For export macro
38#include "vtkWrappingHints.h" // For VTK_MARSHALAUTO
39
40#include <memory> // for unique_ptr
41
42VTK_ABI_NAMESPACE_BEGIN
43
44class vtkIdList;
47
48class VTKRENDERINGOPENGL2_EXPORT VTK_MARSHALAUTO vtkEGLRenderWindow : public vtkOpenGLRenderWindow
49{
50public:
55 void PrintSelf(ostream& os, vtkIndent indent) override;
56
60 void Frame() override;
61
66 void SetShowWindow(bool) override;
67
71 virtual void WindowInitialize();
72
79 void Initialize() override;
80
86 void Finalize() override;
87
91 void SetFullScreen(vtkTypeBool) override;
92
96 void WindowRemap() override;
97
101 virtual void PrefFullScreen();
102
111 void SetSize(int width, int height) override;
112 void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
113
120 void SetStereoCapableWindow(vtkTypeBool capable) override;
121
125 void MakeCurrent() override;
126
130 void ReleaseCurrent() override;
131
135 bool IsCurrent() override;
136
140 vtkTypeBool IsDirect() override { return 1; }
141
146 int* GetScreenSize() VTK_SIZEHINT(2) override;
147
152 int* GetPosition() VTK_SIZEHINT(2) override;
153
155
158 void SetDisplayId(void*) override {}
159 void SetWindowId(void* window) override;
160 void SetNextWindowId(void*) override {}
161 void SetParentId(void*) override {}
162 void* GetGenericDisplayId() override;
163 void* GetGenericWindowId() override { return nullptr; }
164 void* GetGenericParentId() override { return nullptr; }
165 void* GetGenericContext() override;
166 void* GetGenericDrawable() override { return nullptr; }
167 void SetWindowInfo(const char*) override;
168 void SetNextWindowInfo(const char*) override {}
169 void SetParentInfo(const char*) override {}
171
172 void SetWindowName(const char*) override;
173
175
180 void SetPosition(int x, int y) override;
181 void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
183
185
189 void HideCursor() override;
190 void ShowCursor() override;
192
197 void Render() override;
198
205 vtkTypeBool GetEventPending() override { return 0; }
206
208
213 void GetEGLSurfaceSize(int* width, int* height);
217 int GetNumberOfDevices() override;
224 bool IsPointSpriteBugPresent() override;
225
226 const char* ReportCapabilities() override;
227
228protected:
231
235
236 void CreateAWindow() override;
237 void DestroyWindow() override;
238 void ResizeWindow(int width, int height);
239
245 bool SetDeviceAsDisplay(int deviceIndex);
246
247private:
248 vtkEGLRenderWindow(const vtkEGLRenderWindow&) = delete;
249 void operator=(const vtkEGLRenderWindow&) = delete;
250
251 std::unique_ptr<vtkEGLRenderWindowInternals> Internals;
252};
253
254#define vtkEGLRenderWindow_OVERRIDE_ATTRIBUTES vtkEGLRenderWindow::CreateOverrideAttributes()
255VTK_ABI_NAMESPACE_END
256#endif
Internal class used to store and control EGL state.
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)
static vtkOverrideAttribute * CreateOverrideAttributes()
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 SetDisplayId(void *) override
Dummy stubs for vtkWindow API.
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?
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...
int * GetPosition() override
Get the position (x and y) of the rendering window in screen coordinates (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 * 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:26
a simple class to control print indentation
Definition vtkIndent.h:29
Attribute for vtkObjectFactory overrides.
int vtkTypeBool
Definition vtkABI.h:64
#define VTK_SIZEHINT(...)
#define VTK_MARSHALAUTO
#define VTK_NEWINSTANCE