Project

General

Profile

« Previous | Next » 

Revision 8982b894

Added by Leszek Koltunski almost 4 years ago

Progress with MeshJoin.

View differences:

src/main/java/org/distorted/examples/meshjoin/MeshJoinSurfaceView.java
23 23
import android.content.Context;
24 24
import android.content.pm.ConfigurationInfo;
25 25
import android.opengl.GLSurfaceView;
26
import android.util.AttributeSet;
26 27
import android.view.MotionEvent;
27 28

  
28 29
///////////////////////////////////////////////////////////////////////////////////////////////////
......
35 36
	
36 37
///////////////////////////////////////////////////////////////////////////////////////////////////
37 38
   
38
    public MeshJoinSurfaceView(Context context)
39
    public MeshJoinSurfaceView(Context context, AttributeSet attrs)
39 40
      {
40
      super(context);
41
      super(context,attrs);
41 42
    
42 43
      mX = -1;
43 44
      mY = -1;
44 45

  
45
      mRenderer = new MeshJoinRenderer(this);
46
      final ActivityManager activityManager     = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
47
      final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
48
      setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 );
49
      setRenderer(mRenderer);
46
      if(!isInEditMode())
47
        {
48
        mRenderer = new MeshJoinRenderer(this);
49
        final ActivityManager activityManager     = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
50
        final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
51
        setEGLContextClientVersion( (configurationInfo.reqGlEsVersion>>16) >= 3 ? 3:2 );
52
        setRenderer(mRenderer);
53
        }
50 54
      }
51 55

  
52 56
///////////////////////////////////////////////////////////////////////////////////////////////////

Also available in: Unified diff