Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
G
Game Library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Game Development
Game Library
Commits
e646c7cb
Commit
e646c7cb
authored
2 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
remove old shader class
parent
37d5c8b6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#3325
failed
2 years ago
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
include/fggl/gfx/ogl/backend.hpp
+0
-62
0 additions, 62 deletions
include/fggl/gfx/ogl/backend.hpp
with
0 additions
and
62 deletions
include/fggl/gfx/ogl/backend.hpp
+
0
−
62
View file @
e646c7cb
...
...
@@ -6,73 +6,11 @@
#include
<stdexcept>
/**
* FGGL OpenGL 4.x rendering backend.
*/
namespace
fggl
::
gfx
{
class
Shader
{
public:
Shader
();
~
Shader
();
inline
void
use
()
const
{
glUseProgram
(
m_handle
);
}
inline
GLuint
uniform
(
const
std
::
string
&
name
)
{
GLint
loc
=
glGetUniformLocation
(
m_handle
,
name
.
c_str
());
if
(
loc
==
-
1
)
{
throw
std
::
runtime_error
(
"invalid shader uniform"
);
}
return
loc
;
}
inline
void
setInt
(
const
std
::
string
&
name
,
const
GLint
value
)
{
setInt
(
uniform
(
name
),
value
);
}
inline
void
setInt
(
GLuint
idx
,
const
GLint
value
)
{
glUniform1i
(
idx
,
value
);
}
inline
void
setFloat
(
const
std
::
string
&
name
,
const
GLfloat
value
)
{
setFloat
(
uniform
(
name
),
value
);
}
inline
void
setFloat
(
GLuint
idx
,
const
GLfloat
value
)
{
glUniform1f
(
idx
,
value
);
}
inline
void
setVec2
(
const
std
::
string
&
name
,
const
GLfloat
*
vec
)
{
setVec2
(
uniform
(
name
),
vec
);
}
inline
void
setVec2
(
GLuint
idx
,
const
GLfloat
*
vec
)
{
glUniform2f
(
idx
,
vec
[
0
],
vec
[
1
]);
}
inline
void
setVec3
(
const
std
::
string
&
name
,
const
GLfloat
*
vec
)
{
setVec3
(
uniform
(
name
),
vec
);
}
inline
void
setVec3
(
GLuint
idx
,
const
GLfloat
*
vec
)
{
glUniform3f
(
idx
,
vec
[
0
],
vec
[
1
],
vec
[
2
]);
}
inline
void
setMat4
(
const
std
::
string
&
name
,
const
GLfloat
*
mat
)
{
setMat4
(
uniform
(
name
),
mat
);
}
inline
void
setMat4
(
GLuint
idx
,
const
GLfloat
*
mat
)
{
glUniformMatrix4fv
(
idx
,
1
,
GL_FALSE
,
mat
);
}
private
:
int
m_handle
;
};
}
#endif
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment