8 #include "renderutils.h"
9 #include "irendertarget.h"
79 virtual void onDestroy()
override;
87 const glm::ivec2 getSize()
const;
121 const glm::ivec2 getBufferSize()
const override;
137 const std::string&
getTitle()
const {
return mTitle; }
142 void setTitle(std::string newTitle);
154 void setFullscreen(
bool value);
159 void toggleFullscreen();
165 void setWidth(
int width);
171 void setHeight(
int height);
177 void setSize(
const glm::ivec2& size);
195 void setPosition(
const glm::ivec2& position);
200 const glm::ivec2 getPosition()
const;
205 SDL_Window* getNativeWindow()
const;
210 virtual uint getNumber()
const override;
229 virtual void beginRendering()
override;
234 virtual void endRendering()
override;
244 virtual VkFormat getDepthFormat()
const override;
249 virtual VkSampleCountFlagBits
getSampleCount()
const override {
return mRasterizationSamples; }
266 bool mSampleShading =
true;
269 bool mBorderless =
false;
270 bool mResizable =
true;
271 bool mVisible =
true;
273 std::string mTitle =
"";
276 int mAddedSwapImages = 1;
277 bool mRestorePosition =
true;
278 bool mRestoreSize =
true;
282 SDL_Window* mSDLWindow =
nullptr;
283 VkSampleCountFlagBits mRasterizationSamples = VK_SAMPLE_COUNT_1_BIT;
284 VkDevice mDevice = VK_NULL_HANDLE;
285 VkSurfaceKHR mSurface = VK_NULL_HANDLE;
286 VkSwapchainKHR mSwapchain = VK_NULL_HANDLE;
287 VkRenderPass mRenderPass = VK_NULL_HANDLE;
288 VkQueue mPresentQueue = VK_NULL_HANDLE;
289 VkFormat mSwapchainFormat = VK_FORMAT_UNDEFINED;
290 std::vector<VkImageView> mSwapChainImageViews;
291 std::vector<VkFramebuffer> mSwapChainFramebuffers;
292 std::vector<VkCommandBuffer> mCommandBuffers;
293 std::vector<VkSemaphore> mImageAvailableSemaphores;
294 std::vector<VkSemaphore> mRenderFinishedSemaphores;
295 std::vector<int> mImagesInFlight;
296 VkPresentModeKHR mPresentationMode = VK_PRESENT_MODE_MAILBOX_KHR;
299 bool mSampleShadingEnabled =
false;
300 uint32 mCurrentImageIndex = 0;
301 uint32 mSwapChainImageCount = 0;
302 bool mRecreateSwapchain =
false;
303 VkSurfaceCapabilitiesKHR mSurfaceCapabilities;
304 VkExtent2D mSwapchainExtent = {0,0};
312 VkCommandBuffer beginRecording();
342 void destroySwapChainResources();
347 bool validSwapchainExtent()
const;
352 void handleEvent(
const Event& event);