![]() ![]() GLES20.glEnableVertexAttribArray(textureProgramColorLocation) GLES20.glVertexAttribPointer(textureProgramUVLocation, 2, GLES20.GL_FLOAT, false, 8 * (Float.SIZE / 8), 2 * (Float.SIZE / 8)) GLES20.glEnableVertexAttribArray(textureProgramUVLocation) GLES20.glVertexAttribPointer(textureProgramPositionLocation, 2, GLES20.GL_FLOAT, false, 8 * (Float.SIZE / 8), 0 * (Float.SIZE / 8)) GLES20.glEnableVertexAttribArray(textureProgramPositionLocation) GLES20.glBufferData(GLES20.GL_ARRAY_BUFFER, count * (Float.SIZE / 8), vertexBatch, GLES20.GL_STATIC_DRAW) GLES20.glBindBuffer(GLES20.GL_ARRAY_BUFFER, vertexBuffer) Public void endTextureRendering(float transform, Texture texture) Call this if you finished drawing a few sprites. VertexBatch.put(srcXPosition + srcXSize) VertexBatch.put(srcYPosition + srcYSize) If(vertexBatch.position() - 48 >= VERTEX_BATCH_SIZE) Public void renderTexture(float xPosition, float yPosition, float xSize, float ySize,įloat srcXPosition, float srcYPosition, float srcXSize,įloat srcYSize, float red, float green, float blue, float alpha) Private static final int VERTEX_BATCH_SIZE = 300 Ĭore render methods of Renderer class: // Call this before rendering a few sprites. Some members of the Renderer class: private int vertexBuffer Renderer.endTextureRendering(cameraTransform, gameTexture) Is this a good method to render sprites (textured quads) or is there a faster or better way?Įxample use: renderer.beginTextureRendering() ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |