Store reference to android app in vulkan base class (#97)

This commit is contained in:
saschawillems 2016-03-20 15:45:40 +01:00
parent f13614e6d2
commit 333eede595
2 changed files with 8 additions and 2 deletions

View file

@ -218,7 +218,11 @@ VkPipelineShaderStageCreateInfo VulkanExampleBase::loadShader(const char * fileN
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);
#else
shaderStage.module = vkTools::loadShader(fileName, device, stage);
#endif
shaderStage.pName = "main"; // todo : make param
assert(shaderStage.module != NULL);
shaderModules.push_back(shaderStage.module);
@ -1176,7 +1180,7 @@ void VulkanExampleBase::initSwapchain()
#if defined(_WIN32)
swapChain.initSurface(windowInstance, window);
#elif defined(__ANDROID__)
swapChain.initSurface(window);
swapChain.initSurface(androidApp->window);
#elif defined(__linux__)
swapChain.initSurface(connection, window);
#endif