浏览代码

optimizations

testing
Michael Porter 4 年前
父节点
当前提交
6214a6708a
共有 2 个文件被更改,包括 6 次插入3 次删除
  1. 1
    0
      CMakeLists.txt
  2. 5
    3
      src/graphics/chunkmesh.cpp

+ 1
- 0
CMakeLists.txt 查看文件

@@ -3,6 +3,7 @@ project ("voxeltronik")
file (GLOB_RECURSE SOURCES "src/*.cpp" "src/*.c")
include_directories("./include")
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_FLAGS "-O2")
set(CMAKE_EXPORT_COMPILE_COMMANDS on)
add_executable(vtk ${SOURCES})


+ 5
- 3
src/graphics/chunkmesh.cpp 查看文件

@@ -217,9 +217,11 @@ void ChunkMesh::rebuildChunkLighting() {
}

void ChunkMesh::draw() {
updateGeometry();
glBindVertexArray(mVAO);
glDrawArrays(GL_TRIANGLES, 0, mGeometryFaceCount * 6);
if (mFaceCount > 0) {
updateGeometry();
glBindVertexArray(mVAO);
glDrawArrays(GL_TRIANGLES, 0, mGeometryFaceCount * 6);
}
}

bool ChunkMesh::updateGeometry() {

正在加载...
取消
保存