OpenTTD Source 20250611-master-gf8776b0a6f
opengl.h File Reference

OpenGL video driver support. More...

Go to the source code of this file.

Data Structures

class  OpenGLBackend
 Platform-independent back-end class for OpenGL video drivers. More...
 
class  OpenGLSprite
 Class that encapsulates a RGBA texture together with a paletted remap texture. More...
 

Typedefs

typedef void(* OGLProc) ()
 
typedef OGLProc(* GetOGLProcAddressProc) (const char *proc)
 
using OpenGLSpriteLRUCache = LRUCache< SpriteID, std::unique_ptr< OpenGLSprite > >
 

Functions

bool IsOpenGLVersionAtLeast (uint8_t major, uint8_t minor)
 Check if the current OpenGL version is equal or higher than a given one.
 
bool HasStringInExtensionList (std::string_view string, std::string_view substring)
 Find a substring in a string made of space delimited elements.
 

Detailed Description

OpenGL video driver support.

Definition in file opengl.h.

Typedef Documentation

◆ GetOGLProcAddressProc

typedef OGLProc(* GetOGLProcAddressProc) (const char *proc)

Definition at line 19 of file opengl.h.

◆ OGLProc

typedef void(* OGLProc) ()

Definition at line 18 of file opengl.h.

◆ OpenGLSpriteLRUCache

using OpenGLSpriteLRUCache = LRUCache<SpriteID, std::unique_ptr<OpenGLSprite> >

Definition at line 26 of file opengl.h.

Function Documentation

◆ HasStringInExtensionList()

bool HasStringInExtensionList ( std::string_view  string,
std::string_view  substring 
)

Find a substring in a string made of space delimited elements.

The substring has to match the complete element, partial matches don't count.

Parameters
stringList of space delimited elements.
substringSubstring to find.
Returns
Whether the substring was found.

Definition at line 150 of file opengl.cpp.

References StringConsumer::SKIP_ALL_SEPARATORS.

◆ IsOpenGLVersionAtLeast()

bool IsOpenGLVersionAtLeast ( uint8_t  major,
uint8_t  minor 
)

Check if the current OpenGL version is equal or higher than a given one.

Parameters
majorMinimal major version.
minorMinimal minor version.
Precondition
OpenGL was initialized.
Returns
True if the OpenGL version is equal or higher than the requested one.

Definition at line 204 of file opengl.cpp.

Referenced by OpenGLBackend::Init(), and OpenGLBackend::InitShaders().