-
Notifications
You must be signed in to change notification settings - Fork 7
Design
This is the overall design of the Ephenation client. As being a project developed on free time, results have had priority before good design. This can be seen in some cases with fat class design, as well as too many interdependencies leading to problems of flexibility.
Doxygen is used to produce documentation, see result at http://larspensjo.github.com/ephenation-client/.
The deferred shader compiles data from the G-buffer.
To help organize the shaders, the OpenGL Shader Wrangler is used (glsw). In principle, it is a string manipulation library, used to combine sub strings into shaders. This string manipulation is done from a common base, in shaders/shader.cpp.
Animation is based on the Assimp library.
Multiple threads are created:
- Main thread will handle all OpenGL.
- One thread will manage the streaming of sound data SoundControl.h.
- A couple of threads are used as a computation pool ChunkProcess.h. If the CPU has N cores (including hyper threading), then N-1 threads will be used. This computation pool is not limited to anything special, and are currently used for load and transforming the binary data of chunks into the list of visible surfaces.
This section describes the basic communication between the client and the server.
The protocol is describe in detail at Ephenation communication protocol
When the player enters Construction mode, the display will change. A menu on the right side shows available block types.
The following prefixes are used on names. The purpose is to have a prefix that says something of the usage, but not of the type.
'f': On member variables (not member functions).
's': Static variable or function.
'g': Global variable or function.
Member functions use an initial upper case letter.
Arguments and local variables use an initial lower case letter.
Class names have an initial upper case letter.
References to local member functions are done with the prefix "this->".
In general, CamelBack naming is used for composed words instead of '_'.
The client source code is structured according to the MVC pattern.
This is enforced using namespaces.
The principle for using namespaces is to use a "using" statement only in the cpp file,
and only for the namespace that the implementation belongs to.
That way, it is clear what function calls are to other namespaces.
At the time of this writing, the separation into Model, View and Controller is not complete. Also, there are dependencies in both directions.