Project

General

Profile

« Previous | Next » 

Revision 86e99907

Added by Leszek Koltunski almost 7 years ago

Correct the FPS work (now works even after a Pause() ! )

View differences:

src/main/java/org/distorted/library/Distorted.java
33 33
  {
34 34
  static int GLSL;
35 35
  static String GLSL_VERSION;
36

  
37
  //////////// DEBUG FLAGS /////////////////////////////////////////////
38
  /**
39
   * When rendering a Screen, show FPS in the upper-left corner?
40
   */
41
  public static final int DEBUG_FPS = 1;
42

  
43
  //////////// END DEBUG FLAGS /////////////////////////////////////////
44

  
45 36
  /**
46 37
   * When creating an instance of a DistortedTexture from another instance, clone the Bitmap that's
47 38
   * backing up our DistortedTexture.
......
84 75

  
85 76
  private static boolean mInitialized=false;
86 77

  
87
  static int mDebugLevel = 0;
88
  static DistortedDebug mDebug;
89

  
90 78
///////////////////////////////////////////////////////////////////////////////////////////////////
91 79
// private: hide this from Javadoc
92 80

  
......
102 90
    return mInitialized;
103 91
    }
104 92

  
105
///////////////////////////////////////////////////////////////////////////////////////////////////
106
/**
107
 * Make the library show various debugging information.
108
 * <p>
109
 * Currently only DEBUG_FPS - show FPS in the upper-left corner of every Screen - is defined.
110
 *
111
 * @param bitmask 0, or a bitmask of DEBUG_** flags to enable (currently only DEBUG_FPS defined)
112
 */
113
  public static void setDebug(int bitmask)
114
    {
115
    mDebugLevel = bitmask;
116

  
117
    if( mDebugLevel!=0 && mDebug==null ) mDebug = new DistortedDebug();
118
    }
119

  
120 93
///////////////////////////////////////////////////////////////////////////////////////////////////
121 94
/**
122 95
 * When OpenGL context gets created, you need to call this method so that the library can initialise its internal data structures.
......
125 98
 * Needs to be called from a thread holding the OpenGL context.
126 99
 *   
127 100
 * @param context Context of the App using the library - used to open up Resources and read Shader code.
128
 * @throws FragmentCompilationException
129
 * @throws VertexCompilationException
130
 * @throws VertexUniformsException
131
 * @throws FragmentUniformsException
132
 * @throws LinkingException
101
 * @throws FragmentCompilationException Fragment Shader failed to compile
102
 * @throws VertexCompilationException   Vertex Shader failed to compile
103
 * @throws VertexUniformsException      Too many uniforms in the Vertex Shader
104
 * @throws FragmentUniformsException    Too many uniforms in the Fragment Shader
105
 * @throws LinkingException             Shader failed to link
133 106
 */
134 107
  public static void onCreate(final Context context)
135 108
  throws FragmentCompilationException,VertexCompilationException,VertexUniformsException,FragmentUniformsException,LinkingException

Also available in: Unified diff