bool nuiInit(void* OSHandle = NULL, nuiKernel* pKernel) { if (gNUIReferences == 0) { #ifdef WIN32 WSADATA wsaData; // if this doesn't work //WSAData wsaData; // then try this instead // MAKEWORD(1,1) for Winsock 1.1, MAKEWORD(2,0) for Winsock 2.0: int res = WSAStartup(MAKEWORD(1,1), &wsaData); #endif if (!App) { #ifdef _WIN32_ App = new nuiManualKernel(OSHandle, pKernel); #elif defined(_ANDROID_) App = new nuiManualKernel(OSHandle, pKernel); #else App = new nuiManualKernel(pKernel); #endif App->CallOnInit(); } // On iOS, init an AutoReleasePool: #if defined(_UIKIT_) nui_autoreleasepool = [[NSAutoreleasePool alloc] init]; #endif #ifndef _MINUI3_ // Init the texture manager: nuiTexture::InitTextures(); // Init the font manager: nglPath fontdb(ePathUserAppSettings); fontdb += nglString(NUI_FONTDB_PATH); nuiFontManager::InitManager(fontdb); if (fontdb.Exists() && fontdb.IsLeaf()) { nglIFile db(fontdb); nuiFontManager::LoadManager(db, fontdb.GetLastMod()); } #if !defined(_UIKIT_) else { nuiFontManager::GetManager(); } nuiFontManager& rManager(nuiFontManager::GetManager(false)); if (rManager.GetFontCount()) { nglOFile db(fontdb, eOFileCreate); if (db.IsOpen()) rManager.Save(db); } #endif nuiDecoration::InitDecorationEngine(); nuiDefaultDecoration::Init(); nuiBuilder::Init(); #endif }
#include "main.h" LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam); rManager rMGR = rManager(); D3Menu d3 = D3Menu(); int screenX = GetSystemMetrics(SM_CXSCREEN); int screenY = GetSystemMetrics(SM_CYSCREEN); const MARGINS margins = { -1, -1, -1, -1 }; bool isRunning = true; VOID renderOverlay() { rMGR.clear(); d3.render(); rMGR.present(); } INT WINAPI WinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPSTR lpCmdLine, _In_ int nShowCmd) { WNDCLASSEX cx; HWND hWnd = NULL; cx.cbClsExtra = NULL; cx.cbSize = sizeof(WNDCLASSEX); cx.cbWndExtra = NULL; cx.hbrBackground = (HBRUSH)0; cx.hCursor = LoadCursor(NULL, IDC_ARROW);