Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Johannes Braun
glare
Commits
25e1e19d
Commit
25e1e19d
authored
Aug 14, 2017
by
Johannes Braun
Browse files
Node class cleanup and ReSharper refactoring with removal of redundant includes.
parent
62a50c97
Changes
94
Hide whitespace changes
Inline
Side-by-side
src/executables/game/main.cpp
View file @
25e1e19d
...
...
@@ -35,8 +35,8 @@ int main(int argc, char* argv[])
//Attach plane as child in front of the camera.
auto
plane
=
core
::
Resources
::
getInstance
().
getColladaMesh
(
files
::
asset
(
"meshes/scenery/TY_Plane.dae"
),
"Cube_001"
);
cam_node
->
attach
(
plane
);
plane
->
transform
()
->
position
=
{
0
,
-
2.
f
,
-
15
};
plane
->
transform
()
->
rotate
({
glm
::
radians
(
-
90.
f
),
glm
::
radians
(
90.
f
),
0.
f
});
plane
->
transform
.
position
=
{
0
,
-
2.
f
,
-
15
};
plane
->
transform
.
rotate
({
glm
::
radians
(
-
90.
f
),
glm
::
radians
(
90.
f
),
0.
f
});
// add the terrain
auto
terrain_node
=
std
::
make_shared
<
core
::
GraphNode
>
(
"terrain"
);
...
...
@@ -49,8 +49,8 @@ int main(int argc, char* argv[])
// Sun light source
auto
sun_node
=
std
::
make_shared
<
core
::
GraphNode
>
(
"light_sun"
);
sun_node
->
transform
()
->
rotate
({
glm
::
radians
(
80.
f
),
0
,
0
});
auto
light_sun
=
sun_node
->
makeComponent
<
core
::
LightComponent
>
(
color
::
rgba32f
{
0.4
f
,
0.4
f
,
0.4
f
,
1.
f
},
core
::
Attenuation
{
1
,
0
,
0
},
core
::
LightParameters
::
makeDirectionalLight
(
0.1
f
));
sun_node
->
transform
.
rotate
({
glm
::
radians
(
80.
f
),
0
,
0
});
auto
light_sun
=
sun_node
->
makeComponent
<
core
::
LightComponent
>
(
color
::
rgba32f
{
0.4
f
,
0.4
f
,
0.4
f
,
1.
f
},
core
::
LightParameters
::
makeDirectionalLight
(
0.1
f
));
// Make Environment lighting node
auto
lighting_node
=
std
::
make_shared
<
core
::
GraphNode
>
(
"environment"
);
...
...
@@ -62,11 +62,11 @@ int main(int argc, char* argv[])
{
// Rotate the sun on keypress
if
(
controls
::
keyState
(
controls
::
Key
::
eF
)
==
controls
::
ButtonAction
::
ePress
)
{
sun_node
->
transform
()
->
rotate
({
glm
::
radians
(
80.
f
)
*
delta
,
0
,
0
});
sun_node
->
transform
.
rotate
({
glm
::
radians
(
80.
f
)
*
delta
,
0
,
0
});
}
// Set the light position to the player camera position
lighting_node
->
transform
()
->
position
=
core
::
state
::
camera
->
getO
wner
()
->
c_
transform
()
.
position
*
glm
::
vec3
(
1
,
0
,
1
);
lighting_node
->
transform
.
position
=
core
::
state
::
camera
->
o
wner
()
->
transform
.
position
*
glm
::
vec3
(
1
,
0
,
1
);
core
::
state
::
gbuffer
->
activate
();
glare
::
core
::
state
::
graph_root
->
draw
();
...
...
src/executables/game/src/map.cpp
View file @
25e1e19d
...
...
@@ -250,7 +250,7 @@ namespace glare
return
m_mesh_renderer
;
}
std
::
shared_ptr
<
core
::
Material
>
Map
::
makeMaterial
()
std
::
shared_ptr
<
core
::
Material
>
Map
::
makeMaterial
()
const
{
std
::
shared_ptr
<
core
::
Material
>
material
=
std
::
make_shared
<
core
::
Material
>
(
"terrain"
);
material
->
base
.
value
=
color
::
preset
::
white
.
rgb
;
...
...
src/executables/game/src/map.h
View file @
25e1e19d
...
...
@@ -22,7 +22,7 @@ namespace glare
glm
::
vec3
getSectorCenter
(
unsigned
x
,
unsigned
z
)
const
;
private:
std
::
shared_ptr
<
core
::
Material
>
makeMaterial
();
std
::
shared_ptr
<
core
::
Material
>
makeMaterial
()
const
;
std
::
shared_ptr
<
core
::
MeshRenderer
>
m_mesh_renderer
;
std
::
vector
<
std
::
vector
<
float
>>
m_heights
;
...
...
src/executables/just_testing/main.cpp
View file @
25e1e19d
#include
<iostream>
#include
<array>
#include
<functional>
...
...
src/executables/minimal/main.cpp
View file @
25e1e19d
...
...
@@ -19,7 +19,7 @@ int main(int argc, char* argv[])
core
::
state
::
skybox
->
reset
(
core
::
Skybox
::
collectFilesFrom
(
files
::
asset
(
"textures/ryfjallet/"
)));
// Add a PlayerController to move around
core
::
state
::
camera
->
getO
wner
()
->
makeComponent
<
component
::
PlayerController
>
();
core
::
state
::
camera
->
o
wner
()
->
makeComponent
<
component
::
PlayerController
>
();
// Create a Pathtracer and all needed stuff for it from the graph
const
auto
pathtracer
=
std
::
make_unique
<
raytrace
::
Pathtracer
>
(
core
::
state
::
graph_root
);
...
...
src/executables/pathtracing/main.cpp
View file @
25e1e19d
#include
<imgui/imgui_glfw.h>
#include
<util/files.h>
#include
<util/console.h>
...
...
@@ -28,7 +30,7 @@ const fs::path engine_settings_path = files::asset("/preferences/default.xml");
const
fs
::
path
pathtracer_settings_path
=
files
::
asset
(
"/preferences/pathtracer_default.xml"
);
const
fs
::
path
skybox_files_path
=
files
::
asset
(
"/textures/ryfjallet/"
);
const
fs
::
path
env_audio_path
=
files
::
asset
(
"/audio/env.wav"
);
const
fs
::
path
startup_scene_path
=
files
::
asset
(
"/meshes/scenery/
spher
e.dae"
);
const
fs
::
path
startup_scene_path
=
files
::
asset
(
"/meshes/scenery/
Hous
e.dae"
);
// My little all-enclosing pathtracer pointer
std
::
unique_ptr
<
raytrace
::
Pathtracer
>
pathtracer
=
nullptr
;
...
...
@@ -132,7 +134,7 @@ void loadScene(const fs::path& path, float scale)
console
::
prompt
(
"Scene could not be loaded: "
+
path
.
string
()
+
". Press [ENTER] to exit."
,
1
);
}
std
::
shared_ptr
<
core
::
GraphNode
>
cam_node
=
core
::
state
::
graph_root
->
find
FirstWithComponent
<
core
::
Camera
>
();
std
::
shared_ptr
<
core
::
GraphNode
>
cam_node
=
core
::
state
::
graph_root
->
find
<
core
::
Camera
>
();
if
(
cam_node
)
{
//If there are any cameras in the collada file, take the first one.
...
...
src/libraries/components/PlayerController.cpp
View file @
25e1e19d
...
...
@@ -37,11 +37,9 @@ namespace glare
{
case
tags
::
camera
:
{
if
(
getO
wner
()
!=
core
::
state
::
camera
->
getO
wner
())
if
(
o
wner
()
!=
core
::
state
::
camera
->
o
wner
())
{
auto
shared
=
std
::
static_pointer_cast
<
PlayerController
>
(
shared_from_this
());
getOwner
()
->
removeComponent
(
shared
);
core
::
state
::
camera
->
getOwner
()
->
addComponent
(
shared
);
core
::
state
::
camera
->
owner
()
->
addComponent
(
detachAs
<
PlayerController
>
());
}
}
break
;
}
...
...
@@ -86,7 +84,7 @@ namespace glare
void
PlayerController
::
update
()
{
auto
transform
=
m_
owner
.
lock
()
->
transform
()
;
auto
&&
transform
=
owner
()
->
transform
;
float
forward
=
static_cast
<
float
>
((
controls
::
keyState
(
controls
::
Key
::
eW
)
==
controls
::
ButtonAction
::
ePress
)
-
(
controls
::
keyState
(
controls
::
Key
::
eS
)
==
controls
::
ButtonAction
::
ePress
));
...
...
@@ -101,18 +99,18 @@ namespace glare
up
*=
m_boost
;
}
transform
->
position
+=
m_
owner
.
lock
()
->
c_
worldTransform
().
forward
()
*
forward
*
m_speed
*
core
::
Time
::
deltaTime
()
+
m_
owner
.
lock
()
->
c_
worldTransform
().
right
()
*
right
*
m_speed
*
core
::
Time
::
deltaTime
()
+
m_
owner
.
lock
()
->
c_
worldTransform
().
up
()
*
up
*
m_speed
*
core
::
Time
::
deltaTime
();
transform
.
position
+=
owner
()
->
worldTransform
().
forward
()
*
forward
*
m_speed
*
core
::
Time
::
deltaTime
()
+
owner
()
->
worldTransform
().
right
()
*
right
*
m_speed
*
core
::
Time
::
deltaTime
()
+
owner
()
->
worldTransform
().
up
()
*
up
*
m_speed
*
core
::
Time
::
deltaTime
();
const
glm
::
vec2
delta
=
last_position
-
controls
::
getCursorPosition
();
last_position
=
controls
::
getCursorPosition
();
if
(
controls
::
isCursorGrabbed
())
{
transform
->
rotation
=
glm
::
quat
(
glm
::
vec3
(
0.
f
,
glm
::
radians
(
delta
.
x
/
10
)
*
m_rotation_speed
,
0.
f
))
*
m_
owner
.
lock
()
->
c_
transform
()
.
rotation
;
transform
->
rotation
*=
glm
::
quat
(
glm
::
vec3
(
glm
::
radians
(
delta
.
y
/
10
)
*
m_rotation_speed
,
0.
f
,
0.
f
));
transform
.
rotation
=
glm
::
quat
(
glm
::
vec3
(
0.
f
,
glm
::
radians
(
delta
.
x
/
10
)
*
m_rotation_speed
,
0.
f
))
*
owner
()
->
transform
.
rotation
;
transform
.
rotation
*=
glm
::
quat
(
glm
::
vec3
(
glm
::
radians
(
delta
.
y
/
10
)
*
m_rotation_speed
,
0.
f
,
0.
f
));
}
}
}
...
...
src/libraries/components/PlayerController.h
View file @
25e1e19d
#ifndef __PLAYERCONTROLLER_H
#define __PLAYERCONTROLLER_H
#include
<util/messaging.h>
#include
<core/graph/component.h>
#include
<core/control.h>
...
...
src/libraries/components/Rotator.cpp
View file @
25e1e19d
...
...
@@ -17,7 +17,7 @@ namespace glare
void
Rotator
::
update
()
{
getO
wner
()
->
transform
()
->
rotate
(
glm
::
vec3
(
0
,
glm
::
radians
(
80.
f
),
0
)
*
core
::
Time
::
deltaTime
());
o
wner
()
->
transform
.
rotate
(
glm
::
vec3
(
0
,
glm
::
radians
(
80.
f
),
0
)
*
static_cast
<
float
>
(
core
::
Time
::
deltaTime
())
)
;
}
}
}
src/libraries/core/anim/animations.h
View file @
25e1e19d
...
...
@@ -2,7 +2,6 @@
#define __ANIMATIONMANAGER_H
// --------------- STDLIB ---------------
#include
<algorithm>
#include
<functional>
#include
<memory>
#include
<vector>
...
...
src/libraries/core/audio/sound_source.cpp
View file @
25e1e19d
...
...
@@ -22,7 +22,7 @@ namespace glare
void
SoundSource
::
update
()
{
glm
::
vec3
position
=
getO
wner
()
->
c_
worldTransform
().
position
;
glm
::
vec3
position
=
o
wner
()
->
worldTransform
().
position
;
al
::
source3f
(
m_source
,
al
::
SourceParam
::
ePosition
,
position
);
al
::
source3f
(
m_source
,
al
::
SourceParam
::
eVelocity
,
position
-
m_last_position
);
...
...
@@ -30,17 +30,17 @@ namespace glare
m_last_position
=
position
;
}
void
SoundSource
::
play
()
void
SoundSource
::
play
()
const
{
al
::
sourcePlay
(
m_source
);
}
void
SoundSource
::
pause
()
void
SoundSource
::
pause
()
const
{
al
::
sourcePause
(
m_source
);
}
void
SoundSource
::
stop
()
void
SoundSource
::
stop
()
const
{
al
::
sourceStop
(
m_source
);
}
...
...
src/libraries/core/audio/sound_source.h
View file @
25e1e19d
...
...
@@ -4,8 +4,6 @@
#include
<util/openal.h>
#include
<core/graph/component.h>
#include
"sound_buffer.h"
namespace
glare
{
namespace
core
...
...
@@ -17,9 +15,9 @@ namespace glare
SoundSource
(
unsigned
buffer
);
void
update
()
override
;
void
play
();
void
pause
();
void
stop
();
void
play
()
const
;
void
pause
()
const
;
void
stop
()
const
;
void
setLooping
(
bool
looping
);
...
...
src/libraries/core/base/framebuffer.h
View file @
25e1e19d
...
...
@@ -2,14 +2,12 @@
#define INCLUDE_FRAMEBUFFER_H
// --- STDLIB ---------------------------------------------
#include
<functional>
#include
<map>
#include
<memory>
// --- EXTERN ---------------------------------------------
#include
<util/log.h>
#include
<util/opengl.h>
#include
<util/templates.h>
// --- INTERN ---------------------------------------------
...
...
@@ -46,7 +44,7 @@ namespace glare
unsigned
attachments
()
const
;
unsigned
samples
()
const
;
p
ublic
:
p
rivate
:
void
putAttachment
(
gl
::
Attachment
attachment
,
unsigned
texture
);
gl
::
handle
::
framebuffer
m_handle
;
...
...
src/libraries/core/base/program.cpp
View file @
25e1e19d
...
...
@@ -29,12 +29,10 @@ namespace glare
throw
std
::
runtime_error
(
log
);
}
else
{
for
(
auto
&&
shader
:
shaders
)
gl
::
detachShader
(
m_handle
,
shader
->
id
());
Log_Debug
<<
"Program was linked successfully."
;
}
for
(
auto
&&
shader
:
shaders
)
gl
::
detachShader
(
m_handle
,
shader
->
id
());
Log_Debug
<<
"Program was linked successfully."
;
collectUniforms
();
collectSubroutines
(
shaders
);
...
...
@@ -65,11 +63,10 @@ namespace glare
if
(
data
.
size
>
1
&&
std
::
string
(
data
.
name
.
data
()
+
data
.
name
.
length
()
-
3
)
==
"[0]"
)
{
const
auto
idx
=
data
.
name
.
find_last_of
(
'['
,
0
);
for
(
int
i
=
1
;
i
<
data
.
size
;
++
i
)
for
(
int
j
=
1
;
j
<
data
.
size
;
++
j
)
{
std
::
string
last_ending
=
"["
+
std
::
to_string
(
i
-
1
)
+
"]"
;
std
::
string
ending
=
"["
+
std
::
to_string
(
i
)
+
"]"
;
std
::
string
last_ending
=
"["
+
std
::
to_string
(
j
-
1
)
+
"]"
;
std
::
string
ending
=
"["
+
std
::
to_string
(
j
)
+
"]"
;
data
.
name
=
std
::
string
(
data
.
name
.
data
(),
data
.
name
.
data
()
+
data
.
name
.
length
()
-
last_ending
.
length
())
+
ending
;
data
.
index
=
uniformLocation
(
data
.
name
);
...
...
@@ -160,7 +157,7 @@ namespace glare
return
-
1
;
}
void
Program
::
setSubroutines
(
gl
::
ShaderType
stage
,
std
::
vector
<
unsigned
>
indices
)
const
void
Program
::
setSubroutines
(
gl
::
ShaderType
stage
,
std
::
vector
<
unsigned
>
indices
)
{
gl
::
uniformSubroutinesuiv
(
stage
,
indices
.
size
(),
indices
.
data
());
}
...
...
src/libraries/core/base/program.h
View file @
25e1e19d
...
...
@@ -7,9 +7,9 @@
#include
<glm/ext.hpp>
#include
<util/opengl.h>
#include
<util/files.h>
#include
<util/log.h>
#include
<core/base/buffer.h>
#include
"shader.h"
namespace
glare
...
...
@@ -52,10 +52,6 @@ namespace glare
void
use
()
const
;
template
<
typename
T
>
void
uniform
(
const
std
::
string
&
name
,
const
T
&
data
)
const
;
template
<
>
void
uniform
<
bool
>
(
const
std
::
string
&
name
,
const
bool
&
data
)
const
;
template
<
>
void
uniform
<
glm
::
bvec2
>
(
const
std
::
string
&
name
,
const
glm
::
bvec2
&
data
)
const
;
template
<
>
void
uniform
<
glm
::
bvec3
>
(
const
std
::
string
&
name
,
const
glm
::
bvec3
&
data
)
const
;
template
<
>
void
uniform
<
glm
::
bvec4
>
(
const
std
::
string
&
name
,
const
glm
::
bvec4
&
data
)
const
;
void
bindSubroutine
(
gl
::
ShaderType
stage
,
const
std
::
string
&
uniform
,
const
std
::
string
&
subroutine
);
...
...
@@ -79,12 +75,12 @@ namespace glare
void
collectUniforms
();
void
collectSubroutines
(
const
std
::
vector
<
std
::
shared_ptr
<
Shader
>>
&
shaders
);
void
setSubroutines
(
gl
::
ShaderType
stage
,
std
::
vector
<
unsigned
>
indices
)
const
;
static
void
setSubroutines
(
gl
::
ShaderType
stage
,
std
::
vector
<
unsigned
>
indices
);
void
uniformUpdate
(
gl
::
UniformType
type
,
unsigned
location
,
const
void
*
data
)
const
;
unsigned
invocations
(
unsigned
global
,
unsigned
local
);
static
unsigned
invocations
(
unsigned
global
,
unsigned
local
);
template
<
typename
T
>
bool
typeValid
(
gl
::
UniformType
type
)
const
;
static
bool
typeValid
(
gl
::
UniformType
type
);
gl
::
handle
::
shader_program
m_handle
;
std
::
map
<
std
::
string
,
UniformInfo
>
m_uniforms
;
...
...
@@ -93,22 +89,22 @@ namespace glare
std
::
map
<
gl
::
ShaderType
,
std
::
vector
<
unsigned
>>
m_subroutine_bindings
;
};
template
<
>
void
Program
::
uniform
<
bool
>
(
const
std
::
string
&
name
,
const
bool
&
data
)
const
template
<
>
inline
void
Program
::
uniform
<
bool
>
(
const
std
::
string
&
name
,
const
bool
&
data
)
const
{
uniform
<
int
>
(
name
,
int
(
data
));
}
template
<
>
void
Program
::
uniform
<
glm
::
bvec2
>
(
const
std
::
string
&
name
,
const
glm
::
bvec2
&
data
)
const
template
<
>
inline
void
Program
::
uniform
<
glm
::
bvec2
>
(
const
std
::
string
&
name
,
const
glm
::
bvec2
&
data
)
const
{
uniform
<
glm
::
ivec2
>
(
name
,
data
);
}
template
<
>
void
Program
::
uniform
<
glm
::
bvec3
>
(
const
std
::
string
&
name
,
const
glm
::
bvec3
&
data
)
const
template
<
>
inline
void
Program
::
uniform
<
glm
::
bvec3
>
(
const
std
::
string
&
name
,
const
glm
::
bvec3
&
data
)
const
{
uniform
<
glm
::
ivec3
>
(
name
,
data
);
}
template
<
>
void
Program
::
uniform
<
glm
::
bvec4
>
(
const
std
::
string
&
name
,
const
glm
::
bvec4
&
data
)
const
template
<
>
inline
void
Program
::
uniform
<
glm
::
bvec4
>
(
const
std
::
string
&
name
,
const
glm
::
bvec4
&
data
)
const
{
uniform
<
glm
::
ivec4
>
(
name
,
data
);
}
...
...
@@ -130,7 +126,7 @@ namespace glare
}
template
<
typename
T
>
bool
Program
::
typeValid
(
gl
::
UniformType
type
)
const
bool
Program
::
typeValid
(
gl
::
UniformType
type
)
{
switch
(
type
)
{
...
...
src/libraries/core/base/shader.cpp
View file @
25e1e19d
...
...
@@ -5,6 +5,9 @@
#include
"shader_system.h"
#include
<gl/glew.h>
#include
<GLFW/glfw3.h>
namespace
glare
{
namespace
core
...
...
@@ -77,9 +80,9 @@ namespace glare
return
m_identifier
;
}
const
gl
::
ShaderType
Shader
::
type
()
const
gl
::
ShaderType
Shader
::
type
()
const
{
return
m_type
;
}
}
}
\ No newline at end of file
}
src/libraries/core/base/shader.h
View file @
25e1e19d
...
...
@@ -2,14 +2,9 @@
#define INCLUDE_SHADER_H
#include
<filesystem>
#include
<memory>
#include
<string>
#include
<util/opengl.h>
#include
"buffer.h"
#include
"vertex_array.h"
namespace
glare
{
namespace
core
...
...
@@ -32,7 +27,7 @@ namespace glare
unsigned
id
()
const
;
const
std
::
string
&
identifierName
()
const
;
const
gl
::
ShaderType
type
()
const
;
gl
::
ShaderType
type
()
const
;
private:
std
::
string
m_identifier
;
...
...
src/libraries/core/base/shader_system.cpp
View file @
25e1e19d
...
...
@@ -7,6 +7,9 @@
#include
<util/files.h>
#include
<util/console.h>
#include
<gl/glew.h>
#include
"GLFW/glfw3.h"
namespace
glare
{
namespace
core
...
...
@@ -74,7 +77,6 @@ namespace glare
static
std
::
string
str_required
=
"require"
;
std
::
string
current_requirement
=
""
;
ExtensionRequirement
current_enum_requirement
;
for
(
const
auto
&
character
:
source
)
{
...
...
@@ -136,7 +138,6 @@ namespace glare
requirement_stream
<<
character
;
state
=
ExtensionParseState
::
eRequirementCheckForm
;
current_requirement
=
character
==
'e'
?
str_enabled
:
str_required
;
current_enum_requirement
=
character
==
'e'
?
ExtensionRequirement
::
eEnabled
:
ExtensionRequirement
::
eRequired
;
current_requirement_position
=
0
;
break
;
}
...
...
@@ -166,7 +167,7 @@ namespace glare
state
=
ExtensionParseState
::
eNone
;
break
;
}
else
if
(
requirement_stream
.
str
()
==
str_required
)
if
(
requirement_stream
.
str
()
==
str_required
)
{
std
::
string
extension_name
=
input_stream
.
str
();
if
(
!
glfwExtensionSupported
(
extension_name
.
c_str
()))
...
...
@@ -182,14 +183,11 @@ namespace glare
state
=
ExtensionParseState
::
eNone
;
break
;
}
else
{
//Uhm... not inside the requirement string, nor at the current req. string position, nor equal to any requirement.
//So clearly malformed.
Log_Error
<<
"Extension malformed."
;
close_loop
=
true
;
break
;
}
//Uhm... not inside the requirement string, nor at the current req. string position, nor equal to any requirement.
//So clearly malformed.
Log_Error
<<
"Extension malformed."
;
close_loop
=
true
;
break
;
default:
break
;
...
...
src/libraries/core/base/shader_system.h
View file @
25e1e19d
#ifndef INCLUDE_SHADER_SYSTEM_H
#define INCLUDE_SHADER_SYSTEM_H
#include
<string>
#include
<vector>
#include
<util/opengl.h>
...
...
src/libraries/core/base/vertex_array.cpp
View file @
25e1e19d
...
...
@@ -12,7 +12,7 @@ namespace glare
gl
::
bindVertexArray
(
m_handle
);
}
void
VertexArray
::
unbind
()
const
void
VertexArray
::
unbind
()
{
gl
::
bindVertexArray
(
0
);
}
...
...
@@ -22,7 +22,7 @@ namespace glare
return
m_handle
;
}
void
VertexArray
::
linkAttribute
(
unsigned
buffer
,
size_t
buffer_offset
,
unsigned
attribute
,
size_t
components
,
gl
::
Type
type
,
bool
normalized
,
size_t
stride
,
size_t
start_index
)
void
VertexArray
::
linkAttribute
(
unsigned
buffer
,
size_t
buffer_offset
,
unsigned
attribute
,
size_t
components
,
gl
::
Type
type
,
bool
normalized
,
size_t
stride
,
size_t
start_index
)
const
{
gl
::
enableVertexArrayAttrib
(
m_handle
,
attribute
);
gl
::
vertexArrayVertexBuffer
(
m_handle
,
attribute
,
buffer
,
buffer_offset
,
stride
);
...
...
@@ -30,12 +30,12 @@ namespace glare
gl
::
vertexArrayAttribBinding
(
m_handle
,
attribute
,
attribute
);
}
void
VertexArray
::
linkAttribute
(
unsigned
buffer
,
unsigned
attribute
,
size_t
components
,
gl
::
Type
type
,
bool
normalize
,
size_t
stride
,
size_t
first_index
)
void
VertexArray
::
linkAttribute
(
unsigned
buffer
,
unsigned
attribute
,
size_t
components
,
gl
::
Type
type
,
bool
normalize
,
size_t
stride
,
size_t
first_index
)
const
{
linkAttribute
(
buffer
,
0
,
attribute
,
components
,
type
,
normalize
,
stride
,
first_index
);
}
void
VertexArray
::
linkIndices
(
unsigned
buffer
)
void
VertexArray
::
linkIndices
(
unsigned
buffer
)
const
{
gl
::
vertexArrayElementBuffer
(
m_handle
,
buffer
);
}
...
...
Prev
1
2
3
4
5
Next
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment