List of usage examples for com.badlogic.gdx.graphics GL20 glVertexAttribPointer
public void glVertexAttribPointer(int indx, int size, int type, boolean normalized, int stride, int ptr);
From source file:net.mgsx.game.examples.gpu.utils.ShaderProgramEx.java
License:Apache License
/** Sets the vertex attribute with the given name. The {@link ShaderProgram} must be bound for this to work. * /* w w w . j ava2 s . c o m*/ * @param name the attribute name * @param size the number of components, must be >= 1 and <= 4 * @param type the type, must be one of GL20.GL_BYTE, GL20.GL_UNSIGNED_BYTE, GL20.GL_SHORT, * GL20.GL_UNSIGNED_SHORT,GL20.GL_FIXED, or GL20.GL_FLOAT. GL_FIXED will not work on the desktop * @param normalize whether fixed point data should be normalized. Will not work on the desktop * @param stride the stride in bytes between successive attributes * @param buffer the buffer containing the vertex attributes. */ public void setVertexAttribute(String name, int size, int type, boolean normalize, int stride, Buffer buffer) { GL20 gl = Gdx.gl20; checkManaged(); int location = fetchAttributeLocation(name); if (location == -1) return; gl.glVertexAttribPointer(location, size, type, normalize, stride, buffer); }
From source file:net.mgsx.game.examples.gpu.utils.ShaderProgramEx.java
License:Apache License
public void setVertexAttribute(int location, int size, int type, boolean normalize, int stride, Buffer buffer) { GL20 gl = Gdx.gl20; checkManaged();/*from ww w .ja v a 2 s . c om*/ gl.glVertexAttribPointer(location, size, type, normalize, stride, buffer); }
From source file:net.mgsx.game.examples.gpu.utils.ShaderProgramEx.java
License:Apache License
/** Sets the vertex attribute with the given name. The {@link ShaderProgram} must be bound for this to work. * //from w ww .j av a2 s . c om * @param name the attribute name * @param size the number of components, must be >= 1 and <= 4 * @param type the type, must be one of GL20.GL_BYTE, GL20.GL_UNSIGNED_BYTE, GL20.GL_SHORT, * GL20.GL_UNSIGNED_SHORT,GL20.GL_FIXED, or GL20.GL_FLOAT. GL_FIXED will not work on the desktop * @param normalize whether fixed point data should be normalized. Will not work on the desktop * @param stride the stride in bytes between successive attributes * @param offset byte offset into the vertex buffer object bound to GL20.GL_ARRAY_BUFFER. */ public void setVertexAttribute(String name, int size, int type, boolean normalize, int stride, int offset) { GL20 gl = Gdx.gl20; checkManaged(); int location = fetchAttributeLocation(name); if (location == -1) return; gl.glVertexAttribPointer(location, size, type, normalize, stride, offset); }
From source file:net.mgsx.game.examples.gpu.utils.ShaderProgramEx.java
License:Apache License
public void setVertexAttribute(int location, int size, int type, boolean normalize, int stride, int offset) { GL20 gl = Gdx.gl20; checkManaged();//w ww. jav a 2s.c o m gl.glVertexAttribPointer(location, size, type, normalize, stride, offset); }