summaryrefslogtreecommitdiffstats
path: root/src/sound/oalsound/test
diff options
context:
space:
mode:
authorerihel <erihel@gmail.com>2012-12-20 20:59:11 +0100
committererihel <erihel@gmail.com>2012-12-20 20:59:11 +0100
commita6ff654ae37ca372d785c1e155fbfe67a3a25fed (patch)
treec65408f7219e22b106a38c120fe671dc2a995e9c /src/sound/oalsound/test
parentf77734e01c85aded92cf5fdc1e7038658e6aaf29 (diff)
downloadcolobot-a6ff654ae37ca372d785c1e155fbfe67a3a25fed.tar.gz
colobot-a6ff654ae37ca372d785c1e155fbfe67a3a25fed.tar.bz2
colobot-a6ff654ae37ca372d785c1e155fbfe67a3a25fed.zip
removing plugins for gold version (for mxe cross compiling)
Diffstat (limited to 'src/sound/oalsound/test')
-rw-r--r--src/sound/oalsound/test/CMakeLists.txt14
-rw-r--r--src/sound/oalsound/test/plugin_test.cpp40
2 files changed, 54 insertions, 0 deletions
diff --git a/src/sound/oalsound/test/CMakeLists.txt b/src/sound/oalsound/test/CMakeLists.txt
new file mode 100644
index 0000000..dd208ea
--- /dev/null
+++ b/src/sound/oalsound/test/CMakeLists.txt
@@ -0,0 +1,14 @@
+cmake_minimum_required(VERSION 2.8)
+
+if(NOT CMAKE_BUILD_TYPE)
+ set(CMAKE_BUILD_TYPE debug)
+endif(NOT CMAKE_BUILD_TYPE)
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11 -rdynamic")
+set(CMAKE_CXX_FLAGS_DEBUG "-g -O0")
+
+add_executable(plugin_test plugin_test.cpp ../../../../common/iman.cpp ../../../../common/logger.cpp ../../../../plugins/pluginloader.cpp)
+
+include_directories(".")
+include_directories("../../../../")
+
+target_link_libraries(plugin_test ${LTDL_LIBRARY})
diff --git a/src/sound/oalsound/test/plugin_test.cpp b/src/sound/oalsound/test/plugin_test.cpp
new file mode 100644
index 0000000..40c1cd2
--- /dev/null
+++ b/src/sound/oalsound/test/plugin_test.cpp
@@ -0,0 +1,40 @@
+#include <string>
+#include <cstdio>
+#include <unistd.h>
+
+#include <common/logger.h>
+#include <common/iman.h>
+#include <sound/sound.h>
+#include <plugins/pluginloader.h>
+
+
+int main() {
+ new CLogger();
+ new CInstanceManager();
+
+ lt_dlinit();
+
+ CPluginLoader *plugin = new CPluginLoader("libopenalsound");
+ if (plugin->LoadPlugin()) {
+ CSoundInterface *sound = static_cast<CSoundInterface*>(CInstanceManager::GetInstancePointer()->SearchInstance(CLASS_SOUND));
+
+ sound->Create(true);
+ sound->CacheAll();
+ sound->Play((Sound)8);
+ sound->Play((Sound)18);
+
+ sleep(10);
+ /*
+ while (1)
+ {
+ // just a test, very slow
+ plugin->FrameMove(0);
+ //if ('n' == getchar())
+ // break;
+ }*/
+ plugin->UnloadPlugin();
+ }
+
+ lt_dlexit();
+ return 0;
+}