Project

General

Profile

« Previous | Next » 

Revision 9167cfd4

Added by Leszek Koltunski almost 8 years ago

Vertex3D: Add the new 'Grid' bitmap option!

View differences:

src/main/java/org/distorted/examples/vertex3d/Vertex3DRenderer.java
198 198
      {
199 199
      Vertex3DActivity act = (Vertex3DActivity)mView.getContext();
200 200

  
201
      InputStream is1 = act.getResources().openRawResource(act.getBitmap());
202
      InputStream is2 = act.getResources().openRawResource(R.raw.water);
203
      InputStream is3 = act.getResources().openRawResource(R.raw.center);
204
      InputStream is4 = act.getResources().openRawResource(R.raw.region);
201
      InputStream is1 = act.getResources().openRawResource(R.raw.water);
202
      InputStream is2 = act.getResources().openRawResource(R.raw.center);
203
      InputStream is3 = act.getResources().openRawResource(R.raw.region);
205 204

  
206
      Bitmap bitmap1,bitmap2,bitmap3,bitmap4;
205
      Bitmap bitmap1,bitmap2,bitmap3;
207 206
        
208 207
      try 
209 208
        {
210 209
        bitmap1 = BitmapFactory.decodeStream(is1);
211 210
        bitmap2 = BitmapFactory.decodeStream(is2);
212 211
        bitmap3 = BitmapFactory.decodeStream(is3);
213
        bitmap4 = BitmapFactory.decodeStream(is4);
214 212
        }
215 213
      finally 
216 214
        {
......
219 217
          is1.close();
220 218
          is2.close();
221 219
          is3.close();
222
          is4.close();
223
          } 
220
          }
224 221
        catch(IOException e) { }
225 222
        }  
226 223
      
227
      mObject.setBitmap(bitmap1);
228
      mBackground.setBitmap(bitmap2);
229
      mCenter.setBitmap(bitmap3);
230
      mRegion.setBitmap(bitmap4);
224
      mObject.setBitmap( act.getBitmap() );
225
      mBackground.setBitmap(bitmap1);
226
      mCenter.setBitmap(bitmap2);
227
      mRegion.setBitmap(bitmap3);
231 228

  
232 229
      try
233 230
        {

Also available in: Unified diff