2023-03-31 20:20:27 +02:00
|
|
|
#ifndef SC_DISPLAY_H
|
|
|
|
#define SC_DISPLAY_H
|
|
|
|
|
|
|
|
#include "common.h"
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <libavformat/avformat.h>
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
|
|
|
|
#include "coords.h"
|
|
|
|
#include "opengl.h"
|
|
|
|
|
2023-04-05 16:04:03 +02:00
|
|
|
#ifdef __APPLE__
|
|
|
|
# define SC_DISPLAY_FORCE_OPENGL_CORE_PROFILE
|
|
|
|
#endif
|
|
|
|
|
2023-03-31 20:20:27 +02:00
|
|
|
struct sc_display {
|
|
|
|
SDL_Renderer *renderer;
|
|
|
|
SDL_Texture *texture;
|
|
|
|
|
|
|
|
struct sc_opengl gl;
|
2023-04-05 16:04:03 +02:00
|
|
|
#ifdef SC_DISPLAY_FORCE_OPENGL_CORE_PROFILE
|
|
|
|
SDL_GLContext *gl_context;
|
|
|
|
#endif
|
|
|
|
|
2023-03-31 20:20:27 +02:00
|
|
|
bool mipmaps;
|
|
|
|
};
|
|
|
|
|
|
|
|
bool
|
|
|
|
sc_display_init(struct sc_display *display, SDL_Window *window, bool mipmaps);
|
|
|
|
|
|
|
|
void
|
|
|
|
sc_display_destroy(struct sc_display *display);
|
|
|
|
|
|
|
|
bool
|
|
|
|
sc_display_set_texture_size(struct sc_display *display, struct sc_size size);
|
|
|
|
|
|
|
|
bool
|
|
|
|
sc_display_update_texture(struct sc_display *display, const AVFrame *frame);
|
|
|
|
|
|
|
|
bool
|
|
|
|
sc_display_render(struct sc_display *display, const SDL_Rect *geometry,
|
|
|
|
unsigned rotation);
|
|
|
|
|
|
|
|
#endif
|