From ad45e4d284c8e9213add8a916ed0442b6148276b Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Sun, 23 Oct 2016 17:00:09 +0200 Subject: [PATCH] doc: fix linking with ffmpeg on Linux and start a tutorial program. --- .gitignore | 1 + build/autotools/m4/lol-conf.m4 | 10 ++++++---- doc/tutorial/16_movie.cpp | 25 +++++++++++++++++++++++++ doc/tutorial/Makefile.am | 7 ++++++- 4 files changed, 38 insertions(+), 5 deletions(-) create mode 100644 doc/tutorial/16_movie.cpp diff --git a/.gitignore b/.gitignore index fd3871fe..3c8ae75b 100644 --- a/.gitignore +++ b/.gitignore @@ -101,6 +101,7 @@ doc/tutorial/12_voronoi doc/tutorial/13_shader_builder doc/tutorial/14_lol_lua doc/tutorial/15_lolimgui +doc/tutorial/16_movie tools/make-font # Our data doc/doxygen.cfg diff --git a/build/autotools/m4/lol-conf.m4 b/build/autotools/m4/lol-conf.m4 index c95a3d1b..f557665d 100644 --- a/build/autotools/m4/lol-conf.m4 +++ b/build/autotools/m4/lol-conf.m4 @@ -165,6 +165,7 @@ AM_CONDITIONAL(LOL_USE_GDIPLUS, test "${ac_cv_my_have_gdiplus}" = "yes") dnl Use libavcodec? (required for movie encoding) ac_cv_my_have_ffmpeg="yes" PKG_CHECK_MODULES([LIBAVCODEC], [libavcodec], [:], [ac_cv_my_have_ffmpeg=no]) +PKG_CHECK_MODULES([LIBAVUTIL], [libavutil], [:], [ac_cv_my_have_ffmpeg=no]) PKG_CHECK_MODULES([LIBAVFORMAT], [libavformat], [:], [ac_cv_my_have_ffmpeg=no]) PKG_CHECK_MODULES([LIBSWSCALE], [libswscale], [:], [ac_cv_my_have_ffmpeg=no]) if test "${ac_cv_my_have_ffmpeg}" = "no"; then @@ -173,16 +174,17 @@ if test "${ac_cv_my_have_ffmpeg}" = "no"; then AC_CHECK_HEADERS(libavformat/avformat.h, [:], [ac_cv_my_have_ffmpeg=no]) AC_CHECK_HEADERS(libswscale/swscale.h, [:], [ac_cv_my_have_ffmpeg=no]) if test "${ac_cv_my_have_ffmpeg}" = "yes"; then + LIBAVCODEC_LIBS="-lavcodec" + LIBAVUTIL_LIBS="-lavutil" LIBAVFORMAT_LIBS="-lavformat" - LIBAVCODEC_LIBS="-lavcodec -lavutil" - LIBSWSCALE_LIBS="-lswscale -lswresample" + LIBSWSCALE_LIBS="-lswscale" AC_CHECK_LIB(ws2_32, main, LOL_LIBS="${LOL_LIBS} -lws2_32") fi fi if test "${ac_cv_my_have_ffmpeg}" != "no"; then AC_DEFINE(LOL_USE_FFMPEG, 1, Define to 1 to use FFmpeg) - LOL_CFLAGS="${LOL_CFLAGS} ${LIBAVFORMAT_CFLAGS} ${LIBAVCODEC_CFLAGS} ${SWSCALE_CFLAGS}" - LOL_LIBS="${LOL_LIBS} ${LIBAVFORMAT_LIBS} ${LIBAVCODEC_LIBS} ${LIBSWSCALE_LIBS}" + LOL_CFLAGS="${LOL_CFLAGS} ${LIBAVFORMAT_CFLAGS} ${LIBAVUTIL_CFLAGS} ${LIBAVCODEC_CFLAGS} ${LIBSWSCALE_CFLAGS}" + LOL_LIBS="${LOL_LIBS} ${LIBAVFORMAT_LIBS} ${LIBAVUTIL_LIBS} ${LIBAVCODEC_LIBS} ${LIBSWSCALE_LIBS}" fi AM_CONDITIONAL(LOL_USE_FFMPEG, test "${ac_cv_my_have_ffmpeg}" != "no") diff --git a/doc/tutorial/16_movie.cpp b/doc/tutorial/16_movie.cpp new file mode 100644 index 00000000..e7b8c1fc --- /dev/null +++ b/doc/tutorial/16_movie.cpp @@ -0,0 +1,25 @@ +// +// Lol Engine — Movie tutorial +// +// Copyright © 2016 Sam Hocevar +// +// Lol Engine is free software. It comes without any warranty, to +// the extent permitted by applicable law. You can redistribute it +// and/or modify it under the terms of the Do What the Fuck You Want +// to Public License, Version 2, as published by the WTFPL Task Force. +// See http://www.wtfpl.net/ for more details. +// + +#if HAVE_CONFIG_H +# include "config.h" +#endif + +#include + +using namespace lol; + +int main(int argc, char **argv) +{ + return 0; +} + diff --git a/doc/tutorial/Makefile.am b/doc/tutorial/Makefile.am index c6f9cb1a..a94e1392 100644 --- a/doc/tutorial/Makefile.am +++ b/doc/tutorial/Makefile.am @@ -4,7 +4,8 @@ include $(top_srcdir)/build/autotools/common.am if BUILD_TUTORIAL noinst_PROGRAMS = 01_triangle 02_cube 03_noise 04_texture 05_easymesh \ 06_sprite 07_input 08_fbo 09_sound 11_fractal \ - 12_voronoi 13_shader_builder 14_lol_lua 15_lolimgui + 12_voronoi 13_shader_builder 14_lol_lua 15_lolimgui \ + 16_movie endif 01_triangle_SOURCES = 01_triangle.cpp 01_triangle.lolfx @@ -69,3 +70,7 @@ endif 15_lolimgui_CPPFLAGS = $(AM_CPPFLAGS) 15_lolimgui_DEPENDENCIES = @LOL_DEPS@ +16_movie_SOURCES = 16_movie.cpp +16_movie_CPPFLAGS = $(AM_CPPFLAGS) +16_movie_DEPENDENCIES = @LOL_DEPS@ +