Tutorial 2, Configuration file config.txt
This tutorial builds on the first tutorial, so be sure to do that first!
[Tutorial 1, BlendELF Basics]
In this tutorial you will learn to use the BlendELF configuration file
config.txt
Step 1: Creating the config.txt file
First we have to create a file
config.txt to our root folder, the same folder where we put
level1.pak and
init.lua in the previous tutorial. My folder looks like this now:
Step 2: Changing the resolution
The first thing we will be doing with our config.txt file, is to change the resolution. Open up the config.txt file in a pure text editor, like notepad in windows and gedit/kate/vim in linux. Write the following line into the config.txt file:
window_size 800 480
Now save the config.txt file and run blendelf (BlendELF.exe on windows and ./blendelf in the console for linux). If everything went right, you should see that the resolution of the BlendELF window has changed. If not, then check the console for errors check that you have written the config.txt file correctly.
Step 3: More configuration options for config.txt
Here are the possible options for
config.txt:
- window_size - consists of two values, the width and the height of the window separated with a space, as in "window_size 800 600", default value is 1024 768
- fullscreen - consists of one truth value, [TRUE|FALSE], as in "fullscreen TRUE", requires a window size compatible with the users monitor, default value is FALSE
- texture_compress - consists of one truth value, [TRUE|FALSE] as in "texture_compress TRUE", TRUE increases rendering speed and reduces texture quality, default value is FALSE
- texture_anisotropy - a floating point value between 1.0-16.0, as in "texture_anisotropy 9.0", bigger value enhances texture sharpness, default value is 1.0
- shadow_map_size - a value between 1 - maximum texture size your system supports, as in "shadow_map_size 1024", bigger shadow map size enhances shadow quality, default value is 1024
- start - A path to a PAK file that is loaded in case a init.lua script file isn't available in the root folder, as in "start level1.pak", default value is game.pak
- log - A path to the file where the engine log should be saved
- multisamples - The amount of multisampling (anti aliasing), typically a value between 2 and 16 (the higher the value, the more anti aliasing is applied per pixel), max value is dependant on hardware
And finally here is a sample
config.txt file:
window_size 1280 720
fullscreen FALSE
texture_compress TRUE
texture_anisotropy 16.0
shadow_map_size 1024
start level1.pak
log elf.log
Thats it for the tutorial! I hope you enjoyed the it, and if you have any comments about the tutorial, please post to the
forums.
Copyright © 2009-2010 Samuel Anjam