Revision 061449ed
Added by Leszek Koltunski almost 4 years ago
src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java | ||
---|---|---|
46 | 46 |
|
47 | 47 |
/////////////////////////////////////////////////////////////////////////////////////////////////// |
48 | 48 |
|
49 |
class QuaternionRenderer implements GLSurfaceView.Renderer
|
|
49 |
class QuaternionRenderer implements GLSurfaceView.Renderer, DistortedLibrary.ExceptionListener
|
|
50 | 50 |
{ |
51 | 51 |
private static final int NUM_QUATERNIONS = 5; |
52 | 52 |
|
... | ... | |
104 | 104 |
|
105 | 105 |
public void onSurfaceChanged(GL10 glUnused, int width, int height) |
106 | 106 |
{ |
107 |
float factor = 0.5f*(width>height ? height:width);
|
|
107 |
float factor = 0.5f*Math.min(width,height);
|
|
108 | 108 |
|
109 | 109 |
mScale.set(factor,factor,factor); |
110 | 110 |
mScreen.resize(width, height); |
... | ... | |
131 | 131 |
} |
132 | 132 |
|
133 | 133 |
mTexture.setTexture(bitmap); |
134 |
|
|
135 |
try
|
|
136 |
{
|
|
137 |
DistortedLibrary.onCreate(mView.getContext()); |
|
138 |
}
|
|
139 |
catch(Exception ex) |
|
140 |
{
|
|
141 |
android.util.Log.e("Quaternion", ex.getMessage() );
|
|
142 |
}
|
|
134 |
|
|
135 |
DistortedLibrary.onCreate(mView.getContext(), this);
|
|
136 |
}
|
|
137 |
|
|
138 |
///////////////////////////////////////////////////////////////////////////////////////////////////
|
|
139 |
|
|
140 |
public void distortedException(Exception ex)
|
|
141 |
{
|
|
142 |
android.util.Log.e("Quaternion", ex.getMessage() );
|
|
143 | 143 |
} |
144 | 144 |
} |
Also available in: Unified diff
Only compile the Full, Normal & OIT programs when they are actually needed.