1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-02 21:12:23 +00:00
mpv/video/out/opengl/ra_gl.h
wm4 47ea771b7a vo_opengl: further GL API use separation
Move multiple GL-specific things from the renderer to other places like
vo_opengl.c, vo_opengl_cb.c, and ra_gl.c.

The vp_w/vp_h parameters to gl_video_resize() make no sense anymore, and
are implicitly part of struct fbodst.

Checking the main framebuffer depth is moved to vo_opengl.c. For
vo_opengl_cb.c it always assumes 8. The API user now has to override
this manually. The previous heuristic didn't make much sense anyway.

The only remaining dependency on GL is the hwdec stuff, which is harder
to change.
2017-08-07 19:17:28 +02:00

49 lines
1.3 KiB
C

#pragma once
#include "common.h"
#include "ra.h"
#include "gl_utils.h"
// For ra.priv
struct ra_gl {
GL *gl;
bool debug_enable;
};
// For ra_tex.priv
struct ra_tex_gl {
bool own_objects;
GLenum target;
GLuint texture; // 0 if no texture data associated
GLuint fbo; // 0 if no rendering requested, or it default framebuffer
// These 3 fields can be 0 if unknown.
GLint internal_format;
GLenum format;
GLenum type;
struct gl_pbo_upload pbo;
};
// For ra_buf.priv
struct ra_buf_gl {
GLuint buffer;
GLsync fence;
};
// For ra_renderpass.priv
struct ra_renderpass_gl {
GLuint program;
// 1 entry for each ra_renderpass_params.inputs[] entry
GLint *uniform_loc;
int num_uniform_loc; // == ra_renderpass_params.num_inputs
struct gl_vao vao;
};
struct ra *ra_create_gl(GL *gl, struct mp_log *log);
struct ra_tex *ra_create_wrapped_texture(struct ra *ra, GLuint gl_texture,
GLenum gl_target, GLint gl_iformat,
GLenum gl_format, GLenum gl_type,
int w, int h);
struct ra_tex *ra_create_wrapped_fb(struct ra *ra, GLuint gl_fbo, int w, int h);
GL *ra_gl_get(struct ra *ra);
void ra_gl_set_debug(struct ra *ra, bool enable);