|
|
|
@ -10,27 +10,52 @@
|
|
|
|
|
VkResult test_ui(RenderContext* render, UIContext* ui) {
|
|
|
|
|
VkResult result;
|
|
|
|
|
|
|
|
|
|
VK_RESULT(load_font(0, "test.ttf", 16, VK_TRUE, render, ui));
|
|
|
|
|
|
|
|
|
|
GPUString context_strings[] = {
|
|
|
|
|
{
|
|
|
|
|
.pos = {0, 16},
|
|
|
|
|
.size = 16,
|
|
|
|
|
.pos = {0, 32},
|
|
|
|
|
.size = 32,
|
|
|
|
|
.color = {1.0, 1.0, 1.0, 1.0},
|
|
|
|
|
.offset = 0,
|
|
|
|
|
.length = strlen("Example"),
|
|
|
|
|
.length = strlen("Example Text"),
|
|
|
|
|
.font = 0,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {0, 64},
|
|
|
|
|
.size = 32,
|
|
|
|
|
.color = {1.0, 1.0, 1.0, 1.0},
|
|
|
|
|
.offset = strlen("Example Text"),
|
|
|
|
|
.length = strlen("Example Text"),
|
|
|
|
|
.font = 1,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {0, 96},
|
|
|
|
|
.size = 32,
|
|
|
|
|
.color = {1.0, 1.0, 1.0, 1.0},
|
|
|
|
|
.offset = 2*strlen("Example Text"),
|
|
|
|
|
.length = strlen("Example Text"),
|
|
|
|
|
.font = 2,
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
.pos = {0, 128},
|
|
|
|
|
.size = 32,
|
|
|
|
|
.color = {1.0, 1.0, 1.0, 1.0},
|
|
|
|
|
.offset = 3*strlen("Example Text"),
|
|
|
|
|
.length = strlen("Example Text"),
|
|
|
|
|
.font = 3,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
uint32_t context_codes[100];
|
|
|
|
|
uint32_t context_codes[256];
|
|
|
|
|
map_string("Example Text", context_codes, 0, 0, ui);
|
|
|
|
|
map_string("Example Text", context_codes, strlen("Example Text"), 1, ui);
|
|
|
|
|
map_string("Example Text", context_codes, 2*strlen("Example Text"), 2, ui);
|
|
|
|
|
map_string("Example Text", context_codes, 3*strlen("Example Text"), 3, ui);
|
|
|
|
|
|
|
|
|
|
LayerInput context_layers[] = {
|
|
|
|
|
{
|
|
|
|
|
.num_strings = 1,
|
|
|
|
|
.num_strings = sizeof(context_strings)/sizeof(GPUString),
|
|
|
|
|
.strings = context_strings,
|
|
|
|
|
.num_codes = 100,
|
|
|
|
|
.num_codes = sizeof(context_codes)/sizeof(uint32_t),
|
|
|
|
|
.codes = context_codes,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|