Animación Vulkan 1.0
Animación de tiro libre baloncesto con motor gráfico desarrollado en clase
Cargando...
Buscando...
Nada coincide
Referencia de la clase GEDrawingContext

Clase que contiene la información sobre el destino de las imágenes a generar (swapchain, vistas, colas de comandos). Más...

#include <GEDrawingContext.h>

Métodos públicos

 GEDrawingContext (GEGraphicsContext *gc, GEWindowPosition wpos)
 Crea el contexto de dibujo (swapchain, vistas y sincronización).
void destroy (GEGraphicsContext *gc)
 Destruye los recursos del contexto de dibujo.
void recreate (GEGraphicsContext *gc, GEWindowPosition wpos)
 Reconstruye el contexto de dibujo tras un cambio de tamaño.
VkFormat getFormat ()
 Obtiene el formato de la imagen.
VkExtent2D getExtent ()
 Obtiene la extensión de la imagen.
uint32_t getImageCount ()
 Obtiene el número de imágenes de la swapchain.
uint32_t getCurrentImage ()
 Obtiene el índice de la imagen actual.
void waitForNextImage (GEGraphicsContext *gc)
 Espera y adquiere la siguiente imagen disponible.
void submitGraphicsCommands (GEGraphicsContext *gc, std::vector< VkCommandBuffer > commandBuffers)
 Envía los comandos gráficos para la imagen actual.
void submitPresentCommands (GEGraphicsContext *gc)
 Envía los comandos de presentación para la imagen actual.

Atributos públicos

std::vector< VkImageView > imageViews
 Vistas de las imágenes del swapchain.

Métodos privados

void createSwapChain (GEGraphicsContext *gc, GEWindowPosition wpos)
 Crea el swapchain y obtiene las imágenes y formatos adecuados.
void createImageViews (VkDevice device)
 Crea una vista para cada imagen del swapchain.
void createSyncObjects (VkDevice device)
 Crea semáforos y fences para sincronización entre frames.
void createQueues (GEGraphicsContext *gc)
 Obtiene las colas gráficas y de presentación del dispositivo.
VkSurfaceFormatKHR chooseSwapSurfaceFormat (const std::vector< VkSurfaceFormatKHR > &availableFormats)
 Escoge el formato de imagen entre los soportados por la superficie.
VkExtent2D chooseSwapExtent (const VkSurfaceCapabilitiesKHR &capabilities, GEWindowPosition wpos)
 Selecciona la extensión (tamaño) adecuada para las imágenes del swapchain.

Atributos privados

uint32_t imageCount
 Número de imágenes en la swapchain.
uint32_t frameCount
 Número de frames en vuelo.
size_t currentFrame = 0
 Índice del frame actual.
uint32_t currentImage = 0
 Índice de la imagen actual.
VkSwapchainKHR swapChain
 Swapchain de Vulkan.
VkFormat imageFormat
 Formato de imagen.
VkExtent2D imageExtent
 Extensión de las imágenes.
std::vector< VkImage > images
 Imágenes de la swapchain.
VkQueue graphicsQueue
 Cola gráfica.
VkQueue presentQueue
 Cola de presentación.
std::vector< VkSemaphore > imageAvailableSemaphores
 Semáforos de imagen disponible.
std::vector< VkSemaphore > renderFinishedSemaphores
 Semáforos de render terminado.
std::vector< VkFence > inFlightFences
 Fences por frame.
std::vector< VkFence > imagesInFlight
 Fence por imagen.

Descripción detallada

Clase que contiene la información sobre el destino de las imágenes a generar (swapchain, vistas, colas de comandos).

Documentación de constructores y destructores

◆ GEDrawingContext()

GEDrawingContext::GEDrawingContext ( GEGraphicsContext * gc,
GEWindowPosition wpos )

Crea el contexto de dibujo (swapchain, vistas y sincronización).

Parámetros
gcContexto gráfico.
wposPosición y tamaño de la ventana.

Hace referencia a createImageViews(), createQueues(), createSwapChain(), createSyncObjects() y GEGraphicsContext::device.

Gráfico de llamadas de esta función:

Documentación de funciones miembro

◆ chooseSwapExtent()

VkExtent2D GEDrawingContext::chooseSwapExtent ( const VkSurfaceCapabilitiesKHR & capabilities,
GEWindowPosition wpos )
private

Selecciona la extensión (tamaño) adecuada para las imágenes del swapchain.

Parámetros
capabilitiesCapacidades de la superficie.
wposPosición y tamaño de la ventana.
Devuelve
Extensión de la imagen seleccionada.

Hace referencia a GEWindowPosition::fullScreen, GEWindowPosition::height, GEWindowPosition::screenHeight, GEWindowPosition::screenWidth y GEWindowPosition::width.

Referenciado por createSwapChain().

Gráfico de llamadas a esta función:

◆ chooseSwapSurfaceFormat()

VkSurfaceFormatKHR GEDrawingContext::chooseSwapSurfaceFormat ( const std::vector< VkSurfaceFormatKHR > & availableFormats)
private

Escoge el formato de imagen entre los soportados por la superficie.

Parámetros
availableFormatsFormatos disponibles.
Devuelve
Formato de superficie seleccionado.

Referenciado por createSwapChain().

Gráfico de llamadas a esta función:

◆ createImageViews()

void GEDrawingContext::createImageViews ( VkDevice device)
private

Crea una vista para cada imagen del swapchain.

Parámetros
deviceDispositivo Vulkan.

Hace referencia a imageCount, imageFormat, images y imageViews.

Referenciado por GEDrawingContext() y recreate().

Gráfico de llamadas a esta función:

◆ createQueues()

void GEDrawingContext::createQueues ( GEGraphicsContext * gc)
private

Obtiene las colas gráficas y de presentación del dispositivo.

Parámetros
gcContexto gráfico.

Hace referencia a GEGraphicsContext::device, graphicsQueue, GEGraphicsContext::graphicsQueueFamilyIndex, presentQueue y GEGraphicsContext::presentQueueFamilyIndex.

Referenciado por GEDrawingContext().

Gráfico de llamadas a esta función:

◆ createSwapChain()

void GEDrawingContext::createSwapChain ( GEGraphicsContext * gc,
GEWindowPosition wpos )
private

Crea el swapchain y obtiene las imágenes y formatos adecuados.

Parámetros
gcContexto gráfico.
wposPosición y tamaño de la ventana.

Hace referencia a chooseSwapExtent(), chooseSwapSurfaceFormat(), GEGraphicsContext::device, GEGraphicsContext::graphicsQueueFamilyIndex, imageCount, imageExtent, imageFormat, images, GEGraphicsContext::physicalDevice, GEGraphicsContext::presentQueueFamilyIndex, GEGraphicsContext::surface y swapChain.

Referenciado por GEDrawingContext() y recreate().

Gráfico de llamadas de esta función:
Gráfico de llamadas a esta función:

◆ createSyncObjects()

void GEDrawingContext::createSyncObjects ( VkDevice device)
private

Crea semáforos y fences para sincronización entre frames.

Parámetros
deviceDispositivo Vulkan.

Hace referencia a frameCount, imageAvailableSemaphores, imageCount, images, imagesInFlight, inFlightFences y renderFinishedSemaphores.

Referenciado por GEDrawingContext().

Gráfico de llamadas a esta función:

◆ destroy()

void GEDrawingContext::destroy ( GEGraphicsContext * gc)

Destruye los recursos del contexto de dibujo.

Parámetros
gcContexto gráfico.

Hace referencia a GEGraphicsContext::device, frameCount, imageAvailableSemaphores, imageCount, imageViews, inFlightFences, renderFinishedSemaphores y swapChain.

◆ getCurrentImage()

uint32_t GEDrawingContext::getCurrentImage ( )

Obtiene el índice de la imagen actual.

Devuelve
Índice de la imagen.

Hace referencia a currentImage.

◆ getExtent()

VkExtent2D GEDrawingContext::getExtent ( )

Obtiene la extensión de la imagen.

Obtiene la extensión (tamaño) de las imágenes.

Devuelve
Extensión de la imagen.

Hace referencia a imageExtent.

Referenciado por GERenderingContext::GERenderingContext(), GEScene::GEScene() y GEScene::recreate().

Gráfico de llamadas a esta función:

◆ getFormat()

VkFormat GEDrawingContext::getFormat ( )

Obtiene el formato de la imagen.

Obtiene el formato de imagen de la swapchain.

Devuelve
Formato de la imagen.

Hace referencia a imageFormat.

Referenciado por GERenderingContext::GERenderingContext().

Gráfico de llamadas a esta función:

◆ getImageCount()

uint32_t GEDrawingContext::getImageCount ( )

Obtiene el número de imágenes de la swapchain.

Devuelve
Número de imágenes.

Hace referencia a imageCount.

Referenciado por GERenderingContext::GERenderingContext().

Gráfico de llamadas a esta función:

◆ recreate()

void GEDrawingContext::recreate ( GEGraphicsContext * gc,
GEWindowPosition wpos )

Reconstruye el contexto de dibujo tras un cambio de tamaño.

Reconstruye los componentes del contexto de dibujo tras un cambio de tamaño.

Parámetros
gcContexto gráfico.
wposNueva posición/tamaño de la ventana.

Hace referencia a createImageViews(), createSwapChain(), GEGraphicsContext::device, imageCount, imageViews y swapChain.

Gráfico de llamadas de esta función:

◆ submitGraphicsCommands()

void GEDrawingContext::submitGraphicsCommands ( GEGraphicsContext * gc,
std::vector< VkCommandBuffer > commandBuffers )

Envía los comandos gráficos para la imagen actual.

Envía los comandos gráficos al dispositivo para la imagen actual.

Parámetros
gcContexto gráfico.
commandBuffersVector con los command buffers.

Hace referencia a currentFrame, currentImage, GEGraphicsContext::device, graphicsQueue, imageAvailableSemaphores, imagesInFlight, inFlightFences y renderFinishedSemaphores.

◆ submitPresentCommands()

void GEDrawingContext::submitPresentCommands ( GEGraphicsContext * gc)

Envía los comandos de presentación para la imagen actual.

Envía los comandos de presentación al dispositivo para mostrar la imagen.

Parámetros
gcContexto gráfico.

Hace referencia a currentFrame, currentImage, frameCount, presentQueue, renderFinishedSemaphores y swapChain.

◆ waitForNextImage()

void GEDrawingContext::waitForNextImage ( GEGraphicsContext * gc)

Espera y adquiere la siguiente imagen disponible.

Espera y adquiere la siguiente imagen disponible para render.

Parámetros
gcContexto gráfico.

Hace referencia a currentFrame, currentImage, GEGraphicsContext::device, imageAvailableSemaphores, inFlightFences y swapChain.

Documentación de datos miembro

◆ currentFrame

size_t GEDrawingContext::currentFrame = 0
private

Índice del frame actual.

Referenciado por submitGraphicsCommands(), submitPresentCommands() y waitForNextImage().

◆ currentImage

uint32_t GEDrawingContext::currentImage = 0
private

Índice de la imagen actual.

Referenciado por getCurrentImage(), submitGraphicsCommands(), submitPresentCommands() y waitForNextImage().

◆ frameCount

uint32_t GEDrawingContext::frameCount
private

Número de frames en vuelo.

Referenciado por createSyncObjects(), destroy() y submitPresentCommands().

◆ graphicsQueue

VkQueue GEDrawingContext::graphicsQueue
private

Cola gráfica.

Referenciado por createQueues() y submitGraphicsCommands().

◆ imageAvailableSemaphores

std::vector<VkSemaphore> GEDrawingContext::imageAvailableSemaphores
private

Semáforos de imagen disponible.

Referenciado por createSyncObjects(), destroy(), submitGraphicsCommands() y waitForNextImage().

◆ imageCount

uint32_t GEDrawingContext::imageCount
private

Número de imágenes en la swapchain.

Referenciado por createImageViews(), createSwapChain(), createSyncObjects(), destroy(), getImageCount() y recreate().

◆ imageExtent

VkExtent2D GEDrawingContext::imageExtent
private

Extensión de las imágenes.

Referenciado por createSwapChain() y getExtent().

◆ imageFormat

VkFormat GEDrawingContext::imageFormat
private

Formato de imagen.

Referenciado por createImageViews(), createSwapChain() y getFormat().

◆ images

std::vector<VkImage> GEDrawingContext::images
private

Imágenes de la swapchain.

Referenciado por createImageViews(), createSwapChain() y createSyncObjects().

◆ imagesInFlight

std::vector<VkFence> GEDrawingContext::imagesInFlight
private

Fence por imagen.

Referenciado por createSyncObjects() y submitGraphicsCommands().

◆ imageViews

std::vector<VkImageView> GEDrawingContext::imageViews

Vistas de las imágenes del swapchain.

Referenciado por GERenderingContext::createFramebuffers(), createImageViews(), destroy() y recreate().

◆ inFlightFences

std::vector<VkFence> GEDrawingContext::inFlightFences
private

◆ presentQueue

VkQueue GEDrawingContext::presentQueue
private

Cola de presentación.

Referenciado por createQueues() y submitPresentCommands().

◆ renderFinishedSemaphores

std::vector<VkSemaphore> GEDrawingContext::renderFinishedSemaphores
private

Semáforos de render terminado.

Referenciado por createSyncObjects(), destroy(), submitGraphicsCommands() y submitPresentCommands().

◆ swapChain

VkSwapchainKHR GEDrawingContext::swapChain
private

La documentación de esta clase está generada de los siguientes archivos: