Last change
on this file since 319 was
319,
checked in by epyon, 11 years ago
|
- created core module and moved all free source files there
- took the opportunity to update all copyright lines and minor cleanup
- minor fixes
- not all examples are up to date
|
File size:
1.2 KB
|
Rev | Line | |
---|
[248] | 1 | // Copyright (C) 2014 ChaosForge Ltd
|
---|
| 2 | // http://chaosforge.org/
|
---|
| 3 | //
|
---|
| 4 | // This file is part of NV Libraries.
|
---|
| 5 | // For conditions of distribution and use, see copyright notice in nv.hh
|
---|
| 6 |
|
---|
| 7 | #include "nv/lib/assimp.hh"
|
---|
| 8 |
|
---|
| 9 | nv::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 |
|
---|
| 18 | nv::assimp_log_guard::~assimp_log_guard()
|
---|
| 19 | {
|
---|
| 20 | aiDetachAllLogStreams();
|
---|
| 21 | }
|
---|
| 22 |
|
---|
| 23 | #if defined( NV_ASSIMP_DYNAMIC )
|
---|
| 24 |
|
---|
[319] | 25 | #include "nv/core/library.hh"
|
---|
[248] | 26 |
|
---|
[250] | 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 |
|
---|
[248] | 31 | bool 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 |
|
---|
[250] | 37 | # define NV_ASSIMP_FUN( rtype, fname, fparams ) *(void **) (&fname) = assimp_library.get(#fname);
|
---|
| 38 | # include <nv/lib/detail/assimp_functions.inc>
|
---|
[248] | 39 | # undef NV_ASSIMP_FUN
|
---|
| 40 |
|
---|
[250] | 41 | static nv::assimp_log_guard lg;
|
---|
[248] | 42 | return true;
|
---|
| 43 | }
|
---|
| 44 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.