示例#1
0
文件: Engine.cpp 项目: zgub4/op3d
void op3d::Engine::initVulkan()
{
    instance.create();
    callback.setup(instance);
    surface.create(instance, window);
    physicalDevice.create(instance, surface);
    device.create(physicalDevice, surface, graphicsQueue, presentQueue);
    swapChain.create(device, surface, physicalDevice, window);
    swapChain.createImageViews(device, swapChainImageViews);
    createRenderPass();
    createDescriptorSetLayout();
    createGraphicsPipeline();
    commandBufferManager.createCommandPool(physicalDevice, surface);
    createDepthResources();
    createFramebuffers();
    createTextureImage();
    createTextureImageView();
    createTextureSampler();
    createVertexBuffer();
    createIndexBuffer();
    createUniformBuffer();
    descriptorPool.createPool();
    descriptorSet.createSet(uniformBuffer, textureImageView, textureSampler, descriptorSetLayout, descriptorPool, device);
    createCommandBuffers();
    createSemaphores();
}
示例#2
0
void CDebugDrawer::resize(int width, int height)
{
	m_currentWidth = width;
	m_currentHeight = height;

	removeFramebuffers();
	createFramebuffers(width, height);
}
示例#3
0
文件: Engine.cpp 项目: zgub4/op3d
void op3d::Engine::recreateSwapChain()
{
    vkDeviceWaitIdle(device);

    swapChain.create(device, surface, physicalDevice, window);
    swapChain.createImageViews(device, swapChainImageViews);
    createRenderPass();
    createGraphicsPipeline();
    createDepthResources();
    createFramebuffers();
    createCommandBuffers();
}