core | glapi | vbo | math | shader | swrast | swrast_setup | tnl | tnl_dd

light.h File Reference

#include "mtypes.h"

Defines

#define GET_SHINE_TAB_ENTRY(table, dp, result)

Functions

void GLAPIENTRY _mesa_ShadeModel (GLenum mode)
void GLAPIENTRY _mesa_ProvokingVertexEXT (GLenum mode)
 Set the provoking vertex (the vertex which specifies the prim's color when flat shading) to either the first or last vertex of the triangle or line.
void GLAPIENTRY _mesa_ColorMaterial (GLenum face, GLenum mode)
void GLAPIENTRY _mesa_Lightf (GLenum light, GLenum pname, GLfloat param)
void GLAPIENTRY _mesa_Lightfv (GLenum light, GLenum pname, const GLfloat *params)
void GLAPIENTRY _mesa_Lightiv (GLenum light, GLenum pname, const GLint *params)
void GLAPIENTRY _mesa_Lighti (GLenum light, GLenum pname, GLint param)
void GLAPIENTRY _mesa_LightModelf (GLenum pname, GLfloat param)
void GLAPIENTRY _mesa_LightModelfv (GLenum pname, const GLfloat *params)
void GLAPIENTRY _mesa_LightModeli (GLenum pname, GLint param)
void GLAPIENTRY _mesa_LightModeliv (GLenum pname, const GLint *params)
void GLAPIENTRY _mesa_GetLightfv (GLenum light, GLenum pname, GLfloat *params)
void GLAPIENTRY _mesa_GetLightiv (GLenum light, GLenum pname, GLint *params)
void GLAPIENTRY _mesa_GetMaterialfv (GLenum face, GLenum pname, GLfloat *params)
void GLAPIENTRY _mesa_GetMaterialiv (GLenum face, GLenum pname, GLint *params)
void _mesa_light (GLcontext *ctx, GLuint lnum, GLenum pname, const GLfloat *params)
 Helper function called by _mesa_Lightfv and _mesa_PopAttrib to set per-light state.
GLuint _mesa_material_bitmask (GLcontext *ctx, GLenum face, GLenum pname, GLuint legal, const char *)
void _mesa_invalidate_spot_exp_table (struct gl_light *l)
void _mesa_invalidate_shine_table (GLcontext *ctx, GLuint i)
void _mesa_validate_all_lighting_tables (GLcontext *ctx)
void _mesa_update_lighting (GLcontext *ctx)
 Examine current lighting parameters to determine if the optimized lighting function can be used.
void _mesa_update_tnl_spaces (GLcontext *ctx, GLuint new_state)
 Bring up to date any state that relies on _NeedEyeCoords.
void _mesa_update_material (GLcontext *ctx, GLuint bitmask)
void _mesa_copy_materials (struct gl_material *dst, const struct gl_material *src, GLuint bitmask)
void _mesa_update_color_material (GLcontext *ctx, const GLfloat rgba[4])
void _mesa_init_lighting (GLcontext *ctx)
 Initialize all lighting state for the given context.
void _mesa_free_lighting_data (GLcontext *ctx)
 Deallocate malloc'd lighting state attached to given context.
void _mesa_allow_light_in_model (GLcontext *ctx, GLboolean flag)
 Drivers may need this if the hardware tnl unit doesn't support the light-in-modelspace optimization.


Define Documentation

#define GET_SHINE_TAB_ENTRY ( table,
dp,
result   ) 

Value:

do {                                                                    \
   struct gl_shine_tab *_tab = table;                                   \
   float f = (dp * (SHINE_TABLE_SIZE-1));                               \
   int k = (int) f;                                                     \
   if (k < 0 /* gcc may cast an overflow float value to negative int value*/ \
        || k > SHINE_TABLE_SIZE-2)                                      \
      result = (GLfloat) _mesa_pow( dp, _tab->shininess );              \
   else                                                                 \
      result = _tab->tab[k] + (f-k)*(_tab->tab[k+1]-_tab->tab[k]);      \
} while (0)


Function Documentation

void _mesa_allow_light_in_model ( GLcontext ctx,
GLboolean  flag 
)

Drivers may need this if the hardware tnl unit doesn't support the light-in-modelspace optimization.

It's also useful for debugging.

void GLAPIENTRY _mesa_ColorMaterial ( GLenum  face,
GLenum  mode 
)

void _mesa_copy_materials ( struct gl_material dst,
const struct gl_material src,
GLuint  bitmask 
)

void _mesa_free_lighting_data ( GLcontext ctx  ) 

Deallocate malloc'd lighting state attached to given context.

void GLAPIENTRY _mesa_GetLightfv ( GLenum  light,
GLenum  pname,
GLfloat *  params 
)

void GLAPIENTRY _mesa_GetLightiv ( GLenum  light,
GLenum  pname,
GLint *  params 
)

void GLAPIENTRY _mesa_GetMaterialfv ( GLenum  face,
GLenum  pname,
GLfloat *  params 
)

void GLAPIENTRY _mesa_GetMaterialiv ( GLenum  face,
GLenum  pname,
GLint *  params 
)

void _mesa_init_lighting ( GLcontext ctx  ) 

Initialize all lighting state for the given context.

void _mesa_invalidate_shine_table ( GLcontext ctx,
GLuint  i 
)

void _mesa_invalidate_spot_exp_table ( struct gl_light l  ) 

void _mesa_light ( GLcontext ctx,
GLuint  lnum,
GLenum  pname,
const GLfloat *  params 
)

Helper function called by _mesa_Lightfv and _mesa_PopAttrib to set per-light state.

For GL_POSITION and GL_SPOT_DIRECTION the params position/direction will have already been transformed by the modelview matrix! Also, all error checking should have already been done.

void GLAPIENTRY _mesa_Lightf ( GLenum  light,
GLenum  pname,
GLfloat  param 
)

void GLAPIENTRY _mesa_Lightfv ( GLenum  light,
GLenum  pname,
const GLfloat *  params 
)

void GLAPIENTRY _mesa_Lighti ( GLenum  light,
GLenum  pname,
GLint  param 
)

void GLAPIENTRY _mesa_Lightiv ( GLenum  light,
GLenum  pname,
const GLint *  params 
)

void GLAPIENTRY _mesa_LightModelf ( GLenum  pname,
GLfloat  param 
)

void GLAPIENTRY _mesa_LightModelfv ( GLenum  pname,
const GLfloat *  params 
)

void GLAPIENTRY _mesa_LightModeli ( GLenum  pname,
GLint  param 
)

void GLAPIENTRY _mesa_LightModeliv ( GLenum  pname,
const GLint *  params 
)

GLuint _mesa_material_bitmask ( GLcontext ctx,
GLenum  face,
GLenum  pname,
GLuint  legal,
const char *   
)

void GLAPIENTRY _mesa_ProvokingVertexEXT ( GLenum  mode  ) 

Set the provoking vertex (the vertex which specifies the prim's color when flat shading) to either the first or last vertex of the triangle or line.

void GLAPIENTRY _mesa_ShadeModel ( GLenum  mode  ) 

void _mesa_update_color_material ( GLcontext ctx,
const GLfloat  rgba[4] 
)

void _mesa_update_lighting ( GLcontext ctx  ) 

Examine current lighting parameters to determine if the optimized lighting function can be used.

Also, precompute some lighting values such as the products of light source and material ambient, diffuse and specular coefficients.

void _mesa_update_material ( GLcontext ctx,
GLuint  bitmask 
)

void _mesa_update_tnl_spaces ( GLcontext ctx,
GLuint  new_state 
)

Bring up to date any state that relies on _NeedEyeCoords.

void _mesa_validate_all_lighting_tables ( GLcontext ctx  ) 


Generated on Sun Sep 27 06:47:46 2009 for Mesa Main by  doxygen 1.5.4