![]() |
Oficina Framework
1.3
Games Framework
|
If there's a controller connected to the computer, Oficina will detect it as soon as it's initiated. The controls used inside the program are referenced from the Xbox 360 buttons bindings.
Warning: If your controller supports vibration, it'll be activated. The use of vibration and its support detection can be seen on the debugger, as well as a big number of other features.
Oficina's internal debugger brings a series of information related to input, screen refresh rate, processor and memory usage (the memory usage is only monitored on Linux system), as well as many other things.
To bring up the debugger, press F1.
To alternate between complete and compact versions, press F2.
There are some command line arguments which you can use to setup a few settings.
These arguments can be entered by executing one of the game's startup scripts (e.g. rungame.sh/bat) from the command line (Linux and Windows alike), via a shortcut (Windows), or via another startup script which calls one of the startup scripts with arguments (Linux and Windows alike, too).
It is possible to play using multiplayer on the current Oficina test build.
It is necessary, though, to enable this resource using a command line or a terminal; The option for this resource on the pause menu is unavailable.
THIS ARGUMENT WILL ONLY RUN ON THE TEST PROGRAM.
On Linux, all you need to do is navigate to the game folder and start it with:
And on Windows, you can run:
Where XXX.XXX.XXX.XXX is the IP address of the destination computer, followed by the port you wish to deliver your packages on the other player's computer.
You can also specify which port you want to listen to by using the following argument:
Where PPPP is the desired port you wish to open.
THIS ARGUMENT WILL ALSO ONLY RUN ON THE TEST PROGRAM.
You can include this and other arguments in the same molds of the network target argument. You can also specify multiple arguments.
Notice that, in some cases, it might be necessary to configure your firewall for the connection to work. Failure on package delivering could be seen on terminal or console, if you execute the program for these means.
To run the game on fullscreen mode, run Oficina including the fullscreen argument.
On Linux systems, Oficina will attempt to make the window size fit your current native resolution, but internal OpenGL context resolution will remain the same. This is done because of SDL's screen resolution issues when attempting fullscreen with a resolution that is different from your screen monitor's resolution.
Oficina Framework depends on the following libraries:
Make sure you have these libraries installed when building the library or any application depending on it.
Normally, these libraries will be available on your repository. They are all opensource, so you will not have difficulty trying to find them.
There may be subdependancies on libogg/libvorbis or zlib, so make sure you also install them correctly.
Building Oficina is rather easy.
Having Oficina's source code, navigate to the source folder, and create the required subfolders for building.
Then, all you need to do is build it with Makefile, using the following command:
Make sure you are using GCC/MinGW as your compiler, and also make sure you have all the needed dependancies installed.
The objects for building Oficina's static libraries will be stored in obj folder, and the static library itself will be stored in lib.
Notice that, running the command "make" alone will only generate the library with debug mode active (liboficinad.a).
If you wish to build Oficina on Release target, you must run the make command like this:
This will create liboficina.a on lib/ folder instead.
Make sure to clean the objects generated from the previous compilation, else you may face building problems!
To clean the objects, run:
You can also build the Test Build application to test Oficina.
To do so, execute the following command:
If you wish to run the Test Build application under Release target, add the target flag to the end of this command:
Installing Oficina Framework on a Linux environment is also easy.
All you need to do is navigate to the folder and run:
You may need superuser privileges to run this action.
This will build both Debug and Release targets of Oficina and copy them and the required headers to your local prefix' (normally /usr/local) include and lib subfolders.
If you wish to change the prefix to, say, /usr, run the installation using the following command:
Windows users will want to build each target separately, then manually copy the contents of lib/ into their MinGW/lib folder, and also copy both the folder OficinaFramework (the one containing only headers) and the file GonglyScriptStructure.h into MinGW/include.
You can also uninstall Oficina Framework using the Makefile.
Just run
You may need superuser privileges to run this action.
If you installed it on another prefix, say, /usr, then you may also want to explicitly show that to the Makefile by running:
Windows users will want to manually remove both files liboficina.a and liboficinad.a from MinGW/lib folder, the folder MinGW/include/OficinaFramework and the file MinGW/include/GonglyScriptStructure.h.
To build your own application, you must use the correct build flags.
After correctly installing Oficina and its dependancies, you will want to compile your own code like this:
Notice the following:
If you're using an IDE like Code::Blocks, you'll want to configure your building targets to use these linking targets accordingly. This is normally done on C::B by right-clicking the project name on the Projects tree and clicking "Build Options". Creating Defines (like the DEBUG_ENABLED case) can also be done from there.
Any game compiled with Oficina Framework has a number of fixed argument flags that can be run from any application.
These flags are configuration flags, normally for setting framerate and resolution configuration, and are normally used on the Gongly Launcher.
The flags are:
Sets the window to full screen size.
Sets both Window Size and Resolution to "x".
Refer to Screen Resolution or Window Size for possible values, as they're strictly related.
Enables vertical synchro.
Refer to Enable Vertical Synchro for more details.
Sets default framerate for the application to "x".
Refer to Framerate for possible values.
Enables system diagnostics, if application was compiled in debug mode and has a font binded to the debug window.
Forces program to run audio loop on the same rendering and logic thread.
This may lower CPU consumption, but may also cause BGM loops to not work properly.
Mutes ALL background music.
Mutes ALL sound effects.
Forces application to output which version of Oficina it was compiled with then halts the application.