This is the source code to Mhatxotic Engine which you need to use a compatible C++ compiler in order to compile.
I use my own project management system binary to build Mhatxotic Engine and the utility scripts help build it which makes trying to get things running a little less daunting.
The setup.hpp module will try to detect and setup a compatible environment automatically. Below are some hints on how to compile it yourself though by the command-line…
On Linux, some built-in libs (via apt-get) are used and I only made my own compilations of LibJPEGTurbo, Lua, LZMA, MiniMP3, LibNSGif and OpenSSL instead of the ones in the previous paragraphs. I also directly copied the link command from output logs. I only compiled and tested this with Ubuntu 24.04 LTS on real hardware unfortunately, so it might not work on your distribution and I don't intend to support anything else.
Below are the only options you can define to modify engine behaviour…
| Define | Purpose |
|---|---|
ALPHA |
Use when enabling debugging and exposes memory previews with the assets command. |
BETA |
For normal development uses with all features and no restrictions. |
RELEASE |
Disables the console by default, hardens checks and hides certain functionality that the end-user does not need. |
- Always use
UTF-8with no BoM. - Unix line-feeds only and no carriage returns.
- Two whitespace characters per indentation.
- No tab characters.
- No empty lines wasting screen estate.
- No lines longer than 80 characters for text mode compatibility so hard-wrapped long lines to next indentation level.
- Do not ever use
.cpp,.cmodules or.hheader files unless they are from a third-party API. The only.cppfile needed isengine.cppand all other code is stored in.hppfiles. - Keep filenames short (
llprefix isLuaLibcode, andsysprefix isSystemcode,pixprefix isposix,winprefix isWindows).
- Curly braces on a new line except when already in function scope.
- Optimisation over readability, use comments to help with readability.
- Prefix all variable names with the typename (e.g.
char*=cpVar,int=iVar,MyClassName=mcnVar). - All function names and class/struct typenames begin with a uppercase character (
MyClass,MyFunctionorMyMethod). - All macro names are uppercase (e.g.
#define MACRO(x) ...). - Comment every line unless a single comment can describe two or more lines.
- No prototyping unless absolutely necessary.
#definefunctions are discouraged so use C++ unless absolutely neccesary.- Keep
#macrostatements indented after the hash (#) symbol and separate from the indentation of the interpreted code. - Limit use of C code unless communicating with third-party API's.
- Keep code as compact as possible and try to eliminate duplicate code.
- Keep code categorised in namespaces and structs and out of global scope which is for external API's only.
- The
gotokeyword is accepted because shishou says so. - Always use the latest CppCheck to verify code.
- Writing operating system specific code means you have to add code for the other operating systems too.
- Try to always use
posixfunctions to keep compatibility with bothMacOSandLinux.
- Must compile with no warnings with
-Wall -Wextraon MacOS C-Lang,-Wextraon Linux GCC and/W4on Windows MSVC. - Only use static libraries so we can keep everything in the binary and self-reliant.
Feel free to create an issue or pull request to correct issues or use the discussions forum for questions.