libmx2 2.2.1
C++20 multimedia and game-engine library (SDL2 / OpenGL / Vulkan)
Loading...
Searching...
No Matches
gl.cpp File Reference

Implementation of gl::ShaderProgram, gl::GLText, gl::GLSprite, gl::GLWindow, and gl::GLObject. More...

#include "config.h"
#include "gl.hpp"
Include dependency graph for gl.cpp:

Go to the source code of this file.

Namespaces

namespace  gl

Functions

GLuint gl::loadTexture (const std::string &filename)
 Load a GL texture from a file.
GLuint gl::loadTexture (const std::string &filename, int &w, int &h)
 Load a GL texture from a file and retrieve its dimensions.
GLuint gl::createTexture (SDL_Surface *surface, bool flip)
 Create a new GL texture from an SDL_Surface.
GLuint gl::createTexture (void *buffer, int width, int height)
 Create a new GL texture from a raw pixel buffer.
void gl::updateTexture (GLuint texture, SDL_Surface *surface, bool flip)
 Replace a GL texture's contents from an SDL_Surface.
SDL_Surface * gl::createSurface (int w, int h)
 Allocate a blank RGBA SDL_Surface.

Variables

const char * gl::vSource
 Default vertex shader source.
const char * gl::fSource
 Default fragment shader source.
const char * gl::ftSource

Detailed Description

Implementation of gl::ShaderProgram, gl::GLText, gl::GLSprite, gl::GLWindow, and gl::GLObject.

Definition in file gl.cpp.