summaryrefslogtreecommitdiffstats
path: root/src/sound/plugins/oalsound/test/plugin_test.cpp
diff options
context:
space:
mode:
authorPiotr Dziwiński <piotrdz@gmail.com>2012-08-12 10:15:19 -0700
committerPiotr Dziwiński <piotrdz@gmail.com>2012-08-12 10:15:19 -0700
commit50deedb6cbc927f6c7d6c3c5e9134d11c20782ae (patch)
tree8eb3fbd914cfea11660534b296bfddcffcc5f7b4 /src/sound/plugins/oalsound/test/plugin_test.cpp
parentbc24b9f9e516e657fcc0034808e010287fc2e393 (diff)
parent62b545128f37746c343760e464872655b5523c6f (diff)
downloadcolobot-50deedb6cbc927f6c7d6c3c5e9134d11c20782ae.tar.gz
colobot-50deedb6cbc927f6c7d6c3c5e9134d11c20782ae.tar.bz2
colobot-50deedb6cbc927f6c7d6c3c5e9134d11c20782ae.zip
Merge pull request #36 from Erihel/dev
Merge of new features: plugins and INI profile, changes from dev-graphics
Diffstat (limited to 'src/sound/plugins/oalsound/test/plugin_test.cpp')
-rw-r--r--src/sound/plugins/oalsound/test/plugin_test.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/src/sound/plugins/oalsound/test/plugin_test.cpp b/src/sound/plugins/oalsound/test/plugin_test.cpp
new file mode 100644
index 0000000..40c1cd2
--- /dev/null
+++ b/src/sound/plugins/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;
+}