Example #1
0
	CEGuiManager::CEGuiManager() {
#ifdef HAVE_OPENGL
		CEGUI::OpenGLRenderer::bootstrapSystem();
#else
		throw GuiException("CEGUI can be used only if opengl is enabled!");
#endif
		m_inputProcessor = new CEGuiInputProcessor();
		
		m_lastTimePulse = TimeManager::instance()->getTime() / 1000.0;

	}
	void OpenGLGuiGraphics::drawText(const std::string& text, int32_t x, int32_t y,
			uint32_t alignment) {
		if (mFont == NULL)
		{
			throw GuiException("OpenGLGuiGraphics::drawText() - No font set!");
		}

		switch (alignment)
		{
			case Left:
				mFont->drawString(this, text, x, y);
				break;
			case Center:
				mFont->drawString(this, text, x - mFont->getWidth(text) / 2, y);
				break;
			case Right:
				mFont->drawString(this, text, x - mFont->getWidth(text), y);
				break;
			default:
				FL_WARN(_log, LMsg("OpenGLGuiGraphics::drawText() - ") << "Unknown alignment: " << alignment);
				mFont->drawString(this, text, x, y);
		}
	}