SuperTuxKart
Loading...
Searching...
No Matches
Public Member Functions | Public Attributes | Private Member Functions | List of all members
GraphicsRestrictions::Version Class Reference

A small utility class to manage and compare version tuples. More...

Public Member Functions

 Version ()
 Dummy default constructor.
 
 Version (const std::string &version)
 Simple constructor which takes a string with "." separated numbers.
 
 Version (const std::string &driver_version, const std::string &card_name)
 Create a version instance from the driver and car name.
 
bool operator== (const Version &other) const
 Compares two version numbers.
 
bool operator!= (const Version &other) const
 Compares two version numbers.
 

Public Attributes

std::vector< uint32_t > m_version
 The array containing the version number.
 

Private Member Functions

void convertVersionString (const std::string &version)
 Searches for the first number in the string, then converts the rest of the string into a tuple.
 

Detailed Description

A small utility class to manage and compare version tuples.

Constructor & Destructor Documentation

◆ Version()

GraphicsRestrictions::Version::Version ( const std::string &  driver_version,
const std::string &  card_name 
)
inline

Create a version instance from the driver and car name.

For example for an Intel HD3000 card the string is "3.1.0 - Build 9.17.10.3517" it would create [9,17,10,3517] - i.e. it takes the vendor info into account.

Parameters
driver_versionThe GL_VERSION string (i.e. opengl and version number).
card_nameThe GL_RENDERER string (i.e. graphics card).

Member Function Documentation

◆ convertVersionString()

void GraphicsRestrictions::Version::convertVersionString ( const std::string &  version)
inlineprivate

Searches for the first number in the string, then converts the rest of the string into a tuple.

E.g. "Build 12.34.56" --> [12,34,56].

◆ operator!=()

bool GraphicsRestrictions::Version::operator!= ( const Version other) const
inline

Compares two version numbers.

Equal returns true if the elements are identical.

◆ operator==()

bool GraphicsRestrictions::Version::operator== ( const Version other) const
inline

Compares two version numbers.

Equal returns true if the elements are identical.


The documentation for this class was generated from the following file: