4#ifndef vtkEGLRenderWindowInternals_h
5#define vtkEGLRenderWindowInternals_h
11#include "vtkglad/include/glad/egl.h"
13VTK_ABI_NAMESPACE_BEGIN
29 [[nodiscard]] EGLDisplay
GetDisplay()
const {
return this->Display; }
34 [[nodiscard]] EGLDisplay
GetSurface()
const {
return this->Surface; }
40 [[nodiscard]] EGLContext
GetContext()
const {
return this->Context; }
41 void SetContext(EGLContext context) { this->Context = context; }
47 void SetWindow(EGLNativeWindowType window) { this->Window = window; }
112 bool TryInitializeMesaSoftware(EGLint& major, EGLint& minor);
117 bool TryInitializeHardware(
int deviceIndex, EGLint& major, EGLint& minor);
122 bool FinalizeDisplaySetup(EGLint major, EGLint minor);
128 void InitializeOffscreenFramebuffer();
134 void DestroyOffscreenFramebuffer();
136 EGLNativeWindowType Window;
141 int DeviceIndex = -1;
142 bool UseOnscreenRendering =
false;
144 std::unique_ptr<vtkEGLConfig> Config;
146 unsigned int Height = 0;
147 unsigned int Width = 0;
149 unsigned int SurfacelessFBO = 0;
150 unsigned int ColorTexture = 0;
151 unsigned int DepthBuffer = 0;
vtkEGLRenderWindowInternals()
bool IsMesaSoftwareRenderer() const
Return true if the current build is using Mesa software rendering backend.
EGLDisplay GetDisplay() const
Return the EGLDisplay.
bool SetDeviceAsDisplay(int deviceIndex)
Set the wanted device for display if the device is available.
EGLDisplay GetSurface() const
Return the EGLSurface.
void SetUseOnscreenRendering(bool useOnscreenRendering)
Setter to handle onscreen rendering.
void ConfigureWindow(int width, int height)
Configure the current EGLWindow with the requested size.
~vtkEGLRenderWindowInternals()=default
bool MakeCurrent()
Try to attach the EGL rendering context to the EGL surface.
void SetContext(EGLContext context)
Get/Set the EGLContext.
EGLContext GetContext() const
Get/Set the EGLContext.
void SetDeviceIndex(int deviceIndex)
Setter used to store the device expected by the user.
void ReleaseCurrent()
Release the EGL state.
int GetNumberOfDevices()
Get the number of devices (graphic cards) from the system.
void SetWindow(EGLNativeWindowType window)
Set the EGLWindow.
void GetSizeFromSurface(int *size)
Get the current size of the EGLSurface.
void DestroyWindow()
Release EGL window.
an ordered list of renderers