shoreline/sdl.h
Tobias Schramm 909b563cfa sdl: Move pixel format definition to header
This way it can be used by other components, too
2019-10-28 23:48:19 +01:00

37 lines
636 B
C

#ifndef _SDL_H_
#define _SDL_H_
#include <SDL.h>
#include "framebuffer.h"
#include "frontend.h"
#define SDL_PXFMT SDL_PIXELFORMAT_RGBA8888
struct sdl;
typedef int (*sdl_cb_resize)(struct sdl* sdl, unsigned int width, unsigned int height);
struct sdl {
SDL_Window* window;
SDL_Renderer* renderer;
SDL_Texture* texture;
struct fb* fb;
sdl_cb_resize resize_cb;
void* cb_private;
struct frontend front;
};
struct sdl_param {
void* cb_private;
sdl_cb_resize resize_cb;
};
int sdl_alloc(struct frontend** ret, struct fb* fb, void* c);
void sdl_free(struct frontend* front);
int sdl_update(struct frontend* front);
#endif