[Updated] Codebase to deal with wasm-style keyboard and mouse inputs

This commit is contained in:
Ninjaws
2024-12-10 14:41:59 +01:00
parent cbf6e658ea
commit 97d93ab113
33 changed files with 344 additions and 124 deletions
+44
View File
@@ -0,0 +1,44 @@
#ifndef TEXTURE_WRAPPER_H
#define TEXTURE_WRAPPER_H
#include "raylib.h"
class TextureWrapper {
public:
TextureWrapper(Texture2D texture, Vector2 size = {32,32}, Vector2 position = {0,0}, Rectangle sourceRect = {0,0,32,32}) {
this->texture = texture;
this->size = size;
this->position = position;
}
~TextureWrapper() {
}
Texture2D getTexture() {
return this->texture;
}
Rectangle getSourceRect(){
return this->sourceRect;
}
Vector2 getSize() {
return this->size;
}
Vector2 getPosition() {
return this->position;
}
void setSourceRect(Rectangle rect) {
this->sourceRect = rect;
}
private:
Texture2D texture;
Rectangle sourceRect;
Vector2 size;
Vector2 position;
};
#endif