hedgewars/uStore.pas
changeset 7634 ca14ec44b223
parent 7565 00568d3054d0
child 7635 7a8b2f04c7dd
equal deleted inserted replaced
7633:d4251e519062 7634:ca14ec44b223
    19 {$INCLUDE "options.inc"}
    19 {$INCLUDE "options.inc"}
    20 {$IF GLunit = GL}{$DEFINE GLunit:=GL,GLext}{$ENDIF}
    20 {$IF GLunit = GL}{$DEFINE GLunit:=GL,GLext}{$ENDIF}
    21 
    21 
    22 unit uStore;
    22 unit uStore;
    23 interface
    23 interface
    24 uses SysUtils, uConsts, SDLh, GLunit, uTypes, uLandTexture, uCaptions, uChat;
    24 uses StrUtils, SysUtils, uConsts, SDLh, GLunit, uTypes, uLandTexture, uCaptions, uChat;
    25 
    25 
    26 procedure initModule;
    26 procedure initModule;
    27 procedure freeModule;
    27 procedure freeModule;
    28 
    28 
    29 procedure StoreLoad(reload: boolean);
    29 procedure StoreLoad(reload: boolean);
   686 
   686 
   687 procedure SetupOpenGL;
   687 procedure SetupOpenGL;
   688 //var vendor: shortstring = '';
   688 //var vendor: shortstring = '';
   689 var buf: array[byte] of char;
   689 var buf: array[byte] of char;
   690     AuxBufNum: LongInt;
   690     AuxBufNum: LongInt;
       
   691     tmpstr: AnsiString;
       
   692     tmpint: LongInt;
       
   693     tmpn: LongInt;
   691 begin
   694 begin
   692     buf[0]:= char(0); // avoid compiler hint
   695     buf[0]:= char(0); // avoid compiler hint
   693     AddFileLog('Setting up OpenGL (using driver: ' + shortstring(SDL_VideoDriverName(buf, sizeof(buf))) + ')');
   696     AddFileLog('Setting up OpenGL (using driver: ' + shortstring(SDL_VideoDriverName(buf, sizeof(buf))) + ')');
   694 
   697 
   695 {$IFDEF SDL13}
   698 {$IFDEF SDL13}
   740     AddFileLog('  |----- Vendor: ' + shortstring(pchar(glGetString(GL_VENDOR))));
   743     AddFileLog('  |----- Vendor: ' + shortstring(pchar(glGetString(GL_VENDOR))));
   741     AddFileLog('  |----- Version: ' + shortstring(pchar(glGetString(GL_VERSION))));
   744     AddFileLog('  |----- Version: ' + shortstring(pchar(glGetString(GL_VERSION))));
   742     AddFileLog('  |----- Texture Size: ' + inttostr(MaxTextureSize));
   745     AddFileLog('  |----- Texture Size: ' + inttostr(MaxTextureSize));
   743     AddFileLog('  |----- Number of auxilary buffers: ' + inttostr(AuxBufNum));
   746     AddFileLog('  |----- Number of auxilary buffers: ' + inttostr(AuxBufNum));
   744     AddFileLog('  \----- Extensions: ');
   747     AddFileLog('  \----- Extensions: ');
   745     AddFileLogRaw(glGetString(GL_EXTENSIONS));
   748     // fetch extentions and store them in string
       
   749     tmpstr := StrPas(PChar(glGetString(GL_EXTENSIONS)));
       
   750     tmpn := WordCount(tmpstr, [' ']);
       
   751     tmpint := 1;
       
   752 
       
   753     repeat
       
   754     begin
       
   755         // print up to 3 extentions per row
       
   756         // ExtractWord will return empty string if index out of range
       
   757         AddFileLog(TrimRight(
       
   758             ExtractWord(tmpint, tmpstr, [' ']) + ' ' +
       
   759             ExtractWord(tmpint+1, tmpstr, [' ']) + ' ' +
       
   760             ExtractWord(tmpint+2, tmpstr, [' '])
       
   761         ));
       
   762         tmpint := tmpint + 3;
       
   763     end;
       
   764     until (tmpint > tmpn);
       
   765     // doesn't seem to print >256 chars, also missing explicit PChar cast
       
   766     // AddFileLogRaw(glGetString(GL_EXTENSIONS));
   746     AddFileLog('');
   767     AddFileLog('');
   747     //TODO: slipt Extensions line into multiple lines
       
   748 
   768 
   749     defaultFrame:= 0;
   769     defaultFrame:= 0;
   750 {$IFDEF USE_VIDEO_RECORDING}
   770 {$IFDEF USE_VIDEO_RECORDING}
   751     if GameType = gmtRecord then
   771     if GameType = gmtRecord then
   752     begin
   772     begin