hedgewars/uRender.pas
changeset 11151 5c40c65b619d
parent 11046 47a8c19ecb60
parent 11086 95f97c4d154c
child 11159 48190da6af61
equal deleted inserted replaced
11077:1fb80cd8ba7b 11151:5c40c65b619d
   358 end;
   358 end;
   359 {$ENDIF}
   359 {$ENDIF}
   360 
   360 
   361 function glLoadExtension(extension : shortstring) : boolean;
   361 function glLoadExtension(extension : shortstring) : boolean;
   362 begin
   362 begin
       
   363 (*
   363 //TODO: pas2c does not handle {$IF (GLunit = gles11) OR DEFINED(PAS2C)}
   364 //TODO: pas2c does not handle {$IF (GLunit = gles11) OR DEFINED(PAS2C)}
   364 {$IFNDEF PAS2C}
   365 {$IFNDEF PAS2C}
   365 {$IF GLunit = gles11}
   366 {$IF GLunit = gles11}
   366     // FreePascal doesnt come with OpenGL ES 1.1 Extension headers
   367     // FreePascal doesnt come with OpenGL ES 1.1 Extension headers
   367     extension:= extension; // avoid hint
   368     extension:= extension; // avoid hint
   376 {$ENDIF}
   377 {$ENDIF}
   377 
   378 
   378 {$ELSE} // pas2c part
   379 {$ELSE} // pas2c part
   379     glLoadExtension:= false;
   380     glLoadExtension:= false;
   380 {$ENDIF}
   381 {$ENDIF}
       
   382 *)
       
   383  
       
   384  extension:= extension; // avoid hint
       
   385  glLoadExtension:= false;
       
   386  AddFileLog('OpenGL - "' + extension + '" skipped')
   381 end;
   387 end;
   382 
   388 
   383 {$IFDEF USE_S3D_RENDERING OR USE_VIDEO_RECORDING}
   389 {$IFDEF USE_S3D_RENDERING OR USE_VIDEO_RECORDING}
   384 procedure CreateFramebuffer(var frame, depth, tex: GLuint);
   390 procedure CreateFramebuffer(var frame, depth, tex: GLuint);
   385 begin
   391 begin
   426 var AuxBufNum: LongInt = 0;
   432 var AuxBufNum: LongInt = 0;
   427     tmpstr: ansistring;
   433     tmpstr: ansistring;
   428     tmpint: LongInt;
   434     tmpint: LongInt;
   429     tmpn: LongInt;
   435     tmpn: LongInt;
   430 begin
   436 begin
   431 {$IFDEF MOBILE}
       
   432     // TODO: this function creates an opengles1.1 context
       
   433     // un-comment below and add proper logic to support opengles2.0
       
   434     //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, 2);
       
   435     //SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, 0);
       
   436     if SDLGLcontext = nil then
       
   437         SDLGLcontext:= SDL_GL_CreateContext(SDLwindow);
       
   438     SDLTry(SDLGLcontext <> nil, true);
       
   439     SDL_GL_SetSwapInterval(1);
       
   440 {$ENDIF}
       
   441 
       
   442     // suppress hint/warning
   437     // suppress hint/warning
   443     AuxBufNum:= AuxBufNum;
   438     AuxBufNum:= AuxBufNum;
   444 
   439 
   445     // get the max (h and v) size for textures that the gpu can support
   440     // get the max (h and v) size for textures that the gpu can support
   446     glGetIntegerv(GL_MAX_TEXTURE_SIZE, @MaxTextureSize);
   441     glGetIntegerv(GL_MAX_TEXTURE_SIZE, @MaxTextureSize);