GTEST_DIR ?= /usr/src/gtest
+ # This will be upgraded for each release, although not necessarily for every git commit.
+ # See http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
+ # for the rules as of how this is changed. This does not really mean that Movit will
+ # strive towards having a rock-stable ABI, but at least the soversion will increase
+ # whenever it breaks, so that you will not have silent failures, and distribution package
+ # management can run its course.
+ movit_ltversion = 1:3:0
+ movit_version = 1.0.3
+
prefix = @prefix@
exec_prefix = @exec_prefix@
includedir = @includedir@
datadir = @datadir@
top_builddir = @top_builddir@
with_demo_app = @with_demo_app@
+with_SDL2 = @with_SDL2@
with_coverage = @with_coverage@
CC=@CC@
CXX=@CXX@
-CXXFLAGS=-Wall @CXXFLAGS@ -I$(GTEST_DIR)/include @Eigen3_CFLAGS@ @GLEW_CFLAGS@ @FFTW3_CFLAGS@
+CXXFLAGS=-Wall @CXXFLAGS@ -I$(GTEST_DIR)/include @SDL2_CFLAGS@ @SDL_CFLAGS@ @Eigen3_CFLAGS@ @epoxy_CFLAGS@ @FFTW3_CFLAGS@
+ifeq ($(with_SDL2),yes)
+CXXFLAGS += -DHAVE_SDL2
+endif
- LDFLAGS=@epoxy_LIBS@ @SDL2_LIBS@ @SDL_LIBS@ @FFTW3_LIBS@ -lpthread
- DEMO_LDLIBS=@SDL2_image_LIBS@ @SDL_image_LIBS@ -lrt -lpthread @libpng_LIBS@ @FFTW3_LIBS@
+ LDFLAGS=@LDFLAGS@
-LDLIBS=@GLEW_LIBS@ @FFTW3_LIBS@ -lpthread
-TEST_LDLIBS=@GLEW_LIBS@ @SDL_LIBS@ -lpthread
++LDLIBS=@epoxy_LIBS@ @FFTW3_LIBS@ -lpthread
++TEST_LDLIBS=@epoxy_LIBS@ @SDL_LIBS@ -lpthread
+ DEMO_LDLIBS=@SDL_image_LIBS@ -lrt -lpthread @libpng_LIBS@ @FFTW3_LIBS@
SHELL=@SHELL@
LIBTOOL=@LIBTOOL@ --tag=CXX
RANLIB=ranlib
endif
# Google Test and other test library functions.
- TEST_OBJS = gtest-all.o gtest_sdl_main.o test_util.o
+ OWN_TEST_OBJS = gtest_sdl_main.o test_util.o
+ TEST_OBJS = gtest-all.o $(OWN_TEST_OBJS)
gtest-all.o: $(GTEST_DIR)/src/gtest-all.cc
$(CXX) -MMD $(CPPFLAGS) -I$(GTEST_DIR) $(CXXFLAGS) -c $< -o $@
# Unit tests.
$(TESTS): %: %.o $(TEST_OBJS) libmovit.la
- $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $@ $^ $(LDLIBS)
+ $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -o $@ $^ $(TEST_LDLIBS)
+ OWN_OBJS=$(DEMO_OBJS) $(LIB_OBJS) $(OWN_TEST_OBJS) $(TESTS:=.o)
OBJS=$(DEMO_OBJS) $(LIB_OBJS) $(TEST_OBJS) $(TESTS:=.o)
# A small demo program.
# The library itself.
libmovit.la: $(LIB_OBJS:.o=.lo)
- $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -rpath $(libdir) -o $@ $^ $(LDLIBS)
+ $(LIBTOOL) --mode=link $(CXX) $(LDFLAGS) -rpath $(libdir) -version-info $(movit_ltversion) -o $@ $^ $(LDLIBS)
%.lo: %.cpp
$(LIBTOOL) --mode=compile $(CXX) -MMD -MP $(CPPFLAGS) $(CXXFLAGS) -o $@ -c $<
# These purposefully do not exist.
MISSING_SHADERS = diffusion_effect.frag glow_effect.frag unsharp_mask_effect.frag resize_effect.frag
+ MISSING_SHADERS += fft_convolution_effect.frag fft_input.frag
SHADERS := $(filter-out $(MISSING_SHADERS),$(SHADERS))
install: libmovit.la
- $(LIBTOOL) --mode=install $(INSTALL) -m 0644 libmovit.la $(libdir)/
- $(MKDIR) -p $(includedir)/movit/
- $(INSTALL) -m 0644 $(HDRS) $(includedir)/movit/
- $(MKDIR) -p $(datadir)/movit/
- $(INSTALL) -m 0644 $(SHADERS) $(datadir)/movit/
- $(MKDIR) -p $(libdir)/pkgconfig/
- $(INSTALL) -m 644 movit.pc $(libdir)/pkgconfig/
-
- .PHONY: coverage clean distclean check all install
+ $(MKDIR) -p $(DESTDIR)$(libdir)/
+ $(LIBTOOL) --mode=install $(INSTALL) -m 0644 libmovit.la $(DESTDIR)$(libdir)/
+ $(MKDIR) -p $(DESTDIR)$(includedir)/movit/
+ $(INSTALL) -m 0644 $(HDRS) $(DESTDIR)$(includedir)/movit/
+ $(MKDIR) -p $(DESTDIR)$(datadir)/movit/
+ $(INSTALL) -m 0644 $(SHADERS) $(DESTDIR)$(datadir)/movit/
+ $(MKDIR) -p $(DESTDIR)$(libdir)/pkgconfig/
+ $(INSTALL) -m 644 movit.pc $(DESTDIR)$(libdir)/pkgconfig/
+
+ DISTDIR=movit-$(movit_version)
+ OTHER_DIST_FILES=add.frag autogen.sh blue.frag configure.ac d65.h identity.frag invert_effect.frag Makefile.in mipmap_needing_effect.frag movit.pc.in README NEWS test_util.h widgets.h
+
+ dist:
+ $(MKDIR) $(DISTDIR)
+ cp $(OWN_OBJS:.o=.cpp) $(DISTDIR)/
+ cp $(HDRS) $(DISTDIR)/
+ cp $(SHADERS) $(DISTDIR)/
+ cp $(OTHER_DIST_FILES) $(DISTDIR)/
+ ( cd $(DISTDIR) && aclocal && libtoolize --install --copy && autoconf && $(RM) -r autom4te.cache/ )
+ tar zcvvf ../$(DISTDIR).tar.gz $(DISTDIR)
+ $(RM) -r $(DISTDIR)
+
+ .PHONY: coverage clean distclean check all install dist
called “modern” usually isn't, and it's really not a toolkit.
Movit aims to be a _high-quality_, _high-performance_, _open-source_
- library for video filters. It is currently in alpha stage.
+ library for video filters.
TL;DR, please give me download link and system demands
works fine on Linux and OS X, and Movit is not very POSIX-bound.)
* GNU Make.
* A GPU capable of running GLSL fragment shaders,
- process floating-point textures, and a few other things. If your machine
- is less than five years old _and you have the appropriate drivers_,
- you're home free.
+ processing floating-point textures, and a few other things (all are
+ part of OpenGL 3.0 or newer, although most OpenGL 2.0 cards also
+ have what's needed through extensions). If your machine is less than five
+ years old _and you have the appropriate drivers_, you're home free.
* The [Eigen 3] and [Google Test] libraries. (The library itself
depends only on the former, but you probably want to run the unit tests.)
-* The [GLEW] library, for dealing with OpenGL extensions on various
+* The [epoxy] library, for dealing with OpenGL extensions on various
platforms.
Movit has been tested with Intel GPUs with the Mesa drivers
TL;DR, but I am interested in a programming example instead
===========================================================
-Assuming you have an OpenGL context already set up:
+Assuming you have an OpenGL context already set up (currently you need
+a classic OpenGL context; a GL 3.2+ core context won't do):
<code>
using namespace movit;
-#include <GL/glew.h>
+#include <epoxy/gl.h>
#include "complex_modulate_effect.h"
#include "effect_chain.h"
{
Effect::set_gl_state(glsl_program_num, prefix, sampler_num);
- float num_repeats[] = { num_repeats_x, num_repeats_y };
+ float num_repeats[] = { float(num_repeats_x), float(num_repeats_y) };
set_uniform_vec2(glsl_program_num, prefix, "num_repeats", num_repeats);
// Set the secondary input to repeat (and nearest while we're at it).
AC_CONFIG_MACRO_DIR([m4])
AC_INIT(movit, git)
LT_INIT
+ PKG_PROG_PKG_CONFIG
AC_CONFIG_SRCDIR(effect.cpp)
+ AC_CONFIG_AUX_DIR(.)
AC_PROG_CC
AC_PROG_CXX
PKG_CHECK_MODULES([Eigen3], [eigen3])
-PKG_CHECK_MODULES([GLEW], [glew])
+PKG_CHECK_MODULES([epoxy], [epoxy])
PKG_CHECK_MODULES([FFTW3], [fftw3])
-# Needed for unit tests and the demo app.
-PKG_CHECK_MODULES([SDL], [sdl])
+# Needed for unit tests and the demo app. We prefer SDL2 if possible,
+# but can also use classic SDL.
+with_SDL2=no
+with_demo_app=yes
+PKG_CHECK_MODULES([SDL2], [sdl2], [with_SDL2=yes], [
+ PKG_CHECK_MODULES([SDL], [sdl])
+])
# These are only needed for the demo app.
-with_demo_app=yes
-PKG_CHECK_MODULES([SDL_image], [SDL_image], [], [with_demo_app=no; AC_MSG_WARN([SDL_image not found, demo program will not be built])])
+if test $with_SDL2 = "yes"; then
+ PKG_CHECK_MODULES([SDL2_image], [SDL2_image], [], [with_demo_app=no; AC_MSG_WARN([SDL2_image not found, demo program will not be built])])
+else
+ PKG_CHECK_MODULES([SDL_image], [SDL_image], [], [with_demo_app=no; AC_MSG_WARN([SDL_image not found, demo program will not be built])])
+fi
PKG_CHECK_MODULES([libpng], [libpng12], [], [with_demo_app=no; AC_MSG_WARN([libpng12 not found, demo program will not be built])])
AC_SUBST([with_demo_app])
+AC_SUBST([with_SDL2])
with_coverage=no
AC_ARG_ENABLE([coverage], [ --enable-coverage build with information needed to compute test coverage], [with_coverage=yes])
Version: git
Requires:
Conflicts:
- Libs: -lmovit @epoxy_LIBS@
- Cflags: -I${includedir}/movit @Eigen3_CFLAGS@ @epoxy_CFLAGS@
+ Libs: -lmovit
-Libs.private: @GLEW_LIBS@ @FFTW3_LIBS@
-Cflags: -I${includedir}/movit @Eigen3_CFLAGS@ @GLEW_CFLAGS@ @FFTW3_CFLAGS@
++Libs.private: @epoxy_LIBS@ @FFTW3_LIBS@
++Cflags: -I${includedir}/movit @Eigen3_CFLAGS@ @epoxy_CFLAGS@ @FFTW3_CFLAGS@