commit 0a28ef3d81fdfd712b1805a8bc89d47263d6f7d9
parent cff863b0c4f9b2ea651b3daa66c6afa4216fa836
Author: Brian Swetland <swetland@frotz.net>
Date: Mon, 9 Sep 2013 01:24:58 -0700
textgrid: fix a bug, remove old cruft
Diffstat:
3 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/common/assets/textgrid.glsl b/common/assets/textgrid.glsl
@@ -20,7 +20,7 @@ void main() {
int id = gl_InstanceID;
// shift unit rectangle to character cell rectangle
- pos.xy += vec2(id % cw, (ch-1) - id / ch);
+ pos.xy += vec2(id % cw, (ch-1) - id / cw);
// adjust unit texture coord to font cell rectangle
float tx = (CHARACTER % uint(16));
diff --git a/common/textgrid.cc b/common/textgrid.cc
@@ -22,19 +22,6 @@
#include "matrix.h"
#include "textgrid.h"
-#define BUILTIN 0
-
-#if BUILTIN
-#include "TextVS.h"
-#include "TextPS.h"
-#endif
-
-//static AttribInfo text_layout_desc[] = {
-// { "POSITION", 0, FMT_32x2_FLOAT, 0, 0, VERTEX_DATA, 0 },
-// { "TEXCOORD", 0, FMT_32x2_FLOAT, 0, 8, VERTEX_DATA, 0 },
-// { "CHARACTER", 0, FMT_8x1_UINT, 1, 0, INSTANCE_DATA, 1 },
-//};
-
// idx, src, dst, count, offset, stride, divisor
static VertexAttrDesc layout[] = {
{ 0, SRC_FLOAT, DST_FLOAT, 2, 0, 16, 0 },
diff --git a/hello/hello.cc b/hello/hello.cc
@@ -132,7 +132,7 @@ int TestApp::init(void) {
attr.init(layout, data, sizeof(layout) / sizeof(layout[0]));
ibuf.use();
- if (text.init(this, 64, 64))
+ if (text.init(this, width/16, height/16))
return -1;
return 0;