diff --git a/examples/opengl/triangle/CMakeLists.txt b/examples/opengl/triangle/CMakeLists.txt index 4088ec99..cb1d21fb 100644 --- a/examples/opengl/triangle/CMakeLists.txt +++ b/examples/opengl/triangle/CMakeLists.txt @@ -20,7 +20,6 @@ project(gl_spinning_triangle LANGUAGES C CXX) # --------------------------------------------------------------------------- set(TRACY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../..") option(TRACY_ENABLE "Enable Tracy profiling" ON) -option(TRACY_OPENGL_AUTO_CALIBRATION "Enable periodic GPU/CPU recalibration" ON) # --------------------------------------------------------------------------- # Platform — RGFW (cross-platform windowing, fetched automatically) @@ -85,9 +84,6 @@ target_compile_features(gl_spinning_triangle PRIVATE cxx_std_17) if(TRACY_ENABLE) target_compile_definitions(gl_spinning_triangle PRIVATE TRACY_ENABLE) endif() -if(TRACY_OPENGL_AUTO_CALIBRATION) - target_compile_definitions(gl_spinning_triangle PRIVATE TRACY_OPENGL_AUTO_CALIBRATION) -endif() target_include_directories(gl_spinning_triangle PRIVATE "${TRACY_DIR}/public" diff --git a/examples/opengl/triangle/platform/platform.h b/examples/opengl/triangle/platform/platform.h index a82280cb..4513e9f9 100644 --- a/examples/opengl/triangle/platform/platform.h +++ b/examples/opengl/triangle/platform/platform.h @@ -6,10 +6,6 @@ #pragma once #ifdef __APPLE__ -// OpenGL is only available on MacOS (no iOS support) -// Anything from gl3.h will spew deprecation warnings when used, -// unless GL_SILENCE_DEPRECATION has been defined beforehand -//# define GL_SILENCE_DEPRECATION # include #else # include diff --git a/examples/opengl/triangle/spinning_triangle.cpp b/examples/opengl/triangle/spinning_triangle.cpp index dd826295..2c4f728c 100644 --- a/examples/opengl/triangle/spinning_triangle.cpp +++ b/examples/opengl/triangle/spinning_triangle.cpp @@ -1,14 +1,23 @@ // spinning_triangle.cpp — OpenGL spinning triangle demo with Tracy GPU profiling. -// -// Tracy GPU zones are active on non-Apple platforms when TRACY_ENABLE is defined. -// TRACY_OPENGL_AUTO_CALIBRATION (enabled by default in CMakeLists.txt) enables -// periodic GPU/CPU drift correction via glGetInteger64v(GL_TIMESTAMP). -#include "platform/platform.h" -#include -#include +#ifdef __APPLE__ +// NOTE: OpenGL is only available on MacOS (no iOS support) +// Including and using anything related to OpenGL on Apple (like ) +// will emit deprecation warnings, unless GL_SILENCE_DEPRECATION is defined +#define GL_SILENCE_DEPRECATION +// NOTE: TracyOpenGL.hpp will not work as expected even on Apple devices that +// support OpenGL, because the OpenGL drivers do not implement ARB_timer_query +// properly (querying GL_TIMESTAMP always resolves to 0). TracyOpenGL.hpp will +// emit a compiler warning, and a Tracy message to the trace/profiler, but the +// program will still run. +#endif + +#include "platform/platform.h" // also includes OpenGL headers #include + +// NOTE: opt-in toggle for periodic recalibrations during Collect() +#define TRACY_OPENGL_AUTO_CALIBRATION #include static const int kWidth = 800;