Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualTispe

Posted 06 June 2013 - 12:13 PM

Gonna bump this, I would like some feedback on a structure I am working on.

 

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	Dx9Device DeviceInterface;							//Wrapper Interfaces to hardware APIs
	Dx9Audio AudioInterface;
	Network NetworkInterface;
	WinInput InputInterface;

/*
Some code
*/

	Assets AssetsManager;								//Game managers
	Entities EntitiesManager;
	Area AreaManager;
	Audio AudioManager;

	MainLoop(&DeviceInterface, &AudioInterface, &NetworkInterface, &InputInterface, &AssetsManager, &EntitiesManager, &AreaManager, &AudioManager);

	return 0;
}

 

void MainLoop(Dx9Device* pDeviceInterface, Dx9Audio* pAudioInterface, Network* pNetworkInterface, WinInput* pInputInterface, Assets* pAssetsManager, Entities* pEntitiesManager, Area* pAreaManager, Audio* pAudioManager)
{
	ToLogicData Data;
	GameData Gamestate;

	while(TickMessages())
	{

		GameInput(pNetworkInterface, pInputInterface, &Data);													//Get Input and output pData
		GameLogic(pAudioManager, pAreaManager, pEntitiesManager, pAssetsManager, &Data, &Gamestate);			//Get pData, update and output game state
		GameOutput(pDeviceInterface, pAudioInterface, pNetworkInterface, &Gamestate);							//Render game state, play audio from state and networking
	}
}

 

Is this a good way for passing interfaces and data around?


#2Tispe

Posted 06 June 2013 - 12:13 PM

Gonna bump this, I would like some feedback on a structure I am working on.

 

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	Dx9Device DeviceInterface;							//Wrapper Interfaces to hardware APIs
	Dx9Audio AudioInterface;
	Network NetworkInterface;
	WinInput InputInterface;

/*
Some code
*/

	Assets AssetsManager;								//Game managers
	Entities EntitiesManager;
	Area AreaManager;
	Audio AudioManager;

	MainLoop(&DeviceInterface, &AudioInterface, &NetworkInterface, &InputInterface, &AssetsManager, &EntitiesManager, &AreaManager, &AudioManager);

	return 0;
}

 

void MainLoop(Dx9Device* pDeviceInterface, Dx9Audio* pAudioInterface, Network* pNetworkInterface, WinInput* pInputInterface, Assets* pAssetsManager, Entities* pEntitiesManager, Area* pAreaManager, Audio* pAudioManager)
{
	ToLogicData Data;
	GameData Gamestate;

	while(TickMessages())
	{

		GameInput(pNetworkInterface, pInputInterface, &Data);													//Get Input and output pData
		GameLogic(pAudioManager, pAreaManager, pEntitiesManager, pAssetsManager, &Data, &Gamestate);			//Get pData, update and output game state
		GameOutput(pDeviceInterface, pAudioInterface, pNetworkInterface, pGamestate);							//Render game state, play audio from state and networking
	}
}

 

Is this a good way for passing interfaces and data around?


#1Tispe

Posted 06 June 2013 - 12:10 PM

Gonna bump this, I would like some feedback on a structure I am working on.

 

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow)
{
	Dx9Device DeviceInterface;							//Wrapper Interfaces to hardware APIs
	Dx9Audio AudioInterface;
	Network NetworkInterface;
	WinInput InputInterface;

/*
Some code
*/

	Assets AssetsManager;								//Game managers
	Entities EntitiesManager;
	Area AreaManager;
	Audio AudioManager;

	MainLoop(&DeviceInterface, &AudioInterface, &NetworkInterface, &InputInterface, &AssetsManager, &EntitiesManager, &AreaManager, &AudioManager);

	return 0;
}

 

void MainLoop(Dx9Device* pDeviceInterface, Dx9Audio* pAudioInterface, Network* pNetworkInterface, WinInput* pInputInterface, Assets* pAssetsManager, Entities* pEntitiesManager, Area* pAreaManager, Audio* pAudioManager)
{
	ToLogicData pData;
	GameData pGamestate;

	while(HandleMessages())
	{

		GameInput(pNetworkInterface, pInputInterface, &Data);													//Get Input and output pData
		GameLogic(pAudioManager, pAreaManager, pEntitiesManager, pAssetsManager, &Data, &Gamestate);			//Get pData, update and output game state
		GameOutput(pDeviceInterface, pAudioInterface, pNetworkInterface, pGamestate);							//Render game state, play audio from state and networking
	}
}

 

Is this a good way for passing interfaces and data around?


PARTNERS