Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
acgl
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
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ACGL
acgl
Commits
bd689e63
Commit
bd689e63
authored
12 years ago
by
Janis Born
Browse files
Options
Downloads
Patches
Plain Diff
ArrayBufferControl can now define integer attributes
parent
acd92f84
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/ACGL/OpenGL/Controller/ArrayBufferControl.hh
+9
-1
9 additions, 1 deletion
include/ACGL/OpenGL/Controller/ArrayBufferControl.hh
src/ACGL/OpenGL/Controller/ArrayBufferControl.cc
+14
-6
14 additions, 6 deletions
src/ACGL/OpenGL/Controller/ArrayBufferControl.cc
with
23 additions
and
7 deletions
include/ACGL/OpenGL/Controller/ArrayBufferControl.hh
+
9
−
1
View file @
bd689e63
...
...
@@ -30,6 +30,7 @@ public:
GLenum
type
;
GLint
dimension
;
GLboolean
normalized
;
GLboolean
isInteger
;
};
// ===================================================================================================== \/
...
...
@@ -65,7 +66,14 @@ public:
inline
ArrayBufferControl
&
attribute
(
const
std
::
string
&
_name
,
GLenum
_type
,
GLint
_dimension
,
GLboolean
_normalized
=
GL_FALSE
)
{
AttributeDefine
a
=
{
_name
,
_type
,
_dimension
,
_normalized
};
AttributeDefine
a
=
{
_name
,
_type
,
_dimension
,
_normalized
,
GL_FALSE
};
mAttributeDefines
.
push_back
(
a
);
return
*
this
;
}
inline
ArrayBufferControl
&
integerAttribute
(
const
std
::
string
&
_name
,
GLenum
_type
,
GLint
_dimension
)
{
AttributeDefine
a
=
{
_name
,
_type
,
_dimension
,
GL_FALSE
,
GL_TRUE
};
mAttributeDefines
.
push_back
(
a
);
return
*
this
;
}
...
...
This diff is collapsed.
Click to expand it.
src/ACGL/OpenGL/Controller/ArrayBufferControl.cc
+
14
−
6
View file @
bd689e63
...
...
@@ -15,12 +15,22 @@ SharedArrayBuffer ArrayBufferControl::create(void)
SharedArrayBuffer
arrayBuffer
(
new
ArrayBuffer
()
);
for
(
AttributeDefineVec
::
size_type
i
=
0
;
i
<
mAttributeDefines
.
size
();
i
++
)
{
if
(
mAttributeDefines
[
i
].
isInteger
)
{
arrayBuffer
->
defineIntegerAttribute
(
mAttributeDefines
[
i
].
name
,
mAttributeDefines
[
i
].
type
,
mAttributeDefines
[
i
].
dimension
);
}
else
{
arrayBuffer
->
defineAttribute
(
mAttributeDefines
[
i
].
name
,
mAttributeDefines
[
i
].
type
,
mAttributeDefines
[
i
].
dimension
,
mAttributeDefines
[
i
].
normalized
);
}
}
if
(
mpData
!=
NULL
)
{
arrayBuffer
->
bind
();
...
...
@@ -28,5 +38,3 @@ SharedArrayBuffer ArrayBufferControl::create(void)
}
return
arrayBuffer
;
}
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