@@ -55,10 +55,24 @@ bool is_enough_address_space_available()
5555
5656void CEngineAPI::InitializeNotDedicated ()
5757{
58+ LPCSTR gl_name = " xrRender_GL" ;
5859 LPCSTR r2_name = " xrRender_R2" ;
5960 LPCSTR r3_name = " xrRender_R3" ;
6061 LPCSTR r4_name = " xrRender_R4" ;
6162
63+ if (psDeviceFlags.test (rsGL))
64+ {
65+ // try to initialize GL
66+ Log (" Loading DLL:" , gl_name);
67+ hRender = LoadLibrary (gl_name);
68+ if (0 == hRender)
69+ {
70+ // try to load R1
71+ Msg (" ! ...Failed - incompatible hardware." );
72+ psDeviceFlags.set (rsR2, TRUE );
73+ }
74+ }
75+
6276 if (psDeviceFlags.test (rsR4))
6377 {
6478 // try to initialize R4
@@ -192,17 +206,20 @@ void CEngineAPI::CreateRendererList()
192206#else
193207 // TODO: ask renderers if they are supported!
194208 if (vid_quality_token != NULL ) return ;
209+ bool bSupports_gl = false ;
195210 bool bSupports_r2 = false ;
196211 bool bSupports_r2_5 = false ;
197212 bool bSupports_r3 = false ;
198213 bool bSupports_r4 = false ;
199214
215+ LPCSTR gl_name = " xrRender_GL" ;
200216 LPCSTR r2_name = " xrRender_R2" ;
201217 LPCSTR r3_name = " xrRender_R3" ;
202218 LPCSTR r4_name = " xrRender_R4" ;
203219
204220 if (strstr (Core.Params , " -perfhud_hack" ))
205221 {
222+ bSupports_gl = true ;
206223 bSupports_r2 = true ;
207224 bSupports_r2_5 = true ;
208225 bSupports_r3 = true ;
@@ -251,6 +268,15 @@ void CEngineAPI::CreateRendererList()
251268 bSupports_r4 = test_dx11_rendering ();
252269 FreeLibrary (hRender);
253270 }
271+
272+ // try to initialize GL
273+ Log (" Loading DLL:" , gl_name);
274+ hRender = LoadLibrary (gl_name);
275+ if (hRender)
276+ {
277+ bSupports_gl = true ;
278+ FreeLibrary (hRender);
279+ }
254280 }
255281
256282 hRender = 0 ;
@@ -310,6 +336,10 @@ void CEngineAPI::CreateRendererList()
310336 if (bBreakLoop) break ;
311337 _tmp.back () = xr_strdup (val);
312338 }
339+
340+ if (bSupports_gl)
341+ _tmp.push_back (" renderer_gl" );
342+
313343 u32 _cnt = _tmp.size () + 1 ;
314344 vid_quality_token = xr_alloc<xr_token>(_cnt);
315345
0 commit comments