32 lines
853 B
C++
32 lines
853 B
C++
#pragma once
|
|
#include <stdint.h>
|
|
#include <SDL3/SDL.h>
|
|
#include <string>
|
|
|
|
namespace draw
|
|
{
|
|
struct texture_t
|
|
{
|
|
std::string name;
|
|
SDL_Texture *texture {nullptr};
|
|
uint8_t *pixels {nullptr};
|
|
int w;
|
|
int h;
|
|
bool target {false};
|
|
};
|
|
|
|
void init();
|
|
void fillRect(int x, int y, int w, int h, uint8_t r, uint8_t g, uint8_t b, uint8_t a);
|
|
void setSource(SDL_Texture *texture);
|
|
void setDest(SDL_Texture *texture);
|
|
|
|
int loadPalette(const char *filename);
|
|
void regenerateTextures();
|
|
texture_t getTexture(const char *name);
|
|
texture_t createTexture(const char* name, int w, int h, SDL_TextureAccess access);
|
|
void deleteTexture(const char *name);
|
|
|
|
void draw(int dx, int dy, int dw, int dh, int sx, int sy, int sw, int sh);
|
|
|
|
void present();
|
|
} |