Project

General

Profile

« Previous | Next » 

Revision 855ba24e

Added by Leszek Koltunski about 7 years ago

New 'glClearColor' and 'glClearDepthf' APIs in OutputSurface. This fixes the 'transparency' regressions from last commit.

View differences:

src/main/java/org/distorted/examples/aroundtheworld/AroundTheWorldRenderer.java
62 62
      mEffects = new DistortedEffects();
63 63
      mManager.apply(mEffects);
64 64
      mScreen = new DistortedScreen();
65
      mScreen.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
65 66
      }
66 67

  
67 68
///////////////////////////////////////////////////////////////////////////////////////////////////
......
75 76

  
76 77
   public void onDrawFrame(GL10 glUnused) 
77 78
      {
78
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
79 79
      mScreen.render( System.currentTimeMillis() );
80 80
      }
81 81

  
......
107 107
    
108 108
   public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
109 109
      {
110
      GLES30.glClearColor(0.5f, 0.5f, 0.5f, 1.0f);
111

  
112 110
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.face);
113 111
      Bitmap bitmap;
114 112

  
src/main/java/org/distorted/examples/bean/BeanRenderer.java
95 95
   
96 96
    public void onDrawFrame(GL10 glUnused) 
97 97
      {
98
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
99 98
      mScreen.render( System.currentTimeMillis() );
100 99
      }
101 100

  
......
129 128
    
130 129
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
131 130
      {
132
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
133

  
134 131
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.bean);
135 132
      Bitmap bitmap;
136 133
        
src/main/java/org/distorted/examples/blur/BlurRenderer.java
82 82
   
83 83
   public void onDrawFrame(GL10 glUnused) 
84 84
      {
85
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
86 85
      mScreen.render( System.currentTimeMillis() );
87 86
      }
88 87

  
......
116 115
    
117 116
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
118 117
      {
119
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
120

  
121 118
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.dog);
122 119
      Bitmap bitmap;
123 120
        
src/main/java/org/distorted/examples/catanddog/CatAndDogRenderer.java
85 85
   
86 86
    public void onDrawFrame(GL10 glUnused) 
87 87
      {
88
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
89 88
      mScreen.render( System.currentTimeMillis() );
90 89
      }
91 90

  
......
93 92
    
94 93
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
95 94
      {
96
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
97

  
98 95
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.cat_and_dog);
99 96
      Bitmap bitmap;
100 97
        
src/main/java/org/distorted/examples/check/CheckRenderer.java
80 80
   
81 81
    public void onDrawFrame(GL10 glUnused) 
82 82
      {
83
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
84 83
      mScreen.render( System.currentTimeMillis() );
85 84
      }
86 85

  
......
114 113
    
115 114
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
116 115
      {  
117
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
118

  
119 116
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.success);
120 117
      Bitmap bitmap;
121 118

  
src/main/java/org/distorted/examples/cubes/CubesRenderer.java
88 88
   
89 89
    public void onDrawFrame(GL10 glUnused) 
90 90
      {
91
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
92 91
      mScreen.render( System.currentTimeMillis() );
93 92
      }
94 93

  
......
124 123
    
125 124
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
126 125
      {
127
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
128

  
129 126
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.grid);
130 127
      Bitmap bitmap;
131 128
        
src/main/java/org/distorted/examples/deform/DeformRenderer.java
180 180
   
181 181
   public void onDrawFrame(GL10 glUnused)
182 182
     {
183
     GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
184

  
185 183
     mPaint.setColor(0xffffffff);
186 184
     fpsCanvas.drawRect(0, 0, fpsW, fpsH, mPaint);
187 185
     mPaint.setColor(0xff000000);
......
230 228
    
231 229
   public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
232 230
     {
233
     GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
234

  
235 231
     DistortedEffects.enableEffect(EffectNames.DISTORT);
236 232
     DistortedEffects.enableEffect(EffectNames.DEFORM);
237 233

  
src/main/java/org/distorted/examples/differentbitmaps/DifferentBitmapsRenderer.java
77 77
      mEffects[0].distort(dDistort,mPoint);                                 // keep moving the whole bitmap left and right.
78 78

  
79 79
      mScreen = new DistortedScreen();
80
      mScreen.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
80 81
      }
81 82

  
82 83
///////////////////////////////////////////////////////////////////////////////////////////////////
......
106 107
   
107 108
    public void onDrawFrame(GL10 glUnused) 
108 109
      {
109
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
110 110
      mScreen.render( System.currentTimeMillis() );
111 111
      }
112 112

  
......
150 150
    
151 151
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
152 152
      {
153
      GLES30.glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
154

  
155 153
      Bitmap bitmap0= readBitmap(R.raw.dog);
156 154
      Bitmap bitmap1= readBitmap(R.raw.face);
157 155
      Bitmap bitmap2= readBitmap(R.raw.cat);
src/main/java/org/distorted/examples/differenteffects/DifferentEffectsRenderer.java
100 100
   
101 101
   public void onDrawFrame(GL10 glUnused)
102 102
     {
103
     GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
104 103
     mScreen.render( System.currentTimeMillis() );
105 104
     }
106 105

  
......
144 143
    
145 144
   public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
146 145
     {
147
     GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
148

  
149 146
     InputStream is = mView.getContext().getResources().openRawResource(R.raw.dog);
150 147
     Bitmap bitmap;
151 148
        
src/main/java/org/distorted/examples/dynamic/DynamicRenderer.java
101 101
   
102 102
   public void onDrawFrame(GL10 glUnused)
103 103
     {   
104
     GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT | GLES30.GL_DEPTH_BUFFER_BIT);               
105
       
106 104
     long time = System.currentTimeMillis();
107 105
      
108 106
     mCanvas.drawRect(0, 0, texW, texH, mPaint);
src/main/java/org/distorted/examples/effectqueue/EffectQueueRenderer.java
138 138
   
139 139
  public void onDrawFrame(GL10 glUnused)
140 140
    {   
141
    GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT | GLES30.GL_DEPTH_BUFFER_BIT);
142 141
    mScreen.render( System.currentTimeMillis() );
143 142
    }
144 143

  
src/main/java/org/distorted/examples/effects3d/Effects3DRenderer.java
166 166

  
167 167
    public void onDrawFrame(GL10 glUnused)
168 168
      {
169
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
170 169
      mScreen.render(System.currentTimeMillis());
171 170
      }
172 171

  
......
245 244

  
246 245
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
247 246
      {
248
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
249

  
250 247
      Effects3DActivity act = (Effects3DActivity)mView.getContext();
251 248

  
252 249
      InputStream isB = act.getResources().openRawResource(R.raw.water);
src/main/java/org/distorted/examples/fbo/FBORenderer.java
89 89
   
90 90
   public void onDrawFrame(GL10 glUnused)
91 91
      {
92
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
93 92
      mScreen.render(System.currentTimeMillis());
94 93
      }
95 94

  
......
123 122
    
124 123
   public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
125 124
      {
126
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
127 125
      GLES30.glEnable(GLES30.GL_CULL_FACE);
128 126
      GLES30.glCullFace(GLES30.GL_BACK);
129 127
      GLES30.glFrontFace(GLES30.GL_CW);
src/main/java/org/distorted/examples/flag/FlagRenderer.java
142 142

  
143 143
    public void onDrawFrame(GL10 glUnused) 
144 144
      {
145
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
146 145
      mScreen.render( System.currentTimeMillis() );
147 146
      }
148 147

  
......
178 177
    
179 178
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
180 179
      {
181
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
182

  
183 180
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.iceland);
184 181
      Bitmap bitmap;
185 182
        
src/main/java/org/distorted/examples/girl/GirlRenderer.java
152 152
   
153 153
   public void onDrawFrame(GL10 glUnused) 
154 154
      {
155
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
156 155
      mScreen.render( System.currentTimeMillis() );
157 156
      }
158 157

  
......
186 185
    
187 186
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
188 187
      {
189
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
190

  
191 188
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.girl);
192 189
      Bitmap bitmap;
193 190
        
src/main/java/org/distorted/examples/listener/ListenerRenderer.java
103 103

  
104 104
    public void onDrawFrame(GL10 glUnused) 
105 105
      {
106
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
107 106
      mScreen.render( System.currentTimeMillis() );
108 107
      }
109 108

  
......
137 136
    
138 137
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
139 138
      {
140
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
141

  
142 139
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.water);
143 140
      Bitmap bitmap;
144 141
        
src/main/java/org/distorted/examples/matrix3d/Matrix3DRenderer.java
55 55

  
56 56
    public void onDrawFrame(GL10 glUnused)
57 57
      {
58
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
59 58
      mScreen.render( System.currentTimeMillis() );
60 59
      }
61 60

  
......
87 86

  
88 87
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
89 88
      {
90
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
91

  
92 89
      Matrix3DActivity act = (Matrix3DActivity)mView.getContext();
93 90

  
94 91
      mTexture.setTexture(act.getBitmap());
src/main/java/org/distorted/examples/mirror/MirrorRenderer.java
111 111

  
112 112
   public void onDrawFrame(GL10 glUnused) 
113 113
      {
114
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
115

  
116 114
      long time = System.currentTimeMillis();
117 115

  
118 116
      mOffScreen1.render(time);
......
163 161
    
164 162
   public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
165 163
      {
166
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
167

  
168 164
      InputStream isM = mView.getContext().getResources().openRawResource(R.raw.mirror);
169 165
      InputStream isH = mView.getContext().getResources().openRawResource(R.raw.messi);
170 166

  
src/main/java/org/distorted/examples/monalisa/MonaLisaRenderer.java
80 80
   
81 81
    public void onDrawFrame(GL10 glUnused) 
82 82
      {
83
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
84 83
      mScreen.render( System.currentTimeMillis() );
85 84
      }
86 85

  
......
112 111
    
113 112
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
114 113
      {
115
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
116

  
117 114
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.monalisa);
118 115
      Bitmap bitmap;
119 116
        
src/main/java/org/distorted/examples/movingeffects/MovingEffectsRenderer.java
148 148
   
149 149
   public void onDrawFrame(GL10 glUnused)
150 150
     {   
151
     GLES30.glClear(GLES30.GL_COLOR_BUFFER_BIT | GLES30.GL_DEPTH_BUFFER_BIT);               
152
       
153 151
     long time = System.currentTimeMillis();
154 152
      
155 153
     if (mView.getCurrentEffect() == MovingEffectsSurfaceView.EFFECT_POINTS && mRefresh )
src/main/java/org/distorted/examples/multiblur/MultiblurRenderer.java
110 110
   
111 111
    public void onDrawFrame(GL10 glUnused) 
112 112
      {
113
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
114 113
      mScreen.render( System.currentTimeMillis() );
115 114
      }
116 115

  
......
146 145
    
147 146
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
148 147
      {
149
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
150

  
151 148
      InputStream is1 = mView.getContext().getResources().openRawResource(R.raw.cat);
152 149
      InputStream is2 = mView.getContext().getResources().openRawResource(R.raw.dog);
153 150
      Bitmap bitmap1,bitmap2;
src/main/java/org/distorted/examples/olimpic/OlimpicRenderer.java
140 140
   
141 141
    public void onDrawFrame(GL10 glUnused) 
142 142
      {
143
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
144 143
      mCurrRendered = mScreen.render(System.currentTimeMillis());
145 144

  
146 145
      if( mCurrRendered!=mPrevRendered )
......
191 190
    
192 191
    public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
193 192
      {
194
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
195

  
196 193
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.leaf);
197 194
      Bitmap leaf;
198 195
      
src/main/java/org/distorted/examples/plainmonalisa/RenderThread.java
189 189
    eglSurface = eglCore.createWindowSurface(surface);
190 190
    eglCore.makeCurrent(eglSurface);
191 191

  
192
    GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
193

  
194 192
    InputStream is = mView.getContext().getResources().openRawResource(R.raw.monalisa);
195 193
    Bitmap bmp;
196 194

  
......
268 266
      }
269 267

  
270 268
    eglCore.makeCurrent(eglSurface);
271

  
272
    GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
273
    mScreen.render( System.currentTimeMillis() );
274

  
269
    mScreen.render( frameTimeNs/1000000 );  // 1 nanosecond = 1 millisecond / 10^-6
275 270
    eglCore.swapBuffers(eglSurface);
276 271
    }
277 272

  
src/main/java/org/distorted/examples/projection/ProjectionRenderer.java
79 79
   
80 80
   public void onDrawFrame(GL10 glUnused) 
81 81
      {
82
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
83 82
      mScreen.render( System.currentTimeMillis() );
84 83
      }
85 84

  
......
130 129
    
131 130
   public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
132 131
      {
133
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
134

  
135 132
      DistortedEffects.enableEffect(EffectNames.DISTORT);
136 133

  
137 134
      try
src/main/java/org/distorted/examples/quaternion/QuaternionRenderer.java
92 92
   
93 93
  public void onDrawFrame(GL10 glUnused) 
94 94
    {
95
    GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
96 95
    mScreen.render( System.currentTimeMillis() );
97 96
    }
98 97

  
......
114 113
    
115 114
  public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
116 115
    {
117
    GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
118

  
119 116
    InputStream is = mView.getContext().getResources().openRawResource(R.raw.grid);
120 117
    Bitmap bitmap;
121 118
        
src/main/java/org/distorted/examples/save/SaveRenderer.java
149 149
   
150 150
  public void onDrawFrame(GL10 glUnused)
151 151
    {
152
    GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
153

  
154 152
    long time = System.currentTimeMillis();
155 153

  
156 154
    if( isSaving )  // render to an offscreen buffer and read pixels
......
224 222
    
225 223
  public void onSurfaceCreated(GL10 glUnused, EGLConfig config)
226 224
    {
227
    GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
228

  
229 225
    InputStream is = mView.getContext().getResources().openRawResource(R.raw.girl);
230 226
    Bitmap bitmap;
231 227

  
src/main/java/org/distorted/examples/sink/SinkRenderer.java
72 72
   
73 73
  public void onDrawFrame(GL10 glUnused) 
74 74
    {
75
    GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
76 75
    mScreen.render( System.currentTimeMillis() );
77 76
    }
78 77

  
......
106 105
    
107 106
  public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
108 107
    {
109
    GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
110

  
111 108
    InputStream is = mView.getContext().getResources().openRawResource(R.raw.cat);
112 109
    Bitmap bitmap;
113 110
        
src/main/java/org/distorted/examples/starwars/StarWarsRenderer.java
153 153
   
154 154
  public void onDrawFrame(GL10 glUnused) 
155 155
    {
156
    GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
157 156
    mScreen.render(System.currentTimeMillis());
158 157
    }
159 158

  
......
183 182
    
184 183
  public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
185 184
    {
186
    GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
187

  
188 185
    setupBitmaps();
189 186

  
190 187
    DistortedEffects.enableEffect(EffectNames.SMOOTH_ALPHA);
src/main/java/org/distorted/examples/wind/WindRenderer.java
81 81
   
82 82
   public void onDrawFrame(GL10 glUnused) 
83 83
      {
84
      GLES30.glClear( GLES30.GL_DEPTH_BUFFER_BIT | GLES30.GL_COLOR_BUFFER_BIT);
85 84
      mScreen.render( System.currentTimeMillis() );
86 85
      }
87 86

  
......
109 108
    
110 109
   public void onSurfaceCreated(GL10 glUnused, EGLConfig config) 
111 110
      {
112
      GLES30.glClearColor(0.0f, 0.0f, 0.0f, 1.0f);
113

  
114 111
      InputStream is = mView.getContext().getResources().openRawResource(R.raw.iceland);
115 112
      Bitmap bitmap;
116 113

  

Also available in: Unified diff