YourGameLib
Loading...
Searching...
No Matches
Classes | Functions | Variables
yourgame::gl Namespace Reference

gl classes and functions More...

Classes

class  Buffer
 
struct  DrawConfig
 
class  Framebuffer
 
class  Geometry
 
class  Lightsource
 
class  Particles
 
class  Shader
 
class  Shape
 
class  SpriteGrid
 
class  Texture
 
struct  TextureConfig
 
struct  TextureCoords
 

Functions

void drawGeo (const yourgame::gl::Geometry *geo, const yourgame::gl::DrawConfig &cfg)
 
std::array< float, 4 > drawSprite (yourgame::gl::Texture *texture, const yourgame::gl::TextureCoords &coords, float x, float y, float width, float height, float angle)
 
void drawSky (yourgame::gl::Texture *texture, yourgame::math::Camera *camera, std::array< float, 3 > tint, yourgame::math::Trafo *trafo)
 
TextureloadTexture (const std::string &imgFilename, const std::string &atlasFilename, const yourgame::gl::TextureConfig &cfg)
 
TextureloadCubemap (const std::vector< std::string > &filenames, const yourgame::gl::TextureConfig &cfg)
 loads images and generates cubemap texture
 
ShaderloadShader (const std::vector< std::pair< GLenum, std::string > > &shaderFilenames, const std::vector< std::pair< GLuint, std::string > > &attrLocs={}, const std::vector< std::pair< GLuint, std::string > > &fragDataLocs={})
 
ShaderloadShaderFromStrings (const std::vector< std::pair< GLenum, std::string > > &shaderCodes, const std::vector< std::pair< GLuint, std::string > > &attrLocs={}, const std::vector< std::pair< GLuint, std::string > > &fragDataLocs={})
 
GeometryloadGeometry (const std::string &objFilename, const std::string &mtlFilename="")
 
GeometryloadGeometryFromStrings (const std::string &objCode, const std::string &mtlCode="")
 

Variables

const GLuint attrLocPosition = 0
 
const GLuint attrLocNormal = 1
 
const GLuint attrLocTexcoords = 2
 
const GLuint attrLocColor = 3
 
const GLuint attrLocInstModelMatCol0 = 4
 
const GLuint attrLocInstModelMatCol1 = 5
 
const GLuint attrLocInstModelMatCol2 = 6
 
const GLuint attrLocInstModelMatCol3 = 7
 
const GLuint attrLocInstProgress = 8
 
const GLchar * unifNameMvpMatrix = "mvpMat"
 
const GLchar * unifNameVpMatrix = "vpMat"
 
const GLchar * unifNameModelMatrix = "modelMat"
 
const GLchar * unifNameNormalMatrix = "normalMat"
 
const GLchar * unifNameCameraPosition = "camPos"
 
const GLchar * unifNameCameraTrafo = "camTrafo"
 
const GLchar * unifNameSkyRotationInv = "skyRotInv"
 
const GLchar * unifNameTextureDiffuse = "textureDiffuse"
 
const GLchar * unifNameTextureSkyCube = "textureSkyCube"
 
const GLchar * unifNameTextureSky = "textureSky"
 
const GLchar * unifNameTextureBufferDepth = "textureBufferDepth"
 
const GLchar * unifNameTextureBufferColor0 = "textureBufferColor0"
 
const GLchar * unifNameLightAmbient = "lightAmbient"
 
const GLchar * unifNameLightDiffuse = "lightDiffuse"
 
const GLchar * unifNameLightSpecular = "lightSpecular"
 
const GLchar * unifNameLightPosition = "lightPosition"
 
const GLchar * unifNameSubtexture = "subtex"
 
const GLint unifValueTextureDiffuse = 0
 
const GLint unifValueTextureSkyCube = 4
 
const GLint unifValueTextureSky = 5
 
const GLint unifValueTextureBufferDepth = 6
 
const GLint unifValueTextureBufferColor0 = 7
 
const GLenum textureUnitDiffuse = GL_TEXTURE0
 
const GLenum textureUnitSkyCube = GL_TEXTURE4
 
const GLenum textureUnitSky = GL_TEXTURE5
 
const GLenum textureUnitBufferDepth = GL_TEXTURE6
 
const GLenum textureUnitBufferColor0 = GL_TEXTURE7
 

Detailed Description

gl classes and functions

Function Documentation

◆ drawGeo()

void yourgame::gl::drawGeo ( const yourgame::gl::Geometry geo,
const yourgame::gl::DrawConfig cfg 
)

◆ drawSky()

void yourgame::gl::drawSky ( yourgame::gl::Texture texture,
yourgame::math::Camera camera,
std::array< float, 3 >  tint,
yourgame::math::Trafo trafo 
)

◆ drawSprite()

std::array< float, 4 > yourgame::gl::drawSprite ( yourgame::gl::Texture texture,
const yourgame::gl::TextureCoords coords,
float  x,
float  y,
float  width,
float  height,
float  angle 
)

◆ loadCubemap()

Texture * yourgame::gl::loadCubemap ( const std::vector< std::string > &  filenames,
const yourgame::gl::TextureConfig cfg 
)

loads images and generates cubemap texture

Parameters
filenamesthis order: POSITIVE_X, NEGATIVE_X, POSITIVE_Y, NEGATIVE_Y, POSITIVE_Z, NEGATIVE_Z

◆ loadGeometry()

Geometry * yourgame::gl::loadGeometry ( const std::string &  objFilename,
const std::string &  mtlFilename = "" 
)

◆ loadGeometryFromStrings()

Geometry * yourgame::gl::loadGeometryFromStrings ( const std::string &  objCode,
const std::string &  mtlCode = "" 
)

◆ loadShader()

Shader * yourgame::gl::loadShader ( const std::vector< std::pair< GLenum, std::string > > &  shaderFilenames,
const std::vector< std::pair< GLuint, std::string > > &  attrLocs = {},
const std::vector< std::pair< GLuint, std::string > > &  fragDataLocs = {} 
)

◆ loadShaderFromStrings()

Shader * yourgame::gl::loadShaderFromStrings ( const std::vector< std::pair< GLenum, std::string > > &  shaderCodes,
const std::vector< std::pair< GLuint, std::string > > &  attrLocs = {},
const std::vector< std::pair< GLuint, std::string > > &  fragDataLocs = {} 
)

◆ loadTexture()

Texture * yourgame::gl::loadTexture ( const std::string &  imgFilename,
const std::string &  atlasFilename,
const yourgame::gl::TextureConfig cfg 
)

Variable Documentation

◆ attrLocColor

const GLuint yourgame::gl::attrLocColor = 3

◆ attrLocInstModelMatCol0

const GLuint yourgame::gl::attrLocInstModelMatCol0 = 4

◆ attrLocInstModelMatCol1

const GLuint yourgame::gl::attrLocInstModelMatCol1 = 5

◆ attrLocInstModelMatCol2

const GLuint yourgame::gl::attrLocInstModelMatCol2 = 6

◆ attrLocInstModelMatCol3

const GLuint yourgame::gl::attrLocInstModelMatCol3 = 7

◆ attrLocInstProgress

const GLuint yourgame::gl::attrLocInstProgress = 8

◆ attrLocNormal

const GLuint yourgame::gl::attrLocNormal = 1

◆ attrLocPosition

const GLuint yourgame::gl::attrLocPosition = 0

◆ attrLocTexcoords

const GLuint yourgame::gl::attrLocTexcoords = 2

◆ textureUnitBufferColor0

const GLenum yourgame::gl::textureUnitBufferColor0 = GL_TEXTURE7

◆ textureUnitBufferDepth

const GLenum yourgame::gl::textureUnitBufferDepth = GL_TEXTURE6

◆ textureUnitDiffuse

const GLenum yourgame::gl::textureUnitDiffuse = GL_TEXTURE0

◆ textureUnitSky

const GLenum yourgame::gl::textureUnitSky = GL_TEXTURE5

◆ textureUnitSkyCube

const GLenum yourgame::gl::textureUnitSkyCube = GL_TEXTURE4

◆ unifNameCameraPosition

const GLchar * yourgame::gl::unifNameCameraPosition = "camPos"

◆ unifNameCameraTrafo

const GLchar * yourgame::gl::unifNameCameraTrafo = "camTrafo"

◆ unifNameLightAmbient

const GLchar * yourgame::gl::unifNameLightAmbient = "lightAmbient"

◆ unifNameLightDiffuse

const GLchar * yourgame::gl::unifNameLightDiffuse = "lightDiffuse"

◆ unifNameLightPosition

const GLchar * yourgame::gl::unifNameLightPosition = "lightPosition"

◆ unifNameLightSpecular

const GLchar * yourgame::gl::unifNameLightSpecular = "lightSpecular"

◆ unifNameModelMatrix

const GLchar * yourgame::gl::unifNameModelMatrix = "modelMat"

◆ unifNameMvpMatrix

const GLchar * yourgame::gl::unifNameMvpMatrix = "mvpMat"

◆ unifNameNormalMatrix

const GLchar * yourgame::gl::unifNameNormalMatrix = "normalMat"

◆ unifNameSkyRotationInv

const GLchar * yourgame::gl::unifNameSkyRotationInv = "skyRotInv"

◆ unifNameSubtexture

const GLchar * yourgame::gl::unifNameSubtexture = "subtex"

◆ unifNameTextureBufferColor0

const GLchar * yourgame::gl::unifNameTextureBufferColor0 = "textureBufferColor0"

◆ unifNameTextureBufferDepth

const GLchar * yourgame::gl::unifNameTextureBufferDepth = "textureBufferDepth"

◆ unifNameTextureDiffuse

const GLchar * yourgame::gl::unifNameTextureDiffuse = "textureDiffuse"

◆ unifNameTextureSky

const GLchar * yourgame::gl::unifNameTextureSky = "textureSky"

◆ unifNameTextureSkyCube

const GLchar * yourgame::gl::unifNameTextureSkyCube = "textureSkyCube"

◆ unifNameVpMatrix

const GLchar * yourgame::gl::unifNameVpMatrix = "vpMat"

◆ unifValueTextureBufferColor0

const GLint yourgame::gl::unifValueTextureBufferColor0 = 7

◆ unifValueTextureBufferDepth

const GLint yourgame::gl::unifValueTextureBufferDepth = 6

◆ unifValueTextureDiffuse

const GLint yourgame::gl::unifValueTextureDiffuse = 0

◆ unifValueTextureSky

const GLint yourgame::gl::unifValueTextureSky = 5

◆ unifValueTextureSkyCube

const GLint yourgame::gl::unifValueTextureSkyCube = 4