mirror of
https://github.com/HarbourMasters/Shipwright.git
synced 2024-08-13 17:03:47 -04:00
f52a2a6406
subrepo: subdir: "OTRGui" merged: "a6066a251" upstream: origin: "https://github.com/HarbourMasters/otrgui.git" branch: "master" commit: "a6066a251" git-subrepo: version: "0.4.1" origin: "???" commit: "???"
39 lines
937 B
C++
39 lines
937 B
C++
#ifndef MarsGameH
|
|
#define MarsGameH
|
|
|
|
#include "raylib.h"
|
|
#include <map>
|
|
#include <string>
|
|
|
|
class OTRGame {
|
|
public:
|
|
std::map<std::string, Font> Fonts;
|
|
std::map<std::string, Model> Models;
|
|
std::map<std::string, Texture2D> Textures;
|
|
float ModelRotation = 0.0f;
|
|
Camera camera;
|
|
|
|
void preload();
|
|
void init();
|
|
void imgui();
|
|
void update();
|
|
void draw();
|
|
void exit();
|
|
protected:
|
|
void LoadTexture(const std::string& name, const std::string& path) {
|
|
const Image tmp = LoadImage(path.c_str());
|
|
Textures[name] = LoadTextureFromImage(tmp);
|
|
UnloadImage(tmp);
|
|
}
|
|
|
|
void LoadFont(const std::string& name, const std::string& path) {
|
|
Font font = LoadFontEx(path.c_str(), 16, nullptr, 0);
|
|
GenTextureMipmaps(&font.texture);
|
|
SetTextureFilter(font.texture, TEXTURE_FILTER_POINT);
|
|
Fonts[name] = font;
|
|
}
|
|
};
|
|
|
|
extern OTRGame* Game;
|
|
|
|
#endif |