1414import java .nio .IntBuffer ;
1515import java .nio .ShortBuffer ;
1616
17- import org .lwjgl .opengles .GLES ;
1817import org .lwjgl .opengles .GLES20 ;
1918import org .lwjgl .opengles .GLES30 ;
2019import org .lwjgl .opengles .GLES31 ;
21- import org .lwjgl .opengles .EXTDisjointTimerQuery ;
2220
2321
2422/**
@@ -35,6 +33,7 @@ public class LwjglGLES extends LwjglRender implements GL, GL2, GLES_30, GLExt, G
3533 public void resetStats () {
3634 }
3735
36+
3837 public static void checkLimit (Buffer buffer ) {
3938 if (buffer == null ) return ;
4039 if (buffer .limit () == 0 ) {
@@ -539,25 +538,11 @@ public void glViewport(int x, int y, int width, int height) {
539538
540539 @ Override
541540 public void glBeginQuery (int target , int query ) {
542- if (target == GL .GL_TIME_ELAPSED ) {
543- if (!GLES .getCapabilities ().GL_EXT_disjoint_timer_query ) {
544- throw new UnsupportedOperationException ("GL_TIME_ELAPSED requires GL_EXT_disjoint_timer_query" );
545- }
546- EXTDisjointTimerQuery .glBeginQueryEXT (target , query );
547- return ;
548- }
549541 GLES30 .glBeginQuery (target , query );
550542 }
551543
552544 @ Override
553545 public void glEndQuery (int target ) {
554- if (target == GL .GL_TIME_ELAPSED ) {
555- if (!GLES .getCapabilities ().GL_EXT_disjoint_timer_query ) {
556- throw new UnsupportedOperationException ("GL_TIME_ELAPSED requires GL_EXT_disjoint_timer_query" );
557- }
558- EXTDisjointTimerQuery .glEndQueryEXT (target );
559- return ;
560- }
561546 GLES30 .glEndQuery (target );
562547 }
563548
@@ -567,30 +552,22 @@ public void glGenQueries(int num, IntBuffer buff) {
567552 int oldLimit = buff .limit ();
568553 int pos = buff .position ();
569554 buff .limit (pos + num );
570- if (GLES .getCapabilities ().GL_EXT_disjoint_timer_query ) {
571- EXTDisjointTimerQuery .glGenQueriesEXT (buff );
572- } else {
573- GLES30 .glGenQueries (buff );
574- }
555+ GLES30 .glGenQueries (buff );
575556 buff .limit (oldLimit );
576557 }
577558
578559 @ Override
579560 public int glGetQueryObjectiv (int query , int pname ) {
580- if (GLES .getCapabilities ().GL_EXT_disjoint_timer_query ) {
581- return EXTDisjointTimerQuery .glGetQueryObjectiEXT (query , pname );
582- }
583561 IntBuffer b = (IntBuffer ) tmpBuff .clear ();
584562 GLES30 .glGetQueryObjectuiv (query , pname , b );
585563 return b .get (0 );
586564 }
587565
588566 @ Override
589567 public long glGetQueryObjectui64 (int query , int pname ) {
590- if (!GLES .getCapabilities ().GL_EXT_disjoint_timer_query ) {
591- throw new UnsupportedOperationException ("64-bit query results require GL_EXT_disjoint_timer_query" );
592- }
593- return EXTDisjointTimerQuery .glGetQueryObjectui64EXT (query , pname );
568+ IntBuffer b = (IntBuffer ) tmpBuff .clear ();
569+ GLES30 .glGetQueryObjectuiv (query , pname , b );
570+ return b .get (0 ) & 0xFFFFFFFFL ;
594571 }
595572
596573 @ Override
0 commit comments