Shkyera Engine
Easy to use, game engine for Python
Interpreter.hpp
Go to the documentation of this file.
1 #pragma once
2 
3 #include <pybind11/embed.h>
4 #include <pybind11/pybind11.h>
5 #include <pybind11/stl.h>
6 
7 #include "renderer/Renderer.hpp"
8 
9 namespace py = pybind11;
10 
11 namespace shkyera::Python {
12 
16 const std::string MODULE = "src.python.shkyera.";
17 
21 void start();
22 
26 void stop();
27 
31 void resetPressedButtons();
32 
38 void addPressedButton(std::string key);
39 
43 void allowRunning();
44 
50 bool isRunning();
51 
57 void setInterpreterRenderer(std::shared_ptr<Renderer> renderer);
58 
59 } // namespace shkyera::Python
Definition: Events.cpp:7
void stop()
Stop the Python interpreter and finalize the Python environment.
Definition: Interpreter.cpp:149
void start()
Start the Python interpreter and initialize the Python environment.
Definition: Interpreter.cpp:135
void resetPressedButtons()
Resets the set of pressed buttons by the user.
Definition: Interpreter.cpp:153
bool isRunning()
Check if the Python environment is running.
Definition: Interpreter.cpp:151
const std::string MODULE
The Python module prefix for shkyera.
Definition: Interpreter.hpp:16
void allowRunning()
Allow the Python environment to run.
Definition: Interpreter.cpp:143
void setInterpreterRenderer(std::shared_ptr< Renderer > renderer)
Set the renderer to use for the Python interpreter.
Definition: Interpreter.cpp:31
void addPressedButton(std::string key)
Add the pressed key to the set, so that the user can interact with it from Python script.
Definition: Interpreter.cpp:159