Project

General

Profile

« Previous | Next » 

Revision b6468abb

Added by Leszek Koltunski over 3 years ago

Progress with using the Library in a second Activity.

View differences:

src/main/java/org/distorted/tutorial/TutorialRenderer.java
21 21

  
22 22
import android.opengl.GLSurfaceView;
23 23

  
24
import org.distorted.effects.BaseEffect;
25
import org.distorted.library.effect.EffectType;
26
import org.distorted.library.effect.VertexEffectQuaternion;
27
import org.distorted.library.effect.VertexEffectRotate;
28
import org.distorted.library.main.DistortedLibrary;
24 29
import org.distorted.library.main.DistortedScreen;
25 30

  
26 31
import javax.microedition.khronos.egl.EGLConfig;
......
28 33

  
29 34
///////////////////////////////////////////////////////////////////////////////////////////////////
30 35

  
31
public class TutorialRenderer implements GLSurfaceView.Renderer
36
public class TutorialRenderer implements GLSurfaceView.Renderer, DistortedLibrary.ExceptionListener
32 37
{
33 38
   private TutorialSurfaceView mView;
34 39
   private DistortedScreen mScreen;
......
69 74
   @Override
70 75
   public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
71 76
      {
77
      DistortedLibrary.setMax(EffectType.VERTEX,25);    // 24 Cube Quats + Rotate
78
      VertexEffectRotate.enable();
79
      VertexEffectQuaternion.enable();
80
      BaseEffect.Type.enableEffects();
72 81

  
82
      DistortedLibrary.onCreate(mView.getContext(),this,1);
73 83
      }
74 84

  
85
///////////////////////////////////////////////////////////////////////////////////////////////////
86

  
87
   public void distortedException(Exception ex)
88
     {
89
     android.util.Log.e("TUTORIAL", "unexpected exception: "+ex.getMessage() );
90
     }
91

  
75 92
///////////////////////////////////////////////////////////////////////////////////////////////////
76 93

  
77 94
   DistortedScreen getScreen()

Also available in: Unified diff