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	  ]).

GLUT Interface

This module is the glut extension of the Prolog OpenGL Interface (plOpengL)

author
- Jan Tatham
license
- LGPL 2.1 */
 glutCreateWindow(+String)
Creates a top-level window
   46glutCreateWindow(String):-
   47	c_glutCreateWindow(String).
 glutDestroyWindow
Destroys the window
   51glutDestroyWindow:-
   52	c_glutDestroyWindow.
 glutDisplayFunc
Sets the display callback for the current window.
   56glutDisplayFunc:-
   57	c_glutDisplayFunc.
 glutFullScreen
Requests that the current window be made full screen.
   61glutFullScreen:-
   62	c_glutFullScreen.
 glutGet(+State, -Answer)
Retrieves simple GLUT state represented by integers.
   66glutGet(State, Answer):-
   67	c_glutGet(State, Answer).
 glutDisplayFunc(+String)
Requests that the current window be made full screen.
   71glutDisplayFunc(String):-
   72	c_glutDisplayFunc(String).
 glutIdleFunc(+String)
Sets the global idle callback.
   76glutIdleFunc(String):-
   77	c_glutIdleFunc(String).
 glutInit
Used to initialize the GLUT library.
   81glutInit:-
   82	c_glutInit.
 glutInitDisplayMode(+OptionList)
Sets the initial display mode.
   86glutInitDisplayMode(OptionList):-
   87	AppliedOptions is OptionList,
   88	c_glutInitDisplayMode(AppliedOptions).
 glutInitWindowPosition(+X, +Y)
set the initial window position.
   92glutInitWindowPosition(X,Y) :-
   93	Xs is X,
   94	Ys is Y,
   95	c_glutInitWindowPosition(Xs,Ys).
 glutInitWindowSize(+X, +Y)
set the initial window size.
   99glutInitWindowSize(Width,Height):-
  100	W is Width,
  101	H is Height,
  102	c_glutInitWindowSize(W,H).
 glutKeyboardFunc
Sets the keyboard callback for the current window.
  106glutKeyboardFunc:-
  107	c_glutKeyboardFunc.
 glutMainLoop
Enters the GLUT event processing loop.
  111glutMainLoop:-
  112	c_glutMainLoop.
 glutMotionFunc
Set the motion and passive motion callbacks respectively for the current window.
  117glutMotionFunc:-
  118	c_glutMotionFunc.
 glutMouseFunc
Sets the mouse callback for the current window.
  122glutMouseFunc:-
  123	c_glutMouseFunc.
 glutPostRedisplay
Marks the current window as needing to be redisplayed.
  127glutPostRedisplay:-
  128	c_glutPostRedisplay.
 glutReshapeFunc
Sets the reshape callback for the current window.
  132glutReshapeFunc:-
  133	c_glutReshapeFunc.
 glutReshapeWindow(+W, +H)
Requests a change to the size of the current window.
  137glutReshapeWindow(W,H):-
  138	c_glutReshapeWindow(W,H).
 glutSetColor(+Index, +Red, +Green, +Blue)
Sets the color of a colormap entry in the layer of use for the current window.
  143glutSetColor(Index, Red, Green, Blue) :-
  144    float(Red),
  145    float(Green),
  146    float(Blue),
  147    c_glutSetColor(Index, Red, Green, Blue).
 glutSolidCone(+Radius, +Height, +Slices, +Stacks)
Render a solid cone
  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).
 glutSolidCube(+Size)
Render a solid cube
  160glutSolidCube(Size) :-
  161    float(Size),
  162    c_glutSolidCube(Size).
 glutSolidSphere(+Radius, +Slices, +Stacks)
Render a solid sphere
  166glutSolidSphere(Radius, Slices, Stacks):-
  167    float(Radius),
  168    L is Slices,
  169    T is Stacks,
  170    c_glutSolidSphere(Radius, L, T).
 glutSolidTeapot(+Size)
Render a solid teapot
  174glutSolidTeapot(Size) :-
  175    float(Size),
  176    c_glutSolidTeapot(Size).
 glutSolidTorus(+InnerRadius, +OuterRadius, +NSides, +Rings)
Render a solid torus
  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).
 glutSwapBuffers
Swaps the buffers of the current window if double buffered.
  189glutSwapBuffers:-
  190	c_glutSwapBuffers.
 glutWireCone(+Radius, +Height, +Slices, +Stacks)
Render a wireframe cone
  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).
 glutWireCube(+Size)
Render a wireframe cube
  203glutWireCube(Size) :-
  204    float(Size),
  205    c_glutWireCube(Size).
 glutWireSphere(+Radius, +Slices, +Stacks)
Render a wireframe sphere
  209glutWireSphere(Radius, Slices, Stacks):-
  210    float(Radius),
  211    L is Slices,
  212    T is Stacks,
  213    c_glutWireSphere(Radius, L, T).
 glutWireTeapot(+Size)
Render a wireframe teapot
  217glutWireTeapot(Size) :-
  218    float(Size),
  219    c_glutWireTeapot(Size).
 glutWireTorus(+InnerRadius, +OuterRadius, +NSides, +Rings)
Render a wireframe torus
  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)