Changeset 80

Show
Ignore:
Timestamp:
02/14/05 01:10:03 (4 years ago)
Author:
aldacron
Message:

* each package now has a new load function that accepts the name of a shared library as a parameter so that users can override the default library names that Derelict uses to load.
* all packages except DerelictSDL were missing error checks when a shared library is first loaded - now they all properly throw an exception if the library initially failed to load.

Files:

Legend:

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

    r46 r80  
    2424typedef ALdouble function(ALenum) pfalGetDouble; 
    2525typedef ALenum function() pfalGetError; 
    26 pfalEnable             alEnable; 
    27 pfalDisable                alDisable; 
    28 pfalIsEnabled          alIsEnabled; 
    29 pfalHint               alHint; 
    30 pfalGetBooleanv            alGetBooleanv; 
    31 pfalGetIntegerv            alGetIntegerv; 
    32 pfalGetFloatv          alGetFloatv; 
    33 pfalGetDoublev         alGetDoublev; 
    34 pfalGetString          alGetString; 
    35 pfalGetInteger         alGetInteger; 
    36 pfalGetFloat           alGetFloat; 
    37 pfalGetDouble          alGetDouble; 
    38 pfalGetError           alGetError; 
     26pfalEnable                          alEnable; 
     27pfalDisable                         alDisable; 
     28pfalIsEnabled                       alIsEnabled; 
     29pfalHint                            alHint; 
     30pfalGetBooleanv                     alGetBooleanv; 
     31pfalGetIntegerv                     alGetIntegerv; 
     32pfalGetFloatv                       alGetFloatv; 
     33pfalGetDoublev                      alGetDoublev; 
     34pfalGetString                       alGetString; 
     35pfalGetInteger                      alGetInteger; 
     36pfalGetFloat                        alGetFloat; 
     37pfalGetDouble                       alGetDouble; 
     38pfalGetError                        alGetError; 
    3939 
    4040typedef ALboolean function(char*) pfalIsExtensionPresent; 
    4141typedef ALboolean function(char*) pfalGetProcAddress; 
    4242typedef ALenum function(char*) pfalGetEnumValue; 
    43 pfalIsExtensionPresent     alIsExtensionPresent; 
    44 pfalGetProcAddress         alGetProcAddress; 
    45 pfalGetEnumValue           alGetEnumValue; 
     43pfalIsExtensionPresent          alIsExtensionPresent; 
     44pfalGetProcAddress                      alGetProcAddress; 
     45pfalGetEnumValue                        alGetEnumValue; 
    4646 
    4747typedef void function(ALenum, ALfloat) pfalListenerf; 
     
    5454typedef void function(ALenum, ALfloat*) pfalGetListenerfv; 
    5555typedef void function(ALenum, ALfloat*, ALfloat*, ALfloat*) pfalGetListener3f; 
    56 pfalListenerf              alListenerf; 
    57 pfalListeneri              alListeneri; 
    58 pfalListener3f             alListener3f; 
    59 pfalListenerfv             alListenerfv; 
    60 pfalGetListeneri           alGetListeneri; 
    61 pfalGetListenerf           alGetListenerf; 
    62 pfalGetListeneriv          alGetListeneriv; 
    63 pfalGetListenerfv          alGetListenerfv; 
    64 pfalGetListener3f          alGetListener3f; 
     56pfalListenerf                           alListenerf; 
     57pfalListeneri                           alListeneri; 
     58pfalListener3f                          alListener3f; 
     59pfalListenerfv                          alListenerfv; 
     60pfalGetListeneri                        alGetListeneri; 
     61pfalGetListenerf                        alGetListenerf; 
     62pfalGetListeneriv                       alGetListeneriv; 
     63pfalGetListenerfv                       alGetListenerfv; 
     64pfalGetListener3f                       alGetListener3f; 
    6565 
    6666typedef void function(ALsizei, ALuint*) pfalGenSources; 
     
    7676typedef void function(ALuint, ALenum, ALfloat*) pfalGetSourcefv; 
    7777typedef void function(ALuint, ALenum, ALfloat*, ALfloat*, ALfloat*) pfalGetSource3f; 
    78 pfalGenSources                 alGenSources; 
    79 pfalDeleteSources              alDeleteSources; 
    80 pfalIsSource                   alIsSource; 
    81 pfalSourcei                        alSourcei; 
    82 pfalSourcef                        alSourcef; 
    83 pfalSource3f                   alSource3f; 
    84 pfalSourcefv                   alSourcefv; 
    85 pfalGetSourcei                 alGetSourcei; 
    86 pfalGetSourcef                 alGetSourcef; 
    87 pfalGetSourceiv                    alGetSourceiv; 
    88 pfalGetSourcefv                    alGetSourcefv; 
    89 pfalGetSource3f                    alGetSource3f; 
     78pfalGenSources                          alGenSources; 
     79pfalDeleteSources                       alDeleteSources; 
     80pfalIsSource                            alIsSource; 
     81pfalSourcei                             alSourcei; 
     82pfalSourcef                             alSourcef; 
     83pfalSource3f                            alSource3f; 
     84pfalSourcefv                            alSourcefv; 
     85pfalGetSourcei                          alGetSourcei; 
     86pfalGetSourcef                          alGetSourcef; 
     87pfalGetSourceiv                         alGetSourceiv; 
     88pfalGetSourcefv                         alGetSourcefv; 
     89pfalGetSource3f                         alGetSource3f; 
    9090 
    9191typedef void function(ALsizei, ALuint*) pfalSourcePlayv; 
     
    9797typedef void function(ALuint) pfalSourceRewind; 
    9898typedef void function(ALuint) pfalSourceStop; 
    99 pfalSourcePlayv                    alSourcePlayv; 
    100 pfalSourceStopv                    alSourceStopv; 
    101 pfalSourceRewindv              alSourceRewindv; 
    102 pfalSourcePausev               alSourcePausev; 
    103 pfalSourcePlay                 alSourcePlay; 
    104 pfalSourcePause                    alSourcePause; 
    105 pfalSourceRewind               alSourceRewind; 
    106 pfalSourceStop                 alSourceStop; 
     99pfalSourcePlayv                         alSourcePlayv; 
     100pfalSourceStopv                         alSourceStopv; 
     101pfalSourceRewindv                       alSourceRewindv; 
     102pfalSourcePausev                        alSourcePausev; 
     103pfalSourcePlay                          alSourcePlay; 
     104pfalSourcePause                         alSourcePause; 
     105pfalSourceRewind                        alSourceRewind; 
     106pfalSourceStop                          alSourceStop; 
    107107 
    108108typedef void function(ALsizei, ALuint*) pfalGenBuffers; 
     
    112112typedef void function(ALuint, ALenum, ALint*) pfalGetBufferi; 
    113113typedef void function(ALuint, ALenum, ALfloat*) pfalGetBufferf; 
    114 pfalGenBuffers                 alGenBuffers; 
    115 pfalDeleteBuffers              alDeleteBuffers; 
    116 pfalIsBuffer                   alIsBuffer; 
    117 pfalBufferData                 alBufferData; 
    118 pfalGetBufferi                 alGetBufferi; 
    119 pfalGetBufferf                 alGetBufferf; 
     114pfalGenBuffers                          alGenBuffers; 
     115pfalDeleteBuffers                       alDeleteBuffers; 
     116pfalIsBuffer                            alIsBuffer; 
     117pfalBufferData                          alBufferData; 
     118pfalGetBufferi                          alGetBufferi; 
     119pfalGetBufferf                          alGetBufferf; 
    120120 
    121121version(linux) 
     
    123123typedef void function(ALuint, ALenum, ALint*) pfalGetBufferiv; 
    124124typedef void function(ALuint, ALenum, ALfloat*) pfalGetBufferfv; 
    125 pfalGetBufferiv                    alGetBufferiv; 
    126 pfalGetBufferfv                    alGetBufferfv; 
     125pfalGetBufferiv                         alGetBufferiv; 
     126pfalGetBufferfv                         alGetBufferfv; 
    127127} 
    128128 
    129129typedef void function(ALuint, ALsizei, ALuint*) pfalSourceQueueBuffers; 
    130130typedef void function(ALuint, ALsizei, ALuint*) pfalSourceUnqueueBuffers; 
    131 pfalSourceQueueBuffers         alSourceQueueBuffers; 
    132 pfalSourceUnqueueBuffers       alSourceUnqueueBuffers; 
     131pfalSourceQueueBuffers                  alSourceQueueBuffers; 
     132pfalSourceUnqueueBuffers                alSourceUnqueueBuffers; 
    133133 
    134134typedef void function(ALfloat) pfalDopplerFactor; 
    135135typedef void function(ALfloat) pfalDopplerVelocity; 
    136136typedef void function(ALenum) pfalDistanceModel; 
    137 pfalDopplerFactor              alDopplerFactor; 
    138 pfalDopplerVelocity                alDopplerVelocity; 
    139 pfalDistanceModel              alDistanceModel; 
     137pfalDopplerFactor                       alDopplerFactor; 
     138pfalDopplerVelocity                     alDopplerVelocity; 
     139pfalDistanceModel                       alDistanceModel; 
    140140 
    141141} 
     
    151151private void* getProc(char[] procname) 
    152152{ 
    153    void *symbol = ExeModule_GetSymbol(hal, procname); 
    154    if(symbol is null) 
    155        throw new Exception("Failed to load openal proc address " ~ procname); 
    156    return symbol; 
     153    void *symbol = ExeModule_GetSymbol(hal, procname); 
     154    if(symbol is null) 
     155        throw new Exception("Failed to load openal proc address " ~ procname); 
     156    return symbol; 
    157157} 
    158158 
    159159private void loadAL() 
    160160{ 
    161     // al functions 
    162     alEnable = cast(pfalEnable)getProc("alEnable"); 
    163     alDisable = cast(pfalDisable)getProc("alDisable"); 
    164     alIsEnabled = cast(pfalIsEnabled)getProc("alIsEnabled"); 
    165     alHint = cast(pfalHint)getProc("alHint"); 
    166     alGetBooleanv = cast(pfalGetBooleanv)getProc("alGetBooleanv"); 
    167     alGetIntegerv = cast(pfalGetIntegerv)getProc("alGetIntegerv"); 
    168     alGetFloatv = cast(pfalGetFloatv)getProc("alGetFloatv"); 
    169     alGetDoublev = cast(pfalGetDoublev)getProc("alGetDoublev"); 
    170     alGetString = cast(pfalGetString)getProc("alGetString"); 
    171     alGetInteger = cast(pfalGetInteger)getProc("alGetInteger"); 
    172     alGetFloat = cast(pfalGetFloat)getProc("alGetFloat"); 
    173     alGetDouble = cast(pfalGetDouble)getProc("alGetDouble"); 
    174     alGetError = cast(pfalGetError)getProc("alGetError"); 
    175     alIsExtensionPresent = cast(pfalIsExtensionPresent)getProc("alIsExtensionPresent"); 
    176     alGetProcAddress = cast(pfalGetProcAddress)getProc("alGetProcAddress"); 
    177     alGetEnumValue = cast(pfalGetEnumValue)getProc("alGetEnumValue"); 
    178     alListenerf = cast(pfalListenerf)getProc("alListenerf"); 
    179     alListeneri = cast(pfalListeneri)getProc("alListeneri"); 
    180     alListener3f = cast(pfalListener3f)getProc("alListener3f"); 
    181     alListenerfv = cast(pfalListenerfv)getProc("alListenerfv"); 
    182     alGetListeneri = cast(pfalGetListeneri)getProc("alGetListeneri"); 
    183     alGetListenerf = cast(pfalGetListenerf)getProc("alGetListenerf"); 
    184     alGetListeneriv = cast(pfalGetListeneriv)getProc("alGetListeneriv"); 
    185     alGetListenerfv = cast(pfalGetListenerfv)getProc("alGetListenerfv"); 
    186     alGetListener3f = cast(pfalGetListener3f)getProc("alGetListener3f"); 
    187     alGenSources = cast(pfalGenSources)getProc("alGenSources"); 
    188     alDeleteSources = cast(pfalDeleteSources)getProc("alDeleteSources"); 
    189     alIsSource = cast(pfalIsSource)getProc("alIsSource"); 
    190     alSourcei = cast(pfalSourcei)getProc("alSourcei"); 
    191     alSourcef = cast(pfalSourcef)getProc("alSourcef"); 
    192     alSource3f = cast(pfalSource3f)getProc("alSource3f"); 
    193     alSourcefv = cast(pfalSourcefv)getProc("alSourcefv"); 
    194     alGetSourcei = cast(pfalGetSourcei)getProc("alGetSourcei"); 
    195     alGetSourcef = cast(pfalGetSourcef)getProc("alGetSourcef"); 
    196     alGetSourceiv = cast(pfalGetSourceiv)getProc("alGetSourceiv"); 
    197     alGetSourcefv = cast(pfalGetSourcefv)getProc("alGetSourcefv"); 
    198     alGetSource3f = cast(pfalGetSource3f)getProc("alGetSource3f"); 
    199     alSourcePlayv = cast(pfalSourcePlayv)getProc("alSourcePlayv"); 
    200     alSourceStopv = cast(pfalSourceStopv)getProc("alSourceStopv"); 
    201     alSourceRewindv = cast(pfalSourceRewindv)getProc("alSourceRewindv"); 
    202     alSourcePausev = cast(pfalSourcePausev)getProc("alSourcePausev"); 
    203     alSourcePlay = cast(pfalSourcePlay)getProc("alSourcePlay"); 
    204     alSourcePause = cast(pfalSourcePause)getProc("alSourcePause"); 
    205     alSourceRewind = cast(pfalSourceRewind)getProc("alSourceRewind"); 
    206     alSourceStop = cast(pfalSourceStop)getProc("alSourceStop"); 
    207     alGenBuffers = cast(pfalGenBuffers)getProc("alGenBuffers"); 
    208     alDeleteBuffers = cast(pfalDeleteBuffers)getProc("alDeleteBuffers"); 
    209     alIsBuffer = cast(pfalIsBuffer)getProc("alIsBuffer"); 
    210     alBufferData = cast(pfalBufferData)getProc("alBufferData"); 
    211     alGetBufferi = cast(pfalGetBufferi)getProc("alGetBufferi"); 
    212     alGetBufferf = cast(pfalGetBufferf)getProc("alGetBufferf");  
    213     version(linux) 
    214     { 
    215         alGetBufferfv = cast(pfalGetBufferfv)getProc("pfalGetBufferfv"); 
    216         alGetBufferiv = cast(pfalGetBufferiv)getProc("pfalGetBufferiv"); 
    217     } 
    218     alSourceQueueBuffers =  cast(pfalSourceQueueBuffers)getProc("alSourceQueueBuffers"); 
    219     alSourceUnqueueBuffers = cast(pfalSourceUnqueueBuffers)getProc("alSourceUnqueueBuffers"); 
    220     alDopplerFactor = cast(pfalDopplerFactor)getProc("alDopplerFactor"); 
    221     alDopplerVelocity = cast(pfalDopplerVelocity)getProc("alDopplerVelocity"); 
    222     alDistanceModel = cast(pfalDistanceModel)getProc("alDistanceModel");     
     161    // al functions 
     162    alEnable = cast(pfalEnable)getProc("alEnable"); 
     163    alDisable = cast(pfalDisable)getProc("alDisable"); 
     164    alIsEnabled = cast(pfalIsEnabled)getProc("alIsEnabled"); 
     165    alHint = cast(pfalHint)getProc("alHint"); 
     166    alGetBooleanv = cast(pfalGetBooleanv)getProc("alGetBooleanv"); 
     167    alGetIntegerv = cast(pfalGetIntegerv)getProc("alGetIntegerv"); 
     168    alGetFloatv = cast(pfalGetFloatv)getProc("alGetFloatv"); 
     169    alGetDoublev = cast(pfalGetDoublev)getProc("alGetDoublev"); 
     170    alGetString = cast(pfalGetString)getProc("alGetString"); 
     171    alGetInteger = cast(pfalGetInteger)getProc("alGetInteger"); 
     172    alGetFloat = cast(pfalGetFloat)getProc("alGetFloat"); 
     173    alGetDouble = cast(pfalGetDouble)getProc("alGetDouble"); 
     174    alGetError = cast(pfalGetError)getProc("alGetError"); 
     175    alIsExtensionPresent = cast(pfalIsExtensionPresent)getProc("alIsExtensionPresent"); 
     176    alGetProcAddress = cast(pfalGetProcAddress)getProc("alGetProcAddress"); 
     177    alGetEnumValue = cast(pfalGetEnumValue)getProc("alGetEnumValue"); 
     178    alListenerf = cast(pfalListenerf)getProc("alListenerf"); 
     179    alListeneri = cast(pfalListeneri)getProc("alListeneri"); 
     180    alListener3f = cast(pfalListener3f)getProc("alListener3f"); 
     181    alListenerfv = cast(pfalListenerfv)getProc("alListenerfv"); 
     182    alGetListeneri = cast(pfalGetListeneri)getProc("alGetListeneri"); 
     183    alGetListenerf = cast(pfalGetListenerf)getProc("alGetListenerf"); 
     184    alGetListeneriv = cast(pfalGetListeneriv)getProc("alGetListeneriv"); 
     185    alGetListenerfv = cast(pfalGetListenerfv)getProc("alGetListenerfv"); 
     186    alGetListener3f = cast(pfalGetListener3f)getProc("alGetListener3f"); 
     187    alGenSources = cast(pfalGenSources)getProc("alGenSources"); 
     188    alDeleteSources = cast(pfalDeleteSources)getProc("alDeleteSources"); 
     189    alIsSource = cast(pfalIsSource)getProc("alIsSource"); 
     190    alSourcei = cast(pfalSourcei)getProc("alSourcei"); 
     191    alSourcef = cast(pfalSourcef)getProc("alSourcef"); 
     192    alSource3f = cast(pfalSource3f)getProc("alSource3f"); 
     193    alSourcefv = cast(pfalSourcefv)getProc("alSourcefv"); 
     194    alGetSourcei = cast(pfalGetSourcei)getProc("alGetSourcei"); 
     195    alGetSourcef = cast(pfalGetSourcef)getProc("alGetSourcef"); 
     196    alGetSourceiv = cast(pfalGetSourceiv)getProc("alGetSourceiv"); 
     197    alGetSourcefv = cast(pfalGetSourcefv)getProc("alGetSourcefv"); 
     198    alGetSource3f = cast(pfalGetSource3f)getProc("alGetSource3f"); 
     199    alSourcePlayv = cast(pfalSourcePlayv)getProc("alSourcePlayv"); 
     200    alSourceStopv = cast(pfalSourceStopv)getProc("alSourceStopv"); 
     201    alSourceRewindv = cast(pfalSourceRewindv)getProc("alSourceRewindv"); 
     202    alSourcePausev = cast(pfalSourcePausev)getProc("alSourcePausev"); 
     203    alSourcePlay = cast(pfalSourcePlay)getProc("alSourcePlay"); 
     204    alSourcePause = cast(pfalSourcePause)getProc("alSourcePause"); 
     205    alSourceRewind = cast(pfalSourceRewind)getProc("alSourceRewind"); 
     206    alSourceStop = cast(pfalSourceStop)getProc("alSourceStop"); 
     207    alGenBuffers = cast(pfalGenBuffers)getProc("alGenBuffers"); 
     208    alDeleteBuffers = cast(pfalDeleteBuffers)getProc("alDeleteBuffers"); 
     209    alIsBuffer = cast(pfalIsBuffer)getProc("alIsBuffer"); 
     210    alBufferData = cast(pfalBufferData)getProc("alBufferData"); 
     211    alGetBufferi = cast(pfalGetBufferi)getProc("alGetBufferi"); 
     212    alGetBufferf = cast(pfalGetBufferf)getProc("alGetBufferf"); 
     213    version(linux) 
     214    { 
     215        alGetBufferfv = cast(pfalGetBufferfv)getProc("pfalGetBufferfv"); 
     216        alGetBufferiv = cast(pfalGetBufferiv)getProc("pfalGetBufferiv"); 
     217    } 
     218    alSourceQueueBuffers =  cast(pfalSourceQueueBuffers)getProc("alSourceQueueBuffers"); 
     219    alSourceUnqueueBuffers = cast(pfalSourceUnqueueBuffers)getProc("alSourceUnqueueBuffers"); 
     220    alDopplerFactor = cast(pfalDopplerFactor)getProc("alDopplerFactor"); 
     221    alDopplerVelocity = cast(pfalDopplerVelocity)getProc("alDopplerVelocity"); 
     222    alDistanceModel = cast(pfalDistanceModel)getProc("alDistanceModel"); 
     223
     224 
     225public void DerelictAL_Load(char[] libName) 
     226
     227    if(hal !== null) 
     228        return; 
     229 
     230    if(ExeModule_Init() == -1) 
     231        throw new Exception("Exemodule initialization failed"); 
     232 
     233    exeModuleInited = true; 
     234 
     235    hal = ExeModule_Load(libName); 
     236 
     237    if(hal is null) 
     238        throw new Exception("Failed to load the OpenAL shared library."); 
     239 
     240    loadAL(); 
    223241} 
    224242 
    225243public void DerelictAL_Load() 
    226244{ 
    227     if(hal !== null) 
    228         return; 
    229          
    230     if(ExeModule_Init() == -1) 
    231         throw new Exception("Exemodule initialization failed"); 
    232          
    233     exeModuleInited = true; 
    234      
    235     version(Windows) 
    236         hal = ExeModule_Load("OpenAL32.dll"); 
    237      
    238     loadAL(); 
     245        version(Windows) 
     246            DerelictAL_Load("OpenAL32.dll"); 
    239247} 
    240248 
     
    243251public void DerelictAL_LoadALU() 
    244252{ 
    245    aluF2L = cast(pfaluF2L)getProc("aluF2L"); 
    246    aluF2S = cast(pfaluF2S)getProc("aluF2S"); 
    247    aluCrossproduct = cast(pfaluCrossproduct)getProc("aluCrossproduct"); 
    248    aluDotproduct = cast(pfaluDotproduct)getProc("aluDotproduct"); 
    249    aluNormalize = cast(pfaluNormalize)getProc("aluNormalize"); 
    250    aluMatrixVector = cast(pfaluMatrixVector)getProc("aluMatrixVector"); 
    251    aluCalculateSourceParameters = cast(pfaluCalculateSourceParameters)getProc("aluCalculateSourceParameters"); 
    252    aluMixData = cast(pfaluMixData)getProc("aluMixData"); 
    253    aluSetReverb = cast(pfaluSetReverb)getProc("aluSetReverb"); 
    254     aluReverb = cast(pfaluReverb)getProc("aluReverb");   
    255 } 
    256 } 
     253    aluF2L = cast(pfaluF2L)getProc("aluF2L"); 
     254    aluF2S = cast(pfaluF2S)getProc("aluF2S"); 
     255    aluCrossproduct = cast(pfaluCrossproduct)getProc("aluCrossproduct"); 
     256    aluDotproduct = cast(pfaluDotproduct)getProc("aluDotproduct"); 
     257    aluNormalize = cast(pfaluNormalize)getProc("aluNormalize"); 
     258    aluMatrixVector = cast(pfaluMatrixVector)getProc("aluMatrixVector"); 
     259    aluCalculateSourceParameters = cast(pfaluCalculateSourceParameters)getProc("aluCalculateSourceParameters"); 
     260    aluMixData = cast(pfaluMixData)getProc("aluMixData"); 
     261    aluSetReverb = cast(pfaluSetReverb)getProc("aluSetReverb"); 
     262    aluReverb = cast(pfaluReverb)getProc("aluReverb"); 
     263} 
     264} // version(Windows) 
    257265 
    258266static ~this() 
    259267{ 
    260    if(exeModuleInited) 
    261     {    
    262        ExeModule_Release(hal); 
    263        ExeModule_Uninit(); 
    264    
    265 } 
     268    if(exeModuleInited) 
     269    { 
     270        ExeModule_Release(hal); 
     271        ExeModule_Uninit(); 
     272   
     273} 
  • trunk/DerelictGL/derelict/opengl/gl.d

    r78 r80  
    5555} 
    5656 
    57 public void DerelictGL_Load(
     57public void DerelictGL_Load(char[] libName
    5858{ 
    5959    if(hgl !== null) 
     
    6363        throw new Exception("ExeModule initialization failed"); 
    6464 
    65     version(Windows) 
    66         hgl = ExeModule_Load("opengl32.dll"); 
    67     version(linux) 
    68         hgl = ExeModule_Load("libgl.so"); 
     65    exeModuleInited = true; 
    6966 
    70     exeModuleInited = true; 
     67    hgl = ExeModule_Load(libName); 
     68 
     69    if(hgl is null) 
     70        throw new Exception("Failed to load the OpenGL shared library"); 
     71 
     72 
    7173 
    7274    loadPlatformGL(); 
    7375    loadGL(); 
     76} 
     77 
     78public void DerelictGL_Load() 
     79{ 
     80    version(Windows) 
     81        DerelictGL_Load("opengl32.dll"); 
     82    version(linux) 
     83        DerelictGL_Load("libgl.so"); 
    7484} 
    7585 
  • trunk/DerelictGLFW/derelict/glfw/glfw.d

    r76 r80  
    11// ----------------------------------------------------------------------- 
    22// FILE: glfw.d -- dynamic loader interface for the GLFW library 
    3 //  
     3// 
    44// 2005-02-09: Added to Derelict library for dynamic linking -- JJR 
    5 //  
     5// 
    66// *** Original header file copyright below *** 
    77 
     
    4646//----------------------------------------------------------- 
    4747// glfw Types and Constants 
    48 //-----------------------------------------------------------   
    49      
     48//----------------------------------------------------------- 
     49 
    5050const int GLFW_VERSION_MAJOR      = 2; 
    5151const int GLFW_VERSION_MINOR      = 4; 
    52 const int GLFW_VERSION_REVISION   = 2;  
     52const int GLFW_VERSION_REVISION   = 2; 
    5353 
    5454// Key and button state/action definitions 
     
    198198// Time spans longer than this (seconds) are considered to be infinity 
    199199const float GLFW_INFINITY = 100000.0; 
    200   
     200 
    201201extern(Windows) 
    202202{ 
    203    // Intrinsic glfw funtion pointer types 
    204    typedef void function(int, int) GLFWwindowsizefun; 
    205    typedef void function(int, int) GLFWmousebuttonfun; 
    206    typedef void function(int, int) GLFWmouseposfun; 
    207    typedef void function(int)      GLFWmousewheelfun; 
    208    typedef void function(int, int) GLFWkeyfun; 
    209    typedef void function(int, int) GLFWcharfun; 
    210    alias void function(void*)    GLFWthreadfun; 
     203    // Intrinsic glfw funtion pointer types 
     204    typedef void function(int, int) GLFWwindowsizefun; 
     205    typedef void function(int, int) GLFWmousebuttonfun; 
     206    typedef void function(int, int) GLFWmouseposfun; 
     207    typedef void function(int)      GLFWmousewheelfun; 
     208    typedef void function(int, int) GLFWkeyfun; 
     209    typedef void function(int, int) GLFWcharfun; 
     210    alias void function(void*)    GLFWthreadfun; 
    211211} 
    212212 
    213213struct GLFWvidmode 
    214214{ 
    215    int Width, Height; 
    216    int RedBits, BlueBits, GreenBits; 
     215    int Width, Height; 
     216    int RedBits, BlueBits, GreenBits; 
    217217} 
    218218 
    219219struct GLFWimage 
    220220{ 
    221    int Width, Height; 
    222    int Format; 
    223    int BytesPerPixel; 
    224    ubyte *Data; 
     221    int Width, Height; 
     222    int Format; 
     223    int BytesPerPixel; 
     224    ubyte *Data; 
    225225} 
    226226 
     
    238238 
    239239version(NO_PREFIX) 
    240 {   
    241    pfglfwInit                      init; 
    242    pfglfwTerminate                 terminate; 
    243    pfglfwGetVersion                getVersion; 
    244  
    245    pfglfwOpenWindow                openWindow; 
    246    pfglfwOpenWindowHint            openWindowHint; 
    247    pfglfwCloseWindow               closeWindow; 
    248    pfglfwSetWindowTitle            setWindowTitle; 
    249    pfglfwGetWindowSize             getWindowSize; 
    250    pfglfwSetWindowSize             setWindowSize; 
    251    pfglfwSetWindowPos              setWindowPos; 
    252    pfglfwIconifyWindow             iconifyWindow; 
    253    pfglfwRestoreWindow             restoreWindow; 
    254    pfglfwSwapBuffers               swapBuffers; 
    255    pfglfwSwapInterval              swapInterval; 
    256    pfglfwGetWindowParam            getWindowParam; 
    257    pfglfwSetWindowSizeCallback     setWindowSizeCallback; 
    258  
    259    pfglfwGetVideoModes             getVideoModes; 
    260    pfglfwGetDesktopMode            getDesktopMode; 
    261  
    262    pfglfwPollEvents                pollEvents; 
    263    pfglfwGetKey                    getKey; 
    264    pfglfwGetMouseButton            getMouseButton; 
    265    pfglfwGetMousePos               getMousePos; 
    266    pfglfwSetMousePos               setMousePos; 
    267    pfglfwGetMouseWheel             getMouseWheel; 
    268    pfglfwSetMouseWheel             setMouseWheel; 
    269    pfglfwSetKeyCallback            setKeyCallback; 
    270    pfglfwSetCharCallback           setCharCallback; 
    271    pfglfwSetMouseButtonCallback    setMouseButtonCallback; 
    272    pfglfwSetMousePosCallback       setMousePosCallback; 
    273    pfglfwSetMouseWheelCallback     setMouseWheelCallback; 
    274  
    275    pfglfwGetJoystickParam          getJoystickParam; 
    276    pfglfwGetJoystickPos            getJoystickPos; 
    277    pfglfwGetJoystickButtons            getJoystickButtons; 
    278  
    279    pfglfwGetTime                   getTime; 
    280    pfglfwSetTime                   setTime; 
    281    pfglfwSleep                     sleep; 
    282  
    283    pfglfwExtensionSupported        extensionSupported; 
    284    pfglfwGetProcAddress            getProcAddress; 
    285    pfglfwGetGLVersion              getGLVersion; 
    286  
    287    pfglfwCreateThread              createThread; 
    288    pfglfwDestroyThread             destroyThread; 
    289    pfglfwWaitThread                waitThread; 
    290    pfglfwGetThreadID               getThreadID; 
    291    pfglfwCreateMutex               createMutex; 
    292    pfglfwDestroyMutex              destroyMutex; 
    293    pfglfwLockMutex                 lockMutex; 
    294    pfglfwUnlockMutex               unlockMutex; 
    295    pfglfwCreateCond                createCond; 
    296    pfglfwDestroyCond               destroyCond; 
    297    pfglfwWaitCond                  waitCond; 
    298    pfglfwSignalCond                signalCond; 
    299    pfglfwBroadcastCond             broadcastCond; 
    300    pfglfwGetNumberOfProcessors     getNumberOfProcessors; 
    301  
    302    pfglfwEnable                    enable; 
    303    pfglfwDisable                   disable; 
    304  
    305    pfglfwReadImage                 readImage; 
    306    pfglfwFreeImage                 freeImage; 
    307    pfglfwLoadTexture2D             loadTexture2D; 
    308      
    309    private void load() 
    310    
    311        init        = cast(pfglfwInit) getProc("glfwInit"); 
    312        terminate   = cast(pfglfwTerminate) getProc("glfwTerminate"); 
    313        getVersion  = cast(pfglfwGetVersion) getProc("glfwGetVersion"); 
    314      
    315        openWindow  = cast(pfglfwOpenWindow) getProc("glfwOpenWindow"); 
    316        openWindowHint = cast(pfglfwOpenWindowHint) getProc("glfwOpenWindowHint"); 
    317        closeWindow = cast(pfglfwCloseWindow) getProc("glfwCloseWindow"); 
    318        setWindowTitle = cast(pfglfwSetWindowTitle) getProc("glfwSetWindowTitle"); 
    319        getWindowSize = cast(pfglfwGetWindowSize) getProc("glfwGetWindowSize"); 
    320        setWindowSize = cast(pfglfwSetWindowSize) getProc("glfwSetWindowSize"); 
    321        setWindowPos = cast(pfglfwSetWindowPos) getProc("glfwSetWindowPos"); 
    322        iconifyWindow = cast(pfglfwIconifyWindow) getProc("glfwIconifyWindow"); 
    323        restoreWindow = cast(pfglfwRestoreWindow) getProc("glfwRestoreWindow"); 
    324        swapBuffers = cast(pfglfwSwapBuffers) getProc("glfwSwapBuffers"); 
    325        swapInterval = cast(pfglfwSwapInterval) getProc("glfwSwapInterval"); 
    326        getWindowParam = cast(pfglfwGetWindowParam) getProc("glfwGetWindowParam"); 
    327        setWindowSizeCallback = cast(pfglfwSetWindowSizeCallback) getProc("glfwSetWindowSizeCallback"); 
    328      
    329        getVideoModes = cast(pfglfwGetVideoModes) getProc("glfwGetVideoModes"); 
    330        getDesktopMode = cast(pfglfwGetDesktopMode) getProc("glfwGetDesktopMode"); 
    331      
    332        pollEvents = cast(pfglfwPollEvents) getProc("glfwPollEvents"); 
    333        getKey = cast(pfglfwGetKey) getProc("glfwGetKey"); 
    334        getMouseButton = cast(pfglfwGetMouseButton) getProc("glfwGetMouseButton"); 
    335        getMousePos = cast(pfglfwGetMousePos) getProc("glfwGetMousePos"); 
    336        setMousePos = cast(pfglfwSetMousePos) getProc("glfwSetMousePos"); 
    337        getMouseWheel = cast(pfglfwGetMouseWheel) getProc("glfwGetMouseWheel"); 
    338        setMouseWheel = cast(pfglfwSetMouseWheel) getProc("glfwSetMouseWheel"); 
    339        setKeyCallback = cast(pfglfwSetKeyCallback) getProc("glfwSetKeyCallback"); 
    340        setCharCallback = cast(pfglfwSetCharCallback) getProc("glfwSetCharCallback"); 
    341        setMouseButtonCallback = cast(pfglfwSetMouseButtonCallback) getProc("glfwSetMouseButtonCallback"); 
    342        setMousePosCallback = cast(pfglfwSetMousePosCallback) getProc("glfwSetMousePosCallback"); 
    343        setMouseWheelCallback = cast(pfglfwSetMouseWheelCallback) getProc("glfwSetMouseWheelCallback"); 
    344      
    345        getJoystickParam = cast(pfglfwGetJoystickParam) getProc("glfwGetJoystickParam"); 
    346        getJoystickPos = cast(pfglfwGetJoystickPos) getProc("glfwGetJoystickPos"); 
    347        getJoystickButtons = cast(pfglfwGetJoystickButtons) getProc("glfwGetJoystickButtons"); 
    348      
    349        getTime = cast(pfglfwGetTime) getProc("glfwGetTime"); 
    350        setTime = cast(pfglfwSetTime) getProc("glfwSetTime"); 
    351        sleep = cast(pfglfwSleep) getProc("glfwSleep"); 
    352      
    353        extensionSupported = cast(pfglfwExtensionSupported) getProc("glfwExtensionSupported"); 
    354        getProcAddress = cast(pfglfwGetProcAddress) getProc("glfwGetProcAddress"); 
    355        getGLVersion = cast(pfglfwGetGLVersion) getProc("glfwGetGLVersion"); 
    356      
    357        createThread = cast(pfglfwCreateThread) getProc("glfwCreateThread"); 
    358        destroyThread = cast(pfglfwDestroyThread) getProc("glfwDestroyThread"); 
    359        waitThread = cast(pfglfwWaitThread) getProc("glfwWaitThread"); 
    360        getThreadID = cast(pfglfwGetThreadID) getProc("glfwGetThreadID"); 
    361        createMutex = cast(pfglfwCreateMutex) getProc("glfwCreateMutex"); 
    362        destroyMutex = cast(pfglfwDestroyMutex) getProc("glfwDestroyMutex"); 
    363        lockMutex = cast(pfglfwLockMutex) getProc("glfwLockMutex"); 
    364        unlockMutex = cast(pfglfwUnlockMutex) getProc("glfwUnlockMutex"); 
    365        createCond = cast(pfglfwCreateCond) getProc("glfwCreateCond"); 
    366        destroyCond = cast(pfglfwDestroyCond) getProc("glfwDestroyCond"); 
    367        waitCond = cast(pfglfwWaitCond) getProc("glfwWaitCond"); 
    368        signalCond = cast(pfglfwSignalCond) getProc("glfwSignalCond"); 
    369        broadcastCond = cast(pfglfwBroadcastCond) getProc("glfwBroadcastCond"); 
    370        getNumberOfProcessors = cast(pfglfwGetNumberOfProcessors) getProc("glfwGetNumberOfProcessors"); 
    371      
    372        enable = cast(pfglfwEnable) getProc("glfwEnable"); 
    373        disable = cast(pfglfwDisable) getProc("glfwDisable"); 
    374      
    375        readImage = cast(pfglfwReadImage) getProc("glfwReadImage"); 
    376        freeImage = cast(pfglfwFreeImage) getProc("glfwFreeImage"); 
    377        loadTexture2D = cast(pfglfwLoadTexture2D) getProc("glfwLoadTexture2D"); 
    378    
     240{ 
     241    pfglfwInit                      init; 
     242    pfglfwTerminate                 terminate; 
     243    pfglfwGetVersion                getVersion; 
     244 
     245    pfglfwOpenWindow                openWindow; 
     246    pfglfwOpenWindowHint            openWindowHint; 
     247    pfglfwCloseWindow               closeWindow; 
     248    pfglfwSetWindowTitle            setWindowTitle; 
     249    pfglfwGetWindowSize             getWindowSize; 
     250    pfglfwSetWindowSize             setWindowSize; 
     251    pfglfwSetWindowPos              setWindowPos; 
     252    pfglfwIconifyWindow             iconifyWindow; 
     253    pfglfwRestoreWindow             restoreWindow; 
     254    pfglfwSwapBuffers               swapBuffers; 
     255    pfglfwSwapInterval              swapInterval; 
     256    pfglfwGetWindowParam            getWindowParam; 
     257    pfglfwSetWindowSizeCallback     setWindowSizeCallback; 
     258 
     259    pfglfwGetVideoModes             getVideoModes; 
     260    pfglfwGetDesktopMode            getDesktopMode; 
     261 
     262    pfglfwPollEvents                pollEvents; 
     263    pfglfwGetKey                    getKey; 
     264    pfglfwGetMouseButton            getMouseButton; 
     265    pfglfwGetMousePos               getMousePos; 
     266    pfglfwSetMousePos               setMousePos; 
     267    pfglfwGetMouseWheel             getMouseWheel; 
     268    pfglfwSetMouseWheel             setMouseWheel; 
     269    pfglfwSetKeyCallback            setKeyCallback; 
     270    pfglfwSetCharCallback           setCharCallback; 
     271    pfglfwSetMouseButtonCallback    setMouseButtonCallback; 
     272    pfglfwSetMousePosCallback       setMousePosCallback; 
     273    pfglfwSetMouseWheelCallback     setMouseWheelCallback; 
     274 
     275    pfglfwGetJoystickParam          getJoystickParam; 
     276    pfglfwGetJoystickPos            getJoystickPos; 
     277    pfglfwGetJoystickButtons            getJoystickButtons; 
     278 
     279    pfglfwGetTime                   getTime; 
     280    pfglfwSetTime                   setTime; 
     281    pfglfwSleep                     sleep; 
     282 
     283    pfglfwExtensionSupported        extensionSupported; 
     284    pfglfwGetProcAddress            getProcAddress; 
     285    pfglfwGetGLVersion              getGLVersion; 
     286 
     287    pfglfwCreateThread              createThread; 
     288    pfglfwDestroyThread             destroyThread; 
     289    pfglfwWaitThread                waitThread; 
     290    pfglfwGetThreadID               getThreadID; 
     291    pfglfwCreateMutex               createMutex; 
     292    pfglfwDestroyMutex              destroyMutex; 
     293    pfglfwLockMutex                 lockMutex; 
     294    pfglfwUnlockMutex               unlockMutex; 
     295    pfglfwCreateCond                createCond; 
     296    pfglfwDestroyCond               destroyCond; 
     297    pfglfwWaitCond                  waitCond; 
     298    pfglfwSignalCond                signalCond; 
     299    pfglfwBroadcastCond             broadcastCond; 
     300    pfglfwGetNumberOfProcessors     getNumberOfProcessors; 
     301 
     302    pfglfwEnable                    enable; 
     303    pfglfwDisable                   disable; 
     304 
     305    pfglfwReadImage                 readImage; 
     306    pfglfwFreeImage                 freeImage; 
     307    pfglfwLoadTexture2D             loadTexture2D; 
     308 
     309    private void load() 
     310   
     311        init        = cast(pfglfwInit) getProc("glfwInit"); 
     312        terminate   = cast(pfglfwTerminate) getProc("glfwTerminate"); 
     313        getVersion  = cast(pfglfwGetVersion) getProc("glfwGetVersion"); 
     314 
     315        openWindow  = cast(pfglfwOpenWindow) getProc("glfwOpenWindow"); 
     316        openWindowHint = cast(pfglfwOpenWindowHint) getProc("glfwOpenWindowHint"); 
     317        closeWindow = cast(pfglfwCloseWindow) getProc("glfwCloseWindow"); 
     318        setWindowTitle = cast(pfglfwSetWindowTitle) getProc("glfwSetWindowTitle"); 
     319        getWindowSize = cast(pfglfwGetWindowSize) getProc("glfwGetWindowSize"); 
     320        setWindowSize = cast(pfglfwSetWindowSize) getProc("glfwSetWindowSize"); 
     321        setWindowPos = cast(pfglfwSetWindowPos) getProc("glfwSetWindowPos"); 
     322        iconifyWindow = cast(pfglfwIconifyWindow) getProc("glfwIconifyWindow"); 
     323        restoreWindow = cast(pfglfwRestoreWindow) getProc("glfwRestoreWindow"); 
     324        swapBuffers = cast(pfglfwSwapBuffers) getProc("glfwSwapBuffers"); 
     325        swapInterval = cast(pfglfwSwapInterval) getProc("glfwSwapInterval"); 
     326        getWindowParam = cast(pfglfwGetWindowParam) getProc("glfwGetWindowParam"); 
     327        setWindowSizeCallback = cast(pfglfwSetWindowSizeCallback) getProc("glfwSetWindowSizeCallback"); 
     328 
     329        getVideoModes = cast(pfglfwGetVideoModes) getProc("glfwGetVideoModes"); 
     330        getDesktopMode = cast(pfglfwGetDesktopMode) getProc("glfwGetDesktopMode"); 
     331 
     332        pollEvents = cast(pfglfwPollEvents) getProc("glfwPollEvents"); 
     333        getKey = cast(pfglfwGetKey) getProc("glfwGetKey"); 
     334        getMouseButton = cast(pfglfwGetMouseButton) getProc("glfwGetMouseButton"); 
     335        getMousePos = cast(pfglfwGetMousePos) getProc("glfwGetMousePos"); 
     336        setMousePos = cast(pfglfwSetMousePos) getProc("glfwSetMousePos"); 
     337        getMouseWheel = cast(pfglfwGetMouseWheel) getProc("glfwGetMouseWheel"); 
     338        setMouseWheel = cast(pfglfwSetMouseWheel) getProc("glfwSetMouseWheel"); 
     339        setKeyCallback = cast(pfglfwSetKeyCallback) getProc("glfwSetKeyCallback"); 
     340        setCharCallback = cast(pfglfwSetCharCallback) getProc("glfwSetCharCallback"); 
     341        setMouseButtonCallback = cast(pfglfwSetMouseButtonCallback) getProc("glfwSetMouseButtonCallback"); 
     342        setMousePosCallback = cast(pfglfwSetMousePosCallback) getProc("glfwSetMousePosCallback"); 
     343        setMouseWheelCallback = cast(pfglfwSetMouseWheelCallback) getProc("glfwSetMouseWheelCallback"); 
     344 
     345        getJoystickParam = cast(pfglfwGetJoystickParam) getProc("glfwGetJoystickParam"); 
     346        getJoystickPos = cast(pfglfwGetJoystickPos) getProc("glfwGetJoystickPos"); 
     347        getJoystickButtons = cast(pfglfwGetJoystickButtons) getProc("glfwGetJoystickButtons"); 
     348 
     349        getTime = cast(pfglfwGetTime) getProc("glfwGetTime"); 
     350        setTime = cast(pfglfwSetTime) getProc("glfwSetTime"); 
     351        sleep = cast(pfglfwSleep) getProc("glfwSleep"); 
     352 
     353        extensionSupported = cast(pfglfwExtensionSupported) getProc("glfwExtensionSupported"); 
     354        getProcAddress = cast(pfglfwGetProcAddress) getProc("glfwGetProcAddress"); 
     355        getGLVersion = cast(pfglfwGetGLVersion) getProc("glfwGetGLVersion"); 
     356 
     357        createThread = cast(pfglfwCreateThread) getProc("glfwCreateThread"); 
     358        destroyThread = cast(pfglfwDestroyThread) getProc("glfwDestroyThread"); 
     359        waitThread = cast(pfglfwWaitThread) getProc("glfwWaitThread"); 
     360        getThreadID = cast(pfglfwGetThreadID) getProc("glfwGetThreadID"); 
     361        createMutex = cast(pfglfwCreateMutex) getProc("glfwCreateMutex"); 
     362        destroyMutex = cast(pfglfwDestroyMutex) getProc("glfwDestroyMutex"); 
     363        lockMutex = cast(pfglfwLockMutex) getProc("glfwLockMutex"); 
     364        unlockMutex = cast(pfglfwUnlockMutex) getProc("glfwUnlockMutex"); 
     365        createCond = cast(pfglfwCreateCond) getProc("glfwCreateCond"); 
     366        destroyCond = cast(pfglfwDestroyCond) getProc("glfwDestroyCond"); 
     367        waitCond = cast(pfglfwWaitCond) getProc("glfwWaitCond"); 
     368        signalCond = cast(pfglfwSignalCond) getProc("glfwSignalCond"); 
     369        broadcastCond = cast(pfglfwBroadcastCond) getProc("glfwBroadcastCond"); 
     370        getNumberOfProcessors = cast(pfglfwGetNumberOfProcessors) getProc("glfwGetNumberOfProcessors"); 
     371 
     372        enable = cast(pfglfwEnable) getProc("glfwEnable"); 
     373        disable = cast(pfglfwDisable) getProc("glfwDisable"); 
     374 
     375        readImage = cast(pfglfwReadImage) getProc("glfwReadImage"); 
     376        freeImage = cast(pfglfwFreeImage) getProc("glfwFreeImage"); 
     377        loadTexture2D = cast(pfglfwLoadTexture2D) getProc("glfwLoadTexture2D"); 
     378   
    379379} 
    380380else // version(default) 
    381381{ 
    382    pfglfwInit                      glfwInit; 
    383    pfglfwTerminate                 glfwTerminate; 
    384    pfglfwGetVersion                glfwGetVersion; 
    385  
    386    pfglfwOpenWindow                glfwOpenWindow; 
    387    pfglfwOpenWindowHint            glfwOpenWindowHint; 
    388    pfglfwCloseWindow               glfwCloseWindow; 
    389    pfglfwSetWindowTitle            glfwSetWindowTitle; 
    390    pfglfwGetWindowSize             glfwGetWindowSize; 
    391    pfglfwSetWindowSize             glfwSetWindowSize; 
    392    pfglfwSetWindowPos              glfwSetWindowPos; 
    393    pfglfwIconifyWindow             glfwIconifyWindow; 
    394    pfglfwRestoreWindow             glfwRestoreWindow; 
    395    pfglfwSwapBuffers               glfwSwapBuffers; 
    396    pfglfwSwapInterval              glfwSwapInterval; 
    397    pfglfwGetWindowParam            glfwGetWindowParam; 
    398    pfglfwSetWindowSizeCallback     glfwSetWindowSizeCallback; 
    399  
    400    pfglfwGetVideoModes             glfwGetVideoModes; 
    401    pfglfwGetDesktopMode            glfwGetDesktopMode; 
    402    pfglfwPollEvents                glfwPollEvents; 
    403    pfglfwGetKey                    glfwGetKey; 
    404    pfglfwGetMouseButton            glfwGetMouseButton; 
    405    pfglfwGetMousePos               glfwGetMousePos; 
    406    pfglfwSetMousePos               glfwSetMousePos; 
    407    pfglfwGetMouseWheel             glfwGetMouseWheel; 
    408    pfglfwSetMouseWheel             glfwSetMouseWheel; 
    409    pfglfwSetKeyCallback            glfwSetKeyCallback; 
    410    pfglfwSetCharCallback           glfwSetCharCallback; 
    411    pfglfwSetMouseButtonCallback    glfwSetMouseButtonCallback; 
    412    pfglfwSetMousePosCallback       glfwSetMousePosCallback; 
    413    pfglfwSetMouseWheelCallback     glfwSetMouseWheelCallback; 
    414  
    415    pfglfwGetJoystickParam          glfwGetJoystickParam; 
    416    pfglfwGetJoystickPos            glfwGetJoystickPos; 
    417    pfglfwGetJoystickButtons        glfwGetJoystickButtons; 
    418  
    419    pfglfwGetTime                   glfwGetTime; 
    420    pfglfwSetTime                   glfwSetTime; 
    421    pfglfwSleep                     glfwSleep; 
    422  
    423    pfglfwExtensionSupported        glfwExtensionSupported; 
    424    pfglfwGetProcAddress            glfwGetProcAddress; 
    425    pfglfwGetGLVersion              glfwGetGLVersion; 
    426  
    427    pfglfwCreateThread              glfwCreateThread; 
    428    pfglfwDestroyThread             glfwDestroyThread; 
    429    pfglfwWaitThread                glfwWaitThread; 
    430    pfglfwGetThreadID               glfwGetThreadID; 
    431    pfglfwCreateMutex               glfwCreateMutex; 
    432    pfglfwDestroyMutex              glfwDestroyMutex; 
    433    pfglfwLockMutex                 glfwLockMutex; 
    434    pfglfwUnlockMutex               glfwUnlockMutex; 
    435    pfglfwCreateCond                glfwCreateCond; 
    436    pfglfwDestroyCond               glfwDestroyCond; 
    437    pfglfwWaitCond                  glfwWaitCond; 
    438    pfglfwSignalCond                glfwSignalCond; 
    439    pfglfwBroadcastCond             glfwBroadcastCond; 
    440    pfglfwGetNumberOfProcessors     glfwGetNumberOfProcessors; 
    441  
    442    pfglfwEnable                    glfwEnable; 
    443    pfglfwDisable                   glfwDisable; 
    444  
    445    pfglfwReadImage                 glfwReadImage; 
    446    pfglfwFreeImage                 glfwFreeImage; 
    447    pfglfwLoadTexture2D             glfwLoadTexture2D; 
    448  
    449    private void load() 
    450     {    
    451        glfwInit        = cast(pfglfwInit) getProc("glfwInit"); 
    452        glfwTerminate   = cast(pfglfwTerminate) getProc("glfwTerminate"); 
    453        glfwGetVersion  = cast(pfglfwGetVersion) getProc("glfwGetVersion"); 
    454      
    455        glfwOpenWindow  = cast(pfglfwOpenWindow) getProc("glfwOpenWindow"); 
    456        glfwOpenWindowHint = cast(pfglfwOpenWindowHint) getProc("glfwOpenWindowHint"); 
    457        glfwCloseWindow = cast(pfglfwCloseWindow) getProc("glfwCloseWindow"); 
    458        glfwSetWindowTitle = cast(pfglfwSetWindowTitle) getProc("glfwSetWindowTitle"); 
    459        glfwGetWindowSize = cast(pfglfwGetWindowSize) getProc("glfwGetWindowSize"); 
    460        glfwSetWindowSize = cast(pfglfwSetWindowSize) getProc("glfwSetWindowSize"); 
    461        glfwSetWindowPos = cast(pfglfwSetWindowPos) getProc("glfwSetWindowPos"); 
    462        glfwIconifyWindow = cast(pfglfwIconifyWindow) getProc("glfwIconifyWindow"); 
    463        glfwRestoreWindow = cast(pfglfwRestoreWindow) getProc("glfwRestoreWindow"); 
    464        glf