#ifndef SC_DISPLAY_H #define SC_DISPLAY_H #include "common.h" #include #include #include #include #include "coords.h" #include "opengl.h" enum sc_texture_type { SC_TEXTURE_TYPE_FRAME, SC_TEXTURE_TYPE_ICON, }; struct sc_display { SDL_Renderer *renderer; // owned by the caller SDL_Texture *texture; // Only valid if texture != NULL struct sc_size texture_size; enum sc_texture_type texture_type; struct sc_opengl gl; bool mipmaps; uint32_t texture_id; // only set if mipmaps is enabled }; bool sc_display_init(struct sc_display *display, SDL_Renderer *renderer, bool mipmaps); void sc_display_destroy(struct sc_display *display); bool sc_display_set_texture_from_frame(struct sc_display *display, const AVFrame *frame); bool sc_display_set_texture_from_surface(struct sc_display *display, SDL_Surface *surface); #endif