Beispiel #1
0
void CGraphics::SetLightingMode(int mode) {
	if(mode==L_WIRED) {
		glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
		DisableLighting();
	} else 
		glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
}
Beispiel #2
0
void CGLLightManager::Remove(int n)
{
	if (_lightSources.size() < 1 || (size_t)n >= _lightSources.size())
		return;
	if (_lightSources.size() == 1)
	{
		_lightSources.pop_back();
		DisableLighting();
		return;
	}
	_lightSources[n] = _lightSources[_lightSources.size() - 1];
	_lightSources.pop_back();
}
	void CoreDelegateImpl::Draw()
	{
		auto p_lights = Core::GetRenderer()->GetLightsController();
		p_lights->DisableLighting();
		drawGrid(100, 4);
		p_lights->EnableLighting();
		static float x = 50;
		static float y = 600;
		auto p_renderer = Core::GetRenderer();
		IRect rect = p_renderer->GetTargetRectangle();
		p_renderer->SetMatrix(MatrixMode::Projection, Matrix4f::CreateOrtho(0, rect.Width(), 0, rect.Height()));
		std::wstring message = L"FPS: " + std::to_wstring(Core::GetApplication()->GetCurrentFPS());
		auto en_font = Core::GetGlobalObject<Resources::ResourceManager>()->GetHandleToResource<Render::Font>("Arial_en");

		auto p_font_mgr = Core::GetGlobalObject<Render::FontManager>();
		p_font_mgr->Render({ x, 900 }, 0.6f, message, en_font);
		p_font_mgr->Render({ x, 865 }, 0.6f, L"Vertices: " + std::to_wstring(Core::GetGlobalObject<Render::MeshSystem>()->GetVerticesRendered()), en_font);
		p_font_mgr->Render({ x, 830 }, 0.6f, L"Trigs: " + std::to_wstring(Core::GetGlobalObject<Render::MeshSystem>()->GetTrianglesRendered()), en_font);
		/*message = L"asdqwetbij[we6  ewrgasdf";
		for (int i = 0; i < 100; ++i)
			p_font_mgr->Render({ x, y }, 1.f, message, en_font);*/
	}