#pragma once

#include <vulkan/vulkan.h>
#include <vector>
#include "GEGraphicsContext.h"
#include "GEWindowPosition.h"

class GEDrawingContext
{

private:
	// Campos auxiliares
	uint32_t imageCount;

	// Componentes gráficos
	VkSwapchainKHR swapChain;
	VkFormat imageFormat;
	VkExtent2D imageExtent;
	std::vector<VkImage> images;

public:
	GEDrawingContext(GEGraphicsContext* gc, GEWindowPosition wpos);
	void destroy(GEGraphicsContext* gc);
	void recreate(GEGraphicsContext* gc, GEWindowPosition wpos);
	VkFormat getFormat();
	VkExtent2D getExtent();
	uint32_t getImageCount();

private:
	// Métodos de creación de componentes
	void createSwapChain(GEGraphicsContext* gc, GEWindowPosition wpos);

	// Métodos auxiliares
	VkSurfaceFormatKHR chooseSwapSurfaceFormat(const std::vector<VkSurfaceFormatKHR>& availableFormats);
	VkExtent2D chooseSwapExtent(const VkSurfaceCapabilitiesKHR& capabilities, GEWindowPosition wpos);
};

