Added support for OpenAL in win32

This commit is contained in:
Mark Vejvoda 2010-04-06 05:30:22 +00:00
parent d38a1f8877
commit 436f46fcba
5 changed files with 59 additions and 16 deletions

Binary file not shown.

View File

@ -133,7 +133,7 @@
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
OmitFramePointers="true"
AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/shared_lib/include/tinyxml;../../source/glest_game/ai;../../source/glest_game/facilities;../../source/glest_game/game;../../source/glest_game/global;../../source/glest_game/graphics;../../source/glest_game/gui;../../source/glest_game/main;../../source/glest_game/menu;../../source/glest_game/network;../../source/glest_game/sound;../../source/glest_game/type_instances;../../source/glest_game/types;../../source/glest_game/world;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/SDL-1.2.14/include";../../source/shared_lib/include/platform/sdl"
AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/shared_lib/include/tinyxml;../../source/glest_game/ai;../../source/glest_game/facilities;../../source/glest_game/game;../../source/glest_game/global;../../source/glest_game/graphics;../../source/glest_game/gui;../../source/glest_game/main;../../source/glest_game/menu;../../source/glest_game/network;../../source/glest_game/sound;../../source/glest_game/type_instances;../../source/glest_game/types;../../source/glest_game/world;../../source/win32_deps/include;"../../source/win32_deps/xerces-c-3.0.1/src";"../../source/win32_deps/SDL-1.2.14/include";../../source/shared_lib/include/platform/sdl;../../source/shared_lib/include/sound/openal;"../../source/win32_deps/openal-soft-1.12.854/include""
AdditionalUsingDirectories=""
PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;XML_LIBRARY;USE_PCH=1;_CRT_SECURE_NO_WARNINGS"
StringPooling="true"
@ -155,7 +155,7 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="dsound.lib dxguid.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib opengl32.lib glu32.lib wsock32.lib libglest.lib mmc.lib lua5.1.lib xerces-c_3.lib Dbghelp.lib libpng.lib jpeg.lib zlib.lib sdl.lib sdlmain.lib winmm.lib"
AdditionalDependencies="dsound.lib dxguid.lib ogg_static.lib vorbis_static.lib vorbisfile_static.lib opengl32.lib glu32.lib wsock32.lib libglest.lib mmc.lib lua5.1.lib xerces-c_3.lib Dbghelp.lib libpng.lib jpeg.lib zlib.lib sdl.lib sdlmain.lib winmm.lib openal32.lib"
AdditionalLibraryDirectories="../../source/win32_deps/lib;&quot;../../build/$(ConfigurationName)/libglest&quot;"
IgnoreDefaultLibraryNames=""
GenerateDebugInformation="true"

View File

@ -113,7 +113,7 @@
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/win32_deps/include;&quot;../../source/win32_deps/xerces-c-3.0.1/src&quot;;&quot;../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude&quot;;../../source/win32_deps/libpng141;&quot;../../source/win32_deps/jpeg-8a&quot;;&quot;../../source/win32_deps/SDL-1.2.14/include&quot;;../../source/shared_lib/include/platform/sdl"
AdditionalIncludeDirectories="../../../deps/include/lua;../../../deps/include;../../source/shared_lib/include;../../source/shared_lib/include/graphics;../../source/shared_lib/include/graphics/gl;../../source/shared_lib/include/platform;../../source/shared_lib/include/platform/win32;../../source/shared_lib/include/sound;../../source/shared_lib/include/sound/ds8;../../source/shared_lib/include/util;../../source/shared_lib/include/lua;../../source/shared_lib/include/xml;../../source/win32_deps/include;&quot;../../source/win32_deps/xerces-c-3.0.1/src&quot;;&quot;../../source/win32_deps/xerces-c-3.0.1/src/xercesc/xinclude&quot;;../../source/win32_deps/libpng141;&quot;../../source/win32_deps/jpeg-8a&quot;;&quot;../../source/win32_deps/SDL-1.2.14/include&quot;;../../source/shared_lib/include/platform/sdl;&quot;../../source/win32_deps/openal-soft-1.12.854/include&quot;;../../source/shared_lib/include/sound/openal"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_CRT_SECURE_NO_WARNINGS;USE_PCH=1"
RuntimeLibrary="0"
EnableFunctionLevelLinking="true"
@ -359,6 +359,10 @@
RelativePath="..\..\source\shared_lib\sources\sound\sound_player.cpp"
>
</File>
<File
RelativePath="..\..\source\shared_lib\sources\sound\openal\sound_player_openal.cpp"
>
</File>
<Filter
Name="ds8"
>
@ -668,10 +672,6 @@
<Filter
Name="win32"
>
<File
RelativePath="..\..\source\shared_lib\include\platform\win32\factory_repository.h"
>
</File>
<File
RelativePath="..\..\source\shared_lib\include\platform\win32\platform_definitions.h"
>

View File

@ -24,12 +24,10 @@
#include "graphics_factory_gl2.h"
#include "sound_factory_ds8.h"
#else
#endif
#include "sound_factory_openal.h"
#endif
using std::string;
using Shared::Graphics::GraphicsFactory;
@ -41,12 +39,10 @@ using Shared::Graphics::Gl::GraphicsFactoryGl;
using Shared::Graphics::Gl::GraphicsFactoryGl2;
using Shared::Sound::Ds8::SoundFactoryDs8;
#else
#endif
using Shared::Sound::OpenAL::SoundFactoryOpenAL;
#endif
namespace Shared{ namespace Platform{
// =====================================================
@ -67,12 +63,10 @@ private:
GraphicsFactoryGl2 graphicsFactoryGl2;
SoundFactoryDs8 soundFactoryDs8;
#else
#endif
SoundFactoryOpenAL soundFactoryOpenAL;
#endif
public:
static FactoryRepository &getInstance();

View File

@ -0,0 +1,49 @@
// ==============================================================
// This file is part of Glest Shared Library (www.glest.org)
//
// Copyright (C) 2001-2008 Martiño Figueroa
//
// You can redistribute this code and/or modify it under
// the terms of the GNU General Public License as published
// by the Free Software Foundation; either version 2 of the
// License, or (at your option) any later version
// ==============================================================
#include "factory_repository.h"
#include "leak_dumper.h"
namespace Shared{ namespace Platform{
// =====================================================
// class FactoryRepository
// =====================================================
FactoryRepository &FactoryRepository::getInstance(){
static FactoryRepository factoryRepository;
return factoryRepository;
}
GraphicsFactory *FactoryRepository::getGraphicsFactory(const string &name){
if(name == "OpenGL"){
return &graphicsFactoryGl;
}
else if(name == "OpenGL2"){
return &graphicsFactoryGl2;
}
throw runtime_error("Unknown graphics factory: " + name);
}
SoundFactory *FactoryRepository::getSoundFactory(const string &name){
if(name == "DirectSound8"){
return &soundFactoryDs8;
}
if(name == "OpenAL") {
return &soundFactoryOpenAL;
}
throw runtime_error("Unknown sound factory: " + name);
}
}}//end namespace