src/text.c

changeset 38
6e5629ea4c5c
parent 37
8a8cc6725b48
child 40
6c438be1a1fd
equal deleted inserted replaced
37:8a8cc6725b48 38:6e5629ea4c5c
37 return; 37 return;
38 } 38 }
39 39
40 // Upload model matrix 40 // Upload model matrix
41 glUniformMatrix4fv(ASC_SHADER_FONT.base.model, 1, 41 glUniformMatrix4fv(ASC_SHADER_FONT.base.model, 1,
42 GL_FALSE, node->base.transform); 42 GL_FALSE, node->base.final_transform);
43 43
44 // Upload surface 44 // Upload surface
45 glActiveTexture(GL_TEXTURE0); 45 glActiveTexture(GL_TEXTURE0);
46 glBindTexture(GL_TEXTURE_RECTANGLE, node->tex_id); 46 glBindTexture(GL_TEXTURE_RECTANGLE, node->tex_id);
47 glUniform1i(ASC_SHADER_FONT.surface, 0); 47 glUniform1i(ASC_SHADER_FONT.surface, 0);
49 // Draw mesh 49 // Draw mesh
50 asc_primitives_draw_plane(); 50 asc_primitives_draw_plane();
51 } 51 }
52 52
53 static void asc_text_update_transform(AscText *node) { 53 static void asc_text_update_transform(AscText *node) {
54 asc_transform_scale(node->base.transform, (float) node->dimension.width, (float) node->dimension.height, 0); 54 asc_transform_scale2i(node->base.local_transform, node->dimension);
55 asc_transform_translate2i(node->base.transform, node->position); 55 asc_transform_translate2i(node->base.world_transform, node->position);
56 } 56 }
57 57
58 static void asc_text_update(AscText *node) { 58 static void asc_text_update(AscText *node) {
59 // short circuit if fully transparent or hidden, we don't need anything 59 // short circuit if fully transparent or hidden, we don't need anything
60 if (node->color.alpha == 0 || node->hidden) { 60 if (node->color.alpha == 0 || node->hidden) {

mercurial