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.1 KB
|
Rev | Line | |
---|
[319] | 1 | // Copyright (C) 2012-2014 ChaosForge Ltd
|
---|
[5] | 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 |
|
---|
[170] | 7 | #include "nv/lib/sdl.hh"
|
---|
[5] | 8 |
|
---|
| 9 | #if defined( NV_SDL_DYNAMIC )
|
---|
| 10 |
|
---|
[319] | 11 | #include "nv/core/library.hh"
|
---|
[5] | 12 |
|
---|
[170] | 13 | #define NV_SDL_FUN( rtype, fname, fparams ) rtype (NV_SDL_APIENTRY *fname) fparams = nullptr;
|
---|
| 14 | #include <nv/lib/detail/sdl_functions.inc>
|
---|
[171] | 15 | #if NV_SDL_VERSION == NV_SDL_12
|
---|
| 16 | # include <nv/lib/detail/sdl_functions_12.inc>
|
---|
| 17 | #elif NV_SDL_VERSION == NV_SDL_20
|
---|
| 18 | # include <nv/lib/detail/sdl_functions_20.inc>
|
---|
| 19 | #endif
|
---|
[168] | 20 | #undef NV_SDL_FUN
|
---|
[5] | 21 |
|
---|
[171] | 22 |
|
---|
| 23 |
|
---|
[5] | 24 | bool nv::load_sdl_library( const char* path )
|
---|
| 25 | {
|
---|
[109] | 26 | static nv::library sdl_library;
|
---|
| 27 | if ( sdl_library.is_open() ) return true;
|
---|
| 28 | sdl_library.open( path );
|
---|
[170] | 29 | # define NV_SDL_FUN( rtype, fname, fparams ) *(void **) (&fname) = sdl_library.get(#fname);
|
---|
| 30 | # include <nv/lib/detail/sdl_functions.inc>
|
---|
[171] | 31 | # if NV_SDL_VERSION == NV_SDL_12
|
---|
| 32 | # include <nv/lib/detail/sdl_functions_12.inc>
|
---|
| 33 | # elif NV_SDL_VERSION == NV_SDL_20
|
---|
| 34 | # include <nv/lib/detail/sdl_functions_20.inc>
|
---|
| 35 | # endif
|
---|
[168] | 36 | # undef NV_SDL_FUN
|
---|
[5] | 37 | return true;
|
---|
| 38 | }
|
---|
| 39 | #endif
|
---|
Note: See
TracBrowser
for help on using the repository browser.