1 /**************************************************************************
3 * Copyright 2013-2014 RAD Game Tools and Valve Software
6 * Permission is hereby granted, free of charge, to any person obtaining a copy
7 * of this software and associated documentation files (the "Software"), to deal
8 * in the Software without restriction, including without limitation the rights
9 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10 * copies of the Software, and to permit persons to whom the Software is
11 * furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24 **************************************************************************/
27 * libbacktrace_test.cpp
31 #include "vogl_core.h"
32 #include "vogl_json.h"
34 namespace blahnamespace
41 void foobar(int x, const char *y, double z);
48 void blah::foobar(int x, const char *y, double z)
56 const char *calling_module = btrace_get_calling_module();
57 const char *current_module = btrace_get_current_module();
59 printf("\nbtrace_get_calling_module returns: %s\n", calling_module ? calling_module : "??");
60 printf("\nbtrace_get_current_module returns: %s\n", current_module ? current_module : "??");
66 blahnamespace::blah b;
71 typedef void (PFN)(void);
72 extern int yyy(PFN *pfn);
74 inline void foo_inlined()
85 int main(int argc, char *argv[])
87 VOGL_NOTE_UNUSED(argc);
88 VOGL_NOTE_UNUSED(argv);
90 printf("libbacktrace_test: hello world!\n\n");
96 // Update btrace with our gl info.
97 btrace_get_glinfo().version_str = "version string here";
98 btrace_get_glinfo().glsl_version_str = "glsl version 4 billion";
99 btrace_get_glinfo().vendor_str = "vendor";
100 btrace_get_glinfo().renderer_str = "renderer_str";
102 vogl::json_document cur_doc;
103 btrace_get_machine_info(cur_doc.get_root());
104 cur_doc.print(true, 0, 0);