Drawing text working using Framebuffer.blit_alpha_bitmap()
This commit is contained in:
1 parent
7562be585f
commit
2d7bf5197f
3 files changed
+17
-7
No files matched your search
@@ -8,6 +8,7 @@ import hulk.bootinfo;
|
||||
import hulk.framebuffer;
|
||||
import hos.memory;
|
||||
import ldc.attributes;
|
||||
import hulk.kfont;
|
||||
|
||||
private __gshared Framebuffer fb;
|
||||
|
||||
@@ -34,6 +35,15 @@ extern(C) void hulk_start(ulong rdi, ulong rsi, ulong rdx, BootInfo * bootinfo)
|
||||
memset32(&bootinfo.fb.buffer[y * bootinfo.fb.stride + 20u], 0x001199u, 20u);
|
||||
}
|
||||
|
||||
string message = "Hello, world! 0123456789!@#$%^&*()_-=+[]{};:\"'<>,./";
|
||||
int x = 100u;
|
||||
foreach (ch; message)
|
||||
{
|
||||
const(CharInfo) * ci = &kfont.chars[ch];
|
||||
fb.blit_alpha_bitmap(x + ci.left, 100 + ci.top - ci.height, ci.bitmap, ci.width, ci.height, 0x0088CCu);
|
||||
x += kfont.advance;
|
||||
}
|
||||
|
||||
for (;;)
|
||||
{
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user