openMSX
Classes | Typedefs | Functions | Variables
gl Namespace Reference

Classes

class  BufferObject
 
class  ColorTexture
 
struct  Context
 
class  FragmentShader
 Wrapper around an OpenGL fragment shader: a program executed on the GPU that computes the colors of pixels. More...
 
class  FrameBufferObject
 
class  matMxN
 
class  matMxN< 4, 4, T >
 
struct  Null
 
class  PixelBuffer
 Wrapper around a pixel buffer. More...
 
struct  PixelBuffers
 
class  Shader
 Wrapper around an OpenGL shader: a program executed on the GPU. More...
 
class  ShaderProgram
 Wrapper around an OpenGL program: a collection of vertex and fragment shaders. More...
 
class  Texture
 Most basic/generic texture: only contains a texture ID. More...
 
class  vecN
 
class  VertexShader
 Wrapper around an OpenGL vertex shader: a program executed on the GPU that computes per-vertex stuff. More...
 

Typedefs

using mat2 = matMxN< 2, 2, float >
 
using mat3 = matMxN< 3, 3, float >
 
using mat4 = matMxN< 4, 4, float >
 
using vec2 = vecN< 2, float >
 
using vec3 = vecN< 3, float >
 
using vec4 = vecN< 4, float >
 
using ivec2 = vecN< 2, int >
 
using ivec3 = vecN< 3, int >
 
using ivec4 = vecN< 4, int >
 

Functions

template<int M, int N, typename T >
bool operator== (const matMxN< M, N, T > &A, const matMxN< M, N, T > &B)
 
template<int M, int N, typename T >
bool operator!= (const matMxN< M, N, T > &A, const matMxN< M, N, T > &B)
 
template<int M, int N, typename T >
matMxN< M, N, T > operator+ (const matMxN< M, N, T > &A, const matMxN< M, N, T > &B)
 
template<int M, int N, typename T >
matMxN< M, N, T > operator- (const matMxN< M, N, T > &A, const matMxN< M, N, T > &B)
 
template<int M, int N, typename T >
matMxN< M, N, T > operator- (const matMxN< M, N, T > &A)
 
template<int M, int N, typename T >
matMxN< M, N, T > operator* (T x, const matMxN< M, N, T > &A)
 
template<int M, int N, typename T >
matMxN< M, N, T > operator* (const matMxN< M, N, T > &A, T x)
 
template<int M, int N, typename T >
vecN< M, T > operator* (const matMxN< M, N, T > &A, const vecN< N, T > &x)
 
template<typename T >
vecN< 4, T > operator* (const matMxN< 4, 4, T > &A, vecN< 4, T > x)
 
template<int M, int N, int O, typename T >
matMxN< M, O, T > operator* (const matMxN< M, N, T > &A, const matMxN< N, O, T > &B)
 
template<int M, int N, typename T >
matMxN< N, M, T > transpose (const matMxN< M, N, T > &A)
 
template<typename T >
determinant (const matMxN< 2, 2, T > &A)
 
template<typename T >
determinant (const matMxN< 3, 3, T > &A)
 
template<typename T >
determinant (const matMxN< 4, 4, T > &A)
 
template<typename T >
matMxN< 2, 2, T > inverse (const matMxN< 2, 2, T > &A)
 
template<typename T >
matMxN< 3, 3, T > inverse (const matMxN< 3, 3, T > &A)
 
template<typename T >
matMxN< 4, 4, T > inverse (const matMxN< 4, 4, T > &A)
 
template<int M, int N, typename T >
norm2_2 (const matMxN< M, N, T > &A)
 
mat4 scale (const vec3 &xyz)
 
mat4 scale (const mat4 &A, const vec3 &xyz)
 
mat4 translate (const vec3 &xyz)
 
mat4 translate (mat4 &A, const vec3 &xyz)
 
mat4 rotate (float angle, const vec3 &axis)
 
mat4 rotate (const mat4 &A, float angle, const vec3 &axis)
 
mat4 rotateX (float angle)
 
mat4 rotateX (const mat4 &A, float angle)
 
mat4 rotateY (float angle)
 
mat4 rotateY (const mat4 &A, float angle)
 
mat4 rotateZ (float angle)
 
mat4 rotateZ (const mat4 &A, float angle)
 
mat4 ortho (float left, float right, float bottom, float top, float nearVal, float farVal)
 
mat4 frustum (float left, float right, float bottom, float top, float nearVal, float farVal)
 
float rsqrt (float x)
 
double rsqrt (double x)
 
template<typename T >
radians (T d)
 
template<typename T >
degrees (T r)
 
template<int N, typename T >
bool operator== (const vecN< N, T > &x, const vecN< N, T > &y)
 
template<int N, typename T >
bool operator!= (const vecN< N, T > &x, const vecN< N, T > &y)
 
template<int N, typename T >
vecN< N, T > operator- (const vecN< N, T > &x)
 
template<int N, typename T >
vecN< N, T > operator+ (const vecN< N, T > &x, const vecN< N, T > &y)
 
template<int N, typename T >
vecN< N, T > operator- (const vecN< N, T > &x, const vecN< N, T > &y)
 
template<int N, typename T >
vecN< N, T > operator* (T x, const vecN< N, T > &y)
 
template<int N, typename T >
vecN< N, T > operator* (const vecN< N, T > &x, T y)
 
template<int N, typename T >
vecN< N, T > operator* (const vecN< N, T > &x, const vecN< N, T > &y)
 
template<int N, typename T >
vecN< N, T > recip (const vecN< N, T > &x)
 
template<int N, typename T >
vecN< N, T > operator/ (T x, const vecN< N, T > &y)
 
template<int N, typename T >
vecN< N, T > operator/ (const vecN< N, T > &x, T y)
 
template<int N, typename T >
vecN< N, T > operator/ (const vecN< N, T > &x, const vecN< N, T > &y)
 
template<int N, typename T >
vecN< N, T > min (const vecN< N, T > &x, const vecN< N, T > &y)
 
template<int N, typename T >
vecN< N, T > max (const vecN< N, T > &x, const vecN< N, T > &y)
 
template<int N, typename T >
vecN< N, T > clamp (const vecN< N, T > &x, const vecN< N, T > &minVal, const vecN< N, T > &maxVal)
 
template<int N, typename T >
vecN< N, T > clamp (const vecN< N, T > &x, T minVal, T maxVal)
 
template<int N, typename T >
sum (const vecN< N, T > &x)
 
template<int N, typename T >
vecN< N, T > sum_broadcast (const vecN< N, T > &x)
 
template<int N, typename T >
dot (const vecN< N, T > &x, const vecN< N, T > &y)
 
template<int N, typename T >
vecN< N, T > dot_broadcast (const vecN< N, T > &x, const vecN< N, T > &y)
 
template<int N, typename T >
length2 (const vecN< N, T > &x)
 
template<int N, typename T >
length (const vecN< N, T > &x)
 
template<int N, typename T >
vecN< N, T > normalize (const vecN< N, T > &x)
 
template<typename T >
vecN< 3, T > cross (const vecN< 3, T > &x, const vecN< 3, T > &y)
 
template<int N, typename T >
vecN< N, int > round (const vecN< N, T > &x)
 
template<int N, typename T >
vecN< N, int > trunc (const vecN< N, T > &x)
 

Variables

std::unique_ptr< Contextcontext
 

Typedef Documentation

◆ ivec2

using gl::ivec2 = typedef vecN<2, int>

Definition at line 141 of file gl_vec.hh.

◆ ivec3

using gl::ivec3 = typedef vecN<3, int>

Definition at line 142 of file gl_vec.hh.

◆ ivec4

using gl::ivec4 = typedef vecN<4, int>

Definition at line 143 of file gl_vec.hh.

◆ mat2

using gl::mat2 = typedef matMxN<2, 2, float>

Definition at line 157 of file gl_mat.hh.

◆ mat3

using gl::mat3 = typedef matMxN<3, 3, float>

Definition at line 158 of file gl_mat.hh.

◆ mat4

using gl::mat4 = typedef matMxN<4, 4, float>

Definition at line 159 of file gl_mat.hh.

◆ vec2

using gl::vec2 = typedef vecN<2, float>

Definition at line 138 of file gl_vec.hh.

◆ vec3

using gl::vec3 = typedef vecN<3, float>

Definition at line 139 of file gl_vec.hh.

◆ vec4

using gl::vec4 = typedef vecN<4, float>

Definition at line 140 of file gl_vec.hh.

Function Documentation

◆ clamp() [1/2]

template<int N, typename T >
vecN<N, T> gl::clamp ( const vecN< N, T > &  x,
const vecN< N, T > &  minVal,
const vecN< N, T > &  maxVal 
)
inline

Definition at line 286 of file gl_vec.hh.

Referenced by main(), and openmsx::Touchpad::~Touchpad().

◆ clamp() [2/2]

template<int N, typename T >
vecN<N, T> gl::clamp ( const vecN< N, T > &  x,
minVal,
maxVal 
)
inline

Definition at line 293 of file gl_vec.hh.

◆ cross()

template<typename T >
vecN<3, T> gl::cross ( const vecN< 3, T > &  x,
const vecN< 3, T > &  y 
)
inline

Definition at line 347 of file gl_vec.hh.

Referenced by main().

◆ degrees()

template<typename T >
T gl::degrees ( r)
inline

Definition at line 163 of file gl_vec.hh.

References M_PI.

Referenced by main().

◆ determinant() [1/3]

template<typename T >
T gl::determinant ( const matMxN< 2, 2, T > &  A)
inline

Definition at line 259 of file gl_mat.hh.

Referenced by inverse(), and main().

◆ determinant() [2/3]

template<typename T >
T gl::determinant ( const matMxN< 3, 3, T > &  A)
inline

Definition at line 266 of file gl_mat.hh.

◆ determinant() [3/3]

template<typename T >
T gl::determinant ( const matMxN< 4, 4, T > &  A)
inline

Definition at line 275 of file gl_mat.hh.

References dot().

◆ dot()

template<int N, typename T >
T gl::dot ( const vecN< N, T > &  x,
const vecN< N, T > &  y 
)
inline

Definition at line 314 of file gl_vec.hh.

Referenced by determinant(), inverse(), and main().

◆ dot_broadcast()

template<int N, typename T >
vecN<N, T> gl::dot_broadcast ( const vecN< N, T > &  x,
const vecN< N, T > &  y 
)
inline

Definition at line 319 of file gl_vec.hh.

Referenced by main().

◆ frustum()

mat4 gl::frustum ( float  left,
float  right,
float  bottom,
float  top,
float  nearVal,
float  farVal 
)
inline

Definition at line 182 of file gl_transform.hh.

Referenced by test_frustum().

◆ inverse() [1/3]

template<typename T >
matMxN<2, 2, T> gl::inverse ( const matMxN< 2, 2, T > &  A)
inline

Definition at line 293 of file gl_mat.hh.

References determinant().

Referenced by inverse(), main(), and test_inverse().

◆ inverse() [2/3]

template<typename T >
matMxN<3, 3, T> gl::inverse ( const matMxN< 3, 3, T > &  A)
inline

Definition at line 302 of file gl_mat.hh.

References determinant().

◆ inverse() [3/3]

template<typename T >
matMxN<4, 4, T> gl::inverse ( const matMxN< 4, 4, T > &  A)
inline

Definition at line 319 of file gl_mat.hh.

References dot(), and inverse().

◆ length()

template<int N, typename T >
T gl::length ( const vecN< N, T > &  x)
inline

◆ length2()

template<int N, typename T >
T gl::length2 ( const vecN< N, T > &  x)
inline

Definition at line 326 of file gl_vec.hh.

Referenced by openmsx::IPSPatch::IPSPatch(), and main().

◆ max()

template<int N, typename T >
vecN<N, T> gl::max ( const vecN< N, T > &  x,
const vecN< N, T > &  y 
)
inline

◆ min()

template<int N, typename T >
vecN<N, T> gl::min ( const vecN< N, T > &  x,
const vecN< N, T > &  y 
)
inline

Definition at line 268 of file gl_vec.hh.

Referenced by openmsx::ADVram::ADVram(), hash_set< openmsx::ProbeBase *, NameFromProbe, XXHasher >::capacity(), string_view::compare(), snappy::compress(), openmsx::V9990SDLRasterizer< Pixel >::drawBorder(), openmsx::SDLRasterizer< Pixel >::drawBorder(), openmsx::SDLRasterizer< Pixel >::drawDisplay(), openmsx::SDLRasterizer< Pixel >::drawSprites(), openmsx::IDECDROM::executeCommand(), openmsx::FloatSetting::FloatSetting(), openmsx::OggReader::getAudio(), openmsx::SDLSoundDriver::getSamples(), openmsx::OSDText::getType(), openmsx::MSXDevice::getVisibleMemRegion(), openmsx::IntegerSetting::IntegerSetting(), openmsx::IPSPatch::IPSPatch(), TclParser::isProc(), main(), StringOp::caseless::operator()(), openmsx::Paper::plot(), openmsx::ImagePrinter::printGraphicByte(), openmsx::ImagePrinter::printVisibleCharacter(), openmsx::PasswordCart::readIO(), openmsx::BlipBuffer::readSamples(), openmsx::MSXCPUInterface::registerMemDevice(), openmsx::RenderSettings::RenderSettings(), openmsx::SpriteChecker::reset(), openmsx::SaI2xScaler< Pixel >::scaleBlank1to2(), openmsx::LineRepeater< i >::scaleFixedLine(), openmsx::LineRepeater< 0 >::scaleFixedLine(), openmsx::MLAAScaler< Pixel >::scaleImage(), openmsx::SCSIHD::SCSIHD(), circular_buffer< std::unique_ptr< openmsx::Frame > >::set_capacity(), openmsx::OSDImageBasedWidget::setProperty(), openmsx::CassettePlayer::setSignal(), string_view::substr(), array_ref< T >::substr(), openmsx::SuperImposedFrameImpl< Pixel >::SuperImposedFrameImpl(), openmsx::FileBase::truncate(), openmsx::MSXCPUInterface::unregisterMemDevice(), openmsx::VDPVRAM::updateSpritesEnabled(), openmsx::SN76489::write(), openmsx::NowindHost::write(), openmsx::AmdFlash::write(), openmsx::AY8910::writeRegister(), openmsx::DMKDiskImage::writeTrackImpl(), openmsx::RenderSettings::~RenderSettings(), and openmsx::SCSILS120::~SCSILS120().

◆ norm2_2()

template<int M, int N, typename T >
T gl::norm2_2 ( const matMxN< M, N, T > &  A)
inline

Definition at line 376 of file gl_mat.hh.

Referenced by main().

◆ normalize()

template<int N, typename T >
vecN<N, T> gl::normalize ( const vecN< N, T > &  x)
inline

Definition at line 340 of file gl_vec.hh.

Referenced by main().

◆ operator!=() [1/2]

template<int M, int N, typename T >
bool gl::operator!= ( const matMxN< M, N, T > &  A,
const matMxN< M, N, T > &  B 
)
inline

Definition at line 172 of file gl_mat.hh.

References openmsx::B.

◆ operator!=() [2/2]

template<int N, typename T >
bool gl::operator!= ( const vecN< N, T > &  x,
const vecN< N, T > &  y 
)
inline

Definition at line 179 of file gl_vec.hh.

◆ operator*() [1/8]

template<int M, int N, typename T >
matMxN<M, N, T> gl::operator* ( x,
const matMxN< M, N, T > &  A 
)
inline

Definition at line 204 of file gl_mat.hh.

◆ operator*() [2/8]

template<int N, typename T >
vecN<N, T> gl::operator* ( x,
const vecN< N, T > &  y 
)
inline

Definition at line 211 of file gl_vec.hh.

◆ operator*() [3/8]

template<int M, int N, typename T >
matMxN<M, N, T> gl::operator* ( const matMxN< M, N, T > &  A,
x 
)
inline

Definition at line 213 of file gl_mat.hh.

◆ operator*() [4/8]

template<int N, typename T >
vecN<N, T> gl::operator* ( const vecN< N, T > &  x,
y 
)
inline

Definition at line 220 of file gl_vec.hh.

◆ operator*() [5/8]

template<int M, int N, typename T >
vecN<M, T> gl::operator* ( const matMxN< M, N, T > &  A,
const vecN< N, T > &  x 
)
inline

Definition at line 222 of file gl_mat.hh.

◆ operator*() [6/8]

template<typename T >
vecN<4, T> gl::operator* ( const matMxN< 4, 4, T > &  A,
vecN< 4, T >  x 
)
inline

Definition at line 229 of file gl_mat.hh.

◆ operator*() [7/8]

template<int N, typename T >
vecN<N, T> gl::operator* ( const vecN< N, T > &  x,
const vecN< N, T > &  y 
)
inline

Definition at line 229 of file gl_vec.hh.

◆ operator*() [8/8]

template<int M, int N, int O, typename T >
matMxN<M, O, T> gl::operator* ( const matMxN< M, N, T > &  A,
const matMxN< N, O, T > &  B 
)
inline

Definition at line 237 of file gl_mat.hh.

References O.

◆ operator+() [1/2]

template<int M, int N, typename T >
matMxN<M, N, T> gl::operator+ ( const matMxN< M, N, T > &  A,
const matMxN< M, N, T > &  B 
)
inline

Definition at line 179 of file gl_mat.hh.

◆ operator+() [2/2]

template<int N, typename T >
vecN<N, T> gl::operator+ ( const vecN< N, T > &  x,
const vecN< N, T > &  y 
)
inline

Definition at line 193 of file gl_vec.hh.

◆ operator-() [1/4]

template<int N, typename T >
vecN<N, T> gl::operator- ( const vecN< N, T > &  x)
inline

Definition at line 186 of file gl_vec.hh.

◆ operator-() [2/4]

template<int M, int N, typename T >
matMxN<M, N, T> gl::operator- ( const matMxN< M, N, T > &  A,
const matMxN< M, N, T > &  B 
)
inline

Definition at line 188 of file gl_mat.hh.

◆ operator-() [3/4]

template<int M, int N, typename T >
matMxN<M, N, T> gl::operator- ( const matMxN< M, N, T > &  A)
inline

Definition at line 197 of file gl_mat.hh.

References openmsx::A.

◆ operator-() [4/4]

template<int N, typename T >
vecN<N, T> gl::operator- ( const vecN< N, T > &  x,
const vecN< N, T > &  y 
)
inline

Definition at line 202 of file gl_vec.hh.

◆ operator/() [1/3]

template<int N, typename T >
vecN<N, T> gl::operator/ ( x,
const vecN< N, T > &  y 
)
inline

Definition at line 247 of file gl_vec.hh.

◆ operator/() [2/3]

template<int N, typename T >
vecN<N, T> gl::operator/ ( const vecN< N, T > &  x,
y 
)
inline

Definition at line 254 of file gl_vec.hh.

◆ operator/() [3/3]

template<int N, typename T >
vecN<N, T> gl::operator/ ( const vecN< N, T > &  x,
const vecN< N, T > &  y 
)
inline

Definition at line 261 of file gl_vec.hh.

◆ operator==() [1/2]

template<int M, int N, typename T >
bool gl::operator== ( const matMxN< M, N, T > &  A,
const matMxN< M, N, T > &  B 
)
inline

Definition at line 166 of file gl_mat.hh.

◆ operator==() [2/2]

template<int N, typename T >
bool gl::operator== ( const vecN< N, T > &  x,
const vecN< N, T > &  y 
)
inline

Definition at line 173 of file gl_vec.hh.

◆ ortho()

mat4 gl::ortho ( float  left,
float  right,
float  bottom,
float  top,
float  nearVal,
float  farVal 
)
inline

Definition at line 167 of file gl_transform.hh.

Referenced by gl::Context::Context(), and test_ortho().

◆ radians()

template<typename T >
T gl::radians ( d)
inline

Definition at line 159 of file gl_vec.hh.

References M_PI.

Referenced by main().

◆ recip()

template<int N, typename T >
vecN<N, T> gl::recip ( const vecN< N, T > &  x)
inline

Definition at line 238 of file gl_vec.hh.

Referenced by main().

◆ rotate() [1/2]

mat4 gl::rotate ( float  angle,
const vec3 axis 
)
inline

◆ rotate() [2/2]

mat4 gl::rotate ( const mat4 A,
float  angle,
const vec3 axis 
)
inline

Definition at line 82 of file gl_transform.hh.

References rotate().

◆ rotateX() [1/2]

mat4 gl::rotateX ( float  angle)
inline

Definition at line 91 of file gl_transform.hh.

◆ rotateX() [2/2]

mat4 gl::rotateX ( const mat4 A,
float  angle 
)
inline

Definition at line 103 of file gl_transform.hh.

◆ rotateY() [1/2]

mat4 gl::rotateY ( float  angle)
inline

Definition at line 116 of file gl_transform.hh.

◆ rotateY() [2/2]

mat4 gl::rotateY ( const mat4 A,
float  angle 
)
inline

Definition at line 128 of file gl_transform.hh.

◆ rotateZ() [1/2]

mat4 gl::rotateZ ( float  angle)
inline

Definition at line 141 of file gl_transform.hh.

◆ rotateZ() [2/2]

mat4 gl::rotateZ ( const mat4 A,
float  angle 
)
inline

Definition at line 153 of file gl_transform.hh.

◆ round()

template<int N, typename T >
vecN<N, int> gl::round ( const vecN< N, T > &  x)
inline

Definition at line 356 of file gl_vec.hh.

Referenced by main().

◆ rsqrt() [1/2]

float gl::rsqrt ( float  x)
inline

Definition at line 149 of file gl_vec.hh.

Referenced by main().

◆ rsqrt() [2/2]

double gl::rsqrt ( double  x)
inline

Definition at line 153 of file gl_vec.hh.

◆ scale() [1/2]

mat4 gl::scale ( const vec3 xyz)
inline

◆ scale() [2/2]

mat4 gl::scale ( const mat4 A,
const vec3 xyz 
)
inline

Definition at line 26 of file gl_transform.hh.

◆ sum()

template<int N, typename T >
T gl::sum ( const vecN< N, T > &  x)
inline

◆ sum_broadcast()

template<int N, typename T >
vecN<N, T> gl::sum_broadcast ( const vecN< N, T > &  x)
inline

Definition at line 307 of file gl_vec.hh.

Referenced by main().

◆ translate() [1/2]

mat4 gl::translate ( const vec3 xyz)
inline

Definition at line 36 of file gl_transform.hh.

◆ translate() [2/2]

mat4 gl::translate ( mat4 A,
const vec3 xyz 
)
inline

Definition at line 45 of file gl_transform.hh.

◆ transpose()

template<int M, int N, typename T >
matMxN<N, M, T> gl::transpose ( const matMxN< M, N, T > &  A)
inline

Definition at line 246 of file gl_mat.hh.

Referenced by main(), and test_transpose().

◆ trunc()

template<int N, typename T >
vecN<N, int> gl::trunc ( const vecN< N, T > &  x)
inline

Definition at line 368 of file gl_vec.hh.

Referenced by openmsx::GLImage::GLImage(), and main().

Variable Documentation

◆ context

std::unique_ptr< Context > gl::context