-
-
Notifications
You must be signed in to change notification settings - Fork 290
/
GLMakie.jl
67 lines (51 loc) · 1.86 KB
/
GLMakie.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
module GLMakie
if isdefined(Base, :Experimental) && isdefined(Base.Experimental, Symbol("@max_methods"))
# GLMakie doesn't do much work, besides assembling shaders.
# If it does, code should be 100% inferable, so hopefully shouldn't be influenced by this
@eval Base.Experimental.@max_methods 1
end
using ModernGL, FixedPointNumbers, Colors, GeometryBasics
using Makie, FileIO
using Makie: @key_str, Key, broadcast_foreach, to_ndim, NativeFont
using Makie: Scene, Lines, Text, Image, Heatmap, Scatter
using Makie: convert_attribute, @extractvalue, LineSegments
using Makie: @get_attribute, to_value, to_colormap, extrema_nan
using Makie: ClosedInterval, (..)
using Makie: inline!, to_native
using Makie: spaces, is_data_space, is_pixel_space, is_relative_space, is_clip_space
import Makie: to_font, glyph_uv_width!, el32convert, Shape, CIRCLE, RECTANGLE, ROUNDED_RECTANGLE, DISTANCEFIELD, TRIANGLE
using ShaderAbstractions
using FreeTypeAbstraction
using GeometryBasics: StaticVector
using Base: RefValue
import Base: push!, isopen, show
using Base.Iterators: repeated, drop
using LinearAlgebra
# re-export Makie, including deprecated names
for name in names(Makie, all=true)
if Base.isexported(Makie, name)
@eval using Makie: $(name)
@eval export $(name)
end
end
export inline!
import ShaderAbstractions: Sampler, Buffer
export Sampler, Buffer
struct GLBackend <: Makie.AbstractBackend
end
loadshader(name) = normpath(joinpath(@__DIR__, "..", "assets", "shader", name))
# don't put this into try catch, to not mess with normal errors
include("gl_backend.jl")
function activate!(use_display=true)
b = GLBackend()
Makie.register_backend!(b)
Makie.set_glyph_resolution!(Makie.High)
Makie.current_backend[] = b
Makie.inline!(!use_display)
end
function __init__()
activate!()
end
export set_window_config!
include("precompiles.jl")
end