Changeset 38

Show
Ignore:
Timestamp:
07/26/04 09:03:06 (4 years ago)
Author:
aldacron
Message:

*[DerelictGL] small cosmetic change to gl.d (moved a variable declaration to the top of the file)
*[DerelictSDL] sdl.d now initializes and shuts down std.loader just like gl.d does
*[DerelictSDL] in sdl.d, moved the calls to getProc from DerelictSDL_Load to a new, internal load() function
*[DerelictPY] in python.d, rewrote std.loader initialization so that it matches gl.d and sdl.d

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/DerelictGL/derelict/opengl/gl.d

    r33 r38  
    193193 
    194194private HXModule hgl; 
     195private bit exeModuleInited = false;  
    195196 
    196197private void* getProc(char[] procname) 
     
    542543} 
    543544 
    544 private bit exeModuleInited = false;  
    545  
    546545/*! 
    547546* Loads the shared lib and core GL 1.1 functions. If the shared lib or any of 
  • trunk/DerelictPY/derelict/python/python.d

    r37 r38  
    1818 
    1919private HXModule hpy; 
     20private bit exeModuleInited = false;  
    2021 
    2122private void* getProc(char[] procname) 
     
    5051    c_sum = cast(pfc_sum)getProc("_Py_c_sum"); 
    5152    c_diff = cast(pfc_diff)getProc("_Py_c_diff"); 
    52     c_neg = cast(pfc_neg)getProc("_Py_c_neg); 
     53    c_neg = cast(pfc_neg)getProc("_Py_c_neg"); 
    5354    c_prod = cast(pfc_prod)getProc("_Py_c_prod"); 
    5455    c_quot = cast(pfc_quot)getProc("_Py_c_quot"); 
     
    5859    PyProperty_Type = cast(PyTypeObject*)getProc("PyProperty_Type"); 
    5960    PyDescr_NewMethod = cast(pfPyDescr_NewMethod)getProc("PyDescr_NewMethod"); 
    60     PyDescr_NewClassMethod = cast(pfPyDescr_NewMethod)getProc("PyDescr_NewMethod"); 
     61    PyDescr_NewClassMethod = cast(pfPyDescr_NewClassMethod)getProc("PyDescr_NewClassMethod"); 
    6162    PyDescr_NewMember = cast(pfPyDescr_NewMember)getProc("PyDescr_NewMember"); 
    6263    PyDescr_NewGetSet = cast(pfPyDescr_NewGetSet)getProc("PyDescr_NewGetSet"); 
     
    9697        hpy = ExeModule_Load("python23.dll"); 
    9798         
     99    if(ExeModule_Init() == -1) 
     100        throw new Exception("ExeModule initialization failed"); 
     101         
     102    exeModuleInited = true;  
     103         
    98104    load();  
    99 } 
    100  
    101 static this() 
    102 { 
    103     ExeModule_Init(); 
    104105} 
    105106 
     
    107108{ 
    108109    ExeModule_Release(hpy); 
    109     ExeModule_Uninit(); 
     110     
     111    if(exeModuleInited) 
     112        ExeModule_Uninit(); 
    110113} 
  • trunk/DerelictSDL/derelict/sdl/sdl.d

    r31 r38  
    4848 
    4949private HXModule hsdl; 
     50private bit exeModuleInited = false; 
    5051 
    5152private void* getProc(char[] procname) 
     
    5758} 
    5859 
    59 public void DerelictSDL_Load() 
     60private void load() 
    6061{ 
    61     if(hsdl !== null) 
    62         return; 
    63          
    64     version(Windows) 
    65         hsdl = ExeModule_Load("sdl.dll");    
    66      
    6762    // active.d 
    6863    SDL_GetAppState = cast(pfSDL_GetAppState)getProc("SDL_GetAppState"); 
     
    274269} 
    275270 
     271public void DerelictSDL_Load() 
     272{ 
     273    if(hsdl !== null) 
     274        return; 
     275         
     276    if(ExeModule_Init() == -1) 
     277        throw new Exception("ExeModule initialization failed"); 
     278         
     279    exeModuleInited = true;  
     280         
     281    version(Windows) 
     282        hsdl = ExeModule_Load("sdl.dll");    
     283     
     284    load(); 
     285} 
     286 
    276287static ~this() 
    277288{ 
    278289    ExeModule_Release(hsdl); 
     290     
     291    if(exeModuleInited) 
     292        ExeModule_Uninit(); 
    279293} 
    280294