Skip to content

Commit

Permalink
compile errors
Browse files Browse the repository at this point in the history
  • Loading branch information
IGitGotIt authored Jan 8, 2024
1 parent 289dcaf commit 83f0b24
Showing 1 changed file with 19 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -133,38 +133,37 @@ void main(void) {
// Yay! We can upload the entire plane in a single GL call.
GLES20.glTexSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, 0, width,
height, GLES20.GL_LUMINANCE, GLES20.GL_UNSIGNED_BYTE,
buf);
buf)
} else {
for (row in 0 until height) {
buf.position( row * stride);
buf.position( row * stride)
GLES20.glTexSubImage2D(GLES20.GL_TEXTURE_2D, 0, 0, row, width,
1, GLES20.GL_LUMINANCE, GLES20.GL_UNSIGNED_BYTE,
buf);
buf)
}
}
}

private fun updateTextures(frame: Frame) {
val width = frame.getWidth();
val height = frame.getHeight();
val half_width = (width + 1) >> 1;
val half_height = (height + 1) >> 1;
val width = frame.getWidth()
val height = frame.getHeight()
val half_width = width + 1 shr 1
val half_height = height + 1 shr 1

GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT, 1);
GLES20.glPixelStorei(GLES20.GL_PACK_ALIGNMENT, 1);
GLES20.glPixelStorei(GLES20.GL_UNPACK_ALIGNMENT, 1)
GLES20.glPixelStorei(GLES20.GL_PACK_ALIGNMENT, 1)

GLES20.glActiveTexture(GLES20.GL_TEXTURE0);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureIds[0]);
GlTexSubImage2D(width, height, frame.getYstride(), frame.getYplane());
GLES20.glActiveTexture(GLES20.GL_TEXTURE0)
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureIds[0])
GlTexSubImage2D(width, height, frame.getYstride(), frame.getYplane())

GLES20.glActiveTexture(GLES20.GL_TEXTURE1);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureIds[1]);
GlTexSubImage2D(half_width, half_height, frame.getUvStride(), frame.getUplane());
GLES20.glActiveTexture(GLES20.GL_TEXTURE1)
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureIds[1])
GlTexSubImage2D(half_width, half_height, frame.getUvStride(), frame.getUplane())

GLES20.glActiveTexture(GLES20.GL_TEXTURE2);
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureIds[2]);
GlTexSubImage2D(half_width, half_height, frame.getUvStride(), frame.getVplane());
}
GLES20.glActiveTexture(GLES20.GL_TEXTURE2)
GLES20.glBindTexture(GLES20.GL_TEXTURE_2D, textureIds[2])
GlTexSubImage2D(half_width, half_height, frame.getUvStride(), frame.getVplane())
}

override fun onSurfaceChanged(gl: GL10, width: Int, height: Int) {
Expand Down Expand Up @@ -431,4 +430,4 @@ void main(void) {
view.setRenderer(renderer)
view.renderMode = GLSurfaceView.RENDERMODE_WHEN_DIRTY
}
}
}

0 comments on commit 83f0b24

Please sign in to comment.