source: trunk/src/lib/assimp.cc @ 489

Last change on this file since 489 was 406, checked in by epyon, 10 years ago
  • code compiles cleanly on maximum warning level
File size: 1.2 KB
Line 
1// Copyright (C) 2014-2015 ChaosForge Ltd
2// http://chaosforge.org/
3//
4// This file is part of Nova libraries.
5// For conditions of distribution and use, see copying.txt file in root folder.
6
7#include "nv/lib/assimp.hh"
8
9nv::assimp_log_guard::assimp_log_guard()
10{
11        aiLogStream ls = aiGetPredefinedLogStream( aiDefaultLogStream_FILE, "assimp_log.txt" );
12        aiAttachLogStream(&ls);
13        ls.callback = assimp_log_callback;
14        ls.user     = nullptr;
15        aiAttachLogStream(&ls);
16}
17
18nv::assimp_log_guard::~assimp_log_guard()
19{
20        aiDetachAllLogStreams();
21}
22
23#if defined( NV_ASSIMP_DYNAMIC )
24
25#include "nv/core/library.hh"
26
27#define NV_ASSIMP_FUN( rtype, fname, fparams ) rtype (NV_ASSIMP_APIENTRY *fname) fparams = nullptr;
28#include <nv/lib/detail/assimp_functions.inc>
29#undef NV_ASSIMP_FUN
30
31bool nv::load_assimp_library( const char* path )
32{
33        static nv::library assimp_library;
34        if ( assimp_library.is_open() ) return true;
35        assimp_library.open( path );
36
37#       define NV_ASSIMP_FUN( rtype, fname, fparams ) void_assign( fname, assimp_library.get(#fname) );
38#       include <nv/lib/detail/assimp_functions.inc>
39#       undef NV_ASSIMP_FUN
40
41        static nv::assimp_log_guard lg;
42        return true;
43}
44#endif
Note: See TracBrowser for help on using the repository browser.