regar007 / shapesinopengles2.0 Goto Github PK
View Code? Open in Web Editor NEWCreate basic shapes in opnegles2. And for abstraction purpose, its a class implementation using VBO's to create basic shapes in Open GLES2.0
License: MIT License
Create basic shapes in opnegles2. And for abstraction purpose, its a class implementation using VBO's to create basic shapes in Open GLES2.0
License: MIT License
I want to display a fullscreen texture in 2D.
I'm implementing a mirror protocol.
The client sends me a buffer object of pixels (1920x1080) and I just grab it and I just want to display it in my
Android Screen.
Here is my buffer how I construct it :
static IntBuffer mybuffer = BufferUtils.createIntBuffer(8300000); byteBuffer.put(256) // ALPHA byteBuffer.put(150) // RED byteBuffer.put(152) // GREEN byteBuffer.put(23) // BLUE byteBuffer.put(152) // ALPHA ... etc etc
Here is my renderer :
`private class Renderer implements GLSurfaceView.Renderer {
private int[] textures = new int[1];
private int[] vertexes = new int[1];
public void onDrawFrame(GL10 gl) {
GLES20.glClearColor(0.1f, 0.1f, 1.0f, 1.0f);
GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT | GLES20.GL_COLOR_BUFFER_BIT);
//step();
GLES20.glGenTextures(1, vertexes, 0);
GLES20.glBindTexture(GL10.GL_VERTEX_ARRAY, vertexes[0]);
GLES20.glGenTextures(1, textures, 0);
GLES20.glBindTexture(GL10.GL_TEXTURE_2D, textures[0]);
GLES20.glTexImage2D(GL10.GL_TEXTURE_2D, 0, GL10.GL_RGBA, 1920, 1080, 0, GL10.GL_RGBA, GL10.GL_UNSIGNED_BYTE, mybuffer);
//Here I should draw but don't know how to do it.
}
public void onSurfaceChanged(GL10 gl, int width, int height) {
init(width, height);
}
public void onSurfaceCreated(GL10 gl, EGLConfig config) {
}
}`
I know that the order to draw something in therory is : load the texture, setup a vertex and fragment shader, create a vertex buffer for a fullscreen quad and a create vertex arrays. Then go about binding it all and issue a draw call.
Can I have some help about that ?
Thank you !
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.