equal
deleted
inserted
replaced
968 LoadImage:= tmpsurf //Result |
968 LoadImage:= tmpsurf //Result |
969 end; |
969 end; |
970 |
970 |
971 function glLoadExtension(extension : string) : boolean; |
971 function glLoadExtension(extension : string) : boolean; |
972 begin |
972 begin |
|
973 {$IFNDEF IPHONEOS} |
973 glLoadExtension:= glext_LoadExtension(extension); |
974 glLoadExtension:= glext_LoadExtension(extension); |
|
975 {$ELSE} |
|
976 glLoadExtension:= false; |
|
977 {$ENDIF} |
974 if not glLoadExtension then |
978 if not glLoadExtension then |
975 WriteLnToConsole('OpenGL: "' + extension + '" failed to load') |
979 WriteLnToConsole('OpenGL: "' + extension + '" failed to load') |
976 else |
980 else |
977 WriteLnToConsole('OpenGL: "' + extension + '" loaded'); |
981 WriteLnToConsole('OpenGL: "' + extension + '" loaded'); |
978 end; |
982 end; |
982 glGetIntegerv(GL_MAX_TEXTURE_SIZE, @MaxTextureSize); |
986 glGetIntegerv(GL_MAX_TEXTURE_SIZE, @MaxTextureSize); |
983 {$IFDEF DEBUGFILE} |
987 {$IFDEF DEBUGFILE} |
984 AddFileLog('GL_MAX_TEXTURE_SIZE: ' + inttostr(MaxTextureSize)); |
988 AddFileLog('GL_MAX_TEXTURE_SIZE: ' + inttostr(MaxTextureSize)); |
985 {$ENDIF} |
989 {$ENDIF} |
986 |
990 |
987 {$IFNDEF GLES11} |
991 {$IFNDEF IPHONEOS} |
988 SupportNPOTT:= glLoadExtension('GL_ARB_texture_non_power_of_two'); |
992 SupportNPOTT:= glLoadExtension('GL_ARB_texture_non_power_of_two'); |
989 {$ENDIF} |
993 {$ENDIF} |
990 |
994 |
991 // set view port to whole window |
995 // set view port to whole window |
992 glViewport(0, 0, cScreenWidth, cScreenHeight); |
996 glViewport(0, 0, cScreenWidth, cScreenHeight); |
1002 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
1006 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
1003 end; |
1007 end; |
1004 |
1008 |
1005 procedure SetScale(f: GLfloat); |
1009 procedure SetScale(f: GLfloat); |
1006 begin |
1010 begin |
1007 // leave immediately if scale factor didn't change |
1011 // leave immediately if scale factor did not change |
1008 if f = cScaleFactor then exit; |
1012 if f = cScaleFactor then exit; |
1009 |
1013 |
1010 if f = 2.0 then // default scaling |
1014 if f = 2.0 then // default scaling |
1011 glPopMatrix // "return" to default scaling |
1015 glPopMatrix // "return" to default scaling |
1012 else // other scaling |
1016 else // other scaling |