-
Notifications
You must be signed in to change notification settings - Fork 0
The Graphics Plugin
The graphics plugin provides the interface for the application as a whole - it manages all input and has complete control with how one interfaces with the application. The default provided graphics plugin also lays out how one might want to deal with various menu screens.
First, the "Graphics" folder should be in Plugins/
There are a number of files that are required by EMA of the Graphics plugin (six, to be exact):
- Graphics.h
- Graphics.cpp
- EntitiyDefaultDrawCode.cpp
- Input.cpp
- ControlledEvents.cpp
- WindowedEvents.cpp
Must be at least:
class Graphics : public GraphicsInternals
{
public:
using GraphicsInternals::GraphicsInternals; //But a custom contructer can be defined, as Graphics(Bin* const bin, ThreadManager* const manager) : GraphicsInternals(bin, manager) {}
void eventLoop() override;
}
Needs to exist, you can write your code in the .h if you want. Whatever you do, don't #include "Graphics.h"
, as EMA works it out on its own (Main/Graphics.(h/cpp) include these Graphics files).
This defines how entities are drawn if their plugin does no provide any code of their own.
Defines real-time input, such as smoothly moving the simulator around with arrow keys.
Defines input on a keystroke basis, such as getting exactly one press from the '+' button to time-accelerate EMA (as opposed to checking if the '+' button is pressed each loop as with real-time input).
Windowed events are the most basic events dealing with the window, that you'll probably always want to call.. By default, this also provides an example on how to properly exit the application.