-
Notifications
You must be signed in to change notification settings - Fork 1
/
opengl-defs.lua
116 lines (94 loc) · 2.02 KB
/
opengl-defs.lua
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
---@diagnostic disable: lowercase-global
--[[
require("opengl-defs")(GL,GLU)
]]
--=============================================
return function(GL,GLU,SDL)
--[[
glViewport = GL.glViewport
glClearColor = GL.glClearColor
glClear = GL.glClear
GL_MODELVIEW=0x1700
GL_PROJECTION=0x1701
GL_TEXTURE=0x1702
glMatrixMode = GL.glMatrixMode
glLoadIdentity = GL.glLoadIdentity
GL_TRIANGLES = 4
GL_TRIANGLE_STRIP = 5
glBegin = GL.glBegin
glEnd = GL.glEnd
glColor3f = GL.glColor3f
glNormal3f = GL.glNormal3f
glVertex3f = GL.glVertex3f
gluPerspective = GLU.gluPerspective
gluLookAt = GLU.gluLookAt
glMaterialfv = GL.glMaterialfv
GL_FRONT =0x0404
GL_AMBIENT =0x1200
GL_DIFFUSE =0x1201
GL_SMOOTH =0x1D01
glShadeModel = GL.glShadeModel
glLightfv = GL.glLightfv
GL_LIGHT0=0x4000
GL_LIGHT1=0x4001
GL_LIGHT2=0x4002
GL_LIGHT3=0x4003
GL_LIGHT4=0x4004
GL_LIGHT5=0x4005
GL_LIGHT6=0x4006
GL_LIGHT7=0x4007
GL_AMBIENT=0x1200
GL_DIFFUSE=0x1201
GL_SPECULAR=0x1202
GL_POSITION=0x1203
glEnable = GL.glEnable
GL_LIGHTING=0x0B50
GL_DEPTH_TEST=0x0B71
GL_DEPTH_BUFFER_BIT=0x00000100
GL_COLOR_BUFFER_BIT=0x00004000
glPushMatrix = GL.glPushMatrix
glPopMatrix = GL.glPopMatrix
glTranslated = GL.glTranslated
glRotated = GL.glRotated
glScalef = GL.glScalef
--]]
GL_MODELVIEW=0x1700
GL_PROJECTION=0x1701
GL_TEXTURE=0x1702
GL_TRIANGLES = 4
GL_TRIANGLE_STRIP = 5
GL_FRONT =0x0404
GL_AMBIENT =0x1200
GL_DIFFUSE =0x1201
GL_SMOOTH =0x1D01
GL_LIGHT0=0x4000
GL_LIGHT1=0x4001
GL_LIGHT2=0x4002
GL_LIGHT3=0x4003
GL_LIGHT4=0x4004
GL_LIGHT5=0x4005
GL_LIGHT6=0x4006
GL_LIGHT7=0x4007
GL_AMBIENT=0x1200
GL_DIFFUSE=0x1201
GL_SPECULAR=0x1202
GL_POSITION=0x1203
GL_LIGHTING=0x0B50
GL_DEPTH_TEST=0x0B71
GL_DEPTH_BUFFER_BIT=0x00000100
GL_COLOR_BUFFER_BIT=0x00004000
_G=setmetatable(_G, {
__index = function(self, index) -- index function CASE
if "glu"==string.sub(index,1,3) then
return GLU[index]
end
if "gl"==string.sub(index,1,2) then
return GL[index]
end
if "SDL"==string.sub(index,1,3) then
return SDL[index]
end
end
})
end
--===========================