2009-01-18 21:10:08 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								USING:  alien  help.markup  help.syntax  io  kernel  math  quotations  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								opengl.gl assocs vocabs.loader sequences accessors colors ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								IN:  opengl  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  gl-color  
						 
					
						
							
								
									
										
										
										
											2009-01-18 21:10:08 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "color"  color } }
							 
						 
					
						
							
								
									
										
										
										
											2009-01-30 04:37:20 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $description "Wrapper for "  { $link glColor4d } " taking an instance of "  { $link color } "."  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $notes "See "  { $link "colors"  } "."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  gl-error  
						 
					
						
							
								
									
										
										
										
											2008-05-05 03:19:25 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "If the most recent OpenGL call resulted in an error, print the error to "  { $link output-stream  } "."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  do-enabled  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $values { "what"  integer  } { "quot"  quotation } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Wraps a quotation in "  { $link glEnable } "/"  { $link glDisable } " calls."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  do-matrix  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $values { "mode"  { $link GL_MODELVIEW } " or "  { $link GL_PROJECTION } } { "quot"  quotation } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Saves and restores the matrix specified by "  { $snippet "mode"  } " before and after calling the quotation."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  gl-line  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $values { "a"  "a pair of integers"  } { "b"  "a pair of integers"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Draws a line between two points."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  gl-fill-rect  
						 
					
						
							
								
									
										
										
										
											2008-11-11 09:53:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "dim"  "a pair of integers"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Draws a filled rectangle with the top-left corner at the origin and the given dimensions."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  gl-rect  
						 
					
						
							
								
									
										
										
										
											2008-11-11 09:53:11 -05:00 
										
									 
								 
							 
							
								
									
										 
								
							 
							
								 
							
							
								{ $values { "dim"  "a pair of integers"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Draws the outline of a rectangle with the top-left corner at the origin and the given dimensions."  } ;
 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-01-31 23:24:08 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								HELP:  gen-gl-buffer  
						 
					
						
							
								
									
										
										
										
											2008-01-27 01:37:28 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $values { "id"  integer  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Wrapper for "  { $link glGenBuffers } " to handle the common case of generating a single buffer ID."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-01-31 23:24:08 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								HELP:  delete-gl-buffer  
						 
					
						
							
								
									
										
										
										
											2008-01-27 01:37:28 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $values { "id"  integer  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Wrapper for "  { $link glDeleteBuffers } " to handle the common case of deleting a single buffer ID."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-01-31 23:24:08 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ gen-gl-buffer delete-gl-buffer } related-words
							 
						 
					
						
							
								
									
										
										
										
											2008-01-27 01:37:28 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  bind-texture-unit  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $values { "id"  "The id of a texture object."  } { "target"  "The texture target (e.g., "  { $snippet "GL_TEXTURE_2D"  } ")"  } { "unit"  "The texture unit to bind (e.g., "  { $snippet "GL_TEXTURE0"  } ")"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Binds texture "  { $snippet "id"  } " to texture target "  { $snippet "target"  } " of texture unit "  { $snippet "unit"  } ". Equivalent to "  { $snippet "unit glActiveTexture target id glBindTexture"  } "."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  set-draw-buffers  
						 
					
						
							
								
									
										
										
										
											2008-01-27 22:32:23 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $values { "buffers"  "A sequence of buffer words (e.g. "  { $snippet "GL_BACK"  } ", "  { $snippet "GL_COLOR_ATTACHMENT0_EXT"  } ")" } }
							 
						 
					
						
							
								
									
										
										
										
											2008-01-27 01:37:28 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $description "Wrapper for "  { $link glDrawBuffers } ". Sets up the buffers named in the sequence for simultaneous drawing."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								HELP:  do-attribs  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $values { "bits"  integer  } { "quot"  quotation } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Wraps a quotation in "  { $link glPushAttrib } "/"  { $link glPopAttrib } " calls."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  gen-dlist  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $values { "id"  integer  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Wrapper for "  { $link glGenLists } " to handle the common case of generating a single display list ID."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  make-dlist  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $values { "type"  "one of "  { $link GL_COMPILE } " or "  { $link GL_COMPILE_AND_EXECUTE } } { "quot"  quotation } { "id"  "an OpenGL texture ID"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Compiles the results of calling the quotation into a new OpenGL display list."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  gl-translate  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $values { "point"  "a pair of integers"  } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Wrapper for "  { $link glTranslated } " taking a point object."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								HELP:  with-translation  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $values { "loc"  "a pair of integers"  } { "quot"  quotation } }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $description "Calls the quotation with a translation by "  { $snippet "loc"  } " pixels applied to the current "  { $link GL_MODELVIEW } " matrix, restoring the matrix when the quotation is done."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ARTICLE: "gl-utilities"  "OpenGL utility words" 
							 
						 
					
						
							
								
									
										
										
										
											2008-07-03 02:39:45 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								"The "  { $vocab-link "opengl"  } " vocabulary implements some utility words to give OpenGL a more Factor-like feel."  
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								$nl
							 
						 
					
						
							
								
									
										
										
										
											2008-07-03 02:39:45 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								"The "  { $vocab-link "opengl.gl"  } " and "  { $vocab-link "opengl.glu"  } " vocabularies have the actual OpenGL bindings."  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $subsection "opengl-low-level"  }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								"Wrappers:"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $subsection gl-color }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $subsection gl-translate }
							 
						 
					
						
							
								
									
										
										
										
											2008-01-27 01:37:28 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								{ $subsection bind-texture-unit }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								"Combinators:"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $subsection do-enabled }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $subsection do-attribs }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $subsection do-matrix }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $subsection with-translation }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $subsection make-dlist }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								"Rendering geometric shapes:"  
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $subsection gl-line }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $subsection gl-fill-rect }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								{ $subsection gl-rect }
							 
						 
					
						
							
								
									
										
										
										
											2008-01-14 01:58:11 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								;
  
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							
							
								ABOUT: "gl-utilities"