Mercurial > mm7
comparison lib/OpenAL/xram.h @ 2134:992d2e6f907d
preparation for libavcodec
author | zipi |
---|---|
date | Tue, 31 Dec 2013 14:52:14 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2133:e378232bfd36 | 2134:992d2e6f907d |
---|---|
1 #include <al.h> | |
2 | |
3 // X-RAM Function pointer definitions | |
4 typedef ALboolean (__cdecl *EAXSetBufferMode)(ALsizei n, ALuint *buffers, ALint value); | |
5 typedef ALenum (__cdecl *EAXGetBufferMode)(ALuint buffer, ALint *value); | |
6 | |
7 ////////////////////////////////////////////////////////////////////////////// | |
8 // Query for X-RAM extension | |
9 // | |
10 // if (alIsExtensionPresent("EAX-RAM") == AL_TRUE) | |
11 // X-RAM Extension found | |
12 // | |
13 ////////////////////////////////////////////////////////////////////////////// | |
14 | |
15 | |
16 ////////////////////////////////////////////////////////////////////////////// | |
17 // X-RAM enum names | |
18 // | |
19 // "AL_EAX_RAM_SIZE" | |
20 // "AL_EAX_RAM_FREE" | |
21 // "AL_STORAGE_AUTOMATIC" | |
22 // "AL_STORAGE_HARDWARE" | |
23 // "AL_STORAGE_ACCESSIBLE" | |
24 // | |
25 // Query enum values using alGetEnumValue, for example | |
26 // | |
27 // long lRamSizeEnum = alGetEnumValue("AL_EAX_RAM_SIZE") | |
28 // | |
29 ////////////////////////////////////////////////////////////////////////////// | |
30 | |
31 | |
32 ////////////////////////////////////////////////////////////////////////////// | |
33 // Query total amount of X-RAM | |
34 // | |
35 // long lTotalSize = alGetInteger(alGetEnumValue("AL_EAX_RAM_SIZE") | |
36 // | |
37 ////////////////////////////////////////////////////////////////////////////// | |
38 | |
39 | |
40 ////////////////////////////////////////////////////////////////////////////// | |
41 // Query free X-RAM available | |
42 // | |
43 // long lFreeSize = alGetInteger(alGetEnumValue("AL_EAX_RAM_FREE") | |
44 // | |
45 ////////////////////////////////////////////////////////////////////////////// | |
46 | |
47 | |
48 ////////////////////////////////////////////////////////////////////////////// | |
49 // Query X-RAM Function pointers | |
50 // | |
51 // Use typedefs defined above to get the X-RAM function pointers using | |
52 // alGetProcAddress | |
53 // | |
54 // EAXSetBufferMode eaxSetBufferMode; | |
55 // EAXGetBufferMode eaxGetBufferMode; | |
56 // | |
57 // eaxSetBufferMode = (EAXSetBufferMode)alGetProcAddress("EAXSetBufferMode"); | |
58 // eaxGetBufferMode = (EAXGetBufferMode)alGetProcAddress("EAXGetBufferMode"); | |
59 // | |
60 ////////////////////////////////////////////////////////////////////////////// | |
61 | |
62 | |
63 ////////////////////////////////////////////////////////////////////////////// | |
64 // Force an Open AL Buffer into X-RAM (good for non-streaming buffers) | |
65 // | |
66 // ALuint uiBuffer; | |
67 // alGenBuffers(1, &uiBuffer); | |
68 // eaxSetBufferMode(1, &uiBuffer, alGetEnumValue("AL_STORAGE_HARDWARE")); | |
69 // alBufferData(...); | |
70 // | |
71 ////////////////////////////////////////////////////////////////////////////// | |
72 | |
73 | |
74 ////////////////////////////////////////////////////////////////////////////// | |
75 // Force an Open AL Buffer into 'accessible' (currently host) RAM (good for streaming buffers) | |
76 // | |
77 // ALuint uiBuffer; | |
78 // alGenBuffers(1, &uiBuffer); | |
79 // eaxSetBufferMode(1, &uiBuffer, alGetEnumValue("AL_STORAGE_ACCESSIBLE")); | |
80 // alBufferData(...); | |
81 // | |
82 ////////////////////////////////////////////////////////////////////////////// | |
83 | |
84 | |
85 ////////////////////////////////////////////////////////////////////////////// | |
86 // Put an Open AL Buffer into X-RAM if memory is available, otherwise use | |
87 // host RAM. This is the default mode. | |
88 // | |
89 // ALuint uiBuffer; | |
90 // alGenBuffers(1, &uiBuffer); | |
91 // eaxSetBufferMode(1, &uiBuffer, alGetEnumValue("AL_STORAGE_AUTOMATIC")); | |
92 // alBufferData(...); | |
93 // | |
94 ////////////////////////////////////////////////////////////////////////////// |