<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html
  PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN" "http://www.w3.org/TR/MathML2/dtd/xhtml-math11-f.dtd">
<html
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:mml="http://www.w3.org/1998/Math/MathML"
><head><title>glGetMaterial</title><link rel="stylesheet" href="style.css" type="text/css"/><meta name="generator" content="DocBook XSL Stylesheets V1.59.1"/><link rel="home" href="index.xml" title="PyOpenGL 2.0.1.07 Man Pages"/><link rel="up" href="reference-GL.xml" title="GL"/><link rel="previous" href="glGetMap.3G.xml" title="glGetMap"/><link rel="next" href="glGetMinmax.3G.xml" title="glGetMinmax"/></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">glGetMaterial</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="glGetMap.3G.xml">Prev</a> </td><th width="60%" align="center">GL</th><td width="20%" align="right"> <a accesskey="n" href="glGetMinmax.3G.xml">Next</a></td></tr></table><hr/></div><div class="refentry" lang="en"><a name="glGetMaterial.3G"/><div class="titlepage"/><div class="refnamediv"><a name="glGetMaterial.3G-name"/><h2>Name</h2><p>glGetMaterialfv, glGetMaterialiv &#8212; return material parameters</p></div><div class="refsynopsisdiv"><a name="glGetMaterial.3G-c_spec"/><h2>C Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code>void <tt>glGetMaterialfv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>face</tt></i>, GLenum <i><tt>pname</tt></i>, GLfloat *<i><tt>params</tt></i>);</code></td></tr><tr><td valign="top"><code>void <tt>glGetMaterialiv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code>GLenum <i><tt>face</tt></i>, GLenum <i><tt>pname</tt></i>, GLint *<i><tt>params</tt></i>);</code></td></tr></table></div><div class="refsynopsisdiv"><a name="glGetMaterial.3G-python_spec"/><h2>Python Specification</h2><table class="funcprototype" border="0" cellpadding="0" cellspacing="0"><tr><td valign="top"><code><tt>glGetMaterialfv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>face</tt></i>, <i><tt>pname</tt></i>) &#8594; <i><tt>params</tt></i></code></td></tr><tr><td valign="top"><code><tt>glGetMaterialiv</tt></code></td><td valign="top"><code>(</code></td><td valign="top"><code><i><tt>face</tt></i>, <i><tt>pname</tt></i>) &#8594; <i><tt>params</tt></i></code></td></tr></table></div><div class="refsect1" lang="en"><a name="glGetMaterial.3G-parameters"/><h2>Parameters</h2><div class="variablelist"><dl><dt><span class="term"><i><tt>face</tt></i></span></dt><dd>
						Specifies which of the two materials is being queried. <tt>GL_FRONT</tt> or
						<tt>GL_BACK</tt> are accepted, representing the front and back materials, respectively.
					</dd><dt><span class="term"><i><tt>pname</tt></i></span></dt><dd>
						Specifies the material parameter to return. <tt>GL_AMBIENT</tt>,
						<tt>GL_DIFFUSE</tt>, <tt>GL_SPECULAR</tt>, <tt>GL_EMISSION</tt>,
						<tt>GL_SHININESS</tt>, and <tt>GL_COLOR_INDEXES</tt> are accepted.
					</dd><dt><span class="term"><i><tt>params</tt></i></span></dt><dd>
						Returns the requested data.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glGetMaterial.3G-description"/><h2>Description</h2><p>
			<tt>glGetMaterial</tt> returns in <i><tt>params</tt></i> the value or values of
			parameter <i><tt>pname</tt></i> of material <i><tt>face</tt></i>. Six parameters are defined:
		</p><div class="variablelist"><dl><dt><span class="term"><tt>GL_AMBIENT</tt></span></dt><dd>
						<i><tt>params</tt></i> returns four integer or floating-point values representing the ambient
						reflectance of the material. Integer values, when requested, are linearly mapped from the internal
						floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0
						maps to the most negative representable integer value. If the internal value is outside the range [-1, 1],
						the corresponding integer return value is undefined. The initial value is (0.2, 0.2, 0.2, 1.0)
					</dd><dt><span class="term"><tt>GL_DIFFUSE</tt></span></dt><dd>
						<i><tt>params</tt></i> returns four integer or floating-point values representing the diffuse
						reflectance of the material. Integer values, when requested, are linearly mapped from the internal
						floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0
						maps to the most negative representable integer value. If the internal value is outside the range [-1, 1],
						the corresponding integer return value is undefined. The initial value is (0.8, 0.8, 0.8, 1.0).
					</dd><dt><span class="term"><tt>GL_SPECULAR</tt></span></dt><dd>
						<i><tt>params</tt></i> returns four integer or floating-point values representing the specular
						reflectance of the material. Integer values, when requested, are linearly mapped from the internal
						floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0
						maps to the most negative representable integer value. If the internal value is outside the range [-1, 1],
						the corresponding integer return value is undefined. The initial value is (0, 0, 0, 1).
					</dd><dt><span class="term"><tt>GL_EMISSION</tt></span></dt><dd>
						<i><tt>params</tt></i> returns four integer or floating-point values representing the emitted light
						intensity of the material. Integer values, when requested, are linearly mapped from the internal
						floating-point representation such that 1.0 maps to the most positive representable integer value, and -1.0
						maps to the most negative representable integer value. If the internal value is outside the range [-1,
						1.0], the corresponding integer return value is undefined. The initial value is (0, 0, 0, 1).
					</dd><dt><span class="term"><tt>GL_SHININESS</tt></span></dt><dd>
						<i><tt>params</tt></i> returns one integer or floating-point value representing the specular
						exponent of the material. Integer values, when requested, are computed by rounding the internal
						floating-point value to the nearest integer value. The initial value is 0.
					</dd><dt><span class="term"><tt>GL_COLOR_INDEXES</tt></span></dt><dd>
						<i><tt>params</tt></i> returns three integer or floating-point values representing the ambient,
						diffuse, and specular indices of the material. These indices are used only for color index lighting. (All
						the other parameters are used only for RGBA lighting.) Integer values, when requested, are computed by
						rounding the internal floating-point values to the nearest integer values.
					</dd></dl></div></div><div class="refsect1" lang="en"><a name="glGetMaterial.3G-notes"/><h2>Notes</h2><p>
			If an error is generated, no change is made to the contents of <i><tt>params</tt></i>.
		</p></div><div class="refsect1" lang="en"><a name="glGetMaterial.3G-errors"/><h2>Errors</h2><p>
			<tt>GL_INVALID_ENUM</tt> is generated if <i><tt>face</tt></i> or <i><tt>pname</tt></i> is not
			an accepted value.
		</p><p>
			<tt>GL_INVALID_OPERATION</tt> is generated if <tt>glGetMaterial</tt> is
			executed between the execution of <a href="glBegin.3G.xml"><tt>glBegin</tt></a> and the corresponding execution of
			<a href="glBegin.3G.xml"><tt>glEnd</tt></a>.
		</p></div><div class="refsect1" lang="en"><a name="glGetMaterial.3G-see_also"/><h2>See Also</h2><p>
			<span class="simplelist"><a href="glMaterial.3G.xml">glMaterial</a></span>
		</p></div></div><div class="navfooter"><hr/><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="glGetMap.3G.xml">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="reference-GL.xml">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="glGetMinmax.3G.xml">Next</a></td></tr><tr><td width="40%" align="left" valign="top">glGetMap </td><td width="20%" align="center"><a accesskey="h" href="index.xml">Home</a></td><td width="40%" align="right" valign="top"> glGetMinmax</td></tr></table></div></body></html>