Revision c1df2105
Added by Leszek Koltunski over 4 years ago
src/main/java/org/distorted/main/RubikRenderer.java | ||
---|---|---|
36 | 36 |
|
37 | 37 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
38 | 38 |
|
39 |
public class RubikRenderer implements GLSurfaceView.Renderer |
|
39 |
public class RubikRenderer implements GLSurfaceView.Renderer, DistortedLibrary.ExceptionListener
|
|
40 | 40 |
{ |
41 | 41 |
private RubikSurfaceView mView; |
42 | 42 |
private DistortedScreen mScreen; |
... | ... | |
83 | 83 |
VertexEffectQuaternion.enable(); |
84 | 84 |
BaseEffect.Type.enableEffects(); |
85 | 85 |
|
86 |
try |
|
87 |
{ |
|
88 |
DistortedLibrary.onCreate(mView.getContext(),1); |
|
89 |
} |
|
90 |
catch(Exception ex) |
|
91 |
{ |
|
92 |
String message = ex.getMessage(); |
|
93 |
String shading = GLES30.glGetString(GLES30.GL_SHADING_LANGUAGE_VERSION); |
|
94 |
String version = GLES30.glGetString(GLES30.GL_VERSION); |
|
95 |
String vendor = GLES30.glGetString(GLES30.GL_VENDOR); |
|
96 |
String renderer= GLES30.glGetString(GLES30.GL_RENDERER); |
|
97 |
|
|
98 |
if( message==null ) message = "exception NULL"; |
|
99 |
|
|
100 |
if( BuildConfig.DEBUG ) |
|
101 |
{ |
|
102 |
android.util.Log.e("DISTORTED", message ); |
|
103 |
android.util.Log.e("DISTORTED", "GLSL Version "+shading); |
|
104 |
android.util.Log.e("DISTORTED", "GL Version " +version); |
|
105 |
android.util.Log.e("DISTORTED", "GL Vendor " +vendor); |
|
106 |
android.util.Log.e("DISTORTED", "GL Renderer " +renderer); |
|
107 |
} |
|
108 |
else |
|
109 |
{ |
|
110 |
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance(); |
|
111 |
crashlytics.setCustomKey("DistortedError", message ); |
|
112 |
crashlytics.setCustomKey("GLSL Version" , shading ); |
|
113 |
crashlytics.setCustomKey("GLversion" , version ); |
|
114 |
crashlytics.setCustomKey("GL Vendor " , vendor ); |
|
115 |
crashlytics.setCustomKey("GLSLrenderer" , renderer); |
|
116 |
crashlytics.recordException(ex); |
|
117 |
} |
|
118 |
|
|
119 |
int glsl = DistortedLibrary.getGLSL(); |
|
120 |
|
|
121 |
if( glsl< 300 ) |
|
122 |
{ |
|
123 |
RubikActivity act = (RubikActivity)mView.getContext(); |
|
124 |
act.OpenGLError(message); |
|
125 |
} |
|
126 |
} |
|
86 |
DistortedLibrary.onCreate(mView.getContext(),this,1); |
|
127 | 87 |
} |
128 | 88 |
|
89 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
|
90 |
|
|
91 |
public void distortedException(Exception ex) |
|
92 |
{ |
|
93 |
String message = ex.getMessage(); |
|
94 |
String shading = GLES30.glGetString(GLES30.GL_SHADING_LANGUAGE_VERSION); |
|
95 |
String version = GLES30.glGetString(GLES30.GL_VERSION); |
|
96 |
String vendor = GLES30.glGetString(GLES30.GL_VENDOR); |
|
97 |
String renderer= GLES30.glGetString(GLES30.GL_RENDERER); |
|
98 |
|
|
99 |
if( message==null ) message = "exception NULL"; |
|
100 |
|
|
101 |
if( BuildConfig.DEBUG ) |
|
102 |
{ |
|
103 |
android.util.Log.e("DISTORTED", message ); |
|
104 |
android.util.Log.e("DISTORTED", "GLSL Version "+shading); |
|
105 |
android.util.Log.e("DISTORTED", "GL Version " +version); |
|
106 |
android.util.Log.e("DISTORTED", "GL Vendor " +vendor); |
|
107 |
android.util.Log.e("DISTORTED", "GL Renderer " +renderer); |
|
108 |
} |
|
109 |
else |
|
110 |
{ |
|
111 |
FirebaseCrashlytics crashlytics = FirebaseCrashlytics.getInstance(); |
|
112 |
crashlytics.setCustomKey("DistortedError", message ); |
|
113 |
crashlytics.setCustomKey("GLSL Version" , shading ); |
|
114 |
crashlytics.setCustomKey("GLversion" , version ); |
|
115 |
crashlytics.setCustomKey("GL Vendor " , vendor ); |
|
116 |
crashlytics.setCustomKey("GLSLrenderer" , renderer); |
|
117 |
crashlytics.recordException(ex); |
|
118 |
} |
|
119 |
|
|
120 |
int glsl = DistortedLibrary.getGLSL(); |
|
121 |
|
|
122 |
if( glsl< 300 ) |
|
123 |
{ |
|
124 |
RubikActivity act = (RubikActivity)mView.getContext(); |
|
125 |
act.OpenGLError(message); |
|
126 |
} |
|
127 |
} |
|
128 |
|
|
129 | 129 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
130 | 130 |
|
131 | 131 |
DistortedScreen getScreen() |
Also available in: Unified diff
Only compile the Full, Normal & OIT programs when they are actually needed.