MapLibre Native Core
background.hpp
Go to the documentation of this file.
1
// Generated code, do not modify this file!
2
// Generated on 2023-04-05T16:25:15.886Z by mwilsnd using shaders/generate_shader_code.js
3
4
#pragma once
5
#include <
mbgl/shaders/shader_source.hpp
>
6
7
namespace
mbgl
{
8
namespace
shaders {
9
10
template
<>
struct
ShaderSource
<
BuiltIn
::
BackgroundProgram
,
gfx::Backend::Type::OpenGL
> {
11
static
constexpr
const
char
* vertex = R
"(layout (location = 0) in vec2 a_pos;
12
uniform mat4 u_matrix;
13
14
void main() {
15
gl_Position = u_matrix * vec4(a_pos, 0, 1);
16
}
17
)";
18
static
constexpr
const
char
* fragment = R
"(uniform vec4 u_color;
19
uniform float u_opacity;
20
21
void main() {
22
fragColor = u_color * u_opacity;
23
24
#ifdef OVERDRAW_INSPECTOR
25
fragColor = vec4(1.0);
26
#endif
27
}
28
)";
29
};
30
31
}
// namespace shaders
32
}
// namespace mbgl
mbgl::gfx::Backend::Type::OpenGL
@ OpenGL
The OpenGL API backend.
mbgl::shaders::BuiltIn
BuiltIn
This enum is used with the ShaderSource template to select source code for the desired program and gr...
Definition:
shader_source.hpp:12
mbgl::shaders::BuiltIn::BackgroundProgram
@ BackgroundProgram
mbgl
Definition:
actor.hpp:15
shader_source.hpp
mbgl::shaders::ShaderSource
Select shader source based on a program type and a desired graphics API.
Definition:
shader_source.hpp:48
include
mbgl
shaders
gl
background.hpp
MapLibre website
|
GitHub repository