7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
# File 'lib/rugl/state/depth.rb', line 7
def apply(gl:, params:)
state = default.merge(params || {})
if state[:enable]
Util.gl_call(gl, :Enable, Util.gl_const(:DEPTH_TEST, gl: gl))
else
Util.gl_call(gl, :Disable, Util.gl_const(:DEPTH_TEST, gl: gl))
end
Util.gl_call(gl, :DepthMask, state[:mask] ? Util.gl_const(:TRUE, gl: gl) : Util.gl_const(:FALSE, gl: gl))
Util.gl_call(gl, :DepthFunc, Util.to_gl_depth_func(state[:func], gl: gl))
range = Array(state[:range])
Util.gl_call(gl, :DepthRange, range[0].to_f, range[1].to_f)
end
|