started texture processing

This commit is contained in:
nosch
2025-08-30 23:35:41 +02:00
parent 4c098950f3
commit 835b40046a
+29
View File
@@ -0,0 +1,29 @@
#include "../../include/raylib-cpp.hpp"
#include <vector>
using namespace std;
typedef vector<raylib::Texture> TextureAtlas;
typedef int ID;
Texture defaultTexture;
void GenDefaultTexture(){
Image img = GenImageChecked(64, 64, 16, 16, PURPLE, BLACK);
defaultTexture = LoadTextureFromImage(img);
UnloadImage(img);
}
TextureAtlas NewTextureAtlas() {
TextureAtlas atlas;
atlas.push_back(defaultTexture);
return atlas;
}
Texture GetTexture(ID id, TextureAtlas atlas) {
if (atlas.size() >= id) {
return atlas[0];
}
return atlas[id];
}