Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[Android] Clean up function SupportsGLES3 in PrefsFragment.java a lit…
…tle bit.
  • Loading branch information
lioncash committed Aug 13, 2013
1 parent 2015484 commit debd5b4
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions Source/Android/src/org/dolphinemu/dolphinemu/PrefsFragment.java
Expand Up @@ -97,33 +97,35 @@ private EGLConfig chooseConfig() {
}
static public boolean SupportsGLES3()
{
String m_GLVersion;
String m_GLVendor;
String m_GLRenderer;

VersionCheck mbuffer = new VersionCheck();
m_GLVersion = mbuffer.getVersion();
m_GLVendor = mbuffer.getVendor();
m_GLRenderer = mbuffer.getRenderer();
String m_GLVersion = mbuffer.getVersion();
String m_GLVendor = mbuffer.getVendor();
String m_GLRenderer = mbuffer.getRenderer();

boolean mSupportsGLES3 = false;

if (m_GLVersion.contains("OpenGL ES 3.0") ||
m_GLVersion.equals("OpenGL ES 3.0")) // 3.0 support
// Check for OpenGL ES 3 support (General case).
if (m_GLVersion.contains("OpenGL ES 3.0") || m_GLVersion.equals("OpenGL ES 3.0"))
mSupportsGLES3 = true;

// Checking for OpenGL ES 3 support for certain Qualcomm devices.
if (!mSupportsGLES3 && m_GLVendor.equals("Qualcomm"))
{
if (m_GLRenderer.contains("Adreno (TM) 3"))
{
int mVStart, mVEnd = 0;
int mVStart = m_GLVersion.indexOf("V@") + 2;
int mVEnd = 0;
float mVersion;
mVStart = m_GLVersion.indexOf("V@") + 2;

for (int a = mVStart; a < m_GLVersion.length(); ++a)
{
if (m_GLVersion.charAt(a) == ' ')
{
mVEnd = a;
break;
}
}

mVersion = Float.parseFloat(m_GLVersion.substring(mVStart, mVEnd));

if (mVersion >= 14.0f)
Expand Down

0 comments on commit debd5b4

Please sign in to comment.