|
|
|
@ -10,14 +10,14 @@ struct Symbol {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct Character {
|
|
|
|
|
vec4 pos;
|
|
|
|
|
vec3 pos;
|
|
|
|
|
vec4 color;
|
|
|
|
|
float size;
|
|
|
|
|
uint code;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
struct String {
|
|
|
|
|
vec4 pos;
|
|
|
|
|
vec3 pos;
|
|
|
|
|
vec4 color;
|
|
|
|
|
float size;
|
|
|
|
|
uint offset;
|
|
|
|
@ -75,11 +75,10 @@ void main() {
|
|
|
|
|
float x = 0;
|
|
|
|
|
for(uint i = 0; i < string.len; i++) {
|
|
|
|
|
Symbol symbol = font.symbol_list.symbols[push.pointers.codes.codes[string.offset + i]];
|
|
|
|
|
push.pointers.characters.characters[buffer_pos + i].pos = vec4(string.pos.xyz + vec3(x, 0, 0), 0);
|
|
|
|
|
push.pointers.characters.characters[buffer_pos + i].pos = string.pos + vec3(x, 0, 0);
|
|
|
|
|
x += string.size*symbol.advance/font.width;
|
|
|
|
|
push.pointers.characters.characters[buffer_pos + i].size = string.size;
|
|
|
|
|
push.pointers.characters.characters[buffer_pos + i].color = string.color;
|
|
|
|
|
push.pointers.characters.characters[buffer_pos + i].code = push.pointers.codes.codes[string.offset + i];
|
|
|
|
|
}
|
|
|
|
|
// Write the characters to push.pointers.characters.characters[buffer_pos:buffer_pos+string.len)
|
|
|
|
|
}
|
|
|
|
|