Readd font support (not workign yet)
This commit is contained in:
@@ -15,11 +15,21 @@ namespace PD {
|
||||
struct HorizonCtr::Impl {
|
||||
C3D_RenderTarget* Top = nullptr;
|
||||
C3D_RenderTarget* Bottom = nullptr;
|
||||
uint32_t* pSocBuf = nullptr;
|
||||
};
|
||||
|
||||
void HorizonCtr::Init() {
|
||||
if (impl) return;
|
||||
impl = new Impl();
|
||||
impl->pSocBuf = (uint32_t*)std::aligned_alloc(0x1000, 0x100000);
|
||||
if (impl->pSocBuf) {
|
||||
Result ret = socInit(impl->pSocBuf, 0x100000);
|
||||
if (R_FAILED(ret)) {
|
||||
free(impl->pSocBuf);
|
||||
impl->pSocBuf = nullptr;
|
||||
}
|
||||
}
|
||||
link3dsStdio();
|
||||
romfsInit();
|
||||
gfxInitDefault();
|
||||
consoleInit(GFX_BOTTOM, nullptr);
|
||||
@@ -41,6 +51,7 @@ void HorizonCtr::Deinit() {
|
||||
C3D_Fini();
|
||||
gfxExit();
|
||||
romfsExit();
|
||||
socExit();
|
||||
delete impl;
|
||||
impl = nullptr;
|
||||
}
|
||||
@@ -48,7 +59,9 @@ void HorizonCtr::Deinit() {
|
||||
|
||||
bool HorizonCtr::Mainloop() {
|
||||
pViewPort = ivec2(400, 240);
|
||||
return aptMainLoop();
|
||||
hidScanInput();
|
||||
bool _kill = hidKeysUp() & KEY_START;
|
||||
return aptMainLoop() && !_kill;
|
||||
}
|
||||
|
||||
void HorizonCtr::ClearViewPort() {
|
||||
|
||||
@@ -16,6 +16,8 @@ struct HorizonNX::Impl {
|
||||
void HorizonNX::Init() {
|
||||
if (impl) return;
|
||||
impl = new Impl();
|
||||
socketInitializeDefault();
|
||||
nxlinkStdio();
|
||||
romfsInit();
|
||||
glfwInit();
|
||||
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
|
||||
|
||||
Reference in New Issue
Block a user