Varjo Native SDK
Varjo_layers.h
Go to the documentation of this file.
1 // Copyright 2019-2023 Varjo Technologies Oy. All rights reserved.
2 
3 #ifndef VARJO_LAYERS_H
4 #define VARJO_LAYERS_H
5 
6 #include "Varjo.h"
7 #include "Varjo_types.h"
8 #include "Varjo_types_layers.h"
9 
10 #if defined __cplusplus
11 extern "C" {
12 #endif
13 
36 VARJO_API struct varjo_SwapChain* varjo_D3D11CreateSwapChain(struct varjo_Session* session, struct ID3D11Device* dev, struct varjo_SwapChainConfig2* config);
37 
61 VARJO_API struct varjo_SwapChain* varjo_GLCreateSwapChain(struct varjo_Session* session, struct varjo_SwapChainConfig2* config);
62 
86 VARJO_API struct varjo_SwapChain* varjo_D3D12CreateSwapChain(
87  struct varjo_Session* session, struct ID3D12CommandQueue* commandQueue, struct varjo_SwapChainConfig2* config);
88 
113 VARJO_API struct varjo_SwapChain* varjo_VKCreateSwapChain(
114  struct varjo_Session* session, struct VkDevice_T* device, uint32_t queueFamilyIndex, uint32_t queueIndex, struct varjo_SwapChainConfig2* config);
115 
129 VARJO_API struct varjo_Texture varjo_GetSwapChainImage(struct varjo_SwapChain* swapChain, int32_t index);
130 
144 VARJO_API void varjo_AcquireSwapChainImage(struct varjo_SwapChain* swapChain, int32_t* index);
145 
151 VARJO_API void varjo_ReleaseSwapChainImage(struct varjo_SwapChain* swapChain);
152 
158 VARJO_API void varjo_FreeSwapChain(struct varjo_SwapChain* swapChain);
159 
168 VARJO_API void varjo_BeginFrameWithLayers(struct varjo_Session* session);
169 
192 VARJO_API void varjo_EndFrameWithLayers(struct varjo_Session* session, struct varjo_SubmitInfoLayers* submitInfo);
193 
204 VARJO_API void varjo_SetMirrorConfig(struct varjo_Session* session, struct varjo_MirrorView* mirrorViews, uint32_t count);
205 
210 VARJO_API void varjo_ResetMirrorConfig(struct varjo_Session* session);
211 
212 #if defined __cplusplus
213 }
214 #endif
215 
216 #endif
varjo_D3D12CreateSwapChain
struct varjo_SwapChain * varjo_D3D12CreateSwapChain(struct varjo_Session *session, struct ID3D12CommandQueue *commandQueue, struct varjo_SwapChainConfig2 *config)
Create a D3D12 swap chain that can be used when submitting layers.
varjo_EndFrameWithLayers
void varjo_EndFrameWithLayers(struct varjo_Session *session, struct varjo_SubmitInfoLayers *submitInfo)
Submit a set of swap chains to the compositor to be displayed.
Varjo.h
varjo_D3D11CreateSwapChain
struct varjo_SwapChain * varjo_D3D11CreateSwapChain(struct varjo_Session *session, struct ID3D11Device *dev, struct varjo_SwapChainConfig2 *config)
Create a D3D11 swap chain that can be used when submitting layers.
varjo_VKCreateSwapChain
struct varjo_SwapChain * varjo_VKCreateSwapChain(struct varjo_Session *session, struct VkDevice_T *device, uint32_t queueFamilyIndex, uint32_t queueIndex, struct varjo_SwapChainConfig2 *config)
Create a Vulkan swap chain that can be used when submitting layers.
varjo_SwapChainConfig2
Swap chain configuration structure.
Definition: Varjo_types_layers.h:16
varjo_GetSwapChainImage
struct varjo_Texture varjo_GetSwapChainImage(struct varjo_SwapChain *swapChain, int32_t index)
Retrieve a swap chain image with the given index.
varjo_ResetMirrorConfig
void varjo_ResetMirrorConfig(struct varjo_Session *session)
Resets mirror config, effectively disabling mirror view feature.
varjo_SubmitInfoLayers
A structure describing the list of layers that the application submits to the compositor each frame.
Definition: Varjo_types_layers.h:224
varjo_FreeSwapChain
void varjo_FreeSwapChain(struct varjo_SwapChain *swapChain)
Delete a swap chain object.
varjo_ReleaseSwapChainImage
void varjo_ReleaseSwapChainImage(struct varjo_SwapChain *swapChain)
Release a swap chain image previously acquired with a call to varjo_AcquireSwapChainImage.
varjo_AcquireSwapChainImage
void varjo_AcquireSwapChainImage(struct varjo_SwapChain *swapChain, int32_t *index)
Acquire (lock) the next image in the swap chain for rendering.
varjo_Texture
API-agnostic texture handle.
Definition: Varjo_types.h:512
Varjo_types.h
varjo_MirrorView
Describes mirror view.
Definition: Varjo_types_layers.h:39
varjo_SetMirrorConfig
void varjo_SetMirrorConfig(struct varjo_Session *session, struct varjo_MirrorView *mirrorViews, uint32_t count)
Configures where Compositor should render mirror views.
varjo_BeginFrameWithLayers
void varjo_BeginFrameWithLayers(struct varjo_Session *session)
Begin rendering the frame.
Varjo_types_layers.h
varjo_GLCreateSwapChain
struct varjo_SwapChain * varjo_GLCreateSwapChain(struct varjo_Session *session, struct varjo_SwapChainConfig2 *config)
Create an OpenGL swap chain that can be used when submitting layers.