org.lwjglb.engine.graph.Mesh.getVaoId()方法的使用及代码示例

x33g5p2x  于2022-01-25 转载在 其他  
字(9.8k)|赞(0)|评价(0)|浏览(120)

本文整理了Java中org.lwjglb.engine.graph.Mesh.getVaoId()方法的一些代码示例,展示了Mesh.getVaoId()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Mesh.getVaoId()方法的具体详情如下:
包路径:org.lwjglb.engine.graph.Mesh
类名称:Mesh
方法名:getVaoId

Mesh.getVaoId介绍

暂无

代码示例

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render() {
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glBindVertexArray(0);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render() {
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glBindVertexArray(0);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void initRender() {
  Texture texture = material.getTexture();
  if (texture != null) {
    // Activate firs texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void initRender() {
  Texture texture = material.getTexture();
  if (texture != null) {
    // Activate firs texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void initRender() {
  Texture texture = material.getTexture();
  if (texture != null) {
    // Activate firs texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void initRender() {
  Texture texture = material.getTexture();
  if (texture != null) {
    // Activate firs texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render() {
  // Activate firs texture bank
  glActiveTexture(GL_TEXTURE0);
  // Bind the texture
  glBindTexture(GL_TEXTURE_2D, texture.getId());
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glBindVertexArray(0);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render() {
  // Activate firs texture bank
  glActiveTexture(GL_TEXTURE0);
  // Bind the texture
  glBindTexture(GL_TEXTURE_2D, texture.getId());
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glBindVertexArray(0);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void initRender() {
  Texture texture = material.getTexture();
  if (texture != null) {
    // Activate first texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  Texture normalMap = material.getNormalMap();
  if ( normalMap != null ) {
    // Activate first texture bank
    glActiveTexture(GL_TEXTURE1);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, normalMap.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

private void initRender() {
  Texture texture = material.getTexture();
  if (texture != null) {
    // Activate first texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  Texture normalMap = material.getNormalMap();
  if ( normalMap != null ) {
    // Activate first texture bank
    glActiveTexture(GL_TEXTURE1);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, normalMap.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render(Window window, Mesh mesh) {
  clear();
  if (window.isResized()) {
    glViewport(0, 0, window.getWidth(), window.getHeight());
    window.setResized(false);
  }
  shaderProgram.bind();
  // Draw the mesh
  glBindVertexArray(mesh.getVaoId());
  glEnableVertexAttribArray(0);
  glDrawElements(GL_TRIANGLES, mesh.getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glBindVertexArray(0);
  shaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render() {
  if (texture != null) {
    // Activate firs texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
  glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glDisableVertexAttribArray(2);
  glBindVertexArray(0);
  glBindTexture(GL_TEXTURE_2D, 0);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render() {
  Texture texture = material.getTexture();
  if (texture != null) {
    // Activate firs texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
  glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glDisableVertexAttribArray(2);
  glBindVertexArray(0);
  glBindTexture(GL_TEXTURE_2D, 0);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render() {
  Texture texture = material.getTexture();
  if (texture != null) {
    // Activate firs texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
  glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glDisableVertexAttribArray(2);
  glBindVertexArray(0);
  glBindTexture(GL_TEXTURE_2D, 0);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render() {
  Texture texture = material.getTexture();
  if (texture != null) {
    // Activate firs texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
  glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glDisableVertexAttribArray(2);
  glBindVertexArray(0);
  glBindTexture(GL_TEXTURE_2D, 0);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render() {
  Texture texture = material.getTexture();
  if (texture != null) {
    // Activate firs texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
  glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glDisableVertexAttribArray(2);
  glBindVertexArray(0);
  glBindTexture(GL_TEXTURE_2D, 0);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render() {
  Texture texture = material.getTexture();
  if (texture != null) {
    // Activate firs texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
  glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glDisableVertexAttribArray(2);
  glBindVertexArray(0);
  glBindTexture(GL_TEXTURE_2D, 0);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render(Window window, Mesh mesh) {
  clear();
  if ( window.isResized() ) {
    glViewport(0, 0, window.getWidth(), window.getHeight());
    window.setResized(false);
  }
  shaderProgram.bind();
  // Draw the mesh
  glBindVertexArray(mesh.getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glDrawElements(GL_TRIANGLES, mesh.getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glBindVertexArray(0);
  shaderProgram.unbind();
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render() {
  Texture texture = material.getTexture();
  if (texture != null) {
    // Activate firs texture bank
    glActiveTexture(GL_TEXTURE0);
    // Bind the texture
    glBindTexture(GL_TEXTURE_2D, texture.getId());
  }
  // Draw the mesh
  glBindVertexArray(getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glEnableVertexAttribArray(2);
  glDrawElements(GL_TRIANGLES, getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glDisableVertexAttribArray(2);
  glBindVertexArray(0);
  glBindTexture(GL_TEXTURE_2D, 0);
}

代码示例来源:origin: lwjglgamedev/lwjglbook

public void render(Window window, Mesh mesh) {
  clear();
  if ( window.isResized() ) {
    glViewport(0, 0, window.getWidth(), window.getHeight());
    window.setResized(false);
  }
  shaderProgram.bind();
  shaderProgram.setUniform("projectionMatrix", projectionMatrix);
  // Draw the mesh
  glBindVertexArray(mesh.getVaoId());
  glEnableVertexAttribArray(0);
  glEnableVertexAttribArray(1);
  glDrawElements(GL_TRIANGLES, mesh.getVertexCount(), GL_UNSIGNED_INT, 0);
  // Restore state
  glDisableVertexAttribArray(0);
  glDisableVertexAttribArray(1);
  glBindVertexArray(0);
  shaderProgram.unbind();
}

相关文章