Visual Computing Library
Loading...
Searching...
No Matches
callback.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_BGFX_CONTEXT_CALLBACK_H
24#define VCL_BGFX_CONTEXT_CALLBACK_H
25
26#include <bgfx/bgfx.h>
27
28namespace vcl {
29
30class Callback : public bgfx::CallbackI
31{
32 bool mDebugVerbose = true;
33
34public:
35 Callback() = default;
36
37 Callback(const Callback&) = delete;
38 Callback& operator=(const Callback&) = delete;
39 Callback(Callback&&) = delete;
40 Callback& operator=(Callback&&) = delete;
41
42 void setDebugVerbosity(bool verbose) { mDebugVerbose = verbose; }
43
44 // CallbackI interface
45 void fatal(
46 const char* filePath,
48 bgfx::Fatal::Enum code,
49 const char* str);
50
51 void traceVargs(
52 const char* filePath,
54 const char* format,
56
57 void profilerBegin(
58 const char* name,
59 uint32_t abgr,
60 const char* filePath,
62
63 void profilerBeginLiteral(
64 const char* name,
65 uint32_t abgr,
66 const char* filePath,
68
69 void profilerEnd();
70
71 uint32_t cacheReadSize(uint64_t id);
72
73 bool cacheRead(uint64_t id, void* data, uint32_t size);
74
75 void cacheWrite(uint64_t id, const void* data, uint32_t size);
76
77 void screenShot(
78 const char* filePath,
79 uint32_t width,
80 uint32_t height,
82 const void* data,
83 uint32_t size,
84 bool yflip);
85
86 void captureBegin(
87 uint32_t width,
88 uint32_t height,
90 bgfx::TextureFormat::Enum format,
91 bool yflip);
92
93 void captureEnd();
94
95 void captureFrame(const void* data, uint32_t size);
96};
97
98} // namespace vcl
99
100#endif // VCL_BGFX_CONTEXT_CALLBACK_H
Definition callback.h:31
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43