Extract texture management to a separate file
Move texture management out of screen.c, which already handles the window and the rendering. This paves the way to implement optional software filtering (swscale) properly, as an alternative to mipmaps (which are not available everywhere).
This commit is contained in:
33
app/src/frame_texture.h
Normal file
33
app/src/frame_texture.h
Normal file
@@ -0,0 +1,33 @@
|
||||
#ifndef SC_FRAME_TEXTURE_H
|
||||
#define SC_FRAME_TEXTURE_H
|
||||
|
||||
#include "common.h"
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <SDL2/SDL.h>
|
||||
#include <libavformat/avformat.h>
|
||||
|
||||
#include "coords.h"
|
||||
#include "opengl.h"
|
||||
|
||||
struct sc_frame_texture {
|
||||
SDL_Renderer *renderer; // owned by struct screen
|
||||
|
||||
bool mipmaps;
|
||||
struct sc_opengl gl;
|
||||
|
||||
SDL_Texture *texture;
|
||||
struct size texture_size;
|
||||
};
|
||||
|
||||
bool
|
||||
sc_frame_texture_init(struct sc_frame_texture *ftex, SDL_Renderer *renderer,
|
||||
bool mipmaps, struct size initial_size);
|
||||
|
||||
void
|
||||
sc_frame_texture_destroy(struct sc_frame_texture *ftex);
|
||||
|
||||
bool
|
||||
sc_frame_texture_update(struct sc_frame_texture *ftex, const AVFrame *frame);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user