Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
0a06c0ba
Commit
0a06c0ba
authored
May 25, 2018
by
Martin Schultz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
made the textnode render triangles instead of quads
parent
22a6e13e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
libs_required/ACG/Scenegraph/TextNode.cc
libs_required/ACG/Scenegraph/TextNode.cc
+20
-2
No files found.
libs_required/ACG/Scenegraph/TextNode.cc
View file @
0a06c0ba
...
...
@@ -319,7 +319,7 @@ draw(GLState& _state, const DrawModes::DrawMode& /*_drawMode*/)
_state
.
push_modelview_matrix
();
_state
.
scale
(
size_
);
glDrawArrays
(
GL_
QUAD
S
,
0
,
int
(
text_
.
size
()
*
4
)
);
glDrawArrays
(
GL_
TRIANGLE
S
,
0
,
int
(
text_
.
size
()
*
4
)
);
_state
.
pop_modelview_matrix
();
if
(
textMode_
==
SCREEN_ALIGNED
||
textMode_
==
SCREEN_ALIGNED_STATIC_SIZE
)
{
...
...
@@ -497,6 +497,24 @@ updateVBO() {
vertexBuffer_
.
push_back
(
avgWidth
*
0.15
);
vertexBuffer_
.
push_back
(
0.0
f
);
// texture coordinates
vertexBuffer_
.
push_back
(
rightTx
);
vertexBuffer_
.
push_back
(
topTx
);
// bottom left
vertexBuffer_
.
push_back
(
left
);
vertexBuffer_
.
push_back
(
0.0
f
);
vertexBuffer_
.
push_back
(
0.0
f
);
// texture coordinates
vertexBuffer_
.
push_back
(
leftTx
);
vertexBuffer_
.
push_back
(
bottomTx
);
// top right
vertexBuffer_
.
push_back
(
right
);
vertexBuffer_
.
push_back
(
avgWidth
*
0.15
);
vertexBuffer_
.
push_back
(
0.0
f
);
// texture coordinates
vertexBuffer_
.
push_back
(
rightTx
);
vertexBuffer_
.
push_back
(
topTx
);
...
...
@@ -623,7 +641,7 @@ getRenderObjects(ACG::IRenderer* _renderer, ACG::GLState& _state , const ACG::S
localMaterial
.
specularColor
(
ACG
::
Vec4f
(
0.0
,
0.0
,
0.0
,
0.0
));
ro
.
setMaterial
(
&
localMaterial
);
ro
.
glDrawArrays
(
GL_
QUAD
S
,
0
,
static_cast
<
GLsizei
>
(
text_
.
size
())
*
4
);
ro
.
glDrawArrays
(
GL_
TRIANGLE
S
,
0
,
static_cast
<
GLsizei
>
(
text_
.
size
())
*
4
);
_renderer
->
addRenderObject
(
&
ro
);
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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