Application Configuration - sinusinu/Flora GitHub Wiki

NOTE: this document is currently wrong, please refer to FloraConfig.cs

 

 

Let's set some configuration on our application!

As you've seen, there is a FloraConfig object that gets fed into new FloraApplication(core, config) on Program.cs.

FloraConfig contains various launch configurations that your application can use, so you should look into it.

Begin with Simple Program:

Program.cs

using Flora;
using System;

namespace FloraTest {
    class Program {
        static void Main(string[] args) {
            FloraConfig config = new FloraConfig() {
                width = 800,
                height = 600,
                windowTitle = "My Awesome Game",
                windowFlags = 0,
                renderFlags = FloraConfig.FloraRenderFlags.Vsync
            };
            MyCore core = new MyCore();
            new FloraApplication(core, config);
        }
    }
}

Currently FloraConfig has 5 variables that can be set.

  • width and height sets the size of window.
  • windowTitle sets the title of the window.
  • windowFlags is a bitmask that is used in creating window.
    • FloraWindowFlags.Maximized makes window maximized at start.
    • FloraWindowFlags.Minimized makes window minimized at start. Be aware that FloraCore.Render will not be called when the window is minimized.
    • FloraWindowFlags.Resizable makes window resizable.
    • FloraWindowFlags.Borderless makes window borderless.
    • Default value is 0.
  • renderFlags is a bitmask that is used in creating renderer.
    • FloraRenderFlags.Vsync makes renderer sync in display refresh rate(a.k.a. V-sync).
    • Default value is FloraRenderFlags.Vsync.