Add Framebuffer.character()
This commit is contained in:
parent
9e7c3ee676
commit
6b7b14d954
@ -4,6 +4,7 @@
|
|||||||
module hulk.framebuffer;
|
module hulk.framebuffer;
|
||||||
|
|
||||||
import hos.memory;
|
import hos.memory;
|
||||||
|
import hulk.kfont;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Represent a graphical frame buffer.
|
* Represent a graphical frame buffer.
|
||||||
@ -105,6 +106,20 @@ struct Framebuffer
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Draw a character.
|
||||||
|
*
|
||||||
|
* @param x X coordinate of left side of character.
|
||||||
|
* @param y Y coordinate of bottom side of character.
|
||||||
|
* @param ch Character to draw.
|
||||||
|
* @param color Color of character.
|
||||||
|
*/
|
||||||
|
void character(int x, int y, char ch, uint color)
|
||||||
|
{
|
||||||
|
const(CharInfo) * ci = &kfont.chars[ch];
|
||||||
|
blit_alpha_bitmap(x + ci.left, y + kfont.baseline_offset + ci.top - ci.height, ci.bitmap, ci.width, ci.height, color);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Blit an 8-bit alpha bitmap to the framebuffer.
|
* Blit an 8-bit alpha bitmap to the framebuffer.
|
||||||
*
|
*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user