From faf4c13bf41a17ce920a2194fc396f8bf7b44331 Mon Sep 17 00:00:00 2001 From: tobigun Date: Wed, 2 Jul 2008 07:50:39 +0000 Subject: Audio/Video engine update: - lyrics<->audio synchronisation (TSyncSource) - better resampling (optional support for libsamplerate) - cleaner termination of audio/video streams/devices - improved decoders and decoder infrastructure - many other improvements/cleanups Currently just for testing (not enabled by default): - Background music - Voice-Passthrough (hear what you sing) - Video VSync git-svn-id: svn://svn.code.sf.net/p/ultrastardx/svn/trunk@1157 b956fd51-792f-4845-bead-9b4dfca2ff2c --- Game/Code/Classes/UGraphic.pas | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'Game/Code/Classes/UGraphic.pas') diff --git a/Game/Code/Classes/UGraphic.pas b/Game/Code/Classes/UGraphic.pas index cc876b65..ae145955 100644 --- a/Game/Code/Classes/UGraphic.pas +++ b/Game/Code/Classes/UGraphic.pas @@ -18,6 +18,7 @@ uses SysUtils, ULyrics, UImage, + UMusic, UScreenLoading, UScreenWelcome, UScreenMain, @@ -454,13 +455,15 @@ begin Log.LogBenchmark('--> Loading Fonts', 2); } + // Note: do not initialize video modules earlier. They might depend on some + // SDL video functions or OpenGL extensions initialized in InitializeScreen() + InitializeVideo(); + //Log.BenchmarkStart(2); Log.LogStatus('TDisplay.Create', 'UGraphic.Initialize3D'); Display := TDisplay.Create; - Log.LogStatus('SDL_EnableUnicode', 'UGraphic.Initialize3D'); - SDL_EnableUnicode(1); //Log.BenchmarkEnd(2); Log.LogBenchmark('====> Creating Display', 2); //Log.LogStatus('Loading Screens', 'Initialize3D'); @@ -551,9 +554,14 @@ begin SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, 5); SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 5); SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 5); - SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 16); // Z-Buffer depth SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); + // VSYNC works for windows only at the moment. SDL_GL_SWAP_CONTROL under + // linux uses GLX_MESA_swap_control which is not supported by nvidea cards. + // Maybe use glXSwapIntervalSGI(1) from the GLX_SGI_swap_control extension instead. + //SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); // VSYNC (currently Windows only) + // If there is a resolution in Parameters, use it, else use the Ini value I := Params.Resolution; if (I <> -1) then -- cgit v1.2.3