Changeset 153

Show
Ignore:
Timestamp:
06/11/06 22:23:42 (2 years ago)
Author:
aldacron
Message:

[DerelictAL]
* added missing alc* functions
* added some missing aliases to alctypes.d
* changed calling convention of all functions to extern(C) on windows
[Docs]
* updated al.html and gl.html to reflect function declaration differences between C versions and Derelict (ubyte* -> char*)
* added to loading.html the description of and rationale behind the optional string parameter for the load function

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/DerelictAL/derelict/openal/alctypes.d

    r132 r153  
    5454alias void ALCvoid; 
    5555 
     56alias ALCvoid ALCdevice; 
     57alias ALCvoid ALCcontext; 
     58 
    5659const ALCenum ALC_INVALID           = 0; 
    5760const ALCboolean ALC_FALSE          = 0; 
  • trunk/DerelictAL/derelict/openal/almanual.d

    r149 r153  
    4141    { 
    4242        import derelict.openal.altypes; 
     43        import derelict.openal.alctypes; 
    4344        import derelict.util.loader; 
    4445    } 
     
    108109        bindFunc(alDopplerVelocity)("alDopplerVelocity", lib); 
    109110        bindFunc(alDistanceModel)("alDistanceModel", lib); 
     111 
     112        bindFunc(alcGetString)("alcGetString", lib); 
     113        bindFunc(alcGetIntegerv)("alcGetIntegerv", lib); 
     114        bindFunc(alcOpenDevice)("alcOpenDevice", lib); 
     115        bindFunc(alcCloseDevice)("alcCloseDevice", lib); 
     116        bindFunc(alcCreateContext)("alcCreateContext", lib); 
     117        bindFunc(alcMakeContextCurrent)("alcMakeContextCurrent", lib); 
     118        bindFunc(alcProcessContext)("alcProcessConext", lib); 
     119        bindFunc(alcGetCurrentContext)("alcGetCurrentContext", lib); 
     120        bindFunc(alcGetContextsDevice)("alcGetContextsDevice", lib); 
     121        bindFunc(alcSuspendContext)("alcSuspendContext", lib); 
     122        bindFunc(alcDestroyContext)("alcDestroyContext", lib); 
     123        bindFunc(alcGetError)("alcGetError", lib); 
     124        bindFunc(alcIsExtensionPresent)("alcIsExtensionPresent", lib); 
     125        bindFunc(alcGetProcAddress)("alcGetProcAddress", lib); 
     126        bindFunc(alcGetEnumValue)("alcGetEnumValue", lib); 
    110127    } 
    111128 
    112    alias   GenericLoader!("OpenAL32.dll", "libal.so, libAL.so, libopenal.so, libopenal.so.0", "", loadAL)  DerelictAL; 
     129    alias   GenericLoader!("OpenAL32.dll", "libal.so, libAL.so, libopenal.so, libopenal.so.0", "", loadAL)  DerelictAL; 
    113130 
    114131 
     
    131148 
    132149 
    133    alias   GenericDependentLoader!(DerelictAL, loadALU) DerelictALU; 
    134  
    135  
    136     version(Windows) 
     150    alias   GenericDependentLoader!(DerelictAL, loadALU) DerelictALU; 
     151 
     152 
     153/*    version(Windows) 
    137154        extern(Windows): 
    138155    else 
    139         extern(C): 
     156 */     extern(C): 
    140157 
    141158    typedef void function(ALenum) pfalEnable; 
     
    269286    } 
    270287 
     288    // ALC 
     289    typedef char* function(ALCdevice*, ALCenum) pfalcGetString; 
     290    typedef ALCvoid function(ALCdevice*, ALCenum, ALCsizei, ALCint*) pfalcGetIntegerv; 
     291    pfalcGetString                          alcGetString; 
     292    pfalcGetIntegerv                        alcGetIntegerv; 
     293 
     294    typedef ALCdevice* function(char*) pfalcOpenDevice; 
     295    typedef ALCvoid function(ALCdevice*) pfalcCloseDevice; 
     296    pfalcOpenDevice                         alcOpenDevice; 
     297    pfalcCloseDevice                        alcCloseDevice; 
     298 
     299    typedef ALCcontext* function(ALCdevice*, ALCint*) pfalcCreateContext; 
     300    typedef ALCboolean function(ALCcontext*) pfalcMakeContextCurrent; 
     301    typedef ALCvoid function(ALCcontext*) pfalcProcessContext; 
     302    typedef ALCcontext* function() pfalcGetCurrentContext; 
     303    typedef ALCdevice* function(ALCcontext*) pfalcGetContextsDevice; 
     304    typedef ALCvoid function(ALCcontext*) pfalcSuspendContext; 
     305    typedef ALCvoid function(ALCcontext*) pfalcDestroyContext; 
     306    pfalcCreateContext                      alcCreateContext; 
     307    pfalcMakeContextCurrent                 alcMakeContextCurrent; 
     308    pfalcProcessContext                     alcProcessContext; 
     309    pfalcGetCurrentContext                  alcGetCurrentContext; 
     310    pfalcGetContextsDevice                  alcGetContextsDevice; 
     311    pfalcSuspendContext                     alcSuspendContext; 
     312    pfalcDestroyContext                     alcDestroyContext; 
     313 
     314    typedef ALCenum function(ALCdevice*) pfalcGetError; 
     315    pfalcGetError                           alcGetError; 
     316 
     317    typedef ALCboolean function(ALCdevice*, char*) pfalcIsExtensionPresent; 
     318    typedef ALCvoid* function(ALCdevice*, char*) pfalcGetProcAddress; 
     319    typedef ALCenum function(ALCdevice*, char*) pfalcGetEnumValue; 
     320    pfalcIsExtensionPresent                 alcIsExtensionPresent; 
     321    pfalcGetProcAddress                 alcGetProcAddress; 
     322    pfalcGetEnumValue                       alcGetEnumValue; 
     323 
    271324    // ALU 
    272325    version(Windows) 
    273326    { 
    274         extern(Windows): 
     327  //      extern(Windows): 
     328        extern(C): 
     329 
    275330            typedef ALint function(ALfloat) pfaluF2L; 
    276331            typedef ALshort function(ALfloat) pfaluF2S; 
  • trunk/docs/al.html

    r149 r153  
    5959</p> 
    6060 
     61<div class="note">Return values and function parameters of type  
     62<tt>ALubyte*</tt> or <tt>ALCubyte*</tt>, when intended to represent a string, 
     63have been declared in DerelictAL as <tt>char*</tt> instead.</div> 
     64 
    6165<p><pre> 
    6266import derelict.openal.al; 
  • trunk/docs/gl.html

    r150 r153  
    4444</pre> 
    4545 
     46<div class="note">Return values and parameters of type <tt>GLubyte*</tt>, when 
     47instended to represent a string, have been declared in DerelictGL as <tt>char*</tt>  
     48instead.</div> 
    4649 
    4750<p> 
  • trunk/docs/loading.html

    r149 r153  
    5656Simple, eh?  
    5757</p><p> 
     58The load method accepts an optional shared library name string parameter that will 
     59overload the default search mechanism. For example, on Windows DerelictAL attempts 
     60to load "openal32.dll" by default. Some systems have audio drivers that provide 
     61a hardware accelerated version of OpenAL, some do not. You may want to ship the 
     62OpenAL dll with your app, but renamed to something like "myopenal.dll", or perhaps 
     63with the same name but in a subdirectory of the application directory ("al/openal32.dll").  
     64If the <tt>DerelictAL.load()</tt> fails, then you can call  
     65<tt>DerelictAL.load("myopenal.dll")</tt> instead. This is important because 
     66Windows (and other OSes) will look in the application's directory for a given 
     67shared library before looking in system directories. If you were to drop openal32.dll 
     68in your application's directory, it would be loaded every time. This technique 
     69can be used for every Derelict package, not just DerelictAL. 
     70</p><p> 
    5871Sometimes, loads fail. There are several root causes for this, the end result 
    5972being either that the system couldn't find the shared library or one of the