Pioneer
src
graphics
opengl
Uniform.h
Go to the documentation of this file.
1
// Copyright © 2008-2021 Pioneer Developers. See AUTHORS.txt for details
2
// Licensed under the terms of the GPL v3. See licenses/GPL-3.txt
3
4
#ifndef _OGL_UNIFORM_H
5
#define _OGL_UNIFORM_H
6
/*
7
* Shader uniform
8
*/
9
#include "
OpenGLLibs.h
"
10
11
#include "
Color.h
"
12
#include "
matrix3x3.h
"
13
#include "
matrix4x4.h
"
14
#include "
vector3.h
"
15
16
namespace
Graphics
{
17
18
class
Texture;
19
20
namespace
OGL {
21
class
Uniform
{
22
public
:
23
Uniform
();
24
void
Init
(
const
char
*name, GLuint program);
25
void
Set
(
int
);
26
void
Set
(
float
);
27
void
Set
(
const
vector3f
&);
28
void
Set
(
const
vector3d
&);
29
void
Set
(
const
Color
&);
30
void
Set
(
const
int
v[3]);
31
void
Set
(
const
float
x,
const
float
y,
const
float
z,
const
float
w);
32
void
Set
(
const
float
m[9]);
33
void
Set
(
const
matrix3x3f
&);
34
void
Set
(
const
matrix4x4f
&);
35
void
Set
(
Texture
*t,
unsigned
int
unit);
36
bool
IsValid
()
const
{
return
(m_location != -1); }
37
38
private
:
39
GLint m_location;
40
};
41
}
// namespace OGL
42
}
// namespace Graphics
43
44
#endif
Color.h
OpenGLLibs.h
Graphics::OGL::Uniform
Definition:
Uniform.h:21
Graphics::OGL::Uniform::Uniform
Uniform()
Definition:
Uniform.cpp:10
Graphics::OGL::Uniform::Init
void Init(const char *name, GLuint program)
Definition:
Uniform.cpp:15
Graphics::OGL::Uniform::IsValid
bool IsValid() const
Definition:
Uniform.h:36
Graphics::OGL::Uniform::Set
void Set(int)
Definition:
Uniform.cpp:20
Graphics::Texture
Definition:
Texture.h:106
matrix3x3< float >
matrix4x4< float >
vector3< float >
matrix3x3.h
matrix4x4.h
Graphics
Definition:
Background.h:13
Color4ub
Definition:
Color.h:66
vector3.h
Generated by
1.9.1