Straightforward and humble event-driven engine for (and not only limited by) pixel graphics.
Best rendering engine ever! (c) Me
-
Download the header file (
RapturePixelEngine.hpp
) -
Include the header in your application (or use
RapturePixelEngineExample.cpp
, skip to Compile & Link)
The project is kept clean, so no inheritance or complex structures. Everything
you need to worry about is put into the RapturePixelEngine
type, in
namespace rpe
. System dependent details are obscured by the Platform
type.
As only one window intstance can be handled, all the operations are performed
over a pointer to an already existing instance, which is retrieved via an
autological static method RapturePixelEngine::instance()
;
- Write some code
// Whoosh, now in your project
#include "RapturePixelEngine.hpp"
// your classical main function
int main() {
// use namespace to avoid repetition
using namespace rpe;
// singleton unique instance pointer
RapturePtr engine = RapturePixelEngine::instance();
// configure the object
engine.Construct();
// start the window!
engine.Start();
return 0;
}
- Callbacks are events, triggered upon certain conditions. A good example
would be
OnEventCallback
, the one triggered on any window event. Later more scoped callbacks might occur. For more infromation look at the types, code won't lie.
RapturePixelEngine::instance()->callbacks.OnEventCallback = [](const Event&) {
// I fire when an event is caught!
// The event is passed as a constant reference
}
- Link the static libraries and compile your project. It uses two of statics, present on most computers. If you can't link with them seek installation guidance for your system.
Linux:
g++ your_desired_file.cpp -lX11 -lpthread -o your_desired_output.o
Windows: temporarily unavailable, expect soon!
- Run the program!
Linux:
./your_desired_output.o
Pull requests are very welcome. For major changes, please open an issue first in order to discuss the need. Use and create!