1:- module(plGLUT,
2 [
3 glutCreateWindow/1,
4 glutDestroyWindow/0,
5 glutDisplayFunc/0,
6 glutFullScreen/0,
7 glutGet/2,
8 glutDisplayFunc/1,
9 glutIdleFunc/1,
10 glutInit/0,
11 glutInitDisplayMode/1,
12 glutInitWindowPosition/2,
13 glutInitWindowSize/2,
14 glutKeyboardFunc/0,
15 glutMainLoop/0,
16 glutMotionFunc/0,
17 glutMouseFunc/0,
18 glutPostRedisplay/0,
19 glutReshapeFunc/0,
20 glutReshapeWindow/2,
21 glutSetColor/4,
22 glutSolidCone/4,
23 glutSolidCube/1,
24 glutSolidSphere/3,
25 glutSolidTeapot/1,
26 glutSolidTorus/4,
27 glutSwapBuffers/0,
28 glutWireCone/4,
29 glutWireCube/1,
30 glutWireSphere/3,
31 glutWireTeapot/1,
32 glutWireTorus/4
33 ]).
46glutCreateWindow(String):-
47 c_glutCreateWindow(String).
51glutDestroyWindow:-
52 c_glutDestroyWindow.
56glutDisplayFunc:-
57 c_glutDisplayFunc.
61glutFullScreen:-
62 c_glutFullScreen.
66glutGet(State, Answer):-
67 c_glutGet(State, Answer).
71glutDisplayFunc(String):-
72 c_glutDisplayFunc(String).
76glutIdleFunc(String):-
77 c_glutIdleFunc(String).
81glutInit:-
82 c_glutInit.
86glutInitDisplayMode(OptionList):-
87 AppliedOptions is OptionList,
88 c_glutInitDisplayMode(AppliedOptions).
92glutInitWindowPosition(X,Y) :-
93 Xs is X,
94 Ys is Y,
95 c_glutInitWindowPosition(Xs,Ys).
99glutInitWindowSize(Width,Height):-
100 W is Width,
101 H is Height,
102 c_glutInitWindowSize(W,H).
106glutKeyboardFunc:-
107 c_glutKeyboardFunc.
111glutMainLoop:-
112 c_glutMainLoop.
117glutMotionFunc:-
118 c_glutMotionFunc.
122glutMouseFunc:-
123 c_glutMouseFunc.
127glutPostRedisplay:-
128 c_glutPostRedisplay.
132glutReshapeFunc:-
133 c_glutReshapeFunc.
137glutReshapeWindow(W,H):-
138 c_glutReshapeWindow(W,H).
143glutSetColor(Index, Red, Green, Blue) :-
144 float(Red),
145 float(Green),
146 float(Blue),
147 c_glutSetColor(Index, Red, Green, Blue).
151glutSolidCone(Radius, Height, Slices, Stacks):-
152 float(Radius),
153 float(Height),
154 L is Slices,
155 T is Stacks,
156 c_glutSolidCone(Radius, Height, L, T).
160glutSolidCube(Size) :-
161 float(Size),
162 c_glutSolidCube(Size).
166glutSolidSphere(Radius, Slices, Stacks):-
167 float(Radius),
168 L is Slices,
169 T is Stacks,
170 c_glutSolidSphere(Radius, L, T).
174glutSolidTeapot(Size) :-
175 float(Size),
176 c_glutSolidTeapot(Size).
180glutSolidTorus(InnerRadius, OuterRadius, NSides, Rings):-
181 float(InnerRadius),
182 float(OuterRadius),
183 N is NSides,
184 R is Rings,
185 c_glutSolidTorus(InnerRadius, OuterRadius, N, R).
189glutSwapBuffers:-
190 c_glutSwapBuffers.
194glutWireCone(Radius, Height, Slices, Stacks):-
195 float(Radius),
196 float(Height),
197 L is Slices,
198 T is Stacks,
199 c_glutWireCone(Radius, Height, L, T).
203glutWireCube(Size) :-
204 float(Size),
205 c_glutWireCube(Size).
209glutWireSphere(Radius, Slices, Stacks):-
210 float(Radius),
211 L is Slices,
212 T is Stacks,
213 c_glutWireSphere(Radius, L, T).
217glutWireTeapot(Size) :-
218 float(Size),
219 c_glutWireTeapot(Size).
223glutWireTorus(InnerRadius, OuterRadius, NSides, Rings):-
224 float(InnerRadius),
225 float(OuterRadius),
226 N is NSides,
227 R is Rings,
228 c_glutWireTorus(InnerRadius, OuterRadius, N, R)
GLUT Interface
This module is the glut extension of the Prolog OpenGL Interface (plOpengL)