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
Onuralp SEZER
Game Library
Commits
bcf3428d
Commit
bcf3428d
authored
2 years ago
by
Joseph Walton-Rivers
Browse files
Options
Downloads
Patches
Plain Diff
remove unused render header
parent
2031253a
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
fggl/gfx/ogl/renderer.cpp
+0
-62
0 additions, 62 deletions
fggl/gfx/ogl/renderer.cpp
with
0 additions
and
62 deletions
fggl/gfx/ogl/renderer.cpp
+
0
−
62
View file @
bcf3428d
...
...
@@ -123,25 +123,6 @@ namespace fggl::gfx {
using
data
::
Mesh2D
;
using
data
::
Vertex2D
;
GlRenderToken
setupVertex2D
()
{
GlRenderToken
token
{};
glGenVertexArrays
(
1
,
&
token
.
vao
);
glBindVertexArray
(
token
.
vao
);
glGenBuffers
(
2
,
token
.
buffs
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
token
.
buffs
[
0
]);
glEnableVertexAttribArray
(
0
);
glVertexAttribPointer
(
0
,
2
,
GL_FLOAT
,
GL_FALSE
,
sizeof
(
Vertex2D
),
reinterpret_cast
<
void
*>
(
offsetof
(
Vertex2D
,
position
)));
glEnableVertexAttribArray
(
1
);
glVertexAttribPointer
(
1
,
3
,
GL_FLOAT
,
GL_FALSE
,
sizeof
(
Vertex2D
),
reinterpret_cast
<
void
*>
(
offsetof
(
Vertex2D
,
colour
)));
glBindVertexArray
(
0
);
return
token
;
}
OpenGL4Backend
::
OpenGL4Backend
(
const
Window
&
owner
)
:
fggl
::
gfx
::
Graphics
()
{
// initialise GLEW, or fail
// FIXME this binds the graphics stack to GLFW :'(
...
...
@@ -205,49 +186,6 @@ namespace fggl::gfx {
glViewport
(
0
,
0
,
width
,
height
);
}
template
<
typename
T
>
static
GLuint
createArrayBuffer
(
std
::
vector
<
T
>
&
vertexData
)
{
GLuint
buffId
;
glGenBuffers
(
1
,
&
buffId
);
glBindBuffer
(
GL_ARRAY_BUFFER
,
buffId
);
glBufferData
(
GL_ARRAY_BUFFER
,
vertexData
.
size
()
*
sizeof
(
T
),
vertexData
.
data
(),
GL_STATIC_DRAW
);
return
buffId
;
}
static
GLuint
createIndexBuffer
(
std
::
vector
<
uint32_t
>
&
indexData
)
{
GLuint
buffId
;
glGenBuffers
(
1
,
&
buffId
);
glBindBuffer
(
GL_ELEMENT_ARRAY_BUFFER
,
buffId
);
glBufferData
(
GL_ELEMENT_ARRAY_BUFFER
,
indexData
.
size
()
*
sizeof
(
uint32_t
),
indexData
.
data
(),
GL_STATIC_DRAW
);
return
buffId
;
}
GlRenderToken
MeshRenderer
::
upload
(
fggl
::
data
::
Mesh
&
mesh
)
{
GlRenderToken
token
{};
glGenVertexArrays
(
1
,
&
token
.
vao
);
glBindVertexArray
(
token
.
vao
);
token
.
buffs
[
0
]
=
createArrayBuffer
<
fggl
::
data
::
Vertex
>
(
mesh
.
vertexList
());
glEnableVertexAttribArray
(
0
);
glVertexAttribPointer
(
0
,
3
,
GL_FLOAT
,
GL_FALSE
,
sizeof
(
fggl
::
data
::
Vertex
),
reinterpret_cast
<
void
*>
(
offsetof
(
fggl
::
data
::
Vertex
,
posititon
)));
glEnableVertexAttribArray
(
1
);
glVertexAttribPointer
(
1
,
3
,
GL_FLOAT
,
GL_FALSE
,
sizeof
(
fggl
::
data
::
Vertex
),
reinterpret_cast
<
void
*>
(
offsetof
(
fggl
::
data
::
Vertex
,
normal
)));
token
.
buffs
[
1
]
=
createIndexBuffer
(
mesh
.
indexList
());
token
.
idxOffset
=
0
;
token
.
idxSize
=
mesh
.
indexCount
();
token
.
restartVertex
=
mesh
.
restartVertex
;
glBindVertexArray
(
0
);
return
token
;
}
// TODO(webpigeon): this shouldn't be hard-coded
constexpr
glm
::
vec3
DEFAULT_LIGHTPOS
=
glm
::
vec3
(
20.0
F
,
20.0
F
,
15.0
F
);
...
...
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