去除无用代码
parent
ce3f433d55
commit
1603473aaf
|
@ -21,14 +21,14 @@ function(buildHomework HOMEWORK_NAME)
|
|||
SET(SOURCE ${SOURCE} ${CMAKE_BINARY_DIR}/xdg-shell-client-protocol.h ${CMAKE_BINARY_DIR}/xdg-shell-protocol.c )
|
||||
ENDIF()
|
||||
# Add shaders
|
||||
set(SHADER_DIR_GLSL "../data/buster_drone/shaders/glsl")
|
||||
file(GLOB SHADERS_GLSL "${SHADER_DIR_GLSL}/*.vert" "${SHADER_DIR_GLSL}/*.frag" "${SHADER_DIR_GLSL}/*.comp" "${SHADER_DIR_GLSL}/*.geom" "${SHADER_DIR_GLSL}/*.tesc" "${SHADER_DIR_GLSL}/*.tese" "${SHADER_DIR_GLSL}/*.mesh" "${SHADER_DIR_GLSL}/*.task" "${SHADER_DIR_GLSL}/*.rgen" "${SHADER_DIR_GLSL}/*.rchit" "${SHADER_DIR_GLSL}/*.rmiss" "${SHADER_DIR_GLSL}/*.rcall")
|
||||
set(SHADER_DIR_HLSL "../data/buster_drone/shaders/hlsl")
|
||||
file(GLOB SHADERS_HLSL "${SHADER_DIR_HLSL}/*.vert" "${SHADER_DIR_HLSL}/*.frag" "${SHADER_DIR_HLSL}/*.comp" "${SHADER_DIR_HLSL}/*.geom" "${SHADER_DIR_HLSL}/*.tesc" "${SHADER_DIR_HLSL}/*.tese" "${SHADER_DIR_HLSL}/*.mesh" "${SHADER_DIR_HLSL}/*.task" "${SHADER_DIR_HLSL}/*.rgen" "${SHADER_DIR_HLSL}/*.rchit" "${SHADER_DIR_HLSL}/*.rmiss" "${SHADER_DIR_HLSL}/*.rcall")
|
||||
source_group("Shaders\\GLSL" FILES ${SHADERS_GLSL})
|
||||
source_group("Shaders\\HLSL" FILES ${SHADERS_HLSL})
|
||||
#set(SHADER_DIR_GLSL "../data/buster_drone/shaders/glsl")
|
||||
#file(GLOB SHADERS_GLSL "${SHADER_DIR_GLSL}/*.vert" "${SHADER_DIR_GLSL}/*.frag" "${SHADER_DIR_GLSL}/*.comp" "${SHADER_DIR_GLSL}/*.geom" "${SHADER_DIR_GLSL}/*.tesc" "${SHADER_DIR_GLSL}/*.tese" "${SHADER_DIR_GLSL}/*.mesh" "${SHADER_DIR_GLSL}/*.task" "${SHADER_DIR_GLSL}/*.rgen" "${SHADER_DIR_GLSL}/*.rchit" "${SHADER_DIR_GLSL}/*.rmiss" "${SHADER_DIR_GLSL}/*.rcall")
|
||||
#set(SHADER_DIR_HLSL "../data/buster_drone/shaders/hlsl")
|
||||
#file(GLOB SHADERS_HLSL "${SHADER_DIR_HLSL}/*.vert" "${SHADER_DIR_HLSL}/*.frag" "${SHADER_DIR_HLSL}/*.comp" "${SHADER_DIR_HLSL}/*.geom" "${SHADER_DIR_HLSL}/*.tesc" "${SHADER_DIR_HLSL}/*.tese" "${SHADER_DIR_HLSL}/*.mesh" "${SHADER_DIR_HLSL}/*.task" "${SHADER_DIR_HLSL}/*.rgen" "${SHADER_DIR_HLSL}/*.rchit" "${SHADER_DIR_HLSL}/*.rmiss" "${SHADER_DIR_HLSL}/*.rcall")
|
||||
#source_group("Shaders\\GLSL" FILES ${SHADERS_GLSL})
|
||||
#source_group("Shaders\\HLSL" FILES ${SHADERS_HLSL})
|
||||
# Add optional readme / tutorial
|
||||
file(GLOB README_FILES "${HOMEWORK_FOLDER}/*.md")
|
||||
#file(GLOB README_FILES "${HOMEWORK_FOLDER}/*.md")
|
||||
if(WIN32)
|
||||
add_executable(${HOMEWORK_NAME} WIN32 ${MAIN_CPP} ${SOURCE} ${MAIN_HEADER} ${SHADERS_GLSL} ${SHADERS_HLSL} ${README_FILES}
|
||||
"render/glTFModel.h"
|
||||
|
|
|
@ -1,42 +0,0 @@
|
|||
#include "assetLoader.h"
|
||||
|
||||
|
||||
|
||||
void assetLoader::readDirectory(const std::string& directory, const std::string& pattern, std::map<std::string, std::string>& filelist, bool recursive)
|
||||
{
|
||||
std::string searchpattern(directory + "/" + pattern);
|
||||
WIN32_FIND_DATA data;
|
||||
HANDLE hFind;
|
||||
if ((hFind = FindFirstFile(searchpattern.c_str(), &data)) != INVALID_HANDLE_VALUE) {
|
||||
do {
|
||||
std::string filename(data.cFileName);
|
||||
filename.erase(filename.find_last_of("."), std::string::npos);
|
||||
filelist[filename] = directory + "/" + data.cFileName;
|
||||
} while (FindNextFile(hFind, &data) != 0);
|
||||
FindClose(hFind);
|
||||
}
|
||||
if (recursive) {
|
||||
std::string dirpattern = directory + "/*";
|
||||
if ((hFind = FindFirstFile(dirpattern.c_str(), &data)) != INVALID_HANDLE_VALUE) {
|
||||
do {
|
||||
if (data.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) {
|
||||
char subdir[MAX_PATH];
|
||||
strcpy(subdir, directory.c_str());
|
||||
strcat(subdir, "/");
|
||||
strcat(subdir, data.cFileName);
|
||||
if ((strcmp(data.cFileName, ".") != 0) && (strcmp(data.cFileName, "..") != 0)) {
|
||||
|
||||
readDirectory(subdir, pattern, filelist, recursive);
|
||||
}
|
||||
}
|
||||
} while (FindNextFile(hFind, &data) != 0);
|
||||
FindClose(hFind);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
std::string assetLoader::getAssetPath()
|
||||
{
|
||||
return "./../data/";
|
||||
}
|
|
@ -1,19 +0,0 @@
|
|||
#pragma once
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <map>
|
||||
#include "vulkan/vulkan.h"
|
||||
#include "VulkanDevice.hpp"
|
||||
|
||||
|
||||
namespace assetLoader
|
||||
{
|
||||
|
||||
void readDirectory(const std::string& directory, const std::string& pattern, std::map<std::string, std::string>& filelist, bool recursive);
|
||||
std::string getAssetPath();
|
||||
};
|
||||
|
Loading…
Reference in New Issue