[Openal] ALubyte* -> ALchar*

dpeacock at creativelabs.com dpeacock at creativelabs.com
Fri Dec 2 09:46:53 PST 2005




Hi,

This was one of the (unfortunate) changes between AL 1.0 and AL 1.1 that
was made in a noble attempt to give Open AL 'normal' string types.

For code that I've written that need to *compile* and *run* on both AL 1.0
and AL 1.1 headers and libraries respectively I do the following :-

Add the following lines ...

#ifndef ALchar
#define ALchar char
#endif

#ifndef ALCchar
#define ALCchar char
#endif

Create a function table containing just the AL 1.0 functions (you cannot
use any AL 1.1 exclusive functions if your application needs to run on AL
1.0 libraries, so having the function table look-up prevents this from
happening).
Define the (AL 1.0) function types in the AL 1.1 way (e.g using AL[C]char's
instead of AL[C]ubytes).

You can then use AL[C]char types for all your strings.   I can send you
some example code that does all the above if you like.

Dan

Notice
The information in this message is confidential and may be legally
privileged.  It is intended solely for the addressee.  Access to this
message by anyone else is unauthorized.  If you are not the intended
recipient,  any disclosure,  copying or distribution of the message,  or
any action taken by you in reliance on it,  is prohibited and may be
unlawful.  If you have received this message in error,  please delete it
and contact the sender immediately.  Thank you.



                                                                           
             Benjamin Grauer                                               
             <bensch at orxonox.e                                             
             thz.ch>                                                    To 
             Sent by:                  openal at opensource.creative.com      
             openal-admin at open                                          cc 
             source.creative.c                                             
             om                                                    Subject 
                                       [Openal] ALubyte* -> ALchar*        
                                                                           
             12/02/2005 09:05                                              
             AM                                                            
                                                                           
                                                                           
                                                                           




-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there

i have a little problem due to variable versions in our development
teams openAL-implementations

The error is, that some implementation use  alcOpenDevice differently:

old versions use
alcOpenDevice(ALCubyte*)
newer versions
alcOpenDevice(ALchar*)

is there a way to make it compile on old AND new versions??


thanks in advance for any hints on this
greets
    Benjamin

here is the code-snippet, that hat the error:

-
------------------------------------------------------------------------------------------------

  ALubyte deviceName[] =
#ifdef __WIN32__
      "native";
#else
      "'( ( devices '( native arts null ) ) )";
#endif
  //
  this->device = alcOpenDevice(deviceName);

  this->context = alcCreateContext(this->device, NULL);

  alcMakeContextCurrent(this->context);
-
---------------------------------------------------------------------------------------------------


- --
visit the worlds most furious open-source 3D-action game
http://www.orxonox.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iQIVAwUBQ5B+3K3dUaw0Ln2OAQKzrQ/+O5hReVwDUUEimB1SZ6TxZrCLqJ5MJBmK
d+bTkWntZvuIHm3GlYc3Y4UFQPjDJz/YlHe/V8KB3h+XAN46NuOV1ayASklTE3NV
qToEurYmO2ngellGszFFyAq48dvw5q47wKRJrxaVRsrXE7dAJXu+fT4ipa+ZQFAJ
58pQOPUJQ0TTl9OQCcim0eG23ULu3elrtjhexCGcDE3lG/yFU9c37LKSLHEx3FTt
Xu0DosWPxyOaGRqXsoxhMhadBYSB5nB2+O9QQfZKD6uI+aJcto9BV6rzPa6lQCrX
a14WPdKhtEaqCmJKiuP+Nfe6K91M/y/p1wxIHDgLNYEBlEtc3kZ7DZUvL99dx5FL
wNaTO/+LPjeMYd+V6abqt3La/edd/64/05mJ8xoxaNrggt6eeCV3If/9UcTCrzYu
bHWTJcbaa7FmF4wUAyqpJWvo6eV1dVxZbnP7uIu7hnXERQ62gRMPEHkKY4E4zBm3
mfTb6vkzxri/ICvl8fLwI5BGxeTBdmCzy+b0C3UtPdSrEtRBGBJsSp0FdR1oAtry
zqOUxbvbt9T85TbUqLDXonFbJ7OfwEIu9UpN4KYIW37DYXSNU2eMwzcGD6BqqYLF
mfIXJbBygtL80jh1q2l4CX8g1mrPYvN6Dn8FLWebLUhMuzdnJoQDczNz5xxAWQ6j
l6+FZK8f6NA=
=Iyxd
-----END PGP SIGNATURE-----

_______________________________________________
openal mailing list
openal at opensource.creative.com
http://opensource.creative.com/mailman/listinfo/openal

ForwardSourceID:NT0002ADDA




More information about the Openal mailing list