Skip to content

Commit 71b2884

Browse files
committed
use GL_TRIANGLE_STRIP in ui.cpp for #234
1 parent 8096155 commit 71b2884

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/engine/interface/ui.cpp

+6-2
Original file line numberDiff line numberDiff line change
@@ -68,10 +68,14 @@ namespace UI
6868

6969
static void quads(float x, float y, float w, float h, float tx = 0, float ty = 0, float tw = 1, float th = 1)
7070
{
71-
gle::attribf(x, y); gle::attribf(tx, ty);
71+
gle::defvertex(2);
72+
gle::deftexcoord0();
73+
gle::begin(GL_TRIANGLE_STRIP);
7274
gle::attribf(x+w, y); gle::attribf(tx+tw, ty);
75+
gle::attribf(x, y); gle::attribf(tx, ty);
7376
gle::attribf(x+w, y+h); gle::attribf(tx+tw, ty+th);
7477
gle::attribf(x, y+h); gle::attribf(tx, ty+th);
78+
gle::end();
7579
}
7680

7781
static void quad(float x, float y, float w, float h, const vec2 tc[4])
@@ -1955,7 +1959,7 @@ namespace UI
19551959

19561960
gle::defvertex(2);
19571961
gle::deftexcoord0();
1958-
gle::begin(GL_QUADS);
1962+
gle::begin(GL_TRIANGLE_STRIP);
19591963
}
19601964

19611965
void enddraw()

0 commit comments

Comments
 (0)