summaryrefslogtreecommitdiffstats
path: root/src/plugins/test/plugin_test.cpp
blob: 7175773601f12b9ede6f016484c96c7472f7d3e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <string>
#include <cstdio>
#include <unistd.h>

#include <common/logger.h>
#include <common/iman.h>
#include <sound/sound.h>
#include <plugins/plugin.h>


int main() {
    new CLogger();
    new CInstanceManager();

    lt_dlinit();

    CPlugin *plugin = new CPlugin("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;
}