OpenTTD Source: src/video/opengl.h File Reference

OpenTTD Source 15.0-beta1

Data Structures | Typedefs | Functions
opengl.h File Reference

OpenGL video driver support. More...

`#include "../core/alloc_type.hpp"`
`#include "../core/geometry_type.hpp"`
`#include "../gfx_type.h"`
`#include "../spriteloader/spriteloader.hpp"`
`#include "../misc/lrucache.hpp"`

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)

## Functions
bool | IsOpenGLVersionAtLeast (uint8_t major, uint8_t minor)
| Check if the current OpenGL version is equal or higher than a given one.
const char * | FindStringInExtensionList (const char *string, const char *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 20 of file opengl.h.

## ◆ OGLProc

typedef void(* OGLProc) ()

Definition at line 19 of file opengl.h.

## Function Documentation

## ◆ FindStringInExtensionList()

const char * FindStringInExtensionList | ( | const char * | string,
|  | const char * | 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

  string | List of space delimited elements.
  substring | Substring to find.

Returns
  Pointer to the start of the match or nullptr if the substring is not present.

Definition at line 144 of file opengl.cpp.

## ◆ IsOpenGLVersionAtLeast()

bool IsOpenGLVersionAtLeast | ( | uint8_t | major,
|  | uint8_t | minor
| ) |  |

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

Parameters

  major | Minimal major version.
  minor | Minimal minor version.

Precondition
  OpenGL was initialized.

Returns
  True if the OpenGL version is equal or higher than the requested one.

Definition at line 207 of file opengl.cpp.

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