修复文字显示bug
This commit is contained in:
parent
25e6159176
commit
96a744bde0
|
|
@ -7,24 +7,30 @@ layout(location = 2) in vec2 inTexCoord;
|
|||
layout(location = 0) out vec4 fragColor;
|
||||
layout(location = 1) out vec2 fragTexCoord;
|
||||
|
||||
layout(binding = 0) uniform UniformBufferObject {
|
||||
float time;
|
||||
vec2 resolution;
|
||||
float rotation;
|
||||
float wavePhase;
|
||||
// Use std140 layout and separate floats instead of vec2 to avoid alignment issues
|
||||
layout(binding = 0, std140) uniform UniformBufferObject {
|
||||
float time; // offset 0
|
||||
float resX; // offset 4
|
||||
float resY; // offset 8
|
||||
float rotation; // offset 12
|
||||
float wavePhase; // offset 16
|
||||
float padding1; // offset 20
|
||||
float padding2; // offset 24
|
||||
} ubo;
|
||||
|
||||
void main() {
|
||||
// Transform position from pixel coordinates to normalized device coordinates
|
||||
// Input position is in pixel coordinates (0,0 = top-left)
|
||||
vec2 pos = inPosition;
|
||||
|
||||
// Convert to NDC: (0, 0) to (width, height) -> (-1, -1) to (1, 1)
|
||||
vec2 ndc = (pos / ubo.resolution) * 2.0 - 1.0;
|
||||
// Note: Vulkan NDC has Y pointing down, but we want traditional Y-up
|
||||
float ndcX = (pos.x / ubo.resX) * 2.0 - 1.0;
|
||||
float ndcY = (pos.y / ubo.resY) * 2.0 - 1.0;
|
||||
|
||||
// Flip Y axis (Vulkan has Y down, we want Y up for easier math)
|
||||
ndc.y = -ndc.y;
|
||||
// NO Y-flip needed here - text coordinates are already in screen space
|
||||
// where (0,0) is top-left, which matches Vulkan's framebuffer coordinates
|
||||
gl_Position = vec4(ndcX, ndcY, 0.0, 1.0);
|
||||
|
||||
gl_Position = vec4(ndc, 0.0, 1.0);
|
||||
fragColor = inColor;
|
||||
fragTexCoord = inTexCoord;
|
||||
}
|
||||
|
|
|
|||
Binary file not shown.
|
|
@ -1,60 +1,67 @@
|
|||
// Auto-generated from text.vert.spv
|
||||
// Size: 1840 bytes (460 words)
|
||||
0x07230203u, 0x00010000u, 0x0008000bu, 0x00000039u, 0x00000000u, 0x00020011u, 0x00000001u, 0x0006000bu,
|
||||
// Size: 2080 bytes (520 words)
|
||||
0x07230203u, 0x00010000u, 0x0008000bu, 0x0000003eu, 0x00000000u, 0x00020011u, 0x00000001u, 0x0006000bu,
|
||||
0x00000001u, 0x4c534c47u, 0x6474732eu, 0x3035342eu, 0x00000000u, 0x0003000eu, 0x00000000u, 0x00000001u,
|
||||
0x000b000fu, 0x00000000u, 0x00000004u, 0x6e69616du, 0x00000000u, 0x0000000bu, 0x00000028u, 0x00000031u,
|
||||
0x00000033u, 0x00000036u, 0x00000037u, 0x00030003u, 0x00000002u, 0x000001c2u, 0x00040005u, 0x00000004u,
|
||||
0x000b000fu, 0x00000000u, 0x00000004u, 0x6e69616du, 0x00000000u, 0x0000000bu, 0x0000002eu, 0x00000036u,
|
||||
0x00000038u, 0x0000003bu, 0x0000003cu, 0x00030003u, 0x00000002u, 0x000001c2u, 0x00040005u, 0x00000004u,
|
||||
0x6e69616du, 0x00000000u, 0x00030005u, 0x00000009u, 0x00736f70u, 0x00050005u, 0x0000000bu, 0x6f506e69u,
|
||||
0x69746973u, 0x00006e6fu, 0x00030005u, 0x0000000du, 0x0063646eu, 0x00070005u, 0x0000000fu, 0x66696e55u,
|
||||
0x426d726fu, 0x65666675u, 0x6a624f72u, 0x00746365u, 0x00050006u, 0x0000000fu, 0x00000000u, 0x656d6974u,
|
||||
0x00000000u, 0x00060006u, 0x0000000fu, 0x00000001u, 0x6f736572u, 0x6974756cu, 0x00006e6fu, 0x00060006u,
|
||||
0x0000000fu, 0x00000002u, 0x61746f72u, 0x6e6f6974u, 0x00000000u, 0x00060006u, 0x0000000fu, 0x00000003u,
|
||||
0x65766177u, 0x73616850u, 0x00000065u, 0x00030005u, 0x00000011u, 0x006f6275u, 0x00060005u, 0x00000026u,
|
||||
0x505f6c67u, 0x65567265u, 0x78657472u, 0x00000000u, 0x00060006u, 0x00000026u, 0x00000000u, 0x505f6c67u,
|
||||
0x7469736fu, 0x006e6f69u, 0x00070006u, 0x00000026u, 0x00000001u, 0x505f6c67u, 0x746e696fu, 0x657a6953u,
|
||||
0x00000000u, 0x00070006u, 0x00000026u, 0x00000002u, 0x435f6c67u, 0x4470696cu, 0x61747369u, 0x0065636eu,
|
||||
0x00070006u, 0x00000026u, 0x00000003u, 0x435f6c67u, 0x446c6c75u, 0x61747369u, 0x0065636eu, 0x00030005u,
|
||||
0x00000028u, 0x00000000u, 0x00050005u, 0x00000031u, 0x67617266u, 0x6f6c6f43u, 0x00000072u, 0x00040005u,
|
||||
0x00000033u, 0x6f436e69u, 0x00726f6cu, 0x00060005u, 0x00000036u, 0x67617266u, 0x43786554u, 0x64726f6fu,
|
||||
0x00000000u, 0x00050005u, 0x00000037u, 0x65546e69u, 0x6f6f4378u, 0x00006472u, 0x00040047u, 0x0000000bu,
|
||||
0x0000001eu, 0x00000000u, 0x00050048u, 0x0000000fu, 0x00000000u, 0x00000023u, 0x00000000u, 0x00050048u,
|
||||
0x0000000fu, 0x00000001u, 0x00000023u, 0x00000008u, 0x00050048u, 0x0000000fu, 0x00000002u, 0x00000023u,
|
||||
0x00000010u, 0x00050048u, 0x0000000fu, 0x00000003u, 0x00000023u, 0x00000014u, 0x00030047u, 0x0000000fu,
|
||||
0x00000002u, 0x00040047u, 0x00000011u, 0x00000022u, 0x00000000u, 0x00040047u, 0x00000011u, 0x00000021u,
|
||||
0x00000000u, 0x00050048u, 0x00000026u, 0x00000000u, 0x0000000bu, 0x00000000u, 0x00050048u, 0x00000026u,
|
||||
0x00000001u, 0x0000000bu, 0x00000001u, 0x00050048u, 0x00000026u, 0x00000002u, 0x0000000bu, 0x00000003u,
|
||||
0x00050048u, 0x00000026u, 0x00000003u, 0x0000000bu, 0x00000004u, 0x00030047u, 0x00000026u, 0x00000002u,
|
||||
0x00040047u, 0x00000031u, 0x0000001eu, 0x00000000u, 0x00040047u, 0x00000033u, 0x0000001eu, 0x00000001u,
|
||||
0x00040047u, 0x00000036u, 0x0000001eu, 0x00000001u, 0x00040047u, 0x00000037u, 0x0000001eu, 0x00000002u,
|
||||
0x00020013u, 0x00000002u, 0x00030021u, 0x00000003u, 0x00000002u, 0x00030016u, 0x00000006u, 0x00000020u,
|
||||
0x00040017u, 0x00000007u, 0x00000006u, 0x00000002u, 0x00040020u, 0x00000008u, 0x00000007u, 0x00000007u,
|
||||
0x00040020u, 0x0000000au, 0x00000001u, 0x00000007u, 0x0004003bu, 0x0000000au, 0x0000000bu, 0x00000001u,
|
||||
0x0006001eu, 0x0000000fu, 0x00000006u, 0x00000007u, 0x00000006u, 0x00000006u, 0x00040020u, 0x00000010u,
|
||||
0x00000002u, 0x0000000fu, 0x0004003bu, 0x00000010u, 0x00000011u, 0x00000002u, 0x00040015u, 0x00000012u,
|
||||
0x00000020u, 0x00000001u, 0x0004002bu, 0x00000012u, 0x00000013u, 0x00000001u, 0x00040020u, 0x00000014u,
|
||||
0x00000002u, 0x00000007u, 0x0004002bu, 0x00000006u, 0x00000018u, 0x40000000u, 0x0004002bu, 0x00000006u,
|
||||
0x0000001au, 0x3f800000u, 0x00040015u, 0x0000001du, 0x00000020u, 0x00000000u, 0x0004002bu, 0x0000001du,
|
||||
0x0000001eu, 0x00000001u, 0x00040020u, 0x0000001fu, 0x00000007u, 0x00000006u, 0x00040017u, 0x00000024u,
|
||||
0x00000006u, 0x00000004u, 0x0004001cu, 0x00000025u, 0x00000006u, 0x0000001eu, 0x0006001eu, 0x00000026u,
|
||||
0x00000024u, 0x00000006u, 0x00000025u, 0x00000025u, 0x00040020u, 0x00000027u, 0x00000003u, 0x00000026u,
|
||||
0x0004003bu, 0x00000027u, 0x00000028u, 0x00000003u, 0x0004002bu, 0x00000012u, 0x00000029u, 0x00000000u,
|
||||
0x0004002bu, 0x00000006u, 0x0000002bu, 0x00000000u, 0x00040020u, 0x0000002fu, 0x00000003u, 0x00000024u,
|
||||
0x0004003bu, 0x0000002fu, 0x00000031u, 0x00000003u, 0x00040020u, 0x00000032u, 0x00000001u, 0x00000024u,
|
||||
0x0004003bu, 0x00000032u, 0x00000033u, 0x00000001u, 0x00040020u, 0x00000035u, 0x00000003u, 0x00000007u,
|
||||
0x0004003bu, 0x00000035u, 0x00000036u, 0x00000003u, 0x0004003bu, 0x0000000au, 0x00000037u, 0x00000001u,
|
||||
0x00050036u, 0x00000002u, 0x00000004u, 0x00000000u, 0x00000003u, 0x000200f8u, 0x00000005u, 0x0004003bu,
|
||||
0x00000008u, 0x00000009u, 0x00000007u, 0x0004003bu, 0x00000008u, 0x0000000du, 0x00000007u, 0x0004003du,
|
||||
0x00000007u, 0x0000000cu, 0x0000000bu, 0x0003003eu, 0x00000009u, 0x0000000cu, 0x0004003du, 0x00000007u,
|
||||
0x0000000eu, 0x00000009u, 0x00050041u, 0x00000014u, 0x00000015u, 0x00000011u, 0x00000013u, 0x0004003du,
|
||||
0x00000007u, 0x00000016u, 0x00000015u, 0x00050088u, 0x00000007u, 0x00000017u, 0x0000000eu, 0x00000016u,
|
||||
0x0005008eu, 0x00000007u, 0x00000019u, 0x00000017u, 0x00000018u, 0x00050050u, 0x00000007u, 0x0000001bu,
|
||||
0x0000001au, 0x0000001au, 0x00050083u, 0x00000007u, 0x0000001cu, 0x00000019u, 0x0000001bu, 0x0003003eu,
|
||||
0x0000000du, 0x0000001cu, 0x00050041u, 0x0000001fu, 0x00000020u, 0x0000000du, 0x0000001eu, 0x0004003du,
|
||||
0x00000006u, 0x00000021u, 0x00000020u, 0x0004007fu, 0x00000006u, 0x00000022u, 0x00000021u, 0x00050041u,
|
||||
0x0000001fu, 0x00000023u, 0x0000000du, 0x0000001eu, 0x0003003eu, 0x00000023u, 0x00000022u, 0x0004003du,
|
||||
0x00000007u, 0x0000002au, 0x0000000du, 0x00050051u, 0x00000006u, 0x0000002cu, 0x0000002au, 0x00000000u,
|
||||
0x00050051u, 0x00000006u, 0x0000002du, 0x0000002au, 0x00000001u, 0x00070050u, 0x00000024u, 0x0000002eu,
|
||||
0x0000002cu, 0x0000002du, 0x0000002bu, 0x0000001au, 0x00050041u, 0x0000002fu, 0x00000030u, 0x00000028u,
|
||||
0x00000029u, 0x0003003eu, 0x00000030u, 0x0000002eu, 0x0004003du, 0x00000024u, 0x00000034u, 0x00000033u,
|
||||
0x0003003eu, 0x00000031u, 0x00000034u, 0x0004003du, 0x00000007u, 0x00000038u, 0x00000037u, 0x0003003eu,
|
||||
0x00000036u, 0x00000038u, 0x000100fdu, 0x00010038u
|
||||
0x69746973u, 0x00006e6fu, 0x00040005u, 0x0000000eu, 0x5863646eu, 0x00000000u, 0x00070005u, 0x00000013u,
|
||||
0x66696e55u, 0x426d726fu, 0x65666675u, 0x6a624f72u, 0x00746365u, 0x00050006u, 0x00000013u, 0x00000000u,
|
||||
0x656d6974u, 0x00000000u, 0x00050006u, 0x00000013u, 0x00000001u, 0x58736572u, 0x00000000u, 0x00050006u,
|
||||
0x00000013u, 0x00000002u, 0x59736572u, 0x00000000u, 0x00060006u, 0x00000013u, 0x00000003u, 0x61746f72u,
|
||||
0x6e6f6974u, 0x00000000u, 0x00060006u, 0x00000013u, 0x00000004u, 0x65766177u, 0x73616850u, 0x00000065u,
|
||||
0x00060006u, 0x00000013u, 0x00000005u, 0x64646170u, 0x31676e69u, 0x00000000u, 0x00060006u, 0x00000013u,
|
||||
0x00000006u, 0x64646170u, 0x32676e69u, 0x00000000u, 0x00030005u, 0x00000015u, 0x006f6275u, 0x00040005u,
|
||||
0x00000020u, 0x5963646eu, 0x00000000u, 0x00060005u, 0x0000002cu, 0x505f6c67u, 0x65567265u, 0x78657472u,
|
||||
0x00000000u, 0x00060006u, 0x0000002cu, 0x00000000u, 0x505f6c67u, 0x7469736fu, 0x006e6f69u, 0x00070006u,
|
||||
0x0000002cu, 0x00000001u, 0x505f6c67u, 0x746e696fu, 0x657a6953u, 0x00000000u, 0x00070006u, 0x0000002cu,
|
||||
0x00000002u, 0x435f6c67u, 0x4470696cu, 0x61747369u, 0x0065636eu, 0x00070006u, 0x0000002cu, 0x00000003u,
|
||||
0x435f6c67u, 0x446c6c75u, 0x61747369u, 0x0065636eu, 0x00030005u, 0x0000002eu, 0x00000000u, 0x00050005u,
|
||||
0x00000036u, 0x67617266u, 0x6f6c6f43u, 0x00000072u, 0x00040005u, 0x00000038u, 0x6f436e69u, 0x00726f6cu,
|
||||
0x00060005u, 0x0000003bu, 0x67617266u, 0x43786554u, 0x64726f6fu, 0x00000000u, 0x00050005u, 0x0000003cu,
|
||||
0x65546e69u, 0x6f6f4378u, 0x00006472u, 0x00040047u, 0x0000000bu, 0x0000001eu, 0x00000000u, 0x00050048u,
|
||||
0x00000013u, 0x00000000u, 0x00000023u, 0x00000000u, 0x00050048u, 0x00000013u, 0x00000001u, 0x00000023u,
|
||||
0x00000004u, 0x00050048u, 0x00000013u, 0x00000002u, 0x00000023u, 0x00000008u, 0x00050048u, 0x00000013u,
|
||||
0x00000003u, 0x00000023u, 0x0000000cu, 0x00050048u, 0x00000013u, 0x00000004u, 0x00000023u, 0x00000010u,
|
||||
0x00050048u, 0x00000013u, 0x00000005u, 0x00000023u, 0x00000014u, 0x00050048u, 0x00000013u, 0x00000006u,
|
||||
0x00000023u, 0x00000018u, 0x00030047u, 0x00000013u, 0x00000002u, 0x00040047u, 0x00000015u, 0x00000022u,
|
||||
0x00000000u, 0x00040047u, 0x00000015u, 0x00000021u, 0x00000000u, 0x00050048u, 0x0000002cu, 0x00000000u,
|
||||
0x0000000bu, 0x00000000u, 0x00050048u, 0x0000002cu, 0x00000001u, 0x0000000bu, 0x00000001u, 0x00050048u,
|
||||
0x0000002cu, 0x00000002u, 0x0000000bu, 0x00000003u, 0x00050048u, 0x0000002cu, 0x00000003u, 0x0000000bu,
|
||||
0x00000004u, 0x00030047u, 0x0000002cu, 0x00000002u, 0x00040047u, 0x00000036u, 0x0000001eu, 0x00000000u,
|
||||
0x00040047u, 0x00000038u, 0x0000001eu, 0x00000001u, 0x00040047u, 0x0000003bu, 0x0000001eu, 0x00000001u,
|
||||
0x00040047u, 0x0000003cu, 0x0000001eu, 0x00000002u, 0x00020013u, 0x00000002u, 0x00030021u, 0x00000003u,
|
||||
0x00000002u, 0x00030016u, 0x00000006u, 0x00000020u, 0x00040017u, 0x00000007u, 0x00000006u, 0x00000002u,
|
||||
0x00040020u, 0x00000008u, 0x00000007u, 0x00000007u, 0x00040020u, 0x0000000au, 0x00000001u, 0x00000007u,
|
||||
0x0004003bu, 0x0000000au, 0x0000000bu, 0x00000001u, 0x00040020u, 0x0000000du, 0x00000007u, 0x00000006u,
|
||||
0x00040015u, 0x0000000fu, 0x00000020u, 0x00000000u, 0x0004002bu, 0x0000000fu, 0x00000010u, 0x00000000u,
|
||||
0x0009001eu, 0x00000013u, 0x00000006u, 0x00000006u, 0x00000006u, 0x00000006u, 0x00000006u, 0x00000006u,
|
||||
0x00000006u, 0x00040020u, 0x00000014u, 0x00000002u, 0x00000013u, 0x0004003bu, 0x00000014u, 0x00000015u,
|
||||
0x00000002u, 0x00040015u, 0x00000016u, 0x00000020u, 0x00000001u, 0x0004002bu, 0x00000016u, 0x00000017u,
|
||||
0x00000001u, 0x00040020u, 0x00000018u, 0x00000002u, 0x00000006u, 0x0004002bu, 0x00000006u, 0x0000001cu,
|
||||
0x40000000u, 0x0004002bu, 0x00000006u, 0x0000001eu, 0x3f800000u, 0x0004002bu, 0x0000000fu, 0x00000021u,
|
||||
0x00000001u, 0x0004002bu, 0x00000016u, 0x00000024u, 0x00000002u, 0x00040017u, 0x0000002au, 0x00000006u,
|
||||
0x00000004u, 0x0004001cu, 0x0000002bu, 0x00000006u, 0x00000021u, 0x0006001eu, 0x0000002cu, 0x0000002au,
|
||||
0x00000006u, 0x0000002bu, 0x0000002bu, 0x00040020u, 0x0000002du, 0x00000003u, 0x0000002cu, 0x0004003bu,
|
||||
0x0000002du, 0x0000002eu, 0x00000003u, 0x0004002bu, 0x00000016u, 0x0000002fu, 0x00000000u, 0x0004002bu,
|
||||
0x00000006u, 0x00000032u, 0x00000000u, 0x00040020u, 0x00000034u, 0x00000003u, 0x0000002au, 0x0004003bu,
|
||||
0x00000034u, 0x00000036u, 0x00000003u, 0x00040020u, 0x00000037u, 0x00000001u, 0x0000002au, 0x0004003bu,
|
||||
0x00000037u, 0x00000038u, 0x00000001u, 0x00040020u, 0x0000003au, 0x00000003u, 0x00000007u, 0x0004003bu,
|
||||
0x0000003au, 0x0000003bu, 0x00000003u, 0x0004003bu, 0x0000000au, 0x0000003cu, 0x00000001u, 0x00050036u,
|
||||
0x00000002u, 0x00000004u, 0x00000000u, 0x00000003u, 0x000200f8u, 0x00000005u, 0x0004003bu, 0x00000008u,
|
||||
0x00000009u, 0x00000007u, 0x0004003bu, 0x0000000du, 0x0000000eu, 0x00000007u, 0x0004003bu, 0x0000000du,
|
||||
0x00000020u, 0x00000007u, 0x0004003du, 0x00000007u, 0x0000000cu, 0x0000000bu, 0x0003003eu, 0x00000009u,
|
||||
0x0000000cu, 0x00050041u, 0x0000000du, 0x00000011u, 0x00000009u, 0x00000010u, 0x0004003du, 0x00000006u,
|
||||
0x00000012u, 0x00000011u, 0x00050041u, 0x00000018u, 0x00000019u, 0x00000015u, 0x00000017u, 0x0004003du,
|
||||
0x00000006u, 0x0000001au, 0x00000019u, 0x00050088u, 0x00000006u, 0x0000001bu, 0x00000012u, 0x0000001au,
|
||||
0x00050085u, 0x00000006u, 0x0000001du, 0x0000001bu, 0x0000001cu, 0x00050083u, 0x00000006u, 0x0000001fu,
|
||||
0x0000001du, 0x0000001eu, 0x0003003eu, 0x0000000eu, 0x0000001fu, 0x00050041u, 0x0000000du, 0x00000022u,
|
||||
0x00000009u, 0x00000021u, 0x0004003du, 0x00000006u, 0x00000023u, 0x00000022u, 0x00050041u, 0x00000018u,
|
||||
0x00000025u, 0x00000015u, 0x00000024u, 0x0004003du, 0x00000006u, 0x00000026u, 0x00000025u, 0x00050088u,
|
||||
0x00000006u, 0x00000027u, 0x00000023u, 0x00000026u, 0x00050085u, 0x00000006u, 0x00000028u, 0x00000027u,
|
||||
0x0000001cu, 0x00050083u, 0x00000006u, 0x00000029u, 0x00000028u, 0x0000001eu, 0x0003003eu, 0x00000020u,
|
||||
0x00000029u, 0x0004003du, 0x00000006u, 0x00000030u, 0x0000000eu, 0x0004003du, 0x00000006u, 0x00000031u,
|
||||
0x00000020u, 0x00070050u, 0x0000002au, 0x00000033u, 0x00000030u, 0x00000031u, 0x00000032u, 0x0000001eu,
|
||||
0x00050041u, 0x00000034u, 0x00000035u, 0x0000002eu, 0x0000002fu, 0x0003003eu, 0x00000035u, 0x00000033u,
|
||||
0x0004003du, 0x0000002au, 0x00000039u, 0x00000038u, 0x0003003eu, 0x00000036u, 0x00000039u, 0x0004003du,
|
||||
0x00000007u, 0x0000003du, 0x0000003cu, 0x0003003eu, 0x0000003bu, 0x0000003du, 0x000100fdu, 0x00010038u
|
||||
|
|
|
|||
|
|
@ -2305,16 +2305,16 @@ void VulkanRenderer::drawText(VkCommandBuffer commandBuffer, int frameCount,
|
|||
std::string title = "PAINTING DISABLED";
|
||||
std::string subtitle = "(Screen Locked)";
|
||||
|
||||
generateTextQuads(title, m_width / 2.0f - 250.0f, m_height / 2.0f - 50.0f, 1.2f, white, vertices, indices);
|
||||
generateTextQuads(subtitle, m_width / 2.0f - 180.0f, m_height / 2.0f + 30.0f, 0.9f, gray, vertices, indices);
|
||||
generateTextQuads(title, m_width / 2.0f - 250.0f, m_height / 2.0f - 50.0f, 0.6f, white, vertices, indices);
|
||||
generateTextQuads(subtitle, m_width / 2.0f - 180.0f, m_height / 2.0f + 30.0f, 0.5f, gray, vertices, indices);
|
||||
|
||||
// Stats
|
||||
std::string stats = "Total Frames Painted: " + std::to_string(frameCount);
|
||||
generateTextQuads(stats, 20.0f, m_height - 60.0f, 0.7f, gray, vertices, indices);
|
||||
generateTextQuads(stats, 20.0f, m_height - 60.0f, 0.3f, gray, vertices, indices);
|
||||
} else {
|
||||
// Active rendering state
|
||||
std::string title = "Screen Lock Detector - Painting Active";
|
||||
generateTextQuads(title, m_width / 2.0f - 350.0f, 30.0f, 0.8f, white, vertices, indices);
|
||||
generateTextQuads(title, m_width / 2.0f - 150.0f, 30.0f, 0.4f, white, vertices, indices);
|
||||
|
||||
// Stats info box
|
||||
std::string frameStr = "Frame Count: " + std::to_string(frameCount);
|
||||
|
|
@ -2322,15 +2322,15 @@ void VulkanRenderer::drawText(VkCommandBuffer commandBuffer, int frameCount,
|
|||
std::string rotStr = "Rotation: " + std::to_string((int)m_ubo.rotation) + "°";
|
||||
std::string timeStr = "Running Time: " + std::to_string((int)m_ubo.time) + "s";
|
||||
|
||||
generateTextQuads(frameStr, 20.0f, 90.0f, 0.6f, green, vertices, indices);
|
||||
generateTextQuads(fpsStr, 20.0f, 130.0f, 0.6f, green, vertices, indices);
|
||||
generateTextQuads(rotStr, 20.0f, 170.0f, 0.6f, green, vertices, indices);
|
||||
generateTextQuads(timeStr, 20.0f, 210.0f, 0.6f, green, vertices, indices);
|
||||
generateTextQuads(frameStr, 20.0f, 90.0f, 0.3f, green, vertices, indices);
|
||||
generateTextQuads(fpsStr, 20.0f, 130.0f, 0.3f, green, vertices, indices);
|
||||
generateTextQuads(rotStr, 20.0f, 170.0f, 0.3f, green, vertices, indices);
|
||||
generateTextQuads(timeStr, 20.0f, 210.0f, 0.3f, green, vertices, indices);
|
||||
|
||||
// Lock info (if available)
|
||||
if (!lockInfo.empty()) {
|
||||
std::string lockTitle = "Last Lock Info:";
|
||||
generateTextQuads(lockTitle, 20.0f, 270.0f, 0.65f, magenta, vertices, indices);
|
||||
generateTextQuads(lockTitle, 20.0f, 270.0f, 0.3f, magenta, vertices, indices);
|
||||
|
||||
// Parse lock info (assuming format from lockInfo string)
|
||||
size_t pos = 0;
|
||||
|
|
@ -2339,19 +2339,19 @@ void VulkanRenderer::drawText(VkCommandBuffer commandBuffer, int frameCount,
|
|||
while ((pos = info.find('\n')) != std::string::npos) {
|
||||
std::string token = info.substr(0, pos);
|
||||
if (!token.empty()) {
|
||||
generateTextQuads(token, 20.0f, 310.0f + line * 40.0f, 0.5f, magenta, vertices, indices);
|
||||
generateTextQuads(token, 20.0f, 310.0f + line * 40.0f, 0.2f, magenta, vertices, indices);
|
||||
line++;
|
||||
}
|
||||
info.erase(0, pos + 1);
|
||||
}
|
||||
if (!info.empty()) {
|
||||
generateTextQuads(info, 20.0f, 310.0f + line * 40.0f, 0.5f, magenta, vertices, indices);
|
||||
generateTextQuads(info, 20.0f, 310.0f + line * 40.0f, 0.2f, magenta, vertices, indices);
|
||||
}
|
||||
}
|
||||
|
||||
// Hint at bottom
|
||||
std::string hint = "Lock your screen to see the painting stop automatically!";
|
||||
generateTextQuads(hint, m_width / 2.0f - 420.0f, m_height - 50.0f, 0.65f, yellow, vertices, indices);
|
||||
generateTextQuads(hint, m_width / 2.0f - 420.0f, m_height - 50.0f, 0.3f, yellow, vertices, indices);
|
||||
}
|
||||
|
||||
// Create temporary buffers for text
|
||||
|
|
|
|||
Loading…
Reference in New Issue