diff options
Diffstat (limited to 'src/others/mimesh/libg3d-0.0.8/include/g3d')
22 files changed, 4286 insertions, 0 deletions
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile b/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile new file mode 100644 index 0000000..524e64c --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile | |||
@@ -0,0 +1,470 @@ | |||
1 | # Makefile.in generated by automake 1.10.1 from Makefile.am. | ||
2 | # include/g3d/Makefile. Generated from Makefile.in by configure. | ||
3 | |||
4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | ||
5 | # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | ||
6 | # This Makefile.in is free software; the Free Software Foundation | ||
7 | # gives unlimited permission to copy and/or distribute it, | ||
8 | # with or without modifications, as long as this notice is preserved. | ||
9 | |||
10 | # This program is distributed in the hope that it will be useful, | ||
11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
13 | # PARTICULAR PURPOSE. | ||
14 | |||
15 | |||
16 | |||
17 | |||
18 | pkgdatadir = $(datadir)/libg3d | ||
19 | pkglibdir = $(libdir)/libg3d | ||
20 | pkgincludedir = $(includedir)/libg3d | ||
21 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
22 | install_sh_DATA = $(install_sh) -c -m 644 | ||
23 | install_sh_PROGRAM = $(install_sh) -c | ||
24 | install_sh_SCRIPT = $(install_sh) -c | ||
25 | INSTALL_HEADER = $(INSTALL_DATA) | ||
26 | transform = $(program_transform_name) | ||
27 | NORMAL_INSTALL = : | ||
28 | PRE_INSTALL = : | ||
29 | POST_INSTALL = : | ||
30 | NORMAL_UNINSTALL = : | ||
31 | PRE_UNINSTALL = : | ||
32 | POST_UNINSTALL = : | ||
33 | build_triplet = x86_64-unknown-linux-gnu | ||
34 | host_triplet = x86_64-unknown-linux-gnu | ||
35 | subdir = include/g3d | ||
36 | DIST_COMMON = $(g3dinclude_HEADERS) $(srcdir)/Makefile.am \ | ||
37 | $(srcdir)/Makefile.in $(srcdir)/config.h.in | ||
38 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
39 | am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ | ||
40 | $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \ | ||
41 | $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
42 | $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \ | ||
43 | $(top_srcdir)/configure.in | ||
44 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
45 | $(ACLOCAL_M4) | ||
46 | mkinstalldirs = $(install_sh) -d | ||
47 | CONFIG_HEADER = config.h | ||
48 | CONFIG_CLEAN_FILES = | ||
49 | SOURCES = | ||
50 | DIST_SOURCES = | ||
51 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
52 | am__vpath_adj = case $$p in \ | ||
53 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
54 | *) f=$$p;; \ | ||
55 | esac; | ||
56 | am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; | ||
57 | am__installdirs = "$(DESTDIR)$(g3dincludedir)" | ||
58 | g3dincludeHEADERS_INSTALL = $(INSTALL_HEADER) | ||
59 | HEADERS = $(g3dinclude_HEADERS) | ||
60 | ETAGS = etags | ||
61 | CTAGS = ctags | ||
62 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
63 | ACLOCAL = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run aclocal-1.10 | ||
64 | AMTAR = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run tar | ||
65 | AR = ar | ||
66 | AS = as | ||
67 | AUTOCONF = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoconf | ||
68 | AUTOHEADER = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run autoheader | ||
69 | AUTOMAKE = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run automake-1.10 | ||
70 | AWK = gawk | ||
71 | CC = gcc | ||
72 | CCDEPMODE = depmode=gcc3 | ||
73 | CFLAGS = -g -O2 | ||
74 | CPP = gcc -E | ||
75 | CPPFLAGS = | ||
76 | CXX = g++ | ||
77 | CXXCPP = g++ -E | ||
78 | CXXDEPMODE = depmode=gcc3 | ||
79 | CXXFLAGS = -g -O2 | ||
80 | CYGPATH_W = echo | ||
81 | DBG_CFLAGS = -O2 | ||
82 | DEBUG = 0 | ||
83 | DEFS = -DHAVE_CONFIG_H | ||
84 | DEPDIR = .deps | ||
85 | DLLTOOL = dlltool | ||
86 | ECHO = echo | ||
87 | ECHO_C = | ||
88 | ECHO_N = -n | ||
89 | ECHO_T = | ||
90 | EGREP = /bin/grep -E | ||
91 | EXEEXT = | ||
92 | F77 = | ||
93 | FFLAGS = | ||
94 | GDKPIXBUF_CFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 | ||
95 | GDKPIXBUF_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 | ||
96 | GLIB_CFLAGS = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include | ||
97 | GLIB_GENMARSHAL = glib-genmarshal | ||
98 | GLIB_LIBS = -Wl,--export-dynamic -pthread -lgmodule-2.0 -lrt -lgobject-2.0 -lglib-2.0 | ||
99 | GLIB_MKENUMS = glib-mkenums | ||
100 | GOBJECT_QUERY = gobject-query | ||
101 | GREP = /bin/grep | ||
102 | GTKDOC_CHECK = /usr/bin/gtkdoc-check | ||
103 | GTK_CFLAGS = -pthread -I/usr/include/gtk-2.0 -I/usr/lib/x86_64-linux-gnu/gtk-2.0/include -I/usr/include/atk-1.0 -I/usr/include/cairo -I/usr/include/gdk-pixbuf-2.0 -I/usr/include/pango-1.0 -I/usr/include/gio-unix-2.0/ -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/libpng12 | ||
104 | GTK_LIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0 | ||
105 | HTML_DIR = ${datadir}/gtk-doc/html | ||
106 | INSTALL = /usr/bin/install -c | ||
107 | INSTALL_DATA = ${INSTALL} -m 644 | ||
108 | INSTALL_PROGRAM = ${INSTALL} | ||
109 | INSTALL_SCRIPT = ${INSTALL} | ||
110 | INSTALL_STRIP_PROGRAM = $(install_sh) -c -s | ||
111 | LDFLAGS = | ||
112 | LEX = flex | ||
113 | LEXLIB = -lfl | ||
114 | LEX_OUTPUT_ROOT = lex.yy | ||
115 | LIBGSF_CFLAGS = -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -I/usr/include/libxml2 -I/usr/include/libgsf-1 | ||
116 | LIBGSF_LIBS = -lgsf-1 -lgobject-2.0 -lxml2 -lglib-2.0 | ||
117 | LIBOBJS = | ||
118 | LIBS = -lm | ||
119 | LIBTOOL = $(SHELL) $(top_builddir)/libtool | ||
120 | LIBXML2_CFLAGS = -I/usr/include/libxml2 | ||
121 | LIBXML2_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 | ||
122 | LN_S = ln -s | ||
123 | LTLIBOBJS = | ||
124 | LTVERSION = 0:8:0 | ||
125 | MAGIC_LIBS = -lmagic | ||
126 | MAKEINFO = ${SHELL} /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/missing --run makeinfo | ||
127 | MATH_LIBS = -lm | ||
128 | MKDIR_P = /bin/mkdir -p | ||
129 | OBJDUMP = objdump | ||
130 | OBJEXT = o | ||
131 | PACKAGE = libg3d | ||
132 | PACKAGE_BUGREPORT = | ||
133 | PACKAGE_NAME = | ||
134 | PACKAGE_STRING = | ||
135 | PACKAGE_TARNAME = | ||
136 | PACKAGE_VERSION = | ||
137 | PATH_SEPARATOR = : | ||
138 | PKG_CONFIG = /usr/bin/pkg-config | ||
139 | PLUGINS_LDFLAGS = -avoid-version -export-dynamic | ||
140 | RANLIB = ranlib | ||
141 | SET_MAKE = | ||
142 | SHELL = /bin/bash | ||
143 | STRIP = strip | ||
144 | VERSION = 0.0.8 | ||
145 | XML2_CONFIG = /usr/bin/xml2-config | ||
146 | XML_CPPFLAGS = -I/usr/include/libxml2 | ||
147 | XML_LIBS = -L/usr/lib/x86_64-linux-gnu -lxml2 | ||
148 | Z_CFLAGS = | ||
149 | Z_LIBS = -lz | ||
150 | abs_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/include/g3d | ||
151 | abs_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/include/g3d | ||
152 | abs_top_builddir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 | ||
153 | abs_top_srcdir = /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8 | ||
154 | ac_ct_CC = gcc | ||
155 | ac_ct_CXX = g++ | ||
156 | ac_ct_F77 = | ||
157 | am__include = include | ||
158 | am__leading_dot = . | ||
159 | am__quote = | ||
160 | am__tar = ${AMTAR} chof - "$$tardir" | ||
161 | am__untar = ${AMTAR} xf - | ||
162 | bindir = ${exec_prefix}/bin | ||
163 | build = x86_64-unknown-linux-gnu | ||
164 | build_alias = | ||
165 | build_cpu = x86_64 | ||
166 | build_os = linux-gnu | ||
167 | build_vendor = unknown | ||
168 | builddir = . | ||
169 | datadir = ${datarootdir} | ||
170 | datarootdir = ${prefix}/share | ||
171 | docdir = ${datarootdir}/doc/${PACKAGE} | ||
172 | dvidir = ${docdir} | ||
173 | exec_prefix = ${prefix} | ||
174 | host = x86_64-unknown-linux-gnu | ||
175 | host_alias = | ||
176 | host_cpu = x86_64 | ||
177 | host_os = linux-gnu | ||
178 | host_vendor = unknown | ||
179 | htmldir = ${docdir} | ||
180 | includedir = ${prefix}/include | ||
181 | infodir = ${datarootdir}/info | ||
182 | install_sh = $(SHELL) /home/dvs1/VirtualWorlds/SOURCE/SledjHamr/src/others/mimesh/libg3d-0.0.8/config/install-sh | ||
183 | libdir = ${exec_prefix}/lib | ||
184 | libexecdir = ${exec_prefix}/libexec | ||
185 | localedir = ${datarootdir}/locale | ||
186 | localstatedir = ${prefix}/var | ||
187 | mandir = ${datarootdir}/man | ||
188 | mkdir_p = /bin/mkdir -p | ||
189 | oldincludedir = /usr/include | ||
190 | pdfdir = ${docdir} | ||
191 | prefix = /usr/local | ||
192 | program_transform_name = s,x,x, | ||
193 | psdir = ${docdir} | ||
194 | sbindir = ${exec_prefix}/sbin | ||
195 | sharedstatedir = ${prefix}/com | ||
196 | srcdir = . | ||
197 | sysconfdir = ${prefix}/etc | ||
198 | target_alias = | ||
199 | top_builddir = ../.. | ||
200 | top_srcdir = ../.. | ||
201 | g3dincludedir = $(includedir)/g3d | ||
202 | g3dinclude_HEADERS = \ | ||
203 | debug.h \ | ||
204 | g3d.h \ | ||
205 | types.h \ | ||
206 | context.h \ | ||
207 | plugins.h \ | ||
208 | model.h \ | ||
209 | object.h \ | ||
210 | face.h \ | ||
211 | material.h \ | ||
212 | texture.h \ | ||
213 | stream.h \ | ||
214 | read.h \ | ||
215 | iff.h \ | ||
216 | primitive.h \ | ||
217 | vector.h \ | ||
218 | matrix.h \ | ||
219 | quat.h | ||
220 | |||
221 | all: config.h | ||
222 | $(MAKE) $(AM_MAKEFLAGS) all-am | ||
223 | |||
224 | .SUFFIXES: | ||
225 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
226 | @for dep in $?; do \ | ||
227 | case '$(am__configure_deps)' in \ | ||
228 | *$$dep*) \ | ||
229 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ | ||
230 | && exit 0; \ | ||
231 | exit 1;; \ | ||
232 | esac; \ | ||
233 | done; \ | ||
234 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/g3d/Makefile'; \ | ||
235 | cd $(top_srcdir) && \ | ||
236 | $(AUTOMAKE) --gnu include/g3d/Makefile | ||
237 | .PRECIOUS: Makefile | ||
238 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
239 | @case '$?' in \ | ||
240 | *config.status*) \ | ||
241 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
242 | *) \ | ||
243 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
244 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
245 | esac; | ||
246 | |||
247 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
248 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
249 | |||
250 | $(top_srcdir)/configure: $(am__configure_deps) | ||
251 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
252 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
253 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
254 | |||
255 | config.h: stamp-h1 | ||
256 | @if test ! -f $@; then \ | ||
257 | rm -f stamp-h1; \ | ||
258 | $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ | ||
259 | else :; fi | ||
260 | |||
261 | stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status | ||
262 | @rm -f stamp-h1 | ||
263 | cd $(top_builddir) && $(SHELL) ./config.status include/g3d/config.h | ||
264 | $(srcdir)/config.h.in: $(am__configure_deps) | ||
265 | cd $(top_srcdir) && $(AUTOHEADER) | ||
266 | rm -f stamp-h1 | ||
267 | touch $@ | ||
268 | |||
269 | distclean-hdr: | ||
270 | -rm -f config.h stamp-h1 | ||
271 | |||
272 | mostlyclean-libtool: | ||
273 | -rm -f *.lo | ||
274 | |||
275 | clean-libtool: | ||
276 | -rm -rf .libs _libs | ||
277 | install-g3dincludeHEADERS: $(g3dinclude_HEADERS) | ||
278 | @$(NORMAL_INSTALL) | ||
279 | test -z "$(g3dincludedir)" || $(MKDIR_P) "$(DESTDIR)$(g3dincludedir)" | ||
280 | @list='$(g3dinclude_HEADERS)'; for p in $$list; do \ | ||
281 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | ||
282 | f=$(am__strip_dir) \ | ||
283 | echo " $(g3dincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(g3dincludedir)/$$f'"; \ | ||
284 | $(g3dincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(g3dincludedir)/$$f"; \ | ||
285 | done | ||
286 | |||
287 | uninstall-g3dincludeHEADERS: | ||
288 | @$(NORMAL_UNINSTALL) | ||
289 | @list='$(g3dinclude_HEADERS)'; for p in $$list; do \ | ||
290 | f=$(am__strip_dir) \ | ||
291 | echo " rm -f '$(DESTDIR)$(g3dincludedir)/$$f'"; \ | ||
292 | rm -f "$(DESTDIR)$(g3dincludedir)/$$f"; \ | ||
293 | done | ||
294 | |||
295 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
296 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
297 | unique=`for i in $$list; do \ | ||
298 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
299 | done | \ | ||
300 | $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ | ||
301 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
302 | mkid -fID $$unique | ||
303 | tags: TAGS | ||
304 | |||
305 | TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ | ||
306 | $(TAGS_FILES) $(LISP) | ||
307 | tags=; \ | ||
308 | here=`pwd`; \ | ||
309 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ | ||
310 | unique=`for i in $$list; do \ | ||
311 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
312 | done | \ | ||
313 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
314 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
315 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ | ||
316 | test -n "$$unique" || unique=$$empty_fix; \ | ||
317 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
318 | $$tags $$unique; \ | ||
319 | fi | ||
320 | ctags: CTAGS | ||
321 | CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ | ||
322 | $(TAGS_FILES) $(LISP) | ||
323 | tags=; \ | ||
324 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ | ||
325 | unique=`for i in $$list; do \ | ||
326 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
327 | done | \ | ||
328 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
329 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
330 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ | ||
331 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
332 | $$tags $$unique | ||
333 | |||
334 | GTAGS: | ||
335 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
336 | && cd $(top_srcdir) \ | ||
337 | && gtags -i $(GTAGS_ARGS) $$here | ||
338 | |||
339 | distclean-tags: | ||
340 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
341 | |||
342 | distdir: $(DISTFILES) | ||
343 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
344 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
345 | list='$(DISTFILES)'; \ | ||
346 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
347 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
348 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
349 | case $$dist_files in \ | ||
350 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
351 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
352 | sort -u` ;; \ | ||
353 | esac; \ | ||
354 | for file in $$dist_files; do \ | ||
355 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
356 | if test -d $$d/$$file; then \ | ||
357 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
358 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
359 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ | ||
360 | fi; \ | ||
361 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ | ||
362 | else \ | ||
363 | test -f $(distdir)/$$file \ | ||
364 | || cp -p $$d/$$file $(distdir)/$$file \ | ||
365 | || exit 1; \ | ||
366 | fi; \ | ||
367 | done | ||
368 | check-am: all-am | ||
369 | check: check-am | ||
370 | all-am: Makefile $(HEADERS) config.h | ||
371 | installdirs: | ||
372 | for dir in "$(DESTDIR)$(g3dincludedir)"; do \ | ||
373 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
374 | done | ||
375 | install: install-am | ||
376 | install-exec: install-exec-am | ||
377 | install-data: install-data-am | ||
378 | uninstall: uninstall-am | ||
379 | |||
380 | install-am: all-am | ||
381 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
382 | |||
383 | installcheck: installcheck-am | ||
384 | install-strip: | ||
385 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
386 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
387 | `test -z '$(STRIP)' || \ | ||
388 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
389 | mostlyclean-generic: | ||
390 | |||
391 | clean-generic: | ||
392 | |||
393 | distclean-generic: | ||
394 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
395 | |||
396 | maintainer-clean-generic: | ||
397 | @echo "This command is intended for maintainers to use" | ||
398 | @echo "it deletes files that may require special tools to rebuild." | ||
399 | clean: clean-am | ||
400 | |||
401 | clean-am: clean-generic clean-libtool mostlyclean-am | ||
402 | |||
403 | distclean: distclean-am | ||
404 | -rm -f Makefile | ||
405 | distclean-am: clean-am distclean-generic distclean-hdr distclean-tags | ||
406 | |||
407 | dvi: dvi-am | ||
408 | |||
409 | dvi-am: | ||
410 | |||
411 | html: html-am | ||
412 | |||
413 | info: info-am | ||
414 | |||
415 | info-am: | ||
416 | |||
417 | install-data-am: install-g3dincludeHEADERS | ||
418 | |||
419 | install-dvi: install-dvi-am | ||
420 | |||
421 | install-exec-am: | ||
422 | |||
423 | install-html: install-html-am | ||
424 | |||
425 | install-info: install-info-am | ||
426 | |||
427 | install-man: | ||
428 | |||
429 | install-pdf: install-pdf-am | ||
430 | |||
431 | install-ps: install-ps-am | ||
432 | |||
433 | installcheck-am: | ||
434 | |||
435 | maintainer-clean: maintainer-clean-am | ||
436 | -rm -f Makefile | ||
437 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
438 | |||
439 | mostlyclean: mostlyclean-am | ||
440 | |||
441 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool | ||
442 | |||
443 | pdf: pdf-am | ||
444 | |||
445 | pdf-am: | ||
446 | |||
447 | ps: ps-am | ||
448 | |||
449 | ps-am: | ||
450 | |||
451 | uninstall-am: uninstall-g3dincludeHEADERS | ||
452 | |||
453 | .MAKE: install-am install-strip | ||
454 | |||
455 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
456 | clean-libtool ctags distclean distclean-generic distclean-hdr \ | ||
457 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | ||
458 | html-am info info-am install install-am install-data \ | ||
459 | install-data-am install-dvi install-dvi-am install-exec \ | ||
460 | install-exec-am install-g3dincludeHEADERS install-html \ | ||
461 | install-html-am install-info install-info-am install-man \ | ||
462 | install-pdf install-pdf-am install-ps install-ps-am \ | ||
463 | install-strip installcheck installcheck-am installdirs \ | ||
464 | maintainer-clean maintainer-clean-generic mostlyclean \ | ||
465 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
466 | tags uninstall uninstall-am uninstall-g3dincludeHEADERS | ||
467 | |||
468 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
469 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
470 | .NOEXPORT: | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.am b/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.am new file mode 100644 index 0000000..9b31564 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.am | |||
@@ -0,0 +1,21 @@ | |||
1 | g3dincludedir = $(includedir)/g3d | ||
2 | |||
3 | g3dinclude_HEADERS = \ | ||
4 | debug.h \ | ||
5 | g3d.h \ | ||
6 | types.h \ | ||
7 | context.h \ | ||
8 | plugins.h \ | ||
9 | model.h \ | ||
10 | object.h \ | ||
11 | face.h \ | ||
12 | material.h \ | ||
13 | texture.h \ | ||
14 | stream.h \ | ||
15 | read.h \ | ||
16 | iff.h \ | ||
17 | primitive.h \ | ||
18 | vector.h \ | ||
19 | matrix.h \ | ||
20 | quat.h | ||
21 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.in b/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.in new file mode 100644 index 0000000..9b863f4 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/Makefile.in | |||
@@ -0,0 +1,470 @@ | |||
1 | # Makefile.in generated by automake 1.10.1 from Makefile.am. | ||
2 | # @configure_input@ | ||
3 | |||
4 | # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, | ||
5 | # 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. | ||
6 | # This Makefile.in is free software; the Free Software Foundation | ||
7 | # gives unlimited permission to copy and/or distribute it, | ||
8 | # with or without modifications, as long as this notice is preserved. | ||
9 | |||
10 | # This program is distributed in the hope that it will be useful, | ||
11 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without | ||
12 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A | ||
13 | # PARTICULAR PURPOSE. | ||
14 | |||
15 | @SET_MAKE@ | ||
16 | |||
17 | VPATH = @srcdir@ | ||
18 | pkgdatadir = $(datadir)/@PACKAGE@ | ||
19 | pkglibdir = $(libdir)/@PACKAGE@ | ||
20 | pkgincludedir = $(includedir)/@PACKAGE@ | ||
21 | am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd | ||
22 | install_sh_DATA = $(install_sh) -c -m 644 | ||
23 | install_sh_PROGRAM = $(install_sh) -c | ||
24 | install_sh_SCRIPT = $(install_sh) -c | ||
25 | INSTALL_HEADER = $(INSTALL_DATA) | ||
26 | transform = $(program_transform_name) | ||
27 | NORMAL_INSTALL = : | ||
28 | PRE_INSTALL = : | ||
29 | POST_INSTALL = : | ||
30 | NORMAL_UNINSTALL = : | ||
31 | PRE_UNINSTALL = : | ||
32 | POST_UNINSTALL = : | ||
33 | build_triplet = @build@ | ||
34 | host_triplet = @host@ | ||
35 | subdir = include/g3d | ||
36 | DIST_COMMON = $(g3dinclude_HEADERS) $(srcdir)/Makefile.am \ | ||
37 | $(srcdir)/Makefile.in $(srcdir)/config.h.in | ||
38 | ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 | ||
39 | am__aclocal_m4_deps = $(top_srcdir)/m4/acinclude.m4 \ | ||
40 | $(top_srcdir)/m4/glib-2.0.m4 $(top_srcdir)/m4/gtk-2.0.m4 \ | ||
41 | $(top_srcdir)/m4/gtk-doc.m4 $(top_srcdir)/m4/libtool.m4 \ | ||
42 | $(top_srcdir)/m4/libxml2.m4 $(top_srcdir)/m4/win32.m4 \ | ||
43 | $(top_srcdir)/configure.in | ||
44 | am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ | ||
45 | $(ACLOCAL_M4) | ||
46 | mkinstalldirs = $(install_sh) -d | ||
47 | CONFIG_HEADER = config.h | ||
48 | CONFIG_CLEAN_FILES = | ||
49 | SOURCES = | ||
50 | DIST_SOURCES = | ||
51 | am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; | ||
52 | am__vpath_adj = case $$p in \ | ||
53 | $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ | ||
54 | *) f=$$p;; \ | ||
55 | esac; | ||
56 | am__strip_dir = `echo $$p | sed -e 's|^.*/||'`; | ||
57 | am__installdirs = "$(DESTDIR)$(g3dincludedir)" | ||
58 | g3dincludeHEADERS_INSTALL = $(INSTALL_HEADER) | ||
59 | HEADERS = $(g3dinclude_HEADERS) | ||
60 | ETAGS = etags | ||
61 | CTAGS = ctags | ||
62 | DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) | ||
63 | ACLOCAL = @ACLOCAL@ | ||
64 | AMTAR = @AMTAR@ | ||
65 | AR = @AR@ | ||
66 | AS = @AS@ | ||
67 | AUTOCONF = @AUTOCONF@ | ||
68 | AUTOHEADER = @AUTOHEADER@ | ||
69 | AUTOMAKE = @AUTOMAKE@ | ||
70 | AWK = @AWK@ | ||
71 | CC = @CC@ | ||
72 | CCDEPMODE = @CCDEPMODE@ | ||
73 | CFLAGS = @CFLAGS@ | ||
74 | CPP = @CPP@ | ||
75 | CPPFLAGS = @CPPFLAGS@ | ||
76 | CXX = @CXX@ | ||
77 | CXXCPP = @CXXCPP@ | ||
78 | CXXDEPMODE = @CXXDEPMODE@ | ||
79 | CXXFLAGS = @CXXFLAGS@ | ||
80 | CYGPATH_W = @CYGPATH_W@ | ||
81 | DBG_CFLAGS = @DBG_CFLAGS@ | ||
82 | DEBUG = @DEBUG@ | ||
83 | DEFS = @DEFS@ | ||
84 | DEPDIR = @DEPDIR@ | ||
85 | DLLTOOL = @DLLTOOL@ | ||
86 | ECHO = @ECHO@ | ||
87 | ECHO_C = @ECHO_C@ | ||
88 | ECHO_N = @ECHO_N@ | ||
89 | ECHO_T = @ECHO_T@ | ||
90 | EGREP = @EGREP@ | ||
91 | EXEEXT = @EXEEXT@ | ||
92 | F77 = @F77@ | ||
93 | FFLAGS = @FFLAGS@ | ||
94 | GDKPIXBUF_CFLAGS = @GDKPIXBUF_CFLAGS@ | ||
95 | GDKPIXBUF_LIBS = @GDKPIXBUF_LIBS@ | ||
96 | GLIB_CFLAGS = @GLIB_CFLAGS@ | ||
97 | GLIB_GENMARSHAL = @GLIB_GENMARSHAL@ | ||
98 | GLIB_LIBS = @GLIB_LIBS@ | ||
99 | GLIB_MKENUMS = @GLIB_MKENUMS@ | ||
100 | GOBJECT_QUERY = @GOBJECT_QUERY@ | ||
101 | GREP = @GREP@ | ||
102 | GTKDOC_CHECK = @GTKDOC_CHECK@ | ||
103 | GTK_CFLAGS = @GTK_CFLAGS@ | ||
104 | GTK_LIBS = @GTK_LIBS@ | ||
105 | HTML_DIR = @HTML_DIR@ | ||
106 | INSTALL = @INSTALL@ | ||
107 | INSTALL_DATA = @INSTALL_DATA@ | ||
108 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | ||
109 | INSTALL_SCRIPT = @INSTALL_SCRIPT@ | ||
110 | INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ | ||
111 | LDFLAGS = @LDFLAGS@ | ||
112 | LEX = @LEX@ | ||
113 | LEXLIB = @LEXLIB@ | ||
114 | LEX_OUTPUT_ROOT = @LEX_OUTPUT_ROOT@ | ||
115 | LIBGSF_CFLAGS = @LIBGSF_CFLAGS@ | ||
116 | LIBGSF_LIBS = @LIBGSF_LIBS@ | ||
117 | LIBOBJS = @LIBOBJS@ | ||
118 | LIBS = @LIBS@ | ||
119 | LIBTOOL = @LIBTOOL@ | ||
120 | LIBXML2_CFLAGS = @LIBXML2_CFLAGS@ | ||
121 | LIBXML2_LIBS = @LIBXML2_LIBS@ | ||
122 | LN_S = @LN_S@ | ||
123 | LTLIBOBJS = @LTLIBOBJS@ | ||
124 | LTVERSION = @LTVERSION@ | ||
125 | MAGIC_LIBS = @MAGIC_LIBS@ | ||
126 | MAKEINFO = @MAKEINFO@ | ||
127 | MATH_LIBS = @MATH_LIBS@ | ||
128 | MKDIR_P = @MKDIR_P@ | ||
129 | OBJDUMP = @OBJDUMP@ | ||
130 | OBJEXT = @OBJEXT@ | ||
131 | PACKAGE = @PACKAGE@ | ||
132 | PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ | ||
133 | PACKAGE_NAME = @PACKAGE_NAME@ | ||
134 | PACKAGE_STRING = @PACKAGE_STRING@ | ||
135 | PACKAGE_TARNAME = @PACKAGE_TARNAME@ | ||
136 | PACKAGE_VERSION = @PACKAGE_VERSION@ | ||
137 | PATH_SEPARATOR = @PATH_SEPARATOR@ | ||
138 | PKG_CONFIG = @PKG_CONFIG@ | ||
139 | PLUGINS_LDFLAGS = @PLUGINS_LDFLAGS@ | ||
140 | RANLIB = @RANLIB@ | ||
141 | SET_MAKE = @SET_MAKE@ | ||
142 | SHELL = @SHELL@ | ||
143 | STRIP = @STRIP@ | ||
144 | VERSION = @VERSION@ | ||
145 | XML2_CONFIG = @XML2_CONFIG@ | ||
146 | XML_CPPFLAGS = @XML_CPPFLAGS@ | ||
147 | XML_LIBS = @XML_LIBS@ | ||
148 | Z_CFLAGS = @Z_CFLAGS@ | ||
149 | Z_LIBS = @Z_LIBS@ | ||
150 | abs_builddir = @abs_builddir@ | ||
151 | abs_srcdir = @abs_srcdir@ | ||
152 | abs_top_builddir = @abs_top_builddir@ | ||
153 | abs_top_srcdir = @abs_top_srcdir@ | ||
154 | ac_ct_CC = @ac_ct_CC@ | ||
155 | ac_ct_CXX = @ac_ct_CXX@ | ||
156 | ac_ct_F77 = @ac_ct_F77@ | ||
157 | am__include = @am__include@ | ||
158 | am__leading_dot = @am__leading_dot@ | ||
159 | am__quote = @am__quote@ | ||
160 | am__tar = @am__tar@ | ||
161 | am__untar = @am__untar@ | ||
162 | bindir = @bindir@ | ||
163 | build = @build@ | ||
164 | build_alias = @build_alias@ | ||
165 | build_cpu = @build_cpu@ | ||
166 | build_os = @build_os@ | ||
167 | build_vendor = @build_vendor@ | ||
168 | builddir = @builddir@ | ||
169 | datadir = @datadir@ | ||
170 | datarootdir = @datarootdir@ | ||
171 | docdir = @docdir@ | ||
172 | dvidir = @dvidir@ | ||
173 | exec_prefix = @exec_prefix@ | ||
174 | host = @host@ | ||
175 | host_alias = @host_alias@ | ||
176 | host_cpu = @host_cpu@ | ||
177 | host_os = @host_os@ | ||
178 | host_vendor = @host_vendor@ | ||
179 | htmldir = @htmldir@ | ||
180 | includedir = @includedir@ | ||
181 | infodir = @infodir@ | ||
182 | install_sh = @install_sh@ | ||
183 | libdir = @libdir@ | ||
184 | libexecdir = @libexecdir@ | ||
185 | localedir = @localedir@ | ||
186 | localstatedir = @localstatedir@ | ||
187 | mandir = @mandir@ | ||
188 | mkdir_p = @mkdir_p@ | ||
189 | oldincludedir = @oldincludedir@ | ||
190 | pdfdir = @pdfdir@ | ||
191 | prefix = @prefix@ | ||
192 | program_transform_name = @program_transform_name@ | ||
193 | psdir = @psdir@ | ||
194 | sbindir = @sbindir@ | ||
195 | sharedstatedir = @sharedstatedir@ | ||
196 | srcdir = @srcdir@ | ||
197 | sysconfdir = @sysconfdir@ | ||
198 | target_alias = @target_alias@ | ||
199 | top_builddir = @top_builddir@ | ||
200 | top_srcdir = @top_srcdir@ | ||
201 | g3dincludedir = $(includedir)/g3d | ||
202 | g3dinclude_HEADERS = \ | ||
203 | debug.h \ | ||
204 | g3d.h \ | ||
205 | types.h \ | ||
206 | context.h \ | ||
207 | plugins.h \ | ||
208 | model.h \ | ||
209 | object.h \ | ||
210 | face.h \ | ||
211 | material.h \ | ||
212 | texture.h \ | ||
213 | stream.h \ | ||
214 | read.h \ | ||
215 | iff.h \ | ||
216 | primitive.h \ | ||
217 | vector.h \ | ||
218 | matrix.h \ | ||
219 | quat.h | ||
220 | |||
221 | all: config.h | ||
222 | $(MAKE) $(AM_MAKEFLAGS) all-am | ||
223 | |||
224 | .SUFFIXES: | ||
225 | $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps) | ||
226 | @for dep in $?; do \ | ||
227 | case '$(am__configure_deps)' in \ | ||
228 | *$$dep*) \ | ||
229 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh \ | ||
230 | && exit 0; \ | ||
231 | exit 1;; \ | ||
232 | esac; \ | ||
233 | done; \ | ||
234 | echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/g3d/Makefile'; \ | ||
235 | cd $(top_srcdir) && \ | ||
236 | $(AUTOMAKE) --gnu include/g3d/Makefile | ||
237 | .PRECIOUS: Makefile | ||
238 | Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status | ||
239 | @case '$?' in \ | ||
240 | *config.status*) \ | ||
241 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ | ||
242 | *) \ | ||
243 | echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ | ||
244 | cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ | ||
245 | esac; | ||
246 | |||
247 | $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) | ||
248 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
249 | |||
250 | $(top_srcdir)/configure: $(am__configure_deps) | ||
251 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
252 | $(ACLOCAL_M4): $(am__aclocal_m4_deps) | ||
253 | cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh | ||
254 | |||
255 | config.h: stamp-h1 | ||
256 | @if test ! -f $@; then \ | ||
257 | rm -f stamp-h1; \ | ||
258 | $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \ | ||
259 | else :; fi | ||
260 | |||
261 | stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status | ||
262 | @rm -f stamp-h1 | ||
263 | cd $(top_builddir) && $(SHELL) ./config.status include/g3d/config.h | ||
264 | $(srcdir)/config.h.in: $(am__configure_deps) | ||
265 | cd $(top_srcdir) && $(AUTOHEADER) | ||
266 | rm -f stamp-h1 | ||
267 | touch $@ | ||
268 | |||
269 | distclean-hdr: | ||
270 | -rm -f config.h stamp-h1 | ||
271 | |||
272 | mostlyclean-libtool: | ||
273 | -rm -f *.lo | ||
274 | |||
275 | clean-libtool: | ||
276 | -rm -rf .libs _libs | ||
277 | install-g3dincludeHEADERS: $(g3dinclude_HEADERS) | ||
278 | @$(NORMAL_INSTALL) | ||
279 | test -z "$(g3dincludedir)" || $(MKDIR_P) "$(DESTDIR)$(g3dincludedir)" | ||
280 | @list='$(g3dinclude_HEADERS)'; for p in $$list; do \ | ||
281 | if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ | ||
282 | f=$(am__strip_dir) \ | ||
283 | echo " $(g3dincludeHEADERS_INSTALL) '$$d$$p' '$(DESTDIR)$(g3dincludedir)/$$f'"; \ | ||
284 | $(g3dincludeHEADERS_INSTALL) "$$d$$p" "$(DESTDIR)$(g3dincludedir)/$$f"; \ | ||
285 | done | ||
286 | |||
287 | uninstall-g3dincludeHEADERS: | ||
288 | @$(NORMAL_UNINSTALL) | ||
289 | @list='$(g3dinclude_HEADERS)'; for p in $$list; do \ | ||
290 | f=$(am__strip_dir) \ | ||
291 | echo " rm -f '$(DESTDIR)$(g3dincludedir)/$$f'"; \ | ||
292 | rm -f "$(DESTDIR)$(g3dincludedir)/$$f"; \ | ||
293 | done | ||
294 | |||
295 | ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) | ||
296 | list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ | ||
297 | unique=`for i in $$list; do \ | ||
298 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
299 | done | \ | ||
300 | $(AWK) '{ files[$$0] = 1; nonemtpy = 1; } \ | ||
301 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
302 | mkid -fID $$unique | ||
303 | tags: TAGS | ||
304 | |||
305 | TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ | ||
306 | $(TAGS_FILES) $(LISP) | ||
307 | tags=; \ | ||
308 | here=`pwd`; \ | ||
309 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ | ||
310 | unique=`for i in $$list; do \ | ||
311 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
312 | done | \ | ||
313 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
314 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
315 | if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \ | ||
316 | test -n "$$unique" || unique=$$empty_fix; \ | ||
317 | $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ | ||
318 | $$tags $$unique; \ | ||
319 | fi | ||
320 | ctags: CTAGS | ||
321 | CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \ | ||
322 | $(TAGS_FILES) $(LISP) | ||
323 | tags=; \ | ||
324 | list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \ | ||
325 | unique=`for i in $$list; do \ | ||
326 | if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ | ||
327 | done | \ | ||
328 | $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ | ||
329 | END { if (nonempty) { for (i in files) print i; }; }'`; \ | ||
330 | test -z "$(CTAGS_ARGS)$$tags$$unique" \ | ||
331 | || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ | ||
332 | $$tags $$unique | ||
333 | |||
334 | GTAGS: | ||
335 | here=`$(am__cd) $(top_builddir) && pwd` \ | ||
336 | && cd $(top_srcdir) \ | ||
337 | && gtags -i $(GTAGS_ARGS) $$here | ||
338 | |||
339 | distclean-tags: | ||
340 | -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags | ||
341 | |||
342 | distdir: $(DISTFILES) | ||
343 | @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
344 | topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ | ||
345 | list='$(DISTFILES)'; \ | ||
346 | dist_files=`for file in $$list; do echo $$file; done | \ | ||
347 | sed -e "s|^$$srcdirstrip/||;t" \ | ||
348 | -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ | ||
349 | case $$dist_files in \ | ||
350 | */*) $(MKDIR_P) `echo "$$dist_files" | \ | ||
351 | sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ | ||
352 | sort -u` ;; \ | ||
353 | esac; \ | ||
354 | for file in $$dist_files; do \ | ||
355 | if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ | ||
356 | if test -d $$d/$$file; then \ | ||
357 | dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ | ||
358 | if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ | ||
359 | cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ | ||
360 | fi; \ | ||
361 | cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ | ||
362 | else \ | ||
363 | test -f $(distdir)/$$file \ | ||
364 | || cp -p $$d/$$file $(distdir)/$$file \ | ||
365 | || exit 1; \ | ||
366 | fi; \ | ||
367 | done | ||
368 | check-am: all-am | ||
369 | check: check-am | ||
370 | all-am: Makefile $(HEADERS) config.h | ||
371 | installdirs: | ||
372 | for dir in "$(DESTDIR)$(g3dincludedir)"; do \ | ||
373 | test -z "$$dir" || $(MKDIR_P) "$$dir"; \ | ||
374 | done | ||
375 | install: install-am | ||
376 | install-exec: install-exec-am | ||
377 | install-data: install-data-am | ||
378 | uninstall: uninstall-am | ||
379 | |||
380 | install-am: all-am | ||
381 | @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am | ||
382 | |||
383 | installcheck: installcheck-am | ||
384 | install-strip: | ||
385 | $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ | ||
386 | install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ | ||
387 | `test -z '$(STRIP)' || \ | ||
388 | echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install | ||
389 | mostlyclean-generic: | ||
390 | |||
391 | clean-generic: | ||
392 | |||
393 | distclean-generic: | ||
394 | -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) | ||
395 | |||
396 | maintainer-clean-generic: | ||
397 | @echo "This command is intended for maintainers to use" | ||
398 | @echo "it deletes files that may require special tools to rebuild." | ||
399 | clean: clean-am | ||
400 | |||
401 | clean-am: clean-generic clean-libtool mostlyclean-am | ||
402 | |||
403 | distclean: distclean-am | ||
404 | -rm -f Makefile | ||
405 | distclean-am: clean-am distclean-generic distclean-hdr distclean-tags | ||
406 | |||
407 | dvi: dvi-am | ||
408 | |||
409 | dvi-am: | ||
410 | |||
411 | html: html-am | ||
412 | |||
413 | info: info-am | ||
414 | |||
415 | info-am: | ||
416 | |||
417 | install-data-am: install-g3dincludeHEADERS | ||
418 | |||
419 | install-dvi: install-dvi-am | ||
420 | |||
421 | install-exec-am: | ||
422 | |||
423 | install-html: install-html-am | ||
424 | |||
425 | install-info: install-info-am | ||
426 | |||
427 | install-man: | ||
428 | |||
429 | install-pdf: install-pdf-am | ||
430 | |||
431 | install-ps: install-ps-am | ||
432 | |||
433 | installcheck-am: | ||
434 | |||
435 | maintainer-clean: maintainer-clean-am | ||
436 | -rm -f Makefile | ||
437 | maintainer-clean-am: distclean-am maintainer-clean-generic | ||
438 | |||
439 | mostlyclean: mostlyclean-am | ||
440 | |||
441 | mostlyclean-am: mostlyclean-generic mostlyclean-libtool | ||
442 | |||
443 | pdf: pdf-am | ||
444 | |||
445 | pdf-am: | ||
446 | |||
447 | ps: ps-am | ||
448 | |||
449 | ps-am: | ||
450 | |||
451 | uninstall-am: uninstall-g3dincludeHEADERS | ||
452 | |||
453 | .MAKE: install-am install-strip | ||
454 | |||
455 | .PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \ | ||
456 | clean-libtool ctags distclean distclean-generic distclean-hdr \ | ||
457 | distclean-libtool distclean-tags distdir dvi dvi-am html \ | ||
458 | html-am info info-am install install-am install-data \ | ||
459 | install-data-am install-dvi install-dvi-am install-exec \ | ||
460 | install-exec-am install-g3dincludeHEADERS install-html \ | ||
461 | install-html-am install-info install-info-am install-man \ | ||
462 | install-pdf install-pdf-am install-ps install-ps-am \ | ||
463 | install-strip installcheck installcheck-am installdirs \ | ||
464 | maintainer-clean maintainer-clean-generic mostlyclean \ | ||
465 | mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ | ||
466 | tags uninstall uninstall-am uninstall-g3dincludeHEADERS | ||
467 | |||
468 | # Tell versions [3.59,3.63) of GNU make to not export all variables. | ||
469 | # Otherwise a system limit (for SysV at least) may be exceeded. | ||
470 | .NOEXPORT: | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/config.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/config.h new file mode 100644 index 0000000..e3455ba --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/config.h | |||
@@ -0,0 +1,72 @@ | |||
1 | /* include/g3d/config.h. Generated from config.h.in by configure. */ | ||
2 | /* include/g3d/config.h.in. Generated from configure.in by autoheader. */ | ||
3 | |||
4 | /* Define to 1 if you have the <dlfcn.h> header file. */ | ||
5 | #define HAVE_DLFCN_H 1 | ||
6 | |||
7 | /* Define to 1 if you have the <inttypes.h> header file. */ | ||
8 | #define HAVE_INTTYPES_H 1 | ||
9 | |||
10 | /* have GSF library */ | ||
11 | #define HAVE_LIBGSF 1 | ||
12 | |||
13 | /* Define to 1 if you have the `m' library (-lm). */ | ||
14 | #define HAVE_LIBM 1 | ||
15 | |||
16 | /* Define to 1 if you have the <memory.h> header file. */ | ||
17 | #define HAVE_MEMORY_H 1 | ||
18 | |||
19 | /* Define to 1 if you have the <stdint.h> header file. */ | ||
20 | #define HAVE_STDINT_H 1 | ||
21 | |||
22 | /* Define to 1 if you have the <stdlib.h> header file. */ | ||
23 | #define HAVE_STDLIB_H 1 | ||
24 | |||
25 | /* Define to 1 if you have the <strings.h> header file. */ | ||
26 | #define HAVE_STRINGS_H 1 | ||
27 | |||
28 | /* Define to 1 if you have the <string.h> header file. */ | ||
29 | #define HAVE_STRING_H 1 | ||
30 | |||
31 | /* Define to 1 if you have the <sys/stat.h> header file. */ | ||
32 | #define HAVE_SYS_STAT_H 1 | ||
33 | |||
34 | /* Define to 1 if you have the <sys/types.h> header file. */ | ||
35 | #define HAVE_SYS_TYPES_H 1 | ||
36 | |||
37 | /* Define to 1 if you have the <unistd.h> header file. */ | ||
38 | #define HAVE_UNISTD_H 1 | ||
39 | |||
40 | /* have zlib */ | ||
41 | #define HAVE_ZLIB 1 | ||
42 | |||
43 | /* magic file */ | ||
44 | #define MAGIC_FILENAME "/usr/local/lib/libg3d/libg3d.magic" | ||
45 | |||
46 | /* Define to the address where bug reports for this package should be sent. */ | ||
47 | #define PACKAGE_BUGREPORT "" | ||
48 | |||
49 | /* Define to the full name of this package. */ | ||
50 | #define PACKAGE_NAME "" | ||
51 | |||
52 | /* Define to the full name and version of this package. */ | ||
53 | #define PACKAGE_STRING "" | ||
54 | |||
55 | /* Define to the one symbol short name of this package. */ | ||
56 | #define PACKAGE_TARNAME "" | ||
57 | |||
58 | /* Define to the version of this package. */ | ||
59 | #define PACKAGE_VERSION "" | ||
60 | |||
61 | /* Plugin directory */ | ||
62 | #define PLUGIN_DIR "/usr/local/lib/libg3d/plugins" | ||
63 | |||
64 | /* Define to 1 if you have the ANSI C header files. */ | ||
65 | #define STDC_HEADERS 1 | ||
66 | |||
67 | /* use libmagic for file type detection */ | ||
68 | #define USE_LIBMAGIC 1 | ||
69 | |||
70 | /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a | ||
71 | `char[]'. */ | ||
72 | #define YYTEXT_POINTER 1 | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/config.h.in b/src/others/mimesh/libg3d-0.0.8/include/g3d/config.h.in new file mode 100644 index 0000000..4e99250 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/config.h.in | |||
@@ -0,0 +1,71 @@ | |||
1 | /* include/g3d/config.h.in. Generated from configure.in by autoheader. */ | ||
2 | |||
3 | /* Define to 1 if you have the <dlfcn.h> header file. */ | ||
4 | #undef HAVE_DLFCN_H | ||
5 | |||
6 | /* Define to 1 if you have the <inttypes.h> header file. */ | ||
7 | #undef HAVE_INTTYPES_H | ||
8 | |||
9 | /* have GSF library */ | ||
10 | #undef HAVE_LIBGSF | ||
11 | |||
12 | /* Define to 1 if you have the `m' library (-lm). */ | ||
13 | #undef HAVE_LIBM | ||
14 | |||
15 | /* Define to 1 if you have the <memory.h> header file. */ | ||
16 | #undef HAVE_MEMORY_H | ||
17 | |||
18 | /* Define to 1 if you have the <stdint.h> header file. */ | ||
19 | #undef HAVE_STDINT_H | ||
20 | |||
21 | /* Define to 1 if you have the <stdlib.h> header file. */ | ||
22 | #undef HAVE_STDLIB_H | ||
23 | |||
24 | /* Define to 1 if you have the <strings.h> header file. */ | ||
25 | #undef HAVE_STRINGS_H | ||
26 | |||
27 | /* Define to 1 if you have the <string.h> header file. */ | ||
28 | #undef HAVE_STRING_H | ||
29 | |||
30 | /* Define to 1 if you have the <sys/stat.h> header file. */ | ||
31 | #undef HAVE_SYS_STAT_H | ||
32 | |||
33 | /* Define to 1 if you have the <sys/types.h> header file. */ | ||
34 | #undef HAVE_SYS_TYPES_H | ||
35 | |||
36 | /* Define to 1 if you have the <unistd.h> header file. */ | ||
37 | #undef HAVE_UNISTD_H | ||
38 | |||
39 | /* have zlib */ | ||
40 | #undef HAVE_ZLIB | ||
41 | |||
42 | /* magic file */ | ||
43 | #undef MAGIC_FILENAME | ||
44 | |||
45 | /* Define to the address where bug reports for this package should be sent. */ | ||
46 | #undef PACKAGE_BUGREPORT | ||
47 | |||
48 | /* Define to the full name of this package. */ | ||
49 | #undef PACKAGE_NAME | ||
50 | |||
51 | /* Define to the full name and version of this package. */ | ||
52 | #undef PACKAGE_STRING | ||
53 | |||
54 | /* Define to the one symbol short name of this package. */ | ||
55 | #undef PACKAGE_TARNAME | ||
56 | |||
57 | /* Define to the version of this package. */ | ||
58 | #undef PACKAGE_VERSION | ||
59 | |||
60 | /* Plugin directory */ | ||
61 | #undef PLUGIN_DIR | ||
62 | |||
63 | /* Define to 1 if you have the ANSI C header files. */ | ||
64 | #undef STDC_HEADERS | ||
65 | |||
66 | /* use libmagic for file type detection */ | ||
67 | #undef USE_LIBMAGIC | ||
68 | |||
69 | /* Define to 1 if `lex' declares `yytext' as a `char *' by default, not a | ||
70 | `char[]'. */ | ||
71 | #undef YYTEXT_POINTER | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/context.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/context.h new file mode 100644 index 0000000..26b2134 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/context.h | |||
@@ -0,0 +1,149 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __G3D_CONTEXT_H__ | ||
24 | #define __G3D_CONTEXT_H__ | ||
25 | |||
26 | #include <g3d/types.h> | ||
27 | |||
28 | #ifdef __cplusplus | ||
29 | extern "C" { | ||
30 | #endif /* ifdef __cplusplus */ | ||
31 | |||
32 | |||
33 | /** | ||
34 | * SECTION:context | ||
35 | * @short_description: Libg3d initialization and configuration | ||
36 | * @see_also: #G3DContext | ||
37 | * @include: g3d/g3d.h | ||
38 | * | ||
39 | * All state information is saved in the context. It also serves as an | ||
40 | * interface to the application. | ||
41 | */ | ||
42 | |||
43 | |||
44 | /** | ||
45 | * g3d_context_new: | ||
46 | * | ||
47 | * Create a new context. This initializes the library (and also the | ||
48 | * plugin system so this has not to be done seperately). | ||
49 | * | ||
50 | * Returns: a valid context, or NULL on failure. | ||
51 | */ | ||
52 | EAPI | ||
53 | G3DContext *g3d_context_new(void); | ||
54 | |||
55 | /** | ||
56 | * g3d_context_free: | ||
57 | * @context: the context to free | ||
58 | * | ||
59 | * Cleans up the context and the plugin system and frees all reserved | ||
60 | * memory. | ||
61 | */ | ||
62 | EAPI | ||
63 | void g3d_context_free(G3DContext *context); | ||
64 | |||
65 | /** | ||
66 | * g3d_context_set_bgcolor: | ||
67 | * @context: a valid context | ||
68 | * @r: red component (range: 0.0 .. 1.0) | ||
69 | * @g: green component (range: 0.0 .. 1.0) | ||
70 | * @b: green component (range: 0.0 .. 1.0) | ||
71 | * @a: alpha component | ||
72 | * | ||
73 | * Try to set the background color. This will call a function registered | ||
74 | * with <link>@g3d_context_set_set_bgcolor_func</link>. | ||
75 | * | ||
76 | * Returns: TRUE on success, FALSE else | ||
77 | */ | ||
78 | EAPI | ||
79 | gboolean g3d_context_set_bgcolor(G3DContext *context, | ||
80 | G3DFloat r, G3DFloat g, G3DFloat b, G3DFloat a); | ||
81 | |||
82 | /** | ||
83 | * g3d_context_update_interface: | ||
84 | * @context: a valid context | ||
85 | * | ||
86 | * Try to update the interface. This will call a function registered with | ||
87 | * @g3d_context_set_update_interface_func. | ||
88 | * | ||
89 | * Returns: TRUE on success, FALSE else | ||
90 | */ | ||
91 | EAPI | ||
92 | gboolean g3d_context_update_interface(G3DContext *context); | ||
93 | |||
94 | /** | ||
95 | * g3d_context_update_progress_bar: | ||
96 | * @context: a valid context | ||
97 | * @percentage: the percentage to set on the progress bar | ||
98 | * @visibility: show or hide the progress bar | ||
99 | * | ||
100 | * Try to update the progress bar. | ||
101 | * | ||
102 | * Returns: TRUE on success, FALSE else | ||
103 | */ | ||
104 | EAPI | ||
105 | gboolean g3d_context_update_progress_bar(G3DContext *context, | ||
106 | G3DFloat percentage, gboolean visibility); | ||
107 | |||
108 | /** | ||
109 | * g3d_context_set_set_bgcolor_func: | ||
110 | * @context: a valid context | ||
111 | * @func: the callback function | ||
112 | * @user_data: user-defined opaque pointer | ||
113 | * | ||
114 | * Registers a callback function for setting the background color. | ||
115 | */ | ||
116 | EAPI | ||
117 | void g3d_context_set_set_bgcolor_func(G3DContext *context, | ||
118 | G3DSetBgColorFunc func, gpointer user_data); | ||
119 | |||
120 | /** | ||
121 | * g3d_context_set_update_interface_func: | ||
122 | * @context: a valid context | ||
123 | * @func: the callback function | ||
124 | * @user_data: user-defined opaque pointer | ||
125 | * | ||
126 | * Registers a callback function for updating the interface. | ||
127 | */ | ||
128 | EAPI | ||
129 | void g3d_context_set_update_interface_func(G3DContext *context, | ||
130 | G3DUpdateInterfaceFunc func, gpointer user_data); | ||
131 | |||
132 | /** | ||
133 | * g3d_context_set_update_progress_bar_func: | ||
134 | * @context: a valid context | ||
135 | * @func: the callback function | ||
136 | * @user_data: user-defined opaque pointer | ||
137 | * | ||
138 | * Registers a callback function for updating the progress bar. | ||
139 | */ | ||
140 | EAPI | ||
141 | void g3d_context_set_update_progress_bar_func(G3DContext *context, | ||
142 | G3DUpdateProgressBarFunc func, gpointer user_data); | ||
143 | |||
144 | #ifdef __cplusplus | ||
145 | } | ||
146 | #endif /* ifdef __cplusplus */ | ||
147 | |||
148 | #endif /* __G3D_CONTEXT_H__ */ | ||
149 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/debug.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/debug.h new file mode 100644 index 0000000..874764b --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/debug.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _G3D_DEBUG_H | ||
23 | #define _G3D_DEBUG_H | ||
24 | |||
25 | |||
26 | #include <glib.h> | ||
27 | /* g_debug() is defined since glib 2.6 */ | ||
28 | |||
29 | /*< private >*/ | ||
30 | #ifndef g_debug | ||
31 | #define g_debug(...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_DEBUG, __VA_ARGS__) | ||
32 | #endif | ||
33 | /*< public >*/ | ||
34 | |||
35 | #if DEBUG > 0 | ||
36 | #include <string.h> | ||
37 | static const gchar *debug_padding_str = " "; | ||
38 | static inline const gchar *debug_pad(guint32 level) { | ||
39 | return debug_padding_str + (strlen(debug_padding_str) - level); | ||
40 | } | ||
41 | #endif | ||
42 | |||
43 | #endif /* _G3D_DEBUG_H */ | ||
44 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/face.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/face.h new file mode 100644 index 0000000..b94b5cf --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/face.h | |||
@@ -0,0 +1,98 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef _G3D_FACE_H | ||
24 | #define _G3D_FACE_H | ||
25 | |||
26 | #include <g3d/types.h> | ||
27 | |||
28 | #ifdef __cplusplus | ||
29 | extern "C" { | ||
30 | #endif /* ifdef __cplusplus */ | ||
31 | |||
32 | /** | ||
33 | * SECTION:face | ||
34 | * @short_description: Face manipulation | ||
35 | * @include: g3d/face.h | ||
36 | * | ||
37 | * A face is plane bordered by at least 3 vertices. | ||
38 | */ | ||
39 | |||
40 | |||
41 | /** | ||
42 | * g3d_face_free: | ||
43 | * @face: the face to free | ||
44 | * | ||
45 | * Frees all memory allocated for this face. | ||
46 | */ | ||
47 | EAPI | ||
48 | void g3d_face_free(G3DFace *face); | ||
49 | |||
50 | /** | ||
51 | * g3d_face_get_normal: | ||
52 | * @face: face to calculate normal of | ||
53 | * @object: object containing vertices of face | ||
54 | * @nx: x component of resulting normal | ||
55 | * @ny: y component of resulting normal | ||
56 | * @nz: z component of resulting normal | ||
57 | * | ||
58 | * calculates the normal of a face. | ||
59 | * | ||
60 | * Returns: TRUE on success, FALSE else | ||
61 | */ | ||
62 | EAPI | ||
63 | gboolean g3d_face_get_normal(G3DFace *face, G3DObject *object, | ||
64 | G3DFloat *nx, G3DFloat *ny, G3DFloat *nz); | ||
65 | |||
66 | /** | ||
67 | * g3d_face_new_tri: | ||
68 | * @material: material to use for face | ||
69 | * @i1: index of first vertex | ||
70 | * @i2: index of second vertex | ||
71 | * @i3: index of third vertex | ||
72 | * | ||
73 | * creates a new triangle face. | ||
74 | * | ||
75 | * Returns: a new face | ||
76 | */ | ||
77 | _G3D_STATIC_INLINE G3DFace *g3d_face_new_tri(G3DMaterial *material, | ||
78 | guint32 i1, guint32 i2, guint32 i3) | ||
79 | { | ||
80 | G3DFace *face; | ||
81 | |||
82 | face = g_new0(G3DFace, 1); | ||
83 | face->material = material; | ||
84 | face->vertex_count = 3; | ||
85 | face->vertex_indices = g_new0(guint32, 3); | ||
86 | face->vertex_indices[0] = i1; | ||
87 | face->vertex_indices[1] = i2; | ||
88 | face->vertex_indices[2] = i3; | ||
89 | |||
90 | return face; | ||
91 | } | ||
92 | |||
93 | #ifdef __cplusplus | ||
94 | } | ||
95 | #endif /* ifdef __cplusplus */ | ||
96 | |||
97 | #endif /* _G3D_FACE_H */ | ||
98 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/g3d.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/g3d.h new file mode 100644 index 0000000..ca30be7 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/g3d.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __G3D_G3D_H__ | ||
24 | #define __G3D_G3D_H__ | ||
25 | |||
26 | #include <g3d/context.h> | ||
27 | #include <g3d/model.h> | ||
28 | #include <g3d/object.h> | ||
29 | #include <g3d/face.h> | ||
30 | #include <g3d/material.h> | ||
31 | |||
32 | #include <g3d/vector.h> | ||
33 | |||
34 | #endif /* __G3D_G3D_H__ */ | ||
35 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/iff.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/iff.h new file mode 100644 index 0000000..a8df77e --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/iff.h | |||
@@ -0,0 +1,325 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __G3D_IFF_H__ | ||
24 | #define __G3D_IFF_H__ | ||
25 | |||
26 | /* FIXME: still needed for FILE until all plugins are converted | ||
27 | * #ifndef G3D_DISABLE_DEPRECATED */ | ||
28 | #include <stdio.h> | ||
29 | /* #endif */ | ||
30 | #include <glib.h> | ||
31 | |||
32 | #include <g3d/types.h> | ||
33 | |||
34 | /** | ||
35 | * SECTION:iff | ||
36 | * @short_description: IFF file helper functions | ||
37 | * @include: g3d/iff.h | ||
38 | * | ||
39 | * These are helper functions to read data from the Interchange File Format | ||
40 | * (IFF). | ||
41 | */ | ||
42 | |||
43 | |||
44 | /** | ||
45 | * G3D_IFF_PAD1: | ||
46 | * | ||
47 | * No padding is done after chunks. | ||
48 | */ | ||
49 | #define G3D_IFF_PAD1 0x01 | ||
50 | /** | ||
51 | * G3D_IFF_PAD2: | ||
52 | * | ||
53 | * Chunks are 2-byte aligned | ||
54 | */ | ||
55 | #define G3D_IFF_PAD2 0x02 | ||
56 | /** | ||
57 | * G3D_IFF_PAD4: | ||
58 | * | ||
59 | * Chunks are 4-byte aligned | ||
60 | */ | ||
61 | #define G3D_IFF_PAD4 0x04 | ||
62 | /** | ||
63 | * G3D_IFF_PAD8: | ||
64 | * | ||
65 | * Chunks are 8-byte aligned | ||
66 | */ | ||
67 | #define G3D_IFF_PAD8 0x08 | ||
68 | |||
69 | /** | ||
70 | * G3D_IFF_SUBCHUNK_LEN16: | ||
71 | * | ||
72 | * All chunks except the toplevel ones have 16-bit sizes. | ||
73 | */ | ||
74 | #define G3D_IFF_SUBCHUNK_LEN16 0x10 | ||
75 | /** | ||
76 | * G3D_IFF_LEN16: | ||
77 | * | ||
78 | * All chunks have 16-bit sizes. | ||
79 | */ | ||
80 | #define G3D_IFF_LEN16 0x20 | ||
81 | /** | ||
82 | * G3D_IFF_LE: | ||
83 | * | ||
84 | * The file has little-endian data. | ||
85 | */ | ||
86 | #define G3D_IFF_LE 0x40 /* little endian */ | ||
87 | |||
88 | /** | ||
89 | * G3D_IFF_MKID: | ||
90 | * @a: first byte | ||
91 | * @b: second byte | ||
92 | * @c: third byte | ||
93 | * @d: fourth byte | ||
94 | * | ||
95 | * Generate an IFF chunk identifier from character representation, e.g. | ||
96 | * G3D_IFF_MKID('F','O','R','M'). | ||
97 | * | ||
98 | * Returns: unsigned integer identifier. | ||
99 | */ | ||
100 | #define G3D_IFF_MKID(a,b,c,d) ( \ | ||
101 | (((guint32)(a))<<24) | \ | ||
102 | (((guint32)(b))<<16) | \ | ||
103 | (((guint32)(c))<< 8) | \ | ||
104 | (((guint32)(d)) ) ) | ||
105 | |||
106 | #ifdef __cplusplus | ||
107 | extern "C" { | ||
108 | #endif /* ifdef __cplusplus */ | ||
109 | |||
110 | #ifndef G3D_DISABLE_DEPRECATED | ||
111 | /** | ||
112 | * g3d_iff_gdata: | ||
113 | * | ||
114 | * IFF global data (deprecated). | ||
115 | */ | ||
116 | #define g3d_iff_gdata G3DIffGlobal | ||
117 | /** | ||
118 | * g3d_iff_ldata: | ||
119 | * | ||
120 | * IFF local data (deprecated). | ||
121 | */ | ||
122 | #define g3d_iff_ldata G3DIffLocal | ||
123 | /** | ||
124 | * g3d_iff_chunk_callback: | ||
125 | * | ||
126 | * IFF chunk callback (deprecated). | ||
127 | */ | ||
128 | #define g3d_iff_chunk_callback G3DIffChunkCallback | ||
129 | /** | ||
130 | * g3d_iff_chunk_info: | ||
131 | * | ||
132 | * IFF chunk description (deprecated). | ||
133 | */ | ||
134 | #define g3d_iff_chunk_info G3DIffChunkInfo | ||
135 | #endif | ||
136 | |||
137 | /** | ||
138 | * G3DIffGlobal: | ||
139 | * @context: a valid context | ||
140 | * @model: a model | ||
141 | * @stream: the stream to read model from | ||
142 | * @flags: IFF flags | ||
143 | * @user_data: to be used by plugin | ||
144 | * @f: file to read model from (DEPRECATED) | ||
145 | * @max_fpos: maximum file position (DEPRECATED) | ||
146 | * | ||
147 | * The plugin-global data to be given to IFF callback functions. | ||
148 | */ | ||
149 | typedef struct { | ||
150 | G3DContext *context; | ||
151 | G3DModel *model; | ||
152 | G3DStream *stream; | ||
153 | guint32 flags; | ||
154 | gpointer user_data; | ||
155 | FILE *f; | ||
156 | long int max_fpos; | ||
157 | } G3DIffGlobal; | ||
158 | |||
159 | /** | ||
160 | * G3DIffLocal: | ||
161 | * @id: chunk identifier | ||
162 | * @parent_id: parent chunk identifier | ||
163 | * @object: an object set by parent callbacks, may be NULL | ||
164 | * @level: level of chunk | ||
165 | * @level_object: object shared by callbacks on the same level, may be NULL | ||
166 | * @nb: number of bytes remaining in chunk, has to be decremented after | ||
167 | * correctly after reading from stream | ||
168 | * @finalize: for container chunks the callback function is called before | ||
169 | * and after processing possible sub-chunks, the second time @finalize is set | ||
170 | * to TRUE | ||
171 | * | ||
172 | * The function-local data for IFF callback functions. | ||
173 | */ | ||
174 | typedef struct { | ||
175 | guint32 id; | ||
176 | guint32 parent_id; | ||
177 | gpointer object; | ||
178 | gint32 level; | ||
179 | gpointer level_object; | ||
180 | gint32 nb; | ||
181 | gboolean finalize; | ||
182 | } G3DIffLocal; | ||
183 | |||
184 | /** | ||
185 | * G3DIffChunkCallback: | ||
186 | * @global: the global data | ||
187 | * @local: the local data | ||
188 | * | ||
189 | * IFF callback function prototype. | ||
190 | * | ||
191 | * Returns: TRUE on success, FALSE else. | ||
192 | */ | ||
193 | typedef gboolean (* G3DIffChunkCallback)( | ||
194 | G3DIffGlobal *global, G3DIffLocal *local); | ||
195 | |||
196 | /** | ||
197 | * G3DIffChunkInfo: | ||
198 | * @id: identifier of chunk | ||
199 | * @description: human-readable description of chunk type | ||
200 | * @container: TRUE if this chunk contains sub-chunks | ||
201 | * @callback: function to be called if such a chunk is found | ||
202 | * | ||
203 | * A chunk type description. | ||
204 | */ | ||
205 | typedef struct { | ||
206 | gchar *id; | ||
207 | gchar *description; | ||
208 | gboolean container; | ||
209 | G3DIffChunkCallback callback; | ||
210 | } G3DIffChunkInfo; | ||
211 | |||
212 | /** | ||
213 | * g3d_iff_check: | ||
214 | * @stream: stream containing IFF file to check | ||
215 | * @id: top level ID (out) | ||
216 | * @len: length of top level container (out) | ||
217 | * | ||
218 | * Checks a stream for a valid IFF signature and reads the top level container. | ||
219 | * | ||
220 | * Returns: TRUE on success (valid IFF), FALSE else | ||
221 | */ | ||
222 | EAPI | ||
223 | gboolean g3d_iff_check(G3DStream *stream, guint32 *id, gsize *len); | ||
224 | |||
225 | /** | ||
226 | * g3d_iff_read_chunk: | ||
227 | * @stream: stream to read from | ||
228 | * @id: ID of chunk (out) | ||
229 | * @len: length of chunk (excluding header) (out) | ||
230 | * @flags: flags | ||
231 | * | ||
232 | * Reads one chunk header from an IFF file. | ||
233 | * | ||
234 | * Returns: real length of chunk including header and possible padding byte | ||
235 | */ | ||
236 | EAPI | ||
237 | gsize g3d_iff_read_chunk(G3DStream *stream, guint32 *id, gsize *len, | ||
238 | guint32 flags); | ||
239 | |||
240 | #ifndef G3D_DISABLE_DEPRECATED | ||
241 | /** | ||
242 | * g3d_iff_open: | ||
243 | * @filename: file name of IFF file | ||
244 | * @id: top level ID (out) | ||
245 | * @len: length of top level container (out) | ||
246 | * | ||
247 | * Opens an IFF file, checks it and reads its top level container. | ||
248 | * | ||
249 | * Returns: the file pointer of open file or NULL in case of an error | ||
250 | */ | ||
251 | FILE *g3d_iff_open(const gchar *filename, guint32 *id, guint32 *len); | ||
252 | |||
253 | /** | ||
254 | * g3d_iff_readchunk: | ||
255 | * @f: the open IFF file pointer | ||
256 | * @id: ID of chunk (out) | ||
257 | * @len: length of chunk (excluding header) (out) | ||
258 | * @flags: flags | ||
259 | * | ||
260 | * Reads one chunk header from an IFF file. | ||
261 | * | ||
262 | * Returns: real length of chunk including header and possible padding byte | ||
263 | */ | ||
264 | int g3d_iff_readchunk(FILE *f, guint32 *id, guint32 *len, guint32 flags); | ||
265 | #endif /* G3D_DISABLE_DEPRECATED */ | ||
266 | |||
267 | /** | ||
268 | * g3d_iff_id_to_text: | ||
269 | * @id: an IFF identifier | ||
270 | * | ||
271 | * Get the text representation of an IFF chunk identifier. | ||
272 | * | ||
273 | * Returns: a newly allocated string containing the text identifier. | ||
274 | */ | ||
275 | EAPI | ||
276 | gchar *g3d_iff_id_to_text(guint32 id); | ||
277 | |||
278 | /** | ||
279 | * g3d_iff_chunk_matches: | ||
280 | * @id: IFF identifier | ||
281 | * @tid: textual representation of identifier | ||
282 | * | ||
283 | * Check whether @id and @tid match. | ||
284 | * | ||
285 | * Returns: TRUE on match, FALSE else. | ||
286 | */ | ||
287 | EAPI | ||
288 | gboolean g3d_iff_chunk_matches(guint32 id, gchar *tid); | ||
289 | |||
290 | /** | ||
291 | * g3d_iff_handle_chunk: | ||
292 | * @global: global data | ||
293 | * @plocal: local data of parent chunk, must not be NULL | ||
294 | * @chunks: chunk description list | ||
295 | * @flags: IFF flags | ||
296 | * | ||
297 | * Handle an IFF chunk based on chunk description. | ||
298 | * | ||
299 | * Returns: level object for siblings, may be NULL. | ||
300 | */ | ||
301 | EAPI | ||
302 | gpointer g3d_iff_handle_chunk(G3DIffGlobal *global, G3DIffLocal *plocal, | ||
303 | G3DIffChunkInfo *chunks, guint32 flags); | ||
304 | |||
305 | /** | ||
306 | * g3d_iff_read_ctnr: | ||
307 | * @global: global data | ||
308 | * @local: local data of current chunk, must not be NULL | ||
309 | * @chunks: chunk description list | ||
310 | * @flags: IFF flags | ||
311 | * | ||
312 | * Read subchunks in current chunk and handle them appropriately. | ||
313 | * | ||
314 | * Returns: TRUE on success, FALSE else. | ||
315 | */ | ||
316 | EAPI | ||
317 | gboolean g3d_iff_read_ctnr(G3DIffGlobal *global, G3DIffLocal *local, | ||
318 | G3DIffChunkInfo *chunks, guint32 flags); | ||
319 | |||
320 | #ifdef __cplusplus | ||
321 | } | ||
322 | #endif /* ifdef __cplusplus */ | ||
323 | |||
324 | #endif | ||
325 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/material.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/material.h new file mode 100644 index 0000000..d04ea4d --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/material.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __G3D_MATERIAL_H__ | ||
24 | #define __G3D_MATERIAL_H__ | ||
25 | |||
26 | #include <g3d/types.h> | ||
27 | |||
28 | #ifdef __cplusplus | ||
29 | extern "C" { | ||
30 | #endif /* ifdef __cplusplus */ | ||
31 | |||
32 | /** | ||
33 | * SECTION:material | ||
34 | * @short_description: Material generation and manipulation | ||
35 | * @include: g3d/material.h | ||
36 | * | ||
37 | * A material contains all color, shading and texture information for a | ||
38 | * #G3DFace. | ||
39 | */ | ||
40 | /** | ||
41 | * g3d_material_new | ||
42 | * | ||
43 | * Generates a new material with a default color. | ||
44 | * | ||
45 | * Returns: the new material or NULL on error | ||
46 | */ | ||
47 | EAPI | ||
48 | G3DMaterial *g3d_material_new(void); | ||
49 | |||
50 | /** | ||
51 | * g3d_material_free: | ||
52 | * @material: the material to free | ||
53 | * | ||
54 | * Frees all memory allocated for that material. | ||
55 | */ | ||
56 | EAPI | ||
57 | void g3d_material_free(G3DMaterial *material); | ||
58 | |||
59 | #ifdef __cplusplus | ||
60 | } | ||
61 | #endif /* ifdef __cplusplus */ | ||
62 | |||
63 | #endif /* __G3D_MATERIAL_H__ */ | ||
64 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/matrix.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/matrix.h new file mode 100644 index 0000000..df4a7a2 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/matrix.h | |||
@@ -0,0 +1,189 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef _G3D_MATRIX_H | ||
24 | #define _G3D_MATRIX_H | ||
25 | |||
26 | #include <g3d/types.h> | ||
27 | |||
28 | #ifdef __cplusplus | ||
29 | extern "C" { | ||
30 | #endif /* ifdef __cplusplus */ | ||
31 | |||
32 | /** | ||
33 | * SECTION:matrix | ||
34 | * @short_description: Matrix manipulation and calculation | ||
35 | * @include: g3d/matrix.h | ||
36 | * | ||
37 | * Matrices in libg3d have the following layout: | ||
38 | * | ||
39 | * G3DMatrix matrix[16]: | ||
40 | * | ||
41 | * matrix[col * 4 + row] = f; | ||
42 | */ | ||
43 | |||
44 | /** | ||
45 | * g3d_matrix_identity: | ||
46 | * @matrix: 4x4 matrix (float[16]) | ||
47 | * | ||
48 | * Sets the given matrix to the identity matrix. | ||
49 | * | ||
50 | * Returns: TRUE on success, FALSE else | ||
51 | */ | ||
52 | EAPI | ||
53 | gboolean g3d_matrix_identity(G3DMatrix *matrix); | ||
54 | |||
55 | /** | ||
56 | * g3d_matrix_new: | ||
57 | * | ||
58 | * Create a new matrix. It is also set to the identity matrix. | ||
59 | * | ||
60 | * Returns: the new matrix | ||
61 | */ | ||
62 | _G3D_STATIC_INLINE G3DMatrix *g3d_matrix_new(void) { | ||
63 | G3DMatrix *matrix = g_new(G3DMatrix, 16); | ||
64 | g3d_matrix_identity(matrix); | ||
65 | return matrix; | ||
66 | } | ||
67 | |||
68 | /** | ||
69 | * g3d_matrix_free: | ||
70 | * @matrix: the matrix to free | ||
71 | * | ||
72 | * Free the memory allocated by a matrix. | ||
73 | */ | ||
74 | _G3D_STATIC_INLINE void g3d_matrix_free(G3DMatrix *matrix) { | ||
75 | g_free(matrix); | ||
76 | } | ||
77 | |||
78 | /** | ||
79 | * g3d_matrix_multiply: | ||
80 | * @m1: first matrix | ||
81 | * @m2: second matrix | ||
82 | * @rm: resulting matrix | ||
83 | * | ||
84 | * Multiplies the matrixes. | ||
85 | * | ||
86 | * Returns: TRUE on success, FALSE else | ||
87 | */ | ||
88 | EAPI | ||
89 | gboolean g3d_matrix_multiply(G3DMatrix *m1, G3DMatrix *m2, G3DMatrix *rm); | ||
90 | |||
91 | /** | ||
92 | * g3d_matrix_translate: | ||
93 | * @x: x translation | ||
94 | * @y: y translation | ||
95 | * @z: z translation | ||
96 | * @rm: resulting matrix | ||
97 | * | ||
98 | * Adds a translation to the the matrix. | ||
99 | * | ||
100 | * Returns: TRUE on success, FALSE else | ||
101 | */ | ||
102 | EAPI | ||
103 | gboolean g3d_matrix_translate(G3DFloat x, G3DFloat y, G3DFloat z, | ||
104 | G3DMatrix *rm); | ||
105 | |||
106 | /** | ||
107 | * g3d_matrix_rotate: | ||
108 | * @angle: rotation angle | ||
109 | * @ax: x component of rotation axis | ||
110 | * @ay: y component of rotation axis | ||
111 | * @az: z component of rotation axis | ||
112 | * @rm: resulting matrix | ||
113 | * | ||
114 | * Adds a rotation to the matrix. | ||
115 | * | ||
116 | * Returns: TRUE on success, FALSE else | ||
117 | */ | ||
118 | EAPI | ||
119 | gboolean g3d_matrix_rotate(G3DFloat angle, G3DFloat ax, G3DFloat ay, | ||
120 | G3DFloat az, G3DMatrix *rm); | ||
121 | |||
122 | /** | ||
123 | * g3d_matrix_rotate_xyz | ||
124 | * @rx: rotation around x axis | ||
125 | * @ry: rotation around y axis | ||
126 | * @rz: rotation around z axis | ||
127 | * @rm: resulting matrix | ||
128 | * | ||
129 | * Adds a rotation around the 3 coordinate system axes to the matrix. | ||
130 | * | ||
131 | * Returns: TRUE on success, FALSE else | ||
132 | */ | ||
133 | EAPI | ||
134 | gboolean g3d_matrix_rotate_xyz(G3DFloat rx, G3DFloat ry, G3DFloat rz, | ||
135 | G3DMatrix *rm); | ||
136 | |||
137 | /** | ||
138 | * g3d_matrix_scale: | ||
139 | * @x: x factor | ||
140 | * @y: y factor | ||
141 | * @z: z factor | ||
142 | * @rm: resulting matrix | ||
143 | * | ||
144 | * Adds a scaling to the matrix. | ||
145 | * | ||
146 | * Returns: TRUE on success, FALSE else | ||
147 | */ | ||
148 | EAPI | ||
149 | gboolean g3d_matrix_scale(G3DFloat x, G3DFloat y, G3DFloat z, G3DMatrix *rm); | ||
150 | |||
151 | /** | ||
152 | * g3d_matrix_transpose: | ||
153 | * @matrix: the matrix | ||
154 | * | ||
155 | * Transposes the matrix. | ||
156 | * | ||
157 | * Returns: TRUE on success, FALSE else | ||
158 | */ | ||
159 | EAPI | ||
160 | gboolean g3d_matrix_transpose(G3DMatrix *matrix); | ||
161 | |||
162 | /** | ||
163 | * g3d_matrix_determinant: | ||
164 | * @matrix: the matrix | ||
165 | * | ||
166 | * Calculate the determinant of the matrix (FIXME: not verified). | ||
167 | * | ||
168 | * Returns: the determinant. | ||
169 | */ | ||
170 | EAPI | ||
171 | G3DFloat g3d_matrix_determinant(G3DMatrix *matrix); | ||
172 | |||
173 | /** | ||
174 | * g3d_matrix_dump: | ||
175 | * @matrix: the matrix | ||
176 | * | ||
177 | * If debugging is enabled, this function dump the matrix to stderr. | ||
178 | * | ||
179 | * Returns: TRUE if matrix is dumped, FALSE else | ||
180 | */ | ||
181 | EAPI | ||
182 | gboolean g3d_matrix_dump(G3DMatrix *matrix); | ||
183 | |||
184 | #ifdef __cplusplus | ||
185 | } | ||
186 | #endif /* ifdef __cplusplus */ | ||
187 | |||
188 | #endif /* _G3D_MATRIX_H */ | ||
189 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/model.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/model.h new file mode 100644 index 0000000..86047a6 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/model.h | |||
@@ -0,0 +1,180 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __G3D_MODEL_H__ | ||
24 | #define __G3D_MODEL_H__ | ||
25 | |||
26 | #include <g3d/types.h> | ||
27 | |||
28 | #ifdef __cplusplus | ||
29 | extern "C" { | ||
30 | #endif /* ifdef __cplusplus */ | ||
31 | |||
32 | /** | ||
33 | * SECTION:model | ||
34 | * @short_description: Model manipulation functions | ||
35 | * @include: g3d/g3d.h | ||
36 | * | ||
37 | * A model is a group of objects. All information loaded from a file by libg3d | ||
38 | * is found in this model. | ||
39 | */ | ||
40 | |||
41 | /** | ||
42 | * g3d_model_new: | ||
43 | * | ||
44 | * This functions allocates and initializes a new G3DModel. | ||
45 | * | ||
46 | * Returns: a newly allocated G3DModel | ||
47 | */ | ||
48 | EAPI | ||
49 | G3DModel *g3d_model_new(void); | ||
50 | |||
51 | /** | ||
52 | * G3D_MODEL_SCALE: | ||
53 | * | ||
54 | * The model should be scaled to a maximum extension of +/- 10.0. | ||
55 | */ | ||
56 | #define G3D_MODEL_SCALE (1 << 0) | ||
57 | /** | ||
58 | * G3D_MODEL_CENTER: | ||
59 | * | ||
60 | * The model should be centered around the (0,0,0). | ||
61 | */ | ||
62 | #define G3D_MODEL_CENTER (1 << 1) | ||
63 | /** | ||
64 | * G3D_MODEL_OPTIMIZE: | ||
65 | * | ||
66 | * The model material/object/face lists should be serialized to some private | ||
67 | * arrays (deprecated). | ||
68 | */ | ||
69 | #define G3D_MODEL_OPTIMIZE (1 << 2) | ||
70 | /** | ||
71 | * G3D_MODEL_NOCHECK: | ||
72 | * | ||
73 | * The common checks should be disabled. The checks include: | ||
74 | * <itemizedlist> | ||
75 | * <listitem>faces have at least 3 indices</listitem> | ||
76 | * <listitem>face indices are <= number of vertices</listitem> | ||
77 | * <listitem>material of faces is not NULL</listitem> | ||
78 | * </itemizedlist> | ||
79 | */ | ||
80 | #define G3D_MODEL_NOCHECK (1 << 3) | ||
81 | |||
82 | /** | ||
83 | * g3d_model_load_full: | ||
84 | * @context: a valid context | ||
85 | * @filename: the file name of the model to load | ||
86 | * @flags: object manipulation flags | ||
87 | * | ||
88 | * Loads a model from a file. Depending on @flags the model is checked, | ||
89 | * centered, resized, optimized. | ||
90 | * | ||
91 | * Returns: the loaded model or NULL in case of an error. | ||
92 | */ | ||
93 | EAPI | ||
94 | G3DModel *g3d_model_load_full(G3DContext *context, const gchar *filename, | ||
95 | guint32 flags); | ||
96 | |||
97 | /** | ||
98 | * g3d_model_load: | ||
99 | * @context: a valid context | ||
100 | * @filename: the file name of the model to load | ||
101 | * | ||
102 | * Loads a model from a file. The model is checked, centered, resized, | ||
103 | * optimized. | ||
104 | * | ||
105 | * Returns: the loaded model or NULL in case of an error | ||
106 | */ | ||
107 | EAPI | ||
108 | G3DModel *g3d_model_load(G3DContext *context, const gchar *filename); | ||
109 | |||
110 | /** | ||
111 | * g3d_model_check: | ||
112 | * @model: the model to check | ||
113 | * | ||
114 | * Checks whether a model returned by plugin is valid. | ||
115 | * | ||
116 | * Returns: TRUE on success, FALSE on error | ||
117 | */ | ||
118 | EAPI | ||
119 | gboolean g3d_model_check(G3DModel *model); | ||
120 | |||
121 | /** | ||
122 | * g3d_model_center: | ||
123 | * @model: the model to center | ||
124 | * | ||
125 | * Translates all object coordinates that the object center is at (0, 0, 0) | ||
126 | * | ||
127 | * Returns: TRUE on success, FALSE on error | ||
128 | */ | ||
129 | EAPI | ||
130 | gboolean g3d_model_center(G3DModel *model); | ||
131 | |||
132 | /** | ||
133 | * g3d_model_clear: | ||
134 | * @model: the model to clear | ||
135 | * | ||
136 | * Removes all objects from a model. | ||
137 | */ | ||
138 | EAPI | ||
139 | void g3d_model_clear(G3DModel *model); | ||
140 | |||
141 | /** | ||
142 | * g3d_model_free: | ||
143 | * @model: the model to free | ||
144 | * | ||
145 | * Frees all memory allocated for the model including all objects, materials | ||
146 | * and textures. | ||
147 | */ | ||
148 | EAPI | ||
149 | void g3d_model_free(G3DModel *model); | ||
150 | |||
151 | /** | ||
152 | * g3d_model_get_object_by_name: | ||
153 | * @model: the model containing all objects | ||
154 | * @name: the name of the requested object | ||
155 | * | ||
156 | * Searches the object tree for an object with the given name. | ||
157 | * | ||
158 | * Returns: the requested object or NULL if non was found | ||
159 | */ | ||
160 | EAPI | ||
161 | G3DObject *g3d_model_get_object_by_name(G3DModel *model, const gchar *name); | ||
162 | |||
163 | /** | ||
164 | * g3d_model_transform: | ||
165 | * @model: the model | ||
166 | * @matrix: transformation matrix | ||
167 | * | ||
168 | * Transform all toplevel objects in model with matrix. | ||
169 | * | ||
170 | * Returns: TRUE on success, FALSE else | ||
171 | */ | ||
172 | EAPI | ||
173 | gboolean g3d_model_transform(G3DModel *model, G3DMatrix *matrix); | ||
174 | |||
175 | #ifdef __cplusplus | ||
176 | } | ||
177 | #endif /* ifdef __cplusplus */ | ||
178 | |||
179 | #endif /* __G3D_MODEL_H__ */ | ||
180 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/object.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/object.h new file mode 100644 index 0000000..97dfefc --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/object.h | |||
@@ -0,0 +1,151 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __G3D_OBJECT_H__ | ||
24 | #define __G3D_OBJECT_H__ | ||
25 | |||
26 | #include <g3d/types.h> | ||
27 | |||
28 | #ifdef __cplusplus | ||
29 | extern "C" { | ||
30 | #endif /* ifdef __cplusplus */ | ||
31 | |||
32 | /** | ||
33 | * SECTION:object | ||
34 | * @short_description: Object manipulation | ||
35 | * @include: g3d/object.h | ||
36 | * | ||
37 | * Objects are parts of a model. In most file formats vertices and faces are | ||
38 | * grouped in some way into objects. Objects can be hierarchical, so what a | ||
39 | * model contains is basically an object tree. | ||
40 | */ | ||
41 | |||
42 | /** | ||
43 | * g3d_object_free: | ||
44 | * @object: the object to free | ||
45 | * | ||
46 | * Frees all memory allocated for that object. | ||
47 | */ | ||
48 | EAPI | ||
49 | void g3d_object_free(G3DObject *object); | ||
50 | |||
51 | /** | ||
52 | * g3d_object_radius: | ||
53 | * @object: the object to measure | ||
54 | * | ||
55 | * Calculates the radius of the object. This is the maximum from the | ||
56 | * center to a vertex. | ||
57 | * | ||
58 | * Returns: the radius of the given object | ||
59 | */ | ||
60 | EAPI | ||
61 | gdouble g3d_object_radius(G3DObject *object); | ||
62 | |||
63 | /** | ||
64 | * g3d_object_scale: | ||
65 | * @object: the object to scale | ||
66 | * @scale: scale factor | ||
67 | * | ||
68 | * Resizes the object by the factor @scale. | ||
69 | * | ||
70 | * Returns: TRUE on success, FALSE else | ||
71 | */ | ||
72 | EAPI | ||
73 | gboolean g3d_object_scale(G3DObject *object, G3DFloat scale); | ||
74 | |||
75 | /** | ||
76 | * g3d_object_transform: | ||
77 | * @object: the object to transform | ||
78 | * @matrix: the transformation matrix | ||
79 | * | ||
80 | * Multiplies all vertices of the object with the transformation matrix. | ||
81 | * | ||
82 | * Returns: TRUE on success, FALSE else | ||
83 | */ | ||
84 | EAPI | ||
85 | gboolean g3d_object_transform(G3DObject *object, G3DMatrix *matrix); | ||
86 | |||
87 | /** | ||
88 | * g3d_object_transform_normals: | ||
89 | * @object: the object to transform | ||
90 | * @matrix: the transformation matrix | ||
91 | * | ||
92 | * Multiplies all normals of the object with the transformation matrix. | ||
93 | * | ||
94 | * Returns: TRUE on success, FALSE else | ||
95 | */ | ||
96 | EAPI | ||
97 | gboolean g3d_object_transform_normals(G3DObject *object, G3DMatrix *matrix); | ||
98 | |||
99 | /** | ||
100 | * g3d_object_duplicate: | ||
101 | * @object: the object to duplicate | ||
102 | * | ||
103 | * Duplicates an object with all vertices, faces and materials. | ||
104 | * | ||
105 | * Returns: the new clone object | ||
106 | */ | ||
107 | EAPI | ||
108 | G3DObject *g3d_object_duplicate(G3DObject *object); | ||
109 | |||
110 | /** | ||
111 | * g3d_object_optimize: | ||
112 | * @object: the object to optimize | ||
113 | * | ||
114 | * Puts all vertex and face information into special arrays for faster | ||
115 | * rendering. It is deprecated and should not be used. | ||
116 | * | ||
117 | * Returns: TRUE on success, FALSE else | ||
118 | */ | ||
119 | EAPI | ||
120 | gboolean g3d_object_optimize(G3DObject *object); | ||
121 | |||
122 | /** | ||
123 | * g3d_object_smooth: | ||
124 | * @object: the object to smooth | ||
125 | * | ||
126 | * FIXME: unimplemented. | ||
127 | * | ||
128 | * Returns: TRUE on success, FALSE else | ||
129 | */ | ||
130 | EAPI | ||
131 | gboolean g3d_object_smooth(G3DObject *object); | ||
132 | |||
133 | /** | ||
134 | * g3d_object_merge: | ||
135 | * @o1: first and target object | ||
136 | * @o2: second object | ||
137 | * | ||
138 | * Merges both objects into @o1. | ||
139 | * FIXME: needs cleanup | ||
140 | * | ||
141 | * Returns: TRUE on success, FALSE else | ||
142 | */ | ||
143 | EAPI | ||
144 | gboolean g3d_object_merge(G3DObject *o1, G3DObject *o2); | ||
145 | |||
146 | #ifdef __cplusplus | ||
147 | } | ||
148 | #endif /* ifdef __cplusplus */ | ||
149 | |||
150 | #endif /* __G3D_OBJECT_H__ */ | ||
151 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/plugins.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/plugins.h new file mode 100644 index 0000000..0a98dcd --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/plugins.h | |||
@@ -0,0 +1,243 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __G3D_PLUGINS_H__ | ||
24 | #define __G3D_PLUGINS_H__ | ||
25 | |||
26 | #include <gmodule.h> | ||
27 | #include <g3d/types.h> | ||
28 | |||
29 | #ifdef __cplusplus | ||
30 | extern "C" { | ||
31 | #endif /* ifdef __cplusplus */ | ||
32 | |||
33 | /** | ||
34 | * SECTION:plugins | ||
35 | * @short_description: G3DPlugin interface | ||
36 | * @see_also: #G3DPlugin | ||
37 | * @include: g3d/plugins.h | ||
38 | * | ||
39 | * Direct interaction with the plugin system is normally not needed when using | ||
40 | * libg3d. It may be required when writing a plugin which should load a | ||
41 | * #G3DImage or a #G3DModel with another plugin. | ||
42 | */ | ||
43 | |||
44 | /** | ||
45 | * G3DPluginType: | ||
46 | * @G3D_PLUGIN_UNKNOWN: unknown plugin type | ||
47 | * @G3D_PLUGIN_IMPORT: model import plugin | ||
48 | * @G3D_PLUGIN_IMAGE: image loading plugin | ||
49 | * | ||
50 | * Type of plugin. | ||
51 | */ | ||
52 | typedef enum { | ||
53 | G3D_PLUGIN_UNKNOWN = 0x00, | ||
54 | G3D_PLUGIN_IMPORT, | ||
55 | G3D_PLUGIN_IMAGE | ||
56 | } G3DPluginType; | ||
57 | |||
58 | /** | ||
59 | * G3DPluginInitFunc: | ||
60 | * @context: the context | ||
61 | * | ||
62 | * Prototype for plugin_init(). | ||
63 | * | ||
64 | * Returns: opaque plugin data. | ||
65 | */ | ||
66 | typedef gpointer (* G3DPluginInitFunc)(G3DContext *context); | ||
67 | |||
68 | /** | ||
69 | * G3DPluginCleanupFunc: | ||
70 | * @user_data: opaque plugin data | ||
71 | * | ||
72 | * Prototype for plugin_cleanup(). | ||
73 | */ | ||
74 | typedef void (* G3DPluginCleanupFunc)(gpointer user_data); | ||
75 | |||
76 | /** | ||
77 | * G3DPluginLoadModelFromStreamFunc: | ||
78 | * @context: the context | ||
79 | * @stream: the stream to load from | ||
80 | * @model: the model structure to fill | ||
81 | * @user_data: opaque plugin data | ||
82 | * | ||
83 | * Prototype for plugin_load_model_from_stream(). | ||
84 | * | ||
85 | * Returns: TRUE on success, FALSE else. | ||
86 | */ | ||
87 | typedef gboolean (* G3DPluginLoadModelFromStreamFunc)(G3DContext *context, | ||
88 | G3DStream *stream, G3DModel *model, gpointer user_data); | ||
89 | |||
90 | /** | ||
91 | * G3DPluginLoadImageStreamFunc: | ||
92 | * @context: the context | ||
93 | * @stream: the stream to load from | ||
94 | * @image: image structure to fill | ||
95 | * @user_data: opaque plugin data | ||
96 | * | ||
97 | * Prototype for plugin_load_image_from_stream(). | ||
98 | * | ||
99 | * Returns: TRUE on success, FALSE else. | ||
100 | */ | ||
101 | typedef gboolean (* G3DPluginLoadImageStreamFunc)(G3DContext *context, | ||
102 | G3DStream *stream, G3DImage *image, gpointer user_data); | ||
103 | |||
104 | /** | ||
105 | * G3DPluginGetDescFunc: | ||
106 | * @context: the context | ||
107 | * | ||
108 | * Prototype for plugin_description(). | ||
109 | * | ||
110 | * Returns: a newly-allocated string containing the description of the plugin. | ||
111 | */ | ||
112 | typedef gchar *(* G3DPluginGetDescFunc)(G3DContext *context); | ||
113 | |||
114 | /** | ||
115 | * G3DPluginGetExtFunc: | ||
116 | * @context: the context | ||
117 | * | ||
118 | * Prototype for plugin_extensions(). | ||
119 | * | ||
120 | * Returns: NULL-terminated list of file extensions supported by this plugin. | ||
121 | * Free with g_strfreev(). | ||
122 | */ | ||
123 | typedef gchar **(* G3DPluginGetExtFunc)(G3DContext *context); | ||
124 | |||
125 | /** | ||
126 | * G3DPlugin: | ||
127 | * | ||
128 | * A libg3d plugin. | ||
129 | */ | ||
130 | struct _G3DPlugin { | ||
131 | /*< private >*/ | ||
132 | gchar *name; | ||
133 | gchar *path; | ||
134 | G3DPluginType type; | ||
135 | gchar **extensions; | ||
136 | |||
137 | G3DPluginInitFunc init_func; | ||
138 | G3DPluginCleanupFunc cleanup_func; | ||
139 | G3DPluginLoadModelFromStreamFunc loadmodelstream_func; | ||
140 | G3DPluginLoadImageStreamFunc loadimagestream_func; | ||
141 | G3DPluginGetDescFunc desc_func; | ||
142 | G3DPluginGetExtFunc ext_func; | ||
143 | |||
144 | gpointer user_data; | ||
145 | |||
146 | GModule *module; | ||
147 | }; | ||
148 | |||
149 | /** | ||
150 | * g3d_plugins_init: | ||
151 | * @context: a valid #G3DContext | ||
152 | * | ||
153 | * Initializes the plugin system. This is implicitly done when using | ||
154 | * g3d_context_new(). | ||
155 | * | ||
156 | * Returns: TRUE on success, FALSE else. | ||
157 | */ | ||
158 | EAPI | ||
159 | gboolean g3d_plugins_init(G3DContext *context); | ||
160 | |||
161 | /** | ||
162 | * g3d_plugins_cleanup: | ||
163 | * @context: a valid context | ||
164 | * | ||
165 | * Clean up the plugin system. Usually done by g3d_context_free(). | ||
166 | */ | ||
167 | EAPI | ||
168 | void g3d_plugins_cleanup(G3DContext *context); | ||
169 | |||
170 | /** | ||
171 | * g3d_plugins_load_model: | ||
172 | * @context: a valid context | ||
173 | * @filename: file name of model to load | ||
174 | * @model: model structure to fill | ||
175 | * | ||
176 | * Try to load a model from file using import plugins. | ||
177 | * | ||
178 | * Returns: TRUE on success, FALSE else. | ||
179 | */ | ||
180 | EAPI | ||
181 | gboolean g3d_plugins_load_model(G3DContext *context, const gchar *filename, | ||
182 | G3DModel *model); | ||
183 | |||
184 | /** | ||
185 | * g3d_plugins_load_model_from_stream: | ||
186 | * @context: a valid context | ||
187 | * @stream: stream to load model from | ||
188 | * @model: model structure to fill | ||
189 | * | ||
190 | * Try to load a model from stream using import plugins. | ||
191 | * | ||
192 | * Returns: TRUE on success, FALSE else. | ||
193 | */ | ||
194 | EAPI | ||
195 | gboolean g3d_plugins_load_model_from_stream(G3DContext *context, | ||
196 | G3DStream *stream, G3DModel *model); | ||
197 | |||
198 | /** | ||
199 | * g3d_plugins_load_image: | ||
200 | * @context: a valid context | ||
201 | * @filename: file name of image to load | ||
202 | * @image: image structure to fill | ||
203 | * | ||
204 | * Try to load an image from file using import plugins. | ||
205 | * | ||
206 | * Returns: TRUE on success, FALSE else. | ||
207 | */ | ||
208 | EAPI | ||
209 | gboolean g3d_plugins_load_image(G3DContext *context, const gchar *filename, | ||
210 | G3DImage *image); | ||
211 | |||
212 | /** | ||
213 | * g3d_plugins_load_image_from_stream: | ||
214 | * @context: a valid context | ||
215 | * @stream: stream to load image from | ||
216 | * @image: image structure to fill | ||
217 | * | ||
218 | * Try to load an image from stream using import plugins. | ||
219 | * | ||
220 | * Returns: TRUE on success, FALSE else. | ||
221 | */ | ||
222 | EAPI | ||
223 | gboolean g3d_plugins_load_image_from_stream(G3DContext *context, | ||
224 | G3DStream *stream, G3DImage *image); | ||
225 | |||
226 | /** | ||
227 | * g3d_plugins_get_image_extensions: | ||
228 | * @context: a valid context | ||
229 | * | ||
230 | * Get the supported image type extensions. | ||
231 | * | ||
232 | * Returns: NULL-terminated list of image file extensions supported by this | ||
233 | * plugin. Free with g_strfreev(). | ||
234 | */ | ||
235 | EAPI | ||
236 | gchar **g3d_plugins_get_image_extensions(G3DContext *context); | ||
237 | |||
238 | #ifdef __cplusplus | ||
239 | } | ||
240 | #endif /* ifdef __cplusplus */ | ||
241 | |||
242 | #endif /* __G3D_PLUGINS_H__ */ | ||
243 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h new file mode 100644 index 0000000..3db23df --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/primitive.h | |||
@@ -0,0 +1,164 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __G3D_PRIMITIVE_H__ | ||
24 | #define __G3D_PRIMITIVE_H__ | ||
25 | |||
26 | #include <g3d/types.h> | ||
27 | |||
28 | #ifdef __cplusplus | ||
29 | extern "C" { | ||
30 | #endif /* ifdef __cplusplus */ | ||
31 | |||
32 | /** | ||
33 | * SECTION:primitive | ||
34 | * @short_description: 3D primitive generation functions | ||
35 | * @include: g3d/primitive.h | ||
36 | * | ||
37 | * Primitives are objects containing basic 3D geometrical structures. A | ||
38 | * variety of them can be created using these functions. | ||
39 | */ | ||
40 | |||
41 | /** | ||
42 | * g3d_primitive_box: | ||
43 | * @width: the width of the box | ||
44 | * @height: the height of the box | ||
45 | * @depth: the depth of the box | ||
46 | * @material: the material to use for all faces | ||
47 | * | ||
48 | * Generates an object containing a box. | ||
49 | * | ||
50 | * Returns: the box object | ||
51 | */ | ||
52 | EAPI | ||
53 | G3DObject *g3d_primitive_box(G3DFloat width, G3DFloat height, G3DFloat depth, | ||
54 | G3DMaterial *material); | ||
55 | |||
56 | #ifndef G3D_DISABLE_DEPRECATED | ||
57 | /** | ||
58 | * g3d_primitive_cube: | ||
59 | * @width: the width of the box | ||
60 | * @height: the height of the box | ||
61 | * @depth: the depth of the box | ||
62 | * @material: the material to use for all faces | ||
63 | * | ||
64 | * Generates an object containing a box. It is deprecated and now a wrapper for | ||
65 | * g3d_primitive_box(). | ||
66 | * | ||
67 | * Returns: the box object | ||
68 | */ | ||
69 | EAPI | ||
70 | G3DObject *g3d_primitive_cube(G3DFloat width, G3DFloat height, G3DFloat depth, | ||
71 | G3DMaterial *material); | ||
72 | #endif | ||
73 | |||
74 | /** | ||
75 | * g3d_primitive_cylinder: | ||
76 | * @radius: the radius of the cylinder | ||
77 | * @height: the height of the side faces | ||
78 | * @sides: number of side faces (number of circle segments) | ||
79 | * @top: add top faces | ||
80 | * @bottom: add bottom faces | ||
81 | * @material: material to use for faces | ||
82 | * | ||
83 | * Generates an object containing a cylinder. | ||
84 | * | ||
85 | * Returns: cylinder object | ||
86 | */ | ||
87 | EAPI | ||
88 | G3DObject *g3d_primitive_cylinder(G3DFloat radius, G3DFloat height, | ||
89 | guint32 sides, gboolean top, gboolean bottom, G3DMaterial *material); | ||
90 | |||
91 | /** | ||
92 | * g3d_primitive_tube: | ||
93 | * @r_in: inner radius | ||
94 | * @r_out: outer radius | ||
95 | * @height: the height of the side faces | ||
96 | * @sides: number of side faces (number of circle segments) | ||
97 | * @top: add top faces | ||
98 | * @bottom: add bottom faces | ||
99 | * @material: material to use for faces | ||
100 | * | ||
101 | * Generates an object containing a tube (a cylinder with a hole). | ||
102 | * | ||
103 | * Returns: tube object | ||
104 | */ | ||
105 | EAPI | ||
106 | G3DObject *g3d_primitive_tube(G3DFloat r_in, G3DFloat r_out, G3DFloat height, | ||
107 | guint32 sides, gboolean top, gboolean bottom, G3DMaterial *material); | ||
108 | |||
109 | /** | ||
110 | * g3d_primitive_sphere: | ||
111 | * @radius: radius | ||
112 | * @vseg: number of vertical segments | ||
113 | * @hseg: number of horizontal segments | ||
114 | * @material: material to use for faces | ||
115 | * | ||
116 | * Generates an object containing a sphere. | ||
117 | * | ||
118 | * Returns: sphere object | ||
119 | */ | ||
120 | EAPI | ||
121 | G3DObject *g3d_primitive_sphere(G3DFloat radius, guint32 vseg, guint32 hseg, | ||
122 | G3DMaterial *material); | ||
123 | |||
124 | /** | ||
125 | * g3d_primitive_box_strip_2d: | ||
126 | * @vcnt: number of control points | ||
127 | * @vdata: 2-dimensional control point data (2 * vcnt * gdouble) | ||
128 | * @height: height of resulting strip (y component) | ||
129 | * @width: width of strip (corner diameter) | ||
130 | * @material: material to use for faces | ||
131 | * | ||
132 | * Generates a strip of box segments defined by corner center points | ||
133 | * using two-dimensional data (x/z plane). | ||
134 | * | ||
135 | * Returns: strip object | ||
136 | */ | ||
137 | EAPI | ||
138 | G3DObject *g3d_primitive_box_strip_2d(guint32 vcnt, gdouble *vdata, | ||
139 | gdouble height, gdouble width, G3DMaterial *material); | ||
140 | |||
141 | /** | ||
142 | * g3d_primitive_mesh: | ||
143 | * @m: number of vertices in m direction | ||
144 | * @n: number of vertices in n direction | ||
145 | * @wrap_m: wrap around in m direction | ||
146 | * @wrap_n: wrap around in n direction | ||
147 | * @material: material to use for faces | ||
148 | * | ||
149 | * Generate a mesh consisting of m * n vertices. The vertex data is | ||
150 | * initialized with (0.0, 0.0, 0.0) and has to be set to something | ||
151 | * useful. | ||
152 | * | ||
153 | * Returns: mesh object | ||
154 | */ | ||
155 | EAPI | ||
156 | G3DObject *g3d_primitive_mesh(guint32 m, guint32 n, gboolean wrap_m, | ||
157 | gboolean wrap_n, G3DMaterial *material); | ||
158 | |||
159 | #ifdef __cplusplus | ||
160 | } | ||
161 | #endif /* ifdef __cplusplus */ | ||
162 | |||
163 | #endif /* __G3D_PRIMITIVE_H__ */ | ||
164 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/quat.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/quat.h new file mode 100644 index 0000000..2d68907 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/quat.h | |||
@@ -0,0 +1,117 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | #ifndef _G3D_QUAT_H | ||
23 | #define _G3D_QUAT_H | ||
24 | |||
25 | #include <g3d/types.h> | ||
26 | |||
27 | /** | ||
28 | * SECTION:quat | ||
29 | * @short_description: quaternion helpers | ||
30 | * @include: g3d/quat.h | ||
31 | */ | ||
32 | |||
33 | /** | ||
34 | * g3d_quat_normalize: | ||
35 | * @q: a quaternion | ||
36 | * | ||
37 | * normalize the quaternion to a length of 1.0. | ||
38 | * | ||
39 | * Returns: TRUE on success, FALSE else | ||
40 | */ | ||
41 | EAPI | ||
42 | gboolean g3d_quat_normalize(G3DQuat *q); | ||
43 | |||
44 | /** | ||
45 | * g3d_quat_rotate: | ||
46 | * @q: resulting quat | ||
47 | * @axis: rotation axis | ||
48 | * @angle: rotation angle | ||
49 | * | ||
50 | * Encode a rotation around an axis into quaternion. | ||
51 | * | ||
52 | * Returns: TRUE on success, FALSE else | ||
53 | */ | ||
54 | EAPI | ||
55 | gboolean g3d_quat_rotate(G3DQuat *q, G3DVector *axis, G3DFloat angle); | ||
56 | |||
57 | /** | ||
58 | * g3d_quat_add: | ||
59 | * @qr: result quat | ||
60 | * @q1: first quat | ||
61 | * @q2: second quat | ||
62 | * | ||
63 | * Add two quats. | ||
64 | * | ||
65 | * Returns: TRUE on success, FALSE else | ||
66 | */ | ||
67 | EAPI | ||
68 | gboolean g3d_quat_add(G3DQuat *qr, G3DQuat *q1, G3DQuat *q2); | ||
69 | |||
70 | /** | ||
71 | * g3d_quat_trackball: | ||
72 | * @q: resulting quaternion | ||
73 | * @x1: x value of first point | ||
74 | * @y1: y value of first point | ||
75 | * @x2: x value of second point | ||
76 | * @y2: y value of second point | ||
77 | * @r: radius of virtual trackball, usually 0.8 | ||
78 | * | ||
79 | * Emulate a virtual trackball movement and return rotation as quaternion. | ||
80 | * The x and y values of the starting and end point of the movement have | ||
81 | * to be in the range -1.0 .. 1.0. | ||
82 | * | ||
83 | * Returns: TRUE on success, FALSE else | ||
84 | */ | ||
85 | EAPI | ||
86 | gboolean g3d_quat_trackball(G3DQuat *q, G3DFloat x1, G3DFloat y1, | ||
87 | G3DFloat x2, G3DFloat y2, G3DFloat r); | ||
88 | |||
89 | /** | ||
90 | * g3d_quat_to_matrix: | ||
91 | * @q: source quat | ||
92 | * @matrix: resulting matrix | ||
93 | * | ||
94 | * Convert a quaternion to a transformation matrix. | ||
95 | * | ||
96 | * Returns: TRUE on success, FALSE else | ||
97 | */ | ||
98 | EAPI | ||
99 | gboolean g3d_quat_to_matrix(G3DQuat *q, G3DMatrix *matrix); | ||
100 | |||
101 | /** | ||
102 | * g3d_quat_to_rotation_xyz: | ||
103 | * @q: a quaternion | ||
104 | * @rx: rotation around x axis | ||
105 | * @ry: rotation around y axis | ||
106 | * @rz: rotation around z axis | ||
107 | * | ||
108 | * Calculate the rotation around the three coordinate axes from a given | ||
109 | * quaternion. | ||
110 | * | ||
111 | * Returns: TRUE on success, FALSE else | ||
112 | */ | ||
113 | EAPI | ||
114 | gboolean g3d_quat_to_rotation_xyz(G3DQuat *q, G3DFloat *rx, G3DFloat *ry, | ||
115 | G3DFloat *rz); | ||
116 | |||
117 | #endif /* _G3D_QUAT_H */ | ||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/read.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/read.h new file mode 100644 index 0000000..08211e3 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/read.h | |||
@@ -0,0 +1,156 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __G3D_READ_H__ | ||
24 | #define __G3D_READ_H__ | ||
25 | |||
26 | #ifndef G3D_DISABLE_DEPRECATED | ||
27 | |||
28 | #include <stdio.h> | ||
29 | #include <glib.h> | ||
30 | |||
31 | #ifdef __cplusplus | ||
32 | extern "C" { | ||
33 | #endif /* ifdef __cplusplus */ | ||
34 | |||
35 | /** | ||
36 | * SECTION:read | ||
37 | * @short_description: file reading abstraction (deprecated) | ||
38 | * @see_also: g3d_stream_open_file | ||
39 | * @include: g3d/read.h | ||
40 | * | ||
41 | * The g3d_read_* family of functions is deprecated in favour of the #G3DStream | ||
42 | * interface. | ||
43 | */ | ||
44 | |||
45 | |||
46 | /** | ||
47 | * g3d_read_int8: | ||
48 | * @f: the file to read from | ||
49 | * | ||
50 | * Read a 1 byte signed integer from file. | ||
51 | * | ||
52 | * Returns: The read value, 0 in case of error | ||
53 | */ | ||
54 | gint32 g3d_read_int8(FILE *f); | ||
55 | |||
56 | /** | ||
57 | * g3d_read_int16_be: | ||
58 | * @f: the file to read from | ||
59 | * | ||
60 | * Read a 2 byte big-endian signed integer from file. | ||
61 | * | ||
62 | * Returns: The read value, 0 in case of error | ||
63 | */ | ||
64 | gint32 g3d_read_int16_be(FILE *f); | ||
65 | |||
66 | /** | ||
67 | * g3d_read_int16_le: | ||
68 | * @f: the file to read from | ||
69 | * | ||
70 | * Read a 2 byte little-endian signed integer from file. | ||
71 | * | ||
72 | * Returns: The read value, 0 in case of error | ||
73 | */ | ||
74 | gint32 g3d_read_int16_le(FILE *f); | ||
75 | |||
76 | /** | ||
77 | * g3d_read_int32_be: | ||
78 | * @f: the file to read from | ||
79 | * | ||
80 | * Read a 4 byte big-endian signed integer from file. | ||
81 | * | ||
82 | * Returns: The read value, 0 in case of error | ||
83 | */ | ||
84 | gint32 g3d_read_int32_be(FILE *f); | ||
85 | |||
86 | /** | ||
87 | * g3d_read_int32_le: | ||
88 | * @f: the file to read from | ||
89 | * | ||
90 | * Read a 4 byte little-endian signed integer from file. | ||
91 | * | ||
92 | * Returns: The read value, 0 in case of error | ||
93 | */ | ||
94 | gint32 g3d_read_int32_le(FILE *f); | ||
95 | |||
96 | /** | ||
97 | * g3d_read_float_be: | ||
98 | * @f: the file to read from | ||
99 | * | ||
100 | * Read a 4 byte big-endian floating point number from file. | ||
101 | * | ||
102 | * Returns: The read value, 0 in case of error | ||
103 | */ | ||
104 | G3DFloat g3d_read_float_be(FILE *f); | ||
105 | |||
106 | /** | ||
107 | * g3d_read_float_le: | ||
108 | * @f: the file to read from | ||
109 | * | ||
110 | * Read a 4 byte little-endian floating point number from file. | ||
111 | * | ||
112 | * Returns: The read value, 0 in case of error | ||
113 | */ | ||
114 | G3DFloat g3d_read_float_le(FILE *f); | ||
115 | |||
116 | /** | ||
117 | * g3d_read_double_be: | ||
118 | * @f: the file to read from | ||
119 | * | ||
120 | * Read a 8 byte big-endian double-precision floating point number from file. | ||
121 | * | ||
122 | * Returns: The read value, 0 in case of error | ||
123 | */ | ||
124 | G3DDouble g3d_read_double_be(FILE *f); | ||
125 | |||
126 | /** | ||
127 | * g3d_read_double_le: | ||
128 | * @f: the file to read from | ||
129 | * | ||
130 | * Read a 8 byte little-endian double-precision floating point number from | ||
131 | * file. | ||
132 | * | ||
133 | * Returns: The read value, 0 in case of error | ||
134 | */ | ||
135 | G3DDouble g3d_read_double_le(FILE *f); | ||
136 | |||
137 | /** | ||
138 | * g3d_read_cstr: | ||
139 | * @f: the file to read from | ||
140 | * @buffer: the buffer to store line in | ||
141 | * @max_len: maximum length of string including termination character | ||
142 | * | ||
143 | * Read a zero-terminated string from file. | ||
144 | * | ||
145 | * Returns: number of bytes read from file. | ||
146 | */ | ||
147 | gint32 g3d_read_cstr(FILE *f, gchar *buffer, gint32 max_len); | ||
148 | |||
149 | #ifdef __cplusplus | ||
150 | } | ||
151 | #endif /* ifdef __cplusplus */ | ||
152 | |||
153 | #endif /* G3D_DISABLE_DEPRECATED */ | ||
154 | |||
155 | #endif /* __G3D_READ_H__ */ | ||
156 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/stream.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/stream.h new file mode 100644 index 0000000..f3f9630 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/stream.h | |||
@@ -0,0 +1,541 @@ | |||
1 | /* $Id:$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef _G3D_STREAM_H | ||
24 | #define _G3D_STREAM_H | ||
25 | |||
26 | #include <glib.h> | ||
27 | #include <g3d/types.h> | ||
28 | |||
29 | #ifdef __cplusplus | ||
30 | extern "C" { | ||
31 | #endif /* ifdef __cplusplus */ | ||
32 | |||
33 | /** | ||
34 | * SECTION:stream | ||
35 | * @short_description: I/O abstraction layer for plugins | ||
36 | * @see_also: #G3DStream | ||
37 | * @include: g3d/stream.h | ||
38 | * | ||
39 | * A stream is an abstraction for data input. It enables plugins to read | ||
40 | * data from a file, a memory buffer, a container file or some other medium. | ||
41 | */ | ||
42 | |||
43 | enum { | ||
44 | /* shift offsets */ | ||
45 | G3D_STREAM_SEEKABLE = 0x00, | ||
46 | G3D_STREAM_READABLE = 0x01, | ||
47 | G3D_STREAM_WRITABLE = 0x02 | ||
48 | }; | ||
49 | |||
50 | /** | ||
51 | * G3DStreamReadFunc: | ||
52 | * @ptr: buffer to read bytes into | ||
53 | * @size: number of bytes to read | ||
54 | * @data: opaque stream data | ||
55 | * | ||
56 | * Callback function for g3d_stream_read(). | ||
57 | * | ||
58 | * Returns: number of bytes actually read. | ||
59 | */ | ||
60 | typedef gsize (* G3DStreamReadFunc)(gpointer ptr, gsize size, gpointer data); | ||
61 | |||
62 | /** | ||
63 | * G3DStreamReadLineFunc: | ||
64 | * @buf: buffer to read bytes into | ||
65 | * @size: maximum size of buffer | ||
66 | * @data: opaque stream data | ||
67 | * | ||
68 | * Callback function for g3d_stream_read_line(). | ||
69 | * | ||
70 | * Returns: The line buffer or NULL in case of an error. | ||
71 | */ | ||
72 | typedef gchar *(* G3DStreamReadLineFunc)(gchar *buf, gsize size, | ||
73 | gpointer data); | ||
74 | |||
75 | /** | ||
76 | * G3DStreamSeekFunc: | ||
77 | * @data: opaque stream data | ||
78 | * @offset: seek offset | ||
79 | * @whence: seek type | ||
80 | * | ||
81 | * Callback function for g3d_stream_seek(). | ||
82 | * | ||
83 | * Returns: 0 on success, -1 else. | ||
84 | */ | ||
85 | typedef gint (*G3DStreamSeekFunc)(gpointer data, goffset offset, | ||
86 | GSeekType whence); | ||
87 | |||
88 | /** | ||
89 | * G3DStreamTellFunc: | ||
90 | * @data: opaque stream data | ||
91 | * | ||
92 | * Callback function for g3d_stream_tell(). | ||
93 | * | ||
94 | * Returns: current stream position. | ||
95 | */ | ||
96 | typedef goffset (*G3DStreamTellFunc)(gpointer data); | ||
97 | |||
98 | /** | ||
99 | * G3DStreamSizeFunc: | ||
100 | * @data: opaque stream data | ||
101 | * | ||
102 | * Callback function for g3d_stream_size(). | ||
103 | * | ||
104 | * Returns: size of stream. | ||
105 | */ | ||
106 | typedef goffset (*G3DStreamSizeFunc)(gpointer data); | ||
107 | |||
108 | /** | ||
109 | * G3DStreamEofFunc: | ||
110 | * @data: opaque stream data | ||
111 | * | ||
112 | * Callback function for g3d_stream_eof(). | ||
113 | * | ||
114 | * Returns: TRUE on stream end-of-file, FALSE else. | ||
115 | */ | ||
116 | typedef gboolean (*G3DStreamEofFunc)(gpointer data); | ||
117 | |||
118 | /** | ||
119 | * G3DStreamCloseFunc: | ||
120 | * @data: opaque stream data | ||
121 | * | ||
122 | * Callback function for g3d_stream_close(). | ||
123 | * | ||
124 | * Returns: 0 on success, -1 else. | ||
125 | */ | ||
126 | typedef gint (*G3DStreamCloseFunc)(gpointer data); | ||
127 | |||
128 | /** | ||
129 | * G3DStream: | ||
130 | * | ||
131 | * An abstraction of input handling. | ||
132 | */ | ||
133 | struct _G3DStream { | ||
134 | /*< private >*/ | ||
135 | guint32 flags; | ||
136 | gchar *uri; | ||
137 | G3DStreamReadFunc read; | ||
138 | G3DStreamReadLineFunc readline; | ||
139 | G3DStreamSeekFunc seek; | ||
140 | G3DStreamTellFunc tell; | ||
141 | G3DStreamSizeFunc size; | ||
142 | G3DStreamEofFunc eof; | ||
143 | G3DStreamCloseFunc close; | ||
144 | gpointer data; | ||
145 | guint32 linecount; | ||
146 | struct _G3DStream *zip_container; | ||
147 | }; | ||
148 | |||
149 | /* public interface */ | ||
150 | |||
151 | /** | ||
152 | * g3d_stream_is_seekable: | ||
153 | * @stream: the stream | ||
154 | * | ||
155 | * Get information whether it is possible to seek in a stream. | ||
156 | * | ||
157 | * Returns: TRUE if seekable, FALSE else | ||
158 | */ | ||
159 | EAPI | ||
160 | gboolean g3d_stream_is_seekable(G3DStream *stream); | ||
161 | |||
162 | /** | ||
163 | * g3d_stream_get_uri: | ||
164 | * @stream: the stream | ||
165 | * | ||
166 | * Get the URI of a stream | ||
167 | * | ||
168 | * Returns: a non-NULL, zero-terminated string containing the URI of the | ||
169 | * string. This return value should not be freed. | ||
170 | */ | ||
171 | EAPI | ||
172 | gchar *g3d_stream_get_uri(G3DStream *stream); | ||
173 | |||
174 | /** | ||
175 | * g3d_stream_read_int8: | ||
176 | * @stream: the stream to read from | ||
177 | * | ||
178 | * Read a 1 byte signed integer from file. | ||
179 | * | ||
180 | * Returns: The read value, 0 in case of error | ||
181 | */ | ||
182 | EAPI | ||
183 | gint32 g3d_stream_read_int8(G3DStream *stream); | ||
184 | |||
185 | /** | ||
186 | * g3d_stream_read_int16_be: | ||
187 | * @stream: the stream to read from | ||
188 | * | ||
189 | * Read a 2 byte big-endian signed integer from file. | ||
190 | * | ||
191 | * Returns: The read value, 0 in case of error | ||
192 | */ | ||
193 | EAPI | ||
194 | gint32 g3d_stream_read_int16_be(G3DStream *stream); | ||
195 | |||
196 | /** | ||
197 | * g3d_stream_read_int16_le: | ||
198 | * @stream: the stream to read from | ||
199 | * | ||
200 | * Read a 2 byte little-endian signed integer from file. | ||
201 | * | ||
202 | * Returns: The read value, 0 in case of error | ||
203 | */ | ||
204 | EAPI | ||
205 | gint32 g3d_stream_read_int16_le(G3DStream *stream); | ||
206 | |||
207 | /** | ||
208 | * g3d_stream_read_int32_be: | ||
209 | * @stream: the stream to read from | ||
210 | * | ||
211 | * Read a 4 byte big-endian signed integer from file. | ||
212 | * | ||
213 | * Returns: The read value, 0 in case of error | ||
214 | */ | ||
215 | EAPI | ||
216 | gint32 g3d_stream_read_int32_be(G3DStream *stream); | ||
217 | |||
218 | /** | ||
219 | * g3d_stream_read_int32_le: | ||
220 | * @stream: the stream to read from | ||
221 | * | ||
222 | * Read a 4 byte little-endian signed integer from file. | ||
223 | * | ||
224 | * Returns: The read value, 0 in case of error | ||
225 | */ | ||
226 | EAPI | ||
227 | gint32 g3d_stream_read_int32_le(G3DStream *stream); | ||
228 | |||
229 | /** | ||
230 | * g3d_stream_read_float_be: | ||
231 | * @stream: the stream to read from | ||
232 | * | ||
233 | * Read a 4 byte big-endian floating point number from file. | ||
234 | * | ||
235 | * Returns: The read value, 0 in case of error | ||
236 | */ | ||
237 | EAPI | ||
238 | G3DFloat g3d_stream_read_float_be(G3DStream *stream); | ||
239 | |||
240 | /** | ||
241 | * g3d_stream_read_float_le: | ||
242 | * @stream: the stream to read from | ||
243 | * | ||
244 | * Read a 4 byte little-endian floating point number from file. | ||
245 | * | ||
246 | * Returns: The read value, 0 in case of error | ||
247 | */ | ||
248 | EAPI | ||
249 | G3DFloat g3d_stream_read_float_le(G3DStream *stream); | ||
250 | |||
251 | /** | ||
252 | * g3d_stream_read_double_be: | ||
253 | * @stream: the stream to read from | ||
254 | * | ||
255 | * Read a 8 byte big-endian double-precision floating point number from file. | ||
256 | * | ||
257 | * Returns: The read value, 0 in case of error | ||
258 | */ | ||
259 | EAPI | ||
260 | G3DDouble g3d_stream_read_double_be(G3DStream *stream); | ||
261 | |||
262 | /** | ||
263 | * g3d_stream_read_double_le: | ||
264 | * @stream: the stream to read from | ||
265 | * | ||
266 | * Read a 8 byte little-endian double-precision floating point number from | ||
267 | * file. | ||
268 | * | ||
269 | * Returns: The read value, 0 in case of error | ||
270 | */ | ||
271 | EAPI | ||
272 | G3DDouble g3d_stream_read_double_le(G3DStream *stream); | ||
273 | |||
274 | /** | ||
275 | * g3d_stream_read_cstr: | ||
276 | * @stream: the stream to read from | ||
277 | * @buffer: the buffer to fill | ||
278 | * @max_len: maximum number to read from stream | ||
279 | * | ||
280 | * Read a string (terminated by '\0') from stream | ||
281 | * | ||
282 | * Returns: number of bytes read from stream | ||
283 | */ | ||
284 | EAPI | ||
285 | gint32 g3d_stream_read_cstr(G3DStream *stream, gchar *buffer, gint32 max_len); | ||
286 | |||
287 | /** | ||
288 | * g3d_stream_read: | ||
289 | * @stream: the stream to read from | ||
290 | * @ptr: pointer to memory storage | ||
291 | * @size: number of bytes to read | ||
292 | * | ||
293 | * Reads a number of bytes from the stream. | ||
294 | * | ||
295 | * Returns: number of bytes successfully read. | ||
296 | */ | ||
297 | EAPI | ||
298 | gsize g3d_stream_read(G3DStream *stream, gpointer ptr, gsize size); | ||
299 | |||
300 | /** | ||
301 | * g3d_stream_read_line: | ||
302 | * @stream: stream to read a line from | ||
303 | * @buf: an allocated buffer to be filled | ||
304 | * @size: maximum length of line including terminating zero | ||
305 | * | ||
306 | * Read a line (terminated by a newline character or end of file) from a | ||
307 | * stream. | ||
308 | * | ||
309 | * Returns: the read line or NULL in case of an error. | ||
310 | */ | ||
311 | EAPI | ||
312 | gchar *g3d_stream_read_line(G3DStream *stream, gchar *buf, gsize size); | ||
313 | |||
314 | /** | ||
315 | * g3d_stream_skip: | ||
316 | * @stream: stream to skip bytes from | ||
317 | * @offset: number of bytes to skip | ||
318 | * | ||
319 | * Skip a number of bytes (>= 0) in stream even if it does not support | ||
320 | * seeking. | ||
321 | * | ||
322 | * Returns: 0 on success, -1 else | ||
323 | */ | ||
324 | EAPI | ||
325 | gint g3d_stream_skip(G3DStream *stream, goffset offset); | ||
326 | |||
327 | /** | ||
328 | * g3d_stream_seek: | ||
329 | * @stream: stream to seek in | ||
330 | * @offset: number of bytes to seek | ||
331 | * @whence: seek type | ||
332 | * | ||
333 | * Moves around the current position in the stream. | ||
334 | * | ||
335 | * Returns: 0 on success, -1 else | ||
336 | */ | ||
337 | EAPI | ||
338 | gint g3d_stream_seek(G3DStream *stream, goffset offset, GSeekType whence); | ||
339 | |||
340 | /** | ||
341 | * g3d_stream_tell: | ||
342 | * @stream: stream to get position from | ||
343 | * | ||
344 | * Tells the current position in the stream. | ||
345 | * | ||
346 | * Returns: current stream position | ||
347 | */ | ||
348 | EAPI | ||
349 | goffset g3d_stream_tell(G3DStream *stream); | ||
350 | |||
351 | /** | ||
352 | * g3d_stream_line: | ||
353 | * @stream: stream to get line from | ||
354 | * | ||
355 | * Get the current line number from stream. This only works if line are | ||
356 | * consequently read with g3d_stream_read_line(), so it's only applicable | ||
357 | * for text streams. | ||
358 | * | ||
359 | * Returns: current line number, may be 0 | ||
360 | */ | ||
361 | EAPI | ||
362 | guint32 g3d_stream_line(G3DStream *stream); | ||
363 | |||
364 | /** | ||
365 | * g3d_stream_size: | ||
366 | * @stream: stream to get size from | ||
367 | * | ||
368 | * Get the size in bytes of a stream. | ||
369 | * | ||
370 | * Returns: size of stream in bytes | ||
371 | */ | ||
372 | EAPI | ||
373 | goffset g3d_stream_size(G3DStream *stream); | ||
374 | |||
375 | /** | ||
376 | * g3d_stream_eof: | ||
377 | * @stream: the stream | ||
378 | * | ||
379 | * Checks whether the stream has reached its end. | ||
380 | * | ||
381 | * Returns: TRUE if no more data can be read, FALSE else. | ||
382 | */ | ||
383 | EAPI | ||
384 | gboolean g3d_stream_eof(G3DStream *stream); | ||
385 | |||
386 | /** | ||
387 | * g3d_stream_close: | ||
388 | * @stream: the stream | ||
389 | * | ||
390 | * Closes an open stream. | ||
391 | * | ||
392 | * Returns: 0 on success. | ||
393 | */ | ||
394 | EAPI | ||
395 | gint g3d_stream_close(G3DStream *stream); | ||
396 | |||
397 | /** | ||
398 | * g3d_stream_new_custom: | ||
399 | * @flags: stream capability flags | ||
400 | * @uri: URI of new stream, must not be NULL | ||
401 | * @readfunc: read callback function | ||
402 | * @readlinefunc: read line callback function, may be NULL in which case | ||
403 | * line reading is emulated with g3d_stream_read() | ||
404 | * @seekfunc: seek callback function | ||
405 | * @tellfunc: tell callback function | ||
406 | * @sizefunc: size callback function | ||
407 | * @eoffunc: end-of-file callback function | ||
408 | * @closefunc: close callback function | ||
409 | * @data: opaque data for all callback functions | ||
410 | * @zip_container: original zip container | ||
411 | * | ||
412 | * Creates a new #G3DStream with custom callback functions. | ||
413 | * | ||
414 | * Returns: a newly allocated #G3DStream or NULL in case of an error. | ||
415 | */ | ||
416 | EAPI | ||
417 | G3DStream *g3d_stream_new_custom(guint32 flags, const gchar *uri, | ||
418 | G3DStreamReadFunc readfunc, G3DStreamReadLineFunc readlinefunc, | ||
419 | G3DStreamSeekFunc seekfunc, G3DStreamTellFunc tellfunc, | ||
420 | G3DStreamSizeFunc sizefunc, | ||
421 | G3DStreamEofFunc eoffunc, G3DStreamCloseFunc closefunc, gpointer data, | ||
422 | G3DStream *zip_container); | ||
423 | |||
424 | /** | ||
425 | * g3d_stream_open_file: | ||
426 | * @filename: the name of the file to open | ||
427 | * @mode: the mode to open the file, as given to fopen() | ||
428 | * | ||
429 | * Opens a file with the C stdio routines. | ||
430 | * | ||
431 | * Returns: a newly allocated #G3DStream or NULL in case of an error. | ||
432 | */ | ||
433 | EAPI | ||
434 | G3DStream *g3d_stream_open_file(const gchar *filename, const gchar *mode); | ||
435 | |||
436 | /** | ||
437 | * g3d_stream_from_buffer: | ||
438 | * @buffer: memory buffer to use | ||
439 | * @size: size of buffer | ||
440 | * @title: optional title of stream, may be NULL | ||
441 | * @free_buffer: whether to free the memory with g_free() on g3d_stream_close() | ||
442 | * | ||
443 | * Use a buffer in memory as #G3DStream. | ||
444 | * | ||
445 | * Returns: a newly allocated #G3DStream or NULL in case of an error. | ||
446 | */ | ||
447 | EAPI | ||
448 | G3DStream *g3d_stream_from_buffer(guint8 *buffer, gsize size, | ||
449 | const gchar *title, gboolean free_buffer); | ||
450 | |||
451 | #ifdef HAVE_ZLIB | ||
452 | |||
453 | /** | ||
454 | * g3d_stream_zlib_inflate_stream: | ||
455 | * @stream: a parent stream | ||
456 | * @cmp_size: the compressed size of the deflated part | ||
457 | * | ||
458 | * Opens a new stream to decompress zlib-deflated parts of a stream. | ||
459 | * | ||
460 | * Returns: a newly allocated #G3DStream or NULL in case of an error | ||
461 | */ | ||
462 | EAPI | ||
463 | G3DStream *g3d_stream_zlib_inflate_stream(G3DStream *stream, gsize cmp_size); | ||
464 | |||
465 | #endif /* HAVE_ZLIB */ | ||
466 | |||
467 | #ifdef HAVE_LIBGSF | ||
468 | |||
469 | /** | ||
470 | * g3d_stream_open_gzip_from_stream: | ||
471 | * @stream: stream to read from | ||
472 | * | ||
473 | * Reads data from a gzip-compressed stream. | ||
474 | * | ||
475 | * Returns: a newly allocated #G3DStream or NULL in case of an error. | ||
476 | */ | ||
477 | EAPI | ||
478 | G3DStream *g3d_stream_open_gzip_from_stream(G3DStream *stream); | ||
479 | |||
480 | /** | ||
481 | * g3d_stream_open_structured_file: | ||
482 | * @filename: name of container file | ||
483 | * @subfile: name of (contained) sub-file | ||
484 | * | ||
485 | * Open a file within a Structured File as #G3DStream. | ||
486 | * | ||
487 | * Returns: a newly allocated #G3DStream or NULL in case of an error. | ||
488 | */ | ||
489 | EAPI | ||
490 | G3DStream *g3d_stream_open_structured_file(const gchar *filename, | ||
491 | const gchar *subfile); | ||
492 | |||
493 | /** | ||
494 | * g3d_stream_open_structured_file_from_stream: | ||
495 | * @stream: stream of container file | ||
496 | * @subfile: name of (contained) sub-file | ||
497 | * | ||
498 | * Open a file within a Structured File which is opened as a stream. At the | ||
499 | * moment this only works for streams opened by g3d_stream_open_file() as | ||
500 | * the file is directly opened again. | ||
501 | * | ||
502 | * Returns: a newly allocated #G3DStream or NULL in case of an error. | ||
503 | */ | ||
504 | EAPI | ||
505 | G3DStream *g3d_stream_open_structured_file_from_stream(G3DStream *stream, | ||
506 | const gchar *subfile); | ||
507 | |||
508 | /** | ||
509 | * g3d_stream_open_zip: | ||
510 | * @filename: name of container file | ||
511 | * @subfile: name of (contained) sub-file | ||
512 | * | ||
513 | * Open a file within a Zip archive. | ||
514 | * | ||
515 | * Returns: a newly allocated #G3DStream or NULL in case of an error. | ||
516 | */ | ||
517 | EAPI | ||
518 | G3DStream *g3d_stream_open_zip(const gchar *filename, const gchar *subfile); | ||
519 | |||
520 | /** | ||
521 | * g3d_stream_open_zip_from_stream: | ||
522 | * @stream: stream of container file | ||
523 | * @subfile: name of (contained) sub-file | ||
524 | * | ||
525 | * Open a file within a Zip archive which is opened as a stream. At the | ||
526 | * moment this only works for streams opened by g3d_stream_open_file() as | ||
527 | * the file is directly opened again. | ||
528 | * | ||
529 | * Returns: a newly allocated #G3DStream or NULL in case of an error. | ||
530 | */ | ||
531 | EAPI | ||
532 | G3DStream *g3d_stream_open_zip_from_stream(G3DStream *stream, | ||
533 | const gchar *subfile); | ||
534 | #endif | ||
535 | |||
536 | #ifdef __cplusplus | ||
537 | } | ||
538 | #endif /* ifdef __cplusplus */ | ||
539 | |||
540 | #endif /* _G3D_STREAM_H */ | ||
541 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/texture.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/texture.h new file mode 100644 index 0000000..f5643a8 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/texture.h | |||
@@ -0,0 +1,123 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __G3D_TEXTURE_H__ | ||
24 | #define __G3D_TEXTURE_H__ | ||
25 | |||
26 | #include <g3d/types.h> | ||
27 | |||
28 | #ifdef __cplusplus | ||
29 | extern "C" { | ||
30 | #endif /* ifdef __cplusplus */ | ||
31 | |||
32 | /** | ||
33 | * SECTION:texture | ||
34 | * @short_description: Texture loading and manipulation | ||
35 | * @include: g3d/texture.h | ||
36 | * | ||
37 | * A texture is an image used in materials. Here are some helper functions, | ||
38 | * mostly for cached loading of a #G3DImage. | ||
39 | */ | ||
40 | |||
41 | /** | ||
42 | * g3d_texture_load_from_stream: | ||
43 | * @context: a valid context | ||
44 | * @model: a valid model or NULL | ||
45 | * @stream: an open stream | ||
46 | * | ||
47 | * Load a texture image from a stream. The file type is determined by the | ||
48 | * extension of the stream URI, so it should be valid. If @model is not NULL | ||
49 | * the texture image is cached (or retrieved from cache if available). | ||
50 | * | ||
51 | * Returns: the texture image or NULL in case of an error. | ||
52 | */ | ||
53 | EAPI | ||
54 | G3DImage *g3d_texture_load_from_stream(G3DContext *context, G3DModel *model, | ||
55 | G3DStream *stream); | ||
56 | |||
57 | /** | ||
58 | * g3d_texture_load_cached: | ||
59 | * @context: a valid context | ||
60 | * @model: a valid model | ||
61 | * @filename: the file name of the texture to load | ||
62 | * | ||
63 | * Loads a texture image from file and attaches it to a hash table in the | ||
64 | * model. On a second try to load this texture it is returned from cache. | ||
65 | * | ||
66 | * Returns: the texture image | ||
67 | */ | ||
68 | EAPI | ||
69 | G3DImage *g3d_texture_load_cached(G3DContext *context, G3DModel *model, | ||
70 | const gchar *filename); | ||
71 | |||
72 | /** | ||
73 | * g3d_texture_free: | ||
74 | * @texture: a texture image | ||
75 | * | ||
76 | * Frees all memory used by this texture image. | ||
77 | */ | ||
78 | EAPI | ||
79 | void g3d_texture_free(G3DImage *texture); | ||
80 | |||
81 | /** | ||
82 | * g3d_texture_prepare: | ||
83 | * @texture: a texture image | ||
84 | * | ||
85 | * Resizes the image to dimensions which are a power of 2 to be | ||
86 | * usable as an OpenGL texture. | ||
87 | * (FIXME: unimplemented) | ||
88 | * | ||
89 | * Returns: TRUE on success, FALSE else | ||
90 | */ | ||
91 | EAPI | ||
92 | gboolean g3d_texture_prepare(G3DImage *texture); | ||
93 | |||
94 | /** | ||
95 | * g3d_texture_flip_y: | ||
96 | * @texture: a texture image | ||
97 | * | ||
98 | * Mirror the image along the x axis - all y coordinates are inverted. | ||
99 | * | ||
100 | * Returns: TRUE on success, FALSE on error. | ||
101 | */ | ||
102 | EAPI | ||
103 | gboolean g3d_texture_flip_y(G3DImage *texture); | ||
104 | |||
105 | /** | ||
106 | * g3d_texture_merge_alpha: | ||
107 | * @image: a texture image or NULL | ||
108 | * @aimage: an image with alpha information | ||
109 | * | ||
110 | * Merges alpha information from @aimage into output image. If @image is NULL a | ||
111 | * new image is created, else @image is returned with alpha from @aimage. | ||
112 | * | ||
113 | * Returns: a texture image or NULL in case of an error. | ||
114 | */ | ||
115 | EAPI | ||
116 | G3DImage *g3d_texture_merge_alpha(G3DImage *image, G3DImage *aimage); | ||
117 | |||
118 | #ifdef __cplusplus | ||
119 | } | ||
120 | #endif /* ifdef __cplusplus */ | ||
121 | |||
122 | #endif /* __G3D_TEXTURE_H__ */ | ||
123 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/types.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/types.h new file mode 100644 index 0000000..a2403a0 --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/types.h | |||
@@ -0,0 +1,478 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __G3D_TYPES_H__ | ||
24 | #define __G3D_TYPES_H__ | ||
25 | |||
26 | #include <GL/gl.h> | ||
27 | |||
28 | #include <glib.h> | ||
29 | |||
30 | #ifdef USE_LIBMAGIC | ||
31 | #include <magic.h> | ||
32 | #endif | ||
33 | |||
34 | #ifdef EAPI | ||
35 | # undef EAPI | ||
36 | #endif /* ifdef EAPI */ | ||
37 | |||
38 | #ifdef _WIN32 | ||
39 | # ifdef EFL_EET_BUILD | ||
40 | # ifdef DLL_EXPORT | ||
41 | # define EAPI __declspec(dllexport) | ||
42 | # else /* ifdef DLL_EXPORT */ | ||
43 | # define EAPI | ||
44 | # endif /* ! DLL_EXPORT */ | ||
45 | # else /* ifdef EFL_EET_BUILD */ | ||
46 | # define EAPI __declspec(dllimport) | ||
47 | # endif /* ! EFL_EET_BUILD */ | ||
48 | #else /* ifdef _WIN32 */ | ||
49 | # ifdef __GNUC__ | ||
50 | # if __GNUC__ >= 4 | ||
51 | # define EAPI __attribute__ ((visibility("default"))) | ||
52 | # else /* if __GNUC__ >= 4 */ | ||
53 | # define EAPI | ||
54 | # endif /* if __GNUC__ >= 4 */ | ||
55 | # else /* ifdef __GNUC__ */ | ||
56 | # define EAPI | ||
57 | # endif /* ifdef __GNUC__ */ | ||
58 | #endif /* ! _WIN32 */ | ||
59 | |||
60 | |||
61 | #ifdef __cplusplus | ||
62 | extern "C" { | ||
63 | #endif /* ifdef __cplusplus */ | ||
64 | |||
65 | /** | ||
66 | * SECTION:types | ||
67 | * @short_description: some defined types for libg3d | ||
68 | * @include: g3d/g3d.h | ||
69 | */ | ||
70 | /* goffset is defined since glib 2.14 */ | ||
71 | #ifndef G_MAXOFFSET | ||
72 | typedef gint64 goffset; | ||
73 | #endif | ||
74 | |||
75 | /* supposed to trick gtk-doc not to ignore these functions - not really... */ | ||
76 | #define _G3D_STATIC_INLINE static inline | ||
77 | |||
78 | /***************************************************************************** | ||
79 | * basic types | ||
80 | *****************************************************************************/ | ||
81 | |||
82 | /** | ||
83 | * SECTION:types | ||
84 | * @short_description: Basic types | ||
85 | * @include: g3d/types.h | ||
86 | * | ||
87 | * Some basic type abstractions used in libg3d. | ||
88 | */ | ||
89 | |||
90 | /** | ||
91 | * G3DFloat: | ||
92 | * | ||
93 | * Default floating point type. If used consistently in the library (not the | ||
94 | * case at the moment) this type can be switched between single and double | ||
95 | * precision at compile-time. | ||
96 | */ | ||
97 | /** | ||
98 | * G3D_FLOAT_IS_DOUBLE | ||
99 | * | ||
100 | * A flag indicating type of #G3DFloat. It is TRUE if #G3DFloat is double and | ||
101 | * FALSE if #G3DFloat is single precision. | ||
102 | */ | ||
103 | #if 1 | ||
104 | #define G3D_FLOAT_IS_DOUBLE TRUE | ||
105 | #define G3D_SCANF_FLOAT "%lf" | ||
106 | typedef gdouble G3DFloat; | ||
107 | #else | ||
108 | #define G3D_FLOAT_IS_DOUBLE FALSE | ||
109 | #define G3D_SCANF_FLOAT "%f" | ||
110 | typedef gfloat G3DFloat; | ||
111 | #endif | ||
112 | /** | ||
113 | * G3DSingle: | ||
114 | * | ||
115 | * Single-precision floating point number. | ||
116 | */ | ||
117 | typedef gfloat G3DSingle; | ||
118 | /** | ||
119 | * G3DDouble: | ||
120 | * | ||
121 | * Double-precision floating point number. | ||
122 | */ | ||
123 | typedef gdouble G3DDouble; | ||
124 | /** | ||
125 | * G3DVector | ||
126 | * | ||
127 | * Vector element type. | ||
128 | */ | ||
129 | typedef G3DFloat G3DVector; | ||
130 | /** | ||
131 | * G3DMatrix: | ||
132 | * | ||
133 | * Matrix element type. | ||
134 | */ | ||
135 | typedef G3DFloat G3DMatrix; | ||
136 | /** | ||
137 | * G3DQuat | ||
138 | * | ||
139 | * Quaternion element type. | ||
140 | */ | ||
141 | typedef G3DFloat G3DQuat; | ||
142 | |||
143 | /***************************************************************************** | ||
144 | * G3DImage | ||
145 | *****************************************************************************/ | ||
146 | |||
147 | /** | ||
148 | * G3D_FLAG_IMG_GREYSCALE: | ||
149 | * | ||
150 | * The image just uses the red channel for grey value | ||
151 | */ | ||
152 | #define G3D_FLAG_IMG_GREYSCALE (1L << 1) | ||
153 | |||
154 | /** | ||
155 | * G3DTexEnv: | ||
156 | * @G3D_TEXENV_UNSPECIFIED: unspecified, application decides | ||
157 | * @G3D_TEXENV_BLEND: use blending | ||
158 | * @G3D_TEXENV_DECAL: use as decal | ||
159 | * @G3D_TEXENV_MODULATE: use modulate | ||
160 | * @G3D_TEXENV_REPLACE: replace color | ||
161 | * | ||
162 | * Specify how the texture should interact with other material properties. | ||
163 | */ | ||
164 | typedef enum { | ||
165 | G3D_TEXENV_UNSPECIFIED = 0, | ||
166 | G3D_TEXENV_BLEND, | ||
167 | G3D_TEXENV_DECAL, | ||
168 | G3D_TEXENV_MODULATE, | ||
169 | G3D_TEXENV_REPLACE | ||
170 | } G3DTexEnv; | ||
171 | |||
172 | /** | ||
173 | * G3DImage: | ||
174 | * @name: name of image | ||
175 | * @width: width of image in pixels | ||
176 | * @height: height of image in pixels | ||
177 | * @depth: depth of image in bits | ||
178 | * @flags: flags | ||
179 | * @pixeldata: the binary image data | ||
180 | * @tex_id: the OpenGL texture id, should be unique model-wide | ||
181 | * @tex_env: texture environment flags | ||
182 | * @tex_scale_u: factor scaling texture width, should be 1.0 for most cases | ||
183 | * @tex_scale_v: factor scaling texture height, should be 1.0 for most cases | ||
184 | * | ||
185 | * Object containing a two-dimensional pixel image. | ||
186 | */ | ||
187 | typedef struct { | ||
188 | gchar *name; | ||
189 | guint32 width; | ||
190 | guint32 height; | ||
191 | guint8 depth; | ||
192 | guint32 flags; | ||
193 | guint8 *pixeldata; | ||
194 | |||
195 | guint32 tex_id; | ||
196 | G3DTexEnv tex_env; | ||
197 | G3DFloat tex_scale_u; | ||
198 | G3DFloat tex_scale_v; | ||
199 | } G3DImage; | ||
200 | |||
201 | /***************************************************************************** | ||
202 | * G3DMaterial | ||
203 | *****************************************************************************/ | ||
204 | |||
205 | /** | ||
206 | * G3D_FLAG_MAT_TWOSIDE: | ||
207 | * | ||
208 | * Faces using this material should be rendered two-sided as the direction | ||
209 | * is unknown. | ||
210 | */ | ||
211 | #define G3D_FLAG_MAT_TWOSIDE (1L << 0) | ||
212 | |||
213 | /** | ||
214 | * G3DMaterial: | ||
215 | * @name: name of material | ||
216 | * @r: red component of color | ||
217 | * @g: green component of color | ||
218 | * @b: blue component of color | ||
219 | * @a: alpha component of color | ||
220 | * @shininess: shiny color | ||
221 | * @specular: specular color | ||
222 | * @flags: flags | ||
223 | * @tex_image: texture image (optional, may be NULL) | ||
224 | * | ||
225 | * A material object. | ||
226 | */ | ||
227 | |||
228 | typedef struct { | ||
229 | gchar *name; | ||
230 | G3DFloat r, g, b, a; | ||
231 | GLfloat shininess; | ||
232 | GLfloat specular[4]; | ||
233 | guint32 flags; | ||
234 | |||
235 | G3DImage *tex_image; | ||
236 | } G3DMaterial; | ||
237 | |||
238 | /***************************************************************************** | ||
239 | * G3DFace | ||
240 | *****************************************************************************/ | ||
241 | |||
242 | /** | ||
243 | * G3D_FLAG_FAC_NORMALS: | ||
244 | * | ||
245 | * The face has custom normals. | ||
246 | */ | ||
247 | #define G3D_FLAG_FAC_NORMALS (1L << 0) | ||
248 | /** | ||
249 | * G3D_FLAG_FAC_TEXMAP: | ||
250 | * | ||
251 | * The face has a texture map and texture coordinates. | ||
252 | */ | ||
253 | #define G3D_FLAG_FAC_TEXMAP (1L << 1) | ||
254 | |||
255 | /** | ||
256 | * G3DFace: | ||
257 | * @vertex_count: number of vertices | ||
258 | * @vertex_indices: indices of vertices in #G3DObject | ||
259 | * @material: material to use for surface | ||
260 | * @flags: flags | ||
261 | * @normals: optional normal array (one vector - 3 #G3DVector values - for each | ||
262 | * vertex) | ||
263 | * @tex_image: optional texture image | ||
264 | * @tex_vertex_count: number of texture vertices, should be 0 or match | ||
265 | * vertex_count | ||
266 | * @tex_vertex_data: array of texture vertices | ||
267 | * | ||
268 | * An object representing a surface. | ||
269 | */ | ||
270 | typedef struct { | ||
271 | guint32 vertex_count; | ||
272 | guint32 *vertex_indices; | ||
273 | |||
274 | G3DMaterial *material; | ||
275 | |||
276 | guint32 flags; | ||
277 | |||
278 | G3DVector *normals; | ||
279 | |||
280 | G3DImage *tex_image; | ||
281 | guint32 tex_vertex_count; | ||
282 | G3DVector *tex_vertex_data; | ||
283 | } G3DFace; | ||
284 | |||
285 | /***************************************************************************** | ||
286 | * G3DTransformation | ||
287 | *****************************************************************************/ | ||
288 | |||
289 | /** | ||
290 | * G3DTransformation: | ||
291 | * @matrix: the transformation matrix | ||
292 | * @flags: flags | ||
293 | * | ||
294 | * A three-dimensional matrix transformation object. | ||
295 | */ | ||
296 | typedef struct { | ||
297 | G3DMatrix matrix[16]; | ||
298 | guint32 flags; | ||
299 | } G3DTransformation; | ||
300 | |||
301 | |||
302 | /***************************************************************************** | ||
303 | * G3DObject | ||
304 | *****************************************************************************/ | ||
305 | |||
306 | /** | ||
307 | * G3DObject: | ||
308 | * @name: name of object | ||
309 | * @materials: list of materials | ||
310 | * @faces: list of faces | ||
311 | * @objects: list of sub-objects | ||
312 | * @transformation: optional transformation | ||
313 | * @hide: flag to disable object rendering | ||
314 | * @vertex_count: number of vertices | ||
315 | * @vertex_data: vertex vector data | ||
316 | * | ||
317 | * A three-dimensional object. | ||
318 | */ | ||
319 | typedef struct { | ||
320 | gchar *name; | ||
321 | |||
322 | GSList *materials; | ||
323 | GSList *faces; | ||
324 | GSList *objects; | ||
325 | |||
326 | /* transformation, may be NULL */ | ||
327 | G3DTransformation *transformation; | ||
328 | |||
329 | /* don't render this object */ | ||
330 | gboolean hide; | ||
331 | |||
332 | /* vertices */ | ||
333 | guint32 vertex_count; | ||
334 | G3DVector *vertex_data; | ||
335 | |||
336 | /*< private >*/ | ||
337 | /* FIXME: texture stuff: temporary storage, should be in G3DFace items */ | ||
338 | guint32 tex_vertex_count; | ||
339 | G3DVector *tex_vertex_data; | ||
340 | G3DImage *tex_image; | ||
341 | |||
342 | /*< private >*/ | ||
343 | /* some fields to speed up rendering, should not be used by plugins */ | ||
344 | /* FIXME: remove from API (replace with user_data pointer?) */ | ||
345 | G3DVector *_normals; | ||
346 | G3DMaterial **_materials; | ||
347 | guint32 _num_faces; | ||
348 | guint32 *_indices; | ||
349 | guint32 *_flags; | ||
350 | guint32 *_tex_images; | ||
351 | G3DVector *_tex_coords; | ||
352 | } G3DObject; | ||
353 | |||
354 | /***************************************************************************** | ||
355 | * G3DContext | ||
356 | *****************************************************************************/ | ||
357 | |||
358 | /** | ||
359 | * G3DSetBgColorFunc: | ||
360 | * @r: red component | ||
361 | * @g: green component | ||
362 | * @b: blue component | ||
363 | * @a: alpha component | ||
364 | * @user_data: opaque data as given to g3d_context_set_set_bgcolor_func() | ||
365 | * | ||
366 | * Background color setting callback. | ||
367 | * | ||
368 | * Returns: TRUE on success, FALSE else. | ||
369 | */ | ||
370 | typedef gboolean (* G3DSetBgColorFunc)(G3DFloat r, G3DFloat g, G3DFloat b, | ||
371 | G3DFloat a, gpointer user_data); | ||
372 | |||
373 | /** | ||
374 | * G3DUpdateInterfaceFunc: | ||
375 | * @user_data: opaque data as given to g3d_context_set_update_interface_func() | ||
376 | * | ||
377 | * Interface updating callback. | ||
378 | * | ||
379 | * Returns: TRUE on success, FALSE else. | ||
380 | */ | ||
381 | typedef gboolean (* G3DUpdateInterfaceFunc)(gpointer user_data); | ||
382 | |||
383 | /** | ||
384 | * G3DUpdateProgressBarFunc: | ||
385 | * @percentage: progress of plugin operation | ||
386 | * @show: #TRUE if the progress bar should be visible, #FALSE else | ||
387 | * @user_data: opaque data as given to | ||
388 | * g3d_context_set_update_progress_bar_func() | ||
389 | * | ||
390 | * Progress updating callback. | ||
391 | * | ||
392 | * Returns: TRUE on success, FALSE else. | ||
393 | */ | ||
394 | typedef gboolean (* G3DUpdateProgressBarFunc)(G3DFloat percentage, | ||
395 | gboolean show, gpointer user_data); | ||
396 | |||
397 | /*< private >*/ | ||
398 | #ifdef USE_LIBMAGIC | ||
399 | #define MAGIC_PTR_TYPE magic_t | ||
400 | #else | ||
401 | #define MAGIC_PTR_TYPE void * | ||
402 | #endif | ||
403 | /*< public >*/ | ||
404 | |||
405 | /** | ||
406 | * G3DContext: | ||
407 | * | ||
408 | * Internal stuff for libg3d. | ||
409 | */ | ||
410 | typedef struct { | ||
411 | /*< private >*/ | ||
412 | GSList *plugins; | ||
413 | MAGIC_PTR_TYPE magic_cookie; | ||
414 | |||
415 | GHashTable *exts_import; | ||
416 | GHashTable *exts_image; | ||
417 | |||
418 | G3DSetBgColorFunc set_bgcolor_func; | ||
419 | gpointer set_bgcolor_data; | ||
420 | G3DUpdateInterfaceFunc update_interface_func; | ||
421 | gpointer update_interface_data; | ||
422 | G3DUpdateProgressBarFunc update_progress_bar_func; | ||
423 | gpointer update_progress_bar_data; | ||
424 | |||
425 | GHashTable *modelCache; | ||
426 | } G3DContext; | ||
427 | |||
428 | /***************************************************************************** | ||
429 | * G3DPlugin: real definition in g3d/plugins.h | ||
430 | *****************************************************************************/ | ||
431 | |||
432 | typedef struct _G3DPlugin G3DPlugin; | ||
433 | |||
434 | /***************************************************************************** | ||
435 | * G3DStream | ||
436 | *****************************************************************************/ | ||
437 | |||
438 | /* declared in stream.h */ | ||
439 | typedef struct _G3DStream G3DStream; | ||
440 | |||
441 | /***************************************************************************** | ||
442 | * G3DModel | ||
443 | *****************************************************************************/ | ||
444 | |||
445 | /** | ||
446 | * G3DModel: | ||
447 | * @filename: file name or URI of loaded model, may be set by application | ||
448 | * @materials: list of materials (#G3DMaterial) | ||
449 | * @objects: list of objects (#G3DObject) | ||
450 | * | ||
451 | * A 3D model. | ||
452 | */ | ||
453 | typedef struct { | ||
454 | gchar *filename; | ||
455 | /*< private >*/ | ||
456 | G3DContext *context; | ||
457 | |||
458 | /*< public >*/ | ||
459 | GSList *materials; | ||
460 | GSList *objects; | ||
461 | |||
462 | /*< private >*/ | ||
463 | GHashTable *tex_images; | ||
464 | |||
465 | /* the plugin used to load the model, may be NULL */ | ||
466 | G3DPlugin *plugin; | ||
467 | /* The stream used to load the model, may be NULL */ | ||
468 | G3DStream *stream; | ||
469 | |||
470 | int refCount; | ||
471 | } G3DModel; | ||
472 | |||
473 | #ifdef __cplusplus | ||
474 | } | ||
475 | #endif /* ifdef __cplusplus */ | ||
476 | |||
477 | #endif /* __G3D_TYPES_H__ */ | ||
478 | |||
diff --git a/src/others/mimesh/libg3d-0.0.8/include/g3d/vector.h b/src/others/mimesh/libg3d-0.0.8/include/g3d/vector.h new file mode 100644 index 0000000..aeb838c --- /dev/null +++ b/src/others/mimesh/libg3d-0.0.8/include/g3d/vector.h | |||
@@ -0,0 +1,125 @@ | |||
1 | /* $Id$ */ | ||
2 | |||
3 | /* | ||
4 | libg3d - 3D object loading library | ||
5 | |||
6 | Copyright (C) 2005-2009 Markus Dahms <mad@automagically.de> | ||
7 | |||
8 | This library is free software; you can redistribute it and/or | ||
9 | modify it under the terms of the GNU Lesser General Public | ||
10 | License as published by the Free Software Foundation; either | ||
11 | version 2.1 of the License, or (at your option) any later version. | ||
12 | |||
13 | This library is distributed in the hope that it will be useful, | ||
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
16 | Lesser General Public License for more details. | ||
17 | |||
18 | You should have received a copy of the GNU Lesser General Public | ||
19 | License along with this library; if not, write to the Free Software | ||
20 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef __G3D_VECTOR_H__ | ||
24 | #define __G3D_VECTOR_H__ | ||
25 | |||
26 | #include <g3d/types.h> | ||
27 | |||
28 | #ifdef __cplusplus | ||
29 | extern "C" { | ||
30 | #endif /* ifdef __cplusplus */ | ||
31 | |||
32 | /** | ||
33 | * SECTION:vector | ||
34 | * @short_description: Vector manipulation and calculation | ||
35 | * @include: g3d/vector.h | ||
36 | * | ||
37 | * A vector is a one-dimensional array of floating point data. | ||
38 | * | ||
39 | * Declare it as statically as: | ||
40 | * | ||
41 | * G3DVector vector[3]; | ||
42 | * | ||
43 | * or allocate it dynamically with: | ||
44 | * | ||
45 | * G3DVector *vector = g3d_vector_new(3, 1); | ||
46 | */ | ||
47 | |||
48 | /** | ||
49 | * g3d_vector_new: | ||
50 | * @size: number of items in one vector | ||
51 | * @n: number of vectors to allocate | ||
52 | * | ||
53 | * Allocate memory for a number of vectors. | ||
54 | * | ||
55 | * Returns: newly allocated vectors | ||
56 | */ | ||
57 | _G3D_STATIC_INLINE G3DVector *g3d_vector_new(guint32 size, guint32 n) { | ||
58 | return g_new0(G3DVector, size * n); | ||
59 | } | ||
60 | |||
61 | /** | ||
62 | * g3d_vector_free: | ||
63 | * @vector: vector to free | ||
64 | * | ||
65 | * Free memory allocated for vector. | ||
66 | */ | ||
67 | _G3D_STATIC_INLINE void g3d_vector_free(G3DVector *vector) { | ||
68 | g_free(vector); | ||
69 | } | ||
70 | |||
71 | /** | ||
72 | * g3d_vector_normal: | ||
73 | * @ax: x component first vector | ||
74 | * @ay: y component first vector | ||
75 | * @az: z component first vector | ||
76 | * @bx: x component second vector | ||
77 | * @by: y component second vector | ||
78 | * @bz: z component second vector | ||
79 | * @nx: x component resulting normal | ||
80 | * @ny: y component resulting normal | ||
81 | * @nz: z component resulting normal | ||
82 | * | ||
83 | * calculate the normal from a plane defined by two vectors | ||
84 | * | ||
85 | * Returns: TRUE on success, FALSE else | ||
86 | */ | ||
87 | EAPI | ||
88 | gboolean g3d_vector_normal(G3DFloat ax, G3DFloat ay, G3DFloat az, | ||
89 | G3DFloat bx, G3DFloat by, G3DFloat bz, | ||
90 | G3DFloat *nx, G3DFloat *ny, G3DFloat *nz); | ||
91 | |||
92 | /** | ||
93 | * g3d_vector_unify: | ||
94 | * @nx: x component of vector | ||
95 | * @ny: y component of vector | ||
96 | * @nz: z component of vector | ||
97 | * | ||
98 | * Transforms the given vector to the unit vector. | ||
99 | * | ||
100 | * Returns: TRUE on success, FALSE else | ||
101 | */ | ||
102 | EAPI | ||
103 | gboolean g3d_vector_unify(G3DFloat *nx, G3DFloat *ny, G3DFloat *nz); | ||
104 | |||
105 | /** | ||
106 | * g3d_vector_transform: | ||
107 | * @x: x component of vector | ||
108 | * @y: y component of vector | ||
109 | * @z: z component of vector | ||
110 | * @matrix: transformation matrix (4x4) | ||
111 | * | ||
112 | * Transforms the given vector corresponding to the given matrix | ||
113 | * | ||
114 | * Returns: TRUE on success, FALSE else | ||
115 | */ | ||
116 | EAPI | ||
117 | gboolean g3d_vector_transform(G3DFloat *x, G3DFloat *y, G3DFloat *z, | ||
118 | G3DMatrix *matrix); | ||
119 | |||
120 | #ifdef __cplusplus | ||
121 | } | ||
122 | #endif /* ifdef __cplusplus */ | ||
123 | |||
124 | #endif /* __G3D_VECTOR_H__ */ | ||
125 | |||