SwApplication

From SWWorkshop

Jump to: navigation, search

It provides initialization data for an application that uses swEngine

Where we use SWApplication?

  • In samples,
  • In tests,
  • In games (Xenophobic, ColorBall, vb..)
  • In tools
  • etc..


Data Structure

typedef struct{
	void  (*appRun)(void); //Callback function(Function pointer) which trigger all screen refresh. So you can write gameLoop logic here. 
	int  width;  //Window width
	int  height; //Window height
	bool fullScreen; 
	bool cursor; //Default Cursor'un is displayed
	char *title; //Window title (Only displayed windowed mode)
	char *path;  //Resource path
	HINSTANCE hInstance;
}swApplication;


Sample Code

//Application Settings
        swApplication simpleApplication;
	simpleApplication.hInstance=hInstance;
	simpleApplication.fullScreen=false;
	simpleApplication.cursor=true;
	simpleApplication.width=800;
	simpleApplication.height=600;
	simpleApplication.title="Simple Application";
	simpleApplication.path="resource";
	simpleApplication.appRun=GameLoop;
Personal tools