-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
163 lines (137 loc) · 5.35 KB
/
index.html
File metadata and controls
163 lines (137 loc) · 5.35 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
---
layout: default
---
<div id="about">
<img id = "projectBanner" src="{{ site.url }}\media\default.png" lat="GitHub Logo"/>
<h3>Scalable</h3>
<p>
With the power of Vulkan and a data oriented architecture the engine can get the most
out of your hardware. Our memory model is flat, which makes Parallelization of our
pipeline easy while keeping as much cache coherency as possible.
</p>
<h3>Extendable</h3>
<p>
The engine is completely open source and all code is peer reviewed and tested before being submitted.
This helps us maintain a high quality bar while ensuring that the code is scalable and
easy to understand.
</p>
<h3>Simple</h3>
<p>
The framework for the engine is written in such a way that all you need to do to create a
game in Fling is create a game class. From there you have all the control to write whatever kind
of gameplay systems you want.
</p>
<div id="image_banner">
<a href="https://github.com/flingengine/FlingEngine" target="_blank">
<img id = "logo_img" src="{{ site.url }}\media\GitHub-Mark-32px.png" lat="GitHub Logo"/>
</a>
<a href="https://flingengine.github.io/FlingEngine/" target="_blank">
<img id = "logo_img" src="{{ site.url }}\media\docs.png" lat="GitHub Logo"/>
</a>
</div>
<h2>Usage</h2>
<p>All you need to do in order to make a game with the Fling Engine is
to override the <code class="language-cpp">Fling::Game</code> class, and specify your game when you
create your engine instance. </p>
<p>Here is a very simple example of a game's <code class="language-cpp">main.cpp</code>:</p>
<pre><code class="language-cpp">
#include "FlingEngine.h"
class YourGame : public Fling::Game
{
/**
* Called before the first gameplay loop tick.
* Do any initialization for custom gameplay systems here.
*/
void Init(entt::registry& t_Reg) override {}
/* Called when the engine is shutting down */
void Shutdown(entt::registry& t_Reg) override {}
/**
* Update is called every frame. Call any system updates for
* your gameplay systems inside of here
*/
void Update(entt::registry& t_Reg, float DeltaTime) override {}
};
/* Entry point for using the Fling Engine! */
int main(int argc, char* argv[])
{
Fling::Engine Engine = {};
try
{
Engine.Run<YourGame>();
}
catch (const std::exception& e)
{
std::cerr << e.what() << std::endl;
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}
</code></pre>
<h3>Building from Source</h3>
<p>The Fling Engine uses CMake for quick and easy setup of your development environment no matter
what platform you are on.</p>
<p>There are several CMake options to consider when building the Fling Engine:</p>
<ul>
<li><code class="language-c">-DCMAKE_BUILD_TYPE=Release</code> will compile your code in release mode (optimizations on),
but keep logging enabled and the asset directories absolute.</li>
<li><code class="language-c">-DDEFINE_SHIPPING=ON</code> will compile your code in release mode, <i>but</i> the Assets and Config directories are
now relative to the executable.</li>
</ul>
<h3>The Assets Folder</h3>
<p>
The Assets folder is where all assets (models, textures, shaders, levels, etc) should be placed.
When you run CMake file paths are generated to be absolute based on where you have
cloned the repo. This means that if you move the folder or repo, <i>you must re-run CMake</i>.
</p>
<p>
A simple setup like this makes quick iteration on assets much easier without the overhead of needing
a full asset management database.
</p>
<p>
Obviously you will want asset paths to be dynamic for a shipping product. All you have to do
in order to accomplish this is to set the <code class="language-c">-DDEFINE_SHIPPING</code>
CMake flag to be <code class="language-c">ON</code> when you run CMake. This also adds a C++ define
that you can check simply:
</p>
<pre><code class="language-cpp">
#ifdef FLING_SHIPPING
// Do some nice stuff
#else
// Do non-shipping code, perhaps with a lot of log messages
#endif
</code></pre>
<h3>The Config Folder</h3>
<p>
Fling Engine uses some simple <code class="language-c">ini</code> files for settings that we thought might be
useful for you to tweak. Check out a full config
<a href="https://github.com/flingengine/FlingEngine/blob/master/Config/EngineConf.ini" target="_blank">here</a>.
</p>
<p>Here is a quick example config file:</p>
<pre><code class="language-cpp">
; Core engine config example
[Engine]
WindowWidth=800
WindowHeight=600
; The text shown in the window title bar!
WindowTitle=Fling Engine
; Will show what git branch and commit head in the title bar
DisplayBuildInfoInTitle=true
DisplayVersionInfoInTitle=true
; This is relative to the Assets directory
WindowIconImage=FlingEngineLogo.png
; Graphics API Settings
[Vulkan]
EnableValidationLayers=false
;UI settings
[Imgui]
display=true
[Camera]
MoveSpeed=10
RotationSpeed=40
; Game settings! Add any custom config file settings you want to read in here
; @see FlingConfig
[Game]
; Start level is relative to the assets directory
; @see World::LoadLevel
StartLevel=Levels/EmptyLevel.json
</code></pre>