forked from LukasBanana/LLGL
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathC99Report.cpp
55 lines (40 loc) · 1.16 KB
/
C99Report.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
/*
* C99Report.cpp
*
* Copyright (c) 2015 Lukas Hermanns. All rights reserved.
* Licensed under the terms of the BSD 3-Clause license (see LICENSE.txt).
*/
#include <LLGL/Report.h>
#include <LLGL-C/Report.h>
#include "C99Internal.h"
// namespace LLGL {
using namespace LLGL;
LLGL_C_EXPORT LLGLReport llglAllocReport()
{
return LLGLReport{ new Report };
}
LLGL_C_EXPORT void llglFreeReport(LLGLReport report)
{
delete LLGL_PTR(Report, report);
}
LLGL_C_EXPORT const char* llglGetReportText(LLGLReport report)
{
if (const Report* internalReport = LLGL_PTR(Report, report))
return internalReport->GetText();
else
return "";
}
LLGL_C_EXPORT bool llglHasReportErrors(LLGLReport report)
{
if (const Report* internalReport = LLGL_PTR(Report, report))
return internalReport->HasErrors();
else
return false;
}
LLGL_C_EXPORT void llglResetReport(LLGLReport report, const char* text, bool hasErrors)
{
if (Report* internalReport = LLGL_PTR(Report, report))
return internalReport->Reset(text, hasErrors);
}
// } /namespace LLGL
// ================================================================================