Skip to content

Commit 8322348

Browse files
committed
better comments and messages
1 parent daba5ac commit 8322348

3 files changed

Lines changed: 16 additions & 15 deletions

File tree

examples/opengl/triangle/CMakeLists.txt

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ project(gl_spinning_triangle LANGUAGES C CXX)
2020
# ---------------------------------------------------------------------------
2121
set(TRACY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../..")
2222
option(TRACY_ENABLE "Enable Tracy profiling" ON)
23-
option(TRACY_OPENGL_AUTO_CALIBRATION "Enable periodic GPU/CPU recalibration" ON)
2423

2524
# ---------------------------------------------------------------------------
2625
# Platform — RGFW (cross-platform windowing, fetched automatically)
@@ -85,9 +84,6 @@ target_compile_features(gl_spinning_triangle PRIVATE cxx_std_17)
8584
if(TRACY_ENABLE)
8685
target_compile_definitions(gl_spinning_triangle PRIVATE TRACY_ENABLE)
8786
endif()
88-
if(TRACY_OPENGL_AUTO_CALIBRATION)
89-
target_compile_definitions(gl_spinning_triangle PRIVATE TRACY_OPENGL_AUTO_CALIBRATION)
90-
endif()
9187

9288
target_include_directories(gl_spinning_triangle PRIVATE
9389
"${TRACY_DIR}/public"

examples/opengl/triangle/platform/platform.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@
66
#pragma once
77

88
#ifdef __APPLE__
9-
// OpenGL is only available on MacOS (no iOS support)
10-
// Anything from gl3.h will spew deprecation warnings when used,
11-
// unless GL_SILENCE_DEPRECATION has been defined beforehand
12-
//# define GL_SILENCE_DEPRECATION
139
# include <OpenGL/gl3.h>
1410
#else
1511
# include <GL/glew.h>

examples/opengl/triangle/spinning_triangle.cpp

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,23 @@
11
// spinning_triangle.cpp — OpenGL spinning triangle demo with Tracy GPU profiling.
2-
//
3-
// Tracy GPU zones are active on non-Apple platforms when TRACY_ENABLE is defined.
4-
// TRACY_OPENGL_AUTO_CALIBRATION (enabled by default in CMakeLists.txt) enables
5-
// periodic GPU/CPU drift correction via glGetInteger64v(GL_TIMESTAMP).
62

7-
#include "platform/platform.h"
8-
#include <cmath>
9-
#include <cstdio>
3+
#ifdef __APPLE__
4+
// NOTE: OpenGL is only available on MacOS (no iOS support)
5+
// Including and using anything related to OpenGL on Apple (like <OpenGL/gl3.h>)
6+
// will emit deprecation warnings, unless GL_SILENCE_DEPRECATION is defined
7+
#define GL_SILENCE_DEPRECATION
8+
// NOTE: TracyOpenGL.hpp will not work as expected even on Apple devices that
9+
// support OpenGL, because the OpenGL drivers do not implement ARB_timer_query
10+
// properly (querying GL_TIMESTAMP always resolves to 0). TracyOpenGL.hpp will
11+
// emit a compiler warning, and a Tracy message to the trace/profiler, but the
12+
// program will still run.
13+
#endif
14+
15+
#include "platform/platform.h" // also includes OpenGL headers
1016

1117
#include <tracy/Tracy.hpp>
18+
19+
// NOTE: opt-in toggle for periodic recalibrations during Collect()
20+
#define TRACY_OPENGL_AUTO_CALIBRATION
1221
#include <tracy/TracyOpenGL.hpp>
1322

1423
static const int kWidth = 800;

0 commit comments

Comments
 (0)