Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenFlipper-Free
OpenFlipper
Commits
0a06c0ba
Commit
0a06c0ba
authored
May 25, 2018
by
Martin Schultz
Browse files
made the textnode render triangles instead of quads
parent
22a6e13e
Changes
1
Show whitespace changes
Inline
Side-by-side
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
)
{
...
...
@@ -501,6 +501,24 @@ updateVBO() {
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
);
// bottom right
vertexBuffer_
.
push_back
(
right
);
vertexBuffer_
.
push_back
(
0.0
f
);
...
...
@@ -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
Supports
Markdown
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