forked from Hartmut/paradiso
CMakeList cleanup and import fix
This commit is contained in:
parent
9b57ca68c6
commit
7cbc525dc6
4 changed files with 9 additions and 7 deletions
24
examples/flappy_bird/lib/image_loader.hpp
Normal file
24
examples/flappy_bird/lib/image_loader.hpp
Normal 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);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue