replaced separate textures with atlasses

This commit is contained in:
rendo 2026-03-13 12:49:11 +05:00
commit bd9abbe5bd
12 changed files with 90 additions and 25 deletions

21
src/atlas.h Normal file
View file

@ -0,0 +1,21 @@
#ifndef ATLAS_H
#define ATLAS_H
#include <raylib.h>
class TextureAtlas {
public:
TextureAtlas(Texture2D* texture, int offset_x, int offset_y, int width, int height);
TextureAtlas();
Rectangle rect_view(int x,int y, int width, int height) const; // Get a view into texture
Rectangle full_view() const;
const Texture2D get_texture() const;
private:
int offset_x;
int offset_y;
int width;
int height;
Texture2D* texture;
};
#endif