Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kubgus/untitled-game-engine
A game engine. (for now)
https://github.com/kubgus/untitled-game-engine
Last synced: about 11 hours ago
JSON representation
A game engine. (for now)
- Host: GitHub
- URL: https://github.com/kubgus/untitled-game-engine
- Owner: kubgus
- License: mit
- Created: 2024-08-02T15:03:51.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-09-08T21:12:59.000Z (5 months ago)
- Last Synced: 2024-09-08T22:27:50.247Z (5 months ago)
- Language: C++
- Homepage:
- Size: 11.3 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Untitled Game Engine
Untitled Game Engine (UGE) is a simple C++ library for making SDL2 games.
## Build Instructions
### Make sure you have `SDL2` installed on your system.
```bash
sdl2-config --version
```#### Linux Install
**Debian**
```bash
sudo apt install libsdl2-dev
```**Fedora**
```bash
sudo dnf install SDL2-devel
```**Arch Linux**
```bash
sudo pacman -S sdl2
```#### Windows Install
Visit [libsdl.org](https://libsdl.org/) and download the latest SDL2 release.
### Build UGE
#### Linux
Run the `scripts/build.sh` script to build UGE and Sandbox.
```bash
sh scripts/build.sh
```> ***Note:*** Make sure to run from the base directory.
#### Windows
1. Install and run [premake5](https://github.com/premake/premake-core/releases).
2. Use build tool you've defined in premake to build UGE and Sandbox.### Run Sandbox
Run executable from `bin/`.
## Usage
```cpp
#include "uge.h"#include
struct roadrunner {
uge::vector2 pos;
int speed = 3;
};class app : public uge::window {
public:
app() : uge::window("app", { 800, 600 }) {}roadrunner steve = { 20, 10 };
protected:
void on_ready() override {
_clear_color = { 0x11, 0x11, 0x11, 0xFF };
_fps_limit = 30;
}void on_draw() override {
draw_rect(steve.pos, { 20, 20 }, { 255, 0, 255 });
}void on_update() override {
steve.pos.x += steve.speed;
}void on_event(SDL_Event& event) override {
if (event.key.keysym.sym == SDLK_ESCAPE) {
stop();
}
}
};int main() {
app app;
app.start();
}
```![1725650901](https://github.com/user-attachments/assets/161e8f18-65f6-422b-94a5-0ddaae797cf0)