Function fro getting asset base path depending on operating system

This commit is contained in:
saschawillems 2016-03-21 20:10:09 +01:00
parent d7bbb0c7a2
commit 29ac49fb6a
2 changed files with 15 additions and 6 deletions

View file

@ -86,6 +86,15 @@ std::string VulkanExampleBase::getWindowTitle()
return windowTitle;
}
const std::string VulkanExampleBase::getAssetPath()
{
#if defined(__ANDROID__)
return "";
#else
return "./../data/";
#endif
}
bool VulkanExampleBase::checkCommandBuffers()
{
for (auto& cmdBuffer : drawCmdBuffers)
@ -213,15 +222,15 @@ void VulkanExampleBase::prepare()
textureLoader = new vkTools::VulkanTextureLoader(physicalDevice, device, queue, cmdPool);
}
VkPipelineShaderStageCreateInfo VulkanExampleBase::loadShader(const char * fileName, VkShaderStageFlagBits stage)
VkPipelineShaderStageCreateInfo VulkanExampleBase::loadShader(std::string fileName, VkShaderStageFlagBits stage)
{
VkPipelineShaderStageCreateInfo shaderStage = {};
shaderStage.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO;
shaderStage.stage = stage;
#if defined(__ANDROID__)
shaderStage.module = vkTools::loadShader(androidApp->activity->assetManager, fileName, device, stage);
shaderStage.module = vkTools::loadShader(androidApp->activity->assetManager, fileName.c_str(), device, stage);
#else
shaderStage.module = vkTools::loadShader(fileName, device, stage);
shaderStage.module = vkTools::loadShader(fileName.c_str(), device, stage);
#endif
shaderStage.pName = "main"; // todo : make param
assert(shaderStage.module != NULL);