Make robot.png a raw resource.
After all, it's being used as a raw resource.
This commit is contained in:
0
samples/ApiDemos/res/drawable/robot.png → samples/ApiDemos/res/raw/robot.png
Executable file → Normal file
0
samples/ApiDemos/res/drawable/robot.png → samples/ApiDemos/res/raw/robot.png
Executable file → Normal file
|
Before Width: | Height: | Size: 5.5 KiB After Width: | Height: | Size: 5.5 KiB |
@@ -101,7 +101,7 @@ public class StaticTriangleRenderer implements GLSurfaceView.Renderer{
|
|||||||
GL_REPLACE);
|
GL_REPLACE);
|
||||||
|
|
||||||
InputStream is = mContext.getResources()
|
InputStream is = mContext.getResources()
|
||||||
.openRawResource(R.drawable.robot);
|
.openRawResource(R.raw.robot);
|
||||||
Bitmap bitmap;
|
Bitmap bitmap;
|
||||||
try {
|
try {
|
||||||
bitmap = BitmapFactory.decodeStream(is);
|
bitmap = BitmapFactory.decodeStream(is);
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ public class TriangleRenderer implements GLSurfaceView.Renderer{
|
|||||||
GL10.GL_REPLACE);
|
GL10.GL_REPLACE);
|
||||||
|
|
||||||
InputStream is = mContext.getResources()
|
InputStream is = mContext.getResources()
|
||||||
.openRawResource(R.drawable.robot);
|
.openRawResource(R.raw.robot);
|
||||||
Bitmap bitmap;
|
Bitmap bitmap;
|
||||||
try {
|
try {
|
||||||
bitmap = BitmapFactory.decodeStream(is);
|
bitmap = BitmapFactory.decodeStream(is);
|
||||||
|
|||||||
@@ -35,6 +35,7 @@ import android.opengl.GLSurfaceView;
|
|||||||
import android.opengl.GLU;
|
import android.opengl.GLU;
|
||||||
import android.opengl.GLUtils;
|
import android.opengl.GLUtils;
|
||||||
import android.os.SystemClock;
|
import android.os.SystemClock;
|
||||||
|
import android.util.Log;
|
||||||
|
|
||||||
import com.example.android.apis.R;
|
import com.example.android.apis.R;
|
||||||
|
|
||||||
@@ -96,7 +97,7 @@ public class SpriteTextRenderer implements GLSurfaceView.Renderer{
|
|||||||
GL10.GL_REPLACE);
|
GL10.GL_REPLACE);
|
||||||
|
|
||||||
InputStream is = mContext.getResources()
|
InputStream is = mContext.getResources()
|
||||||
.openRawResource(R.drawable.robot);
|
.openRawResource(R.raw.robot);
|
||||||
Bitmap bitmap;
|
Bitmap bitmap;
|
||||||
try {
|
try {
|
||||||
bitmap = BitmapFactory.decodeStream(is);
|
bitmap = BitmapFactory.decodeStream(is);
|
||||||
@@ -172,6 +173,15 @@ public class SpriteTextRenderer implements GLSurfaceView.Renderer{
|
|||||||
gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T,
|
gl.glTexParameterx(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_WRAP_T,
|
||||||
GL10.GL_REPEAT);
|
GL10.GL_REPEAT);
|
||||||
|
|
||||||
|
{
|
||||||
|
long time = SystemClock.uptimeMillis();
|
||||||
|
if (mLastTime != 0) {
|
||||||
|
long delta = time - mLastTime;
|
||||||
|
Log.w("time", Long.toString(delta));
|
||||||
|
}
|
||||||
|
mLastTime = time;
|
||||||
|
}
|
||||||
|
|
||||||
long time = SystemClock.uptimeMillis() % 4000L;
|
long time = SystemClock.uptimeMillis() % 4000L;
|
||||||
float angle = 0.090f * ((int) time);
|
float angle = 0.090f * ((int) time);
|
||||||
|
|
||||||
@@ -266,6 +276,7 @@ public class SpriteTextRenderer implements GLSurfaceView.Renderer{
|
|||||||
private Projector mProjector;
|
private Projector mProjector;
|
||||||
private NumericSprite mNumericSprite;
|
private NumericSprite mNumericSprite;
|
||||||
private float[] mScratch = new float[8];
|
private float[] mScratch = new float[8];
|
||||||
|
private long mLastTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
class Triangle {
|
class Triangle {
|
||||||
|
|||||||
Reference in New Issue
Block a user