Files
plotter/include/plot/gl/caps.hpp
T
Martino Ferrari ed3a8ce645 licence: MIT LICENSE and SPDX identifiers in every first-party file
The repository had no licence at all, so every source was all-rights-reserved
by default. Add the verbatim MIT text at LICENSE (Copyright (c) 2026 Martino
Ferrari) and a two-line SPDX header to each of the 113 first-party sources --
48 include/plot, 26 src, 10 adapters, 5 examples, 21 tests, 3 tools -- so the
grant travels with each file rather than relying on the root document alone.

Scripts keep their shebang on line 1; the SPDX lines follow it. Genuinely
vendored code is untouched: third_party/stb_truetype.h carries no header of
ours. src/render/embedded_mono_font.cpp is generated, so tools/fonts/gen_atlas.py
emit() now writes the two lines into its header comment and the file was
regenerated -- gen_atlas.py --check passes and the regeneration adds only those
comment lines to the previously committed file.

README's provenance section now states MIT and links LICENSE.

No code, test or public API change.
2026-09-28 22:13:40 +02:00

34 lines
1.3 KiB
C++

// SPDX-License-Identifier: MIT
// SPDX-FileCopyrightText: 2026 Martino Ferrari
#pragma once
#include <plot/gl/api.hpp>
namespace plot::gl {
/// What the current context can do. Only OpenGL 3.3 core is required; every
/// field above that baseline is false when the driver does not offer it.
struct Caps {
int major = 0;
int minor = 0;
/// GL_VERSION / GL_RENDERER / GL_VENDOR strings. They are owned by the
/// context: valid until it is destroyed, and empty ("") when nothing has
/// been probed yet.
const char* renderer = "";
const char* vendor = "";
bool compute = false; ///< GL 4.3+ (compute shaders)
bool buffer_storage = false; ///< GL 4.4+ or ARB_buffer_storage
bool persistent_map = false; ///< GL 4.4+ or ARB_buffer_storage
bool core_profile = false; ///< GL_CONTEXT_CORE_PROFILE_BIT
};
/// Capabilities of the context that is current on the calling thread, probed
/// once on the first successful query and cached afterwards. Safe to call
/// before load(): with no usable context (or no resolved entry points) every
/// field stays zero. `load()` invalidates the cache. The cache is
/// process-global and unsynchronised: probe from the thread that owns the
/// current context.
const Caps& caps() noexcept;
} // namespace plot::gl