|
libmx2 2.2.1
C++20 multimedia and game-engine library (SDL2 / OpenGL / Vulkan)
|
Classes | |
| class | ShaderProgram |
| GLSL shader program wrapper (shared-ownership). More... | |
| class | GLText |
| Render SDL_ttf text into an OpenGL texture and display it on screen. More... | |
| class | GLSprite |
| A textured screen-space quad drawn with an OpenGL shader. More... | |
| class | GLWindow |
| SDL2 + OpenGL/ES window with event loop and console support. More... | |
| class | GLObject |
| Abstract interface for scene objects managed by a GLWindow. More... | |
Enumerations | |
| enum class | GLMode { DESKTOP , ES } |
| OpenGL mode: desktop GL or OpenGL ES. More... | |
Functions | |
| GLuint | loadTexture (const std::string &filename) |
| Load a GL texture from a file. | |
| GLuint | loadTexture (const std::string &filename, int &w, int &h) |
| Load a GL texture from a file and retrieve its dimensions. | |
| GLuint | createTexture (SDL_Surface *surface, bool flip) |
| Create a new GL texture from an SDL_Surface. | |
| GLuint | createTexture (void *buffer, int width, int height) |
| Create a new GL texture from a raw pixel buffer. | |
| void | updateTexture (GLuint texture, SDL_Surface *surface, bool flip) |
| Replace a GL texture's contents from an SDL_Surface. | |
| SDL_Surface * | createSurface (int w, int h) |
| Allocate a blank RGBA SDL_Surface. | |
Variables | |
| const char * | vSource |
| Default vertex shader source. | |
| const char * | fSource |
| Default fragment shader source. | |
| const char * | ftSource |
|
strong |
| SDL_Surface * gl::createSurface | ( | int | w, |
| int | h ) |
| GLuint gl::createTexture | ( | SDL_Surface * | surface, |
| bool | flip ) |
Create a new GL texture from an SDL_Surface.
| surface | Source surface. |
| flip | If true, flip vertically. |
Definition at line 743 of file gl.cpp.
References mx::Texture::flipSurface().
Referenced by mx::MXCapture::createImage().
| GLuint gl::createTexture | ( | void * | buffer, |
| int | width, | ||
| int | height ) |
| GLuint gl::loadTexture | ( | const std::string & | filename | ) |
Load a GL texture from a file.
| filename | Image file path. |
Definition at line 689 of file gl.cpp.
References mx::Texture::flipSurface(), and png::LoadPNG().
Referenced by gl::GLSprite::loadTextureImpl(), gl::GLSprite::loadTextureImpl(), mx::Model::setTextures(), and mx::Model::setTexturesFromMTL().
| GLuint gl::loadTexture | ( | const std::string & | filename, |
| int & | w, | ||
| int & | h ) |
Load a GL texture from a file and retrieve its dimensions.
| filename | Image file path. |
| w | Output: width. |
| h | Output: height. |
Definition at line 717 of file gl.cpp.
References mx::Texture::flipSurface(), and png::LoadPNG().
| void gl::updateTexture | ( | GLuint | texture, |
| SDL_Surface * | surface, | ||
| bool | flip ) |
Replace a GL texture's contents from an SDL_Surface.
| texture | Target GL texture ID. |
| surface | Source surface. |
| flip | If true, flip vertically before uploading. |
Definition at line 795 of file gl.cpp.
References mx::Texture::flipSurface().
| const char * gl::fSource |
Default fragment shader source.
Definition at line 862 of file gl.cpp.
Referenced by console::GLConsole::load().
| const char* gl::ftSource |
Definition at line 870 of file gl.cpp.
Referenced by gl::GLText::init().
| const char * gl::vSource |
Default vertex shader source.
Definition at line 853 of file gl.cpp.
Referenced by gl::GLText::init(), and console::GLConsole::load().