Project

General

Profile

« Previous | Next » 

Revision 3c26029b

Added by Leszek Koltunski over 1 year ago

Decouple (to a large degree) the OpenGL Library from Android.

View differences:

src/main/java/org/distorted/library/main/DistortedLibrary.java
221 221
  public interface LibraryUser
222 222
    {
223 223
    void distortedException(Exception ex);
224
    int openGlVersion();
225 224
    InputStream localFile(int fileID);
226 225
    void logMessage(String message);
227 226
    }
......
971 970
      }
972 971
    }
973 972

  
973
///////////////////////////////////////////////////////////////////////////////////////////////////
974

  
975
  private static int getVersion()
976
    {
977
    int[] major = new int[1];
978
    int[] minor = new int[1];
979
    GLES30.glGetIntegerv(GLES30.GL_MAJOR_VERSION, major, 0);
980
    GLES30.glGetIntegerv(GLES30.GL_MINOR_VERSION, minor, 0);
981
    return major[0] * 100 + minor[0] * 10;
982
    }
983

  
974 984
///////////////////////////////////////////////////////////////////////////////////////////////////
975 985
/**
976 986
 * Not an external API
......
1021 1031
  public static void onSurfaceCreated(final LibraryUser user, int queueSize)
1022 1032
    {
1023 1033
    mUser = user;
1024
    int version = mUser.openGlVersion();
1034
    int version = getVersion();
1025 1035
    int major = version/100;
1026 1036
    int minor = ((version/10)%10);
1027 1037

  

Also available in: Unified diff