VTK  9.7.1
vtkEGLRenderWindowInternals.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
3 
4 #ifndef vtkEGLRenderWindowInternals_h
5 #define vtkEGLRenderWindowInternals_h
6 
7 #include "Private/vtkEGLConfig.h"
8 #include "vtkOpenGLRenderer.h"
9 
10 #include "vtkglad/include/glad/egl.h"
11 
12 VTK_ABI_NAMESPACE_BEGIN
13 
19 class VTKRENDERINGOPENGL2_EXPORT vtkEGLRenderWindowInternals
20 {
21 public:
25  [[nodiscard]] EGLDisplay GetDisplay() const { return this->Display; }
26 
30  [[nodiscard]] EGLDisplay GetSurface() const { return this->Surface; }
31 
33 
36  [[nodiscard]] EGLContext GetContext() const { return this->Context; }
37  void SetContext(EGLContext context) { this->Context = context; }
39 
41 
44  [[nodiscard]] EGLNativeWindowType GetWindow() const { return this->Window; }
45  void SetWindow(EGLNativeWindowType window) { this->Window = window; }
47 
51  void SwapBuffer();
52 
56  [[nodiscard]] int GetNumberOfDevices();
57 
62  [[nodiscard]] bool SetDeviceAsDisplay(int deviceIndex);
63 
67  void DestroyWindow();
68 
73  void ConfigureWindow(int width, int height);
74 
78  void SetDeviceIndex(int deviceIndex) { this->DeviceIndex = deviceIndex; };
79 
84  void SetUseOnscreenRendering(bool useOnscreenRendering);
85 
89  void GetSizeFromSurface(int* size);
90 
94  void ReleaseCurrent();
95 
100  bool MakeCurrent();
101 
103  ~vtkEGLRenderWindowInternals() = default;
104 
105 private:
106  EGLNativeWindowType Window;
107  EGLDisplay Display;
108  EGLSurface Surface;
109  EGLContext Context;
110 
111  int DeviceIndex = -1;
112  bool UseOnscreenRendering = false;
113 
114  std::unique_ptr<vtkEGLConfig> Config;
115 };
116 
117 VTK_ABI_NAMESPACE_END
118 #endif
void SetDeviceIndex(int deviceIndex)
Setter used to store the device expected by the user.
EGLContext GetContext() const
Get/Set the EGLContext.
EGLDisplay GetDisplay() const
Return the EGLDisplay.
Internal class used to store and control EGL state.
void SetWindow(EGLNativeWindowType window)
Get/Set the EGLWindow.
void SetContext(EGLContext context)
Get/Set the EGLContext.
EGLDisplay GetSurface() const
Return the EGLSurface.
EGLNativeWindowType GetWindow() const
Get/Set the EGLWindow.