![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include "LinuxOpenGLPlatform.h"#include "Misc/ScopeLock.h"#include "OpenGLDrv.h"#include <SDL3/SDL.h>#include "OpenGLDrvPrivate.h"#include "ComponentReregisterContext.h"#include "Linux/LinuxPlatformApplicationMisc.h"#include "GenericPlatform/GenericPlatformFramePacer.h"#include "RHIUtilities.h"Classes | |
| struct | FPlatformOpenGLContext |
| class | FScopeContext |
| struct | FPlatformOpenGLDevice |
Macros | |
| #define | GET_GL_ENTRYPOINTS(Type, Func) GLFuncPointers::Func = reinterpret_cast<Type>(SDL_GL_GetProcAddress(#Func)); |
| #define | CHECK_GL_ENTRYPOINTS(Type, Func) if (Func == NULL) { bFoundAllEntryPoints = false; UE_LOG(LogRHI, Fatal, TEXT("Failed to find entry point for %s"), TEXT(#Func)); } |
Typedefs | |
| typedef SDL_Window * | SDL_HWindow |
| typedef SDL_GLContext | SDL_HGLContext |
| #define CHECK_GL_ENTRYPOINTS | ( | Type, | |
| Func | |||
| ) | if (Func == NULL) { bFoundAllEntryPoints = false; UE_LOG(LogRHI, Fatal, TEXT("Failed to find entry point for %s"), TEXT(#Func)); } |
| #define GET_GL_ENTRYPOINTS | ( | Type, | |
| Func | |||
| ) | GLFuncPointers::Func = reinterpret_cast<Type>(SDL_GL_GetProcAddress(#Func)); |
| void Linux_ContextMakeCurrent | ( | SDL_HWindow | hWnd, |
| SDL_HGLContext | hGLDC | ||
| ) |
| SDL_HGLContext Linux_GetCurrentContext | ( | ) |
| void Linux_PlatformCreateDummyGLWindow | ( | FPlatformOpenGLContext * | OutContext | ) |
Create a dummy window used to construct OpenGL contexts.
| void Linux_PlatformCreateOpenGLContextCore | ( | FPlatformOpenGLContext * | OutContext | ) |
Create a core profile OpenGL context.
| bool Linux_PlatformOpenGLDebugCtx | ( | ) |
Enable/Disable debug context from the commandline
| bool PlatformBlitToViewport | ( | IRHICommandContext & | RHICmdContext, |
| FPlatformOpenGLDevice * | Device, | ||
| const FOpenGLViewport & | Viewport, | ||
| uint32 | BackbufferSizeX, | ||
| uint32 | BackbufferSizeY, | ||
| bool | bPresent, | ||
| bool | bLockToVsync | ||
| ) |
Main function for transferring data to on-screen buffers. On Windows it temporarily switches OpenGL context, on Mac only context's output view.
| bool PlatformCanEnableGPUCapture | ( | ) |
Returns true if the platform supports a GPU capture tool (eg RenderDoc)
| FOpenGLTexture * PlatformCreateBuiltinBackBuffer | ( | FOpenGLDynamicRHI * | OpenGLRHI, |
| uint32 | SizeX, | ||
| uint32 | SizeY | ||
| ) |
| FPlatformOpenGLContext * PlatformCreateOpenGLContext | ( | FPlatformOpenGLDevice * | Device, |
| void * | InWindowHandle | ||
| ) |
Create an OpenGL context.
| FPlatformOpenGLDevice * PlatformCreateOpenGLDevice | ( | ) |
Create the OpenGL device, encompassing all data needed to handle set of OpenGL contexts for a single OpenGL RHI. This contains shared context (to be used for resource loading), rendering context (to be used for rendering), and viewport contexts (to be used for blitting for various platform-specific viewports). On different platforms implementation details differ, by a lot. This should be called when creating the OpenGL RHI.
| void PlatformDestroyOpenGLContext | ( | FPlatformOpenGLDevice * | Device, |
| FPlatformOpenGLContext * | Context | ||
| ) |
Destroy an OpenGL context.
| void PlatformDestroyOpenGLDevice | ( | FPlatformOpenGLDevice * | Device | ) |
| void PlatformFlushIfNeeded | ( | ) |
| bool PlatformGetAvailableResolutions | ( | FScreenResolutionArray & | Resolutions, |
| bool | bIgnoreRefreshRate | ||
| ) |
Retrieve available screen resolutions.
Returns a supported screen resolution that most closely matches input.
| void * PlatformGetWindow | ( | FPlatformOpenGLContext * | Context, |
| void ** | AddParam | ||
| ) |
| int32 PlatformGlGetError | ( | ) |
Just a glGetError() call. Added to make it possible to compile GL_VERIFY macros in other projects than OpenGLDrv.
| bool PlatformInitOpenGL | ( | ) |
Initialize OpenGL on this platform. This must be called once before device contexts can be created.
| void PlatformNULLContextSetup | ( | ) |
This is used to detach an OpenGL context from current thread.
| bool PlatformOpenGLThreadHasRenderingContext | ( | ) |
Returns true when the calling thread owns the OpenGL rendering context.
| void PlatformReleaseOpenGLContext | ( | FPlatformOpenGLDevice * | Device, |
| FPlatformOpenGLContext * | Context | ||
| ) |
Release an OpenGL context.
| void PlatformRenderingContextSetup | ( | FPlatformOpenGLDevice * | Device | ) |
Set up rendering OpenGL context on current thread. This is the only context that can be used for rendering, and not only loading resources and framebuffer blitting (due to limitations of Windows OpenGL).
| void PlatformResizeGLContext | ( | FPlatformOpenGLDevice * | Device, |
| FPlatformOpenGLContext * | Context, | ||
| uint32 | SizeX, | ||
| uint32 | SizeY, | ||
| bool | bFullscreen, | ||
| bool | bWasFullscreen, | ||
| GLenum | BackBufferTarget, | ||
| GLuint | BackBufferResource | ||
| ) |
Resize the GL context.
| void PlatformRestoreDesktopDisplayMode | ( | ) |
Restore the original display mode