diff --git a/config/Sources.cmake b/config/Sources.cmake
index fcc24b15ba0c0e5c7c88d13aa823f5d705e09016..e991fa51c17a3d893be24a7ff324a563f60d3267 100644
--- a/config/Sources.cmake
+++ b/config/Sources.cmake
@@ -50,10 +50,7 @@ set(vkcv_sources
         
         ${vkcv_include}/vkcv/QueueManager.hpp
         ${vkcv_source}/vkcv/QueueManager.cpp
-        
-        ${vkcv_source}/vkcv/Surface.hpp
-        ${vkcv_source}/vkcv/Surface.cpp
-        
+
         ${vkcv_source}/vkcv/ImageLayoutTransitions.hpp
         ${vkcv_source}/vkcv/ImageLayoutTransitions.cpp
 
@@ -72,6 +69,14 @@ set(vkcv_sources
 		${vkcv_source}/vkcv/SamplerManager.cpp
         
         ${vkcv_include}/vkcv/DescriptorWrites.hpp
-
+		
 		${vkcv_include}/vkcv/DescriptorSetLayout.hpp
+        
+        ${vkcv_include}/vkcv/DrawcallRecording.hpp
+        ${vkcv_source}/vkcv/DrawcallRecording.cpp
+        
+        ${vkcv_include}/vkcv/CommandStreamManager.hpp
+        ${vkcv_source}/vkcv/CommandStreamManager.cpp
+        
+        ${vkcv_include}/vkcv/CommandRecordingFunctionTypes.hpp
 )
diff --git a/include/vkcv/Buffer.hpp b/include/vkcv/Buffer.hpp
index d327067ce409e845bcac5e4c9f56e7de59df89c2..ae935ba9501d4d7776cad7e3ba190a2dd02e5e38 100644
--- a/include/vkcv/Buffer.hpp
+++ b/include/vkcv/Buffer.hpp
@@ -37,6 +37,11 @@ namespace vkcv {
 		size_t getSize() const {
 			return m_count * sizeof(T);
 		}
+
+        [[nodiscard]]
+        const vk::Buffer getVulkanHandle() const {
+            return m_manager->getBuffer(m_handle);
+        }
 		
 		void fill(const T* data, size_t count = 0, size_t offset = 0) {
 			 m_manager->fillBuffer(m_handle, data, count * sizeof(T), offset * sizeof(T));
diff --git a/include/vkcv/CommandRecordingFunctionTypes.hpp b/include/vkcv/CommandRecordingFunctionTypes.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..c236fb2c717afd2a3bafc4b3a22708cdac942ffe
--- /dev/null
+++ b/include/vkcv/CommandRecordingFunctionTypes.hpp
@@ -0,0 +1,8 @@
+#pragma once
+#include "vkcv/Event.hpp"
+#include <vulkan/vulkan.hpp>
+
+namespace vkcv {
+	typedef typename event_function<const vk::CommandBuffer&>::type RecordCommandFunction;
+	typedef typename event_function<>::type FinishCommandFunction;
+}
\ No newline at end of file
diff --git a/include/vkcv/CommandStreamManager.hpp b/include/vkcv/CommandStreamManager.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..4af2127ccf6271f1076e3dde05304b8f9c556139
--- /dev/null
+++ b/include/vkcv/CommandStreamManager.hpp
@@ -0,0 +1,55 @@
+#pragma once
+#include <vulkan/vulkan.hpp>
+#include <vector>
+#include "vkcv/Event.hpp"
+#include "vkcv/Handles.hpp"
+#include "vkcv/CommandRecordingFunctionTypes.hpp"
+
+namespace vkcv {
+	
+	class Core;
+
+	class CommandStreamManager
+	{
+		friend class Core;
+	private:
+		struct CommandStream {
+			inline CommandStream(vk::CommandBuffer cmdBuffer, vk::Queue queue, vk::CommandPool cmdPool) 
+				: cmdBuffer(cmdBuffer), cmdPool(cmdPool), queue(queue) {};
+			vk::CommandBuffer                   cmdBuffer;
+			vk::CommandPool                     cmdPool;
+			vk::Queue                           queue;
+			std::vector<FinishCommandFunction>  callbacks;
+		};
+
+		Core* m_core;
+		std::vector<CommandStream> m_commandStreams;
+
+		CommandStreamManager() noexcept;
+
+		void init(Core* core);
+
+	public:
+		~CommandStreamManager() noexcept;
+
+		CommandStreamManager(CommandStreamManager&& other) = delete;
+		CommandStreamManager(const CommandStreamManager& other) = delete;
+
+		CommandStreamManager& operator=(CommandStreamManager&& other) = delete;
+		CommandStreamManager& operator=(const CommandStreamManager& other) = delete;
+
+		CommandStreamHandle createCommandStream(
+			const vk::Queue queue,
+			vk::CommandPool cmdPool);
+
+		void recordCommandsToStream(const CommandStreamHandle handle, const RecordCommandFunction record);
+		void addFinishCallbackToStream(const CommandStreamHandle handle, const FinishCommandFunction finish);
+		void submitCommandStreamSynchronous(
+			const CommandStreamHandle   handle,
+			std::vector<vk::Semaphore>  &waitSemaphores,
+			std::vector<vk::Semaphore>  &signalSemaphores);
+
+		vk::CommandBuffer getStreamCommandBuffer(const CommandStreamHandle handle);
+	};
+
+}
\ No newline at end of file
diff --git a/include/vkcv/Core.hpp b/include/vkcv/Core.hpp
index ea9b5c773a7db8abb1d78bf2b3b739b672ab249a..8a165adf43561b1204490a12afa00d2a3fabdbf4 100644
--- a/include/vkcv/Core.hpp
+++ b/include/vkcv/Core.hpp
@@ -22,13 +22,11 @@
 #include "Sampler.hpp"
 #include "DescriptorWrites.hpp"
 #include "Event.hpp"
+#include "DrawcallRecording.hpp"
+#include "CommandRecordingFunctionTypes.hpp"
 
 namespace vkcv
 {
-	struct VertexBufferBinding {
-		vk::DeviceSize	offset;
-		BufferHandle	buffer;
-	};
 
     // forward declarations
     class PassManager;
@@ -37,15 +35,13 @@ namespace vkcv
     class BufferManager;
     class SamplerManager;
     class ImageManager;
+	class CommandStreamManager;
 
 	struct SubmitInfo {
 		QueueType queueType;
 		std::vector<vk::Semaphore> waitSemaphores;
 		std::vector<vk::Semaphore> signalSemaphores;
 	};
-	
-	typedef typename event_function<const vk::CommandBuffer&>::type RecordCommandFunction;
-	typedef typename event_function<>::type FinishCommandFunction;
 
     class Core final
     {
@@ -56,40 +52,38 @@ namespace vkcv
          *
          * @param context encapsulates various Vulkan objects
          */
-        Core(Context &&context, Window &window, SwapChain swapChain,  std::vector<vk::ImageView> imageViews,
+        Core(Context &&context, Window &window, const SwapChain& swapChain,  std::vector<vk::ImageView> imageViews,
 			const CommandResources& commandResources, const SyncResources& syncResources) noexcept;
         // explicit destruction of default constructor
         Core() = delete;
 
 		Result acquireSwapchainImage();
-		void destroyTemporaryFramebuffers();
 
         Context m_Context;
 
-        SwapChain					m_swapchain;
-        std::vector<vk::ImageView>	m_swapchainImageViews;
-        const Window&				m_window;
+        SwapChain                       m_swapchain;
+        std::vector<vk::ImageView>      m_swapchainImageViews;
+        std::vector<vk::Image>          m_swapchainImages;
+		std::vector<vk::ImageLayout>    m_swapchainImageLayouts;
+        const Window&                   m_window;
 
-        std::unique_ptr<PassManager>		m_PassManager;
-        std::unique_ptr<PipelineManager>	m_PipelineManager;
-        std::unique_ptr<DescriptorManager>	m_DescriptorManager;
-        std::unique_ptr<BufferManager>		m_BufferManager;
-        std::unique_ptr<SamplerManager>		m_SamplerManager;
-        std::unique_ptr<ImageManager>		m_ImageManager;
+        std::unique_ptr<PassManager>            m_PassManager;
+        std::unique_ptr<PipelineManager>        m_PipelineManager;
+        std::unique_ptr<DescriptorManager>      m_DescriptorManager;
+        std::unique_ptr<BufferManager>          m_BufferManager;
+        std::unique_ptr<SamplerManager>         m_SamplerManager;
+        std::unique_ptr<ImageManager>           m_ImageManager;
+        std::unique_ptr<CommandStreamManager>   m_CommandStreamManager;
 
-		CommandResources				m_CommandResources;
-		SyncResources					m_SyncResources;
-		uint32_t						m_currentSwapchainImageIndex;
-		std::vector<vk::Framebuffer>	m_TemporaryFramebuffers;
-		
-		ImageHandle						m_DepthImage;
+		CommandResources    m_CommandResources;
+		SyncResources       m_SyncResources;
+		uint32_t            m_currentSwapchainImageIndex;
 
-        /**
-         * recreates the swapchain
-         * @param[in] width new window width
-         * @param[in] height new window hight
-         */
-        static void recreateSwapchain(int width, int height);
+        std::function<void(int, int)> e_resizeHandle;
+
+        static std::vector<vk::ImageView> createImageViews( Context &context, SwapChain& swapChain);
+
+		void recordSwapchainImageLayoutTransition(vk::CommandBuffer cmdBuffer, vk::ImageLayout newLayout);
 
     public:
         /**
@@ -216,31 +210,23 @@ namespace vkcv
          *   @return
          */
         [[nodiscard]]
-        ResourcesHandle createResourceDescription(const std::vector<DescriptorSetConfig> &descriptorSets);
-		void writeResourceDescription(ResourcesHandle handle, size_t setIndex, const DescriptorWrites& writes);
+        DescriptorSetHandle createDescriptorSet(const std::vector<DescriptorBinding> &bindings);
+		void writeResourceDescription(DescriptorSetHandle handle, size_t setIndex, const DescriptorWrites& writes);
 
-		vk::DescriptorSetLayout getDescritorSetLayout(ResourcesHandle handle, size_t setIndex);
+		DescriptorSet getDescriptorSet(const DescriptorSetHandle handle) const;
 
 		/**
 		 * @brief start recording command buffers and increment frame index
 		*/
-		void beginFrame();
+		bool beginFrame(uint32_t& width, uint32_t& height);
 
-		/**
-		 * @brief render a beautiful triangle
-		*/
-		void renderMesh(
-			const PassHandle						renderpassHandle, 
-			const PipelineHandle					pipelineHandle,
-			const uint32_t							width,
-			const uint32_t							height,
-			const size_t							pushConstantSize, 
-			const void*								pushConstantData, 
-			const std::vector<VertexBufferBinding>	&vertexBufferBindings, 
-			const BufferHandle						indexBuffer, 
-			const size_t							indexCount,
-			const vkcv::ResourcesHandle				resourceHandle,
-			const size_t							resourceDescriptorSetIndex);
+		void recordDrawcallsToCmdStream(
+            const CommandStreamHandle       cmdStreamHandle,
+			const PassHandle                renderpassHandle, 
+			const PipelineHandle            pipelineHandle,
+			const PushConstantData          &pushConstantData,
+			const std::vector<DrawcallInfo> &drawcalls,
+			const std::vector<ImageHandle>  &renderTargets);
 
 		/**
 		 * @brief end recording and present image
@@ -258,6 +244,20 @@ namespace vkcv
 		 * @param record Record-command-function
 		 * @param finish Finish-command-function or nullptr
 		 */
-		void submitCommands(const SubmitInfo &submitInfo, const RecordCommandFunction& record, const FinishCommandFunction& finish);
+		void recordAndSubmitCommands(
+			const SubmitInfo            &submitInfo, 
+			const RecordCommandFunction &record, 
+			const FinishCommandFunction &finish);
+
+		CommandStreamHandle createCommandStream(QueueType queueType);
+
+		void recordCommandsToStream(
+			const CommandStreamHandle   cmdStreamHandle,
+			const RecordCommandFunction &record,
+			const FinishCommandFunction &finish);
+
+		void submitCommandStream(const CommandStreamHandle handle);
+		void prepareSwapchainImageForPresent(const CommandStreamHandle handle);
+		void prepareImageForSampling(const CommandStreamHandle cmdStream, const ImageHandle image);
     };
 }
diff --git a/include/vkcv/DescriptorConfig.hpp b/include/vkcv/DescriptorConfig.hpp
index 161273db1ec3bd0be290ecdd1042d12d181d303e..86c2e20eb37633e4519749bef507161133e57425 100644
--- a/include/vkcv/DescriptorConfig.hpp
+++ b/include/vkcv/DescriptorConfig.hpp
@@ -1,8 +1,16 @@
 #pragma once
 #include <vkcv/ShaderProgram.hpp>
+#include <vkcv/Handles.hpp>
+#include <vulkan/vulkan.hpp>
 
 namespace vkcv
 {
+    struct DescriptorSet
+    {
+        vk::DescriptorSet       vulkanHandle;
+        vk::DescriptorSetLayout layout;
+    };
+
     /*
     * All the types of descriptors (resources) that can be retrieved by the shaders
     */
@@ -24,7 +32,6 @@ namespace vkcv
     */
     struct DescriptorBinding
     {
-        DescriptorBinding() = delete;
         DescriptorBinding(
             DescriptorType descriptorType,
             uint32_t descriptorCount,
@@ -35,16 +42,4 @@ namespace vkcv
         uint32_t descriptorCount;
         ShaderStage shaderStage;
     };
-
-    /*
-    * One descriptor set struct that contains all the necessary information for the actual creation.
-    * @param[in] a number of bindings that were created beforehand
-    * @param[in] the number of (identical) sets that should be created from the attached bindings
-    */
-    struct DescriptorSetConfig
-    {
-        explicit DescriptorSetConfig(std::vector<DescriptorBinding> bindings) noexcept;
-
-        std::vector<DescriptorBinding> bindings;
-    };
 }
diff --git a/include/vkcv/DrawcallRecording.hpp b/include/vkcv/DrawcallRecording.hpp
new file mode 100644
index 0000000000000000000000000000000000000000..0929ad038fb95ec1573e7c76e5ce13adb84ab760
--- /dev/null
+++ b/include/vkcv/DrawcallRecording.hpp
@@ -0,0 +1,54 @@
+#pragma once
+#include <vulkan/vulkan.hpp>
+#include <vkcv/Handles.hpp>
+#include <vkcv/DescriptorConfig.hpp>
+
+namespace vkcv {
+    struct VertexBufferBinding {
+        inline VertexBufferBinding(vk::DeviceSize offset, vk::Buffer buffer) noexcept
+            : offset(offset), buffer(buffer) {}
+
+        vk::DeviceSize  offset;
+        vk::Buffer      buffer;
+    };
+
+    struct DescriptorSetUsage {
+        inline DescriptorSetUsage(uint32_t setLocation, vk::DescriptorSet vulkanHandle) noexcept
+            : setLocation(setLocation), vulkanHandle(vulkanHandle) {}
+
+        const uint32_t          setLocation;
+        const vk::DescriptorSet vulkanHandle;
+    };
+
+    struct Mesh {
+        inline Mesh(std::vector<VertexBufferBinding> vertexBufferBindings, vk::Buffer indexBuffer, size_t indexCount) noexcept
+            : vertexBufferBindings(vertexBufferBindings), indexBuffer(indexBuffer), indexCount(indexCount){}
+
+        std::vector<VertexBufferBinding>    vertexBufferBindings;
+        vk::Buffer                          indexBuffer;
+        size_t                              indexCount;
+    };
+
+    struct PushConstantData {
+        inline PushConstantData(void* data, size_t sizePerDrawcall) : data(data), sizePerDrawcall(sizePerDrawcall) {}
+
+        void* data;
+        size_t  sizePerDrawcall;
+    };
+
+    struct DrawcallInfo {
+        inline DrawcallInfo(const Mesh& mesh, const std::vector<DescriptorSetUsage>& descriptorSets)
+            : mesh(mesh), descriptorSets(descriptorSets) {}
+
+        Mesh                            mesh;
+        std::vector<DescriptorSetUsage> descriptorSets;
+    };
+
+    void recordDrawcall(
+        const DrawcallInfo      &drawcall,
+        vk::CommandBuffer       cmdBuffer,
+        vk::PipelineLayout      pipelineLayout,
+        const PushConstantData  &pushConstantData,
+        const size_t            drawcallIndex);
+
+}
\ No newline at end of file
diff --git a/include/vkcv/Handles.hpp b/include/vkcv/Handles.hpp
index 86cd55557ed73d3886d8708836a1f6f07cd02898..ea05bd212dd9314957e4771070bedb3963b1b2dc 100644
--- a/include/vkcv/Handles.hpp
+++ b/include/vkcv/Handles.hpp
@@ -79,7 +79,7 @@ namespace vkcv
 		using Handle::Handle;
 	};
 	
-	class ResourcesHandle : public Handle {
+	class DescriptorSetHandle : public Handle {
 		friend class DescriptorManager;
 	private:
 		using Handle::Handle;
@@ -93,8 +93,19 @@ namespace vkcv
 
 	class ImageHandle : public Handle {
 		friend class ImageManager;
-	private:
 		using Handle::Handle;
+	public:
+		[[nodiscard]]
+		bool isSwapchainImage() const;
+		
+		static ImageHandle createSwapchainImageHandle(const HandleDestroyFunction& destroy = nullptr);
+		
 	};
+
+    class CommandStreamHandle : public Handle {
+        friend class CommandStreamManager;
+    private:
+        using Handle::Handle;
+    };
 	
 }
diff --git a/include/vkcv/Image.hpp b/include/vkcv/Image.hpp
index d76bd12169f622f05f1731b0eb3065d6133a5f2f..a1219ce4147ebbb8ae0650da8a87766f8967874b 100644
--- a/include/vkcv/Image.hpp
+++ b/include/vkcv/Image.hpp
@@ -9,8 +9,12 @@
 #include "Handles.hpp"
 
 namespace vkcv {
-	
-	class ImageManager;
+
+    // forward declares
+    class ImageManager;
+
+	bool isDepthFormat(const vk::Format format);
+
 	class Image {
 		friend class Core;
 	public:
@@ -37,11 +41,9 @@ namespace vkcv {
 		void fill(void* data, size_t size = SIZE_MAX);
 	private:
 		ImageManager* const m_manager;
-		const ImageHandle m_handle;
-		const vk::Format m_format;
-		vk::ImageLayout m_layout;
+		const ImageHandle   m_handle;
 
-		Image(ImageManager* manager, const ImageHandle& handle, vk::Format format);
+		Image(ImageManager* manager, const ImageHandle& handle);
 		
 		static Image create(ImageManager* manager, vk::Format format, uint32_t width, uint32_t height, uint32_t depth);
 		
diff --git a/include/vkcv/PassConfig.hpp b/include/vkcv/PassConfig.hpp
index d9a5bcd83acca5f5ba86b4e6ce6973acbed89de6..8f3b516d4b4451c513366fbd8469908bccde6a5f 100644
--- a/include/vkcv/PassConfig.hpp
+++ b/include/vkcv/PassConfig.hpp
@@ -32,23 +32,15 @@ namespace vkcv
 
     struct AttachmentDescription
     {
-        AttachmentDescription() = delete;
         AttachmentDescription(
-			AttachmentLayout initial,
-			AttachmentLayout in_pass,
-			AttachmentLayout final,
-			AttachmentOperation store_op,
-			AttachmentOperation load_op,
-			vk::Format format) noexcept;
-
-        AttachmentLayout layout_initial;
-        AttachmentLayout layout_in_pass;
-        AttachmentLayout layout_final;
+            AttachmentOperation store_op,
+            AttachmentOperation load_op,
+            vk::Format format) noexcept;
 
         AttachmentOperation store_operation;
         AttachmentOperation load_operation;
 
-		vk::Format format;
+        vk::Format format;
     };
 
     struct PassConfig
diff --git a/include/vkcv/PipelineConfig.hpp b/include/vkcv/PipelineConfig.hpp
index a8e1334f3ee5d6774b9fed35edd685f19747814d..7dc6f2200db7efc1abdddab81145daec27540c49 100644
--- a/include/vkcv/PipelineConfig.hpp
+++ b/include/vkcv/PipelineConfig.hpp
@@ -24,19 +24,22 @@ namespace vkcv {
          * @param passHandle handle for Render Pass
          */
         PipelineConfig(
-			const ShaderProgram&						shaderProgram, 
-			uint32_t									width, 
-			uint32_t									height, 
-			PassHandle									&passHandle,
-			const std::vector<VertexAttribute>			&vertexAttributes,
-			const std::vector<vk::DescriptorSetLayout>	&descriptorLayouts);
+            const ShaderProgram&                        shaderProgram,
+            uint32_t                                    width,
+            uint32_t                                    height,
+            const PassHandle                            &passHandle,
+            const std::vector<VertexAttribute>          &vertexAttributes,
+            const std::vector<vk::DescriptorSetLayout>  &descriptorLayouts,
+            bool                                        useDynamicViewport);
+
+        ShaderProgram                           m_ShaderProgram;
+        uint32_t                                m_Height;
+        uint32_t                                m_Width;
+        PassHandle                              m_PassHandle;
+        std::vector<VertexAttribute>            m_VertexAttributes;
+        std::vector<vk::DescriptorSetLayout>    m_DescriptorLayouts;
+        bool                                    m_UseDynamicViewport;
 
-		ShaderProgram							m_ShaderProgram;
-        uint32_t								m_Height;
-        uint32_t								m_Width;
-        PassHandle								m_PassHandle;
-		std::vector<VertexAttribute>			m_vertexAttributes;
-		std::vector<vk::DescriptorSetLayout>	m_descriptorLayouts;
     };
 
 }
\ No newline at end of file
diff --git a/include/vkcv/ShaderProgram.hpp b/include/vkcv/ShaderProgram.hpp
index 48a8c7672c57a560ca4eaeba2149b62aef1b10ed..fe637f288947e539bc57723a443ae6b67ade0c05 100644
--- a/include/vkcv/ShaderProgram.hpp
+++ b/include/vkcv/ShaderProgram.hpp
@@ -59,6 +59,7 @@ namespace vkcv {
         void reflectShader(ShaderStage shaderStage);
 
         const VertexLayout &getVertexLayout() const;
+		size_t getPushConstantSize() const;
 
         const DescriptorSetLayout &getDescriptorSetLayout() const;
 
@@ -67,5 +68,6 @@ namespace vkcv {
 
         VertexLayout m_VertexLayout;
         DescriptorSetLayout m_DescriptorSetLayout;
+		size_t m_pushConstantSize = 0;
 	};
 }
diff --git a/include/vkcv/SwapChain.hpp b/include/vkcv/SwapChain.hpp
index 1087d6364f6f811b741904d4e2b31fcfeb450901..089205d1633551b4ad9f11d0bdd5540b2bb61bbb 100644
--- a/include/vkcv/SwapChain.hpp
+++ b/include/vkcv/SwapChain.hpp
@@ -3,15 +3,32 @@
 #include "Context.hpp"
 #include "vkcv/Window.hpp"
 
-namespace vkcv {
+#include <atomic>
+
+namespace vkcv
+{
     class SwapChain final {
     private:
 
-        vk::SurfaceKHR m_surface;
-        vk::SwapchainKHR m_swapchain;
-        vk::SurfaceFormatKHR m_format;
+        struct Surface
+        {
+            vk::SurfaceKHR handle;
+            std::vector<vk::SurfaceFormatKHR> formats;
+            vk::SurfaceCapabilitiesKHR capabilities;
+            std::vector<vk::PresentModeKHR> presentModes;
+        };
+        
+        Surface m_Surface;
 
-		uint32_t m_ImageCount;
+        vk::SwapchainKHR m_Swapchain;
+        vk::Format m_SwapchainFormat;
+        vk::ColorSpaceKHR m_SwapchainColorSpace;
+        vk::PresentModeKHR m_SwapchainPresentMode;
+		uint32_t m_SwapchainImageCount;
+	
+		vk::Extent2D m_Extent;
+	
+		std::atomic<bool> m_RecreationRequired;
 
         /**
          * Constructor of a SwapChain object
@@ -21,11 +38,17 @@ namespace vkcv {
          * @param swapchain to show images in the window
          * @param format
          */
-        SwapChain(vk::SurfaceKHR surface, vk::SwapchainKHR swapchain, vk::SurfaceFormatKHR format, uint32_t imageCount);
+         // TODO:
+        SwapChain(const Surface &surface,
+                  vk::SwapchainKHR swapchain,
+                  vk::Format format,
+                  vk::ColorSpaceKHR colorSpace,
+                  vk::PresentModeKHR presentMode,
+                  uint32_t imageCount,
+				  vk::Extent2D extent) noexcept;
 
     public:
-        SwapChain(const SwapChain &other) = default;
-        SwapChain(SwapChain &&other) = default;
+    	SwapChain(const SwapChain& other);
 
         /**
          * @return The swapchain linked with the #SwapChain class
@@ -39,13 +62,14 @@ namespace vkcv {
          * @return current surface
          */
         [[nodiscard]]
-        vk::SurfaceKHR getSurface();
+        vk::SurfaceKHR getSurface() const;
+
         /**
-         * gets the current surface format
-         * @return gets the surface format
+         * gets the chosen swapchain format
+         * @return gets the chosen swapchain format
          */
         [[nodiscard]]
-        vk::SurfaceFormatKHR getSurfaceFormat();
+        vk::Format getSwapchainFormat() const;
 
         /**
          * creates a swap chain object out of the given window and the given context
@@ -53,7 +77,7 @@ namespace vkcv {
          * @param context of the application
          * @return returns an object of swapChain
          */
-        static SwapChain create(const Window &window, const Context &context, const vk::SurfaceKHR surface);
+        static SwapChain create(const Window &window, const Context &context);
 
         /**
          * Destructor of SwapChain
@@ -64,6 +88,34 @@ namespace vkcv {
 		 * @return number of images in swapchain
 		*/
 		uint32_t getImageCount();
-    };
+		
+		/**
+		 * TODO
+		 *
+		 * @return
+		 */
+		bool shouldUpdateSwapchain() const;
 
+		/**
+		 * TODO
+		 *
+		 * context
+		 * window
+		 */
+		void updateSwapchain(const Context &context, const Window &window);
+		
+		/**
+		 *
+		 */
+        void signalSwapchainRecreation();
+	
+        /**
+         * TODO
+         *
+         * @return
+         */
+        [[nodiscard]]
+		const vk::Extent2D& getExtent() const;
+    
+    };
 }
diff --git a/include/vkcv/Window.hpp b/include/vkcv/Window.hpp
index 7428c7c73eb481f7352821faed36257211dfd5bf..f71671c935a0a5e17bb517c726d75ffff2973532 100644
--- a/include/vkcv/Window.hpp
+++ b/include/vkcv/Window.hpp
@@ -17,7 +17,6 @@ namespace vkcv {
     private:
         GLFWwindow *m_window;
 
-
         /**
          *
          * @param GLFWwindow of the class
diff --git a/modules/camera/include/vkcv/camera/Camera.hpp b/modules/camera/include/vkcv/camera/Camera.hpp
index 7e177b9a2fbde0890e0c8ea6a1d9a19d6e277c7c..ff8fda811eaad7a99dbb940601f9e5904025255e 100644
--- a/modules/camera/include/vkcv/camera/Camera.hpp
+++ b/modules/camera/include/vkcv/camera/Camera.hpp
@@ -63,7 +63,7 @@ namespace vkcv {
         
         void changeFov(double fov);
 
-        void updateRatio(float ratio);
+        void updateRatio(int width, int height);
 
         float getRatio() const;
 
diff --git a/modules/camera/include/vkcv/camera/CameraManager.hpp b/modules/camera/include/vkcv/camera/CameraManager.hpp
index 9511b752e972afb1e10f41a118433a4e8933fd65..4e52eccea25e8544a9a5cc89d0dc74ddd0e023c6 100644
--- a/modules/camera/include/vkcv/camera/CameraManager.hpp
+++ b/modules/camera/include/vkcv/camera/CameraManager.hpp
@@ -9,10 +9,11 @@ namespace vkcv{
 
     class CameraManager{
     private:
-        std::function<void(int, int, int, int)> m_keyHandle;
-        std::function<void(double, double)> m_mouseMoveHandle;
-        std::function<void(double, double)> m_mouseScrollHandle;
-        std::function<void(int, int, int)> m_mouseButtonHandle;
+        std::function<void(int, int, int, int)> e_keyHandle;
+        std::function<void(double, double)> e_mouseMoveHandle;
+        std::function<void(double, double)> e_mouseScrollHandle;
+        std::function<void(int, int, int)> e_mouseButtonHandle;
+        std::function<void(int, int)> e_resizeHandle;
 
         Window &m_window;
         Camera m_camera;
@@ -29,6 +30,7 @@ namespace vkcv{
         void scrollCallback( double offsetX, double offsetY);
         void mouseMoveCallback( double offsetX, double offsetY);
         void mouseButtonCallback(int button, int action, int mods);
+        void resizeCallback(int width, int height);
 
     public:
         CameraManager(Window &window, float width, float height, glm::vec3 up = glm::vec3(0.0f,-1.0f,0.0f), glm::vec3 position = glm::vec3(0.0f,0.0f,0.0f));
diff --git a/modules/camera/src/vkcv/camera/Camera.cpp b/modules/camera/src/vkcv/camera/Camera.cpp
index bc8a8498e67a6bd751f5a6ed1d4c4fba0279a68d..af89ed86881acc8b754a041d32599a78caac57b4 100644
--- a/modules/camera/src/vkcv/camera/Camera.cpp
+++ b/modules/camera/src/vkcv/camera/Camera.cpp
@@ -82,13 +82,15 @@ namespace vkcv {
         setFov(fov);
     }
 
-    void Camera::updateRatio( float ratio){
-        m_ratio = ratio;
+    void Camera::updateRatio( int width, int height){
+        m_width = width;
+        m_height = height;
+        m_ratio = static_cast<float>(width)/glm::max(height, 1);
         setPerspective( m_fov, m_ratio, m_near, m_far);
     }
 
     float Camera::getRatio() const {
-        return 0.0f;
+        return m_ratio;
     }
 
     void Camera::setNearFar( float near, float far){
diff --git a/modules/camera/src/vkcv/camera/CameraManager.cpp b/modules/camera/src/vkcv/camera/CameraManager.cpp
index 18f499a2b34b64c1442c5d9e267d6476b8d69199..2631890d646fbf27a4fbb14cfeef706678d8918c 100644
--- a/modules/camera/src/vkcv/camera/CameraManager.cpp
+++ b/modules/camera/src/vkcv/camera/CameraManager.cpp
@@ -15,10 +15,11 @@ namespace vkcv{
     }
 
     void CameraManager::bindCamera(){
-        m_keyHandle = m_window.e_key.add( [&](int key, int scancode, int action, int mods) { this->keyCallback(key, scancode, action, mods); });
-        m_mouseMoveHandle = m_window.e_mouseMove.add( [&]( double offsetX, double offsetY) {this->mouseMoveCallback( offsetX, offsetY);} );
-        m_mouseScrollHandle =  m_window.e_mouseScroll.add([&](double offsetX, double offsetY) {this->scrollCallback( offsetX, offsetY);} );
-        m_mouseButtonHandle = m_window.e_mouseButton.add([&] (int button, int action, int mods) {this->mouseButtonCallback( button,  action,  mods);});
+        e_keyHandle = m_window.e_key.add( [&](int key, int scancode, int action, int mods) { this->keyCallback(key, scancode, action, mods); });
+        e_mouseMoveHandle = m_window.e_mouseMove.add( [&]( double offsetX, double offsetY) {this->mouseMoveCallback( offsetX, offsetY);} );
+        e_mouseScrollHandle =  m_window.e_mouseScroll.add([&](double offsetX, double offsetY) {this->scrollCallback( offsetX, offsetY);} );
+        e_mouseButtonHandle = m_window.e_mouseButton.add([&] (int button, int action, int mods) {this->mouseButtonCallback( button,  action,  mods);});
+        e_resizeHandle = m_window.e_resize.add([&] (int width, int height) {this->resizeCallback( width, height);});
     }
 
     void CameraManager::mouseButtonCallback(int button, int action, int mods){
@@ -75,6 +76,11 @@ namespace vkcv{
                 break;
         }
     }
+
+    void CameraManager::resizeCallback(int width, int height){
+            m_camera.updateRatio(width, height);
+    }
+
     Camera &CameraManager::getCamera(){
         return m_camera;
     }
diff --git a/projects/CMakeLists.txt b/projects/CMakeLists.txt
index 7ca73a0811df7f1568508b56312ce3348237a695..ccbdaf4101c5dabb3e9d43788e255eab85ad5776 100644
--- a/projects/CMakeLists.txt
+++ b/projects/CMakeLists.txt
@@ -2,3 +2,4 @@
 # Add new projects/examples here:
 add_subdirectory(first_triangle)
 add_subdirectory(first_mesh)
+add_subdirectory(cmd_sync_test)
\ No newline at end of file
diff --git a/projects/cmd_sync_test/.gitignore b/projects/cmd_sync_test/.gitignore
new file mode 100644
index 0000000000000000000000000000000000000000..16f72da367245ad14a38ee756816f06f8cbbe3d2
--- /dev/null
+++ b/projects/cmd_sync_test/.gitignore
@@ -0,0 +1 @@
+cmd_sync_test
\ No newline at end of file
diff --git a/projects/cmd_sync_test/CMakeLists.txt b/projects/cmd_sync_test/CMakeLists.txt
new file mode 100644
index 0000000000000000000000000000000000000000..da1d12949d9e8c918d78ab5cb0484106fae69b6a
--- /dev/null
+++ b/projects/cmd_sync_test/CMakeLists.txt
@@ -0,0 +1,28 @@
+cmake_minimum_required(VERSION 3.16)
+project(cmd_sync_test)
+
+# setting c++ standard for the project
+set(CMAKE_CXX_STANDARD 17)
+set(CMAKE_CXX_STANDARD_REQUIRED ON)
+
+# this should fix the execution path to load local files from the project
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+
+# adding source files to the project
+add_executable(cmd_sync_test src/main.cpp)
+
+# this should fix the execution path to load local files from the project (for MSVC)
+if(MSVC)
+	set_target_properties(cmd_sync_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+	set_target_properties(cmd_sync_test PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+    
+    # in addition to setting the output directory, the working directory has to be set
+	# by default visual studio sets the working directory to the build directory, when using the debugger
+	set_target_properties(cmd_sync_test PROPERTIES VS_DEBUGGER_WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY})
+endif()
+
+# including headers of dependencies and the VkCV framework
+target_include_directories(cmd_sync_test SYSTEM BEFORE PRIVATE ${vkcv_include} ${vkcv_includes} ${vkcv_asset_loader_include} ${vkcv_camera_include})
+
+# linking with libraries from all dependencies and the VkCV framework
+target_link_libraries(cmd_sync_test vkcv ${vkcv_libraries} vkcv_asset_loader ${vkcv_asset_loader_libraries} vkcv_camera)
diff --git a/projects/cmd_sync_test/resources/cube/boards2_vcyc_jpg.jpg b/projects/cmd_sync_test/resources/cube/boards2_vcyc_jpg.jpg
new file mode 100644
index 0000000000000000000000000000000000000000..2636039e272289c0fba3fa2d88a060b857501248
--- /dev/null
+++ b/projects/cmd_sync_test/resources/cube/boards2_vcyc_jpg.jpg
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:cca33a6e58ddd1b37a6e6853a9aa0e7b15ca678937119194752393dd2a0a0564
+size 1192476
diff --git a/projects/cmd_sync_test/resources/cube/cube.bin b/projects/cmd_sync_test/resources/cube/cube.bin
new file mode 100644
index 0000000000000000000000000000000000000000..3303cd8635848bee18e10ab8754d5e4e7218db92
--- /dev/null
+++ b/projects/cmd_sync_test/resources/cube/cube.bin
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:9bb9b6b8bbe50a0aaa517057f245ee844f80afa7426dacb2aed4128f71629ce4
+size 840
diff --git a/projects/cmd_sync_test/resources/cube/cube.blend b/projects/cmd_sync_test/resources/cube/cube.blend
new file mode 100644
index 0000000000000000000000000000000000000000..62ccb2c742094bcfb5ed194ab905bffae86bfd65
--- /dev/null
+++ b/projects/cmd_sync_test/resources/cube/cube.blend
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:a6c1e245f259c610528c9485db6688928faac0ab2addee9e3c2dde7740e4dd09
+size 774920
diff --git a/projects/cmd_sync_test/resources/cube/cube.blend1 b/projects/cmd_sync_test/resources/cube/cube.blend1
new file mode 100644
index 0000000000000000000000000000000000000000..13f21dcca218d7bc7a07a8a9682b5e1d9e607736
--- /dev/null
+++ b/projects/cmd_sync_test/resources/cube/cube.blend1
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f4496f423569b8ca81f3b3a55fad00f925557e0193fb9dbe6cdce7e71fb48f7b
+size 774920
diff --git a/projects/cmd_sync_test/resources/cube/cube.glb b/projects/cmd_sync_test/resources/cube/cube.glb
new file mode 100644
index 0000000000000000000000000000000000000000..66a42c65e71dcf375e04cc378256024dd3c7834d
--- /dev/null
+++ b/projects/cmd_sync_test/resources/cube/cube.glb
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:198568b715f397d78f7c358c0f709a419e7fd677e54cdec7c19f71b5ed264897
+size 1194508
diff --git a/projects/cmd_sync_test/resources/cube/cube.gltf b/projects/cmd_sync_test/resources/cube/cube.gltf
new file mode 100644
index 0000000000000000000000000000000000000000..428176144843dd06c78fe1d11a6392a0ea02b22d
--- /dev/null
+++ b/projects/cmd_sync_test/resources/cube/cube.gltf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f82f455647a84ca6242882ae26a79a499d3ce594f8de317ab89488c5b79721ac
+size 2823
diff --git a/projects/cmd_sync_test/resources/shaders/compile.bat b/projects/cmd_sync_test/resources/shaders/compile.bat
new file mode 100644
index 0000000000000000000000000000000000000000..516c2f2f78001e1a5d182356e7c3fe82d66a45ee
--- /dev/null
+++ b/projects/cmd_sync_test/resources/shaders/compile.bat
@@ -0,0 +1,5 @@
+%VULKAN_SDK%\Bin32\glslc.exe shader.vert -o vert.spv
+%VULKAN_SDK%\Bin32\glslc.exe shader.frag -o frag.spv
+%VULKAN_SDK%\Bin32\glslc.exe shadow.vert -o shadow_vert.spv
+%VULKAN_SDK%\Bin32\glslc.exe shadow.frag -o shadow_frag.spv
+pause
\ No newline at end of file
diff --git a/projects/cmd_sync_test/resources/shaders/frag.spv b/projects/cmd_sync_test/resources/shaders/frag.spv
new file mode 100644
index 0000000000000000000000000000000000000000..ff3110571871d65ce119dc6c5006e7e67aa53546
Binary files /dev/null and b/projects/cmd_sync_test/resources/shaders/frag.spv differ
diff --git a/projects/cmd_sync_test/resources/shaders/shader.frag b/projects/cmd_sync_test/resources/shaders/shader.frag
new file mode 100644
index 0000000000000000000000000000000000000000..95f1b3319e1ca5c7c34ff94e5e7198819c0233c1
--- /dev/null
+++ b/projects/cmd_sync_test/resources/shaders/shader.frag
@@ -0,0 +1,44 @@
+#version 450
+#extension GL_ARB_separate_shader_objects : enable
+
+layout(location = 0) in vec3 passNormal;
+layout(location = 1) in vec2 passUV;
+layout(location = 2) in vec3 passPos;
+
+layout(location = 0) out vec3 outColor;
+
+layout(set=0, binding=0) uniform texture2D  meshTexture;
+layout(set=0, binding=1) uniform sampler    textureSampler;
+layout(set=0, binding=2) uniform sunBuffer {
+    vec3 L; float padding;
+    mat4 lightMatrix;
+};
+layout(set=0, binding=3) uniform texture2D  shadowMap;
+layout(set=0, binding=4) uniform sampler    shadowMapSampler;
+
+float shadowTest(vec3 worldPos){
+    vec4 lightPos = lightMatrix * vec4(worldPos, 1);
+    lightPos /= lightPos.w;
+    lightPos.xy = lightPos.xy * 0.5 + 0.5;
+    
+    if(any(lessThan(lightPos.xy, vec2(0))) || any(greaterThan(lightPos.xy, vec2(1)))){
+        return 1;
+    }
+    
+    lightPos.z = clamp(lightPos.z, 0, 1);
+    
+    float shadowMapSample = texture(sampler2D(shadowMap, shadowMapSampler), lightPos.xy).r;
+    float bias = 0.01f;
+    shadowMapSample += bias;
+    return shadowMapSample < lightPos.z ? 0 : 1;
+}
+
+void main()	{
+    vec3 N = normalize(passNormal);
+    vec3 sunColor = vec3(1);
+    vec3 sun = sunColor * clamp(dot(N, L), 0, 1);
+    sun *= shadowTest(passPos);
+    vec3 ambient = vec3(0.1);
+    vec3 albedo = texture(sampler2D(meshTexture, textureSampler), passUV).rgb;
+	outColor = albedo * (sun + ambient);
+}
\ No newline at end of file
diff --git a/projects/cmd_sync_test/resources/shaders/shader.vert b/projects/cmd_sync_test/resources/shaders/shader.vert
new file mode 100644
index 0000000000000000000000000000000000000000..0ab82c203806356d0f35dc52c0a6988b286d90d1
--- /dev/null
+++ b/projects/cmd_sync_test/resources/shaders/shader.vert
@@ -0,0 +1,22 @@
+#version 450
+#extension GL_ARB_separate_shader_objects : enable
+
+layout(location = 0) in vec3 inPosition;
+layout(location = 1) in vec3 inNormal;
+layout(location = 2) in vec2 inUV;
+
+layout(location = 0) out vec3 passNormal;
+layout(location = 1) out vec2 passUV;
+layout(location = 2) out vec3 passPos;
+
+layout( push_constant ) uniform constants{
+    mat4 mvp;
+    mat4 model;
+};
+
+void main()	{
+	gl_Position = mvp * vec4(inPosition, 1.0);
+	passNormal  = inNormal;
+    passUV      = inUV;
+    passPos     = (model * vec4(inPosition, 1)).xyz;
+}
\ No newline at end of file
diff --git a/projects/cmd_sync_test/resources/shaders/shadow.frag b/projects/cmd_sync_test/resources/shaders/shadow.frag
new file mode 100644
index 0000000000000000000000000000000000000000..848f853f556660b4900b5db7fb6fc98d57c1cd5b
--- /dev/null
+++ b/projects/cmd_sync_test/resources/shaders/shadow.frag
@@ -0,0 +1,6 @@
+#version 450
+#extension GL_ARB_separate_shader_objects : enable
+
+void main()	{
+
+}
\ No newline at end of file
diff --git a/projects/cmd_sync_test/resources/shaders/shadow.vert b/projects/cmd_sync_test/resources/shaders/shadow.vert
new file mode 100644
index 0000000000000000000000000000000000000000..e0f41d42d575fa64fedbfa04adf89ac0f4aeebe8
--- /dev/null
+++ b/projects/cmd_sync_test/resources/shaders/shadow.vert
@@ -0,0 +1,12 @@
+#version 450
+#extension GL_ARB_separate_shader_objects : enable
+
+layout(location = 0) in vec3 inPosition;
+
+layout( push_constant ) uniform constants{
+    mat4 mvp;
+};
+
+void main()	{
+	gl_Position = mvp * vec4(inPosition, 1.0);
+}
\ No newline at end of file
diff --git a/projects/cmd_sync_test/resources/shaders/shadow_frag.spv b/projects/cmd_sync_test/resources/shaders/shadow_frag.spv
new file mode 100644
index 0000000000000000000000000000000000000000..6be3bd2518a3b1f234e39aea2503ba86cfb3314b
Binary files /dev/null and b/projects/cmd_sync_test/resources/shaders/shadow_frag.spv differ
diff --git a/projects/cmd_sync_test/resources/shaders/shadow_vert.spv b/projects/cmd_sync_test/resources/shaders/shadow_vert.spv
new file mode 100644
index 0000000000000000000000000000000000000000..afaa0824ee9be2c22209d611943c6512587dce24
Binary files /dev/null and b/projects/cmd_sync_test/resources/shaders/shadow_vert.spv differ
diff --git a/projects/cmd_sync_test/resources/shaders/vert.spv b/projects/cmd_sync_test/resources/shaders/vert.spv
new file mode 100644
index 0000000000000000000000000000000000000000..5e514eef5983927316465679af5461f507497130
Binary files /dev/null and b/projects/cmd_sync_test/resources/shaders/vert.spv differ
diff --git a/projects/cmd_sync_test/resources/triangle/Triangle.bin b/projects/cmd_sync_test/resources/triangle/Triangle.bin
new file mode 100644
index 0000000000000000000000000000000000000000..57f26ad96592b64377e6aa93823d96a94e6c5022
--- /dev/null
+++ b/projects/cmd_sync_test/resources/triangle/Triangle.bin
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:412ebd5f7242c266b4957e7e26be13aa331dbcb7bbb854ab334a2437ae8ed959
+size 104
diff --git a/projects/cmd_sync_test/resources/triangle/Triangle.blend b/projects/cmd_sync_test/resources/triangle/Triangle.blend
new file mode 100644
index 0000000000000000000000000000000000000000..2421dc5e1bb029d73a9ec09cc4530c5196851fd7
--- /dev/null
+++ b/projects/cmd_sync_test/resources/triangle/Triangle.blend
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:387e544df173219fbf292a64a6656d1d782bbf71a5a9e9fdef0a308f47b05477
+size 758144
diff --git a/projects/cmd_sync_test/resources/triangle/Triangle.glb b/projects/cmd_sync_test/resources/triangle/Triangle.glb
new file mode 100644
index 0000000000000000000000000000000000000000..4148620cd6af0dadbc791aa1c52bb5431a40884b
--- /dev/null
+++ b/projects/cmd_sync_test/resources/triangle/Triangle.glb
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:f4be087a605212d139416b5352a018283b26b99260cbcddb7013a1beeb331227
+size 980
diff --git a/projects/cmd_sync_test/resources/triangle/Triangle.gltf b/projects/cmd_sync_test/resources/triangle/Triangle.gltf
new file mode 100644
index 0000000000000000000000000000000000000000..a188e6ee16a5e8486cf307c7bda8cfd99bdbeea6
--- /dev/null
+++ b/projects/cmd_sync_test/resources/triangle/Triangle.gltf
@@ -0,0 +1,3 @@
+version https://git-lfs.github.com/spec/v1
+oid sha256:d5fc354e040f79cff329e919677b194c75e3a522c6406f75c1108ad9575f12ec
+size 2202
diff --git a/projects/cmd_sync_test/src/main.cpp b/projects/cmd_sync_test/src/main.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..a0fb29fafe24a4ae1279161dc8814c0d8f52765f
--- /dev/null
+++ b/projects/cmd_sync_test/src/main.cpp
@@ -0,0 +1,301 @@
+#include <iostream>
+#include <vkcv/Core.hpp>
+#include <GLFW/glfw3.h>
+#include <vkcv/camera/CameraManager.hpp>
+#include <chrono>
+#include <vkcv/asset/asset_loader.hpp>
+
+int main(int argc, const char** argv) {
+	const char* applicationName = "First Mesh";
+
+	uint32_t windowWidth = 800;
+	uint32_t windowHeight = 600;
+	
+	vkcv::Window window = vkcv::Window::create(
+		applicationName,
+		windowWidth,
+		windowHeight,
+		true
+	);
+
+	vkcv::CameraManager cameraManager(window, windowWidth, windowHeight);
+	cameraManager.getCamera().setPosition(glm::vec3(0.f, 0.f, 3.f));
+	cameraManager.getCamera().setNearFar(0.1, 30);
+
+	window.initEvents();
+
+	vkcv::Core core = vkcv::Core::create(
+		window,
+		applicationName,
+		VK_MAKE_VERSION(0, 0, 1),
+		{ vk::QueueFlagBits::eTransfer,vk::QueueFlagBits::eGraphics, vk::QueueFlagBits::eCompute },
+		{},
+		{ "VK_KHR_swapchain" }
+	);
+
+	vkcv::asset::Mesh mesh;
+
+	const char* path = argc > 1 ? argv[1] : "resources/cube/cube.gltf";
+	int result = vkcv::asset::loadMesh(path, mesh);
+
+	if (result == 1) {
+		std::cout << "Mesh loading successful!" << std::endl;
+	}
+	else {
+		std::cout << "Mesh loading failed: " << result << std::endl;
+		return 1;
+	}
+
+	assert(mesh.vertexGroups.size() > 0);
+	auto vertexBuffer = core.createBuffer<uint8_t>(
+			vkcv::BufferType::VERTEX,
+			mesh.vertexGroups[0].vertexBuffer.data.size(),
+			vkcv::BufferMemoryType::DEVICE_LOCAL
+	);
+	
+	vertexBuffer.fill(mesh.vertexGroups[0].vertexBuffer.data);
+
+	auto indexBuffer = core.createBuffer<uint8_t>(
+			vkcv::BufferType::INDEX,
+			mesh.vertexGroups[0].indexBuffer.data.size(),
+			vkcv::BufferMemoryType::DEVICE_LOCAL
+	);
+	
+	indexBuffer.fill(mesh.vertexGroups[0].indexBuffer.data);
+	
+	auto& attributes = mesh.vertexGroups[0].vertexBuffer.attributes;
+	
+	std::sort(attributes.begin(), attributes.end(), [](const vkcv::VertexAttribute& x, const vkcv::VertexAttribute& y) {
+		return static_cast<uint32_t>(x.type) < static_cast<uint32_t>(y.type);
+	});
+
+	const std::vector<vkcv::VertexBufferBinding> vertexBufferBindings = {
+		vkcv::VertexBufferBinding(attributes[0].offset, vertexBuffer.getVulkanHandle()),
+		vkcv::VertexBufferBinding(attributes[1].offset, vertexBuffer.getVulkanHandle()),
+		vkcv::VertexBufferBinding(attributes[2].offset, vertexBuffer.getVulkanHandle()) };
+
+	const vkcv::Mesh loadedMesh(vertexBufferBindings, indexBuffer.getVulkanHandle(), mesh.vertexGroups[0].numIndices);
+
+	// an example attachment for passes that output to the window
+	const vkcv::AttachmentDescription present_color_attachment(
+		vkcv::AttachmentOperation::STORE,
+		vkcv::AttachmentOperation::CLEAR,
+		core.getSwapchainImageFormat()
+	);
+	
+	const vkcv::AttachmentDescription depth_attachment(
+			vkcv::AttachmentOperation::STORE,
+			vkcv::AttachmentOperation::CLEAR,
+			vk::Format::eD32Sfloat
+	);
+
+	vkcv::PassConfig trianglePassDefinition({ present_color_attachment, depth_attachment });
+	vkcv::PassHandle trianglePass = core.createPass(trianglePassDefinition);
+
+	if (!trianglePass) {
+		std::cout << "Error. Could not create renderpass. Exiting." << std::endl;
+		return EXIT_FAILURE;
+	}
+
+	vkcv::ShaderProgram triangleShaderProgram{};
+	triangleShaderProgram.addShader(vkcv::ShaderStage::VERTEX, std::filesystem::path("resources/shaders/vert.spv"));
+	triangleShaderProgram.addShader(vkcv::ShaderStage::FRAGMENT, std::filesystem::path("resources/shaders/frag.spv"));
+	triangleShaderProgram.reflectShader(vkcv::ShaderStage::VERTEX);
+	triangleShaderProgram.reflectShader(vkcv::ShaderStage::FRAGMENT);
+	
+	std::vector<vkcv::DescriptorBinding> descriptorBindings = {
+		vkcv::DescriptorBinding(vkcv::DescriptorType::IMAGE_SAMPLED,    1, vkcv::ShaderStage::FRAGMENT),
+		vkcv::DescriptorBinding(vkcv::DescriptorType::SAMPLER,          1, vkcv::ShaderStage::FRAGMENT),
+		vkcv::DescriptorBinding(vkcv::DescriptorType::UNIFORM_BUFFER,   1, vkcv::ShaderStage::FRAGMENT),
+		vkcv::DescriptorBinding(vkcv::DescriptorType::IMAGE_SAMPLED,    1, vkcv::ShaderStage::FRAGMENT) ,
+		vkcv::DescriptorBinding(vkcv::DescriptorType::SAMPLER,          1, vkcv::ShaderStage::FRAGMENT) };
+	vkcv::DescriptorSetHandle descriptorSet = core.createDescriptorSet(descriptorBindings);
+
+	const vkcv::PipelineConfig trianglePipelineDefinition(
+		triangleShaderProgram, 
+		windowWidth,
+		windowHeight,
+		trianglePass,
+		attributes,
+		{ core.getDescriptorSet(descriptorSet).layout },
+		true);
+	vkcv::PipelineHandle trianglePipeline = core.createGraphicsPipeline(trianglePipelineDefinition);
+	
+	if (!trianglePipeline) {
+		std::cout << "Error. Could not create graphics pipeline. Exiting." << std::endl;
+		return EXIT_FAILURE;
+	}
+	
+	vkcv::Image texture = core.createImage(vk::Format::eR8G8B8A8Srgb, mesh.texture_hack.w, mesh.texture_hack.h);
+	texture.fill(mesh.texture_hack.img);
+
+	vkcv::SamplerHandle sampler = core.createSampler(
+		vkcv::SamplerFilterType::LINEAR,
+		vkcv::SamplerFilterType::LINEAR,
+		vkcv::SamplerMipmapMode::LINEAR,
+		vkcv::SamplerAddressMode::REPEAT
+	);
+
+    vkcv::SamplerHandle shadowSampler = core.createSampler(
+        vkcv::SamplerFilterType::NEAREST,
+        vkcv::SamplerFilterType::NEAREST,
+        vkcv::SamplerMipmapMode::NEAREST,
+        vkcv::SamplerAddressMode::CLAMP_TO_EDGE
+    );
+
+	vkcv::ImageHandle depthBuffer = core.createImage(vk::Format::eD32Sfloat, windowWidth, windowHeight).getHandle();
+
+	const vkcv::ImageHandle swapchainInput = vkcv::ImageHandle::createSwapchainImageHandle();
+
+	const vkcv::DescriptorSetUsage descriptorUsage(0, core.getDescriptorSet(descriptorSet).vulkanHandle);
+
+	const std::vector<glm::vec3> instancePositions = {
+		glm::vec3( 0.f, -2.f, 0.f),
+		glm::vec3( 3.f,  0.f, 0.f),
+		glm::vec3(-3.f,  0.f, 0.f),
+		glm::vec3( 0.f,  2.f, 0.f),
+		glm::vec3( 0.f, -5.f, 0.f)
+	};
+
+	std::vector<glm::mat4> modelMatrices;
+	std::vector<vkcv::DrawcallInfo> drawcalls;
+	std::vector<vkcv::DrawcallInfo> shadowDrawcalls;
+	for (const auto& position : instancePositions) {
+		modelMatrices.push_back(glm::translate(glm::mat4(1.f), position));
+		drawcalls.push_back(vkcv::DrawcallInfo(loadedMesh, { descriptorUsage }));
+		shadowDrawcalls.push_back(vkcv::DrawcallInfo(loadedMesh, {}));
+	}
+
+	modelMatrices.back() *= glm::scale(glm::mat4(1.f), glm::vec3(10.f, 1.f, 10.f));
+
+	std::vector<std::array<glm::mat4, 2>> mainPassMatrices;
+	std::vector<glm::mat4> mvpLight;
+
+	vkcv::ShaderProgram shadowShader;
+	shadowShader.addShader(vkcv::ShaderStage::VERTEX, "resources/shaders/shadow_vert.spv");
+	shadowShader.addShader(vkcv::ShaderStage::FRAGMENT, "resources/shaders/shadow_frag.spv");
+    shadowShader.reflectShader(vkcv::ShaderStage::VERTEX);
+    shadowShader.reflectShader(vkcv::ShaderStage::FRAGMENT);
+
+	const vk::Format shadowMapFormat = vk::Format::eD16Unorm;
+	const std::vector<vkcv::AttachmentDescription> shadowAttachments = {
+		vkcv::AttachmentDescription(vkcv::AttachmentOperation::STORE, vkcv::AttachmentOperation::CLEAR, shadowMapFormat)
+	};
+	const vkcv::PassConfig shadowPassConfig(shadowAttachments);
+	const vkcv::PassHandle shadowPass = core.createPass(shadowPassConfig);
+
+	const uint32_t shadowMapResolution = 1024;
+	const vkcv::Image shadowMap = core.createImage(shadowMapFormat, shadowMapResolution, shadowMapResolution, 1);
+	const vkcv::PipelineConfig shadowPipeConfig(
+		shadowShader, 
+		shadowMapResolution, 
+		shadowMapResolution, 
+		shadowPass, 
+		attributes,
+		{}, 
+		false);
+	const vkcv::PipelineHandle shadowPipe = core.createGraphicsPipeline(shadowPipeConfig);
+
+	struct LightInfo {
+		glm::vec3 direction;
+		float padding;
+		glm::mat4 lightMatrix;
+	};
+	LightInfo lightInfo;
+	vkcv::Buffer lightBuffer = core.createBuffer<LightInfo>(vkcv::BufferType::UNIFORM, sizeof(glm::vec3));
+
+	vkcv::DescriptorWrites setWrites;
+	setWrites.sampledImageWrites    = { 
+        vkcv::SampledImageDescriptorWrite(0, texture.getHandle()),
+        vkcv::SampledImageDescriptorWrite(3, shadowMap.getHandle()) };
+	setWrites.samplerWrites         = { 
+        vkcv::SamplerDescriptorWrite(1, sampler), 
+        vkcv::SamplerDescriptorWrite(4, shadowSampler) };
+    setWrites.uniformBufferWrites   = { vkcv::UniformBufferDescriptorWrite(2, lightBuffer.getHandle()) };
+	core.writeResourceDescription(descriptorSet, 0, setWrites);
+
+	auto start = std::chrono::system_clock::now();
+	const auto appStartTime = start;
+	while (window.isWindowOpen()) {
+		vkcv::Window::pollEvents();
+		
+		uint32_t swapchainWidth, swapchainHeight;
+		if (!core.beginFrame(swapchainWidth, swapchainHeight)) {
+			continue;
+		}
+		
+		if ((swapchainWidth != windowWidth) || ((swapchainHeight != windowHeight))) {
+			depthBuffer = core.createImage(vk::Format::eD32Sfloat, swapchainWidth, swapchainHeight).getHandle();
+			
+			windowWidth = swapchainWidth;
+			windowHeight = swapchainHeight;
+		}
+		
+		auto end = std::chrono::system_clock::now();
+		auto deltatime = std::chrono::duration_cast<std::chrono::microseconds>(end - start);
+		start = end;
+		cameraManager.getCamera().updateView(deltatime.count() * 0.000001);
+
+		const float sunTheta = std::chrono::duration_cast<std::chrono::milliseconds>(end - appStartTime).count() * 0.001f;
+		lightInfo.direction = glm::normalize(glm::vec3(std::cos(sunTheta), 1, std::sin(sunTheta)));
+
+		const float shadowProjectionSize = 5.f;
+		glm::mat4 projectionLight = glm::ortho(
+			-shadowProjectionSize,
+			shadowProjectionSize,
+			-shadowProjectionSize,
+			shadowProjectionSize,
+			-shadowProjectionSize,
+			shadowProjectionSize);
+		
+		glm::mat4 vulkanCorrectionMatrix(1.f);
+		vulkanCorrectionMatrix[2][2] = 0.5;
+		vulkanCorrectionMatrix[3][2] = 0.5;
+		projectionLight = vulkanCorrectionMatrix * projectionLight;
+
+		const glm::mat4 viewLight = glm::lookAt(glm::vec3(0), -lightInfo.direction, glm::vec3(0, -1, 0));
+
+		lightInfo.lightMatrix = projectionLight * viewLight;
+		lightBuffer.fill({ lightInfo });
+
+		const glm::mat4 viewProjectionCamera = cameraManager.getCamera().getProjection() * cameraManager.getCamera().getView();
+
+		mainPassMatrices.clear();
+		mvpLight.clear();
+		for (const auto& m : modelMatrices) {
+			mainPassMatrices.push_back({ viewProjectionCamera * m, m });
+			mvpLight.push_back(lightInfo.lightMatrix* m);
+		}
+
+		vkcv::PushConstantData pushConstantData((void*)mainPassMatrices.data(), 2 * sizeof(glm::mat4));
+		const std::vector<vkcv::ImageHandle> renderTargets = { swapchainInput, depthBuffer };
+
+		vkcv::PushConstantData shadowPushConstantData((void*)mvpLight.data(), sizeof(glm::mat4));
+
+		auto cmdStream = core.createCommandStream(vkcv::QueueType::Graphics);
+
+		core.recordDrawcallsToCmdStream(
+			cmdStream,
+			shadowPass,
+			shadowPipe,
+			shadowPushConstantData,
+			shadowDrawcalls,
+			{ shadowMap.getHandle() });
+
+		core.prepareImageForSampling(cmdStream, shadowMap.getHandle());
+
+		core.recordDrawcallsToCmdStream(
+			cmdStream,
+			trianglePass,
+			trianglePipeline,
+			pushConstantData,
+			drawcalls,
+			renderTargets);
+		core.prepareSwapchainImageForPresent(cmdStream);
+		core.submitCommandStream(cmdStream);
+
+		core.endFrame();
+	}
+	
+	return 0;
+}
diff --git a/projects/first_mesh/src/main.cpp b/projects/first_mesh/src/main.cpp
index 107cd432e1bc902692bb5b1fa694120ddf24038b..599eae46ca0243d7eaacc06ec59c713edd5f1e72 100644
--- a/projects/first_mesh/src/main.cpp
+++ b/projects/first_mesh/src/main.cpp
@@ -8,16 +8,17 @@
 int main(int argc, const char** argv) {
 	const char* applicationName = "First Mesh";
 
-	const int windowWidth = 800;
-	const int windowHeight = 600;
+	uint32_t windowWidth = 800;
+	uint32_t windowHeight = 600;
+
 	vkcv::Window window = vkcv::Window::create(
 		applicationName,
 		windowWidth,
 		windowHeight,
-		false
+		true
 	);
 
-	vkcv::CameraManager cameraManager(window, windowWidth, windowHeight);
+	vkcv::CameraManager cameraManager(window, static_cast<float>(window.getWidth()), static_cast<float>(window.getHeight()));
 
 	window.initEvents();
 
@@ -25,7 +26,7 @@ int main(int argc, const char** argv) {
 		window,
 		applicationName,
 		VK_MAKE_VERSION(0, 0, 1),
-		{ vk::QueueFlagBits::eTransfer,vk::QueueFlagBits::eGraphics, vk::QueueFlagBits::eCompute },
+		{ vk::QueueFlagBits::eGraphics ,vk::QueueFlagBits::eCompute , vk::QueueFlagBits::eTransfer },
 		{},
 		{ "VK_KHR_swapchain" }
 	);
@@ -43,7 +44,7 @@ int main(int argc, const char** argv) {
 		return 1;
 	}
 
-	assert(mesh.vertexGroups.size() > 0);
+	assert(!mesh.vertexGroups.empty());
 	auto vertexBuffer = core.createBuffer<uint8_t>(
 			vkcv::BufferType::VERTEX,
 			mesh.vertexGroups[0].vertexBuffer.data.size(),
@@ -62,18 +63,12 @@ int main(int argc, const char** argv) {
 
 	// an example attachment for passes that output to the window
 	const vkcv::AttachmentDescription present_color_attachment(
-		vkcv::AttachmentLayout::UNDEFINED,
-		vkcv::AttachmentLayout::COLOR_ATTACHMENT,
-		vkcv::AttachmentLayout::PRESENTATION,
 		vkcv::AttachmentOperation::STORE,
 		vkcv::AttachmentOperation::CLEAR,
 		core.getSwapchainImageFormat()
 	);
 	
 	const vkcv::AttachmentDescription depth_attachment(
-			vkcv::AttachmentLayout::UNDEFINED,
-			vkcv::AttachmentLayout::DEPTH_STENCIL_ATTACHMENT,
-			vkcv::AttachmentLayout::DEPTH_STENCIL_ATTACHMENT,
 			vkcv::AttachmentOperation::STORE,
 			vkcv::AttachmentOperation::CLEAR,
 			vk::Format::eD32Sfloat
@@ -99,19 +94,19 @@ int main(int argc, const char** argv) {
 		return static_cast<uint32_t>(x.type) < static_cast<uint32_t>(y.type);
 	});
 
-	vkcv::DescriptorSetConfig setConfig({
+	std::vector<vkcv::DescriptorBinding> descriptorBindings = {
 		vkcv::DescriptorBinding(vkcv::DescriptorType::IMAGE_SAMPLED,	1, vkcv::ShaderStage::FRAGMENT),
-		vkcv::DescriptorBinding(vkcv::DescriptorType::SAMPLER,			1, vkcv::ShaderStage::FRAGMENT)
-	});
-	vkcv::ResourcesHandle set = core.createResourceDescription({ setConfig });
+		vkcv::DescriptorBinding(vkcv::DescriptorType::SAMPLER,			1, vkcv::ShaderStage::FRAGMENT) };
+	vkcv::DescriptorSetHandle descriptorSet = core.createDescriptorSet(descriptorBindings);
 
 	const vkcv::PipelineConfig trianglePipelineDefinition(
-		triangleShaderProgram, 
-		windowWidth,
-		windowHeight,
+		triangleShaderProgram,
+        UINT32_MAX,
+        UINT32_MAX,
 		trianglePass,
 		mesh.vertexGroups[0].vertexBuffer.attributes,
-		{ core.getDescritorSetLayout(set, 0) });
+		{ core.getDescriptorSet(descriptorSet).layout },
+		true);
 	vkcv::PipelineHandle trianglePipeline = core.createGraphicsPipeline(trianglePipelineDefinition);
 	
 	if (!trianglePipeline) {
@@ -129,40 +124,65 @@ int main(int argc, const char** argv) {
 		vkcv::SamplerAddressMode::REPEAT
 	);
 
-	std::vector<vkcv::VertexBufferBinding> vertexBufferBindings = {
-		{ mesh.vertexGroups[0].vertexBuffer.attributes[0].offset, vertexBuffer.getHandle() },
-		{ mesh.vertexGroups[0].vertexBuffer.attributes[1].offset, vertexBuffer.getHandle() },
-		{ mesh.vertexGroups[0].vertexBuffer.attributes[2].offset, vertexBuffer.getHandle() }
+	const std::vector<vkcv::VertexBufferBinding> vertexBufferBindings = {
+		vkcv::VertexBufferBinding( mesh.vertexGroups[0].vertexBuffer.attributes[0].offset, vertexBuffer.getVulkanHandle() ),
+		vkcv::VertexBufferBinding( mesh.vertexGroups[0].vertexBuffer.attributes[1].offset, vertexBuffer.getVulkanHandle() ),
+		vkcv::VertexBufferBinding( mesh.vertexGroups[0].vertexBuffer.attributes[2].offset, vertexBuffer.getVulkanHandle() )
 	};
 
 	vkcv::DescriptorWrites setWrites;
 	setWrites.sampledImageWrites	= { vkcv::SampledImageDescriptorWrite(0, texture.getHandle()) };
 	setWrites.samplerWrites			= { vkcv::SamplerDescriptorWrite(1, sampler) };
-	core.writeResourceDescription(set, 0, setWrites);
+	core.writeResourceDescription(descriptorSet, 0, setWrites);
+
+	vkcv::ImageHandle depthBuffer = core.createImage(vk::Format::eD32Sfloat, windowWidth, windowHeight).getHandle();
+
+	const vkcv::ImageHandle swapchainInput = vkcv::ImageHandle::createSwapchainImageHandle();
+
+	const vkcv::Mesh renderMesh(vertexBufferBindings, indexBuffer.getVulkanHandle(), mesh.vertexGroups[0].numIndices);
+
+	vkcv::DescriptorSetUsage    descriptorUsage(0, core.getDescriptorSet(descriptorSet).vulkanHandle);
+	vkcv::DrawcallInfo          drawcall(renderMesh, { descriptorUsage });
 
 	auto start = std::chrono::system_clock::now();
 	while (window.isWindowOpen()) {
-		core.beginFrame();
-		window.pollEvents();
+        vkcv::Window::pollEvents();
+		
+		if(window.getHeight() == 0 || window.getWidth() == 0)
+			continue;
+		
+		uint32_t swapchainWidth, swapchainHeight;
+		if (!core.beginFrame(swapchainWidth, swapchainHeight)) {
+			continue;
+		}
+		
+		if ((swapchainWidth != windowWidth) || ((swapchainHeight != windowHeight))) {
+			depthBuffer = core.createImage(vk::Format::eD32Sfloat, swapchainWidth, swapchainHeight).getHandle();
+			
+			windowWidth = swapchainWidth;
+			windowHeight = swapchainHeight;
+		}
+  
 		auto end = std::chrono::system_clock::now();
 		auto deltatime = end - start;
 		start = end;
 		cameraManager.getCamera().updateView(std::chrono::duration<double>(deltatime).count());
 		const glm::mat4 mvp = cameraManager.getCamera().getProjection() * cameraManager.getCamera().getView();
 
-		core.renderMesh(
+		vkcv::PushConstantData pushConstantData((void*)&mvp, sizeof(glm::mat4));
+
+		const std::vector<vkcv::ImageHandle> renderTargets = { swapchainInput, depthBuffer };
+		auto cmdStream = core.createCommandStream(vkcv::QueueType::Graphics);
+
+		core.recordDrawcallsToCmdStream(
+			cmdStream,
 			trianglePass,
 			trianglePipeline,
-			windowWidth,
-			windowHeight,
-			sizeof(mvp),
-			&mvp,
-			vertexBufferBindings,
-			indexBuffer.getHandle(),
-			mesh.vertexGroups[0].numIndices,
-			set,
-			0
-		);
+			pushConstantData,
+			{ drawcall },
+			renderTargets);
+		core.prepareSwapchainImageForPresent(cmdStream);
+		core.submitCommandStream(cmdStream);
 
 		core.endFrame();
 	}
diff --git a/projects/first_triangle/src/main.cpp b/projects/first_triangle/src/main.cpp
index 2c071b727f7e41e7eb4dee17a2da3302f615ffa0..2ede653ff98e19159e0155b282cab1b309a13816 100644
--- a/projects/first_triangle/src/main.cpp
+++ b/projects/first_triangle/src/main.cpp
@@ -79,9 +79,6 @@ int main(int argc, const char** argv) {
 
 	// an example attachment for passes that output to the window
 	const vkcv::AttachmentDescription present_color_attachment(
-		vkcv::AttachmentLayout::UNDEFINED,
-		vkcv::AttachmentLayout::COLOR_ATTACHMENT,
-		vkcv::AttachmentLayout::PRESENTATION,
 		vkcv::AttachmentOperation::STORE,
 		vkcv::AttachmentOperation::CLEAR,
 		core.getSwapchainImageFormat());
@@ -103,21 +100,21 @@ int main(int argc, const char** argv) {
 
 	const vkcv::PipelineConfig trianglePipelineDefinition(
 		triangleShaderProgram,
-		windowWidth,
-		windowHeight,
+		(uint32_t)windowWidth,
+		(uint32_t)windowHeight,
 		trianglePass,
 		{},
-		{});
+		{},
+		false);
+
 	vkcv::PipelineHandle trianglePipeline = core.createGraphicsPipeline(trianglePipelineDefinition);
-	
+
 	if (!trianglePipeline)
 	{
 		std::cout << "Error. Could not create graphics pipeline. Exiting." << std::endl;
 		return EXIT_FAILURE;
 	}
 
-	std::vector<vkcv::VertexBufferBinding> vertexBufferBindings;
-
 	/*
 	 * BufferHandle triangleVertices = core.createBuffer(vertices);
 	 * BufferHandle triangleIndices = core.createBuffer(indices);
@@ -133,29 +130,42 @@ int main(int argc, const char** argv) {
 	 *
 	 * PipelineHandle trianglePipeline = core.CreatePipeline(trianglePipeline);
 	 */
-    auto start = std::chrono::system_clock::now();
+	auto start = std::chrono::system_clock::now();
+
+	vkcv::ImageHandle swapchainImageHandle = vkcv::ImageHandle::createSwapchainImageHandle();
+
+	const vkcv::Mesh renderMesh({}, triangleIndexBuffer.getVulkanHandle(), 3);
+	vkcv::DrawcallInfo drawcall(renderMesh, {});
+
+	const vkcv::ImageHandle swapchainInput = vkcv::ImageHandle::createSwapchainImageHandle();
+
 	while (window.isWindowOpen())
 	{
-		core.beginFrame();
         window.pollEvents();
+		
+		uint32_t swapchainWidth, swapchainHeight; // No resizing = No problem
+		if (!core.beginFrame(swapchainWidth, swapchainHeight)) {
+			continue;
+		}
+		
         auto end = std::chrono::system_clock::now();
         auto deltatime = end - start;
         start = end;
         cameraManager.getCamera().updateView(std::chrono::duration<double>(deltatime).count());
 		const glm::mat4 mvp = cameraManager.getCamera().getProjection() * cameraManager.getCamera().getView();
 
-	    core.renderMesh(
+		vkcv::PushConstantData pushConstantData((void*)&mvp, sizeof(glm::mat4));
+		auto cmdStream = core.createCommandStream(vkcv::QueueType::Graphics);
+
+		core.recordDrawcallsToCmdStream(
+			cmdStream,
 			trianglePass,
 			trianglePipeline,
-			windowWidth,
-			windowHeight,
-			sizeof(mvp),
-			&mvp,
-			vertexBufferBindings,
-			triangleIndexBuffer.getHandle(),
-			3,
-			vkcv::ResourcesHandle(),
-			0);
+			pushConstantData,
+			{ drawcall },
+			{ swapchainInput });
+		core.prepareSwapchainImageForPresent(cmdStream);
+		core.submitCommandStream(cmdStream);
 	    
 	    core.endFrame();
 	}
diff --git a/src/vkcv/BufferManager.cpp b/src/vkcv/BufferManager.cpp
index ef874606ed0f30f33e4b1e0720d4f3455a8e137e..6d494c4ec90726d46039007607464378624f1c75 100644
--- a/src/vkcv/BufferManager.cpp
+++ b/src/vkcv/BufferManager.cpp
@@ -158,7 +158,7 @@ namespace vkcv {
 		SubmitInfo submitInfo;
 		submitInfo.queueType = QueueType::Transfer;
 		
-		core->submitCommands(
+		core->recordAndSubmitCommands(
 				submitInfo,
 				[&info, &mapped_size](const vk::CommandBuffer& commandBuffer) {
 					const vk::BufferCopy region (
diff --git a/src/vkcv/CommandStreamManager.cpp b/src/vkcv/CommandStreamManager.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..9d0a236a4eaa5a166be77d143370a018b9ea7e73
--- /dev/null
+++ b/src/vkcv/CommandStreamManager.cpp
@@ -0,0 +1,119 @@
+#include "vkcv/CommandStreamManager.hpp"
+#include "vkcv/Core.hpp"
+
+namespace vkcv {
+	CommandStreamManager::CommandStreamManager() noexcept : m_core(nullptr){}
+
+	CommandStreamManager::~CommandStreamManager() noexcept {
+		for (const auto& stream : m_commandStreams) {
+			if (stream.cmdBuffer && stream.cmdBuffer) {
+				m_core->getContext().getDevice().freeCommandBuffers(stream.cmdPool, stream.cmdBuffer);
+			}
+		}
+	}
+
+	void CommandStreamManager::init(Core* core) {
+		if (!core) {
+			std::cerr << "Error: CommandStreamManager::init requires valid core pointer" << std::endl;
+		}
+		m_core = core;
+	}
+
+	CommandStreamHandle CommandStreamManager::createCommandStream(
+		const vk::Queue queue, 
+		vk::CommandPool cmdPool) {
+
+		const vk::CommandBuffer cmdBuffer = allocateCommandBuffer(m_core->getContext().getDevice(), cmdPool);
+
+		CommandStream stream(cmdBuffer, queue, cmdPool);
+		beginCommandBuffer(stream.cmdBuffer, vk::CommandBufferUsageFlagBits::eOneTimeSubmit);
+
+		// find unused stream
+		int unusedStreamIndex = -1;
+		for (int i = 0; i < m_commandStreams.size(); i++) {
+			if (m_commandStreams[i].cmdBuffer) {
+				// still in use
+			}
+			else {
+				unusedStreamIndex = i;
+				break;
+			}
+		}
+
+        const bool foundUnusedStream = unusedStreamIndex >= 0;
+        if (foundUnusedStream) {
+            m_commandStreams[unusedStreamIndex] = stream;
+            return CommandStreamHandle(unusedStreamIndex);
+        }
+
+        CommandStreamHandle handle(m_commandStreams.size());
+        m_commandStreams.push_back(stream);
+        return handle;
+    }
+
+	void CommandStreamManager::recordCommandsToStream(
+		const CommandStreamHandle   handle, 
+		const RecordCommandFunction record) {
+
+		const size_t id = handle.getId();
+		if (id >= m_commandStreams.size()) {
+			std::cerr << "Error: CommandStreamManager::recordCommandsToStream requires valid handle" << std::endl;
+			return;
+		}
+
+		CommandStream& stream = m_commandStreams[id];
+		record(stream.cmdBuffer);
+	}
+
+	void CommandStreamManager::addFinishCallbackToStream(
+		const CommandStreamHandle   handle, 
+		const FinishCommandFunction finish) {
+
+		const size_t id = handle.getId();
+		if (id >= m_commandStreams.size()) {
+			std::cerr << "Error: CommandStreamManager::addFinishCallbackToStream requires valid handle" << std::endl;
+			return;
+		}
+
+		CommandStream& stream = m_commandStreams[id];
+		stream.callbacks.push_back(finish);
+	}
+
+	void CommandStreamManager::submitCommandStreamSynchronous(
+		const CommandStreamHandle   handle,
+		std::vector<vk::Semaphore>  &waitSemaphores,
+		std::vector<vk::Semaphore>  &signalSemaphores) {
+
+		const size_t id = handle.getId();
+		if (id >= m_commandStreams.size()) {
+			std::cerr << "Error: CommandStreamManager::submitCommandStreamSynchronous requires valid handle" << std::endl;
+			return;
+		}
+		CommandStream& stream = m_commandStreams[id];
+		stream.cmdBuffer.end();
+
+		const auto device = m_core->getContext().getDevice();
+		const vk::Fence waitFence = createFence(device);
+		submitCommandBufferToQueue(stream.queue, stream.cmdBuffer, waitFence, waitSemaphores, signalSemaphores);
+		waitForFence(device, waitFence);
+		device.destroyFence(waitFence);
+
+		device.freeCommandBuffers(stream.cmdPool, stream.cmdBuffer);
+		stream.cmdBuffer    = nullptr;
+		stream.cmdPool      = nullptr;
+		stream.queue        = nullptr;
+
+		for (const auto& finishCallback : stream.callbacks) {
+			finishCallback();
+		}
+	}
+
+	vk::CommandBuffer CommandStreamManager::getStreamCommandBuffer(const CommandStreamHandle handle) {
+		const size_t id = handle.getId();
+		if (id >= m_commandStreams.size()) {
+			std::cerr << "Error: CommandStreamManager::submitCommandStreamSynchronous requires valid handle" << std::endl;
+			return nullptr;
+		}
+		return m_commandStreams[id].cmdBuffer;
+	}
+}
\ No newline at end of file
diff --git a/src/vkcv/Core.cpp b/src/vkcv/Core.cpp
index 720b89c2d8ca2d95289266818ec07511b8d0bd7c..9ed83d2a224119bd20fcfc81c5720b425de06bb6 100644
--- a/src/vkcv/Core.cpp
+++ b/src/vkcv/Core.cpp
@@ -13,8 +13,8 @@
 #include "SamplerManager.hpp"
 #include "ImageManager.hpp"
 #include "DescriptorManager.hpp"
-#include "Surface.hpp"
 #include "ImageLayoutTransitions.hpp"
+#include "vkcv/CommandStreamManager.hpp"
 
 namespace vkcv
 {
@@ -32,40 +32,11 @@ namespace vkcv
         		instanceExtensions,
         		deviceExtensions
 		);
-	
-		const vk::SurfaceKHR surface = createSurface(
-				window.getWindow(),
-				context.getInstance(),
-				context.getPhysicalDevice()
-		);
 
-        SwapChain swapChain = SwapChain::create(window, context, surface);
+        SwapChain swapChain = SwapChain::create(window, context);
 
-        std::vector<vk::Image> swapChainImages = context.getDevice().getSwapchainImagesKHR(swapChain.getSwapchain());
         std::vector<vk::ImageView> imageViews;
-        imageViews.reserve( swapChainImages.size() );
-        //here can be swizzled with vk::ComponentSwizzle if needed
-        vk::ComponentMapping componentMapping(
-                vk::ComponentSwizzle::eR,
-                vk::ComponentSwizzle::eG,
-                vk::ComponentSwizzle::eB,
-                vk::ComponentSwizzle::eA );
-
-        vk::ImageSubresourceRange subResourceRange( vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1 );
-
-        for ( auto image : swapChainImages )
-        {
-            vk::ImageViewCreateInfo imageViewCreateInfo(
-                    vk::ImageViewCreateFlags(),
-                    image,
-                    vk::ImageViewType::e2D,
-                    swapChain.getSurfaceFormat().format,
-                    componentMapping,
-                    subResourceRange
-            );
-
-            imageViews.push_back(context.getDevice().createImageView(imageViewCreateInfo));
-        }
+        imageViews = createImageViews( context, swapChain);
 
         const auto& queueManager = context.getQueueManager();
         
@@ -74,10 +45,6 @@ namespace vkcv
 		const auto						commandResources		= createCommandResources(context.getDevice(), queueFamilySet);
 		const auto						defaultSyncResources	= createSyncResources(context.getDevice());
 
-        window.e_resize.add([&](int width, int height){
-            recreateSwapchain(width,height);
-        });
-
         return Core(std::move(context) , window, swapChain, imageViews, commandResources, defaultSyncResources);
     }
 
@@ -86,8 +53,8 @@ namespace vkcv
         return m_Context;
     }
 
-	Core::Core(Context &&context, Window &window , SwapChain swapChain,  std::vector<vk::ImageView> imageViews,
-		const CommandResources& commandResources, const SyncResources& syncResources) noexcept :
+    Core::Core(Context &&context, Window &window, const SwapChain& swapChain,  std::vector<vk::ImageView> imageViews,
+        const CommandResources& commandResources, const SyncResources& syncResources) noexcept :
             m_Context(std::move(context)),
             m_window(window),
             m_swapchain(swapChain),
@@ -95,16 +62,25 @@ namespace vkcv
             m_PassManager{std::make_unique<PassManager>(m_Context.m_Device)},
             m_PipelineManager{std::make_unique<PipelineManager>(m_Context.m_Device)},
             m_DescriptorManager(std::make_unique<DescriptorManager>(m_Context.m_Device)),
-			m_BufferManager{std::unique_ptr<BufferManager>(new BufferManager())},
-			m_SamplerManager(std::unique_ptr<SamplerManager>(new SamplerManager(m_Context.m_Device))),
-			m_ImageManager{std::unique_ptr<ImageManager>(new ImageManager(*m_BufferManager))},
+            m_BufferManager{std::unique_ptr<BufferManager>(new BufferManager())},
+            m_SamplerManager(std::unique_ptr<SamplerManager>(new SamplerManager(m_Context.m_Device))),
+            m_ImageManager{std::unique_ptr<ImageManager>(new ImageManager(*m_BufferManager))},
+            m_CommandStreamManager{std::unique_ptr<CommandStreamManager>(new CommandStreamManager)},
             m_CommandResources(commandResources),
             m_SyncResources(syncResources)
 	{
-    	m_BufferManager->m_core = this;
-    	m_BufferManager->init();
-    	
-    	m_ImageManager->m_core = this;
+		m_BufferManager->m_core = this;
+		m_BufferManager->init();
+		m_CommandStreamManager->init(this);
+
+		m_ImageManager->m_core = this;
+
+		e_resizeHandle = window.e_resize.add( [&](int width, int height) {
+			m_swapchain.signalSwapchainRecreation();
+		});
+
+		m_swapchainImages = m_Context.getDevice().getSwapchainImagesKHR(m_swapchain.getSwapchain());
+		m_swapchainImageLayouts.resize(m_swapchainImages.size(), vk::ImageLayout::eUndefined);
 	}
 
 	Core::~Core() noexcept {
@@ -115,7 +91,6 @@ namespace vkcv
 
 		destroyCommandResources(m_Context.getDevice(), m_CommandResources);
 		destroySyncResources(m_Context.getDevice(), m_SyncResources);
-		destroyTemporaryFramebuffers();
 
 		m_Context.m_Device.destroySwapchainKHR(m_swapchain.getSwapchain());
 		m_Context.m_Instance.destroySurfaceKHR(m_swapchain.getSurface());
@@ -134,16 +109,23 @@ namespace vkcv
 
 	Result Core::acquireSwapchainImage() {
     	uint32_t imageIndex;
+		
+    	vk::Result result;
     	
-		const auto& acquireResult = m_Context.getDevice().acquireNextImageKHR(
-			m_swapchain.getSwapchain(), 
-			std::numeric_limits<uint64_t>::max(), 
-			m_SyncResources.swapchainImageAcquired,
-			nullptr, 
-			&imageIndex, {}
-		);
+		try {
+			result = m_Context.getDevice().acquireNextImageKHR(
+					m_swapchain.getSwapchain(),
+					std::numeric_limits<uint64_t>::max(),
+					m_SyncResources.swapchainImageAcquired,
+					nullptr,
+					&imageIndex, {}
+			);
+		} catch (vk::OutOfDateKHRError e) {
+			result = vk::Result::eErrorOutOfDateKHR;
+		}
 		
-		if (acquireResult != vk::Result::eSuccess) {
+		if (result != vk::Result::eSuccess) {
+			std::cerr << vk::to_string(result) << std::endl;
 			return Result::ERROR;
 		}
 		
@@ -151,86 +133,116 @@ namespace vkcv
 		return Result::SUCCESS;
 	}
 
-	void Core::destroyTemporaryFramebuffers() {
-		for (const vk::Framebuffer f : m_TemporaryFramebuffers) {
-			m_Context.getDevice().destroyFramebuffer(f);
-		}
-		m_TemporaryFramebuffers.clear();
-	}
+	bool Core::beginFrame(uint32_t& width, uint32_t& height) {
+		if (m_swapchain.shouldUpdateSwapchain()) {
+			m_Context.getDevice().waitIdle();
+			
+			for (auto image : m_swapchainImageViews)
+				m_Context.m_Device.destroyImageView(image);
+			
+			m_swapchain.updateSwapchain(m_Context, m_window);
+			m_swapchainImageViews = createImageViews(m_Context, m_swapchain);
+			m_swapchainImages = m_Context.getDevice().getSwapchainImagesKHR(m_swapchain.getSwapchain());
 
-	void Core::beginFrame() {
+			m_swapchainImageLayouts.clear();
+			m_swapchainImageLayouts.resize(m_swapchainImages.size(), vk::ImageLayout::eUndefined);
+		}
+		
     	if (acquireSwapchainImage() != Result::SUCCESS) {
-    		return;
+    		std::cerr << "Acquire failed!" << std::endl;
+    		
+    		m_currentSwapchainImageIndex = std::numeric_limits<uint32_t>::max();
     	}
-		m_Context.getDevice().waitIdle();	// FIMXE: this is a sin against graphics programming, but its getting late - Alex
-		destroyTemporaryFramebuffers();
-	}
-	
-	vk::Framebuffer createFramebuffer(const vk::Device device, const vk::RenderPass& renderpass,
-									  const int width, const int height, const std::vector<vk::ImageView>& attachments) {
-		const vk::FramebufferCreateFlags flags = {};
-		const vk::FramebufferCreateInfo createInfo(flags, renderpass, attachments.size(), attachments.data(), width, height, 1);
-		return device.createFramebuffer(createInfo);
+		
+		m_Context.getDevice().waitIdle(); // TODO: this is a sin against graphics programming, but its getting late - Alex
+		
+		const auto& extent = m_swapchain.getExtent();
+		
+		width = extent.width;
+		height = extent.height;
+		
+		return (m_currentSwapchainImageIndex != std::numeric_limits<uint32_t>::max());
 	}
 
-	void Core::renderMesh(
-		const PassHandle						renderpassHandle, 
-		const PipelineHandle					pipelineHandle, 
-		const uint32_t 							width,
-		const uint32_t							height,
-		const size_t							pushConstantSize, 
-		const void								*pushConstantData,
-		const std::vector<VertexBufferBinding>& vertexBufferBindings, 
-		const BufferHandle						indexBuffer, 
-		const size_t							indexCount,
-		const vkcv::ResourcesHandle				resourceHandle,
-		const size_t							resourceDescriptorSetIndex
-		) {
+	void Core::recordDrawcallsToCmdStream(
+		const CommandStreamHandle       cmdStreamHandle,
+		const PassHandle                renderpassHandle, 
+		const PipelineHandle            pipelineHandle, 
+        const PushConstantData          &pushConstantData,
+        const std::vector<DrawcallInfo> &drawcalls,
+		const std::vector<ImageHandle>  &renderTargets) {
 
 		if (m_currentSwapchainImageIndex == std::numeric_limits<uint32_t>::max()) {
 			return;
 		}
 
-		const vk::RenderPass renderpass = m_PassManager->getVkPass(renderpassHandle);
-		const PassConfig passConfig = m_PassManager->getPassConfig(renderpassHandle);
-		
-		const bool checkForDepthImage = (
-				(!m_DepthImage) ||
-				(width != m_ImageManager->getImageWidth(m_DepthImage)) ||
-				(height != m_ImageManager->getImageHeight(m_DepthImage))
-		);
-		
-		if (checkForDepthImage) {
-			for (const auto &attachment : passConfig.attachments) {
-				if (attachment.layout_final == AttachmentLayout::DEPTH_STENCIL_ATTACHMENT) {
-					m_DepthImage = m_ImageManager->createImage(width, height, 1, attachment.format);
-					break;
-				}
+		uint32_t width;
+		uint32_t height;
+		if (renderTargets.size() > 0) {
+			const vkcv::ImageHandle firstImage = renderTargets[0];
+			if (firstImage.isSwapchainImage()) {
+				const auto& swapchainExtent = m_swapchain.getExtent();
+				width = swapchainExtent.width;
+				height = swapchainExtent.height;
+			}
+			else {
+				width = m_ImageManager->getImageWidth(firstImage);
+				height = m_ImageManager->getImageHeight(firstImage);
 			}
 		}
-		
-		const vk::ImageView imageView	= m_swapchainImageViews[m_currentSwapchainImageIndex];
+		else {
+			width = 1;
+			height = 1;
+		}
+		// TODO: validate that width/height match for all attachments
+
+		const vk::RenderPass renderpass = m_PassManager->getVkPass(renderpassHandle);
+		const PassConfig passConfig = m_PassManager->getPassConfig(renderpassHandle);
+
 		const vk::Pipeline pipeline		= m_PipelineManager->getVkPipeline(pipelineHandle);
-        const vk::PipelineLayout pipelineLayout = m_PipelineManager->getVkPipelineLayout(pipelineHandle);
+		const vk::PipelineLayout pipelineLayout = m_PipelineManager->getVkPipelineLayout(pipelineHandle);
 		const vk::Rect2D renderArea(vk::Offset2D(0, 0), vk::Extent2D(width, height));
-		const vk::Buffer vulkanIndexBuffer	= m_BufferManager->getBuffer(indexBuffer);
 
-		std::vector<vk::ImageView> attachments;
-		attachments.push_back(imageView);
-		
-		if (m_DepthImage) {
-			attachments.push_back(m_ImageManager->getVulkanImageView(m_DepthImage));
+		const vk::ImageView swapchainImageView = m_swapchainImageViews[m_currentSwapchainImageIndex];
+
+		std::vector<vk::ImageView> attachmentsViews;
+		for (const ImageHandle handle : renderTargets) {
+			vk::ImageView targetHandle;
+			const auto cmdBuffer = m_CommandStreamManager->getStreamCommandBuffer(cmdStreamHandle);
+			if (handle.isSwapchainImage()) {
+				recordSwapchainImageLayoutTransition(cmdBuffer, vk::ImageLayout::eColorAttachmentOptimal);
+				targetHandle = m_swapchainImageViews[m_currentSwapchainImageIndex];
+			}
+			else {
+				targetHandle = m_ImageManager->getVulkanImageView(handle);
+				const bool isDepthImage = isDepthFormat(m_ImageManager->getImageFormat(handle));
+				const vk::ImageLayout targetLayout = 
+					isDepthFormat ? vk::ImageLayout::eDepthStencilAttachmentOptimal : vk::ImageLayout::eColorAttachmentOptimal;
+				m_ImageManager->recordImageLayoutTransition(handle, targetLayout, cmdBuffer);
+			}
+			attachmentsViews.push_back(targetHandle);
 		}
 		
-		const vk::Framebuffer framebuffer = createFramebuffer(
-				m_Context.getDevice(),
-				renderpass,
-				width,
-				height,
-				attachments
-		);
-		
-		m_TemporaryFramebuffers.push_back(framebuffer);
+		vk::Framebuffer framebuffer = nullptr;
+        const vk::FramebufferCreateInfo createInfo(
+            {},
+            renderpass,
+            static_cast<uint32_t>(attachmentsViews.size()),
+            attachmentsViews.data(),
+            width,
+            height,
+            1);
+        if(m_Context.m_Device.createFramebuffer(&createInfo, nullptr, &framebuffer) != vk::Result::eSuccess)
+        {
+            std::cout << "FAILED TO CREATE TEMPORARY FRAMEBUFFER!" << std::endl;
+            return;
+        }
+
+        vk::Viewport dynamicViewport(0.0f, 0.0f,
+            static_cast<float>(width), static_cast<float>(height),
+            0.0f, 1.0f);
+
+        vk::Rect2D dynamicScissor({0, 0}, {width, height});
 
 		auto &bufferManager = m_BufferManager;
 
@@ -238,48 +250,52 @@ namespace vkcv
 		submitInfo.queueType = QueueType::Graphics;
 		submitInfo.signalSemaphores = { m_SyncResources.renderFinished };
 
-		submitCommands(submitInfo, [&](const vk::CommandBuffer& cmdBuffer) {
-			std::vector<vk::ClearValue> clearValues;
-			
-			for (const auto& attachment : passConfig.attachments) {
-				if (attachment.load_operation == AttachmentOperation::CLEAR) {
-					float clear = 0.0f;
-					
-					if (attachment.layout_final == AttachmentLayout::DEPTH_STENCIL_ATTACHMENT) {
-						clear = 1.0f;
-					}
-					
-					clearValues.emplace_back(std::array<float, 4>{
-							clear,
-							clear,
-							clear,
-							1.f
-					});
-				}
-			}
+		auto submitFunction = [&](const vk::CommandBuffer& cmdBuffer) {
+            std::vector<vk::ClearValue> clearValues;
 
-			const vk::RenderPassBeginInfo beginInfo(renderpass, framebuffer, renderArea, clearValues.size(), clearValues.data());
-			const vk::SubpassContents subpassContents = {};
-			cmdBuffer.beginRenderPass(beginInfo, subpassContents, {});
+            for (const auto& attachment : passConfig.attachments) {
+                if (attachment.load_operation == AttachmentOperation::CLEAR) {
+                    float clear = 0.0f;
 
-			cmdBuffer.bindPipeline(vk::PipelineBindPoint::eGraphics, pipeline, {});
+                    if (isDepthFormat(attachment.format)) {
+                        clear = 1.0f;
+                    }
 
-			for (uint32_t i = 0; i < vertexBufferBindings.size(); i++) {
-				const auto &vertexBinding = vertexBufferBindings[i];
-				const auto vertexBuffer = bufferManager->getBuffer(vertexBinding.buffer);
-				cmdBuffer.bindVertexBuffers(i, (vertexBuffer), (vertexBinding.offset));
-			}
-			
-			if (resourceHandle) {
-				const vk::DescriptorSet descriptorSet = m_DescriptorManager->getDescriptorSet(resourceHandle, resourceDescriptorSetIndex);
-				cmdBuffer.bindDescriptorSets(vk::PipelineBindPoint::eGraphics, pipelineLayout, 0, descriptorSet, nullptr);
-			}
-			
-			cmdBuffer.bindIndexBuffer(vulkanIndexBuffer, 0, vk::IndexType::eUint16);	//FIXME: choose proper size
-			cmdBuffer.pushConstants(pipelineLayout, vk::ShaderStageFlagBits::eAll, 0, pushConstantSize, pushConstantData);
-			cmdBuffer.drawIndexed(indexCount, 1, 0, 0, {});
-			cmdBuffer.endRenderPass();
-		}, nullptr);
+                    clearValues.emplace_back(std::array<float, 4>{
+                            clear,
+                            clear,
+                            clear,
+                            1.f
+                    });
+                }
+            }
+
+            const vk::RenderPassBeginInfo beginInfo(renderpass, framebuffer, renderArea, clearValues.size(), clearValues.data());
+            const vk::SubpassContents subpassContents = {};
+            cmdBuffer.beginRenderPass(beginInfo, subpassContents, {});
+
+            cmdBuffer.bindPipeline(vk::PipelineBindPoint::eGraphics, pipeline, {});
+
+            const PipelineConfig &pipeConfig = m_PipelineManager->getPipelineConfig(pipelineHandle);
+            if(pipeConfig.m_UseDynamicViewport)
+            {
+                cmdBuffer.setViewport(0, 1, &dynamicViewport);
+                cmdBuffer.setScissor(0, 1, &dynamicScissor);
+            }
+
+            for (int i = 0; i < drawcalls.size(); i++) {
+                recordDrawcall(drawcalls[i], cmdBuffer, pipelineLayout, pushConstantData, i);
+            }
+
+            cmdBuffer.endRenderPass();
+        };
+
+        auto finishFunction = [framebuffer, this]()
+        {
+            m_Context.m_Device.destroy(framebuffer);
+        };
+
+		recordCommandsToStream(cmdStreamHandle, submitFunction, finishFunction);
 	}
 
 	void Core::endFrame() {
@@ -288,36 +304,39 @@ namespace vkcv
 		}
   
 		const auto swapchainImages = m_Context.getDevice().getSwapchainImagesKHR(m_swapchain.getSwapchain());
-		const vk::Image presentImage = swapchainImages[m_currentSwapchainImageIndex];
-		
+
 		const auto& queueManager = m_Context.getQueueManager();
 		std::array<vk::Semaphore, 2> waitSemaphores{ 
 			m_SyncResources.renderFinished, 
 			m_SyncResources.swapchainImageAcquired };
 
-		vk::Result presentResult;
 		const vk::SwapchainKHR& swapchain = m_swapchain.getSwapchain();
 		const vk::PresentInfoKHR presentInfo(
 			waitSemaphores,
 			swapchain,
-			m_currentSwapchainImageIndex, 
-			presentResult);
-        queueManager.getPresentQueue().handle.presentKHR(presentInfo);
-		if (presentResult != vk::Result::eSuccess) {
-			std::cout << "Error: swapchain present failed" << std::endl;
+			m_currentSwapchainImageIndex);
+		
+		vk::Result result;
+		
+		try {
+			result = queueManager.getPresentQueue().handle.presentKHR(presentInfo);
+		} catch (vk::OutOfDateKHRError e) {
+			result = vk::Result::eErrorOutOfDateKHR;
+		}
+		
+		if (result != vk::Result::eSuccess) {
+			std::cout << "Error: swapchain present failed... " << vk::to_string(result) << std::endl;
 		}
 	}
 
 	vk::Format Core::getSwapchainImageFormat() {
-		return m_swapchain.getSurfaceFormat().format;
+		return m_swapchain.getSwapchainFormat();
 	}
-
-    void Core::recreateSwapchain(int width, int height) {
-        /* boilerplate for #34 */
-        std::cout << "Resized to : " << width << " , " << height << std::endl;
-    }
 	
-	void Core::submitCommands(const SubmitInfo &submitInfo, const RecordCommandFunction& record, const FinishCommandFunction& finish)
+	void Core::recordAndSubmitCommands(
+		const SubmitInfo &submitInfo, 
+		const RecordCommandFunction &record, 
+		const FinishCommandFunction &finish)
 	{
 		const vk::Device& device = m_Context.getDevice();
 
@@ -340,23 +359,50 @@ namespace vkcv
 			finish();
 		}
 	}
-	
+
+	CommandStreamHandle Core::createCommandStream(QueueType queueType) {
+
+		const vk::Device&       device  = m_Context.getDevice();
+		const vkcv::Queue       queue   = getQueueForSubmit(queueType, m_Context.getQueueManager());
+		const vk::CommandPool   cmdPool = chooseCmdPool(queue, m_CommandResources);
+
+		return m_CommandStreamManager->createCommandStream(queue.handle, cmdPool);
+	}
+
+    void Core::recordCommandsToStream(
+		const CommandStreamHandle   cmdStreamHandle,
+		const RecordCommandFunction &record, 
+		const FinishCommandFunction &finish) {
+
+		m_CommandStreamManager->recordCommandsToStream(cmdStreamHandle, record);
+		if (finish) {
+			m_CommandStreamManager->addFinishCallbackToStream(cmdStreamHandle, finish);
+		}
+	}
+
+	void Core::submitCommandStream(const CommandStreamHandle handle) {
+		std::vector<vk::Semaphore> waitSemaphores;
+		// FIXME: add proper user controllable sync
+		std::vector<vk::Semaphore> signalSemaphores = { m_SyncResources.renderFinished };
+		m_CommandStreamManager->submitCommandStreamSynchronous(handle, waitSemaphores, signalSemaphores);
+	}
+
 	SamplerHandle Core::createSampler(SamplerFilterType magFilter, SamplerFilterType minFilter,
 									  SamplerMipmapMode mipmapMode, SamplerAddressMode addressMode) {
-    	return m_SamplerManager->createSampler(magFilter, minFilter, mipmapMode, addressMode);
-    }
-    
+		return m_SamplerManager->createSampler(magFilter, minFilter, mipmapMode, addressMode);
+	}
+
 	Image Core::createImage(vk::Format format, uint32_t width, uint32_t height, uint32_t depth)
 	{
     	return Image::create(m_ImageManager.get(), format, width, height, depth);
 	}
 
-    ResourcesHandle Core::createResourceDescription(const std::vector<DescriptorSetConfig> &descriptorSets)
+    DescriptorSetHandle Core::createDescriptorSet(const std::vector<DescriptorBinding>& bindings)
     {
-        return m_DescriptorManager->createResourceDescription(descriptorSets);
+        return m_DescriptorManager->createDescriptorSet(bindings);
     }
 
-	void Core::writeResourceDescription(ResourcesHandle handle, size_t setIndex, const DescriptorWrites &writes) {
+	void Core::writeResourceDescription(DescriptorSetHandle handle, size_t setIndex, const DescriptorWrites &writes) {
 		m_DescriptorManager->writeResourceDescription(
 			handle, 
 			setIndex, 
@@ -366,7 +412,57 @@ namespace vkcv
 			*m_SamplerManager);
 	}
 
-	vk::DescriptorSetLayout Core::getDescritorSetLayout(ResourcesHandle handle, size_t setIndex) {
-		return m_DescriptorManager->getDescriptorSetLayout(handle, setIndex);
+	DescriptorSet Core::getDescriptorSet(const DescriptorSetHandle handle) const {
+		return m_DescriptorManager->getDescriptorSet(handle);
+	}
+
+    std::vector<vk::ImageView> Core::createImageViews( Context &context, SwapChain& swapChain){
+        std::vector<vk::ImageView> imageViews;
+        std::vector<vk::Image> swapChainImages = context.getDevice().getSwapchainImagesKHR(swapChain.getSwapchain());
+        imageViews.reserve( swapChainImages.size() );
+        //here can be swizzled with vk::ComponentSwizzle if needed
+        vk::ComponentMapping componentMapping(
+                vk::ComponentSwizzle::eR,
+                vk::ComponentSwizzle::eG,
+                vk::ComponentSwizzle::eB,
+                vk::ComponentSwizzle::eA );
+
+        vk::ImageSubresourceRange subResourceRange( vk::ImageAspectFlagBits::eColor, 0, 1, 0, 1 );
+
+        for ( auto image : swapChainImages )
+        {
+            vk::ImageViewCreateInfo imageViewCreateInfo(
+                    vk::ImageViewCreateFlags(),
+                    image,
+                    vk::ImageViewType::e2D,
+                    swapChain.getSwapchainFormat(),
+                    componentMapping,
+                    subResourceRange);
+
+            imageViews.push_back(context.getDevice().createImageView(imageViewCreateInfo));
+        }
+        return imageViews;
+    }
+
+	void Core::recordSwapchainImageLayoutTransition(vk::CommandBuffer cmdBuffer, vk::ImageLayout newLayout) {
+		auto& imageLayout = m_swapchainImageLayouts[m_currentSwapchainImageIndex];
+		const auto transitionBarrier = createSwapchainImageLayoutTransitionBarrier(
+			m_swapchainImages[m_currentSwapchainImageIndex],
+			imageLayout,
+			newLayout);
+		recordImageBarrier(cmdBuffer, transitionBarrier);
+		imageLayout = newLayout;
+	}
+
+	void Core::prepareSwapchainImageForPresent(const CommandStreamHandle handle) {
+		m_CommandStreamManager->recordCommandsToStream(handle, [&](vk::CommandBuffer cmdBuffer) {
+			recordSwapchainImageLayoutTransition(cmdBuffer, vk::ImageLayout::ePresentSrcKHR);
+		});
+	}
+
+	void Core::prepareImageForSampling(const CommandStreamHandle cmdStream, const ImageHandle image) {
+		recordCommandsToStream(cmdStream, [image, this](const vk::CommandBuffer cmdBuffer) {
+			m_ImageManager->recordImageLayoutTransition(image, vk::ImageLayout::eShaderReadOnlyOptimal, cmdBuffer);
+		}, nullptr);
 	}
 }
diff --git a/src/vkcv/DescriptorConfig.cpp b/src/vkcv/DescriptorConfig.cpp
index c4f6e326560e91747d206fecc983525a5b7bb6dc..be6cfc9b40baad6636e6bc6a2b6e803aacd7ddc0 100644
--- a/src/vkcv/DescriptorConfig.cpp
+++ b/src/vkcv/DescriptorConfig.cpp
@@ -1,20 +1,13 @@
 #include "vkcv/DescriptorConfig.hpp"
 
-#include <utility>
-
 namespace vkcv {
-
-    DescriptorBinding::DescriptorBinding(
-        DescriptorType descriptorType,
-        uint32_t descriptorCount,
-        ShaderStage shaderStage
-    ) noexcept :
-        descriptorType{descriptorType},
-        descriptorCount{descriptorCount},
-        shaderStage{shaderStage}
-    {};
-
-    DescriptorSetConfig::DescriptorSetConfig(std::vector<DescriptorBinding> bindings) noexcept :
-        bindings{std::move(bindings)}
-    {};
+	DescriptorBinding::DescriptorBinding(
+		DescriptorType descriptorType,
+		uint32_t descriptorCount,
+		ShaderStage shaderStage) noexcept
+		:
+		descriptorType(descriptorType),
+		descriptorCount(descriptorCount),
+		shaderStage(shaderStage) {}
+	
 }
diff --git a/src/vkcv/DescriptorManager.cpp b/src/vkcv/DescriptorManager.cpp
index 5f1be53941cc9342eaec424a67e9319110f1b703..a2efecbe7055122d28a864b7c722a5998be460e4 100644
--- a/src/vkcv/DescriptorManager.cpp
+++ b/src/vkcv/DescriptorManager.cpp
@@ -2,88 +2,85 @@
 
 namespace vkcv
 {
-    DescriptorManager::ResourceDescription::ResourceDescription(std::vector<vk::DescriptorSet> sets,
-                                                                std::vector<vk::DescriptorSetLayout> layouts) noexcept :
-    descriptorSets{std::move(sets)},
-    descriptorSetLayouts{std::move(layouts)}
-    {}
     DescriptorManager::DescriptorManager(vk::Device device) noexcept:
         m_Device{ device }
     {
         /**
-         * Allocate a set size for the initial pool, namely 1000 units of each descriptor type below.
+         * Allocate the set size for the descriptor pools, namely 1000 units of each descriptor type below.
+		 * Finally, create an initial pool.
          */
-        const std::vector<vk::DescriptorPoolSize> poolSizes = {vk::DescriptorPoolSize(vk::DescriptorType::eSampler, 1000),
-                                                    vk::DescriptorPoolSize(vk::DescriptorType::eSampledImage, 1000),
-                                                    vk::DescriptorPoolSize(vk::DescriptorType::eUniformBuffer, 1000),
-                                                    vk::DescriptorPoolSize(vk::DescriptorType::eStorageBuffer, 1000)};
+		m_PoolSizes = { vk::DescriptorPoolSize(vk::DescriptorType::eSampler, 1000),
+													vk::DescriptorPoolSize(vk::DescriptorType::eSampledImage, 1000),
+													vk::DescriptorPoolSize(vk::DescriptorType::eUniformBuffer, 1000),
+													vk::DescriptorPoolSize(vk::DescriptorType::eStorageBuffer, 1000) };
 
-        vk::DescriptorPoolCreateInfo poolInfo({},
-                                              1000,
-                                              static_cast<uint32_t>(poolSizes.size()),
-                                              poolSizes.data());
+		m_PoolInfo = vk::DescriptorPoolCreateInfo({},
+			1000,
+			static_cast<uint32_t>(m_PoolSizes.size()),
+			m_PoolSizes.data());
 
-        if(m_Device.createDescriptorPool(&poolInfo, nullptr, &m_Pool) != vk::Result::eSuccess)
-        {
-            std::cout << "FAILED TO ALLOCATED DESCRIPTOR POOL." << std::endl;
-            m_Pool = nullptr;
-        };
+		allocateDescriptorPool();
     }
 
     DescriptorManager::~DescriptorManager() noexcept
     {
-        for (uint64_t id = 0; id < m_ResourceDescriptions.size(); id++) {
-			destroyResourceDescriptionById(id);
+        for (uint64_t id = 0; id < m_DescriptorSets.size(); id++) {
+			destroyDescriptorSetById(id);
         }
-        
-        m_Device.destroy(m_Pool);
+		m_DescriptorSets.clear();
+		for (const auto &pool : m_Pools) {
+			m_Device.destroy(pool);
+		}
     }
 
-    ResourcesHandle DescriptorManager::createResourceDescription(const std::vector<DescriptorSetConfig> &descriptorSets)
+    DescriptorSetHandle DescriptorManager::createDescriptorSet(const std::vector<DescriptorBinding>& bindings)
     {
-        std::vector<vk::DescriptorSet> vk_sets;
-        std::vector<vk::DescriptorSetLayout> vk_setLayouts;
+        std::vector<vk::DescriptorSetLayoutBinding> setBindings = {};
 
-        for (const auto &set : descriptorSets) {
-            std::vector<vk::DescriptorSetLayoutBinding> setBindings = {};
+        //create each set's binding
+        for (uint32_t i = 0; i < bindings.size(); i++) {
+            vk::DescriptorSetLayoutBinding descriptorSetLayoutBinding(
+                i,
+                convertDescriptorTypeFlag(bindings[i].descriptorType),
+                bindings[i].descriptorCount,
+                convertShaderStageFlag(bindings[i].shaderStage));
+            setBindings.push_back(descriptorSetLayoutBinding);
+        }
 
-            //create each set's binding
-            for (uint32_t j = 0; j < set.bindings.size(); j++) {
-                vk::DescriptorSetLayoutBinding descriptorSetLayoutBinding(
-                        j,
-                        convertDescriptorTypeFlag(set.bindings[j].descriptorType),
-                        set.bindings[j].descriptorCount,
-                        convertShaderStageFlag(set.bindings[j].shaderStage));
-                setBindings.push_back(descriptorSetLayoutBinding);
-            }
+        DescriptorSet set;
 
-            //create the descriptor set's layout from the bindings gathered above
-            vk::DescriptorSetLayoutCreateInfo layoutInfo({}, setBindings);
-            vk::DescriptorSetLayout layout = nullptr;
-            if(m_Device.createDescriptorSetLayout(&layoutInfo, nullptr, &layout) != vk::Result::eSuccess)
-            {
-                std::cout << "FAILED TO CREATE DESCRIPTOR SET LAYOUT" << std::endl;
-                return ResourcesHandle();
-            };
-            vk_setLayouts.push_back(layout);
-        }
-        //create and allocate the set(s) based on the layouts that have been gathered above
-        vk_sets.resize(vk_setLayouts.size());
-        vk::DescriptorSetAllocateInfo allocInfo(m_Pool, vk_sets.size(), vk_setLayouts.data());
-        auto result = m_Device.allocateDescriptorSets(&allocInfo, vk_sets.data());
+        //create the descriptor set's layout from the bindings gathered above
+        vk::DescriptorSetLayoutCreateInfo layoutInfo({}, setBindings);
+        if(m_Device.createDescriptorSetLayout(&layoutInfo, nullptr, &set.layout) != vk::Result::eSuccess)
+        {
+            std::cout << "FAILED TO CREATE DESCRIPTOR SET LAYOUT" << std::endl;
+            return DescriptorSetHandle();
+        };
+        
+        //create and allocate the set based on the layout that have been gathered above
+        vk::DescriptorSetAllocateInfo allocInfo(m_Pools.back(), 1, &set.layout);
+        auto result = m_Device.allocateDescriptorSets(&allocInfo, &set.vulkanHandle);
         if(result != vk::Result::eSuccess)
         {
-            std::cout << "FAILED TO ALLOCATE DESCRIPTOR SET" << std::endl;
-            std::cout << vk::to_string(result) << std::endl;
-            for(const auto &layout : vk_setLayouts)
-                m_Device.destroy(layout);
+			//create a new descriptor pool if the previous one ran out of memory
+			if (result == vk::Result::eErrorOutOfPoolMemory) {
+				allocateDescriptorPool();
+				allocInfo.setDescriptorPool(m_Pools.back());
+				result = m_Device.allocateDescriptorSets(&allocInfo, &set.vulkanHandle);
+			}
+			if (result != vk::Result::eSuccess) {
+				std::cout << "FAILED TO ALLOCATE DESCRIPTOR SET" << std::endl;
+				std::cout << vk::to_string(result) << std::endl;
+				m_Device.destroy(set.layout);
 
-            return ResourcesHandle();
+				return DescriptorSetHandle();
+			}
         };
 
-        const uint64_t id = m_ResourceDescriptions.size();
-        m_ResourceDescriptions.emplace_back(vk_sets, vk_setLayouts);
-        return ResourcesHandle(id, [&](uint64_t id) { destroyResourceDescriptionById(id); });
+        const uint64_t id = m_DescriptorSets.size();
+
+        m_DescriptorSets.push_back(set);
+        return DescriptorSetHandle(id, [&](uint64_t id) { destroyDescriptorSetById(id); });
     }
     
     struct WriteDescriptorSetInfo {
@@ -94,14 +91,14 @@ namespace vkcv
     };
 
 	void DescriptorManager::writeResourceDescription(
-		ResourcesHandle			handle, 
+		const DescriptorSetHandle	&handle,
 		size_t					setIndex,
 		const DescriptorWrites	&writes,
 		const ImageManager		&imageManager, 
 		const BufferManager		&bufferManager,
 		const SamplerManager	&samplerManager) {
 
-		vk::DescriptorSet set = m_ResourceDescriptions[handle.getId()].descriptorSets[setIndex];
+		vk::DescriptorSet set = m_DescriptorSets[handle.getId()].vulkanHandle;
 
 		std::vector<vk::DescriptorImageInfo> imageInfos;
 		std::vector<vk::DescriptorBufferInfo> bufferInfos;
@@ -224,12 +221,8 @@ namespace vkcv
 		m_Device.updateDescriptorSets(vulkanWrites, nullptr);
 	}
 
-	vk::DescriptorSet DescriptorManager::getDescriptorSet(ResourcesHandle handle, size_t index) {
-		return m_ResourceDescriptions[handle.getId()].descriptorSets[index];
-	}
-
-	vk::DescriptorSetLayout DescriptorManager::getDescriptorSetLayout(ResourcesHandle handle, size_t index) {
-		return m_ResourceDescriptions[handle.getId()].descriptorSetLayouts[index];
+	DescriptorSet DescriptorManager::getDescriptorSet(const DescriptorSetHandle handle) const {
+		return m_DescriptorSets[handle.getId()];
 	}
 
     vk::DescriptorType DescriptorManager::convertDescriptorTypeFlag(DescriptorType type) {
@@ -271,18 +264,29 @@ namespace vkcv
         }
     }
     
-    void DescriptorManager::destroyResourceDescriptionById(uint64_t id) {
-		if (id >= m_ResourceDescriptions.size()) {
+    void DescriptorManager::destroyDescriptorSetById(uint64_t id) {
+		if (id >= m_DescriptorSets.size()) {
+			std::cerr << "Error: DescriptorManager::destroyResourceDescriptionById invalid id" << std::endl;
 			return;
 		}
 		
-		auto& resourceDescription = m_ResourceDescriptions[id];
-	
-		for(const auto &layout : resourceDescription.descriptorSetLayouts) {
-			m_Device.destroyDescriptorSetLayout(layout);
+		auto& set = m_DescriptorSets[id];
+		if (set.layout) {
+			m_Device.destroyDescriptorSetLayout(set.layout);
+			set.layout = nullptr;
 		}
-	
-		resourceDescription.descriptorSetLayouts.clear();
+		// FIXME: descriptor set itself not destroyed
+	}
+
+	vk::DescriptorPool DescriptorManager::allocateDescriptorPool() {
+		vk::DescriptorPool pool;
+		if (m_Device.createDescriptorPool(&m_PoolInfo, nullptr, &pool) != vk::Result::eSuccess)
+		{
+			std::cout << "FAILED TO ALLOCATE DESCRIPTOR POOL." << std::endl;
+			pool = nullptr;
+		};
+		m_Pools.push_back(pool);
+		return pool;
 	}
 
 }
\ No newline at end of file
diff --git a/src/vkcv/DescriptorManager.hpp b/src/vkcv/DescriptorManager.hpp
index 8063277de741acfcb64b6eee5ffcec53cd47998a..d8607b9312b25e71c7eb4af009efd92b834b40ec 100644
--- a/src/vkcv/DescriptorManager.hpp
+++ b/src/vkcv/DescriptorManager.hpp
@@ -1,3 +1,8 @@
+/**
+ * @authors Artur Wasmut, Susanne D�tsch, Simeon Hermann
+ * @file src/vkcv/DescriptorManager.cpp
+ * @brief Creation and handling of descriptor sets and the respective descriptor pools
+ */
 #include <vulkan/vulkan.hpp>
 
 #include "vkcv/Handles.hpp"
@@ -16,48 +21,30 @@ namespace vkcv
 	    explicit DescriptorManager(vk::Device device) noexcept;
 	    ~DescriptorManager() noexcept;
 
-		/**
-		* Creates all vk::DescriptorSets and allocates them from the pool. 
-		* DescriptorSets are put inside a ResourceDescription struct. 
-		* Structs are then put into m_ResourceDescriptions.
-		* @param[in] vector of filled vkcv::DescriptorSet structs
-		* @return index into that objects a resource handle
-		*/
-        ResourcesHandle createResourceDescription(const std::vector<DescriptorSetConfig> & descriptorSets);
+        DescriptorSetHandle createDescriptorSet(const std::vector<DescriptorBinding> &descriptorBindings);
 
 		void writeResourceDescription(
-			ResourcesHandle			handle,
+			const DescriptorSetHandle	&handle,
 			size_t					setIndex,
-			const DescriptorWrites& writes,
-			const ImageManager& imageManager,
-			const BufferManager& bufferManager,
-			const SamplerManager& samplerManager);
+			const DescriptorWrites  &writes,
+			const ImageManager      &imageManager,
+			const BufferManager     &bufferManager,
+			const SamplerManager    &samplerManager);
 
-		vk::DescriptorSet		getDescriptorSet(ResourcesHandle handle, size_t index);
-		vk::DescriptorSetLayout getDescriptorSetLayout(ResourcesHandle handle, size_t index);
+		[[nodiscard]]
+		DescriptorSet getDescriptorSet(const DescriptorSetHandle handle) const;
 
 	private:
-		vk::Device			m_Device;
-        vk::DescriptorPool	m_Pool;
-
-
-		/**
-		* Container for all resources requested by the user in one call of createResourceDescription.
-		* Includes descriptor sets and the respective descriptor set layouts.
-		*/
-        struct ResourceDescription
-        {
-            ResourceDescription() = delete;
-            ResourceDescription(std::vector<vk::DescriptorSet> sets, std::vector<vk::DescriptorSetLayout> layouts) noexcept;
+		vk::Device m_Device;
+		std::vector<vk::DescriptorPool>	m_Pools;
+		std::vector<vk::DescriptorPoolSize> m_PoolSizes;
+		vk::DescriptorPoolCreateInfo m_PoolInfo;
 
-            std::vector<vk::DescriptorSet> descriptorSets;
-            std::vector<vk::DescriptorSetLayout> descriptorSetLayouts;
-        };
 
 		/**
 		* Contains all the resource descriptions that were requested by the user in calls of createResourceDescription.
 		*/
-        std::vector<ResourceDescription> m_ResourceDescriptions;
+        std::vector<DescriptorSet> m_DescriptorSets;
 		
 		/**
 		* Converts the flags of the descriptor types from VulkanCV (vkcv) to Vulkan (vk).
@@ -72,7 +59,18 @@ namespace vkcv
 		*/
 		static vk::ShaderStageFlagBits convertShaderStageFlag(ShaderStage stage);
 		
-		void destroyResourceDescriptionById(uint64_t id);
+		/**
+		* Destroys a specific resource description
+		* @param[in] the handle id of the respective resource description
+		*/
+		void destroyDescriptorSetById(uint64_t id);
+
+		/**
+		* creates a descriptor pool based on the poolSizes and poolInfo defined in the constructor
+		* is called initially in the constructor and then every time the pool runs out memory
+		* @return a DescriptorPool object
+		*/
+		vk::DescriptorPool allocateDescriptorPool();
 		
 	};
 }
\ No newline at end of file
diff --git a/src/vkcv/DrawcallRecording.cpp b/src/vkcv/DrawcallRecording.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..85b6eeb5fa413223b7b7f10f77b868252912041b
--- /dev/null
+++ b/src/vkcv/DrawcallRecording.cpp
@@ -0,0 +1,41 @@
+#include <vkcv/DrawcallRecording.hpp>
+
+namespace vkcv {
+
+    void recordDrawcall(
+        const DrawcallInfo      &drawcall,
+        vk::CommandBuffer       cmdBuffer,
+        vk::PipelineLayout      pipelineLayout,
+        const PushConstantData  &pushConstantData,
+        const size_t            drawcallIndex) {
+
+        for (uint32_t i = 0; i < drawcall.mesh.vertexBufferBindings.size(); i++) {
+            const auto& vertexBinding = drawcall.mesh.vertexBufferBindings[i];
+            cmdBuffer.bindVertexBuffers(i, vertexBinding.buffer, vertexBinding.offset);
+        }
+
+        for (const auto& descriptorUsage : drawcall.descriptorSets) {
+            cmdBuffer.bindDescriptorSets(
+                vk::PipelineBindPoint::eGraphics,
+                pipelineLayout,
+                descriptorUsage.setLocation,
+                descriptorUsage.vulkanHandle,
+                nullptr);
+        }
+
+        cmdBuffer.bindIndexBuffer(drawcall.mesh.indexBuffer, 0, vk::IndexType::eUint16);	//FIXME: choose proper size
+
+        const size_t drawcallPushConstantOffset = drawcallIndex * pushConstantData.sizePerDrawcall;
+        // char* cast because void* does not support pointer arithmetic
+        const void* drawcallPushConstantData = drawcallPushConstantOffset + (char*)pushConstantData.data;
+
+        cmdBuffer.pushConstants(
+            pipelineLayout,
+            vk::ShaderStageFlagBits::eAll,
+            0,
+            pushConstantData.sizePerDrawcall,
+            drawcallPushConstantData);
+
+        cmdBuffer.drawIndexed(drawcall.mesh.indexCount, 1, 0, 0, {});
+    }
+}
\ No newline at end of file
diff --git a/src/vkcv/Handles.cpp b/src/vkcv/Handles.cpp
index 4a00121f8203e9e46301d7609d354d06788873ed..020489418c8e2db6ce2062d6fd20f06f90a05c37 100644
--- a/src/vkcv/Handles.cpp
+++ b/src/vkcv/Handles.cpp
@@ -88,4 +88,12 @@ namespace vkcv {
 		}
 	}
 	
+	bool ImageHandle::isSwapchainImage() const {
+		return (getId() == UINT64_MAX - 1);
+	}
+	
+	ImageHandle ImageHandle::createSwapchainImageHandle(const HandleDestroyFunction &destroy) {
+		return ImageHandle(uint64_t(UINT64_MAX - 1), destroy);
+	}
+	
 }
diff --git a/src/vkcv/Image.cpp b/src/vkcv/Image.cpp
index 9ce5c25a01957ca43c75c14f6b37a7a3e82feee4..f861daeb1cd7de9697e2f649de444666b8b0e63c 100644
--- a/src/vkcv/Image.cpp
+++ b/src/vkcv/Image.cpp
@@ -8,13 +8,24 @@
 
 namespace vkcv{
 	
+	bool isDepthFormat(const vk::Format format) {
+		switch (format) {
+			case(vk::Format::eD16Unorm):        return true;
+			case(vk::Format::eD16UnormS8Uint):  return true;
+			case(vk::Format::eD24UnormS8Uint):  return true;
+			case(vk::Format::eD32Sfloat):       return true;
+			case(vk::Format::eD32SfloatS8Uint): return true;
+			default:                            return false;
+		}
+	}
+
 	Image Image::create(ImageManager* manager, vk::Format format, uint32_t width, uint32_t height, uint32_t depth)
 	{
-		return Image(manager, manager->createImage(width, height, depth, format), format);
+		return Image(manager, manager->createImage(width, height, depth, format));
 	}
 	
 	vk::Format Image::getFormat() const {
-		return m_format;
+		return m_manager->getImageFormat(m_handle);
 	}
 	
 	uint32_t Image::getWidth() const {
@@ -28,15 +39,10 @@ namespace vkcv{
 	uint32_t Image::getDepth() const {
 		return m_manager->getImageDepth(m_handle);
 	}
-	
-	vk::ImageLayout Image::getLayout() const {
-		return m_layout;
-	}
 
 	void Image::switchLayout(vk::ImageLayout newLayout)
 	{
-		m_manager->switchImageLayout(m_handle, m_layout, newLayout);
-		m_layout = newLayout;
+		m_manager->switchImageLayoutImmediate(m_handle, newLayout);
 	}
 
 	vkcv::ImageHandle Image::getHandle() const {
@@ -47,12 +53,9 @@ namespace vkcv{
 		m_manager->fillImage(m_handle, data, size);
 	}
 	
-	Image::Image(ImageManager* manager, const ImageHandle& handle, vk::Format format) :
+	Image::Image(ImageManager* manager, const ImageHandle& handle) :
 		m_manager(manager),
-		m_handle(handle),
-		m_format(format),
-		m_layout(vk::ImageLayout::eUndefined)
-	{
-	}
+		m_handle(handle)
+	{}
 
 }
diff --git a/src/vkcv/ImageLayoutTransitions.cpp b/src/vkcv/ImageLayoutTransitions.cpp
index 0b08819489c41c5cde3ceddbb0629a5d2ae3cd30..cb0f90a79d188cd80a5744d8c6ad7718e542d473 100644
--- a/src/vkcv/ImageLayoutTransitions.cpp
+++ b/src/vkcv/ImageLayoutTransitions.cpp
@@ -1,24 +1,68 @@
 #include "ImageLayoutTransitions.hpp"
+#include "vkcv/Image.hpp"
 
 namespace vkcv {
-	void transitionImageLayoutImmediate(const vk::CommandBuffer cmdBuffer, const vk::Image image,
-		const vk::ImageLayout oldLayout, const vk::ImageLayout newLayout) {
+	vk::ImageMemoryBarrier createImageLayoutTransitionBarrier(const ImageManager::Image &image, vk::ImageLayout newLayout) {
 
-		// TODO: proper src and dst masks
-		const vk::PipelineStageFlags srcStageMask = vk::PipelineStageFlagBits::eAllCommands;
-		const vk::PipelineStageFlags dstStageMask = vk::PipelineStageFlagBits::eAllCommands;
-		const vk::DependencyFlags dependecyFlags = {};
+		vk::ImageAspectFlags aspectFlags;
+		if (isDepthFormat(image.m_format)) {
+			aspectFlags = vk::ImageAspectFlagBits::eDepth;
+		}
+		else {
+			aspectFlags = vk::ImageAspectFlagBits::eColor;
+		}
 
-		// TODO: proper src and dst masks
-		const vk::AccessFlags srcAccessMask = vk::AccessFlagBits::eColorAttachmentWrite;
-		const vk::AccessFlags dstAccessMask = vk::AccessFlagBits::eColorAttachmentWrite;
+		vk::ImageSubresourceRange imageSubresourceRange(
+			aspectFlags,
+			0,
+			image.m_levels,
+			0,
+			image.m_layers
+		);
 
-		// TODO: proper aspect flags
-		const vk::ImageAspectFlags aspectFlags = vk::ImageAspectFlagBits::eColor;
+		// TODO: precise AccessFlagBits, will require a lot of context
+		return vk::ImageMemoryBarrier(
+			vk::AccessFlagBits::eMemoryWrite,
+			vk::AccessFlagBits::eMemoryRead,
+			image.m_layout,
+			newLayout,
+			VK_QUEUE_FAMILY_IGNORED,
+			VK_QUEUE_FAMILY_IGNORED,
+			image.m_handle,
+			imageSubresourceRange);
+	}
+
+	vk::ImageMemoryBarrier createSwapchainImageLayoutTransitionBarrier(
+		vk::Image       vulkanHandle, 
+		vk::ImageLayout oldLayout, 
+		vk::ImageLayout newLayout) {
 
-		const vk::ImageSubresourceRange subresourceRange(aspectFlags, 0, 1, 0, 1);
-		vk::ImageMemoryBarrier imageBarrier(srcAccessMask, dstAccessMask, oldLayout, newLayout, 0, 0, image, subresourceRange);
+		vk::ImageSubresourceRange imageSubresourceRange(
+			vk::ImageAspectFlagBits::eColor,
+			0,
+			1,
+			0,
+			1);
+
+		// TODO: precise AccessFlagBits, will require a lot of context
+		return vk::ImageMemoryBarrier(
+			vk::AccessFlagBits::eMemoryWrite,
+			vk::AccessFlagBits::eMemoryRead,
+			oldLayout,
+			newLayout,
+			VK_QUEUE_FAMILY_IGNORED,
+			VK_QUEUE_FAMILY_IGNORED,
+			vulkanHandle,
+			imageSubresourceRange);
+	}
 
-		cmdBuffer.pipelineBarrier(srcStageMask, dstStageMask, dependecyFlags, 0, nullptr, 0, nullptr, 1, &imageBarrier, {});
+	void recordImageBarrier(vk::CommandBuffer cmdBuffer, vk::ImageMemoryBarrier barrier) {
+		cmdBuffer.pipelineBarrier(
+			vk::PipelineStageFlagBits::eTopOfPipe,
+			vk::PipelineStageFlagBits::eBottomOfPipe,
+			{},
+			nullptr,
+			nullptr,
+			barrier);
 	}
 }
\ No newline at end of file
diff --git a/src/vkcv/ImageLayoutTransitions.hpp b/src/vkcv/ImageLayoutTransitions.hpp
index 3dbfbdf6690a0683b30a96f400e7e4b6ec25c379..5c147f133a6492746ad410367e5e627be000d7be 100644
--- a/src/vkcv/ImageLayoutTransitions.hpp
+++ b/src/vkcv/ImageLayoutTransitions.hpp
@@ -1,7 +1,13 @@
 #pragma once
 #include <vulkan/vulkan.hpp>
+#include "ImageManager.hpp"
 
 namespace vkcv {
-	void transitionImageLayoutImmediate(const vk::CommandBuffer cmdBuffer, const vk::Image image,
-		const vk::ImageLayout oldLayout, const vk::ImageLayout newLayout);
+	vk::ImageMemoryBarrier createImageLayoutTransitionBarrier(const ImageManager::Image& image, vk::ImageLayout newLayout);
+	vk::ImageMemoryBarrier createSwapchainImageLayoutTransitionBarrier(
+		vk::Image       vulkanHandle,
+		vk::ImageLayout oldLayout,
+		vk::ImageLayout newLayout);
+
+	void recordImageBarrier(vk::CommandBuffer cmdBuffer, vk::ImageMemoryBarrier barrier);
 }
\ No newline at end of file
diff --git a/src/vkcv/ImageManager.cpp b/src/vkcv/ImageManager.cpp
index d3eb9cc559340f21009187bf43dcdf1e32e6ad60..cdfd32b009a8007b606c86bf087b3f921b2bb89f 100644
--- a/src/vkcv/ImageManager.cpp
+++ b/src/vkcv/ImageManager.cpp
@@ -5,11 +5,34 @@
  */
 #include "ImageManager.hpp"
 #include "vkcv/Core.hpp"
+#include "ImageLayoutTransitions.hpp"
 
 #include <algorithm>
 
 namespace vkcv {
 
+	ImageManager::Image::Image(
+		vk::Image           handle,
+		vk::DeviceMemory    memory,
+		vk::ImageView       view,
+		uint32_t            width,
+		uint32_t            height,
+		uint32_t            depth,
+		vk::Format          format,
+		uint32_t            layers,
+		uint32_t            levels)
+		:
+		m_handle(handle),
+		m_memory(memory),
+		m_view(view),
+		m_width(width),
+		m_height(height),
+		m_depth(depth),
+		m_format(format),
+		m_layers(layers),
+		m_levels(levels)
+	{}
+
 	/**
 	 * @brief searches memory type index for image allocation, combines requirements of image and application
 	 * @param physicalMemoryProperties Memory Properties of physical device
@@ -89,6 +112,11 @@ namespace vkcv {
 			}
 		}
 		
+		if (isDepthFormat) {
+			imageType = vk::ImageType::e2D;
+			imageViewType = vk::ImageViewType::e2D;
+		}
+		
 		vk::ImageTiling imageTiling = vk::ImageTiling::eOptimal;
 		
 		if (!formatProperties.optimalTilingFeatures) {
@@ -166,14 +194,19 @@ namespace vkcv {
 		vk::ImageView view = device.createImageView(imageViewCreateInfo);
 		
 		const uint64_t id = m_images.size();
-		m_images.push_back({ image, memory, view, width, height, depth, format, arrayLayers, mipLevels });
+		m_images.push_back(Image(image, memory, view, width, height, depth, format, arrayLayers, mipLevels));
 		return ImageHandle(id, [&](uint64_t id) { destroyImageById(id); });
 	}
 	
+	ImageHandle ImageManager::createSwapchainImage() {
+		return ImageHandle::createSwapchainImageHandle();
+	}
+	
 	vk::Image ImageManager::getVulkanImage(const ImageHandle &handle) const {
 		const uint64_t id = handle.getId();
 		
 		if (id >= m_images.size()) {
+			std::cerr << "Error: ImageManager::getVulkanImage invalid handle" << std::endl;
 			return nullptr;
 		}
 		
@@ -186,6 +219,7 @@ namespace vkcv {
 		const uint64_t id = handle.getId();
 		
 		if (id >= m_images.size()) {
+			std::cerr << "Error: ImageManager::getVulkanDeviceMemory invalid handle" << std::endl;
 			return nullptr;
 		}
 		
@@ -198,6 +232,7 @@ namespace vkcv {
 		const uint64_t id = handle.getId();
 		
 		if (id >= m_images.size()) {
+			std::cerr << "Error: ImageManager::getVulkanImageView invalid handle" << std::endl;
 			return nullptr;
 		}
 		
@@ -206,84 +241,53 @@ namespace vkcv {
 		return image.m_view;
 	}
 	
-	void ImageManager::switchImageLayout(const ImageHandle& handle, vk::ImageLayout oldLayout, vk::ImageLayout newLayout) {
+	void ImageManager::switchImageLayoutImmediate(const ImageHandle& handle, vk::ImageLayout newLayout) {
 		const uint64_t id = handle.getId();
 		
 		if (id >= m_images.size()) {
+			std::cerr << "Error: ImageManager::switchImageLayout invalid handle" << std::endl;
 			return;
 		}
 		
 		auto& image = m_images[id];
-		
-		//alternativly we could use switch case for every variable to set
-		vk::AccessFlags sourceAccessMask;
-		vk::PipelineStageFlags sourceStage;
-		
-		vk::AccessFlags destinationAccessMask;
-		vk::PipelineStageFlags destinationStage;
-		
-		if ((oldLayout == vk::ImageLayout::eUndefined) &&
-			(newLayout == vk::ImageLayout::eTransferDstOptimal))
-		{
-			destinationAccessMask = vk::AccessFlagBits::eTransferWrite;
-			
-			sourceStage = vk::PipelineStageFlagBits::eTopOfPipe;
-			destinationStage = vk::PipelineStageFlagBits::eTransfer;
-		}
-		else if ((oldLayout == vk::ImageLayout::eTransferDstOptimal) &&
-				 (newLayout == vk::ImageLayout::eShaderReadOnlyOptimal))
-		{
-			sourceAccessMask = vk::AccessFlagBits::eTransferWrite;
-			destinationAccessMask = vk::AccessFlagBits::eShaderRead;
-			
-			sourceStage = vk::PipelineStageFlagBits::eTransfer;
-			destinationStage = vk::PipelineStageFlagBits::eFragmentShader;
-		}
-		
-		vk::ImageAspectFlags aspectFlags;
-		
-		if (isDepthImageFormat(image.m_format)) {
-			aspectFlags = vk::ImageAspectFlagBits::eDepth;
-		} else {
-			aspectFlags = vk::ImageAspectFlagBits::eColor;
-		}
-		
-		vk::ImageSubresourceRange imageSubresourceRange(
-				aspectFlags,
-				0,
-				image.m_levels,
-				0,
-				image.m_layers
-		);
-		
-		vk::ImageMemoryBarrier imageMemoryBarrier(
-			sourceAccessMask,
-			destinationAccessMask,
-			oldLayout,
-			newLayout,
-			VK_QUEUE_FAMILY_IGNORED,
-			VK_QUEUE_FAMILY_IGNORED,
-			image.m_handle,
-			imageSubresourceRange
-		);
+		const auto transitionBarrier = createImageLayoutTransitionBarrier(image, newLayout);
 		
 		SubmitInfo submitInfo;
 		submitInfo.queueType = QueueType::Graphics;
 		
-		m_core->submitCommands(
+		m_core->recordAndSubmitCommands(
 			submitInfo,
-			[sourceStage, destinationStage, imageMemoryBarrier](const vk::CommandBuffer& commandBuffer) {
-				commandBuffer.pipelineBarrier(
-					sourceStage,
-					destinationStage,
-					{},
-					nullptr,
-					nullptr,
-					imageMemoryBarrier
+			[transitionBarrier](const vk::CommandBuffer& commandBuffer) {
+			// TODO: precise PipelineStageFlagBits, will require a lot of context
+			commandBuffer.pipelineBarrier(
+				vk::PipelineStageFlagBits::eTopOfPipe,
+				vk::PipelineStageFlagBits::eBottomOfPipe,
+				{},
+				nullptr,
+				nullptr,
+				transitionBarrier
 				);
 			},
-			nullptr
-		);
+			nullptr);
+		image.m_layout = newLayout;
+	}
+
+	void ImageManager::recordImageLayoutTransition(
+		const ImageHandle& handle, 
+		vk::ImageLayout newLayout, 
+		vk::CommandBuffer cmdBuffer) {
+
+		const uint64_t id = handle.getId();
+
+		if (id >= m_images.size()) {
+			std::cerr << "Error: ImageManager::switchImageLayout invalid handle" << std::endl;
+			return;
+		}
+
+		auto& image = m_images[id];
+		const auto transitionBarrier = createImageLayoutTransitionBarrier(image, newLayout);
+		recordImageBarrier(cmdBuffer, transitionBarrier);
+		image.m_layout = newLayout;
 	}
 	
 	void ImageManager::fillImage(const ImageHandle& handle, void* data, size_t size)
@@ -291,16 +295,15 @@ namespace vkcv {
 		const uint64_t id = handle.getId();
 		
 		if (id >= m_images.size()) {
+			std::cerr << "Error: ImageManager::fillImage invalid handle" << std::endl;
 			return;
 		}
 		
 		auto& image = m_images[id];
 		
-		switchImageLayout(
+		switchImageLayoutImmediate(
 				handle,
-				vk::ImageLayout::eUndefined,
-				vk::ImageLayout::eTransferDstOptimal
-		);
+				vk::ImageLayout::eTransferDstOptimal);
 		
 		uint32_t channels = 4; // TODO: check image.m_format
 		const size_t image_size = (
@@ -320,7 +323,7 @@ namespace vkcv {
 		SubmitInfo submitInfo;
 		submitInfo.queueType = QueueType::Transfer;
 		
-		m_core->submitCommands(
+		m_core->recordAndSubmitCommands(
 				submitInfo,
 				[&image, &stagingBuffer](const vk::CommandBuffer& commandBuffer) {
 					vk::ImageAspectFlags aspectFlags;
@@ -354,9 +357,8 @@ namespace vkcv {
 					);
 				},
 				[&]() {
-					switchImageLayout(
+					switchImageLayoutImmediate(
 							handle,
-							vk::ImageLayout::eTransferDstOptimal,
 							vk::ImageLayout::eShaderReadOnlyOptimal
 					);
 				}
@@ -367,6 +369,7 @@ namespace vkcv {
 		const uint64_t id = handle.getId();
 		
 		if (id >= m_images.size()) {
+			std::cerr << "Error: ImageManager::getImageWidth invalid handle" << std::endl;
 			return 0;
 		}
 		
@@ -379,6 +382,7 @@ namespace vkcv {
 		const uint64_t id = handle.getId();
 		
 		if (id >= m_images.size()) {
+			std::cerr << "Error: ImageManager::getImageHeight invalid handle" << std::endl;
 			return 0;
 		}
 		
@@ -391,6 +395,7 @@ namespace vkcv {
 		const uint64_t id = handle.getId();
 		
 		if (id >= m_images.size()) {
+			std::cerr << "Error: ImageManager::getImageDepth invalid handle" << std::endl;
 			return 0;
 		}
 		
@@ -402,6 +407,7 @@ namespace vkcv {
 	void ImageManager::destroyImageById(uint64_t id)
 	{
 		if (id >= m_images.size()) {
+			std::cerr << "Error: ImageManager::destroyImageById invalid handle" << std::endl;
 			return;
 		}
 		
@@ -425,5 +431,16 @@ namespace vkcv {
 		}
 	}
 
+	vk::Format ImageManager::getImageFormat(const ImageHandle& handle) const {
+
+		const uint64_t id = handle.getId();
+
+		if (id >= m_images.size()) {
+			std::cerr << "Error: ImageManager::destroyImageById invalid handle" << std::endl;
+			return vk::Format::eUndefined;
+		}
+
+		return m_images[id].m_format;
+	}
 
 }
\ No newline at end of file
diff --git a/src/vkcv/ImageManager.hpp b/src/vkcv/ImageManager.hpp
index 4b6e5208e26c56ec73f3f58e88a4e65878e985f7..b9fccb25ec16bc1fd9569ab1a94627bd7ff06b18 100644
--- a/src/vkcv/ImageManager.hpp
+++ b/src/vkcv/ImageManager.hpp
@@ -11,23 +11,38 @@
 #include "vkcv/Handles.hpp"
 
 namespace vkcv {
-	
+
 	class ImageManager
 	{
 		friend class Core;
-	private:
+	public:
 		struct Image
 		{
-			vk::Image m_handle;
-			vk::DeviceMemory m_memory;
-			vk::ImageView m_view;
-			uint32_t m_width = 0;
-			uint32_t m_height = 0;
-			uint32_t m_depth = 0;
-			vk::Format m_format;
-			uint32_t m_layers = 1;
-			uint32_t m_levels = 1;
+			vk::Image           m_handle;
+			vk::DeviceMemory    m_memory;
+			vk::ImageView       m_view;
+			uint32_t            m_width = 0;
+			uint32_t            m_height = 0;
+			uint32_t            m_depth = 0;
+			vk::Format          m_format;
+			uint32_t            m_layers = 1;
+			uint32_t            m_levels = 1;
+			vk::ImageLayout     m_layout = vk::ImageLayout::eUndefined;
+		private:
+			// struct is public so utility functions can access members, but only ImageManager can create Image
+			friend ImageManager;
+			Image(
+				vk::Image           handle,
+				vk::DeviceMemory    memory,
+				vk::ImageView       view,
+				uint32_t            width,
+				uint32_t            height,
+				uint32_t            depth,
+				vk::Format          format,
+				uint32_t            layers,
+				uint32_t            levels);
 		};
+	private:
 		
 		Core* m_core;
 		BufferManager& m_bufferManager;
@@ -54,6 +69,8 @@ namespace vkcv {
 		
 		ImageHandle createImage(uint32_t width, uint32_t height, uint32_t depth, vk::Format format);
 		
+		ImageHandle createSwapchainImage();
+		
 		[[nodiscard]]
 		vk::Image getVulkanImage(const ImageHandle& handle) const;
 		
@@ -62,8 +79,13 @@ namespace vkcv {
 		
 		[[nodiscard]]
 		vk::ImageView getVulkanImageView(const ImageHandle& handle) const;
-		
-		void switchImageLayout(const ImageHandle& handle, vk::ImageLayout oldLayout, vk::ImageLayout newLayout);
+
+		void switchImageLayoutImmediate(const ImageHandle& handle, vk::ImageLayout newLayout);
+		void recordImageLayoutTransition(
+			const ImageHandle& handle, 
+			vk::ImageLayout newLayout, 
+			vk::CommandBuffer cmdBuffer);
+
 		void fillImage(const ImageHandle& handle, void* data, size_t size);
 		
 		[[nodiscard]]
@@ -75,5 +97,7 @@ namespace vkcv {
 		[[nodiscard]]
 		uint32_t getImageDepth(const ImageHandle& handle) const;
 		
+		[[nodiscard]]
+		vk::Format getImageFormat(const ImageHandle& handle) const;
 	};
 }
\ No newline at end of file
diff --git a/src/vkcv/PassConfig.cpp b/src/vkcv/PassConfig.cpp
index ef07d3ee8d6170ae893cd055eefcc971cd1b87a3..602f1d3e2a8100ebd9bbb83772312d3d659abe86 100644
--- a/src/vkcv/PassConfig.cpp
+++ b/src/vkcv/PassConfig.cpp
@@ -5,15 +5,9 @@
 namespace vkcv
 {
     AttachmentDescription::AttachmentDescription(
-		AttachmentLayout initial,
-		AttachmentLayout in_pass,
-		AttachmentLayout final,
 		AttachmentOperation store_op,
 		AttachmentOperation load_op,
 		vk::Format format) noexcept :
-	layout_initial{initial},
-	layout_in_pass{in_pass},
-	layout_final{final},
 	store_operation{store_op},
 	load_operation{load_op},
 	format(format)
diff --git a/src/vkcv/PassManager.cpp b/src/vkcv/PassManager.cpp
index 8b59495ae7eaa68b6f42ed2a4786ae688e4a6375..c34b0d3631c48561f42eb7f21ba5578156910f51 100644
--- a/src/vkcv/PassManager.cpp
+++ b/src/vkcv/PassManager.cpp
@@ -1,4 +1,5 @@
 #include "PassManager.hpp"
+#include "vkcv/Image.hpp"
 
 namespace vkcv
 {
@@ -73,63 +74,63 @@ namespace vkcv
         for (uint32_t i = 0; i < config.attachments.size(); i++)
         {
             // TODO: Renderpass struct should hold proper format information
-            vk::Format format = config.attachments[i].format;
+            vk::Format      format = config.attachments[i].format;
+            vk::ImageLayout layout;
 
-            if (config.attachments[i].layout_in_pass == AttachmentLayout::DEPTH_STENCIL_ATTACHMENT)
+            if (isDepthFormat(config.attachments[i].format))
             {
+                layout                              = vk::ImageLayout::eDepthStencilAttachmentOptimal;
                 depthAttachmentReference.attachment = i;
-                depthAttachmentReference.layout = getVkLayoutFromAttachLayout(config.attachments[i].layout_in_pass);
-                pDepthAttachment = &depthAttachmentReference;
+                depthAttachmentReference.layout     = layout;
+                pDepthAttachment                    = &depthAttachmentReference;
             }
             else
             {
-                vk::AttachmentReference attachmentRef(i, getVkLayoutFromAttachLayout(config.attachments[i].layout_in_pass));
+                layout = vk::ImageLayout::eColorAttachmentOptimal;
+                vk::AttachmentReference attachmentRef(i, layout);
                 colorAttachmentReferences.push_back(attachmentRef);
             }
 
             vk::AttachmentDescription attachmentDesc(
-            		{},
-            		format,
-            		vk::SampleCountFlagBits::e1,
-            		getVKLoadOpFromAttachOp(config.attachments[i].load_operation),
-            		getVkStoreOpFromAttachOp(config.attachments[i].store_operation),
-            		vk::AttachmentLoadOp::eDontCare,
-            		vk::AttachmentStoreOp::eDontCare,
-            		getVkLayoutFromAttachLayout(config.attachments[i].layout_initial),
-            		getVkLayoutFromAttachLayout(config.attachments[i].layout_final)
-			);
-            
+                {},
+                format,
+                vk::SampleCountFlagBits::e1,
+                getVKLoadOpFromAttachOp(config.attachments[i].load_operation),
+                getVkStoreOpFromAttachOp(config.attachments[i].store_operation),
+                vk::AttachmentLoadOp::eDontCare,
+                vk::AttachmentStoreOp::eDontCare,
+                layout,
+                layout);
+
             attachmentDescriptions.push_back(attachmentDesc);
         }
         
         const vk::SubpassDescription subpassDescription(
-        		{},
-        		vk::PipelineBindPoint::eGraphics,
-        		0,
-        		{},
-        		static_cast<uint32_t>(colorAttachmentReferences.size()),
-        		colorAttachmentReferences.data(),
-        		{},
-        		pDepthAttachment,
-        		0,
-        		{}
-        );
+            {},
+            vk::PipelineBindPoint::eGraphics,
+            0,
+            {},
+            static_cast<uint32_t>(colorAttachmentReferences.size()),
+            colorAttachmentReferences.data(),
+            {},
+            pDepthAttachment,
+            0,
+            {});
 
         const vk::RenderPassCreateInfo passInfo(
-        		{},
-        		static_cast<uint32_t>(attachmentDescriptions.size()),
-        		attachmentDescriptions.data(),
-        		1,
-        		&subpassDescription,
-        		0,
-        		{}
-	  	);
+            {},
+            static_cast<uint32_t>(attachmentDescriptions.size()),
+            attachmentDescriptions.data(),
+            1,
+            &subpassDescription,
+            0,
+            {});
 
         vk::RenderPass renderPass = m_Device.createRenderPass(passInfo);
-	
+
         const uint64_t id = m_Passes.size();
-		m_Passes.push_back({ renderPass, config });
-		return PassHandle(id, [&](uint64_t id) { destroyPassById(id); });
+        m_Passes.push_back({ renderPass, config });
+        return PassHandle(id, [&](uint64_t id) { destroyPassById(id); });
     }
 
     vk::RenderPass PassManager::getVkPass(const PassHandle &handle) const
diff --git a/src/vkcv/PipelineConfig.cpp b/src/vkcv/PipelineConfig.cpp
index d317258470bde76e8b8ba8e1f9bc684ea469b6c0..ad8437ca2a6c07862f66485c74c89ccba0d69ebe 100644
--- a/src/vkcv/PipelineConfig.cpp
+++ b/src/vkcv/PipelineConfig.cpp
@@ -9,18 +9,20 @@
 namespace vkcv {
 
     PipelineConfig::PipelineConfig(
-		const ShaderProgram&						shaderProgram, 
-		uint32_t									width, 
-		uint32_t									height, 
-		PassHandle									&passHandle, 
-		const std::vector<VertexAttribute>			&vertexAttributes,
-		const std::vector<vk::DescriptorSetLayout>	&descriptorLayouts)
+		const ShaderProgram&                        shaderProgram,
+		uint32_t                                    width,
+		uint32_t                                    height,
+		const PassHandle                            &passHandle,
+		const std::vector<VertexAttribute>          &vertexAttributes,
+		const std::vector<vk::DescriptorSetLayout>  &descriptorLayouts,
+		bool                                        useDynamicViewport)
 		:
 		m_ShaderProgram(shaderProgram),
 		m_Height(height),
 		m_Width(width),
 		m_PassHandle(passHandle),
-		m_vertexAttributes(vertexAttributes),
-		m_descriptorLayouts(descriptorLayouts)
+		m_VertexAttributes(vertexAttributes),
+		m_DescriptorLayouts(descriptorLayouts),
+		m_UseDynamicViewport(useDynamicViewport)
 		{}
 }
diff --git a/src/vkcv/PipelineManager.cpp b/src/vkcv/PipelineManager.cpp
index 1b866c05d4a12c9bf28d08178438cb3a1ff70a3c..28a64a243b9a7a8fc9372409ef3783901219c868 100644
--- a/src/vkcv/PipelineManager.cpp
+++ b/src/vkcv/PipelineManager.cpp
@@ -1,11 +1,13 @@
 #include "PipelineManager.hpp"
+#include "vkcv/Image.hpp"
 
 namespace vkcv
 {
 
     PipelineManager::PipelineManager(vk::Device device) noexcept :
     m_Device{device},
-    m_Pipelines{}
+    m_Pipelines{},
+    m_Configs{}
     {}
 
     PipelineManager::~PipelineManager() noexcept
@@ -92,10 +94,10 @@ namespace vkcv
             vk::Format	vertexFormat	= vertexFormatToVulkanFormat(attachment.format);
 
 			//FIXME: hoping that order is the same and compatible: add explicit mapping and validation
-			const VertexAttribute attribute = config.m_vertexAttributes[i];
+			const VertexAttribute attribute = config.m_VertexAttributes[i];
 
-            vertexAttributeDescriptions.push_back({location, binding, vertexFormatToVulkanFormat(attachment.format), 0});
-			vertexBindingDescriptions.push_back(vk::VertexInputBindingDescription(
+            vertexAttributeDescriptions.emplace_back(location, binding, vertexFormatToVulkanFormat(attachment.format), 0);
+			vertexBindingDescriptions.emplace_back(vk::VertexInputBindingDescription(
 				binding,
 				attribute.stride + getFormatSize(attachment.format),
 				vk::VertexInputRate::eVertex));
@@ -172,13 +174,13 @@ namespace vkcv
                 { 1.f,1.f,1.f,1.f }
         );
 
-		const size_t matrixPushConstantSize = 4 * 4 * sizeof(float);
+		const size_t matrixPushConstantSize = config.m_ShaderProgram.getPushConstantSize();
 		const vk::PushConstantRange pushConstantRange(vk::ShaderStageFlagBits::eAll, 0, matrixPushConstantSize);
 
         // pipeline layout
         vk::PipelineLayoutCreateInfo pipelineLayoutCreateInfo(
 			{},
-			(config.m_descriptorLayouts),
+			(config.m_DescriptorLayouts),
 			(pushConstantRange));
         vk::PipelineLayout vkPipelineLayout{};
         if (m_Device.createPipelineLayout(&pipelineLayoutCreateInfo, nullptr, &vkPipelineLayout) != vk::Result::eSuccess)
@@ -206,13 +208,24 @@ namespace vkcv
 		const PassConfig& passConfig = passManager.getPassConfig(config.m_PassHandle);
 		
 		for (const auto& attachment : passConfig.attachments) {
-			if (attachment.layout_final == AttachmentLayout::DEPTH_STENCIL_ATTACHMENT) {
+			if (isDepthFormat(attachment.format)) {
 				p_depthStencilCreateInfo = &depthStencilCreateInfo;
 				break;
 			}
 		}
-	
-		// graphics pipeline create
+
+		std::vector<vk::DynamicState> dynamicStates = {};
+		if(config.m_UseDynamicViewport)
+        {
+		    dynamicStates.push_back(vk::DynamicState::eViewport);
+		    dynamicStates.push_back(vk::DynamicState::eScissor);
+        }
+
+        vk::PipelineDynamicStateCreateInfo dynamicStateCreateInfo({},
+                                                            static_cast<uint32_t>(dynamicStates.size()),
+                                                            dynamicStates.data());
+
+        // graphics pipeline create
         std::vector<vk::PipelineShaderStageCreateInfo> shaderStages = { pipelineVertexShaderStageInfo, pipelineFragmentShaderStageInfo };
         const vk::GraphicsPipelineCreateInfo graphicsPipelineCreateInfo(
                 {},
@@ -226,7 +239,7 @@ namespace vkcv
                 &pipelineMultisampleStateCreateInfo,
 				p_depthStencilCreateInfo,
                 &pipelineColorBlendStateCreateInfo,
-                nullptr,
+                &dynamicStateCreateInfo,
                 vkPipelineLayout,
                 pass,
                 0,
@@ -247,6 +260,7 @@ namespace vkcv
         
         const uint64_t id = m_Pipelines.size();
         m_Pipelines.push_back({ vkPipeline, vkPipelineLayout });
+        m_Configs.push_back(config);
         return PipelineHandle(id, [&](uint64_t id) { destroyPipelineById(id); });
     }
 
@@ -293,5 +307,11 @@ namespace vkcv
 			pipeline.m_layout = nullptr;
 		}
     }
-    
+
+    const PipelineConfig &PipelineManager::getPipelineConfig(const PipelineHandle &handle) const
+    {
+        const uint64_t id = handle.getId();
+        return m_Configs.at(id);
+    }
+
 }
\ No newline at end of file
diff --git a/src/vkcv/PipelineManager.hpp b/src/vkcv/PipelineManager.hpp
index 950df0be2d8edf3037c93e8522215bfa740d033d..e243151f7248c07fa0287bb2eaf698e5080f7f61 100644
--- a/src/vkcv/PipelineManager.hpp
+++ b/src/vkcv/PipelineManager.hpp
@@ -18,6 +18,7 @@ namespace vkcv
     	
         vk::Device m_Device;
         std::vector<Pipeline> m_Pipelines;
+        std::vector<PipelineConfig> m_Configs;
         
         void destroyPipelineById(uint64_t id);
         
@@ -36,7 +37,11 @@ namespace vkcv
 
         [[nodiscard]]
         vk::Pipeline getVkPipeline(const PipelineHandle &handle) const;
+
         [[nodiscard]]
         vk::PipelineLayout getVkPipelineLayout(const PipelineHandle &handle) const;
+
+        [[nodiscard]]
+        const PipelineConfig &getPipelineConfig(const PipelineHandle &handle) const;
     };
 }
diff --git a/src/vkcv/QueueManager.cpp b/src/vkcv/QueueManager.cpp
index c062437553c4c49d72f6d9a4f1160da2e5d41884..e4d1a2d3a3302fc435c4c278322c08f51f19be6b 100644
--- a/src/vkcv/QueueManager.cpp
+++ b/src/vkcv/QueueManager.cpp
@@ -1,10 +1,10 @@
 
 #include <limits>
 #include <unordered_set>
+#include <iostream>
 
 #include "vkcv/QueueManager.hpp"
 
-#include "vkcv/QueueManager.hpp"
 
 namespace vkcv {
 
@@ -89,7 +89,13 @@ namespace vkcv {
                         }
                     }
                     if (!found) {
-                        throw std::runtime_error("Too many graphics queues were requested than being available!");
+                        for (int i = 0; i < queueFamilyStatus.size() && !found; i++) {
+                            if (initialQueueFamilyStatus[i][0] > 0) {
+                                queuePairsGraphics.push_back(std::pair(i, 0));
+                                found = true;
+                            }
+                        }
+                        std::cerr << "Warning: not enough \"" << vk::to_string(qFlag) << "\"-Queues." << std::endl;
                     }
                     break;
                 case vk::QueueFlagBits::eCompute:
@@ -104,7 +110,13 @@ namespace vkcv {
                         }
                     }
                     if (!found) {
-                        throw std::runtime_error("Too many compute queues were requested than being available!");
+                        for (int i = 0; i < queueFamilyStatus.size() && !found; i++) {
+                            if (initialQueueFamilyStatus[i][1] > 0) {
+                                queuePairsCompute.push_back(std::pair(i, 0));
+                                found = true;
+                            }
+                        }
+                        std::cerr << "Warning: not enough \"" << vk::to_string(qFlag) << "\"-Queues." << std::endl;
                     }
                     break;
                 case vk::QueueFlagBits::eTransfer:
@@ -119,7 +131,13 @@ namespace vkcv {
                         }
                     }
                     if (!found) {
-                        throw std::runtime_error("Too many transfer queues were requested than being available!");
+                        for (int i = 0; i < queueFamilyStatus.size() && !found; i++) {
+                            if (initialQueueFamilyStatus[i][2] > 0) {
+                                queuePairsTransfer.push_back(std::pair(i, 0));
+                                found = true;
+                            }
+                        }
+                        std::cerr << "Warning: not enough \"" << vk::to_string(qFlag) << "\"-Queues." << std::endl;
                     }
                     break;
                 default:
diff --git a/src/vkcv/ShaderProgram.cpp b/src/vkcv/ShaderProgram.cpp
index f7899eb26a13ca14afbe29102b987f84949b4b12..59f8163c9dc75e0a716d80f2396665b0ba52c924 100644
--- a/src/vkcv/ShaderProgram.cpp
+++ b/src/vkcv/ShaderProgram.cpp
@@ -5,6 +5,7 @@
  */
 
 #include "vkcv/ShaderProgram.hpp"
+#include <algorithm>
 
 namespace vkcv {
     /**
@@ -163,6 +164,13 @@ namespace vkcv {
         }
 
         m_DescriptorSetLayout = DescriptorSetLayout(sampledImageVec, storageImageVec, uniformBufferVec, storageBufferVec, samplerVec);
+
+		for (const auto &pushConstantBuffer : resources.push_constant_buffers) {
+			for (const auto &range : comp.get_active_buffer_ranges(pushConstantBuffer.id)) {
+				const size_t size = range.range + range.offset;
+				m_pushConstantSize = std::max(m_pushConstantSize, size);
+			}
+		}
     }
 
     const VertexLayout& ShaderProgram::getVertexLayout() const{
@@ -172,4 +180,7 @@ namespace vkcv {
     const DescriptorSetLayout& ShaderProgram::getDescriptorSetLayout() const {
         return m_DescriptorSetLayout;
     }
+	size_t ShaderProgram::getPushConstantSize() const {
+		return m_pushConstantSize;
+	}
 }
diff --git a/src/vkcv/Surface.cpp b/src/vkcv/Surface.cpp
deleted file mode 100644
index 29b6c646dc212cba2cc31f32dca5c4fcc023cd03..0000000000000000000000000000000000000000
--- a/src/vkcv/Surface.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-#include "Surface.hpp"
-
-#define GLFW_INCLUDE_VULKAN
-#include <GLFW/glfw3.h>
-
-namespace vkcv {
-	/**
-	* creates surface and checks availability
-	* @param window current window for the surface
-	* @param instance Vulkan-Instance
-	* @param physicalDevice Vulkan-PhysicalDevice
-	* @return created surface
-	*/
-	vk::SurfaceKHR createSurface(GLFWwindow* window, const vk::Instance& instance, const vk::PhysicalDevice& physicalDevice) {
-		//create surface
-		VkSurfaceKHR surface;
-		if (glfwCreateWindowSurface(VkInstance(instance), window, nullptr, &surface) != VK_SUCCESS) {
-			throw std::runtime_error("failed to create a window surface!");
-		}
-		vk::Bool32 surfaceSupport = false;
-		if (physicalDevice.getSurfaceSupportKHR(0, vk::SurfaceKHR(surface), &surfaceSupport) != vk::Result::eSuccess && surfaceSupport != true) {
-			throw std::runtime_error("surface is not supported by the device!");
-		}
-
-		return vk::SurfaceKHR(surface);
-	}
-}
diff --git a/src/vkcv/Surface.hpp b/src/vkcv/Surface.hpp
deleted file mode 100644
index 74aafeba821334767ac5e13cd33e1d9674e12f5b..0000000000000000000000000000000000000000
--- a/src/vkcv/Surface.hpp
+++ /dev/null
@@ -1,8 +0,0 @@
-#pragma once
-#include <vulkan/vulkan.hpp>
-
-struct GLFWwindow;
-
-namespace vkcv {	
-	vk::SurfaceKHR createSurface(GLFWwindow* window, const vk::Instance& instance, const vk::PhysicalDevice& physicalDevice);
-}
\ No newline at end of file
diff --git a/src/vkcv/SwapChain.cpp b/src/vkcv/SwapChain.cpp
index 3483ae37e718453a99d56d31e025433acb7f4422..b787536b66cfd802dfd435a773a584c875eeb391 100644
--- a/src/vkcv/SwapChain.cpp
+++ b/src/vkcv/SwapChain.cpp
@@ -1,29 +1,70 @@
 #include <vkcv/SwapChain.hpp>
+#include <utility>
 
-namespace vkcv {
+#define GLFW_INCLUDE_VULKAN
+#include <GLFW/glfw3.h>
 
-    SwapChain::SwapChain(vk::SurfaceKHR surface, vk::SwapchainKHR swapchain, vk::SurfaceFormatKHR format, uint32_t imageCount)
-        : m_surface(surface), m_swapchain(swapchain), m_format( format), m_ImageCount(imageCount)
+namespace vkcv
+{
+    /**
+    * creates surface and checks availability
+    * @param window current window for the surface
+    * @param instance Vulkan-Instance
+    * @param physicalDevice Vulkan-PhysicalDevice
+    * @return created surface
+    */
+    vk::SurfaceKHR createSurface(GLFWwindow* window, const vk::Instance& instance, const vk::PhysicalDevice& physicalDevice) {
+        //create surface
+        VkSurfaceKHR surface;
+        if (glfwCreateWindowSurface(VkInstance(instance), window, nullptr, &surface) != VK_SUCCESS) {
+            throw std::runtime_error("failed to create a window surface!");
+        }
+        vk::Bool32 surfaceSupport = false;
+        if (physicalDevice.getSurfaceSupportKHR(0, vk::SurfaceKHR(surface), &surfaceSupport) != vk::Result::eSuccess && surfaceSupport != true) {
+            throw std::runtime_error("surface is not supported by the device!");
+        }
+
+        return vk::SurfaceKHR(surface);
+    }
+
+    SwapChain::SwapChain(const Surface &surface,
+                         vk::SwapchainKHR swapchain,
+                         vk::Format format,
+                         vk::ColorSpaceKHR colorSpace,
+                         vk::PresentModeKHR presentMode,
+                         uint32_t imageCount,
+						 vk::Extent2D extent) noexcept :
+    m_Surface(surface),
+    m_Swapchain(swapchain),
+    m_SwapchainFormat(format),
+    m_SwapchainColorSpace(colorSpace),
+    m_SwapchainPresentMode(presentMode),
+    m_SwapchainImageCount(imageCount),
+	m_Extent(extent),
+    m_RecreationRequired(false)
     {}
+    
+    SwapChain::SwapChain(const SwapChain &other) :
+			m_Surface(other.m_Surface),
+			m_Swapchain(other.m_Swapchain),
+			m_SwapchainFormat(other.m_SwapchainFormat),
+			m_SwapchainColorSpace(other.m_SwapchainColorSpace),
+			m_SwapchainPresentMode(other.m_SwapchainPresentMode),
+			m_SwapchainImageCount(other.m_SwapchainImageCount),
+			m_Extent(other.m_Extent),
+			m_RecreationRequired(other.m_RecreationRequired.load())
+	{}
 
     const vk::SwapchainKHR& SwapChain::getSwapchain() const {
-        return m_swapchain;
+        return m_Swapchain;
     }
 
-    /**
-     * gets surface of the swapchain
-     * @return current surface
-     */
-    vk::SurfaceKHR SwapChain::getSurface() {
-        return m_surface;
+    vk::SurfaceKHR SwapChain::getSurface() const {
+        return m_Surface.handle;
     }
 
-    /**
-     * gets the surface of the swapchain
-     * @return chosen format
-     */
-    vk::SurfaceFormatKHR SwapChain::getSurfaceFormat(){
-        return m_format;
+    vk::Format SwapChain::getSwapchainFormat() const{
+        return m_SwapchainFormat;
     }
 
     /**
@@ -33,7 +74,7 @@ namespace vkcv {
      * @param window of the current application
      * @return chosen Extent for the surface
      */
-    vk::Extent2D chooseSwapExtent(vk::PhysicalDevice physicalDevice, vk::SurfaceKHR surface, const Window &window){
+    vk::Extent2D chooseExtent(vk::PhysicalDevice physicalDevice, vk::SurfaceKHR surface, const Window &window){
         vk::SurfaceCapabilitiesKHR surfaceCapabilities;
         if(physicalDevice.getSurfaceCapabilitiesKHR(surface,&surfaceCapabilities) != vk::Result::eSuccess){
             throw std::runtime_error("cannot get surface capabilities. There is an issue with the surface.");
@@ -43,15 +84,10 @@ namespace vkcv {
                 static_cast<uint32_t>(window.getWidth()),
                 static_cast<uint32_t>(window.getHeight())
         };
+        
         extent2D.width = std::max(surfaceCapabilities.minImageExtent.width, std::min(surfaceCapabilities.maxImageExtent.width, extent2D.width));
         extent2D.height = std::max(surfaceCapabilities.minImageExtent.height, std::min(surfaceCapabilities.maxImageExtent.height, extent2D.height));
 
-        if (extent2D.width > surfaceCapabilities.maxImageExtent.width ||
-            extent2D.width < surfaceCapabilities.minImageExtent.width ||
-            extent2D.height > surfaceCapabilities.maxImageExtent.height ||
-            extent2D.height < surfaceCapabilities.minImageExtent.height) {
-            std::printf("Surface size not matching. Resizing to allowed value.");
-        }
         return extent2D;
     }
 
@@ -61,7 +97,7 @@ namespace vkcv {
      * @param surface of the swapchain
      * @return available Format
      */
-    vk::SurfaceFormatKHR chooseSwapSurfaceFormat(vk::PhysicalDevice physicalDevice, vk::SurfaceKHR surface) {
+    vk::SurfaceFormatKHR chooseSurfaceFormat(vk::PhysicalDevice physicalDevice, vk::SurfaceKHR surface) {
         uint32_t formatCount;
         physicalDevice.getSurfaceFormatsKHR(surface, &formatCount, nullptr);
         std::vector<vk::SurfaceFormatKHR> availableFormats(formatCount);
@@ -126,23 +162,29 @@ namespace vkcv {
      * @param context that keeps instance, physicalDevice and a device.
      * @return swapchain
      */
-    SwapChain SwapChain::create(const Window &window, const Context &context, const vk::SurfaceKHR surface) {
+    SwapChain SwapChain::create(const Window &window, const Context &context) {
         const vk::Instance& instance = context.getInstance();
         const vk::PhysicalDevice& physicalDevice = context.getPhysicalDevice();
         const vk::Device& device = context.getDevice();
 
-        vk::Extent2D extent2D = chooseSwapExtent(physicalDevice, surface, window);
-        vk::SurfaceFormatKHR surfaceFormat = chooseSwapSurfaceFormat(physicalDevice, surface);
-        vk::PresentModeKHR presentMode = choosePresentMode(physicalDevice, surface);
-        uint32_t imageCount = chooseImageCount(physicalDevice, surface);
+        Surface surface;
+        surface.handle       = createSurface(window.getWindow(), instance, physicalDevice);
+        surface.formats      = physicalDevice.getSurfaceFormatsKHR(surface.handle);
+        surface.capabilities = physicalDevice.getSurfaceCapabilitiesKHR(surface.handle);
+        surface.presentModes = physicalDevice.getSurfacePresentModesKHR(surface.handle);
+
+        vk::Extent2D chosenExtent = chooseExtent(physicalDevice, surface.handle, window);
+        vk::SurfaceFormatKHR chosenSurfaceFormat = chooseSurfaceFormat(physicalDevice, surface.handle);
+        vk::PresentModeKHR chosenPresentMode = choosePresentMode(physicalDevice, surface.handle);
+        uint32_t chosenImageCount = chooseImageCount(physicalDevice, surface.handle);
 
         vk::SwapchainCreateInfoKHR swapchainCreateInfo(
                 vk::SwapchainCreateFlagsKHR(),  //flags
-                surface,    // surface
-                imageCount,  // minImageCount TODO: how many do we need for our application?? "must be less than or equal to the value returned in maxImageCount" -> 3 for Triple Buffering, else 2 for Double Buffering (should be the standard)
-                surfaceFormat.format,   // imageFormat
-                surfaceFormat.colorSpace,   // imageColorSpace
-                extent2D,   // imageExtent
+                surface.handle,    // surface
+                chosenImageCount,  // minImageCount TODO: how many do we need for our application?? "must be less than or equal to the value returned in maxImageCount" -> 3 for Triple Buffering, else 2 for Double Buffering (should be the standard)
+                chosenSurfaceFormat.format,   // imageFormat
+                chosenSurfaceFormat.colorSpace,   // imageColorSpace
+                chosenExtent,   // imageExtent
                 1,  // imageArrayLayers TODO: should we only allow non-stereoscopic applications? yes -> 1, no -> ? "must be greater than 0, less or equal to maxImageArrayLayers"
                 vk::ImageUsageFlagBits::eColorAttachment,  // imageUsage TODO: what attachments? only color? depth?
                 vk::SharingMode::eExclusive,    // imageSharingMode TODO: which sharing mode? "VK_SHARING_MODE_EXCLUSIV access exclusive to a single queue family, better performance", "VK_SHARING_MODE_CONCURRENT access from multiple queues"
@@ -150,22 +192,71 @@ namespace vkcv {
                 nullptr,    // pQueueFamilyIndices, the pointer to an array of queue family indices having access to the images(s) of the swapchain when imageSharingMode is VK_SHARING_MODE_CONCURRENT
                 vk::SurfaceTransformFlagBitsKHR::eIdentity, // preTransform, transformations applied onto the image before display
                 vk::CompositeAlphaFlagBitsKHR::eOpaque, // compositeAlpha, TODO: how to handle transparent pixels? do we need transparency? If no -> opaque
-                presentMode,    // presentMode
+                chosenPresentMode,    // presentMode
                 true,   // clipped
                 nullptr // oldSwapchain
         );
 
         vk::SwapchainKHR swapchain = device.createSwapchainKHR(swapchainCreateInfo);
 
-        return SwapChain(surface, swapchain, surfaceFormat, imageCount);
+        return SwapChain(surface,
+                         swapchain,
+                         chosenSurfaceFormat.format,
+                         chosenSurfaceFormat.colorSpace,
+                         chosenPresentMode,
+                         chosenImageCount,
+						 chosenExtent);
+    }
+    
+    bool SwapChain::shouldUpdateSwapchain() const {
+    	return m_RecreationRequired;
+    }
+    
+    void SwapChain::updateSwapchain(const Context &context, const Window &window) {
+    	if (!m_RecreationRequired.exchange(false))
+    		return;
+    	
+		vk::SwapchainKHR oldSwapchain = m_Swapchain;
+		vk::Extent2D extent2D = chooseExtent(context.getPhysicalDevice(), m_Surface.handle, window);
+	
+		vk::SwapchainCreateInfoKHR swapchainCreateInfo(
+				vk::SwapchainCreateFlagsKHR(),
+				m_Surface.handle,
+				m_SwapchainImageCount,
+				m_SwapchainFormat,
+				m_SwapchainColorSpace,
+				extent2D,
+				1,
+				vk::ImageUsageFlagBits::eColorAttachment,
+				vk::SharingMode::eExclusive,
+				0,
+				nullptr,
+				vk::SurfaceTransformFlagBitsKHR::eIdentity,
+				vk::CompositeAlphaFlagBitsKHR::eOpaque,
+				m_SwapchainPresentMode,
+				true,
+				oldSwapchain
+		);
+	
+		m_Swapchain = context.getDevice().createSwapchainKHR(swapchainCreateInfo);
+		context.getDevice().destroySwapchainKHR(oldSwapchain);
+		
+		m_Extent = extent2D;
     }
 
+    void SwapChain::signalSwapchainRecreation() {
+		m_RecreationRequired = true;
+    }
+    
+    const vk::Extent2D& SwapChain::getExtent() const {
+    	return m_Extent;
+    }
 
     SwapChain::~SwapChain() {
         // needs to be destroyed by creator
     }
 
 	uint32_t SwapChain::getImageCount() {
-		return m_ImageCount;
+		return m_SwapchainImageCount;
 	}
 }