Blender V4.3
app/opengl/shader.h
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2011-2022 OpenGL Foundation
2 *
3 * SPDX-License-Identifier: Apache-2.0 */
4
5#pragma once
6
7#include "util/types.h"
8
10
12 public:
13 static constexpr const char *position_attribute_name = "pos";
14 static constexpr const char *tex_coord_attribute_name = "texCoord";
15
16 OpenGLShader() = default;
17 virtual ~OpenGLShader() = default;
18
19 /* Get attribute location for position and texture coordinate respectively.
20 * NOTE: The shader needs to be bound to have access to those. */
23
24 void bind(int width, int height);
25 void unbind();
26
27 protected:
29
31 void destroy_shader();
32
33 /* Cached values of various OpenGL resources. */
36
40
41 /* Shader compilation attempted. Which means, that if the shader program is 0 then compilation or
42 * linking has failed. Do not attempt to re-compile the shader. */
44};
45
unsigned int uint
int get_position_attrib_location()
OpenGLShader()=default
static constexpr const char * position_attribute_name
virtual ~OpenGLShader()=default
int position_attribute_location_
bool shader_compile_attempted_
void bind(int width, int height)
int get_tex_coord_attrib_location()
int tex_coord_attribute_location_
static constexpr const char * tex_coord_attribute_name
#define CCL_NAMESPACE_END