added BitmapFont.cpp/.h and VGA8.F16
This commit is contained in:
34
BitmapFont.cpp
Normal file
34
BitmapFont.cpp
Normal file
@@ -0,0 +1,34 @@
|
||||
#include<hgl/filesystem/FileSystem.h>
|
||||
|
||||
using namespace hgl;
|
||||
|
||||
namespace
|
||||
{
|
||||
uint8 *bitmap_font_data=nullptr;
|
||||
}//namespace
|
||||
|
||||
bool LoadBitmapFont()
|
||||
{
|
||||
if(bitmap_font_data)
|
||||
return(true);
|
||||
|
||||
bitmap_font_data=new uint8[256*16];
|
||||
|
||||
if(!filesystem::LoadFileToMemory(OS_TEXT("VGA8.F16"), (void **)&bitmap_font_data))
|
||||
return(false);
|
||||
|
||||
return(true);
|
||||
}
|
||||
|
||||
void ClearBitmapFont()
|
||||
{
|
||||
SAFE_CLEAR_ARRAY(bitmap_font_data);
|
||||
}
|
||||
|
||||
const uint GetCharWidth(){return bitmap_font_data?8:0;}
|
||||
const uint GetCharHeight(){return bitmap_font_data?16:0;}
|
||||
|
||||
const uint8 *GetBitmapChar(const char ch)
|
||||
{
|
||||
return bitmap_font_data+uchar(ch)*16;
|
||||
}
|
Reference in New Issue
Block a user