The app.enml file

The app.enml defines default application properties for the game. It must be in the project root directory. All properties set in the default scope are used on all platforms but these values may be overwritten by platform-specific ones.

Example:

default
{
	title = Ethanon Engine; // window title
	richLighting = true;
}

windows
{
	width = 640;
	height = 480;
	windowed = true;
	vsync = true;
}

android
{
	// it will overwrite the default 'richLighting' property
	richLighting = false; // disables lighting when running on Android
}

ios
{
	fixedHeight = 480; // forces backbuffer height to 480p on iOS
}

Some other features of the app.enml file are described below.

Best screen sizes

In order to force the window size to the current best back-buffer resolution possible, which is the real resolution of the main display, ideal for fullscreen mode, width and height attributes must be set to best:

default
{
	width  = best;
	height = best;
	windowed = false;
}

Notice that width and height attributes are always treated as best on non-desktops devices.

Fixed size back-buffers

Rendering many large dynamic lights or even too many transparent entities may become costly for some platforms. Sometimes it is good to avoid that extra cost by rendering the entire scene into a smaller back-buffer that will fill the entire screen when the rendering is finished. This can be enabled by setting fixedHeight or fixedWidth parameters:

default
{
	width = 1024;
	height = 768;

	// window size is 1024x768, but the actual
	// back-buffer will be 640x480
	fixedHeight = 480;
	fixedWidth = auto;

	windowed = true;
	vsync = true;
}

Custom sized back-buffers must keep the same aspect ration as the current screen size, thus only fixedWidth or fixedHeight can be set. If fixedHeight > 0, fixedWidth must be auto and vice versa.

User-defined words

The developer may optionally define custom words which may be processed by the engine in pre-compilation time. Example:

// compiles the code inside if/endif statements when the DESKTOP word is defined
#if ONLINE_LEADERBOARD_SUPPORTED
  print("This platform supports on-line leader-boards!");
#endif

#if GAME_CENTER
  print("The score leader-board in this platform is provided by Apple's Game Center");
#endif

By default, Ethanon Engine defines the following words:

Platform / condition Words defined
Windows WINDOWS, DESKTOP
Mac OS X MACOSX, DESKTOP
iOS APPLE_IOS, MOBILE, HANDHELD
Android ANDROID, MOBILE, HANDHELD
Application is running from SciTE or Sublime TESTING
Ethanon is running on debug mode DEBUG

Additional custom words are defined by the definedWords parameter in a comma-separated string. Words defined in the default enml-entity are merged with the ones defined in the platform specific ones:

default
{
	title = Extremely awesome game;
	width = 1280;
	height = 720;
	definedWords = DISPLAY_FPS_RATE;
}

windows
{
	definedWords = ENABLE_DEBUGGING_CHEATS;
}
macosx { definedWords = ENABLE_DEBUGGING_CHEATS; }
ios { definedWords = ONLINE_LEADERBOARD_SUPPORTED,GAME_CENTER,ENABLE_BANNER_ADS,ENABLE_VIDEO_ADS; }
android { definedWords = ONLINE_LEADERBOARD_SUPPORTED,OPEN_FEINT,ENABLE_BANNER_ADS; }

With custom words, developers can easily handle differences between platforms and switch them at will.