Blender V5.0
OpenGLShader Class Reference

#include <shader.h>

Public Member Functions

 OpenGLShader ()=default
virtual ~OpenGLShader ()=default
int get_position_attrib_location ()
int get_tex_coord_attrib_location ()
void bind (const int width, const int height)
void unbind ()

Static Public Attributes

static constexpr const char * position_attribute_name = "pos"
static constexpr const char * tex_coord_attribute_name = "texCoord"

Protected Member Functions

uint get_shader_program ()
void create_shader_if_needed ()
void destroy_shader ()

Protected Attributes

int position_attribute_location_ = -1
int tex_coord_attribute_location_ = -1
uint shader_program_ = 0
int image_texture_location_ = -1
int fullscreen_location_ = -1
bool shader_compile_attempted_ = false

Detailed Description

Definition at line 11 of file app/opengl/shader.h.

Constructor & Destructor Documentation

◆ OpenGLShader()

OpenGLShader::OpenGLShader ( )
default

◆ ~OpenGLShader()

virtual OpenGLShader::~OpenGLShader ( )
virtualdefault

Member Function Documentation

◆ bind()

void OpenGLShader::bind ( const int width,
const int height )

◆ create_shader_if_needed()

void OpenGLShader::create_shader_if_needed ( )
protected

◆ destroy_shader()

void OpenGLShader::destroy_shader ( )
protected

Definition at line 192 of file app/opengl/shader.cpp.

References shader_program_.

Referenced by create_shader_if_needed().

◆ get_position_attrib_location()

int OpenGLShader::get_position_attrib_location ( )

◆ get_shader_program()

uint OpenGLShader::get_shader_program ( )
protected

◆ get_tex_coord_attrib_location()

int OpenGLShader::get_tex_coord_attrib_location ( )

◆ unbind()

void OpenGLShader::unbind ( )

Definition at line 155 of file app/opengl/shader.cpp.

Member Data Documentation

◆ fullscreen_location_

int OpenGLShader::fullscreen_location_ = -1
protected

Definition at line 39 of file app/opengl/shader.h.

Referenced by bind(), and create_shader_if_needed().

◆ image_texture_location_

int OpenGLShader::image_texture_location_ = -1
protected

Definition at line 38 of file app/opengl/shader.h.

Referenced by bind(), and create_shader_if_needed().

◆ position_attribute_location_

int OpenGLShader::position_attribute_location_ = -1
protected

Definition at line 34 of file app/opengl/shader.h.

Referenced by get_position_attrib_location().

◆ position_attribute_name

const char* OpenGLShader::position_attribute_name = "pos"
staticconstexpr

Definition at line 13 of file app/opengl/shader.h.

Referenced by get_position_attrib_location().

◆ shader_compile_attempted_

bool OpenGLShader::shader_compile_attempted_ = false
protected

Definition at line 43 of file app/opengl/shader.h.

Referenced by create_shader_if_needed().

◆ shader_program_

uint OpenGLShader::shader_program_ = 0
protected

◆ tex_coord_attribute_location_

int OpenGLShader::tex_coord_attribute_location_ = -1
protected

Definition at line 35 of file app/opengl/shader.h.

Referenced by get_tex_coord_attrib_location().

◆ tex_coord_attribute_name

const char* OpenGLShader::tex_coord_attribute_name = "texCoord"
staticconstexpr

Definition at line 14 of file app/opengl/shader.h.

Referenced by get_tex_coord_attrib_location().


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