forked from LukasBanana/LLGL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC99SwapChain.cpp
68 lines (49 loc) · 1.73 KB
/
C99SwapChain.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* C99SwapChain.cpp
*
* Copyright (c) 2015 Lukas Hermanns. All rights reserved.
* Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt).
*/
#include <LLGL/SwapChain.h>
#include <LLGL-C/SwapChain.h>
#include "C99Internal.h"
// namespace LLGL {
using namespace LLGL;
LLGL_C_EXPORT void llglPresent(LLGLSwapChain swapChain)
{
LLGL_PTR(SwapChain, swapChain)->Present();
}
LLGL_C_EXPORT uint32_t llglGetCurrentSwapIndex(LLGLSwapChain swapChain)
{
return LLGL_PTR(SwapChain, swapChain)->GetCurrentSwapIndex();
}
LLGL_C_EXPORT uint32_t llglGetNumSwapBuffers(LLGLSwapChain swapChain)
{
return LLGL_PTR(SwapChain, swapChain)->GetNumSwapBuffers();
}
LLGL_C_EXPORT LLGLFormat llglGetColorFormat(LLGLSwapChain swapChain)
{
return (LLGLFormat)LLGL_PTR(SwapChain, swapChain)->GetColorFormat();
}
LLGL_C_EXPORT LLGLFormat llglGetDepthStencilFormat(LLGLSwapChain swapChain)
{
return (LLGLFormat)LLGL_PTR(SwapChain, swapChain)->GetDepthStencilFormat();
}
LLGL_C_EXPORT bool llglResizeBuffers(LLGLSwapChain swapChain, const LLGLExtent2D* resolution, long flags)
{
return LLGL_PTR(SwapChain, swapChain)->ResizeBuffers(*(const Extent2D*)resolution, flags);
}
LLGL_C_EXPORT bool llglSetVsyncInterval(LLGLSwapChain swapChain, uint32_t vsyncInterval)
{
return LLGL_PTR(SwapChain, swapChain)->SetVsyncInterval(vsyncInterval);
}
LLGL_C_EXPORT bool llglSwitchFullscreen(LLGLSwapChain swapChain, bool enable)
{
return LLGL_PTR(SwapChain, swapChain)->SwitchFullscreen(enable);
}
LLGL_C_EXPORT LLGLSurface llglGetSurface(LLGLSwapChain swapChain)
{
return LLGLSurface{ &(LLGL_PTR(SwapChain, swapChain)->GetSurface()) };
}
// } /namespace LLGL
// ================================================================================