Oficina Framework  1.3
Games Framework
GameArgs Available Options

This page contains examples and usage of GameArgs when invoking EngineCore's Initialize method.

Example

#include "OficinaFramework.h"
using namespace OficinaFramework;
int main(int argc, char** argv)
{
// Create list of arguments
std::list<string>* GameArgs = new std::list<string>;
GameArgs->push_front("gamename=Your Game Name Here");
GameArgs->push_front("iconpath=icon_name_on_data_folder");
GameArgs->push_front("resolution=720p");
GameArgs->push_front("framerate=60Hz");
GameArgs->push_front("vsync");
GameArgs->push_front("enable_network");
GameArgs->push_front("enable_multithreaded_audio");
// This argument will only be activated if compiled
// with a debug flag
#ifdef DEBUG_ENABLED
GameArgs->push_front("enable_diagnostics");
#endif
// Initialize the core
EngineCore::Initialize(argc, argv, GameArgs);
// Run game
}

As you can see above, using GameArgs is fairly simple. All you need to do is create a list of arguments and pass them to the initializer, and they will be handled accordingly.
If a GameArg is not recognized, it'll be prompted to the console, regardless of the build nature.

GameName

Sets the name of the game (including on game window).
Usage:

gamename=x

x: String containing the name of the game

Screen Resolution

Sets the rendering resolution.
Usage:

resolution=<Width>x<Height>

or

resolution=<literal>

x: Resolution to be given to the renderer.
Use the syntax <Width>x<Height> after the = sign to specify a custom resolution.

Some default values and literals:

16:9 resolutions

  • 720p/hd/HD -> 1280x720, 720p
  • 768p -> 1366x768
  • 900p -> 1600x900
  • 1080p/fhd/FullHD -> 1920x1080, 1080p
  • 1440p -> 2560x1440
  • 2160p/4k/4K -> 3840x2160, 4K

4:3 resolutions

  • 640x480 -> 640x480
  • 800x600 -> 800x600
  • 1024x768 -> 1024x768
  • 1600x1200 -> 1600x1200

Window Size

This GameArg is now deprecated.
Use

See also
Screen Resolution instead.
Usage:
windowsize=x

Framerate

Sets the window to a fixed refresh rate.
Do not give this GameArg if you intend to use variable rate.
Usage:

framerate=x

x: Desired refresh rate.

Possible values:

  • 05/05FPS/05fps/05hz/05Hz -> 5 hertz (test purposes only!)
  • 15/15FPS/15fps/15hz/15Hz -> 15 hertz
  • 20/20FPS/20fps/20hz/20Hz -> 20 hertz
  • 24/24FPS/24fps/24hz/24Hz -> 24 hertz
  • 30/30FPS/30fps/30hz/30Hz -> 30 hertz
  • 60/60FPS/60fps/60hz/60Hz -> 60 hertz

Enable Networking

Enable network communication.
Only use this if any network communication is intended.
Usage:

enable_network

Enable Diagnostics

Enable diagnostics mode.
Only enable this for debug, for there could be performance drops.
Usage:

enable_diagnostics

Set Icon

Sets the icon for the application.
Usage:

iconpath=x

x: Path to the icon .png file on Game Path.

Enable Multithreaded Audio

Enables the audio thread (recomended).
If inactive or failed to initialize, audio management will be embeded on game loop.
Usage:

enable_multithreaded_audio

Mute Background Music

Mutes background music.
Usage:

mute_bgm

Enable Vertical Synchro

Enables VSync.
Usage:

vsync