diff --git a/.travis.yml b/.travis.yml index 046994f..dc8b24b 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,6 +3,7 @@ os: - linux dist: trusty julia: + - 0.6 - 0.7 - nightly matrix: diff --git a/REQUIRE b/REQUIRE index cdbb2dc..137767a 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1 +1 @@ -julia 0.7-alpha +julia 0.6 diff --git a/appveyor.yml b/appveyor.yml index bd2f18c..2401217 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -1,5 +1,6 @@ environment: matrix: + - JULIA_URL: "https://julialang-s3.julialang.org/bin/winnt/x64/0.6/julia-0.6-latest-win64.exe" - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe" - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" @@ -14,10 +15,6 @@ notifications: on_build_failure: false on_build_status_changed: false -matrix: - allow_failures: - - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x86/julia-latest-win32.exe" - - JULIA_URL: "https://julialangnightlies-s3.julialang.org/bin/winnt/x64/julia-latest-win64.exe" install: - ps: "[System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12" diff --git a/src/ModernGL.jl b/src/ModernGL.jl index a9e3ac9..9af44d4 100644 --- a/src/ModernGL.jl +++ b/src/ModernGL.jl @@ -1,7 +1,19 @@ __precompile__(true) module ModernGL -using Libdl +if VERSION < v"0.7.0-" + const Cvoid = Void + const iswindows = is_windows + const isunix = is_unix + const isapple = is_apple +else + using Libdl + const iswindows = Sys.iswindows + const isunix = Sys.isunix + const isapple = Sys.isapple +end + + function glXGetProcAddress(glFuncName) ccall((:glXGetProcAddress, "libGL.so.1"), Ptr{Cvoid}, (Ptr{UInt8},), glFuncName) @@ -20,12 +32,12 @@ function wglGetProcAddress(glFuncName) ccall((:wglGetProcAddress, "opengl32"), Ptr{Cvoid}, (Ptr{UInt8},), glFuncName) end -if Sys.isapple() +if isapple() getprocaddress(glFuncName) = NSGetProcAddress(glFuncName) -elseif Sys.isunix() +elseif isunix() getprocaddress(glFuncName) = glXGetProcAddress(glFuncName) end -if Sys.iswindows() +if iswindows() getprocaddress(glFuncName) = wglGetProcAddress(glFuncName) end diff --git a/src/functionloading.jl b/src/functionloading.jl index 6c8346d..71e0a09 100644 --- a/src/functionloading.jl +++ b/src/functionloading.jl @@ -37,7 +37,7 @@ macro glfunc(opengl_func) func_name_str = string(func_name) ptr_expr = :(getprocaddress_e($func_name_str)) - if Sys.iswindows() # windows has some function pointers statically available and some not, this is how we deal with it: + if iswindows() # windows has some function pointers statically available and some not, this is how we deal with it: ptr = Libdl.dlsym_e(gl_lib, func_name) if (ptr != C_NULL) ptr_expr = :(($func_name_sym, "opengl32")) @@ -68,10 +68,10 @@ macro glfunc(opengl_func) return esc(ret) end -if Sys.iswindows() +if iswindows() const gl_lib = Libdl.dlopen("opengl32") end include("glFunctions.jl") -if Sys.iswindows() +if iswindows() Libdl.dlclose(gl_lib) end