summaryrefslogtreecommitdiffstats
path: root/video/out/gl_utils.h
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2015-01-28 19:40:46 +0100
committerwm4 <wm4@nowhere>2015-01-28 19:40:46 +0100
commit3583559164b922673b2ccdb31f810befae613779 (patch)
treee38e66b50ce6076db8f06def3c296354e182f645 /video/out/gl_utils.h
parent7b3feecbc23e3e0b0d9cf66f02af53d127a0b681 (diff)
downloadmpv-3583559164b922673b2ccdb31f810befae613779.tar.bz2
mpv-3583559164b922673b2ccdb31f810befae613779.tar.xz
vo_opengl: move utility functions from loader to a separate file
gl_common.c contained the function loader (which is big) and additional utility functions (not so big, but will grow when moving more out of gl_video.c). Just split them. There are no changes other than some modifications to comments.
Diffstat (limited to 'video/out/gl_utils.h')
-rw-r--r--video/out/gl_utils.h46
1 files changed, 46 insertions, 0 deletions
diff --git a/video/out/gl_utils.h b/video/out/gl_utils.h
new file mode 100644
index 0000000000..4f32e5ff56
--- /dev/null
+++ b/video/out/gl_utils.h
@@ -0,0 +1,46 @@
+/*
+ * This file is part of mpv.
+ * Parts based on MPlayer code by Reimar Döffinger.
+ *
+ * mpv is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * mpv is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with mpv. If not, see <http://www.gnu.org/licenses/>.
+ *
+ * You can alternatively redistribute this file and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ */
+
+#ifndef MP_GL_UTILS_
+#define MP_GL_UTILS_
+
+#include "gl_common.h"
+
+struct mp_log;
+
+void glCheckError(GL *gl, struct mp_log *log, const char *info);
+
+int glFmt2bpp(GLenum format, GLenum type);
+void glUploadTex(GL *gl, GLenum target, GLenum format, GLenum type,
+ const void *dataptr, int stride,
+ int x, int y, int w, int h, int slice);
+void glClearTex(GL *gl, GLenum target, GLenum format, GLenum type,
+ int x, int y, int w, int h, uint8_t val, void **scratch);
+
+mp_image_t *glGetWindowScreenshot(GL *gl);
+
+// print a multi line string with line numbers (e.g. for shader sources)
+// log, lev: module and log level, as in mp_msg()
+void mp_log_source(struct mp_log *log, int lev, const char *src);
+
+#endif