@@ -228,9 +228,6 @@ TVertexArray = class(TInterfacedObject, IVertexArray)
228
228
glGenVertexArrays: procedure(n: GLsizei; arrays: PGLuint); { $IFDEF MSWINDOWS} stdcall{ $ELSE} cdecl{ $ENDIF} ;
229
229
glBindVertexArray: procedure(array_: GLuint); { $IFDEF MSWINDOWS} stdcall{ $ELSE} cdecl{ $ENDIF} ;
230
230
glDeleteVertexArrays: procedure(n: GLsizei; { $IFDEF MSWINDOWS} const { $ENDIF} arrays: PGLuint); { $IFDEF MSWINDOWS} stdcall{ $ELSE} cdecl{ $ENDIF} ;
231
- { $IFDEF ANDROID}
232
- FLibHandle: THandle;
233
- { $ENDIF}
234
231
private
235
232
FVertexBuffer: GLuint;
236
233
FIndexBuffer: GLuint;
@@ -252,7 +249,6 @@ TVertexArray = class(TInterfacedObject, IVertexArray)
252
249
procedure EndRender ;
253
250
public
254
251
class constructor Create;
255
- class destructor Destroy;
256
252
{ $ENDREGION 'Internal Declarations'}
257
253
public
258
254
{ Creates a vertex array.
@@ -745,8 +741,6 @@ implementation
745
741
System.IOUtils,
746
742
{ $IF Defined(MACOS)}
747
743
Macapi.CoreFoundation, // For inlining to work
748
- { $ELSEIF Defined(ANDROID)}
749
- Posix.Dlfcn,
750
744
{ $ENDIF}
751
745
Neslib.Stb.Image,
752
746
Sample.Platform;
@@ -1046,14 +1040,6 @@ constructor TVertexArray.Create(const ALayout: TVertexLayout; const AVertices;
1046
1040
Create(ALayout, AVertices, ASizeOfVertices, AIndices[0 ], Length(AIndices));
1047
1041
end ;
1048
1042
1049
- class destructor TVertexArray.Destroy;
1050
- begin
1051
- { $IFDEF ANDROID}
1052
- if (FLibHandle <> 0 ) then
1053
- dlClose(FLibHandle);
1054
- { $ENDIF}
1055
- end ;
1056
-
1057
1043
constructor TVertexArray.Create(const ALayout: TVertexLayout; const AVertices;
1058
1044
const ASizeOfVertices: Integer; const AIndices;
1059
1045
const AIndexCount: Integer);
@@ -1174,18 +1160,15 @@ class procedure TVertexArray.Initialize;
1174
1160
glBindVertexArray := glBindVertexArrayAPPLE;
1175
1161
glDeleteVertexArrays := glDeleteVertexArraysAPPLE;
1176
1162
{ $ELSEIF Defined(ANDROID)}
1177
- FSupportsVAO := glIsExtensionSupported(' GL_OES_vertex_array_object' );
1178
- if (FSupportsVAO) then
1179
- begin
1180
- FLibHandle := dlopen(AndroidGles2Lib, RTLD_LAZY);
1181
- FSupportsVAO := (FLibHandle <> 0 );
1182
- if (FSupportsVAO) then
1183
- begin
1184
- glGenVertexArrays := dlsym(FLibHandle, ' glGenVertexArraysOES' );
1185
- glBindVertexArray := dlsym(FLibHandle, ' glBindVertexArrayOES' );
1186
- glDeleteVertexArrays := dlsym(FLibHandle, ' glDeleteVertexArraysOES' );
1187
- end ;
1188
- end ;
1163
+ { Technically, a lot of Android devices support VAO's if the extension
1164
+ GL_OES_vertex_array_object is available. However, on some Android devices,
1165
+ this extension is available, but it does not work. Calling a VAO API then
1166
+ results in a log message: "E/libEGL: called unimplemented OpenGL ES API."
1167
+ (See http://blog.linderdaum.com/2013/10/19/vao/).
1168
+ So we cannot reliably use VAO's on Android.
1169
+ (NOTE: As of OpenGL ES 3.0, VAO are part of the core specification, but we
1170
+ target OpenGL ES 2.0) }
1171
+ FSupportsVAO := False;
1189
1172
{ $ENDIF}
1190
1173
1191
1174
FSupportsVAO := FSupportsVAO and Assigned(glGenVertexArrays)
0 commit comments