Add flappy bird

This commit is contained in:
Robin Rottstädt 2023-09-23 22:12:50 +02:00
parent 237102965b
commit 9b57ca68c6
No known key found for this signature in database
GPG key ID: 630B61F1D46CCE35
12 changed files with 8392 additions and 1 deletions

View file

@ -0,0 +1,24 @@
#pragma once
#include <paradiso/bitmap.hpp>
#include <optional>
#include <string>
#include <unordered_map>
class image_loader {
public:
/**
* @brief loads an Image from a file
* @param[in] filename path to file
* @return bitmap from file
*/
static paradiso::Bitmap load(const std::string& filename);
private:
static inline const std::string ASSET_PATH = "assets/";
static std::unordered_map<std::string, paradiso::Bitmap> image_cache;
static paradiso::Bitmap readBMP(std::string& filename);
};