1 /*****************************************************************************
3 *****************************************************************************
4 * Copyright (C) 2020 Videolabs
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation; either version 2.1 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with this program; if not, write to the Free Software Foundation,
18 * Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301, USA.
19 *****************************************************************************/
21 #ifndef VLC_SUB_RENDERER_H
22 #define VLC_SUB_RENDERER_H
28 #include <vlc_common.h>
29 #include <vlc_opengl.h>
32 #include "gl_common.h"
35 * A subpictures renderer handles the rendering of RGB subpictures.
37 struct vlc_gl_sub_renderer
;
40 * Create a new subpictures renderer
42 * \param gl the GL context
43 * \param api the OpenGL API
44 * \param supports_npot indicate if the implementation supports non-power-of-2
47 struct vlc_gl_sub_renderer
*
48 vlc_gl_sub_renderer_New(vlc_gl_t
*gl
, const struct vlc_gl_api
*api
);
51 * Delete a subpictures renderer
53 * \param sr the renderer
56 vlc_gl_sub_renderer_Delete(struct vlc_gl_sub_renderer
*sr
);
59 * Prepare the fragment shader
61 * Concretely, it allocates OpenGL textures if necessary and uploads the
64 * \param sr the renderer
65 * \param subpicture the subpicture to render
68 vlc_gl_sub_renderer_Prepare(struct vlc_gl_sub_renderer
*sr
,
69 subpicture_t
*subpicture
);
72 * Draw the prepared subpicture
74 * \param sr the renderer
77 vlc_gl_sub_renderer_Draw(struct vlc_gl_sub_renderer
*sr
);