Commit a9d1d85a authored by David Llewellyn-Jones's avatar David Llewellyn-Jones

Added C wrapper for OpenVDB and integrated into build process.

parent 74a23200
......@@ -10,17 +10,30 @@ AC_CONFIG_HEADERS([config.h])
# Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AM_PROG_CC_C_O
# Checks for libraries.
PKG_CHECK_MODULES([FUNCTY], [gtk+-2.0 gdk-2.0 gtkglext-1.0 glee libzip, libpng])
PKG_CHECK_MODULES([OpenEXR], [OpenEXR, tbb])
AC_CHECK_LIB([glut], [glutInit], [], [AC_MSG_ERROR([The glut library is missing.])])
AC_CHECK_LIB([symbolic], [CreateInteger], [], [AC_MSG_ERROR([The symbolic library is missing.])])
# See http://nerdland.net/2009/07/detecting-c-libraries-with-autotools/
AC_MSG_CHECKING([for OpenVDB])
AC_LANG(C++)
SAVED_LIBS=$LIBS
LIBS="$LIBS -lopenvdb"
AC_LINK_IFELSE(
[AC_LANG_PROGRAM([[#include <openvdb/openvdb.h>]], [openvdb::initialize();])],
[AC_MSG_RESULT([yes]); SVX2VDB_LIBS="$SVX2VDB_LIBS -lopenvdb"] [HAVE_OPENVDB=1],
[AC_MSG_ERROR([The openvdb library is missing.])])
LIBS=$LIBS
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h sys/timeb.h GLee.h])
AC_CHECK_HEADERS([stdlib.h string.h sys/timeb.h GLee.h openvdb/openvdb.h])
# Checks for compiler characteristics
AC_C_BIGENDIAN
......
bin_PROGRAMS = ../functy
___functy_SOURCES = function.c function.h function_private.h functy.c functy.h textures.c textures.h utils.c utils.h vis.c vis.h filesave.c filesave.h cartesian.c cartesian.h spherical.c spherical.h shader.c shader.h curve.c curve.h vecsym.c vecsym.h exportply.c exportply.h exportstl.c exportstl.h exportbitmap.c exportbitmap.h exportsvx.c exportsvx.h recall.c recall.h controlvar.c controlvar.h shadow.c shadow.h longpoll.c longpoll.h
___functy_SOURCES = function.c function.h function_private.h functy.c functy.h textures.c textures.h utils.c utils.h vis.c vis.h filesave.c filesave.h cartesian.c cartesian.h spherical.c spherical.h shader.c shader.h curve.c curve.h vecsym.c vecsym.h exportply.c exportply.h exportstl.c exportstl.h exportbitmap.c exportbitmap.h exportsvx.c exportsvx.h recall.c recall.h controlvar.c controlvar.h shadow.c shadow.h longpoll.c longpoll.h exportvdb.c exportvdb.h ovdbc.cpp ovdbc.h
___functy_LDADD = -lm @FUNCTY_LIBS@
___functy_LDADD = -lm @FUNCTY_LIBS@ @OpenEXR_LIBS@
___functy_CPPFLAGS = -DFUNCTYDIR=\"$(datadir)/@PACKAGE@\" -Wall @FUNCTY_CFLAGS@
___functy_CPPFLAGS = -DFUNCTYDIR=\"$(datadir)/@PACKAGE@\" -Wall @FUNCTY_CFLAGS@ @OpenEXR_CFLAGS@
#dist_pkgdata_DATA = ../ui/functy.ui
......@@ -16,6 +16,7 @@
#include "function.h"
#include "function_private.h"
#include "textures.h"
#include "string.h"
///////////////////////////////////////////////////////////////////
// Defines
......@@ -465,6 +466,11 @@ void FunctionShadersRegenerate (FuncPersist * psFuncData) {
ShaderRegenerateVertex (szShader, psFuncData->psShaderData);
if (szShader) {
Recall * out = recopen ("temp.vs", "w");
recwrite (szShader, 1, strlen (szShader), out);
recclose (out);
g_free (szShader);
szShader = NULL;
}
......@@ -488,6 +494,11 @@ void FunctionShadersRegenerate (FuncPersist * psFuncData) {
ShaderRegenerateFragment (szShader, psFuncData->psShaderData);
if (szShader) {
Recall * out = recopen ("temp.fs", "w");
recwrite (szShader, 1, strlen (szShader), out);
recclose (out);
g_free (szShader);
szShader = NULL;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment