88#pragma comment(lib, "xrEngine.lib")
99#pragma comment(lib, "xrScriptEngine.lib")
1010
11+ extern " C" void XR_EXPORT SetupEnv ()
12+ {
13+ GlobalEnv.Render = &RImplementation;
14+ GlobalEnv.RenderFactory = &RenderFactoryImpl;
15+ GlobalEnv.DU = &DUImpl;
16+ GlobalEnv.UIRender = &UIRenderImpl;
17+ #ifdef DEBUG
18+ GlobalEnv.DRender = &DebugRenderImpl;
19+ #endif
20+ xrRender_initconsole ();
21+ }
22+
1123BOOL APIENTRY DllMain ( HANDLE hModule,
1224 DWORD ul_reason_for_call,
1325 LPVOID lpReserved
@@ -16,18 +28,8 @@ BOOL APIENTRY DllMain( HANDLE hModule,
1628 switch (ul_reason_for_call)
1729 {
1830 case DLL_PROCESS_ATTACH :
19- // Can't call CreateDXGIFactory from DllMain
20- // if (!xrRender_test_hw()) return FALSE;
21- GlobalEnv.Render = &RImplementation;
22- GlobalEnv.RenderFactory = &RenderFactoryImpl;
23- GlobalEnv.DU = &DUImpl;
24- // GlobalEnv.vid_mode_token = inited by HW;
25- GlobalEnv.UIRender = &UIRenderImpl;
26- #ifdef DEBUG
27- GlobalEnv.DRender = &DebugRenderImpl;
28- #endif // DEBUG
29- xrRender_initconsole ();
30- break ;
31+ SetupEnv ();
32+ break ;
3133 case DLL_THREAD_ATTACH :
3234 case DLL_THREAD_DETACH :
3335 case DLL_PROCESS_DETACH :
0 commit comments