VTK  9.0.20200808
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:
43  static vtkEGLRenderWindow* New();
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  bool IsCurrent() override;
118 
122  vtkTypeBool IsDirect() override { return 1; }
123 
128  int* GetScreenSize() VTK_SIZEHINT(2) override;
129 
134  int* GetPosition() VTK_SIZEHINT(2) override;
135 
137 
140  void SetDisplayId(void*) override {}
141  void SetWindowId(void* window) override;
142  void SetNextWindowId(void*) override {}
143  void SetParentId(void*) override {}
144  void* GetGenericDisplayId() override;
145  void* GetGenericWindowId() override { return nullptr; }
146  void* GetGenericParentId() override { return nullptr; }
147  void* GetGenericContext() override;
148  void* GetGenericDrawable() override { return nullptr; }
149  void SetWindowInfo(const char*) override;
150  void SetNextWindowInfo(const char*) override {}
151  void SetParentInfo(const char*) override {}
153 
154  void SetWindowName(const char*) override;
155 
157 
162  void SetPosition(int x, int y) override;
163  void SetPosition(int a[2]) override { this->SetPosition(a[0], a[1]); }
165 
167 
171  void HideCursor() override;
172  void ShowCursor() override;
174 
179  void Render() override;
180 
187  vtkTypeBool GetEventPending() override { return 0; }
188 
189  vtkTypeBool GetOwnWindow() { return this->OwnWindow; }
190 
195  void GetEGLSurfaceSize(int* width, int* height);
199  int GetNumberOfDevices() override;
206  bool IsPointSpriteBugPresent() override;
207 
208 protected:
210  ~vtkEGLRenderWindow() override;
211 
215  class vtkInternals;
216  vtkInternals* Internals;
217 
218  void CreateAWindow() override;
219  void DestroyWindow() override;
220  void ResizeWindow(int width, int height);
221 
227  void SetDeviceAsDisplay(int deviceIndex);
228 
229 private:
230  vtkEGLRenderWindow(const vtkEGLRenderWindow&) = delete;
231  void operator=(const vtkEGLRenderWindow&) = delete;
232 
233  bool DeviceExtensionsPresent;
234 };
235 
236 #endif
vtkOpenGLRenderWindow::PrintSelf
void PrintSelf(ostream &os, vtkIndent indent) override
Methods invoked by print to print information about the object including superclasses.
vtkEGLRenderWindow
OpenGL rendering window.
Definition: vtkEGLRenderWindow.h:40
vtkEGLRenderWindow::SetNextWindowInfo
void SetNextWindowInfo(const char *) override
Definition: vtkEGLRenderWindow.h:150
vtkEGLRenderWindow::GetEventPending
vtkTypeBool GetEventPending() override
Check to see if a mouse button has been pressed.
Definition: vtkEGLRenderWindow.h:187
vtkRenderWindow::SetWindowInfo
void SetWindowInfo(const char *) override
Definition: vtkRenderWindow.h:628
vtkWindow::SetPosition
virtual void SetPosition(int x, int y)
Set the position (x and y) of the rendering window in screen coordinates (in pixels).
vtkEGLRenderWindow::GetGenericWindowId
void * GetGenericWindowId() override
Definition: vtkEGLRenderWindow.h:145
vtkEGLRenderWindow::SetPosition
void SetPosition(int a[2]) override
Definition: vtkEGLRenderWindow.h:163
vtkRenderWindow::SetWindowId
void SetWindowId(void *) override
Definition: vtkRenderWindow.h:620
vtkEGLRenderWindow::SetNextWindowId
void SetNextWindowId(void *) override
Definition: vtkEGLRenderWindow.h:142
vtkEGLRenderWindow::GetGenericDrawable
void * GetGenericDrawable() override
Definition: vtkEGLRenderWindow.h:148
vtkEGLRenderWindow::SetSize
void SetSize(int a[2]) override
Definition: vtkEGLRenderWindow.h:99
vtkEGLRenderWindow::Internals
vtkInternals * Internals
Definition: vtkEGLRenderWindow.h:215
vtkRenderWindow::GetGenericDisplayId
void * GetGenericDisplayId() override
Definition: vtkRenderWindow.h:623
vtkRenderWindow::WindowRemap
virtual void WindowRemap()
Remap the rendering window.
Definition: vtkRenderWindow.h:404
vtkRenderWindow::ShowCursor
virtual void ShowCursor()
Definition: vtkRenderWindow.h:212
vtkRenderWindow::HideCursor
virtual void HideCursor()
Hide or Show the mouse cursor, it is nice to be able to hide the default cursor if you want VTK to di...
Definition: vtkRenderWindow.h:211
vtkWindow::SetSize
virtual void SetSize(int width, int height)
Set the size (width and height) of the rendering window in screen coordinates (in pixels).
VTK_SIZEHINT
#define VTK_SIZEHINT(...)
Definition: vtkWrappingHints.h:45
vtkRenderWindow::Finalize
virtual void Finalize()
Finalize the rendering process.
Definition: vtkRenderWindow.h:177
vtkOpenGLRenderWindow::Render
void Render() override
Handle opengl specific code and calls superclass.
vtkX3D::height
Definition: vtkX3D.h:260
vtkWindow::SetWindowName
virtual void SetWindowName(const char *)
vtkEGLRenderWindow::IsDirect
vtkTypeBool IsDirect() override
Is this render window using hardware acceleration? 0-false, 1-true.
Definition: vtkEGLRenderWindow.h:122
vtkEGLRenderWindow::GetGenericParentId
void * GetGenericParentId() override
Definition: vtkEGLRenderWindow.h:146
vtkRenderWindow::MakeCurrent
void MakeCurrent() override
Attempt to make this window the current graphics context for the calling thread.
Definition: vtkRenderWindow.h:656
vtkIndent
a simple class to control print indentation
Definition: vtkIndent.h:33
vtkEGLRenderWindow::GetOwnWindow
vtkTypeBool GetOwnWindow()
Definition: vtkEGLRenderWindow.h:189
vtkIdList
list of point or cell ids
Definition: vtkIdList.h:30
vtkWindow::GetScreenSize
virtual int * GetScreenSize()
Get the current size of the screen in pixels.
Definition: vtkWindow.h:105
vtkOpenGLRenderWindow::IsPointSpriteBugPresent
virtual bool IsPointSpriteBugPresent()
Returns true if driver has an EGL/OpenGL bug that makes vtkChartsCoreCxx-TestChartDoubleColors and ot...
Definition: vtkOpenGLRenderWindow.h:269
vtkRenderWindow::SetStereoCapableWindow
virtual void SetStereoCapableWindow(vtkTypeBool capable)
vtkRenderWindow::GetNumberOfDevices
virtual int GetNumberOfDevices()
Returns the number of devices (graphics cards) on a system.
Definition: vtkRenderWindow.h:740
vtkEGLRenderWindow::OwnWindow
vtkTypeBool OwnWindow
Definition: vtkEGLRenderWindow.h:212
vtkOpenGLRenderWindow::Frame
void Frame() override
A termination method performed at the end of the rendering process to do things like swapping buffers...
vtkEGLRenderWindow::IsPointSpriteBugTested
bool IsPointSpriteBugTested
Definition: vtkEGLRenderWindow.h:213
vtkRenderWindow::SetFullScreen
virtual void SetFullScreen(vtkTypeBool)
Turn on/off rendering full screen window size.
Definition: vtkRenderWindow.h:228
vtkEGLRenderWindow::IsPointSpriteBugPresent_
bool IsPointSpriteBugPresent_
Definition: vtkEGLRenderWindow.h:214
vtkOpenGLRenderWindow::DestroyWindow
virtual void DestroyWindow()=0
Destroy a not-off-screen window.
vtkEGLRenderWindow::SetParentInfo
void SetParentInfo(const char *) override
Definition: vtkEGLRenderWindow.h:151
vtkWindow::SetShowWindow
virtual void SetShowWindow(bool)
vtkOpenGLRenderWindow
OpenGL rendering window.
Definition: vtkOpenGLRenderWindow.h:53
vtkRenderWindow::GetGenericContext
void * GetGenericContext() override
Definition: vtkRenderWindow.h:626
vtkRenderWindow::IsCurrent
virtual bool IsCurrent()
Tells if this window is the current graphics context for the calling thread.
Definition: vtkRenderWindow.h:662
vtkRenderWindow::New
static vtkRenderWindow * New()
Construct an instance of vtkRenderWindow with its screen size set to 300x300, borders turned on,...
vtkEGLRenderWindow::SetParentId
void SetParentId(void *) override
Definition: vtkEGLRenderWindow.h:143
vtkTypeBool
int vtkTypeBool
Definition: vtkABI.h:69
vtkOpenGLRenderWindow::Initialize
virtual void Initialize(void)
Initialize the rendering window.
Definition: vtkOpenGLRenderWindow.h:302
vtkOpenGLRenderWindow::CreateAWindow
virtual void CreateAWindow()=0
Create a not-off-screen window.
vtkOpenGLRenderWindow.h