started texture processing
This commit is contained in:
@@ -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];
|
||||
}
|
||||
Reference in New Issue
Block a user