Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int array to opengl texture in android
- mNewTexture = new int[width*height*4]
- for(int i=0; i<mRGB.length; i=i+4){
- mNewTexture[i] = getR(mRGB[i]) ; //R
- mNewTexture[i+1] = getG(mRGB[i]) ; //G
- mNewTexture[i+2] = getB(mRGB[i]) ; //B
- mNewTexture[i+3] = getA(mRGB[i]); //A
- }
- gl.glBindTexture(GL10.GL_TEXTURE_2D, tex);
- gl.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, 1024, 512, 0, GL10.GL_RGBA, GL10.GL_FLOAT, FloatBuffer.wrap(mNewTexture));
- gl.glTexParameterf(GL10.GL_TEXTURE_2D, GL10.GL_TEXTURE_MIN_FILTER, GL10.GL_LINEAR);
Add Comment
Please, Sign In to add comment