// Copyright (C) 2020 Daniel Mall
#pragma once
#include "CDemoBase.h"
#include "CDemoTriangle.h"
#include "CDemoSpokes.h"
#include "CDemoImgui.h"

enum class eDemoDispatchId
{
	nDemoIdImgui,
	nDemoIdTriangle,
	nDemoIdSpokes,

	// none selected
	nDemoIdNone
};

class CDemoDispatch
{
public:
	CDemoDispatch();
	~CDemoDispatch();
	void Deallocate();
	void Frame();
	void EventInput(const sapp_event* event);
	void PassAction(sg_pass_action& passAction);

	//! which demo is currently displayed
	eDemoDispatchId m_nDemoSelected;

private:
	void CheckForSwitchDemo();
	void ActivateSelectedDemo(CDemoBase* pSelectedDemo);

private:
	/// the last demo selected
	eDemoDispatchId m_nLastDemoSelected;

	/// the last demo selected
	CDemoBase* m_pDemo = nullptr;

	/// classic OpenGl demos
	CDemoImgui* m_pImgui = nullptr;
	CDemoTriangle* m_pTriangle = nullptr;
	CDemoSpokes* m_pSpokes = nullptr;
};
