本文整理匯總了Java中org.lwjgl.opengl.GL30.glBindVertexArray方法的典型用法代碼示例。如果您正苦於以下問題:Java GL30.glBindVertexArray方法的具體用法?Java GL30.glBindVertexArray怎麽用?Java GL30.glBindVertexArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類org.lwjgl.opengl.GL30
的用法示例。
在下文中一共展示了GL30.glBindVertexArray方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: prepareTexturedModel
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
private void prepareTexturedModel(TexturedModel model) {
RawModel rawModel = model.getRawModel();
GL30.glBindVertexArray(rawModel.getVaoID());
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
ModelTexture texture = model.getTexture();
if(texture.isHasTransparency()) {
MasterRenderer.disableCulling();
}
shader.loadFakeLightingVariable(texture.isUseFakeLighting());
shader.loadShineVariables(texture.getShineDamper(), texture.getReflectivity());
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
}
示例2: render
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
public static final void render(final Vec3 position, final float scale) {
shader.start();
GL30.glBindVertexArray(model.id);
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
shader.loadTransformationMatrix(MatrixCreation.createTransformationMatrix(position, new Vec3(), new Vec3(scale, 1, scale)));
GL11.glDrawArrays(GL11.GL_TRIANGLES, 0, model.vertexCount);
GL20.glDisableVertexAttribArray(0);
GL20.glDisableVertexAttribArray(1);
GL20.glDisableVertexAttribArray(2);
GL30.glBindVertexArray(0);
shader.stop();
}
示例3: prepareTexturedModel
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
private void prepareTexturedModel(TexturedModel model) {
RawModel rawModel = model.getRawModel();
GL30.glBindVertexArray(rawModel.getVaoID());
GL20.glEnableVertexAttribArray(0); // position coordinates
GL20.glEnableVertexAttribArray(1); // texture coordinates
GL20.glEnableVertexAttribArray(2); // normal coordinates
ModelTexture texture = model.getTexture();
shader.loadShineVariable(texture.getShineDamper(), texture.getReflectivity());
GL13.glActiveTexture(GL13.GL_TEXTURE0); // activate texture bank - where sampler function will sample
GL11.glBindTexture(GL11.GL_TEXTURE_2D, model.getTexture().getID());
}
示例4: prepareTerrain
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
/**
* Binds texture for shaders and rendering
* @param terrain - terrain containing the texture.
*/
private void prepareTerrain(Terrain terrain) {
RawModel rawModel = terrain.getModel();
GL30.glBindVertexArray(rawModel.getVaoID());
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
bindTextures(terrain);
UniformList.terrainShineDamper.loadData(1);
UniformList.terrainReflectivity.loadData(0);
}
示例5: prepareTerrain
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
private void prepareTerrain(Terrain terrain) {
RawModel rawModel = terrain.getModel();
GL30.glBindVertexArray(rawModel.getVaoID());
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
bindTextures(terrain);
shader.loadShineVariables(1, 0);
}
示例6: dispose
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
public void dispose() {
GL30.glBindVertexArray(0);
GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, 0);
GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, 0);
GL20.glDisableVertexAttribArray(0);
GL20.glDisableVertexAttribArray(1);
GL15.glDeleteBuffers(vbo);
GL15.glDeleteBuffers(vboTexture);
GL15.glDeleteBuffers(vboi);
GL30.glDeleteVertexArrays(vao);
}
示例7: unbind
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
public void unbind()
{
for(int i = 0; i < this.vertexBuffers.length; ++i)
{
if (this.vertexBuffers[i] != null)
{
GL20.glDisableVertexAttribArray(i);
}
}
GL30.glBindVertexArray(0);
}
示例8: prepareTerrain
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
private void prepareTerrain(final Terrain terrain) {
GL30.glBindVertexArray(terrain.getModel().getVaoId());
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL20.glEnableVertexAttribArray(2);
shader.loadShineVariables(
terrain.getTexture().getShineDamper(),
terrain.getTexture().getReflectivity()
);
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL11.glBindTexture(GL11.GL_TEXTURE_2D, terrain.getTexture().getTextureId());
}
示例9: enable
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
public void enable() {
GL30.glBindVertexArray(vao);
GL20.glEnableVertexAttribArray(0);
GL20.glEnableVertexAttribArray(1);
GL13.glActiveTexture(GL13.GL_TEXTURE0);
GL15.glBindBuffer(GL15.GL_ELEMENT_ARRAY_BUFFER, vboi);
}
示例10: unbindTexturedModel
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
/**
* Finished using texture, unbinding arrays
*/
private void unbindTexturedModel() {
GL20.glDisableVertexAttribArray(0);
GL20.glDisableVertexAttribArray(1);
GL20.glDisableVertexAttribArray(2);
GL30.glBindVertexArray(0);
}
示例11: unbind
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
public void unbind() {
GL30.glBindVertexArray(0);
}
示例12: bind
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
/**
* Binds this VAO
*/
public void bind() {
GL30.glBindVertexArray(vaoid);
}
示例13: unbindTexturedModel
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
private void unbindTexturedModel() {
GL20.glDisableVertexAttribArray(0);
GL20.glDisableVertexAttribArray(1);
GL20.glDisableVertexAttribArray(2);
GL30.glBindVertexArray(0);
}
示例14: createVao
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
private int createVao() {
int vaoId = GL30.glGenVertexArrays();
vaos.add(vaoId);
GL30.glBindVertexArray(vaoId);
return vaoId;
}
示例15: bind
import org.lwjgl.opengl.GL30; //導入方法依賴的package包/類
public void bind() {
GL30.glBindVertexArray(id);
}