-
Notifications
You must be signed in to change notification settings - Fork 1
/
rlgl.scm
60 lines (46 loc) · 1.99 KB
/
rlgl.scm
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
;;; Shaders System Functions (Module: rlgl)
;;; NOTE: This functions are useless when using OpenGL 1.1
;; Shader loading/unloading functions
(foreign-constructor load-shader
"LoadShader"
shader
(c-pointer (struct Shader))
((c-string vsFileName)
(c-string fsFileName)))
(foreign-define-with-struct unload-shader
"UnloadShader"
void
(((c-pointer (struct Shader)) shaderToUnload)))
;; Shader configuration functions
(foreign-define-with-struct get-shader-location
"GetShaderLocation"
int
(((c-pointer (struct Shader)) targetShader)
(c-string uniformName)))
(foreign-define-with-struct set-shader-value!
"SetShaderValue"
void
(((c-pointer (struct Shader)) shader)
(int uniformLoc)
((c-pointer void) value)
(int uniformType)))
;; Texture maps generation (PBR)
;; NOTE: Required shaders should be provided
(foreign-constructor gen-texture-cubemap
"GenTextureCubemap"
texture-2d
(c-pointer (struct Texture2D))
(((c-pointer (struct Shader)) shader)
((c-pointer (struct Texture2D)) skyHDR)
(int size)))
;; Shading begin/end functions
(foreign-define-with-struct begin-shader-mode
"BeginShaderMode"
void
(((c-pointer (struct Shader)) shader)))
(define end-shader-mode
(foreign-lambda void "EndShaderMode"))
(define begin-blend-mode
(foreign-lambda void "BeginBlendMode" int))
(define end-blend-mode
(foreign-lambda void "EndBlendMode"))