bool Engine::initUI() { if (m_uiInitialized) return true; m_uiModeTextures[MODE_STARTUP_SCREEN] = NvCreateTextureFromDDSEx("splash_screen.dds", 0, 0, NULL, NULL, NULL, NULL); m_uiModeTextures[MODE_AUTOPAUSE] = NvCreateTextureFromDDSEx("pause_screen.dds", 0, 0, NULL, NULL, NULL, NULL); m_uiModeTextures[MODE_QUIT_CONFIRM] = NvCreateTextureFromDDSEx("quit_screen.dds", 0, 0, NULL, NULL, NULL, NULL); mDrawRect = new NvDrawRect(); #define NUM_FONTS 1 static NvBool fontsSplit[NUM_FONTS] = {1}; /* all are split */ static const char *fontFiles[NUM_FONTS] = { "courier+lucida_256.dds"}; if (NVBFInitialize(NUM_FONTS, (const char**)fontFiles, fontsSplit, 0)) { LOGW("Could not initialize NvBitFont"); return false; } m_clockText = NVBFTextAlloc(); NVBFTextSetFont(m_clockText, 1); // should look up by font file name. NVBFTextSetSize(m_clockText, 32); NVBFTextSetColor(m_clockText, NV_PC_PREDEF_WHITE); NVBFTextSetString(m_clockText, "000:00.00"); m_uiInitialized = true; return true; }
bool UI::InitUI() { if (m_uiInitialized) { RenderThreadInitProducts(); RenderThreadInitReceipts(); SetDirections(); return true; } #define NUM_FONTS 2 static NvBool fontsSplit[NUM_FONTS] = {1,1}; /* all are split */ static const char *fontFiles[NUM_FONTS] = { "courier+lucida_256.dds", "utahcond+bold_1024.dds" }; if (NVBFInitialize(NUM_FONTS, (const char**)fontFiles, fontsSplit, 0)) { LOGW("Could not initialize NvBitFont"); return false; } SetupLabel((void**)&m_uiLabelFetch, 2, 32, NVBF_COLORSTR_WHITE ""); SetupLabel((void**)&m_uiLabelDirections, 2, 32, NVBF_COLORSTR_WHITE "Directions:"); SetupLabel((void**)&m_uiLabelMessage, 2, 32, NVBF_COLORSTR_WHITE "Message:"); m_uiRequestGamerUUID.Setup(2, 32, NVBF_COLORSTR_GREEN "[Get GamerUUID]", NVBF_COLORSTR_WHITE "Get GamerUUID"); m_uiRequestProducts.Setup(2, 32, NVBF_COLORSTR_GREEN "[Get Products]", NVBF_COLORSTR_WHITE "Get Products"); m_uiRequestPurchase.Setup(2, 32, NVBF_COLORSTR_GREEN "[Purchase]", NVBF_COLORSTR_WHITE "Purchase"); m_uiRequestReceipts.Setup(2, 32, NVBF_COLORSTR_GREEN "[Get Receipts]", NVBF_COLORSTR_WHITE "Get Receipts"); m_uiPause.Setup(2, 32, NVBF_COLORSTR_GREEN "[Pause]", NVBF_COLORSTR_WHITE "Pause"); m_uiRequestGamerUUID.Down = &m_uiRequestReceipts; m_uiRequestGamerUUID.Left = &m_uiRequestProducts; m_uiRequestProducts.Down = &m_uiRequestPurchase; m_uiRequestProducts.Right = &m_uiRequestGamerUUID; m_uiRequestPurchase.Up = &m_uiRequestProducts; m_uiRequestPurchase.Right = &m_uiRequestReceipts; m_uiRequestReceipts.Left = &m_uiRequestPurchase; m_uiRequestReceipts.Up = &m_uiRequestGamerUUID; m_uiPause.Up = &m_uiRequestReceipts; m_selectedButton = &m_uiPause; m_uiPause.SetActive(true); m_uiInitialized = true; return true; }