Varjo Native SDK
Varjo_layers.h
Go to the documentation of this file.
1 // Copyright 2019-2021 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 
38 VARJO_API struct varjo_SwapChain* varjo_D3D11CreateSwapChain(struct varjo_Session* session, struct ID3D11Device* dev, struct varjo_SwapChainConfig2* config);
39 
65 VARJO_API struct varjo_SwapChain* varjo_GLCreateSwapChain(struct varjo_Session* session, struct varjo_SwapChainConfig2* config);
66 
90 VARJO_API struct varjo_SwapChain* varjo_D3D12CreateSwapChain(
91  struct varjo_Session* session, struct ID3D12CommandQueue* commandQueue, struct varjo_SwapChainConfig2* config);
92 
106 VARJO_API struct varjo_Texture varjo_GetSwapChainImage(struct varjo_SwapChain* swapChain, int32_t index);
107 
121 VARJO_API void varjo_AcquireSwapChainImage(struct varjo_SwapChain* swapChain, int32_t* index);
122 
128 VARJO_API void varjo_ReleaseSwapChainImage(struct varjo_SwapChain* swapChain);
129 
135 VARJO_API void varjo_FreeSwapChain(struct varjo_SwapChain* swapChain);
136 
145 VARJO_API void varjo_BeginFrameWithLayers(struct varjo_Session* session);
146 
169 VARJO_API void varjo_EndFrameWithLayers(struct varjo_Session* session, struct varjo_SubmitInfoLayers* submitInfo);
170 
171 #if defined __cplusplus
172 }
173 #endif
174 
175 #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_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_SubmitInfoLayers
A structure describing the list of layers that the application submits to the compositor each frame.
Definition: Varjo_types_layers.h:171
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:457
Varjo_types.h
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.