mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-02-10 14:39:01 +01:00
[Android] In the About pane, show if the phone supports OpenGL ES 3. Makes it less confusing for users.
This commit is contained in:
parent
023922cd5b
commit
ee26564c65
@ -40,6 +40,7 @@ public class AboutFragment extends Fragment {
|
|||||||
int a = 0;
|
int a = 0;
|
||||||
|
|
||||||
Input.add(a++, new GameListItem(m_activity, "Build Revision", NativeLibrary.GetVersionString(), "", true));
|
Input.add(a++, new GameListItem(m_activity, "Build Revision", NativeLibrary.GetVersionString(), "", true));
|
||||||
|
Input.add(a++, new GameListItem(m_activity, "Supports OpenGL ES 3", PrefsFragment.SupportsGLES3() ? "Yes" : "No", "", true));
|
||||||
adapter = new FolderBrowserAdapter(m_activity, R.layout.folderbrowser, Input);
|
adapter = new FolderBrowserAdapter(m_activity, R.layout.folderbrowser, Input);
|
||||||
mMainList.setAdapter(adapter);
|
mMainList.setAdapter(adapter);
|
||||||
|
|
||||||
|
@ -18,12 +18,7 @@ import javax.microedition.khronos.opengles.GL10;
|
|||||||
public class PrefsFragment extends PreferenceFragment {
|
public class PrefsFragment extends PreferenceFragment {
|
||||||
private Activity m_activity;
|
private Activity m_activity;
|
||||||
|
|
||||||
private String m_GLVersion;
|
static public class VersionCheck {
|
||||||
private String m_GLVendor;
|
|
||||||
private String m_GLRenderer;
|
|
||||||
|
|
||||||
|
|
||||||
public class VersionCheck {
|
|
||||||
EGL10 mEGL;
|
EGL10 mEGL;
|
||||||
EGLDisplay mEGLDisplay;
|
EGLDisplay mEGLDisplay;
|
||||||
EGLConfig[] mEGLConfigs;
|
EGLConfig[] mEGLConfigs;
|
||||||
@ -93,7 +88,42 @@ public class PrefsFragment extends PreferenceFragment {
|
|||||||
return mEGLConfigs[0]; // Best match is probably the first configuration
|
return mEGLConfigs[0]; // Best match is probably the first configuration
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
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();
|
||||||
|
|
||||||
|
boolean mSupportsGLES3 = false;
|
||||||
|
|
||||||
|
if (m_GLVersion.contains("OpenGL ES 3.0")) // 3.0 support
|
||||||
|
mSupportsGLES3 = true;
|
||||||
|
if (!mSupportsGLES3 && m_GLVendor.equals("Qualcomm"))
|
||||||
|
{
|
||||||
|
if (m_GLRenderer.contains("Adreno (TM) 3"))
|
||||||
|
{
|
||||||
|
int mVStart, 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)
|
||||||
|
mSupportsGLES3 = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return mSupportsGLES3;
|
||||||
|
}
|
||||||
@Override
|
@Override
|
||||||
public void onCreate(Bundle savedInstanceState) {
|
public void onCreate(Bundle savedInstanceState) {
|
||||||
super.onCreate(savedInstanceState);
|
super.onCreate(savedInstanceState);
|
||||||
@ -138,34 +168,8 @@ public class PrefsFragment extends PreferenceFragment {
|
|||||||
|
|
||||||
PreferenceCategory mCategory = (PreferenceCategory) findPreference("cpuprefcat");
|
PreferenceCategory mCategory = (PreferenceCategory) findPreference("cpuprefcat");
|
||||||
mCategory.addPreference(etp);
|
mCategory.addPreference(etp);
|
||||||
VersionCheck mbuffer = new VersionCheck();
|
|
||||||
m_GLVersion = mbuffer.getVersion();
|
|
||||||
m_GLVendor = mbuffer.getVendor();
|
|
||||||
m_GLRenderer = mbuffer.getRenderer();
|
|
||||||
|
|
||||||
boolean mSupportsGLES3 = false;
|
boolean mSupportsGLES3 = SupportsGLES3();
|
||||||
|
|
||||||
if (m_GLVersion.contains("OpenGL ES 3.0")) // 3.0 support
|
|
||||||
mSupportsGLES3 = true;
|
|
||||||
if (!mSupportsGLES3 && m_GLVendor.equals("Qualcomm"))
|
|
||||||
{
|
|
||||||
if (m_GLRenderer.contains("Adreno (TM) 3"))
|
|
||||||
{
|
|
||||||
int mVStart, 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)
|
|
||||||
mSupportsGLES3 = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mSupportsGLES3)
|
if (!mSupportsGLES3)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user