LibreOffice Module vcl (master) 1
|
#include <OpenGLHelper.hxx>
Public Member Functions | |
OpenGLHelper ()=delete | |
Static Public Member Functions | |
static GLint | LoadShaders (const OUString &rVertexShaderName, const OUString &rFragmentShaderName, const OUString &rGeometryShaderName, std::string_view preamble, std::string_view rDigest) |
static GLint | LoadShaders (const OUString &rVertexShaderName, const OUString &rFragmentShaderName, std::string_view preamble, std::string_view rDigest) |
static GLint | LoadShaders (const OUString &rVertexShaderName, const OUString &rFragmentShaderName, const OUString &rGeometryShaderName) |
static GLint | LoadShaders (const OUString &rVertexShaderName, const OUString &rFragmentShaderName) |
static BitmapEx | ConvertBufferToBitmapEx (const sal_uInt8 *const pBuffer, tools::Long nWidth, tools::Long nHeight) |
The caller is responsible for allocating the memory for the buffer before calling this method. More... | |
static GLenum | OptimalBufferFormat () |
Returns the optimal buffer format for OpenGL (GL_BGRA or GL_RGBA). More... | |
static void | renderToFile (tools::Long nWidth, tools::Long nHeight, const OUString &rFileName) |
static const char * | GLErrorString (GLenum errorCode) |
static void | createFramebuffer (tools::Long nWidth, tools::Long nHeight, GLuint &nFramebufferId, GLuint &nRenderbufferDepthId, GLuint &nRenderbufferColorId) |
The caller is responsible for deleting the buffer objects identified by nFramebufferId, nRenderbufferDepthId and nRenderbufferColorId. More... | |
static float | getGLVersion () |
Get OpenGL version (needs a context) More... | |
static void | checkGLError (const char *aFile, size_t nLine) |
static void | debugMsgPrint (const int nType, const char *pFormat,...) |
Insert a glDebugMessage into the queue - helpful for debugging with apitrace to annotate the output and correlate it with code. More... | |
static void | debugMsgStream (std::ostringstream const &pStream) |
static void | debugMsgStreamWarn (std::ostringstream const &pStream) |
static bool | isDeviceDenylisted () |
checks if the device/driver pair is on our OpenGL denylist More... | |
static bool | supportsOpenGL () |
checks if the system supports all features that are necessary for the OpenGL support More... | |
Definition at line 45 of file OpenGLHelper.hxx.
|
delete |
|
static |
Definition at line 721 of file OpenGLHelper.cxx.
References GLErrorString(), and SAL_WARN.
|
static |
The caller is responsible for allocating the memory for the buffer before calling this method.
The buffer size is assumed to be 4*width*height and the format to be OptimalBufferFormat().
Definition at line 554 of file OpenGLHelper.cxx.
References vcl::N24_BPP, N24BitTcBgr, N24BitTcRgb, N8BitPal, x, and y.
Referenced by renderToFile().
|
static |
The caller is responsible for deleting the buffer objects identified by nFramebufferId, nRenderbufferDepthId and nRenderbufferColorId.
This create a buffer for rendering to texture and should be freed with glDeleteTextures.
nWidth | Width of frame |
nHeight | Height of frame |
nFramebufferId | FrameBuffer ID |
nRenderbufferDepthId | RenderBuffer's depth ID |
nRenderbufferColorId | RenderBuffer's color ID |
Definition at line 658 of file OpenGLHelper.cxx.
References CHECK_GL_ERROR, and SAL_WARN.
|
static |
Insert a glDebugMessage into the queue - helpful for debugging with apitrace to annotate the output and correlate it with code.
Definition at line 893 of file OpenGLHelper.cxx.
References OpenGLContext::hasCurrent(), nType, SAL_INFO, and SAL_WARN.
Referenced by debugMsgStream(), and debugMsgStreamWarn().
|
static |
Definition at line 881 of file OpenGLHelper.cxx.
References debugMsgPrint().
|
static |
Definition at line 887 of file OpenGLHelper.cxx.
References debugMsgPrint().
|
static |
Get OpenGL version (needs a context)
Definition at line 704 of file OpenGLHelper.cxx.
References CHECK_GL_ERROR.
Referenced by OpenGLContext::InitGL().
|
static |
Definition at line 598 of file OpenGLHelper.cxx.
Referenced by checkGLError().
|
static |
checks if the device/driver pair is on our OpenGL denylist
Definition at line 748 of file OpenGLHelper.cxx.
References WinOpenGLDeviceInfo::GetAdapterVendorID(), WinOpenGLDeviceInfo::isDeviceBlocked(), OpenGLZone::relaxWatchdogTimings(), and SAL_INFO.
Referenced by supportsOpenGL().
|
static |
Definition at line 520 of file OpenGLHelper.cxx.
References LoadShaders().
|
static |
Definition at line 513 of file OpenGLHelper.cxx.
References LoadShaders().
|
static |
Definition at line 372 of file OpenGLHelper.cxx.
References addPreamble(), CHECK_GL_ERROR, gbInShaderCompile, SAL_WARN, and VCL_GL_INFO.
Referenced by LoadShaders().
|
static |
Definition at line 505 of file OpenGLHelper.cxx.
References LoadShaders().
|
static |
Returns the optimal buffer format for OpenGL (GL_BGRA or GL_RGBA).
Definition at line 545 of file OpenGLHelper.cxx.
Referenced by renderToFile().
|
static |
Definition at line 526 of file OpenGLHelper.cxx.
References CHECK_GL_ERROR, SvFileStream::Close(), ConvertBufferToBitmapEx(), OptimalBufferFormat(), SAL_WARN, and vcl::PngImageWriter::write().
|
static |
checks if the system supports all features that are necessary for the OpenGL support
Definition at line 775 of file OpenGLHelper.cxx.
References ImplGetSVData(), isDeviceDenylisted(), and WatchdogThread::start().