ragb/include/ragb_sdl.h
2024-11-14 04:10:38 +01:00

24 lines
745 B
C

#ifndef RAGB_SDL_H
#define RAGB_SDL_H
#include <r_util.h>
#include <SDL2/SDL.h>
typedef struct gb_pixel_buffer_t {
SDL_Renderer *renderer;
SDL_Texture *texture;
ut8 *buf; //buffer containing pixeldata
ut32 color[4]; //rgb colors
ut32 clear_color;
ut16 w; //x size in pixel
ut16 h; //y size in pixel
// ut16 xsf; //x scale factor for projecting onto the texture
// ut16 ysf; //y scale factor for projecting onto the texture
} GBPixBuf;
GBPixBuf *gb_pix_buf_new(SDL_Renderer *renderer, ut16 w, ut16 h, ut32 clear_color);
void gb_pix_buf_free(GBPixBuf *pb);
void gb_pix_buf_set_pixel(GBPixBuf *pb, ut16 x, ut16 y, ut8 pixval);
void gb_pix_buf_set_color(GBPixBuf *pb, ut8 color_idx, ut32 rgb);
void gb_pix_buf_clear(GBPixBuf *pb);
#endif