PDA

View Full Version : How to determine whether OpenAL is installed?



chronozphere
21-10-2007, 04:42 PM
Hi everyone

I have build a simple application that uses OpenAL. Now i want it to check whether OpenAL is installed, so that it can notify the user if isn't.

The only problem is, that the OpenAL headers use static-linking. So i don't know where to put my "checking-code". And what's the best way to check for a specific OpenAL version??

Thanks :)

JernejL
21-10-2007, 05:13 PM
you are supposed to copy openal dlls yourself if the system has none..

noeska
21-10-2007, 08:23 PM
you can use function:
InitOpenAL(LibName: String): Boolean;
with the unit you can download from: http://www.noeska.com/doal/downloads.aspx
that uses dynamic loading.

PS looking at the code now it seems that


if &#40;LibHandle <> 0&#41; then
is placed to low it should be placed before:

alGetProcAddress &#58;= GetProcAddress&#40;LibHandle, 'alGetProcAddress'&#41;;
Now when calling InitOpenAl it should return true when openal is available and false when not.

WILL
21-10-2007, 10:01 PM
you are supposed to copy openal dlls yourself if the system has none..

This won't work if you are planning on a Linux release.

chronozphere
22-10-2007, 12:51 PM
Ah thanx guys :)




PS looking at the code now it seems that
Code:

if (LibHandle <> 0) then

is placed to low it should be placed before:
Code:
alGetProcAddress := GetProcAddress(LibHandle, 'alGetProcAddress');

Now when calling InitOpenAl it should return true when openal is available and false when not.


I fixed it... thanx for pointing that out :)


I'm trying the new OpenAL header (it's al.pas + alut.pas + altypes.pas, all in one :razz: )
Can i use it just like the previous headers, except for the InitOpenAL call in the beginning?

Do i need to Release the DLL when my app finishes? :?

noeska
22-10-2007, 04:59 PM
Creative provides an openal runtime installer for that. It should be included in the coresdk.

Linux should work also (even) with fpc.