VTK  9.1.0
vtkEGLRenderWindow.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Program: Visualization Toolkit
4  Module: vtkEGLRenderWindow.h
5 
6  Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
7  All rights reserved.
8  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
9 
10  This software is distributed WITHOUT ANY WARRANTY; without even
11  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
12  PURPOSE. See the above copyright notice for more information.
13 
14 =========================================================================*/
32 #ifndef vtkEGLRenderWindow_h
33 #define vtkEGLRenderWindow_h
34 
35 #include "vtkOpenGLRenderWindow.h"
36 #include "vtkRenderingOpenGL2Module.h" // For export macro
37 
38 class vtkIdList;
39 
40 class VTKRENDERINGOPENGL2_EXPORT vtkEGLRenderWindow : public vtkOpenGLRenderWindow
41 {
42 public:
45  void PrintSelf(ostream& os, vtkIndent indent) override;
46 
50  void Frame(void) override;
51 
52  // override as some EGL systems cannot show the window
53  void SetShowWindow(bool) override;
54 
58  virtual void WindowInitialize(void);
59 
66  void Initialize(void) override;
67 
73  void Finalize(void) override;
74 
78  void SetFullScreen(vtkTypeBool) override;
79 
83  void WindowRemap(void) override;
84 
88  virtual void PrefFullScreen(void);
89 
98  void SetSize(int width, int height) override;
99  void SetSize(int a[2]) override { this->SetSize(a[0], a[1]); }
100 
107  void SetStereoCapableWindow(vtkTypeBool capable) override;
108 
112  void MakeCurrent() override;
113 
117  void ReleaseCurrent() override;
118 
122  bool IsCurrent() override;
123 
127  vtkTypeBool IsDirect() override { return 1; }
128 
133  int* GetScreenSize() VTK_SIZEHINT(2) override;
134 
139  int* GetPosition() VTK_SIZEHINT(2) override;
140 
142 
145  void SetDisplayId(void*) override {}
146  void SetWindowId(void* window) override;
147  void SetNextWindowId(void*) override {}
148  void SetParentId(void*) override {}
149  void* GetGenericDisplayId() override;
150  void* GetGenericWindowId() override { return nullptr; }
151  void* GetGenericParentId() override { return nullptr; }
152  void* GetGenericContext() override;
153  void* GetGenericDrawable() override { return nullptr; }
154  void SetWindowInfo(const char*) override;
155  void SetNextWindowInfo(const char*) override {}
156  void SetParentInfo(const char*) override {}
158 
159  void SetWindowName(const char*) override;
160 
162 
167  void SetPosition(int x, int y) override;
168  void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
170 
172 
176  void HideCursor() override;
177  void ShowCursor() override;
179 
184  void Render() override;
185 
192  vtkTypeBool GetEventPending() override { return 0; }
193 
194  vtkTypeBool GetOwnWindow() { return this->OwnWindow; }
195 
200  void GetEGLSurfaceSize(int* width, int* height);
204  int GetNumberOfDevices() override;
211  bool IsPointSpriteBugPresent() override;
212 
213 protected:
216 
220  class vtkInternals;
221  vtkInternals* Internals;
222 
223  void CreateAWindow() override;
224  void DestroyWindow() override;
225  void ResizeWindow(int width, int height);
226 
232  void SetDeviceAsDisplay(int deviceIndex);
233 
234 private:
235  vtkEGLRenderWindow(const vtkEGLRenderWindow&) = delete;
236  void operator=(const vtkEGLRenderWindow&) = delete;
237 
238  bool DeviceExtensionsPresent;
239 };
240 
241 #endif
vtkEGLRenderWindow::ReleaseCurrent
void ReleaseCurrent() override
Release the current context.
vtkEGLRenderWindow
OpenGL rendering window.
Definition: vtkEGLRenderWindow.h:41
vtkEGLRenderWindow::SetNextWindowInfo
void SetNextWindowInfo(const char *) override
Dummy stubs for vtkWindow API.
Definition: vtkEGLRenderWindow.h:155
vtkEGLRenderWindow::GetEventPending
vtkTypeBool GetEventPending() override
Check to see if a mouse button has been pressed.
Definition: vtkEGLRenderWindow.h:192
vtkEGLRenderWindow::~vtkEGLRenderWindow
~vtkEGLRenderWindow() override
vtkEGLRenderWindow::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkEGLRenderWindow::SetDeviceAsDisplay
void SetDeviceAsDisplay(int deviceIndex)
Use EGL_EXT_device_base, EGL_EXT_platform_device and EGL_EXT_platform_base extensions to set the disp...
vtkEGLRenderWindow::SetSize
void SetSize(int width, int height) override
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
vtkEGLRenderWindow::SetWindowId
void SetWindowId(void *window) override
Dummy stubs for vtkWindow API.
vtkEGLRenderWindow::WindowInitialize
virtual void WindowInitialize(void)
Initialize the window for rendering.
vtkEGLRenderWindow::GetGenericWindowId
void * GetGenericWindowId() override
Dummy stubs for vtkWindow API.
Definition: vtkEGLRenderWindow.h:150
vtkEGLRenderWindow::SetPosition
void SetPosition(int a[2]) override
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
Definition: vtkEGLRenderWindow.h:168
vtkEGLRenderWindow::SetNextWindowId
void SetNextWindowId(void *) override
Dummy stubs for vtkWindow API.
Definition: vtkEGLRenderWindow.h:147
vtkEGLRenderWindow::GetGenericDrawable
void * GetGenericDrawable() override
Dummy stubs for vtkWindow API.
Definition: vtkEGLRenderWindow.h:153
vtkEGLRenderWindow::SetFullScreen
void SetFullScreen(vtkTypeBool) override
Change the window to fill the entire screen.
vtkEGLRenderWindow::SetShowWindow
void SetShowWindow(bool) override
Show or not Show the window.
vtkEGLRenderWindow::SetSize
void SetSize(int a[2]) override
Get the size (width and height) of the rendering window in screen coordinates (in pixels).
Definition: vtkEGLRenderWindow.h:99
vtkEGLRenderWindow::Internals
vtkInternals * Internals
Definition: vtkEGLRenderWindow.h:220
vtkEGLRenderWindow::CreateAWindow
void CreateAWindow() override
Create a not-off-screen window.
vtkEGLRenderWindow::Frame
void Frame(void) override
End the rendering process and display the image.
vtkEGLRenderWindow::New
static vtkEGLRenderWindow * New()
vtkEGLRenderWindow::Render
void Render() override
This computes the size of the render window before calling the supper classes render.
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:48
vtkX3D::height
@ height
Definition: vtkX3D.h:260
vtkEGLRenderWindow::IsDirect
vtkTypeBool IsDirect() override
Is this render window using hardware acceleration? 0-false, 1-true.
Definition: vtkEGLRenderWindow.h:127
vtkEGLRenderWindow::GetGenericParentId
void * GetGenericParentId() override
Dummy stubs for vtkWindow API.
Definition: vtkEGLRenderWindow.h:151
vtkEGLRenderWindow::GetGenericContext
void * GetGenericContext() override
Dummy stubs for vtkWindow API.
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:113
vtkEGLRenderWindow::GetOwnWindow
vtkTypeBool GetOwnWindow()
Definition: vtkEGLRenderWindow.h:194
vtkEGLRenderWindow::IsCurrent
bool IsCurrent() override
Tells if this window is the current OpenGL context for the calling thread.
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:140
vtkEGLRenderWindow::SetPosition
void SetPosition(int x, int y) override
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
vtkEGLRenderWindow::GetScreenSize
int * GetScreenSize() override
Get the current size of the screen in pixels.
vtkEGLRenderWindow::SetStereoCapableWindow
void SetStereoCapableWindow(vtkTypeBool capable) override
Prescribe that the window be created in a stereo-capable mode.
vtkEGLRenderWindow::DestroyWindow
void DestroyWindow() override
Destroy a not-off-screen window.
vtkEGLRenderWindow::SetWindowName
void SetWindowName(const char *) override
Get name of rendering window.
vtkEGLRenderWindow::SetWindowInfo
void SetWindowInfo(const char *) override
Dummy stubs for vtkWindow API.
vtkEGLRenderWindow::OwnWindow
vtkTypeBool OwnWindow
Definition: vtkEGLRenderWindow.h:217
vtkEGLRenderWindow::IsPointSpriteBugTested
bool IsPointSpriteBugTested
Definition: vtkEGLRenderWindow.h:218
vtkEGLRenderWindow::HideCursor
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...
vtkEGLRenderWindow::Initialize
void Initialize(void) override
Initialize the rendering window.
vtkEGLRenderWindow::ResizeWindow
void ResizeWindow(int width, int height)
vtkEGLRenderWindow::IsPointSpriteBugPresent_
bool IsPointSpriteBugPresent_
Definition: vtkEGLRenderWindow.h:219
vtkEGLRenderWindow::ShowCursor
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...
vtkEGLRenderWindow::SetParentInfo
void SetParentInfo(const char *) override
Dummy stubs for vtkWindow API.
Definition: vtkEGLRenderWindow.h:156
vtkEGLRenderWindow::vtkEGLRenderWindow
vtkEGLRenderWindow()
vtkEGLRenderWindow::PrefFullScreen
virtual void PrefFullScreen(void)
Set the preferred window size to full screen.
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:83
vtkEGLRenderWindow::WindowRemap
void WindowRemap(void) override
Resize the window.
vtkEGLRenderWindow::Finalize
void Finalize(void) override
"Deinitialize" the rendering window.
vtkEGLRenderWindow::IsPointSpriteBugPresent
bool IsPointSpriteBugPresent() override
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
vtkEGLRenderWindow::SetParentId
void SetParentId(void *) override
Dummy stubs for vtkWindow API.
Definition: vtkEGLRenderWindow.h:148
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkEGLRenderWindow::GetEGLSurfaceSize
void GetEGLSurfaceSize(int *width, int *height)
Returns the width and height of the allocated EGL surface.
vtkEGLRenderWindow::GetNumberOfDevices
int GetNumberOfDevices() override
Returns the number of devices (graphics cards) on a system.
vtkEGLRenderWindow::GetGenericDisplayId
void * GetGenericDisplayId() override
Dummy stubs for vtkWindow API.
vtkOpenGLRenderWindow.h
vtkEGLRenderWindow::MakeCurrent
void MakeCurrent() override
Make this window the current OpenGL context.