508 |
508 |
509 procedure SetupOpenGL; |
509 procedure SetupOpenGL; |
510 {$IFNDEF IPHONEOS} |
510 {$IFNDEF IPHONEOS} |
511 var vendor: shortstring; |
511 var vendor: shortstring; |
512 {$IFDEF DARWIN} |
512 {$IFDEF DARWIN} |
513 one: LongInt; |
513 const one = 1; |
514 {$ENDIF} |
514 {$ENDIF} |
515 {$ENDIF} |
515 {$ENDIF} |
516 begin |
516 begin |
517 |
517 |
518 {$IFDEF IPHONEOS} |
518 {$IFDEF IPHONEOS} |
519 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0); // no double buffering |
519 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 0); |
520 SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 1); |
520 SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 1); |
521 {$ELSE} |
521 {$ELSE} |
522 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); |
522 SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1); |
523 vendor:= LowerCase(shortstring(pchar(glGetString(GL_VENDOR)))); |
523 vendor:= LowerCase(shortstring(pchar(glGetString(GL_VENDOR)))); |
524 {$IFNDEF SDL13} |
524 {$IFNDEF SDL13} |
525 // this attribute is default in 1.3 and must be enabled in MacOSX |
525 // this attribute is default in 1.3 and must be enabled in MacOSX |
526 if (cReducedQuality and rqDesyncVBlank) <> 0 then |
526 SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, ((cReducedQuality and rqDesyncVBlank) = 0)) |
527 SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0) |
527 |
528 else |
|
529 SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); |
|
530 {$IFDEF DARWIN} |
528 {$IFDEF DARWIN} |
531 // fixes vsync in Snow Leopard |
529 // fixes vsync in Snow Leopard |
532 one:= 1; |
|
533 CGLSetParameter(CGLGetCurrentContext(), 222, @one); |
530 CGLSetParameter(CGLGetCurrentContext(), 222, @one); |
534 {$ENDIF} |
531 {$ENDIF} |
535 {$ENDIF} |
532 {$ENDIF} |
536 {$ENDIF} |
533 {$ENDIF} |
537 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0); // no depth buffer |
534 SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0); // no depth buffer |