777 |
777 |
778 // TODO: this function creates an opengles1.1 context |
778 // TODO: this function creates an opengles1.1 context |
779 // un-comment below and add proper logic to support opengles2.0 |
779 // un-comment below and add proper logic to support opengles2.0 |
780 //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); |
780 //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2); |
781 //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); |
781 //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0); |
782 if SDLGLcontext = nil then |
782 {if SDLGLcontext = nil then |
783 SDLGLcontext:= SDL_GL_CreateContext(SDLwindow); |
783 SDLGLcontext:= SDL_GL_CreateContext(SDLwindow); |
784 if SDLCheck(SDLGLcontext <> nil, 'SDLGLcontext', true) then exit; |
784 if SDLCheck(SDLGLcontext <> nil, 'SDLGLcontext', true) then exit; |
785 SDL_GL_SetSwapInterval(1); |
785 SDL_GL_SetSwapInterval(1);} |
786 |
786 |
787 RendererSetup(); |
787 RendererSetup(); |
788 |
788 |
789 // gl2 init/matrix code was here, but removed |
789 // gl2 init/matrix code was here, but removed |
790 end; |
790 end; |
791 |
791 |
792 //////////////////////////////////////////////////////////////////////////////// |
792 //////////////////////////////////////////////////////////////////////////////// |
793 procedure AddProgress; |
793 procedure AddProgress; |
794 var r: TSDL_Rect; |
794 var r: TSDL_Rect; |
795 texsurf: PSDL_Surface; |
795 texsurf: PSDL_Surface; |
796 begin |
796 begin |
797 if cOnlyStats then exit; |
797 if cOnlyStats then exit; (* |
798 if Step = 0 then |
798 if Step = 0 then |
799 begin |
799 begin |
800 WriteToConsole(msgLoading + 'progress sprite: '); |
800 WriteToConsole(msgLoading + 'progress sprite: '); |
801 texsurf:= LoadDataImage(ptGraphics, 'Progress', ifCritical or ifColorKey); |
801 texsurf:= LoadDataImage(ptGraphics, 'Progress', ifCritical or ifColorKey); |
802 |
802 |
830 DrawTextureFromRect( -squaresize div 2, (cScreenHeight - squaresize) shr 1, @r, ProgrTex); |
830 DrawTextureFromRect( -squaresize div 2, (cScreenHeight - squaresize) shr 1, @r, ProgrTex); |
831 DrawTexture( -LoadingText^.w div 2, (cScreenHeight - LoadingText^.h) shr 1 - (squaresize div 2) - (LoadingText^.h div 2) - 8, LoadingText); |
831 DrawTexture( -LoadingText^.w div 2, (cScreenHeight - LoadingText^.h) shr 1 - (squaresize div 2) - (LoadingText^.h div 2) - 8, LoadingText); |
832 |
832 |
833 SwapBuffers; |
833 SwapBuffers; |
834 |
834 |
835 inc(Step); |
835 inc(Step); *) |
836 end; |
836 end; |
837 |
837 |
838 procedure FinishProgress; |
838 procedure FinishProgress; |
839 begin |
839 begin (* |
840 {$IFNDEF PAS2C} |
840 {$IFNDEF PAS2C} |
841 with mobileRecord do |
841 with mobileRecord do |
842 if GameLoaded <> nil then |
842 if GameLoaded <> nil then |
843 GameLoaded(); |
843 GameLoaded(); |
844 {$ENDIF} |
844 {$ENDIF} |
845 WriteLnToConsole('Freeing progress textures... '); |
845 WriteLnToConsole('Freeing progress textures... '); |
846 FreeAndNilTexture(ProgrTex); |
846 FreeAndNilTexture(ProgrTex); |
847 FreeAndNilTexture(LoadingText); |
847 FreeAndNilTexture(LoadingText); |
848 Step:= 0 |
848 Step:= 0 *) |
849 end; |
849 end; |
850 |
850 |
851 function RenderHelpWindow(caption, subcaption, description, extra: ansistring; extracolor: LongInt; iconsurf: PSDL_Surface; iconrect: PSDL_Rect): PTexture; |
851 function RenderHelpWindow(caption, subcaption, description, extra: ansistring; extracolor: LongInt; iconsurf: PSDL_Surface; iconrect: PSDL_Rect): PTexture; |
852 var tmpsurf: PSDL_SURFACE; |
852 var tmpsurf: PSDL_SURFACE; |
853 w, h, i, j: LongInt; |
853 w, h, i, j: LongInt; |
1082 else |
1082 else |
1083 begin |
1083 begin |
1084 cScreenWidth:= cWindowedWidth; |
1084 cScreenWidth:= cWindowedWidth; |
1085 cScreenHeight:= cWindowedHeight; |
1085 cScreenHeight:= cWindowedHeight; |
1086 end; |
1086 end; |
1087 |
1087 { |
1088 AddFileLog('Preparing to change video parameters...'); |
1088 AddFileLog('Preparing to change video parameters...'); |
1089 if SDLwindow = nil then |
1089 if SDLwindow = nil then |
1090 begin |
1090 begin |
1091 // set window title |
1091 // set window title |
1092 WriteToConsole('Init SDL_image... '); |
1092 WriteToConsole('Init SDL_image... '); |