DEADSOFTWARE

Added support OpenGL ES 1.1 through nanoGL (have some bugs) and fix build for ARM
[d2df-sdl.git] / src / game / g_menu.pas
index ff57a392880a97a2b1bdb2514b6272240288b007..fca66beba93f4e99812a0570f864adb2b66ff58a 100644 (file)
@@ -42,11 +42,16 @@ var
 implementation
 
 uses
+{$IFDEF USE_NANOGL}
+  nanoGL,
+{$ELSE}
+  GL, GLExt,
+{$ENDIF}
   g_gui, g_textures, e_graphics, g_main, g_window, g_game, g_map,
   g_basic, g_console, g_sound, g_gfx, g_player, g_options, g_weapons,
   e_log, SysUtils, CONFIG, g_playermodel, DateUtils, sdl2,
   MAPDEF, Math, g_saveload,
-  e_texture, GL, GLExt, g_language,
+  e_texture, g_language,
   g_net, g_netmsg, g_netmaster, g_items, e_input,
   utils, wadreader;
 
@@ -107,7 +112,6 @@ var
   menu: TGUIMenu;
   i: Integer;
   ovs: Boolean;
-  v: Byte;
 begin
   menu := TGUIMenu(g_GUI_GetWindow('OptionsVideoMenu').GetControl('mOptionsVideoMenu'));
 
@@ -118,14 +122,7 @@ begin
 
   ovs := gVSync;
   gVSync := TGUISwitch(menu.GetControl('swVSync')).ItemIndex = 0;
-  {$IF not DEFINED(HEADLESS)}
-  if (ovs <> gVSync) then
-  begin
-    if (gVSync) then v := 1 else v := 0;
-    if (SDL_GL_SetSwapInterval(v) <> 0) then writeln('oops; can''t change vsync option, restart required')
-    else writeln('vsync changed');
-  end;
-  {$ENDIF}
+  if (ovs <> gVSync) then g_SetVSync(gVSync);
 
   gTextureFilter := TGUISwitch(menu.GetControl('swTextureFilter')).ItemIndex = 0;
   glLegacyNPOT := not (TGUISwitch(menu.GetControl('swLegacyNPOT')).ItemIndex = 0);