Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rm deps/build.jl #82

Merged
merged 4 commits into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions deps/build.jl

This file was deleted.

21 changes: 15 additions & 6 deletions src/functionloading.jl
Original file line number Diff line number Diff line change
@@ -1,16 +1,25 @@
const depsfile = normpath(joinpath(@__DIR__, "..", "deps", "deps.jl"))
function should_enable_opengl_debugging()
v = get(ENV, "MODERNGL_DEBUGGING", "false")
if v in ("true", "false")
return v == "true"
else
error("MODERNGL_DEBUGGING must be either 'true' or 'false'.")
end
end

# decide this early here to debug any workload precompilation *in this package* before __init__ is run
const enable_opengl_debugging = Ref{Bool}(should_enable_opengl_debugging())

if isfile(depsfile)
include(depsfile)
else
const enable_opengl_debugging = get(ENV, "MODERNGL_DEBUGGING", "false") == "true"
function __init__()
# the env var may have changed since precompilation
enable_opengl_debugging[] = should_enable_opengl_debugging()
end

gl_represent(x::GLenum) = GLENUM(x).name
gl_represent(x) = repr(x)

function debug_opengl_expr(func_name, args)
if enable_opengl_debugging && func_name != :glGetError
if enable_opengl_debugging[] && func_name != :glGetError
quote
err = glGetError()
if err != GL_NO_ERROR
Expand Down
Loading