comparison tests/test_text.nim @ 1282:3308b88e53a6

did: undo part of stupid API renaming a few weeks back ;(
author sam <sam@basx.dev>
date Mon, 29 Jul 2024 16:05:09 +0700
parents c09cdff9a97e
children 0369fa1ffbd9
comparison
equal deleted inserted replaced
1281:c09cdff9a97e 1282:3308b88e53a6
12 proc test_01_static_label(time: float32) = 12 proc test_01_static_label(time: float32) =
13 var renderdata = InitRenderData() 13 var renderdata = InitRenderData()
14 14
15 var pipeline = CreatePipeline[DefaultFontShader](renderPass = vulkan.swapchain.renderPass) 15 var pipeline = CreatePipeline[DefaultFontShader](renderPass = vulkan.swapchain.renderPass)
16 16
17 var font = LoadFont("Overhaul.ttf", lineHeightPixels = 160) 17 var font = loadFont("Overhaul.ttf", lineHeightPixels = 160)
18 var label1 = InitTextbox( 18 var label1 = InitTextbox(
19 renderdata, 19 renderdata,
20 pipeline.descriptorSetLayouts[0], 20 pipeline.descriptorSetLayouts[0],
21 font, 21 font,
22 "Hello semicongine!", 22 "Hello semicongine!",
40 proc test_02_multiple_animated(time: float32) = 40 proc test_02_multiple_animated(time: float32) =
41 var renderdata = InitRenderData() 41 var renderdata = InitRenderData()
42 42
43 var pipeline = CreatePipeline[DefaultFontShader](renderPass = vulkan.swapchain.renderPass) 43 var pipeline = CreatePipeline[DefaultFontShader](renderPass = vulkan.swapchain.renderPass)
44 44
45 var font1 = LoadFont("Overhaul.ttf", lineHeightPixels = 40) 45 var font1 = loadFont("Overhaul.ttf", lineHeightPixels = 40)
46 var font2 = LoadFont("Overhaul.ttf", lineHeightPixels = 160) 46 var font2 = loadFont("Overhaul.ttf", lineHeightPixels = 160)
47 var font3 = LoadFont("DejaVuSans.ttf", lineHeightPixels = 160) 47 var font3 = loadFont("DejaVuSans.ttf", lineHeightPixels = 160)
48 var labels = [ 48 var labels = [
49 InitTextbox( 49 InitTextbox(
50 renderdata, 50 renderdata,
51 pipeline.descriptorSetLayouts[0], 51 pipeline.descriptorSetLayouts[0],
52 font1, 52 font1,
102 proc test_03_layouting(time: float32) = 102 proc test_03_layouting(time: float32) =
103 var renderdata = InitRenderData() 103 var renderdata = InitRenderData()
104 104
105 var pipeline = CreatePipeline[DefaultFontShader](renderPass = vulkan.swapchain.renderPass) 105 var pipeline = CreatePipeline[DefaultFontShader](renderPass = vulkan.swapchain.renderPass)
106 106
107 var font = LoadFont("DejaVuSans.ttf", lineHeightPixels = 40) 107 var font = loadFont("DejaVuSans.ttf", lineHeightPixels = 40)
108 var labels: seq[Textbox] 108 var labels: seq[Textbox]
109 109
110 for horizontal in HorizontalAlignment: 110 for horizontal in HorizontalAlignment:
111 labels.add InitTextbox( 111 labels.add InitTextbox(
112 renderdata, 112 renderdata,
163 proc test_04_lots_of_texts(time: float32) = 163 proc test_04_lots_of_texts(time: float32) =
164 var renderdata = InitRenderData() 164 var renderdata = InitRenderData()
165 165
166 var pipeline = CreatePipeline[DefaultFontShader](renderPass = vulkan.swapchain.renderPass) 166 var pipeline = CreatePipeline[DefaultFontShader](renderPass = vulkan.swapchain.renderPass)
167 167
168 var font = LoadFont("DejaVuSans.ttf", lineHeightPixels = 160) 168 var font = loadFont("DejaVuSans.ttf", lineHeightPixels = 160)
169 var labels: seq[Textbox] 169 var labels: seq[Textbox]
170 for i in 0 ..< 100: 170 for i in 0 ..< 100:
171 labels.add InitTextbox( 171 labels.add InitTextbox(
172 renderdata, 172 renderdata,
173 pipeline.descriptorSetLayouts[0], 173 pipeline.descriptorSetLayouts[0],