MOS
Classes | Public Member Functions | Static Public Member Functions | List of all members
mos::gl::Renderer Class Referencefinal

Render geometry shapes with OpenGL. More...

#include <renderer.hpp>

Public Member Functions

 Renderer (const glm::ivec2 &resolution, const int samples=1)
 Inits the renderer, creates an OpenGL context with GLAD. More...
 
 Renderer (const Renderer &renderer)=delete
 
 Renderer (const Renderer &&renderer)=delete
 
Rendereroperator= (const Renderer &renderer)=delete
 
Rendereroperator= (const Renderer &&renderer)=delete
 
auto load (const gfx::Model &model) -> gpu::Model
 Loads a model into GPU memory. More...
 
auto load (const gfx::Models &models) -> gpu::Models
 Load multiple models into GPU memory. More...
 
auto load (const gfx::Mesh &mesh) -> gpu::Mesh
 Load a mesh into GPU memory. More...
 
auto load (const gfx::Shared_mesh &mesh) -> void
 Load a shared mesh into GPU memory. More...
 
auto unload (const gfx::Mesh &mesh) -> void
 Unloads a mesh from GPU memory. More...
 
auto load (const gfx::Shared_texture_2D &texture) -> void
 Loads a shared texture into GPU memory. More...
 
auto load_or_update (const gfx::Texture_2D &texture) -> void
 Loads a texture into GPU memory. More...
 
auto unload (const gfx::Shared_texture_2D &texture) -> void
 Unloads a shared texture from GPU memory. More...
 
auto render (const gfx::Scenes &scenes, const glm::vec4 &color={0.0f, 0.0f, 0.0f, 1.0f}, const glm::ivec2 &resolution=glm::ivec2(128, 128)) -> void
 Render multiple scenes. More...
 
auto clear_buffers () -> void
 Clear all GPU buffers/memory. More...
 

Static Public Member Functions

static GLuint generate (const std::function< void(GLsizei, GLuint *)> &f)
 
static GLuint wrap_convert (const gfx::Texture::Wrap &w)
 
static GLuint filter_convert (const gfx::Texture::Filter &f)
 
static GLuint filter_convert_mip (const gfx::Texture::Filter &f)
 

Detailed Description

Render geometry shapes with OpenGL.

Constructor & Destructor Documentation

◆ Renderer()

mos::gl::Renderer::Renderer ( const glm::ivec2 &  resolution,
const int  samples = 1 
)
explicit

Inits the renderer, creates an OpenGL context with GLAD.

Member Function Documentation

◆ clear_buffers()

auto mos::gl::Renderer::clear_buffers ( ) -> void

Clear all GPU buffers/memory.

◆ load() [1/5]

auto mos::gl::Renderer::load ( const gfx::Model model) -> gpu::Model

Loads a model into GPU memory.

◆ load() [2/5]

auto mos::gl::Renderer::load ( const gfx::Models &  models) -> gpu::Models

Load multiple models into GPU memory.

◆ load() [3/5]

auto mos::gl::Renderer::load ( const gfx::Mesh mesh) -> gpu::Mesh

Load a mesh into GPU memory.

◆ load() [4/5]

auto mos::gl::Renderer::load ( const gfx::Shared_mesh &  mesh) -> void

Load a shared mesh into GPU memory.

◆ load() [5/5]

auto mos::gl::Renderer::load ( const gfx::Shared_texture_2D &  texture) -> void

Loads a shared texture into GPU memory.

◆ load_or_update()

auto mos::gl::Renderer::load_or_update ( const gfx::Texture_2D texture) -> void

Loads a texture into GPU memory.

◆ render()

auto mos::gl::Renderer::render ( const gfx::Scenes scenes,
const glm::vec4 &  color = {0.0f, 0.0f, 0.0f, 1.0f},
const glm::ivec2 &  resolution = glm::ivec2(128, 128) 
) -> void

Render multiple scenes.

◆ unload() [1/2]

auto mos::gl::Renderer::unload ( const gfx::Mesh mesh) -> void

Unloads a mesh from GPU memory.

◆ unload() [2/2]

auto mos::gl::Renderer::unload ( const gfx::Shared_texture_2D &  texture) -> void

Unloads a shared texture from GPU memory.


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