Skip to content

Commit

Permalink
Merge pull request #82 from IanButterworth/ib/rm_build
Browse files Browse the repository at this point in the history
rm deps/build.jl
  • Loading branch information
SimonDanisch authored Jan 17, 2025
2 parents 90200d8 + b98a464 commit ffef0b2
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
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

0 comments on commit ffef0b2

Please sign in to comment.