Example #1
0
int Engine::Draw(Context& context)
{
	// Create a graphics and set it to our system
	Graphics* graph = GetSystem<Graphics>(SystemType::Sys_Graphics);
	if (graph == nullptr) return false;

	// Create the game logic and set it to our system
	GameLogic* logic = GetSystem<GameLogic>(SystemType::Sys_Logic);
	if (logic == nullptr)
		return false;

	// Begin the Draw
	graph->BeginDraw();

	// Draw the game logic
	logic->Draw(context);

	Rect2D r(100, 100, 200, 200);
	RENDERER->DrawRect(r, 2.f);

	// End the Draw
	graph->EndDraw();

	return true;
}