Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the ambiera forums
// Copyright (c) 2007-2008 Tomer Nosrati
// This file is part of the "NUSoftware Game Engine".
// For conditions of distribution and use, see copyright notice in nge.h
#include "ISoundManager.h"
#include "devices/CIrrKlangManager.h"
ISoundManager* createSoundManager(E_AUDIO_DEVICE AudioDevice)
{
switch(AudioDevice)
{
case EAD_IRRKLANG:
# ifdef _NGE_COMPILE_WITH_IRRKLANG_
return new CIrrKlangManager();
# else
return 0;
# endif
case EAD_FMOD:
# ifdef _NGE_COMPILE_WITH_FMOD_
return 0; // until there will be a fmod manager
# else
return 0;
# endif
default: return 0;
}
return 0;
}
Is that enough so when I use my engine in a commercial product and undefine _NGE_COMPILE_WITH_IRRKLANG_ it wont break the license?
Note: There are still places where irrKlang.h is included but none of them actually use the library because it needs a CIrrKlangManager which it doesn't get because of the code above.
Last edited by MasterGod on Fri Feb 01, 2008 11:04 am, edited 1 time in total.
When I don't define _NGE_COMPILE_WITH_IRRKLANG_:
1. I don't need the .lib of irrKlang
2. I don't need the dll
3. I DO need the .h files for compilation.
4. It compiles fine and everything is as expected.
I would think that even just including the header files for irrklang would break the licence, can you not get it to work without them? I would think you could do similar things to not require them.
Should I stick a #ifdef before every irrklang include?
It would break my code cause it needs the types declared in those .h files..
Maybe because all the real code, the implementation which is in the dll and lib files could be not-shipped and only the .h files will be required to compile, its ok.. But I must have niko answering that and have his approval.
Yeah you'd have to #def out all the irrklang includes, you shouldn't really rely on the types in there if you're not meant to be using the code. In fact that probably does break the licence because you're using the types from the irrklang code.
Just redefine your own versions of the types in your own code and you could have a single header file for your audio stuff which your own classes use and in that audio header file you decide which lib headers to include (irrklang, fmod etc) which would allow you to remove the irrklang headers completely from your code, except for that audio header where they wouldn't be compiled in if you didn't ask for them.
Incidentally i reckon Christian might appreciate a word with you about this switchable audio library implementation as he wants to do some similar things in The First King.
When I don't define _NGE_COMPILE_WITH_IRRKLANG_:
1. I don't need the .lib of irrKlang
2. I don't need the dll
3. I DO need the .h files for compilation.
4. It compiles fine and everything is as expected.
Maybe niko can make it clear?
niko's email wrote:Nikolaus Gebhardt to me
show details 11:12 AM (1 hour ago)
Reply
Hi,
no, sure, that's absolutely ok. Just use it
niko
- Show quoted text -
Seems like niko agrees with me that it's enough Yay!
Lovely chap! That probably makes it easier for you. Though i imagine for other projects that can't be used freely or whatever they probably wouldn't be so friendly about it.