mirror of
https://github.com/mpv-player/mpv
synced 2025-01-06 23:20:15 +00:00
e34957940b
Don't load all the legacy functions (including ancient extensions). Slightly simplify function loader and context creation, now that legacy GL doesn't need to be handled. Remove the code for drawing OSD in legacy mode. Remove all the header hacks, which were meant for ancient OpenGL headers which didn't even support things like OpenGL 1.3. Instead, adjust the GLX check to make sure we get both OpenGL 3x and 2.1 symbols. For win32 and OSX, we assume that the user has the latest headers anyway. For wayland, we hope that things somehow go right.
43 lines
1.0 KiB
C
43 lines
1.0 KiB
C
#ifndef MPLAYER_GL_OSD_H
|
|
#define MPLAYER_GL_OSD_H
|
|
|
|
#include <stdbool.h>
|
|
#include <inttypes.h>
|
|
|
|
#include "gl_common.h"
|
|
#include "sub/osd.h"
|
|
|
|
struct mpgl_osd_part {
|
|
enum sub_bitmap_format format;
|
|
int bitmap_id, bitmap_pos_id;
|
|
GLuint texture;
|
|
int w, h;
|
|
GLuint buffer;
|
|
int num_vertices;
|
|
void *vertices;
|
|
struct bitmap_packer *packer;
|
|
};
|
|
|
|
struct mpgl_osd {
|
|
struct mp_log *log;
|
|
struct osd_state *osd;
|
|
GL *gl;
|
|
bool use_pbo;
|
|
bool scaled;
|
|
struct mpgl_osd_part *parts[MAX_OSD_PARTS];
|
|
const struct osd_fmt_entry *fmt_table;
|
|
bool formats[SUBBITMAP_COUNT];
|
|
void *scratch;
|
|
};
|
|
|
|
struct mpgl_osd *mpgl_osd_init(GL *gl, struct mp_log *log, struct osd_state *osd);
|
|
void mpgl_osd_destroy(struct mpgl_osd *ctx);
|
|
|
|
struct mpgl_osd_part *mpgl_osd_generate(struct mpgl_osd *ctx,
|
|
struct sub_bitmaps *b);
|
|
|
|
void mpgl_osd_set_gl_state(struct mpgl_osd *ctx, struct mpgl_osd_part *p);
|
|
void mpgl_osd_unset_gl_state(struct mpgl_osd *ctx, struct mpgl_osd_part *p);
|
|
|
|
#endif
|