Project

General

Profile

« Previous | Next » 

Revision a2d56cfd

Added by Leszek Koltunski over 7 years ago

Change of API: move setting the EGL context back to the APP.

View differences:

src/main/java/org/distorted/library/main/Distorted.java
155 155

  
156 156
    mInitialized = false;
157 157
    }
158

  
159
///////////////////////////////////////////////////////////////////////////////////////////////////
160
/**
161
 * Return 2 or 3 depending if we have OpenGL Es 2.0 or 3.x context created.
162
 */
163
  public static int getGlVersion()
164
    {
165
    return GLSL == 300 ? 3:2;
166
    }
158 167
  }
src/main/java/org/distorted/library/main/DistortedScreen.java
139 139
 * <p>
140 140
 * Has to be followed by a 'resize()' to set the size.
141 141
 */
142
  public DistortedScreen(GLSurfaceView view)
142
  public DistortedScreen()
143 143
    {
144 144
    // set color to 'DONT_CREATE' so that Screens will not get added to the Surface lists
145 145
    // set depth to 'CREATED' so that depth will be, by default, on.
146 146
    super(0,0,DONT_CREATE,1,DEPTH_NO_STENCIL,0,TYPE_USER);
147 147

  
148
    if( view!=null )
149
      {
150
      Context context = view.getContext();
151
      final ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
152
      final ConfigurationInfo configurationInfo = activityManager.getDeviceConfigurationInfo();
153
      view.setEGLContextClientVersion((configurationInfo.reqGlEsVersion >> 16) >= 3 ? 3 : 2);
154
      }
155

  
156 148
    mInitialized = false;
157 149
    }
158 150
  }

Also available in: Unified diff