瀏覽代碼

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() {

Loading…
取消
儲存