@@ -1,8 +1,9 @@ | |||
/* $Id: glu.h,v 1.14 1999/11/09 06:17:08 brianp Exp $ */ | |||
/* $Id: glu.h,v 1.15 1999/11/11 01:27:17 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1995-1999 Brian Paul | |||
* | |||
* This library is free software; you can redistribute it and/or | |||
@@ -70,151 +71,149 @@ extern "C" { | |||
#endif | |||
#define GLU_VERSION_1_1 1 | |||
#define GLU_VERSION_1_2 1 | |||
#define GLU_TRUE GL_TRUE | |||
#define GLU_FALSE GL_FALSE | |||
enum { | |||
/* Normal vectors */ | |||
GLU_SMOOTH = 100000, | |||
GLU_FLAT = 100001, | |||
GLU_NONE = 100002, | |||
/* Quadric draw styles */ | |||
GLU_POINT = 100010, | |||
GLU_LINE = 100011, | |||
GLU_FILL = 100012, | |||
GLU_SILHOUETTE = 100013, | |||
/* Quadric orientation */ | |||
GLU_OUTSIDE = 100020, | |||
GLU_INSIDE = 100021, | |||
/* Tessellator */ | |||
GLU_TESS_BEGIN = 100100, | |||
GLU_TESS_VERTEX = 100101, | |||
GLU_TESS_END = 100102, | |||
GLU_TESS_ERROR = 100103, | |||
GLU_TESS_EDGE_FLAG = 100104, | |||
GLU_TESS_COMBINE = 100105, | |||
GLU_TESS_BEGIN_DATA = 100106, | |||
GLU_TESS_VERTEX_DATA = 100107, | |||
GLU_TESS_END_DATA = 100108, | |||
GLU_TESS_ERROR_DATA = 100109, | |||
GLU_TESS_EDGE_FLAG_DATA = 100110, | |||
GLU_TESS_COMBINE_DATA = 100111, | |||
/* Winding rules */ | |||
GLU_TESS_WINDING_ODD = 100130, | |||
GLU_TESS_WINDING_NONZERO = 100131, | |||
GLU_TESS_WINDING_POSITIVE = 100132, | |||
GLU_TESS_WINDING_NEGATIVE = 100133, | |||
GLU_TESS_WINDING_ABS_GEQ_TWO = 100134, | |||
/* Tessellation properties */ | |||
GLU_TESS_WINDING_RULE = 100140, | |||
GLU_TESS_BOUNDARY_ONLY = 100141, | |||
GLU_TESS_TOLERANCE = 100142, | |||
/* Tessellation errors */ | |||
GLU_TESS_ERROR1 = 100151, /* Missing gluBeginPolygon */ | |||
GLU_TESS_ERROR2 = 100152, /* Missing gluBeginContour */ | |||
GLU_TESS_ERROR3 = 100153, /* Missing gluEndPolygon */ | |||
GLU_TESS_ERROR4 = 100154, /* Missing gluEndContour */ | |||
GLU_TESS_ERROR5 = 100155, /* */ | |||
GLU_TESS_ERROR6 = 100156, /* */ | |||
GLU_TESS_ERROR7 = 100157, /* */ | |||
GLU_TESS_ERROR8 = 100158, /* */ | |||
/* NURBS */ | |||
GLU_AUTO_LOAD_MATRIX = 100200, | |||
GLU_CULLING = 100201, | |||
GLU_PARAMETRIC_TOLERANCE= 100202, | |||
GLU_SAMPLING_TOLERANCE = 100203, | |||
GLU_DISPLAY_MODE = 100204, | |||
GLU_SAMPLING_METHOD = 100205, | |||
GLU_U_STEP = 100206, | |||
GLU_V_STEP = 100207, | |||
GLU_PATH_LENGTH = 100215, | |||
GLU_PARAMETRIC_ERROR = 100216, | |||
GLU_DOMAIN_DISTANCE = 100217, | |||
GLU_MAP1_TRIM_2 = 100210, | |||
GLU_MAP1_TRIM_3 = 100211, | |||
GLU_OUTLINE_POLYGON = 100240, | |||
GLU_OUTLINE_PATCH = 100241, | |||
GLU_NURBS_ERROR1 = 100251, /* spline order un-supported */ | |||
GLU_NURBS_ERROR2 = 100252, /* too few knots */ | |||
GLU_NURBS_ERROR3 = 100253, /* valid knot range is empty */ | |||
GLU_NURBS_ERROR4 = 100254, /* decreasing knot sequence */ | |||
GLU_NURBS_ERROR5 = 100255, /* knot multiplicity > spline order */ | |||
GLU_NURBS_ERROR6 = 100256, /* endcurve() must follow bgncurve() */ | |||
GLU_NURBS_ERROR7 = 100257, /* bgncurve() must precede endcurve() */ | |||
GLU_NURBS_ERROR8 = 100258, /* ctrlarray or knot vector is NULL */ | |||
GLU_NURBS_ERROR9 = 100259, /* can't draw pwlcurves */ | |||
GLU_NURBS_ERROR10 = 100260, /* missing gluNurbsCurve() */ | |||
GLU_NURBS_ERROR11 = 100261, /* missing gluNurbsSurface() */ | |||
GLU_NURBS_ERROR12 = 100262, /* endtrim() must precede endsurface() */ | |||
GLU_NURBS_ERROR13 = 100263, /* bgnsurface() must precede endsurface() */ | |||
GLU_NURBS_ERROR14 = 100264, /* curve of improper type passed as trim curve */ | |||
GLU_NURBS_ERROR15 = 100265, /* bgnsurface() must precede bgntrim() */ | |||
GLU_NURBS_ERROR16 = 100266, /* endtrim() must follow bgntrim() */ | |||
GLU_NURBS_ERROR17 = 100267, /* bgntrim() must precede endtrim()*/ | |||
GLU_NURBS_ERROR18 = 100268, /* invalid or missing trim curve*/ | |||
GLU_NURBS_ERROR19 = 100269, /* bgntrim() must precede pwlcurve() */ | |||
GLU_NURBS_ERROR20 = 100270, /* pwlcurve referenced twice*/ | |||
GLU_NURBS_ERROR21 = 100271, /* pwlcurve and nurbscurve mixed */ | |||
GLU_NURBS_ERROR22 = 100272, /* improper usage of trim data type */ | |||
GLU_NURBS_ERROR23 = 100273, /* nurbscurve referenced twice */ | |||
GLU_NURBS_ERROR24 = 100274, /* nurbscurve and pwlcurve mixed */ | |||
GLU_NURBS_ERROR25 = 100275, /* nurbssurface referenced twice */ | |||
GLU_NURBS_ERROR26 = 100276, /* invalid property */ | |||
GLU_NURBS_ERROR27 = 100277, /* endsurface() must follow bgnsurface() */ | |||
GLU_NURBS_ERROR28 = 100278, /* intersecting or misoriented trim curves */ | |||
GLU_NURBS_ERROR29 = 100279, /* intersecting trim curves */ | |||
GLU_NURBS_ERROR30 = 100280, /* UNUSED */ | |||
GLU_NURBS_ERROR31 = 100281, /* unconnected trim curves */ | |||
GLU_NURBS_ERROR32 = 100282, /* unknown knot error */ | |||
GLU_NURBS_ERROR33 = 100283, /* negative vertex count encountered */ | |||
GLU_NURBS_ERROR34 = 100284, /* negative byte-stride */ | |||
GLU_NURBS_ERROR35 = 100285, /* unknown type descriptor */ | |||
GLU_NURBS_ERROR36 = 100286, /* null control point reference */ | |||
GLU_NURBS_ERROR37 = 100287, /* duplicate point on pwlcurve */ | |||
/* Errors */ | |||
GLU_INVALID_ENUM = 100900, | |||
GLU_INVALID_VALUE = 100901, | |||
GLU_OUT_OF_MEMORY = 100902, | |||
GLU_INCOMPATIBLE_GL_VERSION = 100903, | |||
/* New in GLU 1.1 */ | |||
GLU_VERSION = 100800, | |||
GLU_EXTENSIONS = 100801, | |||
/*** GLU 1.0 tessellation - obsolete! ***/ | |||
/* Contour types */ | |||
GLU_CW = 100120, | |||
GLU_CCW = 100121, | |||
GLU_INTERIOR = 100122, | |||
GLU_EXTERIOR = 100123, | |||
GLU_UNKNOWN = 100124, | |||
/* Tessellator */ | |||
GLU_BEGIN = GLU_TESS_BEGIN, | |||
GLU_VERTEX = GLU_TESS_VERTEX, | |||
GLU_END = GLU_TESS_END, | |||
GLU_ERROR = GLU_TESS_ERROR, | |||
GLU_EDGE_FLAG = GLU_TESS_EDGE_FLAG | |||
}; | |||
#define GLU_VERSION_1_1 1 | |||
#define GLU_VERSION_1_2 1 | |||
#define GLU_TRUE 1 | |||
#define GLU_FALSE 0 | |||
/* Normal vectors */ | |||
#define GLU_SMOOTH 100000 | |||
#define GLU_FLAT 100001 | |||
#define GLU_NONE 100002 | |||
/* Quadric draw styles */ | |||
#define GLU_POINT 100010 | |||
#define GLU_LINE 100011 | |||
#define GLU_FILL 100012 | |||
#define GLU_SILHOUETTE 100013 | |||
/* Quadric orientation */ | |||
#define GLU_OUTSIDE 100020 | |||
#define GLU_INSIDE 100021 | |||
/* Tessellator */ | |||
#define GLU_TESS_BEGIN 100100 | |||
#define GLU_TESS_VERTEX 100101 | |||
#define GLU_TESS_END 100102 | |||
#define GLU_TESS_ERROR 100103 | |||
#define GLU_TESS_EDGE_FLAG 100104 | |||
#define GLU_TESS_COMBINE 100105 | |||
#define GLU_TESS_BEGIN_DATA 100106 | |||
#define GLU_TESS_VERTEX_DATA 100107 | |||
#define GLU_TESS_END_DATA 100108 | |||
#define GLU_TESS_ERROR_DATA 100109 | |||
#define GLU_TESS_EDGE_FLAG_DATA 100110 | |||
#define GLU_TESS_COMBINE_DATA 100111 | |||
/* Winding rules */ | |||
#define GLU_TESS_WINDING_ODD 100130 | |||
#define GLU_TESS_WINDING_NONZERO 100131 | |||
#define GLU_TESS_WINDING_POSITIVE 100132 | |||
#define GLU_TESS_WINDING_NEGATIVE 100133 | |||
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134 | |||
/* Tessellation properties */ | |||
#define GLU_TESS_WINDING_RULE 100140 | |||
#define GLU_TESS_BOUNDARY_ONLY 100141 | |||
#define GLU_TESS_TOLERANCE 100142 | |||
/* Tessellation errors */ | |||
#define GLU_TESS_ERROR1 100151 /* Missing gluBeginPolygon */ | |||
#define GLU_TESS_ERROR2 100152 /* Missing gluBeginContour */ | |||
#define GLU_TESS_ERROR3 100153 /* Missing gluEndPolygon */ | |||
#define GLU_TESS_ERROR4 100154 /* Missing gluEndContour */ | |||
#define GLU_TESS_ERROR5 100155 /* */ | |||
#define GLU_TESS_ERROR6 100156 /* */ | |||
#define GLU_TESS_ERROR7 100157 /* */ | |||
#define GLU_TESS_ERROR8 100158 /* */ | |||
/* NURBS */ | |||
#define GLU_AUTO_LOAD_MATRIX 100200 | |||
#define GLU_CULLING 100201 | |||
#define GLU_PARAMETRIC_TOLERANC 100202 | |||
#define GLU_SAMPLING_TOLERANCE 100203 | |||
#define GLU_DISPLAY_MODE 100204 | |||
#define GLU_SAMPLING_METHOD 100205 | |||
#define GLU_U_STEP 100206 | |||
#define GLU_V_STEP 100207 | |||
#define GLU_PATH_LENGTH 100215 | |||
#define GLU_PARAMETRIC_ERROR 100216 | |||
#define GLU_DOMAIN_DISTANCE 100217 | |||
#define GLU_MAP1_TRIM_2 100210 | |||
#define GLU_MAP1_TRIM_3 100211 | |||
#define GLU_OUTLINE_POLYGON 100240 | |||
#define GLU_OUTLINE_PATCH 100241 | |||
#define GLU_NURBS_ERROR1 100251 /* spline order un-supported */ | |||
#define GLU_NURBS_ERROR2 100252 /* too few knots */ | |||
#define GLU_NURBS_ERROR3 100253 /* valid knot range is empty */ | |||
#define GLU_NURBS_ERROR4 100254 /* decreasing knot sequence */ | |||
#define GLU_NURBS_ERROR5 100255 /* knot multiplicity > spline order */ | |||
#define GLU_NURBS_ERROR6 100256 /* endcurve() must follow bgncurve() */ | |||
#define GLU_NURBS_ERROR7 100257 /* bgncurve() must precede endcurve() */ | |||
#define GLU_NURBS_ERROR8 100258 /* ctrlarray or knot vector is NULL */ | |||
#define GLU_NURBS_ERROR9 100259 /* can't draw pwlcurves */ | |||
#define GLU_NURBS_ERROR10 100260 /* missing gluNurbsCurve() */ | |||
#define GLU_NURBS_ERROR11 100261 /* missing gluNurbsSurface() */ | |||
#define GLU_NURBS_ERROR12 100262 /* endtrim() must precede endsurface() */ | |||
#define GLU_NURBS_ERROR13 100263 /* bgnsurface() must precede endsurface() */ | |||
#define GLU_NURBS_ERROR14 100264 /* curve of improper type passed as trim curve */ | |||
#define GLU_NURBS_ERROR15 100265 /* bgnsurface() must precede bgntrim() */ | |||
#define GLU_NURBS_ERROR16 100266 /* endtrim() must follow bgntrim() */ | |||
#define GLU_NURBS_ERROR17 100267 /* bgntrim() must precede endtrim()*/ | |||
#define GLU_NURBS_ERROR18 100268 /* invalid or missing trim curve*/ | |||
#define GLU_NURBS_ERROR19 100269 /* bgntrim() must precede pwlcurve() */ | |||
#define GLU_NURBS_ERROR20 100270 /* pwlcurve referenced twice*/ | |||
#define GLU_NURBS_ERROR21 100271 /* pwlcurve and nurbscurve mixed */ | |||
#define GLU_NURBS_ERROR22 100272 /* improper usage of trim data type */ | |||
#define GLU_NURBS_ERROR23 100273 /* nurbscurve referenced twice */ | |||
#define GLU_NURBS_ERROR24 100274 /* nurbscurve and pwlcurve mixed */ | |||
#define GLU_NURBS_ERROR25 100275 /* nurbssurface referenced twice */ | |||
#define GLU_NURBS_ERROR26 100276 /* invalid property */ | |||
#define GLU_NURBS_ERROR27 100277 /* endsurface() must follow bgnsurface() */ | |||
#define GLU_NURBS_ERROR28 100278 /* intersecting or misoriented trim curves */ | |||
#define GLU_NURBS_ERROR29 100279 /* intersecting trim curves */ | |||
#define GLU_NURBS_ERROR30 100280 /* UNUSED */ | |||
#define GLU_NURBS_ERROR31 100281 /* unconnected trim curves */ | |||
#define GLU_NURBS_ERROR32 100282 /* unknown knot error */ | |||
#define GLU_NURBS_ERROR33 100283 /* negative vertex count encountered */ | |||
#define GLU_NURBS_ERROR34 100284 /* negative byte-stride */ | |||
#define GLU_NURBS_ERROR35 100285 /* unknown type descriptor */ | |||
#define GLU_NURBS_ERROR36 100286 /* null control point reference */ | |||
#define GLU_NURBS_ERROR37 100287 /* duplicate point on pwlcurve */ | |||
/* Errors */ | |||
#define GLU_INVALID_ENUM 100900 | |||
#define GLU_INVALID_VALUE 100901 | |||
#define GLU_OUT_OF_MEMORY 100902 | |||
#define GLU_INCOMPATIBLE_GL_VERSION 100903 | |||
/* New in GLU 1.1 */ | |||
#define GLU_VERSION 100800 | |||
#define GLU_EXTENSIONS 100801 | |||
/*** GLU 1.0 tessellation - obsolete! ***/ | |||
/* Contour types */ | |||
#define GLU_CW 100120 | |||
#define GLU_CCW 100121 | |||
#define GLU_INTERIOR 100122 | |||
#define GLU_EXTERIOR 100123 | |||
#define GLU_UNKNOWN 100124 | |||
/* Tessellator */ | |||
#define GLU_BEGIN GLU_TESS_BEGIN | |||
#define GLU_VERTEX GLU_TESS_VERTEX | |||
#define GLU_END GLU_TESS_END | |||
#define GLU_ERROR GLU_TESS_ERROR | |||
#define GLU_EDGE_FLAG GLU_TESS_EDGE_FLAG | |||
/* | |||
@@ -247,37 +246,37 @@ enum { | |||
*/ | |||
GLUAPI void GLAPIENTRY gluLookAt( GLdouble eyex, GLdouble eyey, GLdouble eyez, | |||
GLdouble centerx, GLdouble centery, | |||
GLdouble centerz, | |||
GLdouble upx, GLdouble upy, GLdouble upz ); | |||
GLdouble centerx, GLdouble centery, | |||
GLdouble centerz, | |||
GLdouble upx, GLdouble upy, GLdouble upz ); | |||
GLUAPI void GLAPIENTRY gluOrtho2D( GLdouble left, GLdouble right, | |||
GLdouble bottom, GLdouble top ); | |||
GLdouble bottom, GLdouble top ); | |||
GLUAPI void GLAPIENTRY gluPerspective( GLdouble fovy, GLdouble aspect, | |||
GLdouble zNear, GLdouble zFar ); | |||
GLdouble zNear, GLdouble zFar ); | |||
GLUAPI void GLAPIENTRY gluPickMatrix( GLdouble x, GLdouble y, | |||
GLdouble width, GLdouble height, | |||
const GLint viewport[4] ); | |||
GLdouble width, GLdouble height, | |||
const GLint viewport[4] ); | |||
GLUAPI GLint GLAPIENTRY gluProject( GLdouble objx, GLdouble objy, GLdouble objz, | |||
const GLdouble modelMatrix[16], | |||
const GLdouble projMatrix[16], | |||
const GLint viewport[4], | |||
GLdouble *winx, GLdouble *winy, | |||
GLdouble *winz ); | |||
GLUAPI GLint GLAPIENTRY gluUnProject( GLdouble winx, GLdouble winy, | |||
GLdouble winz, | |||
const GLdouble modelMatrix[16], | |||
const GLdouble projMatrix[16], | |||
const GLint viewport[4], | |||
GLdouble *objx, GLdouble *objy, | |||
GLdouble *objz ); | |||
GLdouble *winx, GLdouble *winy, | |||
GLdouble *winz ); | |||
GLUAPI GLint GLAPIENTRY gluUnProject( GLdouble winx, GLdouble winy, | |||
GLdouble winz, | |||
const GLdouble modelMatrix[16], | |||
const GLdouble projMatrix[16], | |||
const GLint viewport[4], | |||
GLdouble *objx, GLdouble *objy, | |||
GLdouble *objz ); | |||
GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ); | |||
@@ -290,19 +289,19 @@ GLUAPI const GLubyte* GLAPIENTRY gluErrorString( GLenum errorCode ); | |||
*/ | |||
GLUAPI GLint GLAPIENTRY gluScaleImage( GLenum format, | |||
GLsizei widthin, GLsizei heightin, | |||
GLenum typein, const void *datain, | |||
GLsizei widthout, GLsizei heightout, | |||
GLenum typeout, void *dataout ); | |||
GLint widthin, GLint heightin, | |||
GLenum typein, const void *datain, | |||
GLint widthout, GLint heightout, | |||
GLenum typeout, void *dataout ); | |||
GLUAPI GLint GLAPIENTRY gluBuild1DMipmaps( GLenum target, GLint components, | |||
GLsizei width, GLenum format, | |||
GLenum type, const void *data ); | |||
GLint width, GLenum format, | |||
GLenum type, const void *data ); | |||
GLUAPI GLint GLAPIENTRY gluBuild2DMipmaps( GLenum target, GLint components, | |||
GLsizei width, GLsizei height, | |||
GLenum format, | |||
GLenum type, const void *data ); | |||
GLint width, GLint height, | |||
GLenum format, | |||
GLenum type, const void *data ); | |||
@@ -317,37 +316,39 @@ GLUAPI GLUquadricObj* GLAPIENTRY gluNewQuadric( void ); | |||
GLUAPI void GLAPIENTRY gluDeleteQuadric( GLUquadricObj *state ); | |||
GLUAPI void GLAPIENTRY gluQuadricDrawStyle( GLUquadricObj *quadObject, | |||
GLenum drawStyle ); | |||
GLenum drawStyle ); | |||
GLUAPI void GLAPIENTRY gluQuadricOrientation( GLUquadricObj *quadObject, | |||
GLenum orientation ); | |||
GLenum orientation ); | |||
GLUAPI void GLAPIENTRY gluQuadricNormals( GLUquadricObj *quadObject, | |||
GLenum normals ); | |||
GLenum normals ); | |||
GLUAPI void GLAPIENTRY gluQuadricTexture( GLUquadricObj *quadObject, | |||
GLboolean textureCoords ); | |||
GLboolean textureCoords ); | |||
GLUAPI void GLAPIENTRY gluQuadricCallback( GLUquadricObj *qobj, | |||
GLenum which, void (GLCALLBACK *fn)() ); | |||
GLenum which, | |||
void (GLCALLBACK *fn)() ); | |||
GLUAPI void GLAPIENTRY gluCylinder( GLUquadricObj *qobj, | |||
GLdouble baseRadius, | |||
GLdouble topRadius, | |||
GLdouble height, | |||
GLint slices, GLint stacks ); | |||
GLdouble baseRadius, | |||
GLdouble topRadius, | |||
GLdouble height, | |||
GLint slices, GLint stacks ); | |||
GLUAPI void GLAPIENTRY gluSphere( GLUquadricObj *qobj, | |||
GLdouble radius, GLint slices, GLint stacks ); | |||
GLdouble radius, GLint slices, | |||
GLint stacks ); | |||
GLUAPI void GLAPIENTRY gluDisk( GLUquadricObj *qobj, | |||
GLdouble innerRadius, GLdouble outerRadius, | |||
GLint slices, GLint loops ); | |||
GLdouble innerRadius, GLdouble outerRadius, | |||
GLint slices, GLint loops ); | |||
GLUAPI void GLAPIENTRY gluPartialDisk( GLUquadricObj *qobj, GLdouble innerRadius, | |||
GLdouble outerRadius, GLint slices, | |||
GLint loops, GLdouble startAngle, | |||
GLdouble sweepAngle ); | |||
GLdouble outerRadius, GLint slices, | |||
GLint loops, GLdouble startAngle, | |||
GLdouble sweepAngle ); | |||
@@ -362,46 +363,47 @@ GLUAPI GLUnurbsObj* GLAPIENTRY gluNewNurbsRenderer( void ); | |||
GLUAPI void GLAPIENTRY gluDeleteNurbsRenderer( GLUnurbsObj *nobj ); | |||
GLUAPI void GLAPIENTRY gluLoadSamplingMatrices( GLUnurbsObj *nobj, | |||
const GLfloat modelMatrix[16], | |||
const GLfloat projMatrix[16], | |||
const GLint viewport[4] ); | |||
const GLfloat modelMatrix[16], | |||
const GLfloat projMatrix[16], | |||
const GLint viewport[4] ); | |||
GLUAPI void GLAPIENTRY gluNurbsProperty( GLUnurbsObj *nobj, GLenum property, | |||
GLfloat value ); | |||
GLfloat value ); | |||
GLUAPI void GLAPIENTRY gluGetNurbsProperty( GLUnurbsObj *nobj, GLenum property, | |||
GLfloat *value ); | |||
GLfloat *value ); | |||
GLUAPI void GLAPIENTRY gluBeginCurve( GLUnurbsObj *nobj ); | |||
GLUAPI void GLAPIENTRY gluEndCurve( GLUnurbsObj * nobj ); | |||
GLUAPI void GLAPIENTRY gluNurbsCurve( GLUnurbsObj *nobj, GLint nknots, | |||
GLfloat *knot, GLint stride, | |||
GLfloat *ctlarray, GLint order, | |||
GLenum type ); | |||
GLfloat *knot, GLint stride, | |||
GLfloat *ctlarray, GLint order, | |||
GLenum type ); | |||
GLUAPI void GLAPIENTRY gluBeginSurface( GLUnurbsObj *nobj ); | |||
GLUAPI void GLAPIENTRY gluEndSurface( GLUnurbsObj * nobj ); | |||
GLUAPI void GLAPIENTRY gluNurbsSurface( GLUnurbsObj *nobj, | |||
GLint sknot_count, GLfloat *sknot, | |||
GLint tknot_count, GLfloat *tknot, | |||
GLint s_stride, GLint t_stride, | |||
GLfloat *ctlarray, | |||
GLint sorder, GLint torder, | |||
GLenum type ); | |||
GLint sknot_count, GLfloat *sknot, | |||
GLint tknot_count, GLfloat *tknot, | |||
GLint s_stride, GLint t_stride, | |||
GLfloat *ctlarray, | |||
GLint sorder, GLint torder, | |||
GLenum type ); | |||
GLUAPI void GLAPIENTRY gluBeginTrim( GLUnurbsObj *nobj ); | |||
GLUAPI void GLAPIENTRY gluEndTrim( GLUnurbsObj *nobj ); | |||
GLUAPI void GLAPIENTRY gluPwlCurve( GLUnurbsObj *nobj, GLint count, | |||
GLfloat *array, GLint stride, GLenum type ); | |||
GLfloat *array, GLint stride, | |||
GLenum type ); | |||
GLUAPI void GLAPIENTRY gluNurbsCallback( GLUnurbsObj *nobj, GLenum which, | |||
void (GLCALLBACK *fn)() ); | |||
void (GLCALLBACK *fn)() ); | |||
@@ -1,8 +1,8 @@ | |||
/* $Id: glx.h,v 1.5 1999/10/27 09:46:07 brianp Exp $ */ | |||
/* $Id: glx.h,v 1.6 1999/11/11 01:27:17 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -50,38 +50,41 @@ extern "C" { | |||
#define GLX_VERSION_1_1 1 | |||
#define GLX_EXTENSION_NAME "GLX" | |||
/* | |||
* Tokens for glXChooseVisual and glXGetConfig: | |||
*/ | |||
enum _GLX_CONFIGS { | |||
GLX_USE_GL = 1, | |||
GLX_BUFFER_SIZE = 2, | |||
GLX_LEVEL = 3, | |||
GLX_RGBA = 4, | |||
GLX_DOUBLEBUFFER = 5, | |||
GLX_STEREO = 6, | |||
GLX_AUX_BUFFERS = 7, | |||
GLX_RED_SIZE = 8, | |||
GLX_GREEN_SIZE = 9, | |||
GLX_BLUE_SIZE = 10, | |||
GLX_ALPHA_SIZE = 11, | |||
GLX_DEPTH_SIZE = 12, | |||
GLX_STENCIL_SIZE = 13, | |||
GLX_ACCUM_RED_SIZE = 14, | |||
GLX_ACCUM_GREEN_SIZE = 15, | |||
GLX_ACCUM_BLUE_SIZE = 16, | |||
GLX_ACCUM_ALPHA_SIZE = 17, | |||
/* GLX_EXT_visual_info extension */ | |||
GLX_X_VISUAL_TYPE_EXT = 0x22, | |||
GLX_TRANSPARENT_TYPE_EXT = 0x23, | |||
GLX_TRANSPARENT_INDEX_VALUE_EXT = 0x24, | |||
GLX_TRANSPARENT_RED_VALUE_EXT = 0x25, | |||
GLX_TRANSPARENT_GREEN_VALUE_EXT = 0x26, | |||
GLX_TRANSPARENT_BLUE_VALUE_EXT = 0x27, | |||
GLX_TRANSPARENT_ALPHA_VALUE_EXT = 0x28 | |||
}; | |||
#define GLX_USE_GL 1 | |||
#define GLX_BUFFER_SIZE 2 | |||
#define GLX_LEVEL 3 | |||
#define GLX_RGBA 4 | |||
#define GLX_DOUBLEBUFFER 5 | |||
#define GLX_STEREO 6 | |||
#define GLX_AUX_BUFFERS 7 | |||
#define GLX_RED_SIZE 8 | |||
#define GLX_GREEN_SIZE 9 | |||
#define GLX_BLUE_SIZE 10 | |||
#define GLX_ALPHA_SIZE 11 | |||
#define GLX_DEPTH_SIZE 12 | |||
#define GLX_STENCIL_SIZE 13 | |||
#define GLX_ACCUM_RED_SIZE 14 | |||
#define GLX_ACCUM_GREEN_SIZE 15 | |||
#define GLX_ACCUM_BLUE_SIZE 16 | |||
#define GLX_ACCUM_ALPHA_SIZE 17 | |||
/* GLX_EXT_visual_info extension */ | |||
#define GLX_X_VISUAL_TYPE_EXT 0x22 | |||
#define GLX_TRANSPARENT_TYPE_EXT 0x23 | |||
#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 | |||
#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 | |||
#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 | |||
#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 | |||
#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 | |||
/* |
@@ -1,7 +1,7 @@ | |||
# $Id: Makefile.X11,v 1.6 1999/10/08 09:27:09 keithw Exp $ | |||
# $Id: Makefile.X11,v 1.7 1999/11/11 01:22:28 brianp Exp $ | |||
# Mesa 3-D graphics library | |||
# Version: 3.1 | |||
# Version: 3.3 | |||
# Copyright (C) 1995-1999 Brian Paul | |||
# Makefile for core library | |||
@@ -18,13 +18,13 @@ VPATH = RCS | |||
INCDIR = ../include | |||
LIBDIR = ../lib | |||
CORE_SOURCES = \ | |||
glapi.c \ | |||
glapinoop.c \ | |||
accum.c \ | |||
alpha.c \ | |||
alphabuf.c \ | |||
api1.c \ | |||
api2.c \ | |||
apiext.c \ | |||
attrib.c \ | |||
bbox.c \ | |||
bitmap.c \ | |||
@@ -37,6 +37,7 @@ CORE_SOURCES = \ | |||
cva.c \ | |||
debug_xform.c \ | |||
depth.c \ | |||
dispatch.c \ | |||
dlist.c \ | |||
drawpix.c \ | |||
enable.c \ | |||
@@ -49,18 +50,19 @@ CORE_SOURCES = \ | |||
glmisc.c \ | |||
hash.c \ | |||
image.c \ | |||
imaging.c \ | |||
light.c \ | |||
lines.c \ | |||
logic.c \ | |||
masking.c \ | |||
matrix.c \ | |||
mem.c \ | |||
mmath.c \ | |||
mthreads.c \ | |||
pb.c \ | |||
pixel.c \ | |||
pipeline.c \ | |||
points.c \ | |||
pointers.c \ | |||
polygon.c \ | |||
quads.c \ | |||
rastpos.c \ |
@@ -1,4 +1,4 @@ | |||
/* $Id: fakeglx.c,v 1.12 1999/10/27 09:50:10 brianp Exp $ */ | |||
/* $Id: fakeglx.c,v 1.13 1999/11/11 01:29:28 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -45,16 +45,7 @@ | |||
#ifdef HAVE_CONFIG_H | |||
#include "conf.h" | |||
#endif | |||
#include <stdio.h> | |||
#include <stdlib.h> | |||
#include <string.h> | |||
#include <X11/Xlib.h> | |||
#include <X11/Xutil.h> | |||
#include "GL/gl.h" | |||
#include "glxheader.h" | |||
#include "GL/xmesa.h" | |||
#include "context.h" | |||
#include "config.h" | |||
@@ -1056,6 +1047,7 @@ Bool Fake_glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx ) | |||
{ | |||
if (ctx && drawable) { | |||
XMesaBuffer buffer; | |||
XMesaContext xmctx = (XMesaContext) ctx; | |||
if (drawable==MakeCurrent_PrevDrawable && ctx==MakeCurrent_PrevContext) { | |||
buffer = MakeCurrent_PrevBuffer; | |||
@@ -1065,7 +1057,7 @@ Bool Fake_glXMakeCurrent( Display *dpy, GLXDrawable drawable, GLXContext ctx ) | |||
} | |||
if (!buffer) { | |||
/* drawable must be a new window! */ | |||
buffer = XMesaCreateWindowBuffer2( ctx->xm_visual, drawable, ctx ); | |||
buffer = XMesaCreateWindowBuffer2( xmctx->xm_visual, drawable, ctx ); | |||
if (!buffer) { | |||
/* Out of memory, or context/drawable depth mismatch */ | |||
return False; |
@@ -0,0 +1,71 @@ | |||
/* $Id: glxheader.h,v 1.1 1999/11/11 01:29:28 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
* Permission is hereby granted, free of charge, to any person obtaining a | |||
* copy of this software and associated documentation files (the "Software"), | |||
* to deal in the Software without restriction, including without limitation | |||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | |||
* and/or sell copies of the Software, and to permit persons to whom the | |||
* Software is furnished to do so, subject to the following conditions: | |||
* | |||
* The above copyright notice and this permission notice shall be included | |||
* in all copies or substantial portions of the Software. | |||
* | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | |||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
*/ | |||
#ifndef GLX_HEADER_H | |||
#define GLX_HEADER_H | |||
#ifdef HAVE_CONFIG_H | |||
#include "conf.h" | |||
#endif | |||
#include "glheader.h" | |||
#ifdef XFree86Server | |||
# include "resource.h" | |||
# include "windowstr.h" | |||
# include "gcstruct.h" | |||
# include "GL/xf86glx.h" | |||
# include "xf86glx_util.h" | |||
#else | |||
# ifdef GLX_DIRECT_RENDERING | |||
# include "dri_mesaint.h" | |||
# endif | |||
# include <X11/Xlib.h> | |||
# include <X11/Xutil.h> | |||
# ifdef USE_XSHM /* was SHM */ | |||
# include <sys/ipc.h> | |||
# include <sys/shm.h> | |||
# include <X11/extensions/XShm.h> | |||
# endif | |||
#endif | |||
/* this silences a compiler warning on several systems */ | |||
struct timespec; | |||
struct itimerspec; | |||
#endif /*GLX_HEADER*/ |
@@ -1,8 +1,8 @@ | |||
/* $Id: xfonts.c,v 1.2 1999/10/13 18:49:47 brianp Exp $ */ | |||
/* $Id: xfonts.c,v 1.3 1999/11/11 01:29:28 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -44,7 +44,7 @@ | |||
#include "GL/xmesa.h" | |||
#include "context.h" | |||
#include "fakeglx.h" | |||
#include "macros.h" | |||
#include "mem.h" | |||
#include "xmesaP.h" | |||
/* Some debugging info. */ |
@@ -0,0 +1,591 @@ | |||
/* $Id: glapi.h,v 1.1 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
* Permission is hereby granted, free of charge, to any person obtaining a | |||
* copy of this software and associated documentation files (the "Software"), | |||
* to deal in the Software without restriction, including without limitation | |||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | |||
* and/or sell copies of the Software, and to permit persons to whom the | |||
* Software is furnished to do so, subject to the following conditions: | |||
* | |||
* The above copyright notice and this permission notice shall be included | |||
* in all copies or substantial portions of the Software. | |||
* | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | |||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
*/ | |||
/* | |||
* This file is not specific to Mesa. It defines a dispatch table | |||
* which could be used by any number of OpenGL implementations. | |||
* It's designed to be gl.h-independent as well. That is, it does | |||
* not depend on any particular extensions being defined in the gl.h | |||
* header. We #define extension symbols (like _GLAPI_EXT_blend_color) | |||
* to determine which entry points to compile. Clients of this dispatcher | |||
* (like Mesa) can #ifdef test these symbols to know how to fill in the | |||
* table. | |||
*/ | |||
#ifndef _GLAPI_H | |||
#define _GLAPI_H | |||
#include "GL/gl.h" | |||
/* Which OpenGL API revisisions are supported by the table: */ | |||
#define _GLAPI_VERSION_1_1 1 | |||
#define _GLAPI_VERSION_1_2 1 | |||
/* And which extensions: */ | |||
#define _GLAPI_ARB_imaging 1 | |||
#define _GLAPI_ARB_multitexture 1 | |||
#define _GLAPI_EXT_color_table 1 | |||
#define _GLAPI_EXT_compiled_vertex_array 1 | |||
#define _GLAPI_EXT_point_parameters 1 | |||
#define _GLAPI_EXT_polygon_offset 1 | |||
#define _GLAPI_EXT_blend_minmax 1 | |||
#define _GLAPI_EXT_blend_color 1 | |||
#define _GLAPI_EXT_texture3D 1 | |||
#define _GLAPI_EXT_texture_object 1 | |||
#define _GLAPI_EXT_vertex_array 1 | |||
#define _GLAPI_INGR_blend_func_separate 1 | |||
#define _GLAPI_MESA_window_pos 1 | |||
#define _GLAPI_MESA_resize_buffers 1 | |||
/* | |||
* This struct contains pointers for all the GL API entrypoints | |||
* plus some reserved slots for dynamic extensions. | |||
* | |||
*/ | |||
struct _glapi_table | |||
{ | |||
/* | |||
* OpenGL 1.0 | |||
*/ | |||
void (*Accum)(GLenum, GLfloat); | |||
void (*AlphaFunc)(GLenum, GLclampf); | |||
void (*Begin)(GLenum); | |||
void (*Bitmap)(GLsizei, GLsizei, GLfloat, GLfloat, GLfloat, GLfloat, const GLubyte *); | |||
void (*BlendFunc)(GLenum, GLenum); | |||
void (*CallList)(GLuint list); | |||
void (*CallLists)(GLsizei, GLenum, const GLvoid *); | |||
void (*Clear)(GLbitfield); | |||
void (*ClearAccum)(GLfloat, GLfloat, GLfloat, GLfloat); | |||
void (*ClearColor)(GLclampf, GLclampf, GLclampf, GLclampf); | |||
void (*ClearDepth)(GLclampd); | |||
void (*ClearIndex)(GLfloat); | |||
void (*ClearStencil)(GLint); | |||
void (*ClipPlane)(GLenum, const GLdouble *); | |||
void (*Color3b)(GLbyte, GLbyte, GLbyte); | |||
void (*Color3bv)(const GLbyte *); | |||
void (*Color3d)(GLdouble, GLdouble, GLdouble); | |||
void (*Color3dv)(const GLdouble *); | |||
void (*Color3f)(GLfloat, GLfloat, GLfloat); | |||
void (*Color3fv)(const GLfloat *); | |||
void (*Color3i)(GLint, GLint, GLint); | |||
void (*Color3iv)(const GLint *); | |||
void (*Color3s)(GLshort, GLshort, GLshort); | |||
void (*Color3sv)(const GLshort *); | |||
void (*Color3ub)(GLubyte, GLubyte, GLubyte); | |||
void (*Color3ubv)(const GLubyte *); | |||
void (*Color3ui)(GLuint, GLuint, GLuint); | |||
void (*Color3uiv)(const GLuint *); | |||
void (*Color3us)(GLushort, GLushort, GLushort); | |||
void (*Color3usv)(const GLushort *); | |||
void (*Color4b)(GLbyte, GLbyte, GLbyte, GLbyte); | |||
void (*Color4bv)(const GLbyte *); | |||
void (*Color4d)(GLdouble, GLdouble, GLdouble, GLdouble); | |||
void (*Color4dv)(const GLdouble *); | |||
void (*Color4f)(GLfloat, GLfloat, GLfloat, GLfloat); | |||
void (*Color4fv)(const GLfloat *); | |||
void (*Color4i)(GLint, GLint, GLint, GLint); | |||
void (*Color4iv)(const GLint *); | |||
void (*Color4s)(GLshort, GLshort, GLshort, GLshort); | |||
void (*Color4sv)(const GLshort *); | |||
void (*Color4ub)(GLubyte, GLubyte, GLubyte, GLubyte); | |||
void (*Color4ubv)(const GLubyte *); | |||
void (*Color4ui)(GLuint, GLuint, GLuint, GLuint); | |||
void (*Color4uiv)(const GLuint *); | |||
void (*Color4us)(GLushort, GLushort, GLushort, GLushort); | |||
void (*Color4usv)(const GLushort *); | |||
void (*ColorMask)(GLboolean, GLboolean, GLboolean, GLboolean); | |||
void (*ColorMaterial)(GLenum, GLenum); | |||
void (*CopyPixels)(GLint, GLint, GLsizei, GLsizei, GLenum); | |||
void (*CullFace)(GLenum); | |||
void (*DeleteLists)(GLuint, GLsizei); | |||
void (*DepthFunc)(GLenum); | |||
void (*DepthMask)(GLboolean); | |||
void (*DepthRange)(GLclampd, GLclampd); | |||
void (*Disable)(GLenum); | |||
void (*DrawBuffer)(GLenum); | |||
void (*DrawPixels)(GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); | |||
void (*EdgeFlag)(GLboolean); | |||
void (*EdgeFlagv)(const GLboolean *); | |||
void (*Enable)(GLenum); | |||
void (*End)(void); | |||
void (*EndList)(void); | |||
void (*EvalCoord1d)(GLdouble); | |||
void (*EvalCoord1dv)(const GLdouble *); | |||
void (*EvalCoord1f)(GLfloat); | |||
void (*EvalCoord1fv)(const GLfloat *); | |||
void (*EvalCoord2d)(GLdouble u, GLdouble); | |||
void (*EvalCoord2dv)(const GLdouble *); | |||
void (*EvalCoord2f)(GLfloat u, GLfloat); | |||
void (*EvalCoord2fv)(const GLfloat *); | |||
void (*EvalMesh1)(GLenum, GLint, GLint); | |||
void (*EvalMesh2)(GLenum, GLint, GLint, GLint, GLint); | |||
void (*EvalPoint1)(GLint); | |||
void (*EvalPoint2)(GLint, GLint); | |||
void (*FeedbackBuffer)(GLsizei, GLenum, GLfloat *); | |||
void (*Finish)(void); | |||
void (*Flush)(void); | |||
void (*Fogf)(GLenum, GLfloat); | |||
void (*Fogfv)(GLenum, const GLfloat *); | |||
void (*Fogi)(GLenum, GLint); | |||
void (*Fogiv)(GLenum, const GLint *); | |||
void (*FrontFace)(GLenum); | |||
void (*Frustum)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); | |||
GLuint (*GenLists)(GLsizei); | |||
void (*GetBooleanv)(GLenum, GLboolean *); | |||
void (*GetClipPlane)(GLenum, GLdouble *); | |||
void (*GetDoublev)(GLenum, GLdouble *); | |||
GLenum (*GetError)(void); | |||
void (*GetFloatv)(GLenum, GLfloat *); | |||
void (*GetIntegerv)(GLenum, GLint *); | |||
void (*GetLightfv)(GLenum light, GLenum, GLfloat *); | |||
void (*GetLightiv)(GLenum light, GLenum, GLint *); | |||
void (*GetMapdv)(GLenum, GLenum, GLdouble *); | |||
void (*GetMapfv)(GLenum, GLenum, GLfloat *); | |||
void (*GetMapiv)(GLenum, GLenum, GLint *); | |||
void (*GetMaterialfv)(GLenum, GLenum, GLfloat *); | |||
void (*GetMaterialiv)(GLenum, GLenum, GLint *); | |||
void (*GetPixelMapfv)(GLenum, GLfloat *); | |||
void (*GetPixelMapuiv)(GLenum, GLuint *); | |||
void (*GetPixelMapusv)(GLenum, GLushort *); | |||
void (*GetPolygonStipple)(GLubyte *); | |||
const GLubyte* (*GetString)(GLenum name); | |||
void (*GetTexEnvfv)(GLenum, GLenum, GLfloat *); | |||
void (*GetTexEnviv)(GLenum, GLenum, GLint *); | |||
void (*GetTexGendv)(GLenum coord, GLenum, GLdouble *); | |||
void (*GetTexGenfv)(GLenum coord, GLenum, GLfloat *); | |||
void (*GetTexGeniv)(GLenum coord, GLenum, GLint *); | |||
void (*GetTexImage)(GLenum, GLint level, GLenum, GLenum, GLvoid *); | |||
void (*GetTexLevelParameterfv)(GLenum, GLint, GLenum, GLfloat *); | |||
void (*GetTexLevelParameteriv)(GLenum, GLint, GLenum, GLint *); | |||
void (*GetTexParameterfv)(GLenum, GLenum, GLfloat *); | |||
void (*GetTexParameteriv)(GLenum, GLenum, GLint *); | |||
void (*Hint)(GLenum, GLenum); | |||
void (*IndexMask)(GLuint); | |||
void (*Indexd)(GLdouble); | |||
void (*Indexdv)(const GLdouble *); | |||
void (*Indexf)(GLfloat); | |||
void (*Indexfv)(const GLfloat *); | |||
void (*Indexi)(GLint); | |||
void (*Indexiv)(const GLint *); | |||
void (*Indexs)(GLshort); | |||
void (*Indexsv)(const GLshort *); | |||
void (*InitNames)(void); | |||
GLboolean (*IsEnabled)(GLenum); | |||
GLboolean (*IsList)(GLuint); | |||
void (*LightModelf)(GLenum, GLfloat); | |||
void (*LightModelfv)(GLenum, const GLfloat *); | |||
void (*LightModeli)(GLenum, GLint); | |||
void (*LightModeliv)(GLenum, const GLint *); | |||
void (*Lightf)(GLenum light, GLenum, GLfloat); | |||
void (*Lightfv)(GLenum light, GLenum, const GLfloat *); | |||
void (*Lighti)(GLenum light, GLenum, GLint); | |||
void (*Lightiv)(GLenum light, GLenum, const GLint *); | |||
void (*LineStipple)(GLint factor, GLushort); | |||
void (*LineWidth)(GLfloat); | |||
void (*ListBase)(GLuint); | |||
void (*LoadIdentity)(void); | |||
void (*LoadMatrixd)(const GLdouble *); | |||
void (*LoadMatrixf)(const GLfloat *); | |||
void (*LoadName)(GLuint); | |||
void (*LogicOp)(GLenum); | |||
void (*Map1d)(GLenum, GLdouble, GLdouble, GLint, GLint, const GLdouble *); | |||
void (*Map1f)(GLenum, GLfloat, GLfloat, GLint, GLint, const GLfloat *); | |||
void (*Map2d)(GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); | |||
void (*Map2f)(GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); | |||
void (*MapGrid1d)(GLint, GLdouble, GLdouble); | |||
void (*MapGrid1f)(GLint, GLfloat, GLfloat); | |||
void (*MapGrid2d)(GLint, GLdouble, GLdouble, GLint, GLdouble, GLdouble); | |||
void (*MapGrid2f)(GLint, GLfloat, GLfloat, GLint, GLfloat, GLfloat); | |||
void (*Materialf)(GLenum, GLenum, GLfloat); | |||
void (*Materialfv)(GLenum, GLenum, const GLfloat *); | |||
void (*Materiali)(GLenum, GLenum, GLint); | |||
void (*Materialiv)(GLenum, GLenum, const GLint *); | |||
void (*MatrixMode)(GLenum); | |||
void (*MultMatrixd)(const GLdouble *); | |||
void (*MultMatrixf)(const GLfloat *); | |||
void (*NewList)(GLuint list, GLenum); | |||
void (*Normal3b)(GLbyte, GLbyte, GLbyte); | |||
void (*Normal3bv)(const GLbyte *); | |||
void (*Normal3d)(GLdouble, GLdouble, GLdouble); | |||
void (*Normal3dv)(const GLdouble *); | |||
void (*Normal3f)(GLfloat, GLfloat, GLfloat); | |||
void (*Normal3fv)(const GLfloat *); | |||
void (*Normal3i)(GLint, GLint, GLint); | |||
void (*Normal3iv)(const GLint *); | |||
void (*Normal3s)(GLshort, GLshort, GLshort); | |||
void (*Normal3sv)(const GLshort *); | |||
void (*Ortho)(GLdouble, GLdouble, GLdouble, GLdouble, GLdouble, GLdouble); | |||
void (*PassThrough)(GLfloat); | |||
void (*PixelMapfv)(GLenum, GLint, const GLfloat *); | |||
void (*PixelMapuiv)(GLenum, GLint, const GLuint *); | |||
void (*PixelMapusv)(GLenum, GLint, const GLushort *); | |||
void (*PixelStoref)(GLenum, GLfloat); | |||
void (*PixelStorei)(GLenum, GLint); | |||
void (*PixelTransferf)(GLenum, GLfloat); | |||
void (*PixelTransferi)(GLenum, GLint); | |||
void (*PixelZoom)(GLfloat, GLfloat); | |||
void (*PointSize)(GLfloat); | |||
void (*PolygonMode)(GLenum, GLenum); | |||
void (*PolygonOffset)(GLfloat, GLfloat); | |||
void (*PolygonStipple)(const GLubyte *); | |||
void (*PopAttrib)(void); | |||
void (*PopMatrix)(void); | |||
void (*PopName)(void); | |||
void (*PushAttrib)(GLbitfield); | |||
void (*PushMatrix)(void); | |||
void (*PushName)(GLuint); | |||
void (*RasterPos2d)(GLdouble, GLdouble); | |||
void (*RasterPos2dv)(const GLdouble *); | |||
void (*RasterPos2f)(GLfloat, GLfloat); | |||
void (*RasterPos2fv)(const GLfloat *); | |||
void (*RasterPos2i)(GLint, GLint); | |||
void (*RasterPos2iv)(const GLint *); | |||
void (*RasterPos2s)(GLshort, GLshort); | |||
void (*RasterPos2sv)(const GLshort *); | |||
void (*RasterPos3d)(GLdouble, GLdouble, GLdouble); | |||
void (*RasterPos3dv)(const GLdouble *); | |||
void (*RasterPos3f)(GLfloat, GLfloat, GLfloat); | |||
void (*RasterPos3fv)(const GLfloat *); | |||
void (*RasterPos3i)(GLint, GLint, GLint); | |||
void (*RasterPos3iv)(const GLint *); | |||
void (*RasterPos3s)(GLshort, GLshort, GLshort); | |||
void (*RasterPos3sv)(const GLshort *); | |||
void (*RasterPos4d)(GLdouble, GLdouble, GLdouble, GLdouble); | |||
void (*RasterPos4dv)(const GLdouble *); | |||
void (*RasterPos4f)(GLfloat, GLfloat, GLfloat, GLfloat); | |||
void (*RasterPos4fv)(const GLfloat *); | |||
void (*RasterPos4i)(GLint, GLint, GLint, GLint); | |||
void (*RasterPos4iv)(const GLint *); | |||
void (*RasterPos4s)(GLshort, GLshort, GLshort, GLshort); | |||
void (*RasterPos4sv)(const GLshort *); | |||
void (*ReadBuffer)(GLenum); | |||
void (*ReadPixels)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLvoid *); | |||
void (*Rectd)(GLdouble, GLdouble, GLdouble, GLdouble); | |||
void (*Rectdv)(const GLdouble *, const GLdouble *); | |||
void (*Rectf)(GLfloat, GLfloat, GLfloat, GLfloat); | |||
void (*Rectfv)(const GLfloat *, const GLfloat *); | |||
void (*Recti)(GLint, GLint, GLint, GLint); | |||
void (*Rectiv)(const GLint *, const GLint *); | |||
void (*Rects)(GLshort, GLshort, GLshort, GLshort); | |||
void (*Rectsv)(const GLshort *, const GLshort *); | |||
GLint (*RenderMode)(GLenum); | |||
void (*Rotated)(GLdouble, GLdouble, GLdouble, GLdouble); | |||
void (*Rotatef)(GLfloat, GLfloat, GLfloat, GLfloat); | |||
void (*Scaled)(GLdouble, GLdouble, GLdouble); | |||
void (*Scalef)(GLfloat, GLfloat, GLfloat); | |||
void (*Scissor)(GLint, GLint, GLsizei, GLsizei); | |||
void (*SelectBuffer)(GLsizei, GLuint *); | |||
void (*ShadeModel)(GLenum); | |||
void (*StencilFunc)(GLenum, GLint, GLuint); | |||
void (*StencilMask)(GLuint); | |||
void (*StencilOp)(GLenum, GLenum, GLenum); | |||
void (*TexCoord1d)(GLdouble); | |||
void (*TexCoord1dv)(const GLdouble *); | |||
void (*TexCoord1f)(GLfloat); | |||
void (*TexCoord1fv)(const GLfloat *); | |||
void (*TexCoord1i)(GLint); | |||
void (*TexCoord1iv)(const GLint *); | |||
void (*TexCoord1s)(GLshort); | |||
void (*TexCoord1sv)(const GLshort *); | |||
void (*TexCoord2d)(GLdouble, GLdouble); | |||
void (*TexCoord2dv)(const GLdouble *); | |||
void (*TexCoord2f)(GLfloat, GLfloat); | |||
void (*TexCoord2fv)(const GLfloat *); | |||
void (*TexCoord2i)(GLint, GLint); | |||
void (*TexCoord2iv)(const GLint *); | |||
void (*TexCoord2s)(GLshort, GLshort); | |||
void (*TexCoord2sv)(const GLshort *); | |||
void (*TexCoord3d)(GLdouble, GLdouble, GLdouble); | |||
void (*TexCoord3dv)(const GLdouble *); | |||
void (*TexCoord3f)(GLfloat, GLfloat, GLfloat); | |||
void (*TexCoord3fv)(const GLfloat *); | |||
void (*TexCoord3i)(GLint, GLint, GLint); | |||
void (*TexCoord3iv)(const GLint *); | |||
void (*TexCoord3s)(GLshort, GLshort, GLshort); | |||
void (*TexCoord3sv)(const GLshort *); | |||
void (*TexCoord4d)(GLdouble, GLdouble, GLdouble, GLdouble); | |||
void (*TexCoord4dv)(const GLdouble *); | |||
void (*TexCoord4f)(GLfloat, GLfloat, GLfloat, GLfloat); | |||
void (*TexCoord4fv)(const GLfloat *); | |||
void (*TexCoord4i)(GLint, GLint, GLint, GLint); | |||
void (*TexCoord4iv)(const GLint *); | |||
void (*TexCoord4s)(GLshort, GLshort, GLshort, GLshort); | |||
void (*TexCoord4sv)(const GLshort *); | |||
void (*TexEnvf)(GLenum, GLenum, GLfloat); | |||
void (*TexEnvfv)(GLenum, GLenum, const GLfloat *); | |||
void (*TexEnvi)(GLenum, GLenum, GLint); | |||
void (*TexEnviv)(GLenum, GLenum, const GLint *); | |||
void (*TexGend)(GLenum, GLenum, GLdouble); | |||
void (*TexGendv)(GLenum, GLenum, const GLdouble *); | |||
void (*TexGenf)(GLenum, GLenum, GLfloat); | |||
void (*TexGenfv)(GLenum, GLenum, const GLfloat *); | |||
void (*TexGeni)(GLenum, GLenum, GLint); | |||
void (*TexGeniv)(GLenum, GLenum, const GLint *); | |||
void (*TexImage1D)(GLenum, GLint, GLint, GLsizei, GLint, GLenum, GLenum, const GLvoid *); | |||
void (*TexImage2D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); | |||
void (*TexParameterf)(GLenum, GLenum, GLfloat); | |||
void (*TexParameterfv)(GLenum, GLenum, const GLfloat *); | |||
void (*TexParameteri)(GLenum, GLenum, GLint); | |||
void (*TexParameteriv)(GLenum, GLenum, const GLint *); | |||
void (*Translated)(GLdouble, GLdouble, GLdouble); | |||
void (*Translatef)(GLfloat, GLfloat, GLfloat); | |||
void (*Vertex2d)(GLdouble, GLdouble); | |||
void (*Vertex2dv)(const GLdouble *); | |||
void (*Vertex2f)(GLfloat, GLfloat); | |||
void (*Vertex2fv)(const GLfloat *); | |||
void (*Vertex2i)(GLint, GLint); | |||
void (*Vertex2iv)(const GLint *); | |||
void (*Vertex2s)(GLshort, GLshort); | |||
void (*Vertex2sv)(const GLshort *); | |||
void (*Vertex3d)(GLdouble, GLdouble, GLdouble); | |||
void (*Vertex3dv)(const GLdouble *); | |||
void (*Vertex3f)(GLfloat, GLfloat, GLfloat); | |||
void (*Vertex3fv)(const GLfloat *); | |||
void (*Vertex3i)(GLint, GLint, GLint); | |||
void (*Vertex3iv)(const GLint *); | |||
void (*Vertex3s)(GLshort, GLshort, GLshort); | |||
void (*Vertex3sv)(const GLshort *); | |||
void (*Vertex4d)(GLdouble, GLdouble, GLdouble, GLdouble); | |||
void (*Vertex4dv)(const GLdouble *); | |||
void (*Vertex4f)(GLfloat, GLfloat, GLfloat, GLfloat); | |||
void (*Vertex4fv)(const GLfloat *); | |||
void (*Vertex4i)(GLint, GLint, GLint, GLint); | |||
void (*Vertex4iv)(const GLint *); | |||
void (*Vertex4s)(GLshort, GLshort, GLshort, GLshort); | |||
void (*Vertex4sv)(const GLshort *); | |||
void (*Viewport)(GLint, GLint, GLsizei, GLsizei); | |||
/* | |||
* OpenGL 1.1 | |||
*/ | |||
#ifdef _GLAPI_VERSION_1_1 | |||
GLboolean (*AreTexturesResident)(GLsizei, const GLuint *, GLboolean *); | |||
void (*ArrayElement)(GLint); | |||
void (*BindTexture)(GLenum, GLuint); | |||
void (*ColorPointer)(GLint, GLenum, GLsizei, const GLvoid *); | |||
void (*CopyTexImage1D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); | |||
void (*CopyTexImage2D)(GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); | |||
void (*CopyTexSubImage1D)(GLenum, GLint, GLint, GLint, GLint, GLsizei); | |||
void (*CopyTexSubImage2D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); | |||
void (*DeleteTextures)(GLsizei, const GLuint *); | |||
void (*DisableClientState)(GLenum); | |||
void (*DrawArrays)(GLenum, GLint, GLsizei); | |||
void (*DrawElements)(GLenum, GLsizei, GLenum, const GLvoid *); | |||
void (*EdgeFlagPointer)(GLsizei, const GLvoid *); | |||
void (*EnableClientState)(GLenum); | |||
void (*GenTextures)(GLsizei, GLuint *); | |||
void (*GetPointerv)(GLenum, GLvoid **); | |||
void (*IndexPointer)(GLenum, GLsizei, const GLvoid *); | |||
void (*Indexub)(GLubyte); | |||
void (*Indexubv)(const GLubyte *); | |||
void (*InterleavedArrays)(GLenum, GLsizei, const GLvoid *); | |||
GLboolean (*IsTexture)(GLuint); | |||
void (*NormalPointer)(GLenum, GLsizei, const GLvoid *); | |||
void (*PopClientAttrib)(void); | |||
void (*PrioritizeTextures)(GLsizei, const GLuint *, const GLclampf *); | |||
void (*PushClientAttrib)(GLbitfield); | |||
void (*TexCoordPointer)(GLint, GLenum, GLsizei, const GLvoid *); | |||
void (*TexSubImage1D)(GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); | |||
void (*TexSubImage2D)(GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); | |||
void (*VertexPointer)(GLint, GLenum, GLsizei, const GLvoid *); | |||
#endif | |||
/* | |||
* OpenGL 1.2 | |||
*/ | |||
#ifdef _GLAPI_VERSION_1_2 | |||
void (*CopyTexSubImage3D)(GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); | |||
void (*DrawRangeElements)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); | |||
void (*TexImage3D)(GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); | |||
void (*TexSubImage3D)(GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); | |||
#ifdef _GLAPI_ARB_imaging | |||
void (*BlendColor)(GLclampf, GLclampf, GLclampf, GLclampf); | |||
void (*BlendEquation)(GLenum); | |||
void (*ColorSubTable)(GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); | |||
void (*ColorTable)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); | |||
void (*ColorTableParameterfv)(GLenum, GLenum, const GLfloat *); | |||
void (*ColorTableParameteriv)(GLenum, GLenum, const GLint *); | |||
void (*ConvolutionFilter1D)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); | |||
void (*ConvolutionFilter2D)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); | |||
void (*ConvolutionParameterf)(GLenum, GLenum, GLfloat); | |||
void (*ConvolutionParameterfv)(GLenum, GLenum, const GLfloat *); | |||
void (*ConvolutionParameteri)(GLenum, GLenum, GLint); | |||
void (*ConvolutionParameteriv)(GLenum, GLenum, const GLint *); | |||
void (*CopyColorSubTable)(GLenum, GLsizei, GLint, GLint, GLsizei); | |||
void (*CopyColorTable)(GLenum, GLenum, GLint, GLint, GLsizei); | |||
void (*CopyConvolutionFilter1D)(GLenum, GLenum, GLint x, GLint y, GLsizei); | |||
void (*CopyConvolutionFilter2D)(GLenum, GLenum, GLint x, GLint y, GLsizei, GLsizei); | |||
void (*GetColorTable)(GLenum, GLenum, GLenum, GLvoid *); | |||
void (*GetColorTableParameterfv)(GLenum, GLenum, GLfloat *); | |||
void (*GetColorTableParameteriv)(GLenum, GLenum, GLint *); | |||
void (*GetConvolutionFilter)(GLenum, GLenum, GLenum, GLvoid *); | |||
void (*GetConvolutionParameterfv)(GLenum, GLenum, GLfloat *); | |||
void (*GetConvolutionParameteriv)(GLenum, GLenum, GLint *); | |||
void (*GetHistogram)(GLenum, GLboolean, GLenum, GLenum, GLvoid *); | |||
void (*GetHistogramParameterfv)(GLenum, GLenum, GLfloat *); | |||
void (*GetHistogramParameteriv)(GLenum, GLenum, GLint *); | |||
void (*GetMinmax)(GLenum, GLboolean, GLenum, GLenum, GLvoid *); | |||
void (*GetMinmaxParameterfv)(GLenum, GLenum, GLfloat *); | |||
void (*GetMinmaxParameteriv)(GLenum, GLenum, GLint *); | |||
void (*GetSeparableFilter)(GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); | |||
void (*Histogram)(GLenum, GLsizei, GLenum, GLboolean); | |||
void (*Minmax)(GLenum, GLenum, GLboolean); | |||
void (*ResetHistogram)(GLenum); | |||
void (*ResetMinmax)(GLenum); | |||
void (*SeparableFilter2D)(GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); | |||
#endif /*_GLAPI_ARB_imaging*/ | |||
#endif /*_GLAPI_VERSION_1_2*/ | |||
/* | |||
* Extensions | |||
*/ | |||
#ifdef _GLAPI_EXT_color_table | |||
void (*ColorTableEXT)(GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); | |||
void (*ColorSubTableEXT)(GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); | |||
void (*GetColorTableEXT)(GLenum, GLenum, GLenum, GLvoid *); | |||
void (*GetColorTableParameterfvEXT)(GLenum, GLenum, GLfloat *); | |||
void (*GetColorTableParameterivEXT)(GLenum, GLenum, GLint *); | |||
#endif | |||
#ifdef _GLAPI_EXT_compiled_vertex_array | |||
void (*LockArraysEXT)(GLint, GLsizei); | |||
void (*UnlockArraysEXT)(void); | |||
#endif | |||
#ifdef _GLAPI_EXT_point_parameters | |||
void (*PointParameterfEXT)(GLenum, GLfloat); | |||
void (*PointParameterfvEXT)(GLenum, const GLfloat *); | |||
#endif | |||
#ifdef _GLAPI_EXT_polygon_offset | |||
void (*PolygonOffsetEXT)(GLfloat, GLfloat); | |||
#endif | |||
#ifdef _GLAPI_EXT_blend_minmax | |||
void (*BlendEquationEXT)(GLenum); | |||
#endif | |||
#ifdef _GLAPI_EXT_blend_color | |||
void (*BlendColorEXT)(GLclampf, GLclampf, GLclampf, GLclampf); | |||
#endif | |||
#ifdef _GLAPI_ARB_multitexture | |||
void (*ActiveTextureARB)(GLenum); | |||
void (*ClientActiveTextureARB)(GLenum); | |||
void (*MultiTexCoord1dARB)(GLenum, GLdouble); | |||
void (*MultiTexCoord1dvARB)(GLenum, const GLdouble *); | |||
void (*MultiTexCoord1fARB)(GLenum, GLfloat); | |||
void (*MultiTexCoord1fvARB)(GLenum, const GLfloat *); | |||
void (*MultiTexCoord1iARB)(GLenum, GLint); | |||
void (*MultiTexCoord1ivARB)(GLenum, const GLint *); | |||
void (*MultiTexCoord1sARB)(GLenum, GLshort); | |||
void (*MultiTexCoord1svARB)(GLenum, const GLshort *); | |||
void (*MultiTexCoord2dARB)(GLenum, GLdouble, GLdouble); | |||
void (*MultiTexCoord2dvARB)(GLenum, const GLdouble *); | |||
void (*MultiTexCoord2fARB)(GLenum, GLfloat, GLfloat); | |||
void (*MultiTexCoord2fvARB)(GLenum, const GLfloat *); | |||
void (*MultiTexCoord2iARB)(GLenum, GLint, GLint); | |||
void (*MultiTexCoord2ivARB)(GLenum, const GLint *); | |||
void (*MultiTexCoord2sARB)(GLenum, GLshort, GLshort); | |||
void (*MultiTexCoord2svARB)(GLenum, const GLshort *); | |||
void (*MultiTexCoord3dARB)(GLenum, GLdouble, GLdouble, GLdouble); | |||
void (*MultiTexCoord3dvARB)(GLenum, const GLdouble *); | |||
void (*MultiTexCoord3fARB)(GLenum, GLfloat, GLfloat, GLfloat); | |||
void (*MultiTexCoord3fvARB)(GLenum, const GLfloat *); | |||
void (*MultiTexCoord3iARB)(GLenum, GLint, GLint, GLint); | |||
void (*MultiTexCoord3ivARB)(GLenum, const GLint *); | |||
void (*MultiTexCoord3sARB)(GLenum, GLshort, GLshort, GLshort); | |||
void (*MultiTexCoord3svARB)(GLenum, const GLshort *); | |||
void (*MultiTexCoord4dARB)(GLenum, GLdouble, GLdouble, GLdouble, GLdouble); | |||
void (*MultiTexCoord4dvARB)(GLenum, const GLdouble *); | |||
void (*MultiTexCoord4fARB)(GLenum, GLfloat, GLfloat, GLfloat, GLfloat); | |||
void (*MultiTexCoord4fvARB)(GLenum, const GLfloat *); | |||
void (*MultiTexCoord4iARB)(GLenum, GLint, GLint, GLint, GLint); | |||
void (*MultiTexCoord4ivARB)(GLenum, const GLint *); | |||
void (*MultiTexCoord4sARB)(GLenum, GLshort, GLshort, GLshort, GLshort); | |||
void (*MultiTexCoord4svARB)(GLenum, const GLshort *); | |||
#endif | |||
#ifdef _GLAPI_INGR_blend_func_separate | |||
void (*BlendFuncSeparateINGR)(GLenum, GLenum, GLenum, GLenum); | |||
#endif | |||
#ifdef _GLAPI_MESA_window_pos | |||
void (*WindowPos4fMESA)(GLfloat x, GLfloat y, GLfloat z, GLfloat w); | |||
#endif | |||
#ifdef _GLAPI_MESA_resize_buffers | |||
void (*ResizeBuffersMESA)(void); | |||
#endif | |||
}; | |||
extern void | |||
_glapi_set_dispatch(struct _glapi_table *dispatch); | |||
extern struct _glapi_table * | |||
_glapi_get_dispatch(void); | |||
extern const char * | |||
_glapi_get_version(void); | |||
extern const char * | |||
_glapi_get_extensions(void); | |||
extern void | |||
_glapi_check_table(const struct _glapi_table *table); | |||
extern GLint | |||
_glapi_alloc_entrypoint(const char *funcName); | |||
extern GLint | |||
_glapi_get_entrypoint(const char *funcName); | |||
extern const GLvoid * | |||
_glapi_get_proc_address(const char *funcName); | |||
#endif |
@@ -1,7 +1,7 @@ | |||
# $Id: Makefile.X11,v 1.6 1999/10/08 09:27:09 keithw Exp $ | |||
# $Id: Makefile.X11,v 1.7 1999/11/11 01:22:28 brianp Exp $ | |||
# Mesa 3-D graphics library | |||
# Version: 3.1 | |||
# Version: 3.3 | |||
# Copyright (C) 1995-1999 Brian Paul | |||
# Makefile for core library | |||
@@ -18,13 +18,13 @@ VPATH = RCS | |||
INCDIR = ../include | |||
LIBDIR = ../lib | |||
CORE_SOURCES = \ | |||
glapi.c \ | |||
glapinoop.c \ | |||
accum.c \ | |||
alpha.c \ | |||
alphabuf.c \ | |||
api1.c \ | |||
api2.c \ | |||
apiext.c \ | |||
attrib.c \ | |||
bbox.c \ | |||
bitmap.c \ | |||
@@ -37,6 +37,7 @@ CORE_SOURCES = \ | |||
cva.c \ | |||
debug_xform.c \ | |||
depth.c \ | |||
dispatch.c \ | |||
dlist.c \ | |||
drawpix.c \ | |||
enable.c \ | |||
@@ -49,18 +50,19 @@ CORE_SOURCES = \ | |||
glmisc.c \ | |||
hash.c \ | |||
image.c \ | |||
imaging.c \ | |||
light.c \ | |||
lines.c \ | |||
logic.c \ | |||
masking.c \ | |||
matrix.c \ | |||
mem.c \ | |||
mmath.c \ | |||
mthreads.c \ | |||
pb.c \ | |||
pixel.c \ | |||
pipeline.c \ | |||
points.c \ | |||
pointers.c \ | |||
polygon.c \ | |||
quads.c \ | |||
rastpos.c \ |
@@ -1,4 +1,4 @@ | |||
/* $Id: accum.c,v 1.10 1999/11/08 07:36:43 brianp Exp $ */ | |||
/* $Id: accum.c,v 1.11 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -25,22 +25,13 @@ | |||
*/ | |||
/* $XFree86: xc/lib/GL/mesa/src/accum.c,v 1.3 1999/04/04 00:20:17 dawes Exp $ */ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <limits.h> | |||
#include <stdlib.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "accum.h" | |||
#include "context.h" | |||
#include "macros.h" | |||
#include "mem.h" | |||
#include "masking.h" | |||
#include "span.h" | |||
#include "types.h" | |||
@@ -101,9 +92,10 @@ void gl_alloc_accum_buffer( GLcontext *ctx ) | |||
void gl_ClearAccum( GLcontext *ctx, | |||
GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) | |||
void | |||
_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glAccum"); | |||
ctx->Accum.ClearColor[0] = CLAMP( red, -1.0, 1.0 ); | |||
@@ -139,8 +131,10 @@ static void rescale_accum( GLcontext *ctx ) | |||
void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value ) | |||
void | |||
_mesa_Accum( GLenum op, GLfloat value ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint xpos, ypos, width, height, width4; | |||
GLfloat acc_scale; | |||
GLubyte rgba[MAX_WIDTH][4]; |
@@ -1,4 +1,4 @@ | |||
/* $Id: accum.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: accum.h,v 1.2 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -38,14 +38,15 @@ | |||
extern void gl_alloc_accum_buffer( GLcontext *ctx ); | |||
extern void gl_Accum( GLcontext *ctx, GLenum op, GLfloat value ); | |||
extern void gl_clear_accum_buffer( GLcontext *ctx ); | |||
extern void gl_ClearAccum( GLcontext *ctx, GLfloat red, GLfloat green, | |||
GLfloat blue, GLfloat alpha ); | |||
extern void | |||
_mesa_Accum( GLenum op, GLfloat value ); | |||
extern void gl_clear_accum_buffer( GLcontext *ctx ); | |||
extern void | |||
_mesa_ClearAccum( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ); | |||
#endif |
@@ -1,4 +1,4 @@ | |||
/* $Id: attrib.c,v 1.10 1999/11/08 15:28:08 brianp Exp $ */ | |||
/* $Id: attrib.c,v 1.11 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -25,23 +25,16 @@ | |||
*/ | |||
#include <stdlib.h> | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <stdio.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "attrib.h" | |||
#include "context.h" | |||
#include "glmisc.h" | |||
#include "enable.h" | |||
#include "enums.h" | |||
#include "macros.h" | |||
#include "mem.h" | |||
#include "simple_list.h" | |||
#include "texstate.h" | |||
#include "types.h" | |||
@@ -92,11 +85,7 @@ static void copy_texobj_state( struct gl_texture_object *dest, | |||
dest->P = src->P; | |||
dest->M = src->M; | |||
dest->MinMagThresh = src->MinMagThresh; | |||
memcpy( dest->Palette, src->Palette, | |||
sizeof(GLubyte) * MAX_TEXTURE_PALETTE_SIZE * 4 ); | |||
dest->PaletteSize = src->PaletteSize; | |||
dest->PaletteIntFormat = src->PaletteIntFormat; | |||
dest->PaletteFormat = src->PaletteFormat; | |||
dest->Palette = src->Palette; | |||
dest->Complete = src->Complete; | |||
dest->SampleFunc = src->SampleFunc; | |||
} | |||
@@ -431,7 +420,7 @@ void gl_PopAttrib( GLcontext* ctx ) | |||
MEMCPY( &ctx->Color, attr->data, | |||
sizeof(struct gl_colorbuffer_attrib) ); | |||
if (ctx->Color.DrawBuffer != oldDrawBuffer) { | |||
gl_DrawBuffer(ctx, ctx->Color.DrawBuffer); | |||
_mesa_DrawBuffer( ctx->Color.DrawBuffer); | |||
} | |||
if ((ctx->Color.AlphaFunc != oldAlphaFunc || | |||
ctx->Color.AlphaRef != oldAlphaRef) && | |||
@@ -471,7 +460,7 @@ void gl_PopAttrib( GLcontext* ctx ) | |||
#define TEST_AND_UPDATE(VALUE, NEWVALUE, ENUM) \ | |||
if ((VALUE) != (NEWVALUE)) { \ | |||
gl_set_enable( ctx, ENUM, (NEWVALUE) ); \ | |||
_mesa_set_enable( ctx, ENUM, (NEWVALUE) ); \ | |||
} | |||
TEST_AND_UPDATE(ctx->Color.AlphaEnabled, enable->AlphaTest, GL_ALPHA_TEST); | |||
@@ -481,7 +470,7 @@ void gl_PopAttrib( GLcontext* ctx ) | |||
GLuint i; | |||
for (i=0;i<MAX_CLIP_PLANES;i++) { | |||
if (ctx->Transform.ClipEnabled[i] != enable->ClipPlane[i]) | |||
gl_set_enable( ctx, (GLenum) (GL_CLIP_PLANE0 + i), enable->ClipPlane[i] ); | |||
_mesa_set_enable( ctx, (GLenum) (GL_CLIP_PLANE0 + i), enable->ClipPlane[i] ); | |||
} | |||
} | |||
TEST_AND_UPDATE(ctx->Light.ColorMaterialEnabled, enable->ColorMaterial, GL_COLOR_MATERIAL); | |||
@@ -742,8 +731,8 @@ void gl_PopAttrib( GLcontext* ctx ) | |||
struct gl_viewport_attrib *v = | |||
(struct gl_viewport_attrib *)attr->data; | |||
gl_Viewport( ctx, v->X, v->Y, v->Width, v->Height ); | |||
gl_DepthRange( ctx, v->Near, v->Far ); | |||
_mesa_Viewport( v->X, v->Y, v->Width, v->Height ); | |||
_mesa_DepthRange( v->Near, v->Far ); | |||
break; | |||
} | |||
default: | |||
@@ -857,3 +846,37 @@ void gl_PopClientAttrib( GLcontext *ctx ) | |||
ctx->NewState = NEW_ALL; | |||
} | |||
void | |||
_mesa_PushAttrib( GLbitfield mask ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
gl_PushAttrib(ctx, mask); | |||
} | |||
void | |||
_mesa_PopAttrib( void ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
gl_PopAttrib(ctx); | |||
} | |||
void | |||
_mesa_PushClientAttrib( GLbitfield mask ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
gl_PushClientAttrib(ctx, mask); | |||
} | |||
void | |||
_mesa_PopClientAttrib( void ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
gl_PopClientAttrib(ctx); | |||
} | |||
@@ -1,8 +1,8 @@ | |||
/* $Id: attrib.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: attrib.h,v 1.2 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef ATTRIB_H | |||
#define ATTRIB_h | |||
@@ -44,4 +41,17 @@ extern void gl_PushClientAttrib( GLcontext *ctx, GLbitfield mask ); | |||
extern void gl_PopClientAttrib( GLcontext *ctx ); | |||
extern void | |||
_mesa_PushAttrib( GLbitfield mask ); | |||
extern void | |||
_mesa_PopAttrib( void ); | |||
extern void | |||
_mesa_PushClientAttrib( GLbitfield mask ); | |||
extern void | |||
_mesa_PopClientAttrib( void ); | |||
#endif |
@@ -1,4 +1,4 @@ | |||
/* $Id: blend.c,v 1.7 1999/11/08 15:28:08 brianp Exp $ */ | |||
/* $Id: blend.c,v 1.8 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -29,13 +29,7 @@ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <stdio.h> | |||
#include <assert.h> | |||
#include <stdlib.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "alphabuf.h" | |||
#include "blend.h" | |||
#include "context.h" | |||
@@ -47,8 +41,9 @@ | |||
#endif | |||
void gl_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor ) | |||
void _mesa_BlendFunc( GLenum sfactor, GLenum dfactor ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBlendFunc"); | |||
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) | |||
@@ -108,9 +103,10 @@ void gl_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor ) | |||
/* GL_INGR_blend_func_separate */ | |||
void | |||
gl_BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB, | |||
GLenum sfactorA, GLenum dfactorA ) | |||
_mesa_BlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactorRGB, | |||
GLenum sfactorA, GLenum dfactorA ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBlendFuncSeparate"); | |||
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) | |||
@@ -214,8 +210,10 @@ gl_BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB, | |||
/* This is really an extension function! */ | |||
void gl_BlendEquation( GLcontext *ctx, GLenum mode ) | |||
void | |||
_mesa_BlendEquationEXT( GLenum mode ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glBlendEquation"); | |||
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) | |||
@@ -256,9 +254,10 @@ void gl_BlendEquation( GLcontext *ctx, GLenum mode ) | |||
void gl_BlendColor( GLcontext *ctx, GLclampf red, GLclampf green, | |||
GLclampf blue, GLclampf alpha ) | |||
void | |||
_mesa_BlendColorEXT( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ctx->Color.BlendColor[0] = CLAMP( red, 0.0F, 1.0F ); | |||
ctx->Color.BlendColor[1] = CLAMP( green, 0.0F, 1.0F ); | |||
ctx->Color.BlendColor[2] = CLAMP( blue, 0.0F, 1.0F ); |
@@ -1,4 +1,4 @@ | |||
/* $Id: blend.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: blend.h,v 1.2 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef BLEND_H | |||
#define BLEND_H | |||
@@ -48,21 +45,20 @@ gl_blend_pixels( GLcontext *ctx, | |||
extern void | |||
gl_BlendFunc( GLcontext *ctx, GLenum sfactor, GLenum dfactor ); | |||
_mesa_BlendFunc( GLenum sfactor, GLenum dfactor ); | |||
extern void | |||
gl_BlendFuncSeparate( GLcontext *ctx, GLenum sfactorRGB, GLenum dfactorRGB, | |||
GLenum sfactorA, GLenum dfactorA ); | |||
_mesa_BlendFuncSeparateINGR( GLenum sfactorRGB, GLenum dfactorRGB, | |||
GLenum sfactorA, GLenum dfactorA ); | |||
extern void | |||
gl_BlendEquation( GLcontext *ctx, GLenum mode ); | |||
_mesa_BlendEquationEXT( GLenum mode ); | |||
extern void | |||
gl_BlendColor( GLcontext *ctx, GLclampf red, GLclampf green, | |||
GLclampf blue, GLclampf alpha ); | |||
_mesa_BlendColorEXT(GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: clip.c,v 1.4 1999/11/08 07:36:43 brianp Exp $ */ | |||
/* $Id: clip.c,v 1.5 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,18 +25,10 @@ | |||
*/ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <string.h> | |||
#include <stdlib.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "clip.h" | |||
#include "context.h" | |||
#include "macros.h" | |||
@@ -130,9 +122,17 @@ static clip_interp_func clip_interp_tab[0x40]; | |||
void gl_ClipPlane( GLcontext* ctx, GLenum plane, const GLfloat *equation ) | |||
void | |||
_mesa_ClipPlane( GLenum plane, const GLdouble *eq ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint p; | |||
GLfloat equation[4]; | |||
equation[0] = eq[0]; | |||
equation[1] = eq[1]; | |||
equation[2] = eq[2]; | |||
equation[3] = eq[3]; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClipPlane"); | |||
@@ -183,8 +183,10 @@ void gl_update_userclip( GLcontext *ctx ) | |||
} | |||
} | |||
void gl_GetClipPlane( GLcontext* ctx, GLenum plane, GLdouble *equation ) | |||
void | |||
_mesa_GetClipPlane( GLenum plane, GLdouble *equation ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint p; | |||
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetClipPlane"); |
@@ -1,4 +1,4 @@ | |||
/* $Id: clip.h,v 1.2 1999/09/18 20:41:22 keithw Exp $ */ | |||
/* $Id: clip.h,v 1.3 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -63,11 +63,9 @@ extern GLuint gl_userclip_point( GLcontext* ctx, const GLfloat v[] ); | |||
extern void gl_user_cliptest( struct vertex_buffer *VB ); | |||
extern void gl_ClipPlane( GLcontext* ctx, | |||
GLenum plane, const GLfloat *equation ); | |||
extern void _mesa_ClipPlane( GLenum plane, const GLdouble *equation ); | |||
extern void gl_GetClipPlane( GLcontext* ctx, | |||
GLenum plane, GLdouble *equation ); | |||
extern void _mesa_GetClipPlane( GLenum plane, GLdouble *equation ); | |||
/* |
@@ -1,4 +1,4 @@ | |||
/* $Id: colortab.c,v 1.3 1999/11/08 07:36:43 brianp Exp $ */ | |||
/* $Id: colortab.c,v 1.4 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -23,20 +23,15 @@ | |||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
*/ | |||
/* $XFree86: xc/lib/GL/mesa/src/colortab.c,v 1.2 1999/04/04 00:20:21 dawes Exp $ */ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifdef XFree86Server | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "colortab.h" | |||
#include "context.h" | |||
#include "image.h" | |||
#include "macros.h" | |||
#endif | |||
@@ -45,7 +40,8 @@ | |||
/* | |||
* Return GL_TRUE if k is a power of two, else return GL_FALSE. | |||
*/ | |||
static GLboolean power_of_two( GLint k ) | |||
static GLboolean | |||
power_of_two( GLint k ) | |||
{ | |||
GLint i, m = 1; | |||
for (i=0; i<32; i++) { | |||
@@ -57,7 +53,8 @@ static GLboolean power_of_two( GLint k ) | |||
} | |||
static GLint decode_internal_format( GLint format ) | |||
static GLint | |||
decode_internal_format( GLint format ) | |||
{ | |||
switch (format) { | |||
case GL_ALPHA: | |||
@@ -114,81 +111,95 @@ static GLint decode_internal_format( GLint format ) | |||
} | |||
void gl_ColorTable( GLcontext *ctx, GLenum target, | |||
GLenum internalFormat, struct gl_image *table ) | |||
void | |||
_mesa_ColorTable( GLenum target, GLenum internalFormat, | |||
GLsizei width, GLenum format, GLenum type, | |||
const GLvoid *table ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
struct gl_texture_object *texObj; | |||
struct gl_palette *palette; | |||
GLboolean proxy = GL_FALSE; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glColorTable"); | |||
if (decode_internal_format(internalFormat) < 0) { | |||
gl_error( ctx, GL_INVALID_ENUM, "glColorTable(internalFormat)" ); | |||
return; | |||
} | |||
switch (target) { | |||
case GL_TEXTURE_1D: | |||
texObj = texUnit->CurrentD[1]; | |||
palette = &texObj->Palette; | |||
break; | |||
case GL_TEXTURE_2D: | |||
texObj = texUnit->CurrentD[2]; | |||
palette = &texObj->Palette; | |||
break; | |||
case GL_TEXTURE_3D_EXT: | |||
case GL_TEXTURE_3D: | |||
texObj = texUnit->CurrentD[3]; | |||
palette = &texObj->Palette; | |||
break; | |||
case GL_PROXY_TEXTURE_1D: | |||
texObj = ctx->Texture.Proxy1D; | |||
palette = &texObj->Palette; | |||
proxy = GL_TRUE; | |||
break; | |||
case GL_PROXY_TEXTURE_2D: | |||
texObj = ctx->Texture.Proxy2D; | |||
palette = &texObj->Palette; | |||
proxy = GL_TRUE; | |||
break; | |||
case GL_PROXY_TEXTURE_3D_EXT: | |||
case GL_PROXY_TEXTURE_3D: | |||
texObj = ctx->Texture.Proxy3D; | |||
palette = &texObj->Palette; | |||
proxy = GL_TRUE; | |||
break; | |||
case GL_SHARED_TEXTURE_PALETTE_EXT: | |||
texObj = NULL; | |||
palette = &ctx->Texture.Palette; | |||
break; | |||
default: | |||
gl_error(ctx, GL_INVALID_ENUM, "glColorTableEXT(target)"); | |||
gl_error(ctx, GL_INVALID_ENUM, "glColorTable(target)"); | |||
return; | |||
} | |||
/* internalformat = just like glTexImage */ | |||
assert(palette); | |||
if (!gl_is_legal_format_and_type(format, type)) { | |||
gl_error(ctx, GL_INVALID_ENUM, "glColorTable(format or type)"); | |||
return; | |||
} | |||
if (decode_internal_format(internalFormat) < 0) { | |||
gl_error( ctx, GL_INVALID_ENUM, "glColorTable(internalFormat)" ); | |||
return; | |||
} | |||
if (table->Width < 1 || table->Width > MAX_TEXTURE_PALETTE_SIZE | |||
|| !power_of_two(table->Width)) { | |||
gl_error(ctx, GL_INVALID_VALUE, "glColorTableEXT(width)"); | |||
if (width < 1 || width > MAX_TEXTURE_PALETTE_SIZE || !power_of_two(width)) { | |||
gl_error(ctx, GL_INVALID_VALUE, "glColorTable(width)"); | |||
if (proxy) { | |||
texObj->PaletteSize = 0; | |||
texObj->PaletteIntFormat = (GLenum) 0; | |||
texObj->PaletteFormat = (GLenum) 0; | |||
palette->Size = 0; | |||
palette->IntFormat = (GLenum) 0; | |||
palette->Format = (GLenum) 0; | |||
} | |||
return; | |||
} | |||
palette->Size = width; | |||
palette->IntFormat = internalFormat; | |||
palette->Format = (GLenum) decode_internal_format(internalFormat); | |||
if (!proxy) { | |||
_mesa_unpack_ubyte_color_span(ctx, width, palette->Format, | |||
palette->Table, /* dest */ | |||
format, type, table, | |||
&ctx->Unpack, GL_FALSE); | |||
} | |||
if (texObj) { | |||
/* per-texture object palette */ | |||
texObj->PaletteSize = table->Width; | |||
texObj->PaletteIntFormat = internalFormat; | |||
texObj->PaletteFormat = (GLenum) decode_internal_format(internalFormat); | |||
if (!proxy) { | |||
MEMCPY(texObj->Palette, table->Data, table->Width*table->Components); | |||
if (ctx->Driver.UpdateTexturePalette) { | |||
(*ctx->Driver.UpdateTexturePalette)( ctx, texObj ); | |||
} | |||
if (ctx->Driver.UpdateTexturePalette) { | |||
(*ctx->Driver.UpdateTexturePalette)( ctx, texObj ); | |||
} | |||
} | |||
else { | |||
/* shared texture palette */ | |||
ctx->Texture.PaletteSize = table->Width; | |||
ctx->Texture.PaletteIntFormat = internalFormat; | |||
ctx->Texture.PaletteFormat = (GLenum) decode_internal_format(internalFormat); | |||
MEMCPY(ctx->Texture.Palette, table->Data, table->Width*table->Components); | |||
if (ctx->Driver.UpdateTexturePalette) { | |||
(*ctx->Driver.UpdateTexturePalette)( ctx, NULL ); | |||
} | |||
@@ -197,38 +208,172 @@ void gl_ColorTable( GLcontext *ctx, GLenum target, | |||
void gl_ColorSubTable( GLcontext *ctx, GLenum target, | |||
GLsizei start, struct gl_image *data ) | |||
void | |||
_mesa_ColorSubTable( GLenum target, GLsizei start, | |||
GLsizei count, GLenum format, GLenum type, | |||
const GLvoid *table ) | |||
{ | |||
/* XXX TODO */ | |||
gl_problem(ctx, "glColorSubTableEXT not implemented"); | |||
(void) target; | |||
(void) start; | |||
(void) data; | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
struct gl_texture_object *texObj; | |||
struct gl_palette *palette; | |||
GLint comps; | |||
GLubyte *dest; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glColorSubTable"); | |||
switch (target) { | |||
case GL_TEXTURE_1D: | |||
texObj = texUnit->CurrentD[1]; | |||
palette = &texObj->Palette; | |||
break; | |||
case GL_TEXTURE_2D: | |||
texObj = texUnit->CurrentD[2]; | |||
palette = &texObj->Palette; | |||
break; | |||
case GL_TEXTURE_3D: | |||
texObj = texUnit->CurrentD[3]; | |||
palette = &texObj->Palette; | |||
break; | |||
case GL_SHARED_TEXTURE_PALETTE_EXT: | |||
texObj = NULL; | |||
palette = &ctx->Texture.Palette; | |||
break; | |||
default: | |||
gl_error(ctx, GL_INVALID_ENUM, "glColorSubTable(target)"); | |||
return; | |||
} | |||
assert(palette); | |||
if (!gl_is_legal_format_and_type(format, type)) { | |||
gl_error(ctx, GL_INVALID_ENUM, "glColorSubTable(format or type)"); | |||
return; | |||
} | |||
if (count < 1) { | |||
gl_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)"); | |||
return; | |||
} | |||
comps = gl_components_in_format(format); | |||
assert(comps > 0); /* error should be caught sooner */ | |||
if (start + count > palette->Size) { | |||
gl_error(ctx, GL_INVALID_VALUE, "glColorSubTable(count)"); | |||
return; | |||
} | |||
dest = palette->Table + start * comps * sizeof(GLubyte); | |||
_mesa_unpack_ubyte_color_span(ctx, count, palette->Format, dest, | |||
format, type, table, | |||
&ctx->Unpack, GL_FALSE); | |||
if (texObj) { | |||
/* per-texture object palette */ | |||
if (ctx->Driver.UpdateTexturePalette) { | |||
(*ctx->Driver.UpdateTexturePalette)( ctx, texObj ); | |||
} | |||
} | |||
else { | |||
/* shared texture palette */ | |||
if (ctx->Driver.UpdateTexturePalette) { | |||
(*ctx->Driver.UpdateTexturePalette)( ctx, NULL ); | |||
} | |||
} | |||
} | |||
void gl_GetColorTable( GLcontext *ctx, GLenum target, GLenum format, | |||
GLenum type, GLvoid *table ) | |||
void | |||
_mesa_GetColorTable( GLenum target, GLenum format, | |||
GLenum type, GLvoid *table ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
struct gl_palette *palette; | |||
GLubyte rgba[MAX_TEXTURE_PALETTE_SIZE][4]; | |||
GLint i; | |||
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetBooleanv"); | |||
switch (target) { | |||
case GL_TEXTURE_1D: | |||
palette = &texUnit->CurrentD[1]->Palette; | |||
break; | |||
case GL_TEXTURE_2D: | |||
palette = &texUnit->CurrentD[2]->Palette; | |||
break; | |||
case GL_TEXTURE_3D_EXT: | |||
case GL_TEXTURE_3D: | |||
palette = &texUnit->CurrentD[3]->Palette; | |||
break; | |||
case GL_SHARED_TEXTURE_PALETTE_EXT: | |||
palette = &ctx->Texture.Palette; | |||
break; | |||
default: | |||
gl_error(ctx, GL_INVALID_ENUM, "glGetColorTable(target)"); | |||
return; | |||
} | |||
assert(palette); | |||
switch (palette->Format) { | |||
case GL_ALPHA: | |||
for (i = 0; i < palette->Size; i++) { | |||
rgba[i][RCOMP] = 0; | |||
rgba[i][GCOMP] = 0; | |||
rgba[i][BCOMP] = 0; | |||
rgba[i][ACOMP] = palette->Table[i]; | |||
} | |||
break; | |||
case GL_LUMINANCE: | |||
for (i = 0; i < palette->Size; i++) { | |||
rgba[i][RCOMP] = palette->Table[i]; | |||
rgba[i][GCOMP] = palette->Table[i]; | |||
rgba[i][BCOMP] = palette->Table[i]; | |||
rgba[i][ACOMP] = 255; | |||
} | |||
break; | |||
case GL_LUMINANCE_ALPHA: | |||
for (i = 0; i < palette->Size; i++) { | |||
rgba[i][RCOMP] = palette->Table[i*2+0]; | |||
rgba[i][GCOMP] = palette->Table[i*2+0]; | |||
rgba[i][BCOMP] = palette->Table[i*2+0]; | |||
rgba[i][ACOMP] = palette->Table[i*2+1]; | |||
} | |||
break; | |||
case GL_INTENSITY: | |||
for (i = 0; i < palette->Size; i++) { | |||
rgba[i][RCOMP] = palette->Table[i]; | |||
rgba[i][GCOMP] = palette->Table[i]; | |||
rgba[i][BCOMP] = palette->Table[i]; | |||
rgba[i][ACOMP] = 255; | |||
} | |||
break; | |||
case GL_RGB: | |||
for (i = 0; i < palette->Size; i++) { | |||
rgba[i][RCOMP] = palette->Table[i*3+0]; | |||
rgba[i][GCOMP] = palette->Table[i*3+1]; | |||
rgba[i][BCOMP] = palette->Table[i*3+2]; | |||
rgba[i][ACOMP] = 255; | |||
} | |||
break; | |||
case GL_RGBA: | |||
for (i = 0; i < palette->Size; i++) { | |||
rgba[i][RCOMP] = palette->Table[i*4+0]; | |||
rgba[i][GCOMP] = palette->Table[i*4+1]; | |||
rgba[i][BCOMP] = palette->Table[i*4+2]; | |||
rgba[i][ACOMP] = palette->Table[i*4+3]; | |||
} | |||
break; | |||
default: | |||
gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableEXT(target)"); | |||
gl_problem(ctx, "bad palette format in glGetColorTable"); | |||
return; | |||
} | |||
gl_problem(ctx, "glGetColorTableEXT not implemented!"); | |||
gl_pack_rgba_span(ctx, palette->Size, (const GLubyte (*)[]) rgba, | |||
format, type, table, &ctx->Pack, GL_FALSE); | |||
gl_problem(ctx, "glGetColorTable not implemented!"); | |||
(void) format; | |||
(void) type; | |||
(void) table; | |||
@@ -236,37 +381,37 @@ void gl_GetColorTable( GLcontext *ctx, GLenum target, GLenum format, | |||
void gl_GetColorTableParameterfv( GLcontext *ctx, GLenum target, | |||
GLenum pname, GLfloat *params ) | |||
void | |||
_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ) | |||
{ | |||
GLint iparams[10]; | |||
gl_GetColorTableParameteriv( ctx, target, pname, iparams ); | |||
_mesa_GetColorTableParameteriv( target, pname, iparams ); | |||
*params = (GLfloat) iparams[0]; | |||
} | |||
void gl_GetColorTableParameteriv( GLcontext *ctx, GLenum target, | |||
GLenum pname, GLint *params ) | |||
void | |||
_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
struct gl_texture_object *texObj; | |||
struct gl_palette *palette; | |||
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetColorTableParameter"); | |||
switch (target) { | |||
case GL_TEXTURE_1D: | |||
texObj = texUnit->CurrentD[1]; | |||
palette = &texUnit->CurrentD[1]->Palette; | |||
break; | |||
case GL_TEXTURE_2D: | |||
texObj = texUnit->CurrentD[2]; | |||
palette = &texUnit->CurrentD[2]->Palette; | |||
break; | |||
case GL_TEXTURE_3D_EXT: | |||
texObj = texUnit->CurrentD[3]; | |||
case GL_TEXTURE_3D: | |||
palette = &texUnit->CurrentD[3]->Palette; | |||
break; | |||
case GL_SHARED_TEXTURE_PALETTE_EXT: | |||
texObj = NULL; | |||
palette = &ctx->Texture.Palette; | |||
break; | |||
default: | |||
gl_error(ctx, GL_INVALID_ENUM, "glGetColorTableParameter(target)"); | |||
@@ -274,34 +419,28 @@ void gl_GetColorTableParameteriv( GLcontext *ctx, GLenum target, | |||
} | |||
switch (pname) { | |||
case GL_COLOR_TABLE_FORMAT_EXT: | |||
if (texObj) | |||
*params = texObj->PaletteIntFormat; | |||
else | |||
*params = ctx->Texture.PaletteIntFormat; | |||
break; | |||
case GL_COLOR_TABLE_WIDTH_EXT: | |||
if (texObj) | |||
*params = texObj->PaletteSize; | |||
else | |||
*params = ctx->Texture.PaletteSize; | |||
break; | |||
case GL_COLOR_TABLE_RED_SIZE_EXT: | |||
case GL_COLOR_TABLE_FORMAT: | |||
*params = palette->IntFormat; | |||
break; | |||
case GL_COLOR_TABLE_WIDTH: | |||
*params = palette->Size; | |||
break; | |||
case GL_COLOR_TABLE_RED_SIZE: | |||
*params = 8; | |||
break; | |||
case GL_COLOR_TABLE_GREEN_SIZE_EXT: | |||
case GL_COLOR_TABLE_GREEN_SIZE: | |||
*params = 8; | |||
break; | |||
case GL_COLOR_TABLE_BLUE_SIZE_EXT: | |||
case GL_COLOR_TABLE_BLUE_SIZE: | |||
*params = 8; | |||
break; | |||
case GL_COLOR_TABLE_ALPHA_SIZE_EXT: | |||
case GL_COLOR_TABLE_ALPHA_SIZE: | |||
*params = 8; | |||
break; | |||
case GL_COLOR_TABLE_LUMINANCE_SIZE_EXT: | |||
case GL_COLOR_TABLE_LUMINANCE_SIZE: | |||
*params = 8; | |||
break; | |||
case GL_COLOR_TABLE_INTENSITY_SIZE_EXT: | |||
case GL_COLOR_TABLE_INTENSITY_SIZE: | |||
*params = 8; | |||
break; | |||
default: |
@@ -1,4 +1,4 @@ | |||
/* $Id: colortab.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: colortab.h,v 1.2 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef COLORTAB_H | |||
#define COLORTAB_H | |||
@@ -35,21 +32,25 @@ | |||
#include "types.h" | |||
extern void gl_ColorTable( GLcontext *ctx, GLenum target, | |||
GLenum internalformat, | |||
struct gl_image *table ); | |||
extern void | |||
_mesa_ColorTable( GLenum target, GLenum internalformat, | |||
GLsizei width, GLenum format, GLenum type, | |||
const GLvoid *table ); | |||
extern void gl_ColorSubTable( GLcontext *ctx, GLenum target, | |||
GLsizei start, struct gl_image *data ); | |||
extern void | |||
_mesa_ColorSubTable( GLenum target, GLsizei start, | |||
GLsizei count, GLenum format, GLenum type, | |||
const GLvoid *table ); | |||
extern void gl_GetColorTable( GLcontext *ctx, GLenum target, GLenum format, | |||
GLenum type, GLvoid *table ); | |||
extern void | |||
_mesa_GetColorTable( GLenum target, GLenum format, | |||
GLenum type, GLvoid *table ); | |||
extern void gl_GetColorTableParameterfv( GLcontext *ctx, GLenum target, | |||
GLenum pname, GLfloat *params ); | |||
extern void | |||
_mesa_GetColorTableParameterfv( GLenum target, GLenum pname, GLfloat *params ); | |||
extern void gl_GetColorTableParameteriv( GLcontext *ctx, GLenum target, | |||
GLenum pname, GLint *params ); | |||
extern void | |||
_mesa_GetColorTableParameteriv( GLenum target, GLenum pname, GLint *params ); | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: config.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: config.h,v 1.2 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,10 +25,6 @@ | |||
*/ | |||
/* | |||
* Tunable configuration parameters. | |||
*/ | |||
@@ -42,13 +38,11 @@ | |||
#include "conf.h" | |||
#endif | |||
/* | |||
* | |||
* OpenGL implementation limits | |||
* | |||
*/ | |||
/* Maximum modelview matrix stack depth: */ | |||
#define MAX_MODELVIEW_STACK_DEPTH 32 | |||
@@ -116,10 +110,9 @@ | |||
#define MAX_ARRAY_LOCK_SIZE 3000 | |||
/* | |||
* | |||
* Mesa-specific parameters | |||
* | |||
*/ | |||
@@ -129,6 +122,9 @@ | |||
#define ACCUM_BITS 16 | |||
/* | |||
* Bits per depth buffer value: 16 or 32 | |||
*/ | |||
#ifdef MESAD3D | |||
/* Mesa / Direct3D driver only */ | |||
extern float g_DepthScale, g_MaxDepth; | |||
@@ -136,9 +132,6 @@ | |||
# define DEPTH_SCALE g_DepthScale | |||
# define MAX_DEPTH g_MaxDepth | |||
#else | |||
/* | |||
* Bits per depth buffer value: 16 or 32 | |||
*/ | |||
# define DEPTH_BITS 16 | |||
# if DEPTH_BITS==16 | |||
# define MAX_DEPTH 0xffff | |||
@@ -201,19 +194,6 @@ | |||
#define VB_SIZE (VB_MAX + VB_MAX_CLIPPED_VERTS) | |||
/* | |||
* | |||
* For X11 driver only: | |||
* | |||
*/ | |||
/* | |||
* When defined, use 6x6x6 dithering instead of 5x9x5. | |||
* 5x9x5 better for general colors, 6x6x6 better for grayscale. | |||
*/ | |||
/*#define DITHER666*/ | |||
typedef struct gl_context GLcontext; | |||
@@ -1,8 +1,8 @@ | |||
/* $Id: context.c,v 1.18 1999/11/08 07:36:43 brianp Exp $ */ | |||
/* $Id: context.c,v 1.19 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,8 +25,6 @@ | |||
*/ | |||
/* $XFree86: xc/lib/GL/mesa/src/context.c,v 1.4 1999/04/04 00:20:21 dawes Exp $ */ | |||
/* | |||
* If multi-threading is enabled (-DTHREADS) then each thread has it's | |||
* own rendering context. A thread obtains the pointer to its GLcontext | |||
@@ -36,42 +34,34 @@ | |||
*/ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <math.h> | |||
#include <stdio.h> | |||
#include <stdlib.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "accum.h" | |||
#include "alphabuf.h" | |||
#include "api.h" | |||
#include "clip.h" | |||
#include "context.h" | |||
#include "cva.h" | |||
#include "depth.h" | |||
#include "dispatch.h" | |||
#include "dlist.h" | |||
#include "eval.h" | |||
#include "enums.h" | |||
#include "extensions.h" | |||
#include "fog.h" | |||
#include "glapi.h" | |||
#include "hash.h" | |||
#include "light.h" | |||
#include "lines.h" | |||
#include "dlist.h" | |||
#include "macros.h" | |||
#include "matrix.h" | |||
#include "mem.h" | |||
#include "mmath.h" | |||
#include "pb.h" | |||
#include "pipeline.h" | |||
#include "points.h" | |||
#include "pointers.h" | |||
#include "quads.h" | |||
#include "shade.h" | |||
#include "simple_list.h" | |||
@@ -95,40 +85,6 @@ | |||
#endif | |||
/* | |||
* Memory allocation functions. Called via the MALLOC, CALLOC and | |||
* FREE macros when DEBUG symbol is defined. | |||
* You might want to set breakpoints on these functions or plug in | |||
* other memory allocation functions. The Mesa sources should only | |||
* use the MALLOC and FREE macros (which could also be overriden). | |||
* | |||
* XXX these functions should probably go into a new glmemory.c file. | |||
*/ | |||
/* | |||
* Allocate memory (uninitialized) | |||
*/ | |||
void *gl_malloc(size_t bytes) | |||
{ | |||
return malloc(bytes); | |||
} | |||
/* | |||
* Allocate memory and initialize to zero. | |||
*/ | |||
void *gl_calloc(size_t bytes) | |||
{ | |||
return calloc(1, bytes); | |||
} | |||
/* | |||
* Free memory | |||
*/ | |||
void gl_free(void *ptr) | |||
{ | |||
free(ptr); | |||
} | |||
/**********************************************************************/ | |||
/***** Context and Thread management *****/ | |||
@@ -157,7 +113,7 @@ static void set_thread_context( GLcontext *ctx ) { | |||
#else | |||
/* One Current Context pointer for all threads in the address space */ | |||
GLcontext *CC = NULL; | |||
GLcontext *_mesa_current_context = NULL; | |||
struct immediate *CURRENT_INPUT = NULL; | |||
#endif /*THREADS*/ | |||
@@ -578,7 +534,6 @@ static void init_1d_map( struct gl_1d_map *map, int n, const float *initial ) | |||
for (i=0;i<n;i++) | |||
map->Points[i] = initial[i]; | |||
} | |||
map->Retain = GL_FALSE; | |||
} | |||
@@ -597,10 +552,20 @@ static void init_2d_map( struct gl_2d_map *map, int n, const float *initial ) | |||
for (i=0;i<n;i++) | |||
map->Points[i] = initial[i]; | |||
} | |||
map->Retain = GL_FALSE; | |||
} | |||
static void init_palette( struct gl_palette *p ) | |||
{ | |||
p->Table[0] = 255; | |||
p->Table[1] = 255; | |||
p->Table[2] = 255; | |||
p->Table[3] = 255; | |||
p->Size = 1; | |||
p->IntFormat = GL_RGBA; | |||
p->Format = GL_RGBA; | |||
} | |||
/* | |||
* Initialize a gl_context structure to default values. | |||
@@ -929,14 +894,7 @@ static void initialize_context( GLcontext *ctx ) | |||
for (i=0; i<MAX_TEXTURE_UNITS; i++) | |||
init_texture_unit( ctx, i ); | |||
ctx->Texture.SharedPalette = GL_FALSE; | |||
ctx->Texture.Palette[0] = 255; | |||
ctx->Texture.Palette[1] = 255; | |||
ctx->Texture.Palette[2] = 255; | |||
ctx->Texture.Palette[3] = 255; | |||
ctx->Texture.PaletteSize = 1; | |||
ctx->Texture.PaletteIntFormat = GL_RGBA; | |||
ctx->Texture.PaletteFormat = GL_RGBA; | |||
init_palette(&ctx->Texture.Palette); | |||
/* Transformation group */ | |||
ctx->Transform.MatrixMode = GL_MODELVIEW; | |||
@@ -1331,13 +1289,10 @@ GLcontext *gl_create_context( GLvisual *visual, | |||
ctx->Driver.ReadDepthSpanFloat = gl_read_depth_span_float; | |||
ctx->Driver.ReadDepthSpanInt = gl_read_depth_span_int; | |||
#ifdef PROFILE | |||
init_timings( ctx ); | |||
#endif | |||
#ifdef GL_VERSION_1_1 | |||
if (!alloc_proxy_textures(ctx)) { | |||
free_shared_state(ctx, ctx->Shared); | |||
FREE(ctx->VB); | |||
@@ -1345,10 +1300,11 @@ GLcontext *gl_create_context( GLvisual *visual, | |||
FREE(ctx); | |||
return NULL; | |||
} | |||
#endif | |||
gl_init_api_function_pointers( ctx ); | |||
ctx->API = ctx->Exec; /* GL_EXECUTE is default */ | |||
/* setup API dispatch tables */ | |||
_mesa_init_exec_table( &ctx->Exec ); | |||
_mesa_init_dlist_table( &ctx->Save ); | |||
ctx->CurrentDispatch = &ctx->Exec; | |||
return ctx; | |||
} | |||
@@ -1462,8 +1418,8 @@ void gl_destroy_context( GLcontext *ctx ) | |||
FREE( (void *) ctx ); | |||
#ifndef THREADS | |||
if (ctx==CC) { | |||
CC = NULL; | |||
if (ctx == _mesa_current_context) { | |||
_mesa_current_context = NULL; | |||
CURRENT_INPUT = NULL; | |||
} | |||
#endif | |||
@@ -1532,37 +1488,42 @@ void gl_destroy_framebuffer( GLframebuffer *buffer ) | |||
/* | |||
* Set the current context, binding the given frame buffer to the context. | |||
*/ | |||
void gl_make_current( GLcontext *ctx, GLframebuffer *buffer ) | |||
void gl_make_current( GLcontext *newCtx, GLframebuffer *buffer ) | |||
{ | |||
GET_CONTEXT; | |||
GET_CURRENT_CONTEXT(oldCtx); | |||
/* Flush the old context | |||
*/ | |||
if (CC) { | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(CC, "gl_make_current"); | |||
if (oldCtx) { | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(oldCtx, "gl_make_current"); | |||
} | |||
#ifdef THREADS | |||
/* TODO: unbind old buffer from context? */ | |||
set_thread_context( ctx ); | |||
set_thread_context( newCtx ); | |||
#else | |||
if (CC && CC->Buffer) { | |||
if (oldCtx && oldCtx->Buffer) { | |||
/* unbind frame buffer from context */ | |||
CC->Buffer = NULL; | |||
oldCtx->Buffer = NULL; | |||
} | |||
CC = ctx; | |||
if (ctx) { | |||
SET_IMMEDIATE(ctx, ctx->input); | |||
_mesa_current_context = newCtx; | |||
if (newCtx) { | |||
SET_IMMEDIATE(newCtx, newCtx->input); | |||
} | |||
#endif | |||
if (newCtx) | |||
_glapi_set_dispatch(newCtx->CurrentDispatch); | |||
else | |||
_glapi_set_dispatch(NULL); /* none current */ | |||
if (MESA_VERBOSE) fprintf(stderr, "gl_make_current()\n"); | |||
if (ctx && buffer) { | |||
/* TODO: check if ctx and buffer's visual match??? */ | |||
ctx->Buffer = buffer; /* Bind the frame buffer to the context */ | |||
ctx->NewState = NEW_ALL; /* just to be safe */ | |||
gl_update_state( ctx ); | |||
if (newCtx && buffer) { | |||
/* TODO: check if newCtx and buffer's visual match??? */ | |||
newCtx->Buffer = buffer; /* Bind the frame buffer to the context */ | |||
newCtx->NewState = NEW_ALL; /* just to be safe */ | |||
gl_update_state( newCtx ); | |||
} | |||
} | |||
@@ -1575,7 +1536,7 @@ GLcontext *gl_get_current_context( void ) | |||
#ifdef THREADS | |||
return gl_get_thread_context(); | |||
#else | |||
return CC; | |||
return _mesa_current_context; | |||
#endif | |||
} | |||
@@ -1659,27 +1620,74 @@ void gl_copy_context( const GLcontext *src, GLcontext *dst, GLuint mask ) | |||
} | |||
/* | |||
* This should be called by device drivers just before they do a | |||
* swapbuffers. Any pending rendering commands will be executed. | |||
*/ | |||
void | |||
_mesa_swapbuffers(GLcontext *ctx) | |||
{ | |||
FLUSH_VB( ctx, "swap buffers" ); | |||
} | |||
/* | |||
* Someday a GLS library or OpenGL-like debugger may call this function | |||
* to register it's own set of API entry points. | |||
* Input: ctx - the context to set API pointers for | |||
* api - if NULL, restore original API pointers | |||
* else, set API function table to this table. | |||
* Return pointer to this context's current API dispatch table. | |||
* It'll either be the immediate-mode execute dispatcher or the | |||
* display list compile dispatcher. | |||
*/ | |||
void gl_set_api_table( GLcontext *ctx, const struct gl_api_table *api ) | |||
struct _glapi_table * | |||
_mesa_get_dispatch(GLcontext *ctx) | |||
{ | |||
return ctx->CurrentDispatch; | |||
} | |||
void | |||
_mesa_ResizeBuffersMESA( void ) | |||
{ | |||
if (api) { | |||
MEMCPY( &ctx->API, api, sizeof(struct gl_api_table) ); | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint buf_width, buf_height; | |||
if (MESA_VERBOSE & VERBOSE_API) | |||
fprintf(stderr, "glResizeBuffersMESA\n"); | |||
/* ask device driver for size of output buffer */ | |||
(*ctx->Driver.GetBufferSize)( ctx, &buf_width, &buf_height ); | |||
/* see if size of device driver's color buffer (window) has changed */ | |||
if (ctx->Buffer->Width == (GLint) buf_width && | |||
ctx->Buffer->Height == (GLint) buf_height) | |||
return; | |||
ctx->NewState |= NEW_RASTER_OPS; /* to update scissor / window bounds */ | |||
/* save buffer size */ | |||
ctx->Buffer->Width = buf_width; | |||
ctx->Buffer->Height = buf_height; | |||
/* Reallocate other buffers if needed. */ | |||
if (ctx->Visual->DepthBits>0) { | |||
/* reallocate depth buffer */ | |||
(*ctx->Driver.AllocDepthBuffer)( ctx ); | |||
} | |||
else { | |||
MEMCPY( &ctx->API, &ctx->Exec, sizeof(struct gl_api_table) ); | |||
if (ctx->Visual->StencilBits>0) { | |||
/* reallocate stencil buffer */ | |||
gl_alloc_stencil_buffer( ctx ); | |||
} | |||
if (ctx->Visual->AccumBits>0) { | |||
/* reallocate accum buffer */ | |||
gl_alloc_accum_buffer( ctx ); | |||
} | |||
if (ctx->Visual->SoftwareAlpha) { | |||
gl_alloc_alpha_buffers( ctx ); | |||
} | |||
} | |||
/**********************************************************************/ | |||
/***** Miscellaneous functions *****/ | |||
/**********************************************************************/ | |||
@@ -1801,66 +1809,6 @@ void gl_error( GLcontext *ctx, GLenum error, const char *s ) | |||
/* | |||
* Execute a glGetError command | |||
*/ | |||
GLenum gl_GetError( GLcontext *ctx ) | |||
{ | |||
GLenum e = ctx->ErrorValue; | |||
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL( ctx, "glGetError", (GLenum) 0); | |||
if (MESA_VERBOSE & VERBOSE_API) | |||
fprintf(stderr, "glGetError <-- %s\n", gl_lookup_enum_by_nr(e)); | |||
ctx->ErrorValue = (GLenum) GL_NO_ERROR; | |||
return e; | |||
} | |||
void gl_ResizeBuffersMESA( GLcontext *ctx ) | |||
{ | |||
GLuint buf_width, buf_height; | |||
if (MESA_VERBOSE & VERBOSE_API) | |||
fprintf(stderr, "glResizeBuffersMESA\n"); | |||
/* ask device driver for size of output buffer */ | |||
(*ctx->Driver.GetBufferSize)( ctx, &buf_width, &buf_height ); | |||
/* see if size of device driver's color buffer (window) has changed */ | |||
if (ctx->Buffer->Width == (GLint) buf_width && | |||
ctx->Buffer->Height == (GLint) buf_height) | |||
return; | |||
ctx->NewState |= NEW_RASTER_OPS; /* to update scissor / window bounds */ | |||
/* save buffer size */ | |||
ctx->Buffer->Width = buf_width; | |||
ctx->Buffer->Height = buf_height; | |||
/* Reallocate other buffers if needed. */ | |||
if (ctx->Visual->DepthBits>0) { | |||
/* reallocate depth buffer */ | |||
(*ctx->Driver.AllocDepthBuffer)( ctx ); | |||
} | |||
if (ctx->Visual->StencilBits>0) { | |||
/* reallocate stencil buffer */ | |||
gl_alloc_stencil_buffer( ctx ); | |||
} | |||
if (ctx->Visual->AccumBits>0) { | |||
/* reallocate accum buffer */ | |||
gl_alloc_accum_buffer( ctx ); | |||
} | |||
if (ctx->Visual->SoftwareAlpha) { | |||
gl_alloc_alpha_buffers( ctx ); | |||
} | |||
} | |||
/**********************************************************************/ | |||
/***** State update logic *****/ | |||
/**********************************************************************/ |
@@ -1,8 +1,8 @@ | |||
/* $Id: context.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: context.h,v 1.2 1999/11/11 01:22:25 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef CONTEXT_H | |||
#define CONTEXT_H | |||
@@ -35,18 +32,35 @@ | |||
#include "types.h" | |||
#ifdef THREADS | |||
/* | |||
* A seperate GLcontext for each thread | |||
*/ | |||
extern GLcontext *gl_get_thread_context( void ); | |||
#define GET_IMMEDIATE struct immediate *IM = (gl_get_thread_context())->input; | |||
#define SET_IMMEDIATE(ctx, im) \ | |||
do { \ | |||
ctx->input = im; \ | |||
} while (0) | |||
#else | |||
/* | |||
* All threads use same pointer to current context. | |||
*/ | |||
extern GLcontext *CC; | |||
extern GLcontext *_mesa_current_context; | |||
extern struct immediate *CURRENT_INPUT; | |||
#define GET_CURRENT_CONTEXT(C) GLcontext *C = _mesa_current_context | |||
#define GET_IMMEDIATE struct immediate *IM = CURRENT_INPUT | |||
#define SET_IMMEDIATE(ctx, im) \ | |||
do { \ | |||
ctx->input = im; \ | |||
CURRENT_INPUT = im; \ | |||
} while (0) | |||
#endif | |||
@@ -124,14 +138,18 @@ extern GLcontext *gl_get_current_context(void); | |||
extern void gl_copy_context(const GLcontext *src, GLcontext *dst, GLuint mask); | |||
extern void gl_set_api_table( GLcontext *ctx, const struct gl_api_table *api ); | |||
extern void | |||
_mesa_swapbuffers(GLcontext *ctx); | |||
extern struct _glapi_table * | |||
_mesa_get_dispatch(GLcontext *ctx); | |||
/* | |||
* GL_MESA_resize_buffers extension | |||
*/ | |||
extern void gl_ResizeBuffersMESA( GLcontext *ctx ); | |||
extern void _mesa_ResizeBuffersMESA( void ); | |||
@@ -146,8 +164,6 @@ extern void gl_warning( const GLcontext *ctx, const char *s ); | |||
extern void gl_error( GLcontext *ctx, GLenum error, const char *s ); | |||
extern void gl_compile_error( GLcontext *ctx, GLenum error, const char *s ); | |||
extern GLenum gl_GetError( GLcontext *ctx ); | |||
extern void gl_update_state( GLcontext *ctx ); | |||
@@ -1,8 +1,8 @@ | |||
/* $Id: depth.c,v 1.8 1999/11/08 07:36:43 brianp Exp $ */ | |||
/* $Id: depth.c,v 1.9 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -24,28 +24,14 @@ | |||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
*/ | |||
/* $XFree86: xc/lib/GL/mesa/src/depth.c,v 1.3 1999/04/04 00:20:22 dawes Exp $ */ | |||
/* | |||
* Depth buffer functions | |||
*/ | |||
#include <stdlib.h> | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <stdio.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "enums.h" | |||
#include "depth.h" | |||
#include "macros.h" | |||
#include "mem.h" | |||
#include "types.h" | |||
#endif | |||
@@ -57,8 +43,10 @@ | |||
void gl_ClearDepth( GLcontext* ctx, GLclampd depth ) | |||
void | |||
_mesa_ClearDepth( GLclampd depth ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearDepth"); | |||
ctx->Depth.Clear = (GLfloat) CLAMP( depth, 0.0, 1.0 ); | |||
if (ctx->Driver.ClearDepth) | |||
@@ -67,8 +55,10 @@ void gl_ClearDepth( GLcontext* ctx, GLclampd depth ) | |||
void gl_DepthFunc( GLcontext* ctx, GLenum func ) | |||
void | |||
_mesa_DepthFunc( GLenum func ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDepthFunc"); | |||
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) | |||
@@ -108,8 +98,10 @@ void gl_DepthFunc( GLcontext* ctx, GLenum func ) | |||
void gl_DepthMask( GLcontext* ctx, GLboolean flag ) | |||
void | |||
_mesa_DepthMask( GLboolean flag ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDepthMask"); | |||
if (MESA_VERBOSE & (VERBOSE_API|VERBOSE_TEXTURE)) |
@@ -1,9 +1,8 @@ | |||
/* $Id: depth.h,v 1.2 1999/10/08 09:27:10 keithw Exp $ */ | |||
/* $Id: depth.h,v 1.3 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -26,9 +25,6 @@ | |||
*/ | |||
#ifndef DEPTH_H | |||
#define DEPTH_H | |||
@@ -90,10 +86,16 @@ extern void gl_alloc_depth_buffer( GLcontext* ctx ); | |||
extern void gl_clear_depth_buffer( GLcontext* ctx ); | |||
extern void gl_ClearDepth( GLcontext* ctx, GLclampd depth ); | |||
extern void gl_DepthFunc( GLcontext* ctx, GLenum func ); | |||
extern void | |||
_mesa_ClearDepth( GLclampd depth ); | |||
extern void | |||
_mesa_DepthFunc( GLenum func ); | |||
extern void | |||
_mesa_DepthMask( GLboolean flag ); | |||
extern void gl_DepthMask( GLcontext* ctx, GLboolean flag ); | |||
#endif |
@@ -0,0 +1,546 @@ | |||
/* $Id: dispatch.c,v 1.1 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
* Permission is hereby granted, free of charge, to any person obtaining a | |||
* copy of this software and associated documentation files (the "Software"), | |||
* to deal in the Software without restriction, including without limitation | |||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | |||
* and/or sell copies of the Software, and to permit persons to whom the | |||
* Software is furnished to do so, subject to the following conditions: | |||
* | |||
* The above copyright notice and this permission notice shall be included | |||
* in all copies or substantial portions of the Software. | |||
* | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | |||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
*/ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#include "glheader.h" | |||
#include "accum.h" | |||
#include "alpha.h" | |||
#include "attrib.h" | |||
#include "bitmap.h" | |||
#include "blend.h" | |||
#include "clip.h" | |||
#include "context.h" | |||
#include "colortab.h" | |||
#include "copypix.h" | |||
#include "cva.h" | |||
#include "depth.h" | |||
#include "dlist.h" | |||
#include "drawpix.h" | |||
#include "enable.h" | |||
#include "eval.h" | |||
#include "feedback.h" | |||
#include "fog.h" | |||
#include "get.h" | |||
#include "glmisc.h" | |||
#include "imaging.h" | |||
#include "light.h" | |||
#include "lines.h" | |||
#include "logic.h" | |||
#include "masking.h" | |||
#include "matrix.h" | |||
#include "pixel.h" | |||
#include "points.h" | |||
#include "polygon.h" | |||
#include "rastpos.h" | |||
#include "readpix.h" | |||
#include "rect.h" | |||
#include "scissor.h" | |||
#include "stencil.h" | |||
#include "teximage.h" | |||
#include "texobj.h" | |||
#include "texstate.h" | |||
#include "types.h" | |||
#include "varray.h" | |||
#include "vbfill.h" | |||
#include "winpos.h" | |||
#endif | |||
/* | |||
* Initialize the given dispatch table with pointers to Mesa's | |||
* immediate-mode commands. | |||
*/ | |||
void | |||
_mesa_init_exec_table(struct _glapi_table *exec) | |||
{ | |||
exec->Accum = _mesa_Accum; | |||
exec->AlphaFunc = _mesa_AlphaFunc; | |||
exec->Begin = _mesa_Begin; | |||
exec->Bitmap = _mesa_Bitmap; | |||
exec->BlendFunc = _mesa_BlendFunc; | |||
exec->CallList = _mesa_CallList; | |||
exec->CallLists = _mesa_CallLists; | |||
exec->Clear = _mesa_Clear; | |||
exec->ClearAccum = _mesa_ClearAccum; | |||
exec->ClearColor = _mesa_ClearColor; | |||
exec->ClearDepth = _mesa_ClearDepth; | |||
exec->ClearIndex = _mesa_ClearIndex; | |||
exec->ClearStencil = _mesa_ClearStencil; | |||
exec->ClipPlane = _mesa_ClipPlane; | |||
exec->Color3b = _mesa_Color3b; | |||
exec->Color3bv = _mesa_Color3bv; | |||
exec->Color3d = _mesa_Color3d; | |||
exec->Color3dv = _mesa_Color3dv; | |||
exec->Color3f = _mesa_Color3f; | |||
exec->Color3fv = _mesa_Color3fv; | |||
exec->Color3i = _mesa_Color3i; | |||
exec->Color3iv = _mesa_Color3iv; | |||
exec->Color3s = _mesa_Color3s; | |||
exec->Color3sv = _mesa_Color3sv; | |||
exec->Color3ub = _mesa_Color3ub; | |||
exec->Color3ubv = _mesa_Color3ubv; | |||
exec->Color3ui = _mesa_Color3ui; | |||
exec->Color3uiv = _mesa_Color3uiv; | |||
exec->Color3us = _mesa_Color3us; | |||
exec->Color3usv = _mesa_Color3usv; | |||
exec->Color4b = _mesa_Color4b; | |||
exec->Color4bv = _mesa_Color4bv; | |||
exec->Color4d = _mesa_Color4d; | |||
exec->Color4dv = _mesa_Color4dv; | |||
exec->Color4f = _mesa_Color4f; | |||
exec->Color4fv = _mesa_Color4fv; | |||
exec->Color4i = _mesa_Color4i; | |||
exec->Color4iv = _mesa_Color4iv; | |||
exec->Color4s = _mesa_Color4s; | |||
exec->Color4sv = _mesa_Color4sv; | |||
exec->Color4ub = _mesa_Color4ub; | |||
exec->Color4ubv = _mesa_Color4ubv; | |||
exec->Color4ui = _mesa_Color4ui; | |||
exec->Color4uiv = _mesa_Color4uiv; | |||
exec->Color4us = _mesa_Color4us; | |||
exec->Color4usv = _mesa_Color4usv; | |||
exec->ColorMask = _mesa_ColorMask; | |||
exec->ColorMaterial = _mesa_ColorMaterial; | |||
exec->CopyPixels = _mesa_CopyPixels; | |||
exec->CullFace = _mesa_CullFace; | |||
exec->DeleteLists = _mesa_DeleteLists; | |||
exec->DepthFunc = _mesa_DepthFunc; | |||
exec->DepthMask = _mesa_DepthMask; | |||
exec->DepthRange = _mesa_DepthRange; | |||
exec->Disable = _mesa_Disable; | |||
exec->DrawBuffer = _mesa_DrawBuffer; | |||
exec->DrawPixels = _mesa_DrawPixels; | |||
exec->EdgeFlag = _mesa_EdgeFlag; | |||
exec->EdgeFlagv = _mesa_EdgeFlagv; | |||
exec->Enable = _mesa_Enable; | |||
exec->End = _mesa_End; | |||
exec->EndList = _mesa_EndList; | |||
exec->EvalCoord1d = _mesa_EvalCoord1d; | |||
exec->EvalCoord1dv = _mesa_EvalCoord1dv; | |||
exec->EvalCoord1f = _mesa_EvalCoord1f; | |||
exec->EvalCoord1fv = _mesa_EvalCoord1fv; | |||
exec->EvalCoord2d = _mesa_EvalCoord2d; | |||
exec->EvalCoord2dv = _mesa_EvalCoord2dv; | |||
exec->EvalCoord2f = _mesa_EvalCoord2f; | |||
exec->EvalCoord2fv = _mesa_EvalCoord2fv; | |||
exec->EvalMesh1 = _mesa_EvalMesh1; | |||
exec->EvalMesh2 = _mesa_EvalMesh2; | |||
exec->EvalPoint1 = _mesa_EvalPoint1; | |||
exec->EvalPoint2 = _mesa_EvalPoint2; | |||
exec->FeedbackBuffer = _mesa_FeedbackBuffer; | |||
exec->Finish = _mesa_Finish; | |||
exec->Flush = _mesa_Flush; | |||
exec->Fogf = _mesa_Fogf; | |||
exec->Fogfv = _mesa_Fogfv; | |||
exec->Fogi = _mesa_Fogi; | |||
exec->Fogiv = _mesa_Fogiv; | |||
exec->FrontFace = _mesa_FrontFace; | |||
exec->Frustum = _mesa_Frustum; | |||
exec->GenLists = _mesa_GenLists; | |||
exec->GetBooleanv = _mesa_GetBooleanv; | |||
exec->GetClipPlane = _mesa_GetClipPlane; | |||
exec->GetDoublev = _mesa_GetDoublev; | |||
exec->GetError = _mesa_GetError; | |||
exec->GetFloatv = _mesa_GetFloatv; | |||
exec->GetIntegerv = _mesa_GetIntegerv; | |||
exec->GetLightfv = _mesa_GetLightfv; | |||
exec->GetLightiv = _mesa_GetLightiv; | |||
exec->GetMapdv = _mesa_GetMapdv; | |||
exec->GetMapfv = _mesa_GetMapfv; | |||
exec->GetMapiv = _mesa_GetMapiv; | |||
exec->GetMaterialfv = _mesa_GetMaterialfv; | |||
exec->GetMaterialiv = _mesa_GetMaterialiv; | |||
exec->GetPixelMapfv = _mesa_GetPixelMapfv; | |||
exec->GetPixelMapuiv = _mesa_GetPixelMapuiv; | |||
exec->GetPixelMapusv = _mesa_GetPixelMapusv; | |||
exec->GetPolygonStipple = _mesa_GetPolygonStipple; | |||
exec->GetString = _mesa_GetString; | |||
exec->GetTexEnvfv = _mesa_GetTexEnvfv; | |||
exec->GetTexEnviv = _mesa_GetTexEnviv; | |||
exec->GetTexGendv = _mesa_GetTexGendv; | |||
exec->GetTexGenfv = _mesa_GetTexGenfv; | |||
exec->GetTexGeniv = _mesa_GetTexGeniv; | |||
exec->GetTexImage = _mesa_GetTexImage; | |||
exec->GetTexLevelParameterfv = _mesa_GetTexLevelParameterfv; | |||
exec->GetTexLevelParameteriv = _mesa_GetTexLevelParameteriv; | |||
exec->GetTexParameterfv = _mesa_GetTexParameterfv; | |||
exec->GetTexParameteriv = _mesa_GetTexParameteriv; | |||
exec->Hint = _mesa_Hint; | |||
exec->IndexMask = _mesa_IndexMask; | |||
exec->Indexd = _mesa_Indexd; | |||
exec->Indexdv = _mesa_Indexdv; | |||
exec->Indexf = _mesa_Indexf; | |||
exec->Indexfv = _mesa_Indexfv; | |||
exec->Indexi = _mesa_Indexi; | |||
exec->Indexiv = _mesa_Indexiv; | |||
exec->Indexs = _mesa_Indexs; | |||
exec->Indexsv = _mesa_Indexsv; | |||
exec->InitNames = _mesa_InitNames; | |||
exec->IsEnabled = _mesa_IsEnabled; | |||
exec->IsList = _mesa_IsList; | |||
exec->LightModelf = _mesa_LightModelf; | |||
exec->LightModelfv = _mesa_LightModelfv; | |||
exec->LightModeli = _mesa_LightModeli; | |||
exec->LightModeliv = _mesa_LightModeliv; | |||
exec->Lightf = _mesa_Lightf; | |||
exec->Lightfv = _mesa_Lightfv; | |||
exec->Lighti = _mesa_Lighti; | |||
exec->Lightiv = _mesa_Lightiv; | |||
exec->LineStipple = _mesa_LineStipple; | |||
exec->LineWidth = _mesa_LineWidth; | |||
exec->ListBase = _mesa_ListBase; | |||
exec->LoadIdentity = _mesa_LoadIdentity; | |||
exec->LoadMatrixd = _mesa_LoadMatrixd; | |||
exec->LoadMatrixf = _mesa_LoadMatrixf; | |||
exec->LoadName = _mesa_LoadName; | |||
exec->LogicOp = _mesa_LogicOp; | |||
exec->Map1d = _mesa_Map1d; | |||
exec->Map1f = _mesa_Map1f; | |||
exec->Map2d = _mesa_Map2d; | |||
exec->Map2f = _mesa_Map2f; | |||
exec->MapGrid1d = _mesa_MapGrid1d; | |||
exec->MapGrid1f = _mesa_MapGrid1f; | |||
exec->MapGrid2d = _mesa_MapGrid2d; | |||
exec->MapGrid2f = _mesa_MapGrid2f; | |||
exec->Materialf = _mesa_Materialf; | |||
exec->Materialfv = _mesa_Materialfv; | |||
exec->Materiali = _mesa_Materiali; | |||
exec->Materialiv = _mesa_Materialiv; | |||
exec->MatrixMode = _mesa_MatrixMode; | |||
exec->MultMatrixd = _mesa_MultMatrixd; | |||
exec->MultMatrixf = _mesa_MultMatrixf; | |||
exec->NewList = _mesa_NewList; | |||
exec->Normal3b = _mesa_Normal3b; | |||
exec->Normal3bv = _mesa_Normal3bv; | |||
exec->Normal3d = _mesa_Normal3d; | |||
exec->Normal3dv = _mesa_Normal3dv; | |||
exec->Normal3f = _mesa_Normal3f; | |||
exec->Normal3fv = _mesa_Normal3fv; | |||
exec->Normal3i = _mesa_Normal3i; | |||
exec->Normal3iv = _mesa_Normal3iv; | |||
exec->Normal3s = _mesa_Normal3s; | |||
exec->Normal3sv = _mesa_Normal3sv; | |||
exec->Ortho = _mesa_Ortho; | |||
exec->PassThrough = _mesa_PassThrough; | |||
exec->PixelMapfv = _mesa_PixelMapfv; | |||
exec->PixelMapuiv = _mesa_PixelMapuiv; | |||
exec->PixelMapusv = _mesa_PixelMapusv; | |||
exec->PixelStoref = _mesa_PixelStoref; | |||
exec->PixelStorei = _mesa_PixelStorei; | |||
exec->PixelTransferf = _mesa_PixelTransferf; | |||
exec->PixelTransferi = _mesa_PixelTransferi; | |||
exec->PixelZoom = _mesa_PixelZoom; | |||
exec->PointSize = _mesa_PointSize; | |||
exec->PolygonMode = _mesa_PolygonMode; | |||
exec->PolygonOffset = _mesa_PolygonOffset; | |||
exec->PolygonStipple = _mesa_PolygonStipple; | |||
exec->PopAttrib = _mesa_PopAttrib; | |||
exec->PopMatrix = _mesa_PopMatrix; | |||
exec->PopName = _mesa_PopName; | |||
exec->PushAttrib = _mesa_PushAttrib; | |||
exec->PushMatrix = _mesa_PushMatrix; | |||
exec->PushName = _mesa_PushName; | |||
exec->RasterPos2d = _mesa_RasterPos2d; | |||
exec->RasterPos2dv = _mesa_RasterPos2dv; | |||
exec->RasterPos2f = _mesa_RasterPos2f; | |||
exec->RasterPos2fv = _mesa_RasterPos2fv; | |||
exec->RasterPos2i = _mesa_RasterPos2i; | |||
exec->RasterPos2iv = _mesa_RasterPos2iv; | |||
exec->RasterPos2s = _mesa_RasterPos2s; | |||
exec->RasterPos2sv = _mesa_RasterPos2sv; | |||
exec->RasterPos3d = _mesa_RasterPos3d; | |||
exec->RasterPos3dv = _mesa_RasterPos3dv; | |||
exec->RasterPos3f = _mesa_RasterPos3f; | |||
exec->RasterPos3fv = _mesa_RasterPos3fv; | |||
exec->RasterPos3i = _mesa_RasterPos3i; | |||
exec->RasterPos3iv = _mesa_RasterPos3iv; | |||
exec->RasterPos3s = _mesa_RasterPos3s; | |||
exec->RasterPos3sv = _mesa_RasterPos3sv; | |||
exec->RasterPos4d = _mesa_RasterPos4d; | |||
exec->RasterPos4dv = _mesa_RasterPos4dv; | |||
exec->RasterPos4f = _mesa_RasterPos4f; | |||
exec->RasterPos4fv = _mesa_RasterPos4fv; | |||
exec->RasterPos4i = _mesa_RasterPos4i; | |||
exec->RasterPos4iv = _mesa_RasterPos4iv; | |||
exec->RasterPos4s = _mesa_RasterPos4s; | |||
exec->RasterPos4sv = _mesa_RasterPos4sv; | |||
exec->ReadBuffer = _mesa_ReadBuffer; | |||
exec->ReadPixels = _mesa_ReadPixels; | |||
exec->Rectd = _mesa_Rectd; | |||
exec->Rectdv = _mesa_Rectdv; | |||
exec->Rectf = _mesa_Rectf; | |||
exec->Rectfv = _mesa_Rectfv; | |||
exec->Recti = _mesa_Recti; | |||
exec->Rectiv = _mesa_Rectiv; | |||
exec->Rects = _mesa_Rects; | |||
exec->Rectsv = _mesa_Rectsv; | |||
exec->RenderMode = _mesa_RenderMode; | |||
exec->Rotated = _mesa_Rotated; | |||
exec->Rotatef = _mesa_Rotatef; | |||
exec->Scaled = _mesa_Scaled; | |||
exec->Scalef = _mesa_Scalef; | |||
exec->Scissor = _mesa_Scissor; | |||
exec->SelectBuffer = _mesa_SelectBuffer; | |||
exec->ShadeModel = _mesa_ShadeModel; | |||
exec->StencilFunc = _mesa_StencilFunc; | |||
exec->StencilMask = _mesa_StencilMask; | |||
exec->StencilOp = _mesa_StencilOp; | |||
exec->TexCoord1d = _mesa_TexCoord1d; | |||
exec->TexCoord1dv = _mesa_TexCoord1dv; | |||
exec->TexCoord1f = _mesa_TexCoord1f; | |||
exec->TexCoord1fv = _mesa_TexCoord1fv; | |||
exec->TexCoord1i = _mesa_TexCoord1i; | |||
exec->TexCoord1iv = _mesa_TexCoord1iv; | |||
exec->TexCoord1s = _mesa_TexCoord1s; | |||
exec->TexCoord1sv = _mesa_TexCoord1sv; | |||
exec->TexCoord2d = _mesa_TexCoord2d; | |||
exec->TexCoord2dv = _mesa_TexCoord2dv; | |||
exec->TexCoord2f = _mesa_TexCoord2f; | |||
exec->TexCoord2fv = _mesa_TexCoord2fv; | |||
exec->TexCoord2i = _mesa_TexCoord2i; | |||
exec->TexCoord2iv = _mesa_TexCoord2iv; | |||
exec->TexCoord2s = _mesa_TexCoord2s; | |||
exec->TexCoord2sv = _mesa_TexCoord2sv; | |||
exec->TexCoord3d = _mesa_TexCoord3d; | |||
exec->TexCoord3dv = _mesa_TexCoord3dv; | |||
exec->TexCoord3f = _mesa_TexCoord3f; | |||
exec->TexCoord3fv = _mesa_TexCoord3fv; | |||
exec->TexCoord3i = _mesa_TexCoord3i; | |||
exec->TexCoord3iv = _mesa_TexCoord3iv; | |||
exec->TexCoord3s = _mesa_TexCoord3s; | |||
exec->TexCoord3sv = _mesa_TexCoord3sv; | |||
exec->TexCoord4d = _mesa_TexCoord4d; | |||
exec->TexCoord4dv = _mesa_TexCoord4dv; | |||
exec->TexCoord4f = _mesa_TexCoord4f; | |||
exec->TexCoord4fv = _mesa_TexCoord4fv; | |||
exec->TexCoord4i = _mesa_TexCoord4i; | |||
exec->TexCoord4iv = _mesa_TexCoord4iv; | |||
exec->TexCoord4s = _mesa_TexCoord4s; | |||
exec->TexCoord4sv = _mesa_TexCoord4sv; | |||
exec->TexEnvf = _mesa_TexEnvf; | |||
exec->TexEnvfv = _mesa_TexEnvfv; | |||
exec->TexEnvi = _mesa_TexEnvi; | |||
exec->TexEnviv = _mesa_TexEnviv; | |||
exec->TexGend = _mesa_TexGend; | |||
exec->TexGendv = _mesa_TexGendv; | |||
exec->TexGenf = _mesa_TexGenf; | |||
exec->TexGenfv = _mesa_TexGenfv; | |||
exec->TexGeni = _mesa_TexGeni; | |||
exec->TexGeniv = _mesa_TexGeniv; | |||
exec->TexImage1D = _mesa_TexImage1D; | |||
exec->TexImage2D = _mesa_TexImage2D; | |||
exec->TexParameterf = _mesa_TexParameterf; | |||
exec->TexParameterfv = _mesa_TexParameterfv; | |||
exec->TexParameteri = _mesa_TexParameteri; | |||
exec->TexParameteriv = _mesa_TexParameteriv; | |||
exec->Translated = _mesa_Translated; | |||
exec->Translatef = _mesa_Translatef; | |||
exec->Vertex2d = _mesa_Vertex2d; | |||
exec->Vertex2dv = _mesa_Vertex2dv; | |||
exec->Vertex2f = _mesa_Vertex2f; | |||
exec->Vertex2fv = _mesa_Vertex2fv; | |||
exec->Vertex2i = _mesa_Vertex2i; | |||
exec->Vertex2iv = _mesa_Vertex2iv; | |||
exec->Vertex2s = _mesa_Vertex2s; | |||
exec->Vertex2sv = _mesa_Vertex2sv; | |||
exec->Vertex3d = _mesa_Vertex3d; | |||
exec->Vertex3dv = _mesa_Vertex3dv; | |||
exec->Vertex3f = _mesa_Vertex3f; | |||
exec->Vertex3fv = _mesa_Vertex3fv; | |||
exec->Vertex3i = _mesa_Vertex3i; | |||
exec->Vertex3iv = _mesa_Vertex3iv; | |||
exec->Vertex3s = _mesa_Vertex3s; | |||
exec->Vertex3sv = _mesa_Vertex3sv; | |||
exec->Vertex4d = _mesa_Vertex4d; | |||
exec->Vertex4dv = _mesa_Vertex4dv; | |||
exec->Vertex4f = _mesa_Vertex4f; | |||
exec->Vertex4fv = _mesa_Vertex4fv; | |||
exec->Vertex4i = _mesa_Vertex4i; | |||
exec->Vertex4iv = _mesa_Vertex4iv; | |||
exec->Vertex4s = _mesa_Vertex4s; | |||
exec->Vertex4sv = _mesa_Vertex4sv; | |||
exec->Viewport = _mesa_Viewport; | |||
#ifdef _GLAPI_VERSION_1_1 | |||
exec->AreTexturesResident = _mesa_AreTexturesResident; | |||
exec->ArrayElement = _mesa_ArrayElement; | |||
exec->BindTexture = _mesa_BindTexture; | |||
exec->ColorPointer = _mesa_ColorPointer; | |||
exec->CopyTexImage1D = _mesa_CopyTexImage1D; | |||
exec->CopyTexImage2D = _mesa_CopyTexImage2D; | |||
exec->CopyTexSubImage1D = _mesa_CopyTexSubImage1D; | |||
exec->CopyTexSubImage2D = _mesa_CopyTexSubImage2D; | |||
exec->DeleteTextures = _mesa_DeleteTextures; | |||
exec->DisableClientState = _mesa_DisableClientState; | |||
exec->DrawArrays = _mesa_DrawArrays; | |||
exec->DrawElements = _mesa_DrawElements; | |||
exec->EdgeFlagPointer = _mesa_EdgeFlagPointer; | |||
exec->EnableClientState = _mesa_EnableClientState; | |||
exec->GenTextures = _mesa_GenTextures; | |||
exec->GetPointerv = _mesa_GetPointerv; | |||
exec->IndexPointer = _mesa_IndexPointer; | |||
exec->Indexub = _mesa_Indexub; | |||
exec->Indexubv = _mesa_Indexubv; | |||
exec->InterleavedArrays = _mesa_InterleavedArrays; | |||
exec->IsTexture = _mesa_IsTexture; | |||
exec->NormalPointer = _mesa_NormalPointer; | |||
exec->PopClientAttrib = _mesa_PopClientAttrib; | |||
exec->PrioritizeTextures = _mesa_PrioritizeTextures; | |||
exec->PushClientAttrib = _mesa_PushClientAttrib; | |||
exec->TexCoordPointer = _mesa_TexCoordPointer; | |||
exec->TexSubImage1D = _mesa_TexSubImage1D; | |||
exec->TexSubImage2D = _mesa_TexSubImage2D; | |||
exec->VertexPointer = _mesa_VertexPointer; | |||
#endif | |||
#ifdef _GLAPI_VERSION_1_2 | |||
exec->CopyTexSubImage3D = _mesa_CopyTexSubImage3D; | |||
exec->DrawRangeElements = _mesa_DrawRangeElements; | |||
exec->TexImage3D = _mesa_TexImage3D; | |||
exec->TexSubImage3D = _mesa_TexSubImage3D; | |||
#endif | |||
/* OpenGL 1.2 GL_ARB_imaging */ | |||
#ifdef _GLAPI_ARB_imaging | |||
exec->BlendColor = _mesa_BlendColor; | |||
exec->BlendEquation = _mesa_BlendEquation; | |||
exec->ColorSubTable = _mesa_ColorSubTable; | |||
exec->ColorTable = _mesa_ColorTable; | |||
exec->ColorTableParameterfv = _mesa_ColorTableParameterfv; | |||
exec->ColorTableParameteriv = _mesa_ColorTableParameteriv; | |||
exec->ConvolutionFilter1D = _mesa_ConvolutionFilter1D; | |||
exec->ConvolutionFilter2D = _mesa_ConvolutionFilter2D; | |||
exec->ConvolutionParameterf = _mesa_ConvolutionParameterf; | |||
exec->ConvolutionParameterfv = _mesa_ConvolutionParameterfv; | |||
exec->ConvolutionParameteri = _mesa_ConvolutionParameteri; | |||
exec->ConvolutionParameteriv = _mesa_ConvolutionParameteriv; | |||
exec->CopyColorSubTable = _mesa_CopyColorSubTable; | |||
exec->CopyColorTable = _mesa_CopyColorTable; | |||
exec->CopyConvolutionFilter1D = _mesa_CopyConvolutionFilter1D; | |||
exec->CopyConvolutionFilter2D = _mesa_CopyConvolutionFilter2D; | |||
exec->GetColorTable = _mesa_GetColorTable; | |||
exec->GetColorTableParameterfv = _mesa_GetColorTableParameterfv; | |||
exec->GetColorTableParameteriv = _mesa_GetColorTableParameteriv; | |||
exec->GetConvolutionFilter = _mesa_GetConvolutionFilter; | |||
exec->GetConvolutionParameterfv = _mesa_GetConvolutionParameterfv; | |||
exec->GetConvolutionParameteriv = _mesa_GetConvolutionParameteriv; | |||
exec->GetHistogram = _mesa_GetHistogram; | |||
exec->GetHistogramParameterfv = _mesa_GetHistogramParameterfv; | |||
exec->GetHistogramParameteriv = _mesa_GetHistogramParameteriv; | |||
exec->GetMinmax = _mesa_GetMinmax; | |||
exec->GetMinmaxParameterfv = _mesa_GetMinmaxParameterfv; | |||
exec->GetMinmaxParameteriv = _mesa_GetMinmaxParameteriv; | |||
exec->GetSeparableFilter = _mesa_GetSeparableFilter; | |||
exec->Histogram = _mesa_Histogram; | |||
exec->Minmax = _mesa_Minmax; | |||
exec->ResetHistogram = _mesa_ResetHistogram; | |||
exec->ResetMinmax = _mesa_ResetMinmax; | |||
exec->SeparableFilter2D = _mesa_SeparableFilter2D; | |||
#endif | |||
#ifdef _GLAPI_EXT_color_table | |||
exec->ColorTableEXT = _mesa_ColorTable; | |||
exec->ColorSubTableEXT = _mesa_ColorSubTable; | |||
exec->GetColorTableEXT = _mesa_GetColorTable; | |||
exec->GetColorTableParameterfvEXT = _mesa_GetColorTableParameterfv; | |||
exec->GetColorTableParameterivEXT = _mesa_GetColorTableParameteriv; | |||
#endif | |||
#ifdef _GLAPI_EXT_compiled_vertex_array | |||
exec->LockArraysEXT = _mesa_LockArraysEXT; | |||
exec->UnlockArraysEXT = _mesa_UnlockArraysEXT; | |||
#endif | |||
#ifdef _GLAPI_EXT_point_parameters | |||
exec->PointParameterfEXT = _mesa_PointParameterfEXT; | |||
exec->PointParameterfvEXT = _mesa_PointParameterfvEXT; | |||
#endif | |||
#ifdef _GLAPI_EXT_polygon_offset | |||
exec->PolygonOffsetEXT = _mesa_PolygonOffsetEXT; | |||
#endif | |||
#ifdef _GLAPI_EXT_blend_minmax | |||
exec->BlendEquationEXT = _mesa_BlendEquationEXT; | |||
#endif | |||
#ifdef _GLAPI_EXT_blend_color | |||
exec->BlendColorEXT = _mesa_BlendColorEXT; | |||
#endif | |||
#ifdef _GLAPI_ARB_multitexture | |||
exec->ActiveTextureARB = _mesa_ActiveTextureARB; | |||
exec->ClientActiveTextureARB = _mesa_ClientActiveTextureARB; | |||
exec->MultiTexCoord1dARB = _mesa_MultiTexCoord1dARB; | |||
exec->MultiTexCoord1dvARB = _mesa_MultiTexCoord1dvARB; | |||
exec->MultiTexCoord1fARB = _mesa_MultiTexCoord1fARB; | |||
exec->MultiTexCoord1fvARB = _mesa_MultiTexCoord1fvARB; | |||
exec->MultiTexCoord1iARB = _mesa_MultiTexCoord1iARB; | |||
exec->MultiTexCoord1ivARB = _mesa_MultiTexCoord1ivARB; | |||
exec->MultiTexCoord1sARB = _mesa_MultiTexCoord1sARB; | |||
exec->MultiTexCoord1svARB = _mesa_MultiTexCoord1svARB; | |||
exec->MultiTexCoord2dARB = _mesa_MultiTexCoord2dARB; | |||
exec->MultiTexCoord2dvARB = _mesa_MultiTexCoord2dvARB; | |||
exec->MultiTexCoord2fARB = _mesa_MultiTexCoord2fARB; | |||
exec->MultiTexCoord2fvARB = _mesa_MultiTexCoord2fvARB; | |||
exec->MultiTexCoord2iARB = _mesa_MultiTexCoord2iARB; | |||
exec->MultiTexCoord2ivARB = _mesa_MultiTexCoord2ivARB; | |||
exec->MultiTexCoord2sARB = _mesa_MultiTexCoord2sARB; | |||
exec->MultiTexCoord2svARB = _mesa_MultiTexCoord2svARB; | |||
exec->MultiTexCoord3dARB = _mesa_MultiTexCoord3dARB; | |||
exec->MultiTexCoord3dvARB = _mesa_MultiTexCoord3dvARB; | |||
exec->MultiTexCoord3fARB = _mesa_MultiTexCoord3fARB; | |||
exec->MultiTexCoord3fvARB = _mesa_MultiTexCoord3fvARB; | |||
exec->MultiTexCoord3iARB = _mesa_MultiTexCoord3iARB; | |||
exec->MultiTexCoord3ivARB = _mesa_MultiTexCoord3ivARB; | |||
exec->MultiTexCoord3sARB = _mesa_MultiTexCoord3sARB; | |||
exec->MultiTexCoord3svARB = _mesa_MultiTexCoord3svARB; | |||
exec->MultiTexCoord4dARB = _mesa_MultiTexCoord4dARB; | |||
exec->MultiTexCoord4dvARB = _mesa_MultiTexCoord4dvARB; | |||
exec->MultiTexCoord4fARB = _mesa_MultiTexCoord4fARB; | |||
exec->MultiTexCoord4fvARB = _mesa_MultiTexCoord4fvARB; | |||
exec->MultiTexCoord4iARB = _mesa_MultiTexCoord4iARB; | |||
exec->MultiTexCoord4ivARB = _mesa_MultiTexCoord4ivARB; | |||
exec->MultiTexCoord4sARB = _mesa_MultiTexCoord4sARB; | |||
exec->MultiTexCoord4svARB = _mesa_MultiTexCoord4svARB; | |||
#endif | |||
#ifdef _GLAPI_INGR_blend_func_separate | |||
exec->BlendFuncSeparateINGR = _mesa_BlendFuncSeparateINGR; | |||
#endif | |||
#ifdef _GLAPI_MESA_window_pos | |||
exec->WindowPos4fMESA = _mesa_WindowPos4fMESA; | |||
#endif | |||
#ifdef _GLAPI_MESA_resize_buffers | |||
exec->ResizeBuffersMESA = _mesa_ResizeBuffersMESA; | |||
#endif | |||
} | |||
@@ -1,4 +1,4 @@ | |||
/* $Id: dlist.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: dlist.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -51,24 +51,23 @@ extern void gl_init_lists( void ); | |||
extern void gl_destroy_list( GLcontext *ctx, GLuint list ); | |||
extern void gl_CallList( GLcontext *ctx, GLuint list ); | |||
extern void _mesa_CallList( GLuint list ); | |||
extern void gl_CallLists( GLcontext *ctx, | |||
GLsizei n, GLenum type, const GLvoid *lists ); | |||
extern void _mesa_CallLists( GLsizei n, GLenum type, const GLvoid *lists ); | |||
extern void gl_DeleteLists( GLcontext *ctx, GLuint list, GLsizei range ); | |||
extern void _mesa_DeleteLists( GLuint list, GLsizei range ); | |||
extern void gl_EndList( GLcontext *ctx ); | |||
extern void _mesa_EndList( void ); | |||
extern GLuint gl_GenLists( GLcontext *ctx, GLsizei range ); | |||
extern GLuint _mesa_GenLists( GLsizei range ); | |||
extern GLboolean gl_IsList( GLcontext *ctx, GLuint list ); | |||
extern GLboolean _mesa_IsList( GLuint list ); | |||
extern void gl_ListBase( GLcontext *ctx, GLuint base ); | |||
extern void _mesa_ListBase( GLuint base ); | |||
extern void gl_NewList( GLcontext *ctx, GLuint list, GLenum mode ); | |||
extern void _mesa_NewList( GLuint list, GLenum mode ); | |||
extern void gl_init_dlist_pointers( struct gl_api_table *table ); | |||
extern void _mesa_init_dlist_table( struct _glapi_table *table ); | |||
extern void gl_compile_cassette( GLcontext *ctx ); |
@@ -1,8 +1,8 @@ | |||
/* $Id: drawpix.c,v 1.5 1999/11/08 07:36:44 brianp Exp $ */ | |||
/* $Id: drawpix.c,v 1.6 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,19 +25,10 @@ | |||
*/ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <stdlib.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "drawpix.h" | |||
#include "feedback.h" | |||
@@ -53,23 +44,16 @@ | |||
/* TODO: apply texture mapping to fragments */ | |||
/* | |||
* Try to do a fast glDrawPixels. Conditions include: | |||
* not using a display list | |||
* simple pixel unpacking | |||
* no raster ops | |||
* etc.... | |||
* Try to do a fast and simple RGB(a) glDrawPixels. | |||
* Return: GL_TRUE if success, GL_FALSE if slow path must be used instead | |||
*/ | |||
GLboolean gl_direct_DrawPixels( GLcontext *ctx, | |||
const struct gl_pixelstore_attrib *unpack, | |||
GLsizei width, GLsizei height, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ) | |||
static GLboolean | |||
simple_DrawPixels( GLcontext *ctx, GLint x, GLint y, | |||
GLsizei width, GLsizei height, GLenum format, GLenum type, | |||
const GLvoid *pixels ) | |||
{ | |||
const struct gl_pixelstore_attrib *unpack = &ctx->Unpack; | |||
GLubyte rgb[MAX_WIDTH][3]; | |||
GLubyte rgba[MAX_WIDTH][4]; | |||
@@ -87,12 +71,10 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx, | |||
} | |||
/* see if device driver can do the drawpix */ | |||
if (ctx->Driver.DrawPixels) { | |||
GLint x = (GLint) (ctx->Current.RasterPos[0] + 0.5F); | |||
GLint y = (GLint) (ctx->Current.RasterPos[1] + 0.5F); | |||
if ((*ctx->Driver.DrawPixels)(ctx, x, y, width, height, format, type, | |||
unpack, pixels)) | |||
return GL_TRUE; | |||
if (ctx->Driver.DrawPixels | |||
&& (*ctx->Driver.DrawPixels)(ctx, x, y, width, height, format, type, | |||
unpack, pixels)) { | |||
return GL_TRUE; | |||
} | |||
if ((ctx->RasterMask&(~(SCISSOR_BIT|WINCLIP_BIT)))==0 | |||
@@ -106,8 +88,8 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx, | |||
&& !unpack->SwapBytes | |||
&& !unpack->LsbFirst) { | |||
GLint destX = (GLint) (ctx->Current.RasterPos[0] + 0.5F); | |||
GLint destY = (GLint) (ctx->Current.RasterPos[1] + 0.5F); | |||
GLint destX = x; | |||
GLint destY = y; | |||
GLint drawWidth = width; /* actual width drawn */ | |||
GLint drawHeight = height; /* actual height drawn */ | |||
GLint skipPixels = unpack->SkipPixels; | |||
@@ -364,10 +346,9 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx, | |||
return GL_FALSE; | |||
} | |||
} | |||
else { | |||
/* can't do direct render, have to use slow path */ | |||
return GL_FALSE; | |||
} | |||
/* can't do a simple draw, have to use slow path */ | |||
return GL_FALSE; | |||
} | |||
@@ -375,99 +356,43 @@ GLboolean gl_direct_DrawPixels( GLcontext *ctx, | |||
/* | |||
* Do glDrawPixels of index pixels. | |||
*/ | |||
static void draw_index_pixels( GLcontext *ctx, GLint x, GLint y, | |||
const struct gl_image *image ) | |||
static void | |||
draw_index_pixels( GLcontext *ctx, GLint x, GLint y, | |||
GLsizei width, GLsizei height, | |||
GLenum type, const GLvoid *pixels ) | |||
{ | |||
GLint width, height, widthInBytes; | |||
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; | |||
const GLint desty = y; | |||
GLint i, j; | |||
GLint row, drawWidth; | |||
GLdepth zspan[MAX_WIDTH]; | |||
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; | |||
assert(image); | |||
assert(image->Format == GL_COLOR_INDEX); | |||
width = image->Width; | |||
height = image->Height; | |||
if (image->Type == GL_BITMAP) | |||
widthInBytes = (width + 7) / 8; | |||
else | |||
widthInBytes = width; | |||
drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; | |||
/* Fragment depth values */ | |||
if (ctx->Depth.Test) { | |||
GLdepth zval = (GLdepth) (ctx->Current.RasterPos[2] * DEPTH_SCALE); | |||
for (i=0;i<width;i++) { | |||
GLint i; | |||
for (i = 0; i < drawWidth; i++) { | |||
zspan[i] = zval; | |||
} | |||
} | |||
/* process the image row by row */ | |||
for (i=0;i<height;i++,y++) { | |||
GLuint ispan[MAX_WIDTH]; | |||
/* convert to uints */ | |||
switch (image->Type) { | |||
case GL_UNSIGNED_BYTE: | |||
{ | |||
GLubyte *src = (GLubyte *) image->Data + i * width; | |||
for (j=0;j<width;j++) { | |||
ispan[j] = (GLuint) *src++; | |||
} | |||
} | |||
break; | |||
case GL_FLOAT: | |||
{ | |||
GLfloat *src = (GLfloat *) image->Data + i * width; | |||
for (j=0;j<width;j++) { | |||
ispan[j] = (GLuint) (GLint) *src++; | |||
} | |||
} | |||
break; | |||
case GL_BITMAP: | |||
{ | |||
GLubyte *src = (GLubyte *) image->Data + i * widthInBytes; | |||
for (j=0;j<width;j++) { | |||
ispan[j] = ( src[j >> 3] >> (7 - (j & 0x7)) ) & 1; | |||
} | |||
} | |||
break; | |||
default: | |||
gl_problem( ctx, "draw_index_pixels type" ); | |||
return; | |||
} | |||
/* apply shift and offset */ | |||
if (ctx->Pixel.IndexOffset || ctx->Pixel.IndexShift) { | |||
gl_shift_and_offset_ci( ctx, width, ispan ); | |||
} | |||
if (ctx->Visual->RGBAflag) { | |||
/* Convert index to RGBA and write to frame buffer */ | |||
GLubyte rgba[MAX_WIDTH][4]; | |||
gl_map_ci_to_rgba( ctx, width, ispan, rgba ); | |||
if (zoom) { | |||
gl_write_zoomed_rgba_span( ctx, width, x, y, zspan, | |||
(const GLubyte (*)[4])rgba, desty ); | |||
} | |||
else { | |||
gl_write_rgba_span( ctx, width, x, y, zspan, rgba, GL_BITMAP ); | |||
} | |||
/* | |||
* General solution | |||
*/ | |||
for (row = 0; row < height; row++, y++) { | |||
GLuint indexes[MAX_WIDTH]; | |||
const GLvoid *source = gl_pixel_addr_in_image(&ctx->Unpack, | |||
pixels, width, height, GL_COLOR_INDEX, type, 0, row, 0); | |||
_mesa_unpack_index_span(ctx, drawWidth, GL_UNSIGNED_INT, indexes, | |||
type, source, &ctx->Unpack, GL_TRUE); | |||
if (zoom) { | |||
gl_write_zoomed_index_span(ctx, drawWidth, x, y, zspan, indexes, desty); | |||
} | |||
else { | |||
/* optionally apply index map then write to frame buffer */ | |||
if (ctx->Pixel.MapColorFlag) { | |||
gl_map_ci(ctx, width, ispan); | |||
} | |||
if (zoom) { | |||
gl_write_zoomed_index_span( ctx, width, x, y, zspan, ispan, desty ); | |||
} | |||
else { | |||
gl_write_index_span( ctx, width, x, y, zspan, ispan, GL_BITMAP ); | |||
} | |||
gl_write_index_span(ctx, drawWidth, x, y, zspan, indexes, GL_BITMAP); | |||
} | |||
} | |||
} | |||
@@ -476,83 +401,44 @@ static void draw_index_pixels( GLcontext *ctx, GLint x, GLint y, | |||
* Do glDrawPixels of stencil image. The image datatype may either | |||
* be GLubyte or GLbitmap. | |||
*/ | |||
static void draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y, | |||
const struct gl_image *image ) | |||
static void | |||
draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y, | |||
GLsizei width, GLsizei height, | |||
GLenum type, const GLvoid *pixels ) | |||
{ | |||
GLint widthInBytes, width, height; | |||
const GLint desty = y; | |||
GLint i; | |||
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; | |||
if (image->Type != GL_BYTE && | |||
image->Type != GL_UNSIGNED_BYTE && | |||
image->Type != GL_SHORT && | |||
image->Type != GL_UNSIGNED_SHORT && | |||
image->Type != GL_INT && | |||
image->Type != GL_UNSIGNED_INT && | |||
image->Type != GL_FLOAT && | |||
image->Type != GL_BITMAP) { | |||
gl_error( ctx, GL_INVALID_OPERATION, "glDrawPixels(stencil type)"); | |||
const GLint desty = y; | |||
GLint row, drawWidth; | |||
if (type != GL_BYTE && | |||
type != GL_UNSIGNED_BYTE && | |||
type != GL_SHORT && | |||
type != GL_UNSIGNED_SHORT && | |||
type != GL_INT && | |||
type != GL_UNSIGNED_INT && | |||
type != GL_FLOAT && | |||
type != GL_BITMAP) { | |||
gl_error( ctx, GL_INVALID_ENUM, "glDrawPixels(stencil type)"); | |||
return; | |||
} | |||
assert(image); | |||
assert(image->Format == GL_STENCIL_INDEX); | |||
assert(image->Type == GL_UNSIGNED_BYTE || image->Type == GL_BITMAP); | |||
if (image->Type == GL_UNSIGNED_BYTE) | |||
widthInBytes = image->Width; | |||
else | |||
widthInBytes = (image->Width + 7) / 8; | |||
width = image->Width; | |||
height = image->Height; | |||
/* process the image row by row */ | |||
for (i=0;i<height;i++,y++) { | |||
GLstencil *src = (GLstencil*)image->Data + i * widthInBytes; | |||
GLstencil *stencilValues; | |||
GLstencil stencilCopy[MAX_WIDTH]; | |||
if (image->Type == GL_BITMAP) { | |||
/* convert bitmap data to GLubyte (0 or 1) data */ | |||
GLint j; | |||
for (j = 0; j < width; j++) { | |||
stencilCopy[j] = ( src[j >> 3] >> (7 - (j & 0x7)) ) & 1; | |||
} | |||
src = stencilCopy; | |||
} | |||
if (ctx->Pixel.IndexOffset || ctx->Pixel.IndexShift | |||
|| ctx->Pixel.MapStencilFlag) { | |||
drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; | |||
/* make copy of stencil values */ | |||
if (src != stencilCopy) | |||
MEMCPY( stencilCopy, src, width * sizeof(GLstencil)); | |||
for (row = 0; row < height; row++, y++) { | |||
GLstencil values[MAX_WIDTH]; | |||
GLenum destType = (sizeof(GLstencil) == sizeof(GLubyte)) | |||
? GL_UNSIGNED_BYTE : GL_UNSIGNED_SHORT; | |||
const GLvoid *source = gl_pixel_addr_in_image(&ctx->Unpack, | |||
pixels, width, height, GL_COLOR_INDEX, type, 0, row, 0); | |||
_mesa_unpack_index_span(ctx, drawWidth, destType, values, | |||
type, source, &ctx->Unpack, GL_TRUE); | |||
/* apply shift and offset */ | |||
if (ctx->Pixel.IndexOffset || ctx->Pixel.IndexShift) { | |||
gl_shift_and_offset_stencil( ctx, width, stencilCopy ); | |||
} | |||
/* mapping */ | |||
if (ctx->Pixel.MapStencilFlag) { | |||
gl_map_stencil( ctx, width, stencilCopy ); | |||
} | |||
stencilValues = stencilCopy; | |||
} | |||
else { | |||
/* use stencil values in-place */ | |||
stencilValues = src; | |||
} | |||
/* write stencil values to stencil buffer */ | |||
if (zoom) { | |||
gl_write_zoomed_stencil_span( ctx, (GLuint) width, x, y, | |||
stencilValues, desty ); | |||
gl_write_zoomed_stencil_span( ctx, (GLuint) drawWidth, x, y, | |||
values, desty ); | |||
} | |||
else { | |||
gl_write_stencil_span( ctx, (GLuint) width, x, y, stencilValues ); | |||
gl_write_stencil_span( ctx, (GLuint) drawWidth, x, y, values ); | |||
} | |||
} | |||
} | |||
@@ -562,30 +448,37 @@ static void draw_stencil_pixels( GLcontext *ctx, GLint x, GLint y, | |||
/* | |||
* Do a glDrawPixels of depth values. | |||
*/ | |||
static void draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, | |||
const struct gl_image *image ) | |||
static void | |||
draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, | |||
GLsizei width, GLsizei height, | |||
GLenum type, const GLvoid *pixels ) | |||
{ | |||
GLint width, height; | |||
const GLboolean bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0; | |||
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; | |||
const GLint desty = y; | |||
GLubyte rgba[MAX_WIDTH][4]; | |||
GLuint ispan[MAX_WIDTH]; | |||
const GLboolean bias_or_scale = ctx->Pixel.DepthBias!=0.0 || ctx->Pixel.DepthScale!=1.0; | |||
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; | |||
assert(image); | |||
assert(image->Format == GL_DEPTH_COMPONENT); | |||
width = image->Width; | |||
height = image->Height; | |||
GLint drawWidth = (width > MAX_WIDTH) ? MAX_WIDTH : width; | |||
if (type != GL_UNSIGNED_BYTE | |||
&& type != GL_UNSIGNED_BYTE | |||
&& type != GL_UNSIGNED_SHORT | |||
&& type != GL_UNSIGNED_SHORT | |||
&& type != GL_UNSIGNED_INT | |||
&& type != GL_UNSIGNED_INT | |||
&& type != GL_FLOAT) { | |||
gl_error(ctx, GL_INVALID_ENUM, "glDrawPixels(type)"); | |||
return; | |||
} | |||
/* Color or index */ | |||
/* Colors or indexes */ | |||
if (ctx->Visual->RGBAflag) { | |||
GLint r = (GLint) (ctx->Current.RasterColor[0] * 255.0F); | |||
GLint g = (GLint) (ctx->Current.RasterColor[1] * 255.0F); | |||
GLint b = (GLint) (ctx->Current.RasterColor[2] * 255.0F); | |||
GLint a = (GLint) (ctx->Current.RasterColor[3] * 255.0F); | |||
GLint i; | |||
for (i=0; i<width; i++) { | |||
for (i = 0; i < drawWidth; i++) { | |||
rgba[i][RCOMP] = r; | |||
rgba[i][GCOMP] = g; | |||
rgba[i][BCOMP] = b; | |||
@@ -594,34 +487,36 @@ static void draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, | |||
} | |||
else { | |||
GLint i; | |||
for (i=0;i<width;i++) { | |||
for (i = 0; i < drawWidth; i++) { | |||
ispan[i] = ctx->Current.RasterIndex; | |||
} | |||
} | |||
if (image->Type==GL_UNSIGNED_SHORT && sizeof(GLdepth)==sizeof(GLushort) | |||
if (type==GL_UNSIGNED_SHORT && sizeof(GLdepth)==sizeof(GLushort) | |||
&& !bias_or_scale && !zoom && ctx->Visual->RGBAflag) { | |||
/* Special case: directly write 16-bit depth values */ | |||
GLint j; | |||
for (j=0;j<height;j++,y++) { | |||
GLdepth *zptr = (GLdepth *) image->Data + j * width; | |||
GLint row; | |||
for (row = 0; row < height; row++, y++) { | |||
const GLdepth *zptr = gl_pixel_addr_in_image(&ctx->Unpack, | |||
pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0); | |||
gl_write_rgba_span( ctx, width, x, y, zptr, rgba, GL_BITMAP ); | |||
} | |||
} | |||
else if (image->Type==GL_UNSIGNED_INT && sizeof(GLdepth)==sizeof(GLuint) | |||
else if (type==GL_UNSIGNED_INT && sizeof(GLdepth)==sizeof(GLuint) | |||
&& !bias_or_scale && !zoom && ctx->Visual->RGBAflag) { | |||
/* Special case: directly write 32-bit depth values */ | |||
GLint i, j; | |||
GLint i, row; | |||
/* Compute shift value to scale 32-bit uints down to depth values. */ | |||
GLuint shift = 0; | |||
GLuint max = MAX_DEPTH; | |||
while ((max&0x80000000)==0) { | |||
while ((max & 0x80000000) == 0) { | |||
max = max << 1; | |||
shift++; | |||
} | |||
for (j=0;j<height;j++,y++) { | |||
for (row = 0; row < height; row++, y++) { | |||
GLdepth zspan[MAX_WIDTH]; | |||
GLuint *zptr = (GLuint *) image->Data + j * width; | |||
const GLdepth *zptr = gl_pixel_addr_in_image(&ctx->Unpack, | |||
pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0); | |||
for (i=0;i<width;i++) { | |||
zspan[i] = zptr[i] >> shift; | |||
} | |||
@@ -629,72 +524,30 @@ static void draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, | |||
} | |||
} | |||
else { | |||
/* General case (slower) */ | |||
GLint i, j; | |||
/* process image row by row */ | |||
for (i=0;i<height;i++,y++) { | |||
GLfloat depth[MAX_WIDTH]; | |||
/* General case */ | |||
GLint row; | |||
for (row = 0; row < height; row++, y++) { | |||
GLdepth zspan[MAX_WIDTH]; | |||
switch (image->Type) { | |||
case GL_UNSIGNED_SHORT: | |||
{ | |||
GLushort *src = (GLushort *) image->Data + i * width; | |||
for (j=0;j<width;j++) { | |||
depth[j] = USHORT_TO_FLOAT( *src++ ); | |||
} | |||
} | |||
break; | |||
case GL_UNSIGNED_INT: | |||
{ | |||
GLuint *src = (GLuint *) image->Data + i * width; | |||
for (j=0;j<width;j++) { | |||
depth[j] = UINT_TO_FLOAT( *src++ ); | |||
} | |||
} | |||
break; | |||
case GL_FLOAT: | |||
{ | |||
GLfloat *src = (GLfloat *) image->Data + i * width; | |||
for (j=0;j<width;j++) { | |||
depth[j] = *src++; | |||
} | |||
} | |||
break; | |||
default: | |||
gl_problem(ctx, "Bad type in draw_depth_pixels"); | |||
return; | |||
} | |||
/* apply depth scale and bias */ | |||
if (ctx->Pixel.DepthScale!=1.0 || ctx->Pixel.DepthBias!=0.0) { | |||
for (j=0;j<width;j++) { | |||
depth[j] = depth[j] * ctx->Pixel.DepthScale + ctx->Pixel.DepthBias; | |||
} | |||
} | |||
/* clamp depth values to [0,1] and convert from floats to integers */ | |||
for (j=0;j<width;j++) { | |||
zspan[j] = (GLdepth) (CLAMP( depth[j], 0.0F, 1.0F ) * DEPTH_SCALE); | |||
} | |||
const GLvoid *src = gl_pixel_addr_in_image(&ctx->Unpack, | |||
pixels, width, height, GL_DEPTH_COMPONENT, type, 0, row, 0); | |||
_mesa_unpack_depth_span( ctx, drawWidth, zspan, type, src, | |||
&ctx->Unpack, GL_TRUE ); | |||
if (ctx->Visual->RGBAflag) { | |||
if (zoom) { | |||
gl_write_zoomed_rgba_span( ctx, width, x, y, zspan, | |||
(const GLubyte (*)[4])rgba, desty ); | |||
gl_write_zoomed_rgba_span(ctx, width, x, y, zspan, | |||
(const GLubyte (*)[4])rgba, desty); | |||
} | |||
else { | |||
gl_write_rgba_span( ctx, width, x, y, zspan, rgba, GL_BITMAP ); | |||
gl_write_rgba_span(ctx, width, x, y, zspan, rgba, GL_BITMAP); | |||
} | |||
} | |||
else { | |||
if (zoom) { | |||
gl_write_zoomed_index_span( ctx, width, x, y, zspan, | |||
ispan, GL_BITMAP ); | |||
gl_write_zoomed_index_span(ctx, width, x, y, zspan, | |||
ispan, GL_BITMAP); | |||
} | |||
else { | |||
gl_write_index_span( ctx, width, x, y, zspan, ispan, GL_BITMAP ); | |||
gl_write_index_span(ctx, width, x, y, zspan, ispan, GL_BITMAP); | |||
} | |||
} | |||
@@ -703,184 +556,71 @@ static void draw_depth_pixels( GLcontext *ctx, GLint x, GLint y, | |||
} | |||
/* Simple unpacking parameters: */ | |||
static struct gl_pixelstore_attrib NoUnpack = { | |||
1, /* Alignment */ | |||
0, /* RowLength */ | |||
0, /* SkipPixels */ | |||
0, /* SkipRows */ | |||
0, /* ImageHeight */ | |||
0, /* SkipImages */ | |||
GL_FALSE, /* SwapBytes */ | |||
GL_FALSE /* LsbFirst */ | |||
}; | |||
/* | |||
* Do glDrawPixels of RGBA pixels. | |||
*/ | |||
static void draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, | |||
const struct gl_image *image ) | |||
static void | |||
draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y, | |||
GLsizei width, GLsizei height, | |||
GLenum format, GLenum type, const GLvoid *pixels ) | |||
{ | |||
GLint width, height; | |||
GLint i, j; | |||
const struct gl_pixelstore_attrib *unpack = &ctx->Unpack; | |||
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; | |||
const GLint desty = y; | |||
GLdepth zspan[MAX_WIDTH]; | |||
GLboolean quickDraw; | |||
const GLboolean zoom = ctx->Pixel.ZoomX!=1.0 || ctx->Pixel.ZoomY!=1.0; | |||
assert(image); | |||
/* Try an optimized glDrawPixels first */ | |||
if (gl_direct_DrawPixels(ctx, &NoUnpack, image->Width, image->Height, | |||
image->Format, image->Type, image->Data )) | |||
if (simple_DrawPixels(ctx, x, y, width, height, format, type, pixels)) | |||
return; | |||
width = image->Width; | |||
height = image->Height; | |||
/* Fragment depth values */ | |||
if (ctx->Depth.Test) { | |||
/* fill in array of z values */ | |||
GLdepth z = (GLdepth) (ctx->Current.RasterPos[2] * DEPTH_SCALE); | |||
GLint i; | |||
for (i=0;i<width;i++) { | |||
zspan[i] = z; | |||
} | |||
} | |||
if (ctx->RasterMask==0 && !zoom && x>=0 && y>=0 | |||
&& x+width<=ctx->Buffer->Width && y+height<=ctx->Buffer->Height) { | |||
if (ctx->RasterMask == 0 && !zoom | |||
&& x >= 0 && y >= 0 | |||
&& x + width <= ctx->Buffer->Width | |||
&& y + height <= ctx->Buffer->Height) { | |||
quickDraw = GL_TRUE; | |||
} | |||
else { | |||
quickDraw = GL_FALSE; | |||
} | |||
/* | |||
* General solution | |||
*/ | |||
{ | |||
/* General solution */ | |||
GLboolean r_flag, g_flag, b_flag, a_flag, l_flag; | |||
GLuint components; | |||
GLubyte rgba[MAX_WIDTH][4]; | |||
GLfloat rf[MAX_WIDTH]; | |||
GLfloat gf[MAX_WIDTH]; | |||
GLfloat bf[MAX_WIDTH]; | |||
DEFARRAY(GLfloat,af,MAX_WIDTH); | |||
CHECKARRAY(af,return); | |||
r_flag = g_flag = b_flag = a_flag = l_flag = GL_FALSE; | |||
switch (image->Format) { | |||
case GL_RED: | |||
r_flag = GL_TRUE; | |||
components = 1; | |||
break; | |||
case GL_GREEN: | |||
g_flag = GL_TRUE; | |||
components = 1; | |||
break; | |||
case GL_BLUE: | |||
b_flag = GL_TRUE; | |||
components = 1; | |||
break; | |||
case GL_ALPHA: | |||
a_flag = GL_TRUE; | |||
components = 1; | |||
break; | |||
case GL_RGB: | |||
r_flag = g_flag = b_flag = GL_TRUE; | |||
components = 3; | |||
break; | |||
case GL_LUMINANCE: | |||
l_flag = GL_TRUE; | |||
components = 1; | |||
break; | |||
case GL_LUMINANCE_ALPHA: | |||
l_flag = a_flag = GL_TRUE; | |||
components = 2; | |||
break; | |||
case GL_RGBA: | |||
r_flag = g_flag = b_flag = a_flag = GL_TRUE; | |||
components = 4; | |||
break; | |||
default: | |||
gl_problem(ctx, "Bad type in draw_rgba_pixels"); | |||
goto cleanup; | |||
} | |||
GLint row; | |||
if (width > MAX_WIDTH) | |||
width = MAX_WIDTH; | |||
for (row = 0; row < height; row++, y++) { | |||
const GLvoid *source = gl_pixel_addr_in_image(unpack, | |||
pixels, width, height, format, type, 0, row, 0); | |||
_mesa_unpack_ubyte_color_span(ctx, width, GL_RGBA, (void*) rgba, | |||
format, type, source, unpack, GL_TRUE); | |||
/* process the image row by row */ | |||
for (i=0;i<height;i++,y++) { | |||
/* convert to floats */ | |||
switch (image->Type) { | |||
case GL_UNSIGNED_BYTE: | |||
{ | |||
GLubyte *src = (GLubyte *) image->Data + i * width * components; | |||
for (j=0;j<width;j++) { | |||
if (l_flag) { | |||
rf[j] = gf[j] = bf[j] = UBYTE_TO_FLOAT(*src++); | |||
} | |||
else { | |||
rf[j] = r_flag ? UBYTE_TO_FLOAT(*src++) : 0.0; | |||
gf[j] = g_flag ? UBYTE_TO_FLOAT(*src++) : 0.0; | |||
bf[j] = b_flag ? UBYTE_TO_FLOAT(*src++) : 0.0; | |||
} | |||
af[j] = a_flag ? UBYTE_TO_FLOAT(*src++) : 1.0; | |||
} | |||
} | |||
break; | |||
case GL_FLOAT: | |||
{ | |||
GLfloat *src = (GLfloat *) image->Data + i * width * components; | |||
for (j=0;j<width;j++) { | |||
if (l_flag) { | |||
rf[j] = gf[j] = bf[j] = *src++; | |||
} | |||
else { | |||
rf[j] = r_flag ? *src++ : 0.0; | |||
gf[j] = g_flag ? *src++ : 0.0; | |||
bf[j] = b_flag ? *src++ : 0.0; | |||
} | |||
af[j] = a_flag ? *src++ : 1.0; | |||
} | |||
} | |||
break; | |||
default: | |||
gl_problem( ctx, "draw_rgba_pixels type" ); | |||
goto cleanup; | |||
} | |||
/* apply scale and bias */ | |||
if (ctx->Pixel.ScaleOrBiasRGBA) { | |||
gl_scale_and_bias_color(ctx, width, rf, gf, bf, af); | |||
} | |||
/* apply pixel mappings */ | |||
if (ctx->Pixel.MapColorFlag) { | |||
gl_map_color(ctx, width, rf, gf, bf, af); | |||
} | |||
/* convert to integers */ | |||
for (j=0;j<width;j++) { | |||
rgba[j][RCOMP] = (GLint) (rf[j] * 255.0F); | |||
rgba[j][GCOMP] = (GLint) (gf[j] * 255.0F); | |||
rgba[j][BCOMP] = (GLint) (bf[j] * 255.0F); | |||
rgba[j][ACOMP] = (GLint) (af[j] * 255.0F); | |||
} | |||
/* write to frame buffer */ | |||
if (quickDraw) { | |||
(*ctx->Driver.WriteRGBASpan)( ctx, width, x, y, | |||
(const GLubyte (*)[4])rgba, NULL); | |||
(*ctx->Driver.WriteRGBASpan)( ctx, width, x, y, | |||
(CONST GLubyte (*)[]) rgba, NULL); | |||
} | |||
else if (zoom) { | |||
gl_write_zoomed_rgba_span( ctx, width, x, y, zspan, | |||
(const GLubyte (*)[4])rgba, desty ); | |||
(CONST GLubyte (*)[]) rgba, desty ); | |||
} | |||
else { | |||
gl_write_rgba_span( ctx, (GLuint) width, x, y, zspan, rgba, GL_BITMAP); | |||
} | |||
} | |||
cleanup: | |||
UNDEFARRAY(af); | |||
} | |||
} | |||
@@ -889,45 +629,50 @@ cleanup: | |||
/* | |||
* Execute glDrawPixels | |||
*/ | |||
void gl_DrawPixels( GLcontext* ctx, struct gl_image *image ) | |||
void | |||
_mesa_DrawPixels( GLsizei width, GLsizei height, | |||
GLenum format, GLenum type, const GLvoid *pixels ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDrawPixels"); | |||
if (gl_image_error_test( ctx, image, "glDrawPixels" )) | |||
return; | |||
if (ctx->RenderMode==GL_RENDER) { | |||
GLint x, y; | |||
if (!ctx->Current.RasterPosValid) { | |||
if (!pixels || !ctx->Current.RasterPosValid) { | |||
return; | |||
} | |||
x = (GLint) (ctx->Current.RasterPos[0] + 0.5F); | |||
y = (GLint) (ctx->Current.RasterPos[1] + 0.5F); | |||
switch (image->Format) { | |||
case GL_COLOR_INDEX: | |||
draw_index_pixels( ctx, x, y, image ); | |||
break; | |||
switch (format) { | |||
case GL_STENCIL_INDEX: | |||
draw_stencil_pixels( ctx, x, y, image ); | |||
draw_stencil_pixels( ctx, x, y, width, height, type, pixels ); | |||
break; | |||
case GL_DEPTH_COMPONENT: | |||
draw_depth_pixels( ctx, x, y, image ); | |||
draw_depth_pixels( ctx, x, y, width, height, type, pixels ); | |||
break; | |||
case GL_COLOR_INDEX: | |||
if (ctx->Visual->RGBAflag) | |||
draw_index_pixels(ctx, x, y, width, height, type, pixels); | |||
else | |||
draw_rgba_pixels(ctx, x,y, width, height, format, type, pixels); | |||
break; | |||
case GL_RED: | |||
case GL_GREEN: | |||
case GL_BLUE: | |||
case GL_ALPHA: | |||
case GL_RGB: | |||
case GL_LUMINANCE: | |||
case GL_LUMINANCE_ALPHA: | |||
case GL_RGB: | |||
case GL_BGR: | |||
case GL_RGBA: | |||
draw_rgba_pixels( ctx, x, y, image ); | |||
case GL_BGRA: | |||
case GL_ABGR_EXT: | |||
draw_rgba_pixels(ctx, x, y, width, height, format, type, pixels); | |||
break; | |||
default: | |||
gl_error( ctx, GL_INVALID_ENUM, "glDrawPixels" ); | |||
gl_error( ctx, GL_INVALID_ENUM, "glDrawPixels(format)" ); | |||
return; | |||
} | |||
} |
@@ -1,8 +1,8 @@ | |||
/* $Id: drawpix.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: drawpix.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef DRAWPIXELS_H | |||
#define DRAWPIXELS_H | |||
@@ -35,20 +32,9 @@ | |||
#include "types.h" | |||
extern GLboolean | |||
gl_direct_DrawPixels( GLcontext *ctx, | |||
const struct gl_pixelstore_attrib *unpack, | |||
GLsizei width, GLsizei height, | |||
GLenum format, GLenum type, const GLvoid *pixels ); | |||
#if 000 | |||
extern void gl_DrawPixels( GLcontext *ctx, GLsizei width, GLsizei height, | |||
GLenum format, GLenum type, const GLvoid *pixels ); | |||
#endif | |||
extern void gl_DrawPixels( GLcontext *ctx, struct gl_image *image ); | |||
extern void | |||
_mesa_DrawPixels( GLsizei width, GLsizei height, | |||
GLenum format, GLenum type, const GLvoid *pixels ); | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: enable.c,v 1.9 1999/11/10 06:29:44 keithw Exp $ */ | |||
/* $Id: enable.c,v 1.10 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,17 +25,10 @@ | |||
*/ | |||
/* $XFree86: xc/lib/GL/mesa/src/enable.c,v 1.3 1999/04/04 00:20:23 dawes Exp $ */ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <stdio.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "enable.h" | |||
#include "light.h" | |||
@@ -54,7 +47,7 @@ | |||
/* | |||
* Perform glEnable and glDisable calls. | |||
*/ | |||
void gl_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) | |||
void _mesa_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) | |||
{ | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "gl_enable/disable" ); | |||
@@ -123,8 +116,8 @@ void gl_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) | |||
if (ctx->Light.ColorMaterialEnabled!=state) { | |||
ctx->Light.ColorMaterialEnabled = state; | |||
ctx->NewState |= NEW_LIGHTING; | |||
if (state) | |||
gl_update_color_material( ctx, ctx->Current.ByteColor ); | |||
if (state) | |||
gl_update_color_material( ctx, ctx->Current.ByteColor ); | |||
} | |||
break; | |||
case GL_CULL_FACE: | |||
@@ -478,22 +471,28 @@ void gl_set_enable( GLcontext *ctx, GLenum cap, GLboolean state ) | |||
void gl_Enable( GLcontext* ctx, GLenum cap ) | |||
void | |||
_mesa_Enable( GLenum cap ) | |||
{ | |||
gl_set_enable( ctx, cap, GL_TRUE ); | |||
GET_CURRENT_CONTEXT(ctx); | |||
_mesa_set_enable( ctx, cap, GL_TRUE ); | |||
} | |||
void gl_Disable( GLcontext* ctx, GLenum cap ) | |||
void | |||
_mesa_Disable( GLenum cap ) | |||
{ | |||
gl_set_enable( ctx, cap, GL_FALSE ); | |||
GET_CURRENT_CONTEXT(ctx); | |||
_mesa_set_enable( ctx, cap, GL_FALSE ); | |||
} | |||
GLboolean gl_IsEnabled( GLcontext* ctx, GLenum cap ) | |||
GLboolean | |||
_mesa_IsEnabled( GLenum cap ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
switch (cap) { | |||
case GL_ALPHA_TEST: | |||
return ctx->Color.AlphaEnabled; | |||
@@ -656,7 +655,8 @@ GLboolean gl_IsEnabled( GLcontext* ctx, GLenum cap ) | |||
static void gl_client_state( GLcontext *ctx, GLenum cap, GLboolean state ) | |||
static void | |||
client_state( GLcontext *ctx, GLenum cap, GLboolean state ) | |||
{ | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, | |||
(state | |||
@@ -691,15 +691,19 @@ static void gl_client_state( GLcontext *ctx, GLenum cap, GLboolean state ) | |||
void gl_EnableClientState( GLcontext *ctx, GLenum cap ) | |||
void | |||
_mesa_EnableClientState( GLenum cap ) | |||
{ | |||
gl_client_state( ctx, cap, GL_TRUE ); | |||
GET_CURRENT_CONTEXT(ctx); | |||
client_state( ctx, cap, GL_TRUE ); | |||
} | |||
void gl_DisableClientState( GLcontext *ctx, GLenum cap ) | |||
void | |||
_mesa_DisableClientState( GLenum cap ) | |||
{ | |||
gl_client_state( ctx, cap, GL_FALSE ); | |||
GET_CURRENT_CONTEXT(ctx); | |||
client_state( ctx, cap, GL_FALSE ); | |||
} | |||
@@ -1,8 +1,8 @@ | |||
/* $Id: enable.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: enable.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef ENABLE_H | |||
#define ENABLE_H | |||
@@ -35,17 +32,23 @@ | |||
#include "types.h" | |||
extern void gl_set_enable( GLcontext* ctx, GLenum cap, GLboolean state ); | |||
extern void | |||
_mesa_set_enable( GLcontext* ctx, GLenum cap, GLboolean state ); | |||
extern void gl_Disable( GLcontext* ctx, GLenum cap ); | |||
extern void | |||
_mesa_Disable( GLenum cap ); | |||
extern void gl_Enable( GLcontext* ctx, GLenum cap ); | |||
extern void | |||
_mesa_Enable( GLenum cap ); | |||
extern GLboolean gl_IsEnabled( GLcontext* ctx, GLenum cap ); | |||
extern GLboolean | |||
_mesa_IsEnabled( GLenum cap ); | |||
extern void gl_EnableClientState( GLcontext *ctx, GLenum cap ); | |||
extern void | |||
_mesa_EnableClientState( GLenum cap ); | |||
extern void gl_DisableClientState( GLcontext *ctx, GLenum cap ); | |||
extern void | |||
_mesa_DisableClientState( GLenum cap ); | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: enums.c,v 1.4 1999/11/08 07:36:44 brianp Exp $ */ | |||
/* $Id: enums.c,v 1.5 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -24,16 +24,14 @@ | |||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
*/ | |||
#ifndef XFree86Server | |||
#include <stdlib.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "GL/gl.h" | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#include "glheader.h" | |||
#include "enums.h" | |||
#include "macros.h" | |||
#include "mem.h" | |||
#endif | |||
typedef struct { |
@@ -1,8 +1,8 @@ | |||
/* $Id: eval.c,v 1.6 1999/11/08 15:30:05 brianp Exp $ */ | |||
/* $Id: eval.c,v 1.7 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -41,16 +41,11 @@ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <math.h> | |||
#include <stdlib.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "eval.h" | |||
#include "macros.h" | |||
#include "mem.h" | |||
#include "mmath.h" | |||
#include "types.h" | |||
#include "vbcull.h" | |||
@@ -528,9 +523,9 @@ de_casteljau_surf(GLfloat *cn, GLfloat *out, GLfloat *du, GLfloat *dv, | |||
/* | |||
* Return the number of components per control point for any type of | |||
* evaluator. Return 0 if bad target. | |||
* See table 5.1 in the OpenGL 1.2 spec. | |||
*/ | |||
static GLint components( GLenum target ) | |||
GLuint _mesa_evaluator_components( GLenum target ) | |||
{ | |||
switch (target) { | |||
case GL_MAP1_VERTEX_3: return 3; | |||
@@ -568,12 +563,11 @@ static GLint components( GLenum target ) | |||
* Return: pointer to buffer of contiguous control points or NULL if out | |||
* of memory. | |||
*/ | |||
GLfloat *gl_copy_map_points1f( GLenum target, | |||
GLint ustride, GLint uorder, | |||
GLfloat *gl_copy_map_points1f( GLenum target, GLint ustride, GLint uorder, | |||
const GLfloat *points ) | |||
{ | |||
GLfloat *buffer, *p; | |||
GLint i, k, size = components(target); | |||
GLint i, k, size = _mesa_evaluator_components(target); | |||
if (!points || size==0) { | |||
return NULL; | |||
@@ -594,12 +588,11 @@ GLfloat *gl_copy_map_points1f( GLenum target, | |||
/* | |||
* Same as above but convert doubles to floats. | |||
*/ | |||
GLfloat *gl_copy_map_points1d( GLenum target, | |||
GLint ustride, GLint uorder, | |||
const GLdouble *points ) | |||
GLfloat *gl_copy_map_points1d( GLenum target, GLint ustride, GLint uorder, | |||
const GLdouble *points ) | |||
{ | |||
GLfloat *buffer, *p; | |||
GLint i, k, size = components(target); | |||
GLint i, k, size = _mesa_evaluator_components(target); | |||
if (!points || size==0) { | |||
return NULL; | |||
@@ -628,15 +621,15 @@ GLfloat *gl_copy_map_points1d( GLenum target, | |||
* of memory. | |||
*/ | |||
GLfloat *gl_copy_map_points2f( GLenum target, | |||
GLint ustride, GLint uorder, | |||
GLint vstride, GLint vorder, | |||
const GLfloat *points ) | |||
GLint ustride, GLint uorder, | |||
GLint vstride, GLint vorder, | |||
const GLfloat *points ) | |||
{ | |||
GLfloat *buffer, *p; | |||
GLint i, j, k, size, dsize, hsize; | |||
GLint uinc; | |||
size = components(target); | |||
size = _mesa_evaluator_components(target); | |||
if (!points || size==0) { | |||
return NULL; | |||
@@ -679,7 +672,7 @@ GLfloat *gl_copy_map_points2d(GLenum target, | |||
GLint i, j, k, size, hsize, dsize; | |||
GLint uinc; | |||
size = components(target); | |||
size = _mesa_evaluator_components(target); | |||
if (!points || size==0) { | |||
return NULL; | |||
@@ -709,6 +702,7 @@ GLfloat *gl_copy_map_points2d(GLenum target, | |||
} | |||
#if 00 | |||
/* | |||
* This function is called by the display list deallocator function to | |||
* specify that a given set of control points are no longer needed. | |||
@@ -804,6 +798,7 @@ void gl_free_control_points( GLcontext* ctx, GLenum target, GLfloat *data ) | |||
} | |||
} | |||
#endif | |||
@@ -813,154 +808,130 @@ void gl_free_control_points( GLcontext* ctx, GLenum target, GLfloat *data ) | |||
/* | |||
* Note that the array of control points must be 'unpacked' at this time. | |||
* Input: retain - if TRUE, this control point data is also in a display | |||
* list and can't be freed until the list is freed. | |||
* This does the work of glMap1[fd]. | |||
*/ | |||
void gl_Map1f( GLcontext* ctx, GLenum target, | |||
GLfloat u1, GLfloat u2, GLint stride, | |||
GLint order, const GLfloat *points, GLboolean retain ) | |||
static void | |||
map1(GLenum target, GLfloat u1, GLfloat u2, GLint ustride, | |||
GLint uorder, const GLvoid *points, GLenum type ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint k; | |||
if (!points) { | |||
gl_error( ctx, GL_OUT_OF_MEMORY, "glMap1f" ); | |||
return; | |||
} | |||
/* may be a new stride after copying control points */ | |||
stride = components( target ); | |||
GLfloat *pnts; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMap1"); | |||
if (u1==u2) { | |||
assert(type == GL_FLOAT || type == GL_DOUBLE); | |||
if (u1 == u2) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glMap1(u1,u2)" ); | |||
return; | |||
} | |||
if (order<1 || order>MAX_EVAL_ORDER) { | |||
if (uorder < 1 || uorder > MAX_EVAL_ORDER) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glMap1(order)" ); | |||
return; | |||
} | |||
if (!points) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glMap1(points)" ); | |||
return; | |||
} | |||
k = components( target ); | |||
if (k==0) { | |||
k = _mesa_evaluator_components( target ); | |||
if (k == 0) { | |||
gl_error( ctx, GL_INVALID_ENUM, "glMap1(target)" ); | |||
} | |||
if (stride < k) { | |||
if (ustride < k) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glMap1(stride)" ); | |||
return; | |||
} | |||
/* make copy of the control points */ | |||
if (type == GL_FLOAT) | |||
pnts = gl_copy_map_points1f(target, ustride, uorder, (GLfloat*) points); | |||
else | |||
pnts = gl_copy_map_points1d(target, ustride, uorder, (GLdouble*) points); | |||
switch (target) { | |||
case GL_MAP1_VERTEX_3: | |||
ctx->EvalMap.Map1Vertex3.Order = order; | |||
ctx->EvalMap.Map1Vertex3.Order = uorder; | |||
ctx->EvalMap.Map1Vertex3.u1 = u1; | |||
ctx->EvalMap.Map1Vertex3.u2 = u2; | |||
ctx->EvalMap.Map1Vertex3.du = 1.0 / (u2 - u1); | |||
if (ctx->EvalMap.Map1Vertex3.Points | |||
&& !ctx->EvalMap.Map1Vertex3.Retain) { | |||
if (ctx->EvalMap.Map1Vertex3.Points) | |||
FREE( ctx->EvalMap.Map1Vertex3.Points ); | |||
} | |||
ctx->EvalMap.Map1Vertex3.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map1Vertex3.Retain = retain; | |||
ctx->EvalMap.Map1Vertex3.Points = pnts; | |||
break; | |||
case GL_MAP1_VERTEX_4: | |||
ctx->EvalMap.Map1Vertex4.Order = order; | |||
ctx->EvalMap.Map1Vertex4.Order = uorder; | |||
ctx->EvalMap.Map1Vertex4.u1 = u1; | |||
ctx->EvalMap.Map1Vertex4.u2 = u2; | |||
ctx->EvalMap.Map1Vertex4.du = 1.0 / (u2 - u1); | |||
if (ctx->EvalMap.Map1Vertex4.Points | |||
&& !ctx->EvalMap.Map1Vertex4.Retain) { | |||
if (ctx->EvalMap.Map1Vertex4.Points) | |||
FREE( ctx->EvalMap.Map1Vertex4.Points ); | |||
} | |||
ctx->EvalMap.Map1Vertex4.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map1Vertex4.Retain = retain; | |||
ctx->EvalMap.Map1Vertex4.Points = pnts; | |||
break; | |||
case GL_MAP1_INDEX: | |||
ctx->EvalMap.Map1Index.Order = order; | |||
ctx->EvalMap.Map1Index.Order = uorder; | |||
ctx->EvalMap.Map1Index.u1 = u1; | |||
ctx->EvalMap.Map1Index.u2 = u2; | |||
ctx->EvalMap.Map1Index.du = 1.0 / (u2 - u1); | |||
if (ctx->EvalMap.Map1Index.Points | |||
&& !ctx->EvalMap.Map1Index.Retain) { | |||
if (ctx->EvalMap.Map1Index.Points) | |||
FREE( ctx->EvalMap.Map1Index.Points ); | |||
} | |||
ctx->EvalMap.Map1Index.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map1Index.Retain = retain; | |||
ctx->EvalMap.Map1Index.Points = pnts; | |||
break; | |||
case GL_MAP1_COLOR_4: | |||
ctx->EvalMap.Map1Color4.Order = order; | |||
ctx->EvalMap.Map1Color4.Order = uorder; | |||
ctx->EvalMap.Map1Color4.u1 = u1; | |||
ctx->EvalMap.Map1Color4.u2 = u2; | |||
ctx->EvalMap.Map1Color4.du = 1.0 / (u2 - u1); | |||
if (ctx->EvalMap.Map1Color4.Points | |||
&& !ctx->EvalMap.Map1Color4.Retain) { | |||
if (ctx->EvalMap.Map1Color4.Points) | |||
FREE( ctx->EvalMap.Map1Color4.Points ); | |||
} | |||
ctx->EvalMap.Map1Color4.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map1Color4.Retain = retain; | |||
ctx->EvalMap.Map1Color4.Points = pnts; | |||
break; | |||
case GL_MAP1_NORMAL: | |||
ctx->EvalMap.Map1Normal.Order = order; | |||
ctx->EvalMap.Map1Normal.Order = uorder; | |||
ctx->EvalMap.Map1Normal.u1 = u1; | |||
ctx->EvalMap.Map1Normal.u2 = u2; | |||
ctx->EvalMap.Map1Normal.du = 1.0 / (u2 - u1); | |||
if (ctx->EvalMap.Map1Normal.Points | |||
&& !ctx->EvalMap.Map1Normal.Retain) { | |||
if (ctx->EvalMap.Map1Normal.Points) | |||
FREE( ctx->EvalMap.Map1Normal.Points ); | |||
} | |||
ctx->EvalMap.Map1Normal.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map1Normal.Retain = retain; | |||
ctx->EvalMap.Map1Normal.Points = pnts; | |||
break; | |||
case GL_MAP1_TEXTURE_COORD_1: | |||
ctx->EvalMap.Map1Texture1.Order = order; | |||
ctx->EvalMap.Map1Texture1.Order = uorder; | |||
ctx->EvalMap.Map1Texture1.u1 = u1; | |||
ctx->EvalMap.Map1Texture1.u2 = u2; | |||
ctx->EvalMap.Map1Texture1.du = 1.0 / (u2 - u1); | |||
if (ctx->EvalMap.Map1Texture1.Points | |||
&& !ctx->EvalMap.Map1Texture1.Retain) { | |||
if (ctx->EvalMap.Map1Texture1.Points) | |||
FREE( ctx->EvalMap.Map1Texture1.Points ); | |||
} | |||
ctx->EvalMap.Map1Texture1.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map1Texture1.Retain = retain; | |||
ctx->EvalMap.Map1Texture1.Points = pnts; | |||
break; | |||
case GL_MAP1_TEXTURE_COORD_2: | |||
ctx->EvalMap.Map1Texture2.Order = order; | |||
ctx->EvalMap.Map1Texture2.Order = uorder; | |||
ctx->EvalMap.Map1Texture2.u1 = u1; | |||
ctx->EvalMap.Map1Texture2.u2 = u2; | |||
ctx->EvalMap.Map1Texture2.du = 1.0 / (u2 - u1); | |||
if (ctx->EvalMap.Map1Texture2.Points | |||
&& !ctx->EvalMap.Map1Texture2.Retain) { | |||
if (ctx->EvalMap.Map1Texture2.Points) | |||
FREE( ctx->EvalMap.Map1Texture2.Points ); | |||
} | |||
ctx->EvalMap.Map1Texture2.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map1Texture2.Retain = retain; | |||
ctx->EvalMap.Map1Texture2.Points = pnts; | |||
break; | |||
case GL_MAP1_TEXTURE_COORD_3: | |||
ctx->EvalMap.Map1Texture3.Order = order; | |||
ctx->EvalMap.Map1Texture3.Order = uorder; | |||
ctx->EvalMap.Map1Texture3.u1 = u1; | |||
ctx->EvalMap.Map1Texture3.u2 = u2; | |||
ctx->EvalMap.Map1Texture3.du = 1.0 / (u2 - u1); | |||
if (ctx->EvalMap.Map1Texture3.Points | |||
&& !ctx->EvalMap.Map1Texture3.Retain) { | |||
if (ctx->EvalMap.Map1Texture3.Points) | |||
FREE( ctx->EvalMap.Map1Texture3.Points ); | |||
} | |||
ctx->EvalMap.Map1Texture3.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map1Texture3.Retain = retain; | |||
ctx->EvalMap.Map1Texture3.Points = pnts; | |||
break; | |||
case GL_MAP1_TEXTURE_COORD_4: | |||
ctx->EvalMap.Map1Texture4.Order = order; | |||
ctx->EvalMap.Map1Texture4.Order = uorder; | |||
ctx->EvalMap.Map1Texture4.u1 = u1; | |||
ctx->EvalMap.Map1Texture4.u2 = u2; | |||
ctx->EvalMap.Map1Texture4.du = 1.0 / (u2 - u1); | |||
if (ctx->EvalMap.Map1Texture4.Points | |||
&& !ctx->EvalMap.Map1Texture4.Retain) { | |||
if (ctx->EvalMap.Map1Texture4.Points) | |||
FREE( ctx->EvalMap.Map1Texture4.Points ); | |||
} | |||
ctx->EvalMap.Map1Texture4.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map1Texture4.Retain = retain; | |||
ctx->EvalMap.Map1Texture4.Points = pnts; | |||
break; | |||
default: | |||
gl_error( ctx, GL_INVALID_ENUM, "glMap1(target)" ); | |||
@@ -969,18 +940,30 @@ void gl_Map1f( GLcontext* ctx, GLenum target, | |||
void | |||
_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, | |||
GLint order, const GLfloat *points ) | |||
{ | |||
map1(target, u1, u2, stride, order, points, GL_FLOAT); | |||
} | |||
/* | |||
* Note that the array of control points must be 'unpacked' at this time. | |||
* Input: retain - if TRUE, this control point data is also in a display | |||
* list and can't be freed until the list is freed. | |||
*/ | |||
void gl_Map2f( GLcontext* ctx, GLenum target, | |||
GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, | |||
GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, | |||
const GLfloat *points, GLboolean retain ) | |||
void | |||
_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, | |||
GLint order, const GLdouble *points ) | |||
{ | |||
map1(target, u1, u2, stride, order, points, GL_DOUBLE); | |||
} | |||
static void | |||
map2( GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, | |||
GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, | |||
const GLvoid *points, GLenum type ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint k; | |||
GLfloat *pnts; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMap2"); | |||
@@ -1004,7 +987,7 @@ void gl_Map2f( GLcontext* ctx, GLenum target, | |||
return; | |||
} | |||
k = components( target ); | |||
k = _mesa_evaluator_components( target ); | |||
if (k==0) { | |||
gl_error( ctx, GL_INVALID_ENUM, "glMap2(target)" ); | |||
} | |||
@@ -1018,6 +1001,14 @@ void gl_Map2f( GLcontext* ctx, GLenum target, | |||
return; | |||
} | |||
/* make copy of the control points */ | |||
if (type == GL_FLOAT) | |||
pnts = gl_copy_map_points2f(target, ustride, uorder, | |||
vstride, vorder, (GLfloat*) points); | |||
else | |||
pnts = gl_copy_map_points2d(target, ustride, uorder, | |||
vstride, vorder, (GLdouble*) points); | |||
switch (target) { | |||
case GL_MAP2_VERTEX_3: | |||
ctx->EvalMap.Map2Vertex3.Uorder = uorder; | |||
@@ -1028,12 +1019,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, | |||
ctx->EvalMap.Map2Vertex3.v1 = v1; | |||
ctx->EvalMap.Map2Vertex3.v2 = v2; | |||
ctx->EvalMap.Map2Vertex3.dv = 1.0 / (v2 - v1); | |||
if (ctx->EvalMap.Map2Vertex3.Points | |||
&& !ctx->EvalMap.Map2Vertex3.Retain) { | |||
if (ctx->EvalMap.Map2Vertex3.Points) | |||
FREE( ctx->EvalMap.Map2Vertex3.Points ); | |||
} | |||
ctx->EvalMap.Map2Vertex3.Retain = retain; | |||
ctx->EvalMap.Map2Vertex3.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map2Vertex3.Points = pnts; | |||
break; | |||
case GL_MAP2_VERTEX_4: | |||
ctx->EvalMap.Map2Vertex4.Uorder = uorder; | |||
@@ -1044,12 +1032,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, | |||
ctx->EvalMap.Map2Vertex4.v1 = v1; | |||
ctx->EvalMap.Map2Vertex4.v2 = v2; | |||
ctx->EvalMap.Map2Vertex4.dv = 1.0 / (v2 - v1); | |||
if (ctx->EvalMap.Map2Vertex4.Points | |||
&& !ctx->EvalMap.Map2Vertex4.Retain) { | |||
if (ctx->EvalMap.Map2Vertex4.Points) | |||
FREE( ctx->EvalMap.Map2Vertex4.Points ); | |||
} | |||
ctx->EvalMap.Map2Vertex4.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map2Vertex4.Retain = retain; | |||
ctx->EvalMap.Map2Vertex4.Points = pnts; | |||
break; | |||
case GL_MAP2_INDEX: | |||
ctx->EvalMap.Map2Index.Uorder = uorder; | |||
@@ -1060,12 +1045,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, | |||
ctx->EvalMap.Map2Index.v1 = v1; | |||
ctx->EvalMap.Map2Index.v2 = v2; | |||
ctx->EvalMap.Map2Index.dv = 1.0 / (v2 - v1); | |||
if (ctx->EvalMap.Map2Index.Points | |||
&& !ctx->EvalMap.Map2Index.Retain) { | |||
if (ctx->EvalMap.Map2Index.Points) | |||
FREE( ctx->EvalMap.Map2Index.Points ); | |||
} | |||
ctx->EvalMap.Map2Index.Retain = retain; | |||
ctx->EvalMap.Map2Index.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map2Index.Points = pnts; | |||
break; | |||
case GL_MAP2_COLOR_4: | |||
ctx->EvalMap.Map2Color4.Uorder = uorder; | |||
@@ -1076,12 +1058,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, | |||
ctx->EvalMap.Map2Color4.v1 = v1; | |||
ctx->EvalMap.Map2Color4.v2 = v2; | |||
ctx->EvalMap.Map2Color4.dv = 1.0 / (v2 - v1); | |||
if (ctx->EvalMap.Map2Color4.Points | |||
&& !ctx->EvalMap.Map2Color4.Retain) { | |||
if (ctx->EvalMap.Map2Color4.Points) | |||
FREE( ctx->EvalMap.Map2Color4.Points ); | |||
} | |||
ctx->EvalMap.Map2Color4.Retain = retain; | |||
ctx->EvalMap.Map2Color4.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map2Color4.Points = pnts; | |||
break; | |||
case GL_MAP2_NORMAL: | |||
ctx->EvalMap.Map2Normal.Uorder = uorder; | |||
@@ -1092,12 +1071,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, | |||
ctx->EvalMap.Map2Normal.v1 = v1; | |||
ctx->EvalMap.Map2Normal.v2 = v2; | |||
ctx->EvalMap.Map2Normal.dv = 1.0 / (v2 - v1); | |||
if (ctx->EvalMap.Map2Normal.Points | |||
&& !ctx->EvalMap.Map2Normal.Retain) { | |||
if (ctx->EvalMap.Map2Normal.Points) | |||
FREE( ctx->EvalMap.Map2Normal.Points ); | |||
} | |||
ctx->EvalMap.Map2Normal.Retain = retain; | |||
ctx->EvalMap.Map2Normal.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map2Normal.Points = pnts; | |||
break; | |||
case GL_MAP2_TEXTURE_COORD_1: | |||
ctx->EvalMap.Map2Texture1.Uorder = uorder; | |||
@@ -1108,12 +1084,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, | |||
ctx->EvalMap.Map2Texture1.v1 = v1; | |||
ctx->EvalMap.Map2Texture1.v2 = v2; | |||
ctx->EvalMap.Map2Texture1.dv = 1.0 / (v2 - v1); | |||
if (ctx->EvalMap.Map2Texture1.Points | |||
&& !ctx->EvalMap.Map2Texture1.Retain) { | |||
if (ctx->EvalMap.Map2Texture1.Points) | |||
FREE( ctx->EvalMap.Map2Texture1.Points ); | |||
} | |||
ctx->EvalMap.Map2Texture1.Retain = retain; | |||
ctx->EvalMap.Map2Texture1.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map2Texture1.Points = pnts; | |||
break; | |||
case GL_MAP2_TEXTURE_COORD_2: | |||
ctx->EvalMap.Map2Texture2.Uorder = uorder; | |||
@@ -1124,12 +1097,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, | |||
ctx->EvalMap.Map2Texture2.v1 = v1; | |||
ctx->EvalMap.Map2Texture2.v2 = v2; | |||
ctx->EvalMap.Map2Texture2.dv = 1.0 / (v2 - v1); | |||
if (ctx->EvalMap.Map2Texture2.Points | |||
&& !ctx->EvalMap.Map2Texture2.Retain) { | |||
if (ctx->EvalMap.Map2Texture2.Points) | |||
FREE( ctx->EvalMap.Map2Texture2.Points ); | |||
} | |||
ctx->EvalMap.Map2Texture2.Retain = retain; | |||
ctx->EvalMap.Map2Texture2.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map2Texture2.Points = pnts; | |||
break; | |||
case GL_MAP2_TEXTURE_COORD_3: | |||
ctx->EvalMap.Map2Texture3.Uorder = uorder; | |||
@@ -1140,12 +1110,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, | |||
ctx->EvalMap.Map2Texture3.v1 = v1; | |||
ctx->EvalMap.Map2Texture3.v2 = v2; | |||
ctx->EvalMap.Map2Texture3.dv = 1.0 / (v2 - v1); | |||
if (ctx->EvalMap.Map2Texture3.Points | |||
&& !ctx->EvalMap.Map2Texture3.Retain) { | |||
if (ctx->EvalMap.Map2Texture3.Points) | |||
FREE( ctx->EvalMap.Map2Texture3.Points ); | |||
} | |||
ctx->EvalMap.Map2Texture3.Retain = retain; | |||
ctx->EvalMap.Map2Texture3.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map2Texture3.Points = pnts; | |||
break; | |||
case GL_MAP2_TEXTURE_COORD_4: | |||
ctx->EvalMap.Map2Texture4.Uorder = uorder; | |||
@@ -1156,12 +1123,9 @@ void gl_Map2f( GLcontext* ctx, GLenum target, | |||
ctx->EvalMap.Map2Texture4.v1 = v1; | |||
ctx->EvalMap.Map2Texture4.v2 = v2; | |||
ctx->EvalMap.Map2Texture4.dv = 1.0 / (v2 - v1); | |||
if (ctx->EvalMap.Map2Texture4.Points | |||
&& !ctx->EvalMap.Map2Texture4.Retain) { | |||
if (ctx->EvalMap.Map2Texture4.Points) | |||
FREE( ctx->EvalMap.Map2Texture4.Points ); | |||
} | |||
ctx->EvalMap.Map2Texture4.Retain = retain; | |||
ctx->EvalMap.Map2Texture4.Points = (GLfloat *) points; | |||
ctx->EvalMap.Map2Texture4.Points = pnts; | |||
break; | |||
default: | |||
gl_error( ctx, GL_INVALID_ENUM, "glMap2(target)" ); | |||
@@ -1169,11 +1133,33 @@ void gl_Map2f( GLcontext* ctx, GLenum target, | |||
} | |||
void | |||
_mesa_Map2f( GLenum target, | |||
GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, | |||
GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, | |||
const GLfloat *points) | |||
{ | |||
map2(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, | |||
points, GL_FLOAT); | |||
} | |||
void gl_GetMapdv( GLcontext* ctx, GLenum target, GLenum query, GLdouble *v ) | |||
void | |||
_mesa_Map2d( GLenum target, | |||
GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, | |||
GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, | |||
const GLdouble *points ) | |||
{ | |||
map2(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, | |||
points, GL_DOUBLE); | |||
} | |||
void | |||
_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint i, n; | |||
GLfloat *data; | |||
@@ -1443,8 +1429,10 @@ void gl_GetMapdv( GLcontext* ctx, GLenum target, GLenum query, GLdouble *v ) | |||
} | |||
void gl_GetMapfv( GLcontext* ctx, GLenum target, GLenum query, GLfloat *v ) | |||
void | |||
_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint i, n; | |||
GLfloat *data; | |||
@@ -1714,8 +1702,10 @@ void gl_GetMapfv( GLcontext* ctx, GLenum target, GLenum query, GLfloat *v ) | |||
} | |||
void gl_GetMapiv( GLcontext* ctx, GLenum target, GLenum query, GLint *v ) | |||
void | |||
_mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint i, n; | |||
GLfloat *data; | |||
@@ -2613,8 +2603,10 @@ void gl_eval_vb( struct vertex_buffer *VB ) | |||
} | |||
void gl_MapGrid1f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2 ) | |||
void | |||
_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMapGrid1f"); | |||
if (un<1) { | |||
@@ -2628,9 +2620,18 @@ void gl_MapGrid1f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2 ) | |||
} | |||
void gl_MapGrid2f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2, | |||
GLint vn, GLfloat v1, GLfloat v2 ) | |||
void | |||
_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ) | |||
{ | |||
_mesa_MapGrid1f( un, u1, u2 ); | |||
} | |||
void | |||
_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, | |||
GLint vn, GLfloat v1, GLfloat v2 ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMapGrid2f"); | |||
if (un<1) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glMapGrid2f(un)" ); | |||
@@ -2651,9 +2652,185 @@ void gl_MapGrid2f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2, | |||
} | |||
void | |||
_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, | |||
GLint vn, GLdouble v1, GLdouble v2 ) | |||
{ | |||
_mesa_MapGrid2f( un, u1, u2, vn, v1, v2 ); | |||
} | |||
/* KW: If are compiling, we don't know whether eval will produce a | |||
* vertex when it is run in the future. If this is pure immediate | |||
* mode, eval is a noop if neither vertex map is enabled. | |||
* | |||
* Thus we need to have a check in the display list code or | |||
* elsewhere for eval(1,2) vertices in the case where | |||
* map(1,2)_vertex is disabled, and to purge those vertices from | |||
* the vb. This is currently done | |||
* via modifications to the cull_vb and render_vb operations, and | |||
* by using the existing cullmask mechanism for all other operations. | |||
*/ | |||
/* KW: Because the eval values don't become 'current', fixup will flow | |||
* through these vertices, and then evaluation will write on top | |||
* of the fixup results. | |||
* | |||
* This is a little inefficient, but at least it is correct. This | |||
* could be short-circuited in the case where all vertices are | |||
* eval-vertices, or more generally by a cullmask in fixup. | |||
* | |||
* Note: using Obj to hold eval coord data. This data is actually | |||
* transformed if eval is disabled. But disabling eval & sending | |||
* eval coords is stupid, right? | |||
*/ | |||
#define EVALCOORD1(IM, x) \ | |||
{ \ | |||
GLuint count = IM->Count++; \ | |||
IM->Flag[count] |= VERT_EVAL_C1; \ | |||
ASSIGN_4V(IM->Obj[count], x, 0, 0, 1); \ | |||
if (count == VB_MAX-1) \ | |||
IM->maybe_transform_vb( IM ); \ | |||
} | |||
#define EVALCOORD2(IM, x, y) \ | |||
{ \ | |||
GLuint count = IM->Count++; \ | |||
IM->Flag[count] |= VERT_EVAL_C2; \ | |||
ASSIGN_4V(IM->Obj[count], x, y, 0, 1); \ | |||
if (count == VB_MAX-1) \ | |||
IM->maybe_transform_vb( IM ); \ | |||
} | |||
#define EVALPOINT1(IM, x) \ | |||
{ \ | |||
GLuint count = IM->Count++; \ | |||
IM->Flag[count] |= VERT_EVAL_P1; \ | |||
ASSIGN_4V(IM->Obj[count], x, 0, 0, 1); \ | |||
if (count == VB_MAX-1) \ | |||
IM->maybe_transform_vb( IM ); \ | |||
} | |||
#define EVALPOINT2(IM, x, y) \ | |||
{ \ | |||
GLuint count = IM->Count++; \ | |||
IM->Flag[count] |= VERT_EVAL_P2; \ | |||
ASSIGN_4V(IM->Obj[count], x, y, 0, 1); \ | |||
if (count == VB_MAX-1) \ | |||
IM->maybe_transform_vb( IM ); \ | |||
} | |||
/* Lame internal function: | |||
*/ | |||
void gl_EvalCoord1f( GLcontext *CC, GLfloat u ) | |||
{ | |||
struct immediate *i = CC->input; | |||
EVALCOORD1( i, u ); | |||
} | |||
void | |||
_mesa_EvalCoord1d( GLdouble u ) | |||
{ | |||
GET_IMMEDIATE; | |||
EVALCOORD1( IM, (GLfloat) u ); | |||
} | |||
void | |||
_mesa_EvalCoord1f( GLfloat u ) | |||
{ | |||
GET_IMMEDIATE; | |||
EVALCOORD1( IM, u ); | |||
} | |||
void | |||
_mesa_EvalCoord1dv( const GLdouble *u ) | |||
{ | |||
GET_IMMEDIATE; | |||
EVALCOORD1( IM, (GLfloat) *u ); | |||
} | |||
void | |||
_mesa_EvalCoord1fv( const GLfloat *u ) | |||
{ | |||
GET_IMMEDIATE; | |||
EVALCOORD1( IM, (GLfloat) *u ); | |||
} | |||
void | |||
_mesa_EvalCoord2d( GLdouble u, GLdouble v ) | |||
{ | |||
GET_IMMEDIATE; | |||
EVALCOORD2( IM, (GLfloat) u, (GLfloat) v ); | |||
} | |||
void | |||
_mesa_EvalCoord2f( GLfloat u, GLfloat v ) | |||
{ | |||
GET_IMMEDIATE; | |||
EVALCOORD2( IM, u, v ); | |||
} | |||
/* Lame internal function: | |||
*/ | |||
void gl_EvalCoord2f( GLcontext *CC, GLfloat u, GLfloat v ) | |||
{ | |||
struct immediate *i = CC->input; | |||
EVALCOORD2( i, u, v ); | |||
} | |||
void | |||
_mesa_EvalCoord2dv( const GLdouble *u ) | |||
{ | |||
GET_IMMEDIATE; | |||
EVALCOORD2( IM, (GLfloat) u[0], (GLfloat) u[1] ); | |||
} | |||
void | |||
_mesa_EvalCoord2fv( const GLfloat *u ) | |||
{ | |||
GET_IMMEDIATE; | |||
EVALCOORD2( IM, u[0], u[1] ); | |||
} | |||
void | |||
_mesa_EvalPoint1( GLint i ) | |||
{ | |||
GET_IMMEDIATE; | |||
EVALPOINT1( IM, i ); | |||
} | |||
void | |||
_mesa_EvalPoint2( GLint i, GLint j ) | |||
{ | |||
GET_IMMEDIATE; | |||
EVALPOINT2( IM, i, j ); | |||
} | |||
void gl_EvalMesh1( GLcontext* ctx, GLenum mode, GLint i1, GLint i2 ) | |||
void | |||
_mesa_EvalMesh1( GLenum mode, GLint i1, GLint i2 ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint i; | |||
GLfloat u, du; | |||
GLenum prim; | |||
@@ -2693,11 +2870,10 @@ void gl_EvalMesh1( GLcontext* ctx, GLenum mode, GLint i1, GLint i2 ) | |||
void gl_EvalMesh2( GLcontext* ctx, | |||
GLenum mode, | |||
GLint i1, GLint i2, | |||
GLint j1, GLint j2 ) | |||
void | |||
_mesa_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint i, j; | |||
GLfloat u, du, v, dv, v1, u1; | |||
@@ -2758,3 +2934,6 @@ void gl_EvalMesh2( GLcontext* ctx, | |||
return; | |||
} | |||
} | |||
@@ -1,8 +1,8 @@ | |||
/* $Id: eval.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: eval.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -35,6 +35,9 @@ | |||
extern void gl_init_eval( void ); | |||
extern GLuint _mesa_evaluator_components( GLenum target ); | |||
extern void gl_free_control_points( GLcontext *ctx, | |||
GLenum target, GLfloat *data ); | |||
@@ -58,38 +61,86 @@ extern GLfloat *gl_copy_map_points2d(GLenum target, | |||
const GLdouble *points ); | |||
extern void gl_Map1f( GLcontext* ctx, | |||
GLenum target, GLfloat u1, GLfloat u2, GLint stride, | |||
GLint order, const GLfloat *points, GLboolean retain ); | |||
extern void gl_eval_vb( struct vertex_buffer *VB ); | |||
extern void gl_Map2f( GLcontext* ctx, GLenum target, | |||
GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, | |||
GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, | |||
const GLfloat *points, GLboolean retain ); | |||
extern void | |||
_mesa_Map1f( GLenum target, GLfloat u1, GLfloat u2, GLint stride, | |||
GLint order, const GLfloat *points ); | |||
extern void | |||
_mesa_Map2f( GLenum target, | |||
GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, | |||
GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, | |||
const GLfloat *points ); | |||
extern void gl_MapGrid1f( GLcontext* ctx, GLint un, GLfloat u1, GLfloat u2 ); | |||
extern void | |||
_mesa_Map1d( GLenum target, GLdouble u1, GLdouble u2, GLint stride, | |||
GLint order, const GLdouble *points ); | |||
extern void gl_MapGrid2f( GLcontext* ctx, | |||
GLint un, GLfloat u1, GLfloat u2, | |||
GLint vn, GLfloat v1, GLfloat v2 ); | |||
extern void | |||
_mesa_Map2d( GLenum target, | |||
GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, | |||
GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, | |||
const GLdouble *points ); | |||
extern void gl_GetMapdv( GLcontext* ctx, | |||
GLenum target, GLenum query, GLdouble *v ); | |||
extern void | |||
_mesa_MapGrid1f( GLint un, GLfloat u1, GLfloat u2 ); | |||
extern void gl_GetMapfv( GLcontext* ctx, | |||
GLenum target, GLenum query, GLfloat *v ); | |||
extern void | |||
_mesa_MapGrid1d( GLint un, GLdouble u1, GLdouble u2 ); | |||
extern void gl_GetMapiv( GLcontext* ctx, | |||
GLenum target, GLenum query, GLint *v ); | |||
extern void | |||
_mesa_MapGrid2f( GLint un, GLfloat u1, GLfloat u2, | |||
GLint vn, GLfloat v1, GLfloat v2 ); | |||
extern void gl_EvalMesh1( GLcontext* ctx, GLenum mode, GLint i1, GLint i2 ); | |||
extern void | |||
_mesa_MapGrid2d( GLint un, GLdouble u1, GLdouble u2, | |||
GLint vn, GLdouble v1, GLdouble v2 ); | |||
extern void gl_EvalMesh2( GLcontext* ctx, GLenum mode, | |||
GLint i1, GLint i2, GLint j1, GLint j2 ); | |||
extern void | |||
_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ); | |||
extern void gl_eval_vb( struct vertex_buffer *VB ); | |||
extern void | |||
_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ); | |||
extern void | |||
_mesa_GetMapiv( GLenum target, GLenum query, GLint *v ); | |||
extern void | |||
_mesa_EvalMesh1( GLenum mode, GLint i1, GLint i2 ); | |||
extern void | |||
_mesa_EvalMesh2( GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2 ); | |||
extern void | |||
_mesa_EvalCoord1d( GLdouble u ); | |||
extern void | |||
_mesa_EvalCoord1f( GLfloat u ); | |||
extern void | |||
_mesa_EvalCoord1dv( const GLdouble *u ); | |||
extern void | |||
_mesa_EvalCoord1fv( const GLfloat *u ); | |||
extern void | |||
_mesa_EvalCoord2d( GLdouble u, GLdouble v ); | |||
extern void | |||
_mesa_EvalCoord2f( GLfloat u, GLfloat v ); | |||
extern void | |||
_mesa_EvalCoord2dv( const GLdouble *u ); | |||
extern void | |||
_mesa_EvalCoord2fv( const GLfloat *u ); | |||
extern void | |||
_mesa_EvalPoint1( GLint i ); | |||
extern void | |||
_mesa_EvalPoint2( GLint i, GLint j ); | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: extensions.c,v 1.10 1999/11/08 07:36:44 brianp Exp $ */ | |||
/* $Id: extensions.c,v 1.11 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,15 +25,16 @@ | |||
*/ | |||
#ifndef XFree86Server | |||
#include <stdlib.h> | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "extensions.h" | |||
#include "mem.h" | |||
#include "simple_list.h" | |||
#include "types.h" | |||
#endif | |||
#define MAX_EXT_NAMELEN 80 |
@@ -1,8 +1,8 @@ | |||
/* $Id: feedback.c,v 1.5 1999/11/08 07:36:44 brianp Exp $ */ | |||
/* $Id: feedback.c,v 1.6 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,18 +25,10 @@ | |||
*/ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <stdio.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "enums.h" | |||
#include "feedback.h" | |||
@@ -57,8 +49,9 @@ | |||
void | |||
gl_FeedbackBuffer( GLcontext *ctx, GLsizei size, GLenum type, GLfloat *buffer ) | |||
_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "glFeedbackBuffer" ); | |||
if (ctx->RenderMode==GL_FEEDBACK) { | |||
@@ -114,8 +107,10 @@ gl_FeedbackBuffer( GLcontext *ctx, GLsizei size, GLenum type, GLfloat *buffer ) | |||
void gl_PassThrough( GLcontext *ctx, GLfloat token ) | |||
void | |||
_mesa_PassThrough( GLfloat token ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPassThrough"); | |||
if (ctx->RenderMode==GL_FEEDBACK) { | |||
@@ -256,8 +251,10 @@ void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last ) | |||
/* | |||
* NOTE: this function can't be put in a display list. | |||
*/ | |||
void gl_SelectBuffer( GLcontext *ctx, GLsizei size, GLuint *buffer ) | |||
void | |||
_mesa_SelectBuffer( GLsizei size, GLuint *buffer ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glSelectBuffer"); | |||
if (ctx->RenderMode==GL_SELECT) { | |||
gl_error( ctx, GL_INVALID_OPERATION, "glSelectBuffer" ); | |||
@@ -351,8 +348,10 @@ static void write_hit_record( GLcontext *ctx ) | |||
void gl_InitNames( GLcontext *ctx ) | |||
void | |||
_mesa_InitNames( void ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glInitNames"); | |||
/* Record the hit before the HitFlag is wiped out again. */ | |||
if (ctx->RenderMode==GL_SELECT) { | |||
@@ -368,8 +367,10 @@ void gl_InitNames( GLcontext *ctx ) | |||
void gl_LoadName( GLcontext *ctx, GLuint name ) | |||
void | |||
_mesa_LoadName( GLuint name ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLoadName"); | |||
if (ctx->RenderMode!=GL_SELECT) { | |||
return; | |||
@@ -390,8 +391,10 @@ void gl_LoadName( GLcontext *ctx, GLuint name ) | |||
} | |||
void gl_PushName( GLcontext *ctx, GLuint name ) | |||
void | |||
_mesa_PushName( GLuint name ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPushName"); | |||
if (ctx->RenderMode!=GL_SELECT) { | |||
return; | |||
@@ -409,8 +412,10 @@ void gl_PushName( GLcontext *ctx, GLuint name ) | |||
void gl_PopName( GLcontext *ctx ) | |||
void | |||
_mesa_PopName( void ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPopName"); | |||
if (ctx->RenderMode!=GL_SELECT) { | |||
return; | |||
@@ -437,8 +442,10 @@ void gl_PopName( GLcontext *ctx ) | |||
/* | |||
* NOTE: this function can't be put in a display list. | |||
*/ | |||
GLint gl_RenderMode( GLcontext *ctx, GLenum mode ) | |||
GLint | |||
_mesa_RenderMode( GLenum mode ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint result; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glRenderMode", 0); |
@@ -1,8 +1,8 @@ | |||
/* $Id: feedback.h,v 1.2 1999/09/18 20:41:23 keithw Exp $ */ | |||
/* $Id: feedback.h,v 1.3 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef FEEDBACK_H | |||
#define FEEDBACK_H | |||
@@ -52,22 +49,30 @@ extern void gl_feedback_vertex( GLcontext *ctx, | |||
extern void gl_update_hitflag( GLcontext *ctx, GLfloat z ); | |||
extern void gl_PassThrough( GLcontext *ctx, GLfloat token ); | |||
extern void | |||
_mesa_PassThrough( GLfloat token ); | |||
extern void | |||
_mesa_FeedbackBuffer( GLsizei size, GLenum type, GLfloat *buffer ); | |||
extern void gl_FeedbackBuffer( GLcontext *ctx, GLsizei size, | |||
GLenum type, GLfloat *buffer ); | |||
extern void | |||
_mesa_SelectBuffer( GLsizei size, GLuint *buffer ); | |||
extern void gl_SelectBuffer( GLcontext *ctx, GLsizei size, GLuint *buffer ); | |||
extern void | |||
_mesa_InitNames( void ); | |||
extern void gl_InitNames( GLcontext *ctx ); | |||
extern void | |||
_mesa_LoadName( GLuint name ); | |||
extern void gl_LoadName( GLcontext *ctx, GLuint name ); | |||
extern void | |||
_mesa_PushName( GLuint name ); | |||
extern void gl_PushName( GLcontext *ctx, GLuint name ); | |||
extern void | |||
_mesa_PopName( void ); | |||
extern void gl_PopName( GLcontext *ctx ); | |||
extern GLint | |||
_mesa_RenderMode( GLenum mode ); | |||
extern GLint gl_RenderMode( GLcontext *ctx, GLenum mode ); | |||
extern void gl_feedback_points( GLcontext *ctx, GLuint first, GLuint last ); | |||
extern void gl_feedback_line( GLcontext *ctx, GLuint v1, GLuint v2, GLuint pv ); |
@@ -1,8 +1,8 @@ | |||
/* $Id: fog.c,v 1.3 1999/11/08 07:36:44 brianp Exp $ */ | |||
/* $Id: fog.c,v 1.4 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,17 +25,10 @@ | |||
*/ | |||
/* $XFree86: xc/lib/GL/mesa/src/fog.c,v 1.4 1999/04/04 00:20:24 dawes Exp $ */ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <math.h> | |||
#include <stdlib.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "fog.h" | |||
#include "macros.h" | |||
@@ -45,8 +38,51 @@ | |||
void gl_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) | |||
void | |||
_mesa_Fogf(GLenum pname, GLfloat param) | |||
{ | |||
_mesa_Fogfv(pname, ¶m); | |||
} | |||
void | |||
_mesa_Fogi(GLenum pname, GLint param ) | |||
{ | |||
GLfloat fparam = (GLfloat) param; | |||
_mesa_Fogfv(pname, &fparam); | |||
} | |||
void | |||
_mesa_Fogiv(GLenum pname, const GLint *params ) | |||
{ | |||
GLfloat p[4]; | |||
switch (pname) { | |||
case GL_FOG_MODE: | |||
case GL_FOG_DENSITY: | |||
case GL_FOG_START: | |||
case GL_FOG_END: | |||
case GL_FOG_INDEX: | |||
p[0] = (GLfloat) *params; | |||
break; | |||
case GL_FOG_COLOR: | |||
p[0] = INT_TO_FLOAT( params[0] ); | |||
p[1] = INT_TO_FLOAT( params[1] ); | |||
p[2] = INT_TO_FLOAT( params[2] ); | |||
p[3] = INT_TO_FLOAT( params[3] ); | |||
break; | |||
default: | |||
/* Error will be caught later in gl_Fogfv */ | |||
; | |||
} | |||
_mesa_Fogfv(pname, p); | |||
} | |||
void | |||
_mesa_Fogfv( GLenum pname, const GLfloat *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLenum m; | |||
switch (pname) { |
@@ -1,8 +1,8 @@ | |||
/* $Id: fog.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: fog.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,7 +25,6 @@ | |||
*/ | |||
#ifndef FOG_H | |||
#define FOG_H | |||
@@ -33,7 +32,21 @@ | |||
#include "types.h" | |||
extern void gl_Fogfv( GLcontext *ctx, GLenum pname, const GLfloat *params ); | |||
extern void | |||
_mesa_Fogf(GLenum pname, GLfloat param); | |||
extern void | |||
_mesa_Fogi(GLenum pname, GLint param ); | |||
extern void | |||
_mesa_Fogfv(GLenum pname, const GLfloat *params ); | |||
extern void | |||
_mesa_Fogiv(GLenum pname, const GLint *params ); | |||
extern void gl_fog_vertices( struct vertex_buffer *VB ); |
@@ -1,8 +1,8 @@ | |||
/* $Id: get.c,v 1.5 1999/10/17 22:36:35 brianp Exp $ */ | |||
/* $Id: get.c,v 1.6 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,18 +25,10 @@ | |||
*/ | |||
/* $XFree86: xc/lib/GL/mesa/src/get.c,v 1.3 1999/04/04 00:20:25 dawes Exp $ */ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <stdio.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "enable.h" | |||
#include "enums.h" | |||
@@ -66,8 +58,10 @@ | |||
void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params ) | |||
void | |||
_mesa_GetBooleanv( GLenum pname, GLboolean *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint i; | |||
GLuint texUnit = ctx->Texture.CurrentUnit; | |||
GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit; | |||
@@ -748,13 +742,13 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params ) | |||
*params = INT_TO_BOOL(0); /* TODO */ | |||
break; | |||
case GL_TEXTURE_1D: | |||
*params = gl_IsEnabled( ctx, GL_TEXTURE_1D ); | |||
*params = _mesa_IsEnabled(GL_TEXTURE_1D ); | |||
break; | |||
case GL_TEXTURE_2D: | |||
*params = gl_IsEnabled( ctx, GL_TEXTURE_2D ); | |||
*params = _mesa_IsEnabled(GL_TEXTURE_2D ); | |||
break; | |||
case GL_TEXTURE_3D: | |||
*params = gl_IsEnabled( ctx, GL_TEXTURE_3D ); | |||
*params = _mesa_IsEnabled(GL_TEXTURE_3D ); | |||
break; | |||
case GL_TEXTURE_BINDING_1D: | |||
*params = INT_TO_BOOL(textureUnit->CurrentD[1]->Name); | |||
@@ -978,8 +972,10 @@ void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params ) | |||
void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params ) | |||
void | |||
_mesa_GetDoublev( GLenum pname, GLdouble *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint i; | |||
GLuint texUnit = ctx->Texture.CurrentUnit; | |||
GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit; | |||
@@ -1660,13 +1656,13 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params ) | |||
*params = 0.0; /* TODO */ | |||
break; | |||
case GL_TEXTURE_1D: | |||
*params = gl_IsEnabled(ctx, GL_TEXTURE_1D) ? 1.0 : 0.0; | |||
*params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0 : 0.0; | |||
break; | |||
case GL_TEXTURE_2D: | |||
*params = gl_IsEnabled(ctx, GL_TEXTURE_2D) ? 1.0 : 0.0; | |||
*params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0 : 0.0; | |||
break; | |||
case GL_TEXTURE_3D: | |||
*params = gl_IsEnabled(ctx, GL_TEXTURE_3D) ? 1.0 : 0.0; | |||
*params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0 : 0.0; | |||
break; | |||
case GL_TEXTURE_BINDING_1D: | |||
*params = (GLdouble) textureUnit->CurrentD[1]->Name; | |||
@@ -1893,8 +1889,10 @@ void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params ) | |||
void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params ) | |||
void | |||
_mesa_GetFloatv( GLenum pname, GLfloat *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint i; | |||
GLuint texUnit = ctx->Texture.CurrentUnit; | |||
GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit; | |||
@@ -2572,13 +2570,13 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params ) | |||
*params = 0.0F; /* TODO */ | |||
break; | |||
case GL_TEXTURE_1D: | |||
*params = gl_IsEnabled(ctx, GL_TEXTURE_1D) ? 1.0 : 0.0; | |||
*params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1.0 : 0.0; | |||
break; | |||
case GL_TEXTURE_2D: | |||
*params = gl_IsEnabled(ctx, GL_TEXTURE_2D) ? 1.0 : 0.0; | |||
*params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1.0 : 0.0; | |||
break; | |||
case GL_TEXTURE_3D: | |||
*params = gl_IsEnabled(ctx, GL_TEXTURE_3D) ? 1.0 : 0.0; | |||
*params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1.0 : 0.0; | |||
break; | |||
case GL_TEXTURE_BINDING_1D: | |||
*params = (GLfloat) textureUnit->CurrentD[1]->Name; | |||
@@ -2802,8 +2800,10 @@ void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params ) | |||
void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params ) | |||
void | |||
_mesa_GetIntegerv( GLenum pname, GLint *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint i; | |||
GLuint texUnit = ctx->Texture.CurrentUnit; | |||
GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit; | |||
@@ -3485,13 +3485,13 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params ) | |||
*params = 0; /* TODO */ | |||
break; | |||
case GL_TEXTURE_1D: | |||
*params = gl_IsEnabled(ctx, GL_TEXTURE_1D) ? 1 : 0; | |||
*params = _mesa_IsEnabled(GL_TEXTURE_1D) ? 1 : 0; | |||
break; | |||
case GL_TEXTURE_2D: | |||
*params = gl_IsEnabled(ctx, GL_TEXTURE_2D) ? 1 : 0; | |||
*params = _mesa_IsEnabled(GL_TEXTURE_2D) ? 1 : 0; | |||
break; | |||
case GL_TEXTURE_3D: | |||
*params = gl_IsEnabled(ctx, GL_TEXTURE_3D) ? 1 : 0; | |||
*params = _mesa_IsEnabled(GL_TEXTURE_3D) ? 1 : 0; | |||
break; | |||
case GL_TEXTURE_BINDING_1D: | |||
*params = textureUnit->CurrentD[1]->Name; | |||
@@ -3725,8 +3725,10 @@ void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params ) | |||
void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params ) | |||
void | |||
_mesa_GetPointerv( GLenum pname, GLvoid **params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint texUnit = ctx->Texture.CurrentUnit; | |||
/*GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;*/ | |||
@@ -3766,11 +3768,13 @@ void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params ) | |||
const GLubyte *gl_GetString( GLcontext *ctx, GLenum name ) | |||
const GLubyte * | |||
_mesa_GetString( GLenum name ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
static char result[1000]; | |||
static char *vendor = "Brian Paul"; | |||
static char *version = "1.2 Mesa 3.1 beta"; | |||
static char *version = "1.2 Mesa 3.3 beta"; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetString", 0); | |||
@@ -3811,3 +3815,24 @@ const GLubyte *gl_GetString( GLcontext *ctx, GLenum name ) | |||
return NULL; | |||
} | |||
} | |||
/* | |||
* Execute a glGetError command | |||
*/ | |||
GLenum | |||
_mesa_GetError( void ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLenum e = ctx->ErrorValue; | |||
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL( ctx, "glGetError", (GLenum) 0); | |||
if (MESA_VERBOSE & VERBOSE_API) | |||
fprintf(stderr, "glGetError <-- %s\n", gl_lookup_enum_by_nr(e)); | |||
ctx->ErrorValue = (GLenum) GL_NO_ERROR; | |||
return e; | |||
} | |||
@@ -1,8 +1,8 @@ | |||
/* $Id: get.h,v 1.2 1999/09/09 23:47:09 brianp Exp $ */ | |||
/* $Id: get.h,v 1.3 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef GET_H | |||
#define GET_H | |||
@@ -35,17 +32,27 @@ | |||
#include "types.h" | |||
extern void gl_GetBooleanv( GLcontext *ctx, GLenum pname, GLboolean *params ); | |||
extern void | |||
_mesa_GetBooleanv( GLenum pname, GLboolean *params ); | |||
extern void | |||
_mesa_GetDoublev( GLenum pname, GLdouble *params ); | |||
extern void | |||
_mesa_GetFloatv( GLenum pname, GLfloat *params ); | |||
extern void gl_GetDoublev( GLcontext *ctx, GLenum pname, GLdouble *params ); | |||
extern void | |||
_mesa_GetIntegerv( GLenum pname, GLint *params ); | |||
extern void gl_GetFloatv( GLcontext *ctx, GLenum pname, GLfloat *params ); | |||
extern void | |||
_mesa_GetPointerv( GLenum pname, GLvoid **params ); | |||
extern void gl_GetIntegerv( GLcontext *ctx, GLenum pname, GLint *params ); | |||
extern const GLubyte * | |||
_mesa_GetString( GLenum name ); | |||
extern void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params ); | |||
extern GLenum | |||
_mesa_GetError( void ); | |||
extern const GLubyte *gl_GetString( GLcontext *ctx, GLenum name ); | |||
#endif |
@@ -0,0 +1,65 @@ | |||
/* $Id: glheader.h,v 1.1 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
* Permission is hereby granted, free of charge, to any person obtaining a | |||
* copy of this software and associated documentation files (the "Software"), | |||
* to deal in the Software without restriction, including without limitation | |||
* the rights to use, copy, modify, merge, publish, distribute, sublicense, | |||
* and/or sell copies of the Software, and to permit persons to whom the | |||
* Software is furnished to do so, subject to the following conditions: | |||
* | |||
* The above copyright notice and this permission notice shall be included | |||
* in all copies or substantial portions of the Software. | |||
* | |||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | |||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | |||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | |||
* BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN | |||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
*/ | |||
#ifndef GLHEADER_H | |||
#define GLHEADER_H | |||
/* | |||
* This is the top-most include file of the Mesa sources. | |||
* It includes gl.h and all system headers which are needed. | |||
* Other Mesa source files should _not_ directly include any system | |||
* headers. This allows Mesa to be integrated into XFree86 and | |||
* allows system-dependent hacks/work-arounds to be collected in one place. | |||
* | |||
* If you touch this file, everything gets recompiled! | |||
* | |||
* This file should be included before any other header in the .c files. | |||
*/ | |||
#ifdef XFree86LOADER | |||
#include "xf86_ansic.h" | |||
#else | |||
#include <assert.h> | |||
#include <ctype.h> | |||
#include <float.h> | |||
#include <math.h> | |||
#include <limits.h> | |||
#include <stdlib.h> | |||
#include <stdio.h> | |||
#include <string.h> | |||
#endif | |||
#ifdef HAVE_CONFIG_H | |||
#include "conf.h" | |||
#endif | |||
#include <GL/gl.h> | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: hash.c,v 1.3 1999/10/13 18:42:50 brianp Exp $ */ | |||
/* $Id: hash.c,v 1.4 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,24 +25,17 @@ | |||
*/ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <stdlib.h> | |||
#include <stdio.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "hash.h" | |||
#include "macros.h" | |||
#include "mem.h" | |||
#endif | |||
/* | |||
* Generic hash table. Only dependency is the GLuint datatype. | |||
* Generic hash table. | |||
* | |||
* This is used to implement display list and texture object lookup. | |||
* NOTE: key=0 is illegal. |
@@ -1,8 +1,8 @@ | |||
/* $Id: hash.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: hash.h,v 1.2 1999/11/11 01:22:26 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,14 +25,11 @@ | |||
*/ | |||
#ifndef HASH_H | |||
#define HASH_H | |||
#include "GL/gl.h" | |||
#include "glheader.h" | |||
struct HashTable; |
@@ -1,4 +1,4 @@ | |||
/* $Id: image.h,v 1.2 1999/11/03 17:27:05 brianp Exp $ */ | |||
/* $Id: image.h,v 1.3 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef IMAGE_H | |||
#define IMAGE_H | |||
@@ -35,6 +32,9 @@ | |||
#include "types.h" | |||
extern struct gl_pixelstore_attrib _mesa_native_packing; | |||
extern void gl_flip_bytes( GLubyte *p, GLuint n ); | |||
@@ -61,33 +61,16 @@ gl_pixel_addr_in_image( const struct gl_pixelstore_attrib *packing, | |||
GLint img, GLint row, GLint column ); | |||
extern struct gl_image * | |||
gl_unpack_bitmap( GLcontext *ctx, GLsizei width, GLsizei height, | |||
const GLubyte *bitmap, | |||
const struct gl_pixelstore_attrib *packing ); | |||
extern void gl_unpack_polygon_stipple( const GLcontext *ctx, | |||
const GLubyte *pattern, | |||
GLuint dest[32] ); | |||
extern void gl_pack_polygon_stipple( const GLcontext *ctx, | |||
const GLuint pattern[32], | |||
GLubyte *dest ); | |||
extern struct gl_image * | |||
gl_unpack_image( GLcontext *ctx, GLint width, GLint height, | |||
GLenum srcFormat, GLenum srcType, const GLvoid *pixels, | |||
const struct gl_pixelstore_attrib *packing ); | |||
extern void | |||
gl_unpack_polygon_stipple( const GLcontext *ctx, | |||
const GLubyte *pattern, | |||
GLuint dest[32] ); | |||
struct gl_image * | |||
gl_unpack_image3D( GLcontext *ctx, GLint width, GLint height,GLint depth, | |||
GLenum srcFormat, GLenum srcType, const GLvoid *pixels, | |||
const struct gl_pixelstore_attrib *packing ); | |||
extern void | |||
gl_pack_polygon_stipple( const GLcontext *ctx, | |||
const GLuint pattern[32], | |||
GLubyte *dest ); | |||
extern void | |||
@@ -98,19 +81,6 @@ gl_pack_rgba_span( const GLcontext *ctx, | |||
GLboolean applyTransferOps ); | |||
extern void gl_free_image( struct gl_image *image ); | |||
extern GLboolean gl_image_error_test( GLcontext *ctx, | |||
const struct gl_image *image, | |||
const char *msg ); | |||
/* | |||
* New (3.3) functions | |||
*/ | |||
extern void | |||
_mesa_unpack_ubyte_color_span( const GLcontext *ctx, | |||
GLuint n, GLenum dstFormat, GLubyte dest[], | |||
@@ -127,10 +97,31 @@ _mesa_unpack_index_span( const GLcontext *ctx, GLuint n, | |||
const struct gl_pixelstore_attrib *unpacking, | |||
GLboolean applyTransferOps ); | |||
extern void | |||
_mesa_unpack_stencil_span( const GLcontext *ctx, GLuint n, | |||
GLenum dstType, GLvoid *dest, | |||
GLenum srcType, const GLvoid *source, | |||
const struct gl_pixelstore_attrib *unpacking, | |||
GLboolean applyTransferOps ); | |||
extern void | |||
_mesa_unpack_depth_span( const GLcontext *ctx, GLuint n, GLdepth *dest, | |||
GLenum srcType, const GLvoid *source, | |||
const struct gl_pixelstore_attrib *unpacking, | |||
GLboolean applyTransferOps ); | |||
extern void * | |||
_mesa_unpack_image( GLsizei width, GLsizei height, GLsizei depth, | |||
GLenum format, GLenum type, const GLvoid *pixels, | |||
const struct gl_pixelstore_attrib *unpack ); | |||
extern GLvoid * | |||
_mesa_unpack_bitmap( GLint width, GLint height, const GLubyte *pixels, | |||
const struct gl_pixelstore_attrib *packing ); | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: light.c,v 1.8 1999/11/10 06:29:44 keithw Exp $ */ | |||
/* $Id: light.c,v 1.9 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,27 +25,16 @@ | |||
*/ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#include <float.h> | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <float.h> | |||
#include <math.h> | |||
#include <stdlib.h> | |||
#include <stdio.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "enums.h" | |||
#include "light.h" | |||
#include "macros.h" | |||
#include "matrix.h" | |||
#include "mem.h" | |||
#include "mmath.h" | |||
#include "simple_list.h" | |||
#include "types.h" | |||
@@ -55,46 +44,50 @@ | |||
void gl_ShadeModel( GLcontext *ctx, GLenum mode ) | |||
void | |||
_mesa_ShadeModel( GLenum mode ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glShadeModel"); | |||
if (MESA_VERBOSE & VERBOSE_API) | |||
fprintf(stderr, "glShadeModel %s\n", gl_lookup_enum_by_nr(mode)); | |||
switch (mode) { | |||
case GL_FLAT: | |||
case GL_SMOOTH: | |||
if (mode == GL_FLAT || mode == GL_SMOOTH) { | |||
if (ctx->Light.ShadeModel!=mode) { | |||
ctx->Light.ShadeModel = mode; | |||
ctx->TriangleCaps ^= DD_FLATSHADE; | |||
ctx->NewState |= NEW_RASTER_OPS; | |||
ctx->Light.ShadeModel = mode; | |||
ctx->TriangleCaps ^= DD_FLATSHADE; | |||
ctx->NewState |= NEW_RASTER_OPS; | |||
if (ctx->Driver.ShadeModel) | |||
(*ctx->Driver.ShadeModel)( ctx, mode ); | |||
} | |||
break; | |||
default: | |||
} | |||
else { | |||
gl_error( ctx, GL_INVALID_ENUM, "glShadeModel" ); | |||
} | |||
if (ctx->Driver.ShadeModel) | |||
(*ctx->Driver.ShadeModel)( ctx, mode ); | |||
} | |||
void gl_Lightfv( GLcontext *ctx, | |||
GLenum light, GLenum pname, const GLfloat *params, | |||
GLint nparams ) | |||
void | |||
_mesa_Lightf( GLenum light, GLenum pname, GLfloat param ) | |||
{ | |||
GLint l; | |||
_mesa_Lightfv( light, pname, ¶m ); | |||
} | |||
(void) nparams; | |||
void | |||
_mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint l; | |||
GLint nParams; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLight"); | |||
l = (GLint) (light - GL_LIGHT0); | |||
if (l<0 || l>=MAX_LIGHTS) { | |||
if (l < 0 || l >= MAX_LIGHTS) { | |||
gl_error( ctx, GL_INVALID_ENUM, "glLight" ); | |||
return; | |||
} | |||
@@ -102,18 +95,22 @@ void gl_Lightfv( GLcontext *ctx, | |||
switch (pname) { | |||
case GL_AMBIENT: | |||
COPY_4V( ctx->Light.Light[l].Ambient, params ); | |||
nParams = 4; | |||
break; | |||
case GL_DIFFUSE: | |||
COPY_4V( ctx->Light.Light[l].Diffuse, params ); | |||
nParams = 4; | |||
break; | |||
case GL_SPECULAR: | |||
COPY_4V( ctx->Light.Light[l].Specular, params ); | |||
nParams = 4; | |||
break; | |||
case GL_POSITION: | |||
/* transform position by ModelView matrix */ | |||
TRANSFORM_POINT( ctx->Light.Light[l].EyePosition, | |||
ctx->ModelView.m, | |||
params ); | |||
nParams = 4; | |||
break; | |||
case GL_SPOT_DIRECTION: | |||
/* transform direction by inverse modelview */ | |||
@@ -123,6 +120,7 @@ void gl_Lightfv( GLcontext *ctx, | |||
TRANSFORM_NORMAL( ctx->Light.Light[l].EyeDirection, | |||
params, | |||
ctx->ModelView.inv ); | |||
nParams = 3; | |||
break; | |||
case GL_SPOT_EXPONENT: | |||
if (params[0]<0.0 || params[0]>128.0) { | |||
@@ -133,6 +131,7 @@ void gl_Lightfv( GLcontext *ctx, | |||
ctx->Light.Light[l].SpotExponent = params[0]; | |||
gl_compute_spot_exp_table( &ctx->Light.Light[l] ); | |||
} | |||
nParams = 1; | |||
break; | |||
case GL_SPOT_CUTOFF: | |||
if ((params[0]<0.0 || params[0]>90.0) && params[0]!=180.0) { | |||
@@ -143,6 +142,7 @@ void gl_Lightfv( GLcontext *ctx, | |||
ctx->Light.Light[l].CosCutoff = cos(params[0]*DEG2RAD); | |||
if (ctx->Light.Light[l].CosCutoff < 0) | |||
ctx->Light.Light[l].CosCutoff = 0; | |||
nParams = 1; | |||
break; | |||
case GL_CONSTANT_ATTENUATION: | |||
if (params[0]<0.0) { | |||
@@ -150,6 +150,7 @@ void gl_Lightfv( GLcontext *ctx, | |||
return; | |||
} | |||
ctx->Light.Light[l].ConstantAttenuation = params[0]; | |||
nParams = 1; | |||
break; | |||
case GL_LINEAR_ATTENUATION: | |||
if (params[0]<0.0) { | |||
@@ -157,6 +158,7 @@ void gl_Lightfv( GLcontext *ctx, | |||
return; | |||
} | |||
ctx->Light.Light[l].LinearAttenuation = params[0]; | |||
nParams = 1; | |||
break; | |||
case GL_QUADRATIC_ATTENUATION: | |||
if (params[0]<0.0) { | |||
@@ -164,23 +166,73 @@ void gl_Lightfv( GLcontext *ctx, | |||
return; | |||
} | |||
ctx->Light.Light[l].QuadraticAttenuation = params[0]; | |||
nParams = 1; | |||
break; | |||
default: | |||
gl_error( ctx, GL_INVALID_ENUM, "glLight" ); | |||
break; | |||
return; | |||
} | |||
if (ctx->Driver.Lightfv) | |||
ctx->Driver.Lightfv( ctx, light, pname, params, nparams ); | |||
ctx->Driver.Lightfv( ctx, light, pname, params, nParams ); | |||
ctx->NewState |= NEW_LIGHTING; | |||
} | |||
void | |||
_mesa_Lighti( GLenum light, GLenum pname, GLint param ) | |||
{ | |||
_mesa_Lightiv( light, pname, ¶m ); | |||
} | |||
void gl_GetLightfv( GLcontext *ctx, | |||
GLenum light, GLenum pname, GLfloat *params ) | |||
void | |||
_mesa_Lightiv( GLenum light, GLenum pname, const GLint *params ) | |||
{ | |||
GLfloat fparam[4]; | |||
switch (pname) { | |||
case GL_AMBIENT: | |||
case GL_DIFFUSE: | |||
case GL_SPECULAR: | |||
fparam[0] = INT_TO_FLOAT( params[0] ); | |||
fparam[1] = INT_TO_FLOAT( params[1] ); | |||
fparam[2] = INT_TO_FLOAT( params[2] ); | |||
fparam[3] = INT_TO_FLOAT( params[3] ); | |||
break; | |||
case GL_POSITION: | |||
fparam[0] = (GLfloat) params[0]; | |||
fparam[1] = (GLfloat) params[1]; | |||
fparam[2] = (GLfloat) params[2]; | |||
fparam[3] = (GLfloat) params[3]; | |||
break; | |||
case GL_SPOT_DIRECTION: | |||
fparam[0] = (GLfloat) params[0]; | |||
fparam[1] = (GLfloat) params[1]; | |||
fparam[2] = (GLfloat) params[2]; | |||
break; | |||
case GL_SPOT_EXPONENT: | |||
case GL_SPOT_CUTOFF: | |||
case GL_CONSTANT_ATTENUATION: | |||
case GL_LINEAR_ATTENUATION: | |||
case GL_QUADRATIC_ATTENUATION: | |||
fparam[0] = (GLfloat) params[0]; | |||
break; | |||
default: | |||
/* error will be caught later in gl_Lightfv */ | |||
; | |||
} | |||
_mesa_Lightfv( light, pname, fparam ); | |||
} | |||
void | |||
_mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint l = (GLint) (light - GL_LIGHT0); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetLight"); | |||
@@ -229,8 +281,10 @@ void gl_GetLightfv( GLcontext *ctx, | |||
void gl_GetLightiv( GLcontext *ctx, GLenum light, GLenum pname, GLint *params ) | |||
void | |||
_mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint l = (GLint) (light - GL_LIGHT0); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetLight"); | |||
@@ -298,9 +352,11 @@ void gl_GetLightiv( GLcontext *ctx, GLenum light, GLenum pname, GLint *params ) | |||
/**********************************************************************/ | |||
void gl_LightModelfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) | |||
void | |||
_mesa_LightModelfv( GLenum pname, const GLfloat *params ) | |||
{ | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLightModel"); | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLightModelfv"); | |||
switch (pname) { | |||
case GL_LIGHT_MODEL_AMBIENT: | |||
@@ -344,6 +400,46 @@ void gl_LightModelfv( GLcontext *ctx, GLenum pname, const GLfloat *params ) | |||
} | |||
void | |||
_mesa_LightModeliv( GLenum pname, const GLint *params ) | |||
{ | |||
GLfloat fparam[4]; | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLightModeliv"); | |||
switch (pname) { | |||
case GL_LIGHT_MODEL_AMBIENT: | |||
fparam[0] = INT_TO_FLOAT( params[0] ); | |||
fparam[1] = INT_TO_FLOAT( params[1] ); | |||
fparam[2] = INT_TO_FLOAT( params[2] ); | |||
fparam[3] = INT_TO_FLOAT( params[3] ); | |||
break; | |||
case GL_LIGHT_MODEL_LOCAL_VIEWER: | |||
case GL_LIGHT_MODEL_TWO_SIDE: | |||
case GL_LIGHT_MODEL_COLOR_CONTROL: | |||
fparam[0] = (GLfloat) params[0]; | |||
break; | |||
default: | |||
/* Error will be caught later in gl_LightModelfv */ | |||
; | |||
} | |||
_mesa_LightModelfv( pname, fparam ); | |||
} | |||
void | |||
_mesa_LightModeli( GLenum pname, GLint param ) | |||
{ | |||
_mesa_LightModeliv( pname, ¶m ); | |||
} | |||
void | |||
_mesa_LightModelf( GLenum pname, GLfloat param ) | |||
{ | |||
_mesa_LightModelfv( pname, ¶m ); | |||
} | |||
/********** MATERIAL **********/ | |||
@@ -569,11 +665,11 @@ void gl_update_color_material( GLcontext *ctx, | |||
GLfloat tmp[4], color[4]; | |||
UBYTE_RGBA_TO_FLOAT_RGBA( color, rgba ); | |||
if (MESA_VERBOSE&VERBOSE_IMMEDIATE) | |||
fprintf(stderr, "gl_update_color_material, mask %x\n", bitmask); | |||
if (bitmask & FRONT_AMBIENT_BIT) { | |||
struct gl_material *mat = &ctx->Light.Material[0]; | |||
SUB_3V( tmp, color, mat->Ambient ); | |||
@@ -676,8 +772,10 @@ void gl_update_color_material( GLcontext *ctx, | |||
void gl_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode ) | |||
void | |||
_mesa_ColorMaterial( GLenum face, GLenum mode ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint bitmask; | |||
GLuint legal = (FRONT_EMISSION_BIT | BACK_EMISSION_BIT | | |||
FRONT_SPECULAR_BIT | BACK_SPECULAR_BIT | | |||
@@ -705,12 +803,21 @@ void gl_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode ) | |||
void | |||
_mesa_Materialf( GLenum face, GLenum pname, GLfloat param ) | |||
{ | |||
_mesa_Materialfv( face, pname, ¶m ); | |||
} | |||
/* KW: This is now called directly (ie by name) from the glMaterial* | |||
* API functions. | |||
*/ | |||
void gl_Materialfv( GLcontext *ctx, | |||
GLenum face, GLenum pname, const GLfloat *params ) | |||
void | |||
_mesa_Materialfv( GLenum face, GLenum pname, const GLfloat *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct immediate *IM; | |||
struct gl_material *mat; | |||
GLuint bitmask; | |||
@@ -736,6 +843,7 @@ void gl_Materialfv( GLcontext *ctx, | |||
IM->MaterialMask[count] = 0; | |||
} | |||
IM->MaterialMask[count] |= bitmask; | |||
mat = IM->Material[count]; | |||
@@ -784,11 +892,48 @@ void gl_Materialfv( GLcontext *ctx, | |||
} | |||
void | |||
_mesa_Materiali(GLenum face, GLenum pname, GLint param ) | |||
{ | |||
_mesa_Materialiv(face, pname, ¶m); | |||
} | |||
void | |||
_mesa_Materialiv(GLenum face, GLenum pname, const GLint *params ) | |||
{ | |||
GLfloat fparam[4]; | |||
switch (pname) { | |||
case GL_AMBIENT: | |||
case GL_DIFFUSE: | |||
case GL_SPECULAR: | |||
case GL_EMISSION: | |||
case GL_AMBIENT_AND_DIFFUSE: | |||
fparam[0] = INT_TO_FLOAT( params[0] ); | |||
fparam[1] = INT_TO_FLOAT( params[1] ); | |||
fparam[2] = INT_TO_FLOAT( params[2] ); | |||
fparam[3] = INT_TO_FLOAT( params[3] ); | |||
break; | |||
case GL_SHININESS: | |||
fparam[0] = (GLfloat) params[0]; | |||
break; | |||
case GL_COLOR_INDEXES: | |||
fparam[0] = (GLfloat) params[0]; | |||
fparam[1] = (GLfloat) params[1]; | |||
fparam[2] = (GLfloat) params[2]; | |||
break; | |||
default: | |||
/* Error will be caught later in gl_Materialfv */ | |||
; | |||
} | |||
_mesa_Materialfv(face, pname, fparam); | |||
} | |||
void gl_GetMaterialfv( GLcontext *ctx, | |||
GLenum face, GLenum pname, GLfloat *params ) | |||
void | |||
_mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint f; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetMaterialfv"); | |||
@@ -831,9 +976,10 @@ void gl_GetMaterialfv( GLcontext *ctx, | |||
void gl_GetMaterialiv( GLcontext *ctx, | |||
GLenum face, GLenum pname, GLint *params ) | |||
void | |||
_mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint f; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetMaterialiv"); |
@@ -1,8 +1,8 @@ | |||
/* $Id: light.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: light.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef LIGHT_H | |||
#define LIGHT_H | |||
@@ -42,44 +39,69 @@ struct gl_shine_tab { | |||
}; | |||
extern void gl_ShadeModel( GLcontext *ctx, GLenum mode ); | |||
extern void | |||
_mesa_ShadeModel( GLenum mode ); | |||
extern void gl_ColorMaterial( GLcontext *ctx, GLenum face, GLenum mode ); | |||
extern void | |||
_mesa_ColorMaterial( GLenum face, GLenum mode ); | |||
extern void gl_Lightfv( GLcontext *ctx, | |||
GLenum light, GLenum pname, const GLfloat *params, | |||
GLint nparams ); | |||
extern void | |||
_mesa_Lightf( GLenum light, GLenum pname, GLfloat param ); | |||
extern void gl_LightModelfv( GLcontext *ctx, | |||
GLenum pname, const GLfloat *params ); | |||
extern void | |||
_mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ); | |||
extern void | |||
_mesa_Lightiv( GLenum light, GLenum pname, const GLint *params ); | |||
extern GLuint gl_material_bitmask( GLcontext *ctx, | |||
GLenum face, GLenum pname, | |||
GLuint legal, | |||
const char * ); | |||
extern void | |||
_mesa_Lighti( GLenum light, GLenum pname, GLint param ); | |||
extern void gl_set_material( GLcontext *ctx, GLuint bitmask, | |||
const GLfloat *params); | |||
extern void | |||
_mesa_LightModelf( GLenum pname, GLfloat param ); | |||
extern void | |||
_mesa_LightModelfv( GLenum pname, const GLfloat *params ); | |||
extern void | |||
_mesa_LightModeli( GLenum pname, GLint param ); | |||
extern void gl_Materialfv( GLcontext *ctx, | |||
GLenum face, GLenum pname, const GLfloat *params ); | |||
extern void | |||
_mesa_LightModeliv( GLenum pname, const GLint *params ); | |||
extern void | |||
_mesa_Materialf( GLenum face, GLenum pname, GLfloat param ); | |||
extern void | |||
_mesa_Materialfv( GLenum face, GLenum pname, const GLfloat *params ); | |||
extern void gl_GetLightfv( GLcontext *ctx, | |||
GLenum light, GLenum pname, GLfloat *params ); | |||
extern void | |||
_mesa_Materiali( GLenum face, GLenum pname, GLint param ); | |||
extern void gl_GetLightiv( GLcontext *ctx, | |||
GLenum light, GLenum pname, GLint *params ); | |||
extern void | |||
_mesa_Materialiv( GLenum face, GLenum pname, const GLint *params ); | |||
extern void | |||
_mesa_GetLightfv( GLenum light, GLenum pname, GLfloat *params ); | |||
extern void gl_GetMaterialfv( GLcontext *ctx, | |||
GLenum face, GLenum pname, GLfloat *params ); | |||
extern void | |||
_mesa_GetLightiv( GLenum light, GLenum pname, GLint *params ); | |||
extern void gl_GetMaterialiv( GLcontext *ctx, | |||
GLenum face, GLenum pname, GLint *params ); | |||
extern void | |||
_mesa_GetMaterialfv( GLenum face, GLenum pname, GLfloat *params ); | |||
extern void | |||
_mesa_GetMaterialiv( GLenum face, GLenum pname, GLint *params ); | |||
extern GLuint gl_material_bitmask( GLcontext *ctx, | |||
GLenum face, GLenum pname, | |||
GLuint legal, | |||
const char * ); | |||
extern void gl_set_material( GLcontext *ctx, GLuint bitmask, | |||
const GLfloat *params); | |||
extern void gl_compute_spot_exp_table( struct gl_light *l ); | |||
@@ -1,8 +1,8 @@ | |||
/* $Id: lines.c,v 1.5 1999/11/08 14:36:32 brianp Exp $ */ | |||
/* $Id: lines.c,v 1.6 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,17 +25,10 @@ | |||
*/ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "depth.h" | |||
#include "feedback.h" | |||
@@ -50,8 +43,10 @@ | |||
void gl_LineWidth( GLcontext *ctx, GLfloat width ) | |||
void | |||
_mesa_LineWidth( GLfloat width ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
if (width<=0.0) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glLineWidth" ); | |||
return; | |||
@@ -68,8 +63,10 @@ void gl_LineWidth( GLcontext *ctx, GLfloat width ) | |||
void gl_LineStipple( GLcontext *ctx, GLint factor, GLushort pattern ) | |||
void | |||
_mesa_LineStipple( GLint factor, GLushort pattern ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glLineStipple"); | |||
ctx->Line.StippleFactor = CLAMP( factor, 1, 256 ); | |||
ctx->Line.StipplePattern = pattern; |
@@ -1,8 +1,8 @@ | |||
/* $Id: lines.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: lines.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef LINES_H | |||
#define LINES_H | |||
@@ -35,11 +32,14 @@ | |||
#include "types.h" | |||
extern void gl_LineWidth( GLcontext *ctx, GLfloat width ); | |||
extern void | |||
_mesa_LineWidth( GLfloat width ); | |||
extern void gl_LineStipple( GLcontext *ctx, GLint factor, GLushort pattern ); | |||
extern void | |||
_mesa_LineStipple( GLint factor, GLushort pattern ); | |||
extern void gl_set_line_function( GLcontext *ctx ); | |||
extern void | |||
gl_set_line_function( GLcontext *ctx ); | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: macros.h,v 1.6 1999/11/08 15:29:43 brianp Exp $ */ | |||
/* $Id: macros.h,v 1.7 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
/* | |||
* A collection of useful macros. | |||
*/ | |||
@@ -36,13 +33,8 @@ | |||
#ifndef MACROS_H | |||
#define MACROS_H | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <math.h> | |||
#include <string.h> | |||
#else | |||
#include <GL/glx_ansic.h> | |||
#endif | |||
#include "glheader.h" | |||
#ifdef DEBUG | |||
@@ -165,26 +157,26 @@ do { \ | |||
#define ACC_4V( DST, SRC ) \ | |||
do { \ | |||
(DST)[0] += (SRC)[0]; \ | |||
(DST)[1] += (SRC)[1]; \ | |||
(DST)[2] += (SRC)[2]; \ | |||
(DST)[3] += (SRC)[3]; \ | |||
(DST)[0] += (SRC)[0]; \ | |||
(DST)[1] += (SRC)[1]; \ | |||
(DST)[2] += (SRC)[2]; \ | |||
(DST)[3] += (SRC)[3]; \ | |||
} while (0) | |||
#define ACC_SCALE_4V( DST, SRCA, SRCB ) \ | |||
do { \ | |||
(DST)[0] += (SRCA)[0] * (SRCB)[0]; \ | |||
(DST)[1] += (SRCA)[1] * (SRCB)[1]; \ | |||
(DST)[2] += (SRCA)[2] * (SRCB)[2]; \ | |||
(DST)[3] += (SRCA)[3] * (SRCB)[3]; \ | |||
(DST)[0] += (SRCA)[0] * (SRCB)[0]; \ | |||
(DST)[1] += (SRCA)[1] * (SRCB)[1]; \ | |||
(DST)[2] += (SRCA)[2] * (SRCB)[2]; \ | |||
(DST)[3] += (SRCA)[3] * (SRCB)[3]; \ | |||
} while (0) | |||
#define ACC_SCALE_SCALAR_4V( DST, S, SRCB ) \ | |||
do { \ | |||
(DST)[0] += S * (SRCB)[0]; \ | |||
(DST)[1] += S * (SRCB)[1]; \ | |||
(DST)[2] += S * (SRCB)[2]; \ | |||
(DST)[3] += S * (SRCB)[3]; \ | |||
(DST)[0] += S * (SRCB)[0]; \ | |||
(DST)[1] += S * (SRCB)[1]; \ | |||
(DST)[2] += S * (SRCB)[2]; \ | |||
(DST)[3] += S * (SRCB)[3]; \ | |||
} while (0) | |||
#define SCALE_SCALAR_4V( DST, S, SRCB ) \ | |||
@@ -480,69 +472,6 @@ do { \ | |||
/* | |||
* Memory allocation | |||
* XXX these should probably go into a new glmemory.h file. | |||
*/ | |||
#ifdef DEBUG | |||
extern void *gl_malloc(size_t bytes); | |||
extern void *gl_calloc(size_t bytes); | |||
extern void gl_free(void *ptr); | |||
#define MALLOC(BYTES) gl_malloc(BYTES) | |||
#define CALLOC(BYTES) gl_calloc(BYTES) | |||
#define MALLOC_STRUCT(T) (struct T *) gl_malloc(sizeof(struct T)) | |||
#define CALLOC_STRUCT(T) (struct T *) gl_calloc(sizeof(struct T)) | |||
#define FREE(PTR) gl_free(PTR) | |||
#else | |||
#define MALLOC(BYTES) (void *) malloc(BYTES) | |||
#define CALLOC(BYTES) (void *) calloc(1, BYTES) | |||
#define MALLOC_STRUCT(T) (struct T *) malloc(sizeof(struct T)) | |||
#define CALLOC_STRUCT(T) (struct T *) calloc(1,sizeof(struct T)) | |||
#define FREE(PTR) free(PTR) | |||
#endif | |||
/* Memory copy: */ | |||
#ifdef SUNOS4 | |||
#define MEMCPY( DST, SRC, BYTES) \ | |||
memcpy( (char *) (DST), (char *) (SRC), (int) (BYTES) ) | |||
#else | |||
#define MEMCPY( DST, SRC, BYTES) \ | |||
memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) ) | |||
#endif | |||
/* Memory set: */ | |||
#ifdef SUNOS4 | |||
#define MEMSET( DST, VAL, N ) \ | |||
memset( (char *) (DST), (int) (VAL), (int) (N) ) | |||
#else | |||
#define MEMSET( DST, VAL, N ) \ | |||
memset( (void *) (DST), (int) (VAL), (size_t) (N) ) | |||
#endif | |||
/* MACs and BeOS don't support static larger than 32kb, so... */ | |||
#if defined(macintosh) && !defined(__MRC__) | |||
extern char *AGLAlloc(int size); | |||
extern void AGLFree(char* ptr); | |||
# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)AGLAlloc(sizeof(TYPE)*(SIZE)) | |||
# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])AGLAlloc(sizeof(TYPE)*(SIZE1)*(SIZE2)) | |||
# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0) | |||
# define UNDEFARRAY(NAME) do {if ((NAME)) {AGLFree((char*)NAME);} }while (0) | |||
#elif defined(__BEOS__) | |||
# define DEFARRAY(TYPE,NAME,SIZE) TYPE *NAME = (TYPE*)malloc(sizeof(TYPE)*(SIZE)) | |||
# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE (*NAME)[SIZE2] = (TYPE(*)[SIZE2])malloc(sizeof(TYPE)*(SIZE1)*(SIZE2)) | |||
# define CHECKARRAY(NAME,CMD) do {if (!(NAME)) {CMD;}} while (0) | |||
# define UNDEFARRAY(NAME) do {if ((NAME)) {free((char*)NAME);} }while (0) | |||
#else | |||
# define DEFARRAY(TYPE,NAME,SIZE) TYPE NAME[SIZE] | |||
# define DEFMARRAY(TYPE,NAME,SIZE1,SIZE2) TYPE NAME[SIZE1][SIZE2] | |||
# define CHECKARRAY(NAME,CMD) do {} while(0) | |||
# define UNDEFARRAY(NAME) | |||
#endif | |||
/* Some compilers don't like some of Mesa's const usage */ | |||
#ifdef NO_CONST | |||
# define CONST |
@@ -1,8 +1,8 @@ | |||
/* $Id: matrix.c,v 1.8 1999/11/08 07:36:44 brianp Exp $ */ | |||
/* $Id: matrix.c,v 1.9 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
/* | |||
* Matrix operations | |||
* | |||
@@ -43,18 +40,11 @@ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <math.h> | |||
#include <stdio.h> | |||
#include <stdlib.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "enums.h" | |||
#include "macros.h" | |||
#include "matrix.h" | |||
#include "mem.h" | |||
#include "mmath.h" | |||
#include "types.h" | |||
#endif | |||
@@ -902,11 +892,12 @@ do { \ | |||
} while (0) | |||
void gl_Frustum( GLcontext *ctx, | |||
GLdouble left, GLdouble right, | |||
GLdouble bottom, GLdouble top, | |||
GLdouble nearval, GLdouble farval ) | |||
void | |||
_mesa_Frustum( GLdouble left, GLdouble right, | |||
GLdouble bottom, GLdouble top, | |||
GLdouble nearval, GLdouble farval ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLfloat x, y, a, b, c, d; | |||
GLfloat m[16]; | |||
GLmatrix *mat = 0; | |||
@@ -952,11 +943,12 @@ void gl_Frustum( GLcontext *ctx, | |||
} | |||
void gl_Ortho( GLcontext *ctx, | |||
GLdouble left, GLdouble right, | |||
GLdouble bottom, GLdouble top, | |||
GLdouble nearval, GLdouble farval ) | |||
void | |||
_mesa_Ortho( GLdouble left, GLdouble right, | |||
GLdouble bottom, GLdouble top, | |||
GLdouble nearval, GLdouble farval ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLfloat x, y, z; | |||
GLfloat tx, ty, tz; | |||
GLfloat m[16]; | |||
@@ -991,8 +983,10 @@ void gl_Ortho( GLcontext *ctx, | |||
} | |||
void gl_MatrixMode( GLcontext *ctx, GLenum mode ) | |||
void | |||
_mesa_MatrixMode( GLenum mode ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glMatrixMode"); | |||
switch (mode) { | |||
case GL_MODELVIEW: | |||
@@ -1007,8 +1001,10 @@ void gl_MatrixMode( GLcontext *ctx, GLenum mode ) | |||
void gl_PushMatrix( GLcontext *ctx ) | |||
void | |||
_mesa_PushMatrix( void ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPushMatrix"); | |||
if (MESA_VERBOSE&VERBOSE_API) | |||
@@ -1056,8 +1052,10 @@ void gl_PushMatrix( GLcontext *ctx ) | |||
void gl_PopMatrix( GLcontext *ctx ) | |||
void | |||
_mesa_PopMatrix( void ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPopMatrix"); | |||
if (MESA_VERBOSE&VERBOSE_API) | |||
@@ -1111,8 +1109,10 @@ void gl_PopMatrix( GLcontext *ctx ) | |||
void gl_LoadIdentity( GLcontext *ctx ) | |||
void | |||
_mesa_LoadIdentity( void ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLmatrix *mat = 0; | |||
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glLoadIdentity"); | |||
@@ -1131,8 +1131,10 @@ void gl_LoadIdentity( GLcontext *ctx ) | |||
} | |||
void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m ) | |||
void | |||
_mesa_LoadMatrixf( const GLfloat *m ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLmatrix *mat = 0; | |||
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glLoadMatrix"); | |||
@@ -1162,12 +1164,25 @@ void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m ) | |||
} | |||
void | |||
_mesa_LoadMatrixd( const GLdouble *m ) | |||
{ | |||
GLfloat f[16]; | |||
GLint i; | |||
for (i = 0; i < 16; i++) | |||
f[i] = m[i]; | |||
_mesa_LoadMatrixf(f); | |||
} | |||
/* | |||
* Multiply the active matrix by an arbitary matrix. | |||
*/ | |||
void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m ) | |||
void | |||
_mesa_MultMatrixf( const GLfloat *m ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLmatrix *mat = 0; | |||
GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glMultMatrix" ); | |||
matmul4( mat->m, mat->m, m ); | |||
@@ -1178,8 +1193,10 @@ void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m ) | |||
/* | |||
* Multiply the active matrix by an arbitary matrix. | |||
*/ | |||
void gl_MultMatrixd( GLcontext *ctx, const GLdouble *m ) | |||
void | |||
_mesa_MultMatrixd( const GLdouble *m ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLmatrix *mat = 0; | |||
GET_ACTIVE_MATRIX( ctx, mat, ctx->NewState, "glMultMatrix" ); | |||
matmul4fd( mat->m, mat->m, m ); | |||
@@ -1227,9 +1244,10 @@ void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *m ) | |||
/* | |||
* Execute a glRotate call | |||
*/ | |||
void gl_Rotatef( GLcontext *ctx, | |||
GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) | |||
void | |||
_mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLfloat m[16]; | |||
if (angle != 0.0F) { | |||
GLmatrix *mat = 0; | |||
@@ -1240,11 +1258,20 @@ void gl_Rotatef( GLcontext *ctx, | |||
} | |||
} | |||
void | |||
_mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ) | |||
{ | |||
_mesa_Rotatef(angle, x, y, z); | |||
} | |||
/* | |||
* Execute a glScale call | |||
*/ | |||
void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ) | |||
void | |||
_mesa_Scalef( GLfloat x, GLfloat y, GLfloat z ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLmatrix *mat = 0; | |||
GLfloat *m; | |||
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glScale"); | |||
@@ -1265,11 +1292,21 @@ void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ) | |||
MAT_DIRTY_DEPENDENTS); | |||
} | |||
void | |||
_mesa_Scaled( GLdouble x, GLdouble y, GLdouble z ) | |||
{ | |||
_mesa_Scalef(x, y, z); | |||
} | |||
/* | |||
* Execute a glTranslate call | |||
*/ | |||
void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ) | |||
void | |||
_mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLmatrix *mat = 0; | |||
GLfloat *m; | |||
GET_ACTIVE_MATRIX(ctx, mat, ctx->NewState, "glTranslate"); | |||
@@ -1286,13 +1323,22 @@ void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ) | |||
} | |||
void | |||
_mesa_Translated( GLdouble x, GLdouble y, GLdouble z ) | |||
{ | |||
_mesa_Translatef(x, y, z); | |||
} | |||
/* | |||
* Define a new viewport and reallocate auxillary buffers if the size of | |||
* the window (color buffer) has changed. | |||
*/ | |||
void gl_Viewport( GLcontext *ctx, | |||
GLint x, GLint y, GLsizei width, GLsizei height ) | |||
void | |||
_mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glViewport"); | |||
if (width<0 || height<0) { | |||
@@ -1330,7 +1376,7 @@ void gl_Viewport( GLcontext *ctx, | |||
/* Check if window/buffer has been resized and if so, reallocate the | |||
* ancillary buffers. | |||
*/ | |||
gl_ResizeBuffersMESA(ctx); | |||
_mesa_ResizeBuffersMESA(); | |||
ctx->RasterMask &= ~WINCLIP_BIT; | |||
@@ -1350,7 +1396,8 @@ void gl_Viewport( GLcontext *ctx, | |||
void gl_DepthRange( GLcontext *ctx, GLclampd nearval, GLclampd farval ) | |||
void | |||
_mesa_DepthRange( GLclampd nearval, GLclampd farval ) | |||
{ | |||
/* | |||
* nearval - specifies mapping of the near clipping plane to window | |||
@@ -1364,7 +1411,7 @@ void gl_DepthRange( GLcontext *ctx, GLclampd nearval, GLclampd farval ) | |||
* this range to window z coords. | |||
*/ | |||
GLfloat n, f; | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDepthRange"); | |||
if (MESA_VERBOSE&VERBOSE_API) |
@@ -1,8 +1,8 @@ | |||
/* $Id: matrix.h,v 1.2 1999/10/08 09:27:11 keithw Exp $ */ | |||
/* $Id: matrix.h,v 1.3 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,16 +25,14 @@ | |||
*/ | |||
#ifndef MATRIX_H | |||
#define MATRIX_H | |||
#include "GL/gl.h" | |||
#include "types.h" | |||
#include "config.h" | |||
typedef struct { | |||
GLfloat m[16]; | |||
GLfloat *inv; /* optional */ | |||
@@ -42,6 +40,7 @@ typedef struct { | |||
GLuint type; | |||
} GLmatrix; | |||
#ifdef VMS | |||
#define gl_calculate_model_project_matrix gl_calculate_model_project_matr | |||
#endif | |||
@@ -51,69 +50,90 @@ extern void gl_rotation_matrix( GLfloat angle, GLfloat x, GLfloat y, GLfloat z, | |||
GLfloat m[] ); | |||
extern void gl_mat_mul_floats( GLmatrix *mat, const GLfloat *m, GLuint flags ); | |||
extern void gl_Frustum( GLcontext *ctx, | |||
GLdouble left, GLdouble right, | |||
GLdouble bottom, GLdouble top, | |||
GLdouble nearval, GLdouble farval ); | |||
extern void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *mat2 ); | |||
extern void gl_Ortho( GLcontext *ctx, | |||
GLdouble left, GLdouble right, | |||
GLdouble bottom, GLdouble top, | |||
GLdouble nearval, GLdouble farval ); | |||
extern void gl_calculate_model_project_matrix( GLcontext *ctx ); | |||
extern void gl_PushMatrix( GLcontext *ctx ); | |||
extern void gl_matrix_ctr( GLmatrix *m ); | |||
extern void gl_PopMatrix( GLcontext *ctx ); | |||
extern void gl_matrix_dtr( GLmatrix *m ); | |||
extern void gl_LoadIdentity( GLcontext *ctx ); | |||
extern void gl_matrix_alloc_inv( GLmatrix *m ); | |||
extern void gl_LoadMatrixf( GLcontext *ctx, const GLfloat *m ); | |||
extern void gl_matrix_copy( GLmatrix *to, const GLmatrix *from ); | |||
extern void gl_MatrixMode( GLcontext *ctx, GLenum mode ); | |||
extern void gl_matrix_mul( GLmatrix *dest, | |||
const GLmatrix *a, | |||
const GLmatrix *b ); | |||
extern void gl_MultMatrixf( GLcontext *ctx, const GLfloat *m ); | |||
extern void gl_matrix_analyze( GLmatrix *mat ); | |||
extern void gl_mat_mul_floats( GLmatrix *mat, const GLfloat *m, GLuint flags ); | |||
extern void gl_mat_mul_mat( GLmatrix *mat, const GLmatrix *mat2 ); | |||
extern GLboolean gl_matrix_invert( GLmatrix *mat ); | |||
extern void gl_Rotatef( GLcontext *ctx, | |||
GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); | |||
extern void gl_print_matrix( const GLmatrix *m ); | |||
extern void gl_Scalef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ); | |||
extern void gl_Translatef( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z ); | |||
extern void gl_Viewport( GLcontext *ctx, | |||
GLint x, GLint y, GLsizei width, GLsizei height ); | |||
extern void | |||
_mesa_Frustum( GLdouble left, GLdouble right, | |||
GLdouble bottom, GLdouble top, | |||
GLdouble nearval, GLdouble farval ); | |||
extern void gl_DepthRange( GLcontext* ctx, GLclampd nearval, GLclampd farval ); | |||
extern void | |||
_mesa_Ortho( GLdouble left, GLdouble right, | |||
GLdouble bottom, GLdouble top, | |||
GLdouble nearval, GLdouble farval ); | |||
extern void | |||
_mesa_PushMatrix( void ); | |||
extern void | |||
_mesa_PopMatrix( void ); | |||
extern void | |||
_mesa_LoadIdentity( void ); | |||
extern void | |||
_mesa_LoadMatrixf( const GLfloat *m ); | |||
extern void gl_calculate_model_project_matrix( GLcontext *ctx ); | |||
extern void | |||
_mesa_LoadMatrixd( const GLdouble *m ); | |||
extern void | |||
_mesa_MatrixMode( GLenum mode ); | |||
extern void gl_matrix_ctr( GLmatrix *m ); | |||
extern void | |||
_mesa_MultMatrixf( const GLfloat *m ); | |||
extern void gl_matrix_dtr( GLmatrix *m ); | |||
extern void | |||
_mesa_MultMatrixd( const GLdouble *m ); | |||
extern void gl_matrix_alloc_inv( GLmatrix *m ); | |||
extern void | |||
_mesa_Rotatef( GLfloat angle, GLfloat x, GLfloat y, GLfloat z ); | |||
extern void gl_matrix_copy( GLmatrix *to, const GLmatrix *from ); | |||
extern void | |||
_mesa_Rotated( GLdouble angle, GLdouble x, GLdouble y, GLdouble z ); | |||
extern void gl_matrix_mul( GLmatrix *dest, | |||
const GLmatrix *a, | |||
const GLmatrix *b ); | |||
extern void | |||
_mesa_Scalef( GLfloat x, GLfloat y, GLfloat z ); | |||
extern void gl_matrix_analyze( GLmatrix *mat ); | |||
extern void | |||
_mesa_Scaled( GLdouble x, GLdouble y, GLdouble z ); | |||
extern void | |||
_mesa_Translatef( GLfloat x, GLfloat y, GLfloat z ); | |||
extern void | |||
_mesa_Translated( GLdouble x, GLdouble y, GLdouble z ); | |||
extern void | |||
_mesa_Viewport( GLint x, GLint y, GLsizei width, GLsizei height ); | |||
extern void | |||
_mesa_DepthRange( GLclampd nearval, GLclampd farval ); | |||
extern void gl_MultMatrixd( GLcontext *ctx, const GLdouble *m ); | |||
extern GLboolean gl_matrix_invert( GLmatrix *mat ); | |||
extern void gl_print_matrix( const GLmatrix *m ); | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: pixel.c,v 1.4 1999/11/08 07:36:44 brianp Exp $ */ | |||
/* $Id: pixel.c,v 1.5 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
/* | |||
* glPixelStore, glPixelTransfer, glPixelMap, glPixelZoom, etc. | |||
*/ | |||
@@ -36,15 +33,10 @@ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <stdio.h> | |||
#include <stdlib.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "macros.h" | |||
#include "mem.h" | |||
#include "pixel.h" | |||
#include "types.h" | |||
#endif | |||
@@ -57,8 +49,10 @@ | |||
void gl_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor ) | |||
void | |||
_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelZoom"); | |||
ctx->Pixel.ZoomX = xfactor; | |||
@@ -72,13 +66,13 @@ void gl_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor ) | |||
/**********************************************************************/ | |||
void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param ) | |||
void | |||
_mesa_PixelStorei( GLenum pname, GLint param ) | |||
{ | |||
/* NOTE: this call can't be compiled into the display list */ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelStore"); | |||
switch (pname) { | |||
case GL_PACK_SWAP_BYTES: | |||
ctx->Pack.SwapBytes = param ? GL_TRUE : GL_FALSE; | |||
@@ -174,6 +168,11 @@ void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param ) | |||
} | |||
void | |||
_mesa_PixelStoref( GLenum pname, GLfloat param ) | |||
{ | |||
_mesa_PixelStorei( pname, (GLint) param ); | |||
} | |||
@@ -183,11 +182,11 @@ void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param ) | |||
void gl_PixelMapfv( GLcontext *ctx, | |||
GLenum map, GLint mapsize, const GLfloat *values ) | |||
void | |||
_mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ) | |||
{ | |||
GLint i; | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelMapfv"); | |||
@@ -288,10 +287,50 @@ void gl_PixelMapfv( GLcontext *ctx, | |||
void | |||
_mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values ) | |||
{ | |||
GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; | |||
GLint i; | |||
if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) { | |||
for (i=0;i<mapsize;i++) { | |||
fvalues[i] = (GLfloat) values[i]; | |||
} | |||
} | |||
else { | |||
for (i=0;i<mapsize;i++) { | |||
fvalues[i] = UINT_TO_FLOAT( values[i] ); | |||
} | |||
} | |||
_mesa_PixelMapfv(map, mapsize, fvalues); | |||
} | |||
void | |||
_mesa_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values ) | |||
{ | |||
GLfloat fvalues[MAX_PIXEL_MAP_TABLE]; | |||
GLint i; | |||
if (map==GL_PIXEL_MAP_I_TO_I || map==GL_PIXEL_MAP_S_TO_S) { | |||
for (i=0;i<mapsize;i++) { | |||
fvalues[i] = (GLfloat) values[i]; | |||
} | |||
} | |||
else { | |||
for (i=0;i<mapsize;i++) { | |||
fvalues[i] = USHORT_TO_FLOAT( values[i] ); | |||
} | |||
} | |||
_mesa_PixelMapfv(map, mapsize, fvalues); | |||
} | |||
void gl_GetPixelMapfv( GLcontext *ctx, GLenum map, GLfloat *values ) | |||
void | |||
_mesa_GetPixelMapfv( GLenum map, GLfloat *values ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint i; | |||
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetPixelMapfv"); | |||
@@ -337,8 +376,10 @@ void gl_GetPixelMapfv( GLcontext *ctx, GLenum map, GLfloat *values ) | |||
} | |||
void gl_GetPixelMapuiv( GLcontext *ctx, GLenum map, GLuint *values ) | |||
void | |||
_mesa_GetPixelMapuiv( GLenum map, GLuint *values ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint i; | |||
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetPixelMapfv"); | |||
@@ -396,8 +437,10 @@ void gl_GetPixelMapuiv( GLcontext *ctx, GLenum map, GLuint *values ) | |||
} | |||
void gl_GetPixelMapusv( GLcontext *ctx, GLenum map, GLushort *values ) | |||
void | |||
_mesa_GetPixelMapusv( GLenum map, GLushort *values ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint i; | |||
ASSERT_OUTSIDE_BEGIN_END(ctx, "glGetPixelMapfv"); | |||
@@ -469,8 +512,10 @@ void gl_GetPixelMapusv( GLcontext *ctx, GLenum map, GLushort *values ) | |||
* Implements glPixelTransfer[fi] whether called immediately or from a | |||
* display list. | |||
*/ | |||
void gl_PixelTransferf( GLcontext *ctx, GLenum pname, GLfloat param ) | |||
void | |||
_mesa_PixelTransferf( GLenum pname, GLfloat param ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPixelTransfer"); | |||
@@ -534,6 +579,13 @@ void gl_PixelTransferf( GLcontext *ctx, GLenum pname, GLfloat param ) | |||
} | |||
void | |||
_mesa_PixelTransferi( GLenum pname, GLint param ) | |||
{ | |||
_mesa_PixelTransferf( pname, (GLfloat) param ); | |||
} | |||
/* |
@@ -1,8 +1,8 @@ | |||
/* $Id: pixel.h,v 1.2 1999/10/30 08:20:57 brianp Exp $ */ | |||
/* $Id: pixel.h,v 1.3 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef PIXEL_H | |||
#define PIXEL_H | |||
@@ -40,21 +37,39 @@ | |||
*/ | |||
extern void gl_GetPixelMapfv( GLcontext *ctx, GLenum map, GLfloat *values ); | |||
extern void | |||
_mesa_GetPixelMapfv( GLenum map, GLfloat *values ); | |||
extern void | |||
_mesa_GetPixelMapuiv( GLenum map, GLuint *values ); | |||
extern void | |||
_mesa_GetPixelMapusv( GLenum map, GLushort *values ); | |||
extern void | |||
_mesa_PixelMapfv( GLenum map, GLint mapsize, const GLfloat *values ); | |||
extern void | |||
_mesa_PixelMapuiv(GLenum map, GLint mapsize, const GLuint *values ); | |||
extern void gl_GetPixelMapuiv( GLcontext *ctx, GLenum map, GLuint *values ); | |||
extern void | |||
_mesa_PixelMapusv(GLenum map, GLint mapsize, const GLushort *values ); | |||
extern void gl_GetPixelMapusv( GLcontext *ctx, GLenum map, GLushort *values ); | |||
extern void | |||
_mesa_PixelStoref( GLenum pname, GLfloat param ); | |||
extern void | |||
_mesa_PixelStorei( GLenum pname, GLint param ); | |||
extern void gl_PixelMapfv( GLcontext *ctx, | |||
GLenum map, GLint mapsize, const GLfloat *values ); | |||
extern void | |||
_mesa_PixelTransferf( GLenum pname, GLfloat param ); | |||
extern void gl_PixelStorei( GLcontext *ctx, GLenum pname, GLint param ); | |||
extern void | |||
_mesa_PixelTransferi( GLenum pname, GLint param ); | |||
extern void gl_PixelTransferf( GLcontext *ctx, GLenum pname, GLfloat param ); | |||
extern void | |||
_mesa_PixelZoom( GLfloat xfactor, GLfloat yfactor ); | |||
extern void gl_PixelZoom( GLcontext *ctx, GLfloat xfactor, GLfloat yfactor ); | |||
/* |
@@ -1,8 +1,8 @@ | |||
/* $Id: points.c,v 1.4 1999/10/21 12:45:53 brianp Exp $ */ | |||
/* $Id: points.c,v 1.5 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -23,18 +23,12 @@ | |||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
*/ | |||
/* $XFree86: xc/lib/GL/mesa/src/points.c,v 1.4 1999/04/04 00:20:29 dawes Exp $ */ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <math.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "feedback.h" | |||
#include "macros.h" | |||
@@ -45,18 +39,20 @@ | |||
#include "texstate.h" | |||
#include "types.h" | |||
#include "vb.h" | |||
#include "mmath.h" | |||
#endif | |||
void gl_PointSize( GLcontext *ctx, GLfloat size ) | |||
void | |||
_mesa_PointSize( GLfloat size ) | |||
{ | |||
if (size<=0.0) { | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointSize"); | |||
if (size <= 0.0) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glPointSize" ); | |||
return; | |||
} | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointSize"); | |||
if (ctx->Point.Size != size) { | |||
ctx->Point.Size = size; | |||
@@ -68,11 +64,20 @@ void gl_PointSize( GLcontext *ctx, GLfloat size ) | |||
void gl_PointParameterfvEXT( GLcontext *ctx, GLenum pname, | |||
const GLfloat *params) | |||
void | |||
_mesa_PointParameterfEXT( GLenum pname, GLfloat param) | |||
{ | |||
_mesa_PointParameterfvEXT(pname, ¶m); | |||
} | |||
void | |||
_mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPointParameterfvEXT"); | |||
if(pname==GL_DISTANCE_ATTENUATION_EXT) { | |||
if (pname == GL_DISTANCE_ATTENUATION_EXT) { | |||
GLboolean tmp = ctx->Point.Attenuated; | |||
COPY_3V(ctx->Point.Params,params); | |||
ctx->Point.Attenuated = (params[0] != 1.0 || | |||
@@ -84,25 +89,26 @@ void gl_PointParameterfvEXT( GLcontext *ctx, GLenum pname, | |||
ctx->TriangleCaps ^= DD_POINT_ATTEN; | |||
ctx->NewState |= NEW_RASTER_OPS; | |||
} | |||
} else { | |||
if (*params<0.0 ) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" ); | |||
} | |||
else { | |||
if (*params<0.0 ) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glPointParameterfvEXT" ); | |||
return; | |||
} | |||
switch (pname) { | |||
case GL_POINT_SIZE_MIN_EXT: | |||
ctx->Point.MinSize=*params; | |||
break; | |||
case GL_POINT_SIZE_MAX_EXT: | |||
ctx->Point.MaxSize=*params; | |||
break; | |||
case GL_POINT_FADE_THRESHOLD_SIZE_EXT: | |||
ctx->Point.Threshold=*params; | |||
break; | |||
default: | |||
gl_error( ctx, GL_INVALID_ENUM, "glPointParameterfvEXT" ); | |||
return; | |||
} | |||
switch (pname) { | |||
case GL_POINT_SIZE_MIN_EXT: | |||
ctx->Point.MinSize=*params; | |||
break; | |||
case GL_POINT_SIZE_MAX_EXT: | |||
ctx->Point.MaxSize=*params; | |||
break; | |||
case GL_POINT_FADE_THRESHOLD_SIZE_EXT: | |||
ctx->Point.Threshold=*params; | |||
break; | |||
default: | |||
gl_error( ctx, GL_INVALID_ENUM, "glPointParameterfvEXT" ); | |||
return; | |||
} | |||
} | |||
} | |||
ctx->NewState |= NEW_RASTER_OPS; | |||
} |
@@ -1,8 +1,8 @@ | |||
/* $Id: points.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: points.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -35,11 +35,19 @@ | |||
#include "types.h" | |||
extern void gl_PointSize( GLcontext *ctx, GLfloat size ); | |||
extern void | |||
_mesa_PointSize( GLfloat size ); | |||
extern void | |||
_mesa_PointParameterfEXT( GLenum pname, GLfloat param); | |||
extern void | |||
_mesa_PointParameterfvEXT( GLenum pname, const GLfloat *params ); | |||
extern void gl_set_point_function( GLcontext *ctx ); | |||
extern void gl_PointParameterfvEXT( GLcontext *ctx, GLenum pname, | |||
const GLfloat *params ); | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: polygon.c,v 1.6 1999/11/08 15:28:08 brianp Exp $ */ | |||
/* $Id: polygon.c,v 1.7 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,31 +25,25 @@ | |||
*/ | |||
/* $XFree86: xc/lib/GL/mesa/src/polygon.c,v 1.3 1999/04/04 00:20:29 dawes Exp $ */ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <stdlib.h> | |||
#include <stdio.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "image.h" | |||
#include "enums.h" | |||
#include "macros.h" | |||
#include "mem.h" | |||
#include "polygon.h" | |||
#include "types.h" | |||
#endif | |||
void gl_CullFace( GLcontext *ctx, GLenum mode ) | |||
void | |||
_mesa_CullFace( GLenum mode ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCullFace"); | |||
if (MESA_VERBOSE&VERBOSE_API) | |||
@@ -69,8 +63,10 @@ void gl_CullFace( GLcontext *ctx, GLenum mode ) | |||
void gl_FrontFace( GLcontext *ctx, GLenum mode ) | |||
void | |||
_mesa_FrontFace( GLenum mode ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glFrontFace"); | |||
if (MESA_VERBOSE&VERBOSE_API) | |||
@@ -91,8 +87,10 @@ void gl_FrontFace( GLcontext *ctx, GLenum mode ) | |||
void gl_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) | |||
void | |||
_mesa_PolygonMode( GLenum face, GLenum mode ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonMode"); | |||
if (MESA_VERBOSE&VERBOSE_API) | |||
@@ -137,8 +135,11 @@ void gl_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) | |||
/* | |||
* NOTE: stipple pattern has already been unpacked. | |||
*/ | |||
void gl_PolygonStipple( GLcontext *ctx, const GLuint pattern[32] ) | |||
void | |||
_mesa_PolygonStipple( const GLubyte *mask ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint *pattern = (GLuint *) mask; /* XXX verify */ | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonStipple"); | |||
if (MESA_VERBOSE&VERBOSE_API) | |||
@@ -153,8 +154,10 @@ void gl_PolygonStipple( GLcontext *ctx, const GLuint pattern[32] ) | |||
void gl_GetPolygonStipple( GLcontext *ctx, GLubyte *dest ) | |||
void | |||
_mesa_GetPolygonStipple( GLubyte *dest ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonOffset"); | |||
if (MESA_VERBOSE&VERBOSE_API) | |||
@@ -165,9 +168,10 @@ void gl_GetPolygonStipple( GLcontext *ctx, GLubyte *dest ) | |||
void gl_PolygonOffset( GLcontext *ctx, | |||
GLfloat factor, GLfloat units ) | |||
void | |||
_mesa_PolygonOffset( GLfloat factor, GLfloat units ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPolygonOffset"); | |||
if (MESA_VERBOSE&VERBOSE_API) | |||
@@ -177,3 +181,10 @@ void gl_PolygonOffset( GLcontext *ctx, | |||
ctx->Polygon.OffsetUnits = units; | |||
} | |||
void | |||
_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias ) | |||
{ | |||
_mesa_PolygonOffset(factor, bias * DEPTH_SCALE ); | |||
} | |||
@@ -1,8 +1,8 @@ | |||
/* $Id: polygon.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: polygon.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef POLYGON_H | |||
#define POLYGON_H | |||
@@ -35,18 +32,26 @@ | |||
#include "types.h" | |||
extern void gl_CullFace( GLcontext *ctx, GLenum mode ); | |||
extern void | |||
_mesa_CullFace( GLenum mode ); | |||
extern void | |||
_mesa_FrontFace( GLenum mode ); | |||
extern void gl_FrontFace( GLcontext *ctx, GLenum mode ); | |||
extern void | |||
_mesa_PolygonMode( GLenum face, GLenum mode ); | |||
extern void gl_PolygonMode( GLcontext *ctx, GLenum face, GLenum mode ); | |||
extern void | |||
_mesa_PolygonOffset( GLfloat factor, GLfloat units ); | |||
extern void gl_PolygonOffset( GLcontext *ctx, | |||
GLfloat factor, GLfloat units ); | |||
extern void | |||
_mesa_PolygonOffsetEXT( GLfloat factor, GLfloat bias ); | |||
extern void gl_PolygonStipple( GLcontext *ctx, const GLuint pattern[32] ); | |||
extern void | |||
_mesa_PolygonStipple( const GLubyte *mask ); | |||
extern void gl_GetPolygonStipple( GLcontext *ctx, GLubyte *mask ); | |||
extern void | |||
_mesa_GetPolygonStipple( GLubyte *mask ); | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: rastpos.c,v 1.3 1999/11/08 15:28:08 brianp Exp $ */ | |||
/* $Id: rastpos.c,v 1.4 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,18 +25,10 @@ | |||
*/ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <math.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "clip.h" | |||
#include "context.h" | |||
#include "feedback.h" | |||
@@ -54,8 +46,8 @@ | |||
/* | |||
* Caller: context->API.RasterPos4f | |||
*/ | |||
void gl_RasterPos4f( GLcontext *ctx, | |||
GLfloat x, GLfloat y, GLfloat z, GLfloat w ) | |||
static void raster_pos4f( GLcontext *ctx, | |||
GLfloat x, GLfloat y, GLfloat z, GLfloat w ) | |||
{ | |||
GLfloat v[4], eye[4], clip[4], ndc[3], d; | |||
@@ -161,69 +153,147 @@ void gl_RasterPos4f( GLcontext *ctx, | |||
/* | |||
* This is a MESA extension function. Pretty much just like glRasterPos | |||
* except we don't apply the modelview or projection matrices; specify a | |||
* window coordinate directly. | |||
* Caller: context->API.WindowPos4fMESA pointer. | |||
*/ | |||
void gl_windowpos( GLcontext *ctx, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) | |||
void | |||
_mesa_RasterPos2d(GLdouble x, GLdouble y) | |||
{ | |||
/* KW: Assume that like rasterpos, this must be outside begin/end. | |||
*/ | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH( ctx, "glWindowPosMESA" ); | |||
_mesa_RasterPos4f(x, y, 0.0F, 1.0F); | |||
} | |||
/* set raster position */ | |||
ctx->Current.RasterPos[0] = x; | |||
ctx->Current.RasterPos[1] = y; | |||
ctx->Current.RasterPos[2] = CLAMP( z, 0.0F, 1.0F ); | |||
ctx->Current.RasterPos[3] = w; | |||
void | |||
_mesa_RasterPos2f(GLfloat x, GLfloat y) | |||
{ | |||
_mesa_RasterPos4f(x, y, 0.0F, 1.0F); | |||
} | |||
ctx->Current.RasterPosValid = GL_TRUE; | |||
void | |||
_mesa_RasterPos2i(GLint x, GLint y) | |||
{ | |||
_mesa_RasterPos4f(x, y, 0.0F, 1.0F); | |||
} | |||
/* raster color */ | |||
if (0 && ctx->Light.Enabled) { | |||
/* KW: I don't see how this can work - would have to take the | |||
* inverse of the projection matrix or the combined | |||
* modelProjection matrix, transform point and normal, and | |||
* do the lighting. Those inverses are not used for | |||
* anything else. This is not an object-space lighting | |||
* issue - what this is trying to do is something like | |||
* clip-space or window-space lighting... | |||
* | |||
* Anyway, since the implementation was never correct, I'm | |||
* not fixing it now - just use the unlit color. | |||
*/ | |||
/* KW: As a reprise, we now *do* keep the inverse of the projection | |||
* matrix, so it is not infeasible to try to swim up stream | |||
* in this manner. I still don't want to implement it, | |||
* however. | |||
*/ | |||
} | |||
else { | |||
/* use current color or index */ | |||
if (ctx->Visual->RGBAflag) { | |||
UBYTE_RGBA_TO_FLOAT_RGBA(ctx->Current.RasterColor, | |||
ctx->Current.ByteColor); | |||
} | |||
else { | |||
ctx->Current.RasterIndex = ctx->Current.Index; | |||
} | |||
} | |||
void | |||
_mesa_RasterPos2s(GLshort x, GLshort y) | |||
{ | |||
_mesa_RasterPos4f(x, y, 0.0F, 1.0F); | |||
} | |||
ctx->Current.RasterDistance = 0.0; | |||
void | |||
_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z) | |||
{ | |||
_mesa_RasterPos4f(x, y, z, 1.0F); | |||
} | |||
{ | |||
GLuint texSet; | |||
for (texSet=0; texSet<MAX_TEXTURE_UNITS; texSet++) { | |||
COPY_4FV( ctx->Current.RasterMultiTexCoord[texSet], | |||
ctx->Current.Texcoord[texSet] ); | |||
} | |||
} | |||
void | |||
_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z) | |||
{ | |||
_mesa_RasterPos4f(x, y, z, 1.0F); | |||
} | |||
if (ctx->RenderMode==GL_SELECT) { | |||
gl_update_hitflag( ctx, ctx->Current.RasterPos[2] ); | |||
} | |||
void | |||
_mesa_RasterPos3i(GLint x, GLint y, GLint z) | |||
{ | |||
_mesa_RasterPos4f(x, y, z, 1.0F); | |||
} | |||
void | |||
_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z) | |||
{ | |||
_mesa_RasterPos4f(x, y, z, 1.0F); | |||
} | |||
void | |||
_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w) | |||
{ | |||
_mesa_RasterPos4f(x, y, z, w); | |||
} | |||
void | |||
_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
raster_pos4f(ctx, x, y, z, w); | |||
} | |||
void | |||
_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w) | |||
{ | |||
_mesa_RasterPos4f(x, y, z, w); | |||
} | |||
void | |||
_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w) | |||
{ | |||
_mesa_RasterPos4f(x, y, z, w); | |||
} | |||
void | |||
_mesa_RasterPos2dv(const GLdouble *v) | |||
{ | |||
_mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F); | |||
} | |||
void | |||
_mesa_RasterPos2fv(const GLfloat *v) | |||
{ | |||
_mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F); | |||
} | |||
void | |||
_mesa_RasterPos2iv(const GLint *v) | |||
{ | |||
_mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F); | |||
} | |||
void | |||
_mesa_RasterPos2sv(const GLshort *v) | |||
{ | |||
_mesa_RasterPos4f(v[0], v[1], 0.0F, 1.0F); | |||
} | |||
void | |||
_mesa_RasterPos3dv(const GLdouble *v) | |||
{ | |||
_mesa_RasterPos4f(v[0], v[1], v[2], 1.0F); | |||
} | |||
void | |||
_mesa_RasterPos3fv(const GLfloat *v) | |||
{ | |||
_mesa_RasterPos4f(v[0], v[1], v[2], 1.0F); | |||
} | |||
void | |||
_mesa_RasterPos3iv(const GLint *v) | |||
{ | |||
_mesa_RasterPos4f(v[0], v[1], v[2], 1.0F); | |||
} | |||
void | |||
_mesa_RasterPos3sv(const GLshort *v) | |||
{ | |||
_mesa_RasterPos4f(v[0], v[1], v[2], 1.0F); | |||
} | |||
void | |||
_mesa_RasterPos4dv(const GLdouble *v) | |||
{ | |||
_mesa_RasterPos4f(v[0], v[1], v[2], v[3]); | |||
} | |||
void | |||
_mesa_RasterPos4fv(const GLfloat *v) | |||
{ | |||
_mesa_RasterPos4f(v[0], v[1], v[2], v[3]); | |||
} | |||
void | |||
_mesa_RasterPos4iv(const GLint *v) | |||
{ | |||
_mesa_RasterPos4f(v[0], v[1], v[2], v[3]); | |||
} | |||
void | |||
_mesa_RasterPos4sv(const GLshort *v) | |||
{ | |||
_mesa_RasterPos4f(v[0], v[1], v[2], v[3]); | |||
} |
@@ -1,8 +1,8 @@ | |||
/* $Id: rastpos.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: rastpos.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,23 +25,84 @@ | |||
*/ | |||
#ifndef RASTPOS_H | |||
#define RASTPOS_H | |||
#include "glheader.h" | |||
#ifndef RASTPOS_H | |||
#define RASTPOS_H | |||
extern void | |||
_mesa_RasterPos2d(GLdouble x, GLdouble y); | |||
extern void | |||
_mesa_RasterPos2f(GLfloat x, GLfloat y); | |||
extern void | |||
_mesa_RasterPos2i(GLint x, GLint y); | |||
extern void | |||
_mesa_RasterPos2s(GLshort x, GLshort y); | |||
extern void | |||
_mesa_RasterPos3d(GLdouble x, GLdouble y, GLdouble z); | |||
extern void | |||
_mesa_RasterPos3f(GLfloat x, GLfloat y, GLfloat z); | |||
extern void | |||
_mesa_RasterPos3i(GLint x, GLint y, GLint z); | |||
extern void | |||
_mesa_RasterPos3s(GLshort x, GLshort y, GLshort z); | |||
extern void | |||
_mesa_RasterPos4d(GLdouble x, GLdouble y, GLdouble z, GLdouble w); | |||
extern void | |||
_mesa_RasterPos4f(GLfloat x, GLfloat y, GLfloat z, GLfloat w); | |||
extern void | |||
_mesa_RasterPos4i(GLint x, GLint y, GLint z, GLint w); | |||
extern void | |||
_mesa_RasterPos4s(GLshort x, GLshort y, GLshort z, GLshort w); | |||
extern void | |||
_mesa_RasterPos2dv(const GLdouble *v); | |||
extern void | |||
_mesa_RasterPos2fv(const GLfloat *v); | |||
extern void | |||
_mesa_RasterPos2iv(const GLint *v); | |||
extern void | |||
_mesa_RasterPos2sv(const GLshort *v); | |||
extern void | |||
_mesa_RasterPos3dv(const GLdouble *v); | |||
extern void | |||
_mesa_RasterPos3fv(const GLfloat *v); | |||
#include "types.h" | |||
extern void | |||
_mesa_RasterPos3iv(const GLint *v); | |||
extern void | |||
_mesa_RasterPos3sv(const GLshort *v); | |||
extern void gl_RasterPos4f( GLcontext *ctx, | |||
GLfloat x, GLfloat y, GLfloat z, GLfloat w ); | |||
extern void | |||
_mesa_RasterPos4dv(const GLdouble *v); | |||
extern void | |||
_mesa_RasterPos4fv(const GLfloat *v); | |||
extern void gl_windowpos( GLcontext *ctx, | |||
GLfloat x, GLfloat y, GLfloat z, GLfloat w ); | |||
extern void | |||
_mesa_RasterPos4iv(const GLint *v); | |||
extern void | |||
_mesa_RasterPos4sv(const GLshort *v); | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: stencil.c,v 1.8 1999/11/08 15:28:08 brianp Exp $ */ | |||
/* $Id: stencil.c,v 1.9 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,19 +25,12 @@ | |||
*/ | |||
/* $XFree86: xc/lib/GL/mesa/src/stencil.c,v 1.3 1999/04/04 00:20:32 dawes Exp $ */ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <stdlib.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "macros.h" | |||
#include "mem.h" | |||
#include "pb.h" | |||
#include "stencil.h" | |||
#include "types.h" | |||
@@ -61,8 +54,10 @@ | |||
#define STENCIL_ADDRESS(X,Y) (ctx->Buffer->Stencil + ctx->Buffer->Width * (Y) + (X)) | |||
void gl_ClearStencil( GLcontext *ctx, GLint s ) | |||
void | |||
_mesa_ClearStencil( GLint s ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glClearStencil"); | |||
ctx->Stencil.Clear = (GLstencil) s; | |||
@@ -73,8 +68,10 @@ void gl_ClearStencil( GLcontext *ctx, GLint s ) | |||
void gl_StencilFunc( GLcontext *ctx, GLenum func, GLint ref, GLuint mask ) | |||
void | |||
_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint maxref; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilFunc"); | |||
@@ -106,8 +103,10 @@ void gl_StencilFunc( GLcontext *ctx, GLenum func, GLint ref, GLuint mask ) | |||
void gl_StencilMask( GLcontext *ctx, GLuint mask ) | |||
void | |||
_mesa_StencilMask( GLuint mask ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilMask"); | |||
ctx->Stencil.WriteMask = (GLstencil) mask; | |||
@@ -118,8 +117,10 @@ void gl_StencilMask( GLcontext *ctx, GLuint mask ) | |||
void gl_StencilOp( GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass ) | |||
void | |||
_mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glStencilOp"); | |||
switch (fail) { | |||
case GL_KEEP: | |||
@@ -1061,7 +1062,7 @@ void gl_alloc_stencil_buffer( GLcontext *ctx ) | |||
ctx->Buffer->Stencil = (GLstencil *) MALLOC(buffersize * sizeof(GLstencil)); | |||
if (!ctx->Buffer->Stencil) { | |||
/* out of memory */ | |||
gl_set_enable( ctx, GL_STENCIL_TEST, GL_FALSE ); | |||
_mesa_set_enable( ctx, GL_STENCIL_TEST, GL_FALSE ); | |||
gl_error( ctx, GL_OUT_OF_MEMORY, "gl_alloc_stencil_buffer" ); | |||
} | |||
} |
@@ -1,8 +1,8 @@ | |||
/* $Id: stencil.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: stencil.h,v 1.2 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef STENCIL_H | |||
#define STENCIL_H | |||
@@ -35,18 +32,20 @@ | |||
#include "types.h" | |||
extern void gl_ClearStencil( GLcontext *ctx, GLint s ); | |||
extern void | |||
_mesa_ClearStencil( GLint s ); | |||
extern void gl_StencilFunc( GLcontext *ctx, GLenum func, | |||
GLint ref, GLuint mask ); | |||
extern void | |||
_mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ); | |||
extern void gl_StencilMask( GLcontext *ctx, GLuint mask ); | |||
extern void | |||
_mesa_StencilMask( GLuint mask ); | |||
extern void gl_StencilOp( GLcontext *ctx, GLenum fail, | |||
GLenum zfail, GLenum zpass ); | |||
extern void | |||
_mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ); | |||
@@ -1,8 +1,8 @@ | |||
/* $Id: teximage.c,v 1.11 1999/11/08 07:36:44 brianp Exp $ */ | |||
/* $Id: teximage.c,v 1.12 1999/11/11 01:22:27 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -28,17 +28,10 @@ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <stdio.h> | |||
#include <stdlib.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "image.h" | |||
#include "macros.h" | |||
#include "mem.h" | |||
#include "mmath.h" | |||
#include "span.h" | |||
#include "teximage.h" | |||
@@ -58,25 +51,13 @@ | |||
static struct gl_pixelstore_attrib defaultPacking = { | |||
1, /* Alignment */ | |||
0, /* RowLength */ | |||
0, /* SkipPixels */ | |||
0, /* SkipRows */ | |||
0, /* ImageHeight */ | |||
0, /* SkipImages */ | |||
GL_FALSE, /* SwapBytes */ | |||
GL_FALSE /* LsbFirst */ | |||
}; | |||
/* | |||
* Compute log base 2 of n. | |||
* If n isn't an exact power of two return -1. | |||
* If n<0 return -1. | |||
*/ | |||
static int logbase2( int n ) | |||
static int | |||
logbase2( int n ) | |||
{ | |||
GLint i = 1; | |||
GLint log2 = 0; | |||
@@ -105,7 +86,8 @@ static int logbase2( int n ) | |||
* GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA. | |||
* Return -1 if invalid enum. | |||
*/ | |||
static GLint decode_internal_format( GLint format ) | |||
static GLint | |||
decode_internal_format( GLint format ) | |||
{ | |||
switch (format) { | |||
case GL_ALPHA: | |||
@@ -177,7 +159,8 @@ static GLint decode_internal_format( GLint format ) | |||
* GL_LUMANCE_ALPHA, GL_INTENSITY, GL_RGB, or GL_RGBA. Return the | |||
* number of components for the format. Return -1 if invalid enum. | |||
*/ | |||
static GLint components_in_intformat( GLint format ) | |||
static GLint | |||
components_in_intformat( GLint format ) | |||
{ | |||
switch (format) { | |||
case GL_ALPHA: | |||
@@ -243,14 +226,16 @@ static GLint components_in_intformat( GLint format ) | |||
struct gl_texture_image *gl_alloc_texture_image( void ) | |||
struct gl_texture_image * | |||
gl_alloc_texture_image( void ) | |||
{ | |||
return CALLOC_STRUCT(gl_texture_image); | |||
} | |||
void gl_free_texture_image( struct gl_texture_image *teximage ) | |||
void | |||
gl_free_texture_image( struct gl_texture_image *teximage ) | |||
{ | |||
if (teximage->Data) { | |||
FREE( teximage->Data ); | |||
@@ -267,7 +252,8 @@ void gl_free_texture_image( struct gl_texture_image *teximage ) | |||
* These fields are set only here by core Mesa but device drivers may | |||
* overwritting these fields to indicate true texel resolution. | |||
*/ | |||
static void set_teximage_component_sizes( struct gl_texture_image *texImage ) | |||
static void | |||
set_teximage_component_sizes( struct gl_texture_image *texImage ) | |||
{ | |||
switch (texImage->Format) { | |||
case GL_ALPHA: | |||
@@ -762,7 +748,7 @@ texture_error_check( GLcontext *ctx, GLenum target, | |||
* Return: GL_TRUE = an error was detected, GL_FALSE = no errors | |||
*/ | |||
static GLboolean | |||
subtexture_error_check( GLcontext *ctx, GLint dimensions, | |||
subtexture_error_check( GLcontext *ctx, GLuint dimensions, | |||
GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, GLint zoffset, | |||
GLint width, GLint height, GLint depth, | |||
@@ -870,7 +856,7 @@ subtexture_error_check( GLcontext *ctx, GLint dimensions, | |||
* Return: GL_TRUE = an error was detected, GL_FALSE = no errors | |||
*/ | |||
static GLboolean | |||
copytexture_error_check( GLcontext *ctx, GLint dimensions, | |||
copytexture_error_check( GLcontext *ctx, GLuint dimensions, | |||
GLenum target, GLint level, GLint internalFormat, | |||
GLint width, GLint height, GLint border ) | |||
{ | |||
@@ -940,7 +926,7 @@ copytexture_error_check( GLcontext *ctx, GLint dimensions, | |||
static GLboolean | |||
copytexsubimage_error_check( GLcontext *ctx, GLint dimensions, | |||
copytexsubimage_error_check( GLcontext *ctx, GLuint dimensions, | |||
GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, GLint zoffset, | |||
GLsizei width, GLsizei height ) | |||
@@ -981,7 +967,7 @@ copytexsubimage_error_check( GLcontext *ctx, GLint dimensions, | |||
return GL_TRUE; | |||
} | |||
teximage = texUnit->CurrentD[dimensions]->Image[level]; | |||
teximage = texUnit->CurrentD[3]->Image[level]; | |||
if (!teximage) { | |||
char message[100]; | |||
sprintf(message, "glCopyTexSubImage%dD(undefined texture)", dimensions); | |||
@@ -1042,11 +1028,12 @@ copytexsubimage_error_check( GLcontext *ctx, GLint dimensions, | |||
/* | |||
* Called from the API. Note that width includes the border. | |||
*/ | |||
void gl_TexImage1D( GLcontext *ctx, GLenum target, GLint level, | |||
GLint internalformat, | |||
GLsizei width, GLint border, GLenum format, | |||
GLenum type, const GLvoid *pixels ) | |||
void | |||
_mesa_TexImage1D( GLenum target, GLint level, GLint internalformat, | |||
GLsizei width, GLint border, GLenum format, | |||
GLenum type, const GLvoid *pixels ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage1D"); | |||
@@ -1111,12 +1098,13 @@ void gl_TexImage1D( GLcontext *ctx, GLenum target, GLint level, | |||
} | |||
void gl_TexImage2D( GLcontext *ctx, GLenum target, GLint level, | |||
GLint internalformat, | |||
GLsizei width, GLsizei height, GLint border, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ) | |||
void | |||
_mesa_TexImage2D( GLenum target, GLint level, GLint internalformat, | |||
GLsizei width, GLsizei height, GLint border, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage2D"); | |||
@@ -1186,16 +1174,17 @@ void gl_TexImage2D( GLcontext *ctx, GLenum target, GLint level, | |||
* Called by the API or display list executor. | |||
* Note that width and height include the border. | |||
*/ | |||
void gl_TexImage3D( GLcontext *ctx, GLenum target, GLint level, | |||
GLint internalformat, | |||
GLsizei width, GLsizei height, GLsizei depth, | |||
GLint border, GLenum format, GLenum type, | |||
const GLvoid *pixels ) | |||
void | |||
_mesa_TexImage3D( GLenum target, GLint level, GLint internalformat, | |||
GLsizei width, GLsizei height, GLsizei depth, | |||
GLint border, GLenum format, GLenum type, | |||
const GLvoid *pixels ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage3D"); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexImage3DEXT"); | |||
if (target==GL_TEXTURE_3D) { | |||
if (target==GL_TEXTURE_3D_EXT) { | |||
struct gl_texture_image *teximage; | |||
if (texture_error_check( ctx, target, level, internalformat, | |||
format, type, 3, width, height, depth, | |||
@@ -1259,9 +1248,11 @@ void gl_TexImage3D( GLcontext *ctx, GLenum target, GLint level, | |||
void gl_GetTexImage( GLcontext *ctx, GLenum target, GLint level, GLenum format, | |||
GLenum type, GLvoid *pixels ) | |||
void | |||
_mesa_GetTexImage( GLenum target, GLint level, GLenum format, | |||
GLenum type, GLvoid *pixels ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
const struct gl_texture_object *texObj; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetTexImage"); | |||
@@ -1387,11 +1378,13 @@ void gl_GetTexImage( GLcontext *ctx, GLenum target, GLint level, GLenum format, | |||
void gl_TexSubImage1D( GLcontext *ctx, GLenum target, GLint level, | |||
GLint xoffset, GLsizei width, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ) | |||
void | |||
_mesa_TexSubImage1D( GLenum target, GLint level, | |||
GLint xoffset, GLsizei width, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
struct gl_texture_image *destTex; | |||
@@ -1454,12 +1447,14 @@ void gl_TexSubImage1D( GLcontext *ctx, GLenum target, GLint level, | |||
} | |||
void gl_TexSubImage2D( GLcontext *ctx, GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, | |||
GLsizei width, GLsizei height, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ) | |||
void | |||
_mesa_TexSubImage2D( GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, | |||
GLsizei width, GLsizei height, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
struct gl_texture_image *destTex; | |||
@@ -1535,12 +1530,14 @@ void gl_TexSubImage2D( GLcontext *ctx, GLenum target, GLint level, | |||
void gl_TexSubImage3D( GLcontext *ctx, GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, GLint zoffset, | |||
GLsizei width, GLsizei height, GLsizei depth, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ) | |||
void | |||
_mesa_TexSubImage3D( GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, GLint zoffset, | |||
GLsizei width, GLsizei height, GLsizei depth, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
struct gl_texture_image *destTex; | |||
@@ -1647,11 +1644,13 @@ read_color_image( GLcontext *ctx, GLint x, GLint y, | |||
void gl_CopyTexImage1D( GLcontext *ctx, GLenum target, GLint level, | |||
GLenum internalFormat, | |||
GLint x, GLint y, | |||
GLsizei width, GLint border ) | |||
void | |||
_mesa_CopyTexImage1D( GLenum target, GLint level, | |||
GLenum internalFormat, | |||
GLint x, GLint y, | |||
GLsizei width, GLint border ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexImage1D"); | |||
if (!copytexture_error_check(ctx, 1, target, level, internalFormat, | |||
@@ -1661,19 +1660,20 @@ void gl_CopyTexImage1D( GLcontext *ctx, GLenum target, GLint level, | |||
gl_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexImage1D" ); | |||
return; | |||
} | |||
(*ctx->Exec.TexImage1D)( ctx, target, level, internalFormat, width, | |||
border, GL_RGBA, GL_UNSIGNED_BYTE, image ); | |||
(*ctx->Exec.TexImage1D)( target, level, internalFormat, width, | |||
border, GL_RGBA, GL_UNSIGNED_BYTE, image ); | |||
FREE(image); | |||
} | |||
} | |||
void gl_CopyTexImage2D( GLcontext *ctx, GLenum target, GLint level, | |||
GLenum internalFormat, | |||
GLint x, GLint y, GLsizei width, GLsizei height, | |||
GLint border ) | |||
void | |||
_mesa_CopyTexImage2D( GLenum target, GLint level, GLenum internalFormat, | |||
GLint x, GLint y, GLsizei width, GLsizei height, | |||
GLint border ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexImage2D"); | |||
if (!copytexture_error_check(ctx, 2, target, level, internalFormat, | |||
@@ -1683,13 +1683,8 @@ void gl_CopyTexImage2D( GLcontext *ctx, GLenum target, GLint level, | |||
gl_error( ctx, GL_OUT_OF_MEMORY, "glCopyTexImage2D" ); | |||
return; | |||
} | |||
{ | |||
struct gl_pixelstore_attrib save = ctx->Unpack; | |||
ctx->Unpack = defaultPacking; | |||
(ctx->Exec.TexImage2D)( ctx, target, level, internalFormat, width, | |||
(ctx->Exec.TexImage2D)( target, level, internalFormat, width, | |||
height, border, GL_RGBA, GL_UNSIGNED_BYTE, image ); | |||
ctx->Unpack = save; /* restore */ | |||
} | |||
FREE(image); | |||
} | |||
} | |||
@@ -1751,9 +1746,11 @@ copy_tex_sub_image( GLcontext *ctx, struct gl_texture_image *dest, | |||
void gl_CopyTexSubImage1D( GLcontext *ctx, GLenum target, GLint level, | |||
GLint xoffset, GLint x, GLint y, GLsizei width ) | |||
void | |||
_mesa_CopyTexSubImage1D( GLenum target, GLint level, | |||
GLint xoffset, GLint x, GLint y, GLsizei width ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexSubImage1D"); | |||
if (!copytexsubimage_error_check(ctx, 1, target, level, | |||
@@ -1777,10 +1774,12 @@ void gl_CopyTexSubImage1D( GLcontext *ctx, GLenum target, GLint level, | |||
void gl_CopyTexSubImage2D( GLcontext *ctx, GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, | |||
GLint x, GLint y, GLsizei width, GLsizei height ) | |||
void | |||
_mesa_CopyTexSubImage2D( GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, | |||
GLint x, GLint y, GLsizei width, GLsizei height ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexSubImage2D"); | |||
if (!copytexsubimage_error_check(ctx, 2, target, level, | |||
@@ -1805,10 +1804,12 @@ void gl_CopyTexSubImage2D( GLcontext *ctx, GLenum target, GLint level, | |||
void gl_CopyTexSubImage3D( GLcontext *ctx, GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, GLint zoffset, | |||
GLint x, GLint y, GLsizei width, GLsizei height ) | |||
void | |||
_mesa_CopyTexSubImage3D( GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, GLint zoffset, | |||
GLint x, GLint y, GLsizei width, GLsizei height ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glCopyTexSubImage3D"); | |||
if (!copytexsubimage_error_check(ctx, 3, target, level, |
@@ -1,8 +1,8 @@ | |||
/* $Id: teximage.h,v 1.2 1999/11/03 17:27:05 brianp Exp $ */ | |||
/* $Id: teximage.h,v 1.3 1999/11/11 01:22:28 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -35,97 +35,90 @@ | |||
/*** Internal functions ***/ | |||
extern struct gl_texture_image *gl_alloc_texture_image( void ); | |||
extern struct gl_texture_image * | |||
gl_alloc_texture_image( void ); | |||
extern void gl_free_texture_image( struct gl_texture_image *teximage ); | |||
extern void | |||
gl_free_texture_image( struct gl_texture_image *teximage ); | |||
/*** API entry point functions ***/ | |||
/*** API entry points ***/ | |||
extern void | |||
_mesa_TexImage1D( GLenum target, GLint level, GLint internalformat, | |||
GLsizei width, GLint border, | |||
GLenum format, GLenum type, const GLvoid *pixels ); | |||
extern void gl_TexImage1D( GLcontext *ctx, | |||
GLenum target, GLint level, GLint internalformat, | |||
GLsizei width, GLint border, GLenum format, | |||
GLenum type, const GLvoid *pixels ); | |||
extern void | |||
_mesa_TexImage2D( GLenum target, GLint level, GLint internalformat, | |||
GLsizei width, GLsizei height, GLint border, | |||
GLenum format, GLenum type, const GLvoid *pixels ); | |||
extern void gl_TexImage2D( GLcontext *ctx, | |||
GLenum target, GLint level, GLint internalformat, | |||
GLsizei width, GLsizei height, GLint border, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ); | |||
extern void | |||
_mesa_TexImage3D( GLenum target, GLint level, GLint internalformat, | |||
GLsizei width, GLsizei height, GLsizei depth, GLint border, | |||
GLenum format, GLenum type, const GLvoid *pixels ); | |||
extern void gl_TexImage3D( GLcontext *ctx, | |||
GLenum target, GLint level, GLint internalformat, | |||
GLsizei width, GLsizei height, GLsizei depth, | |||
GLint border, GLenum format, GLenum type, | |||
const GLvoid *pixels ); | |||
extern void | |||
_mesa_GetTexImage( GLenum target, GLint level, | |||
GLenum format, GLenum type, GLvoid *pixels ); | |||
extern void gl_GetTexImage( GLcontext *ctx, GLenum target, GLint level, | |||
GLenum format, GLenum type, GLvoid *pixels ); | |||
extern void | |||
_mesa_TexSubImage1D( GLenum target, GLint level, GLint xoffset, | |||
GLsizei width, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ); | |||
extern void gl_TexSubImage1D( GLcontext *ctx, | |||
GLenum target, GLint level, GLint xoffset, | |||
GLsizei width, GLenum format, GLenum type, | |||
const GLvoid *pixels ); | |||
extern void | |||
_mesa_TexSubImage2D( GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, | |||
GLsizei width, GLsizei height, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ); | |||
extern void gl_TexSubImage2D( GLcontext *ctx, | |||
GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, | |||
GLsizei width, GLsizei height, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ); | |||
extern void | |||
_mesa_TexSubImage3D( GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, GLint zoffset, | |||
GLsizei width, GLsizei height, GLsizei depth, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ); | |||
extern void gl_TexSubImage3D( GLcontext *ctx, | |||
GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, GLint zoffset, | |||
GLsizei width, GLsizei height, GLsizei depth, | |||
GLenum format, GLenum type, | |||
const GLvoid *pixels ); | |||
extern void | |||
_mesa_CopyTexImage1D( GLenum target, GLint level, GLenum internalformat, | |||
GLint x, GLint y, GLsizei width, GLint border ); | |||
extern void gl_CopyTexImage1D( GLcontext *ctx, | |||
GLenum target, GLint level, | |||
GLenum internalformat, | |||
GLint x, GLint y, | |||
GLsizei width, GLint border ); | |||
extern void | |||
_mesa_CopyTexImage2D( GLenum target, GLint level, | |||
GLenum internalformat, GLint x, GLint y, | |||
GLsizei width, GLsizei height, GLint border ); | |||
extern void gl_CopyTexImage2D( GLcontext *ctx, | |||
GLenum target, GLint level, | |||
GLenum internalformat, GLint x, GLint y, | |||
GLsizei width, GLsizei height, | |||
GLint border ); | |||
extern void | |||
_mesa_CopyTexSubImage1D( GLenum target, GLint level, GLint xoffset, | |||
GLint x, GLint y, GLsizei width ); | |||
extern void gl_CopyTexSubImage1D( GLcontext *ctx, | |||
GLenum target, GLint level, | |||
GLint xoffset, GLint x, GLint y, | |||
GLsizei width ); | |||
extern void | |||
_mesa_CopyTexSubImage2D( GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, | |||
GLint x, GLint y, GLsizei width, GLsizei height ); | |||
extern void gl_CopyTexSubImage2D( GLcontext *ctx, | |||
GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, | |||
GLint x, GLint y, | |||
GLsizei width, GLsizei height ); | |||
extern void gl_CopyTexSubImage3D( GLcontext *ctx, | |||
GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, | |||
GLint zoffset, | |||
GLint x, GLint y, | |||
GLsizei width, GLsizei height ); | |||
extern void | |||
_mesa_CopyTexSubImage3D( GLenum target, GLint level, | |||
GLint xoffset, GLint yoffset, GLint zoffset, | |||
GLint x, GLint y, GLsizei width, GLsizei height ); | |||
#endif | |||
@@ -1,8 +1,8 @@ | |||
/* $Id: texobj.c,v 1.7 1999/11/05 06:43:11 brianp Exp $ */ | |||
/* $Id: texobj.c,v 1.8 1999/11/11 01:22:28 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -23,25 +23,16 @@ | |||
* AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | |||
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | |||
*/ | |||
/* $XFree86: xc/lib/GL/mesa/src/texobj.c,v 1.3 1999/04/04 00:20:32 dawes Exp $ */ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <stdio.h> | |||
#include <stdlib.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "enums.h" | |||
#include "hash.h" | |||
#include "macros.h" | |||
#include "mem.h" | |||
#include "teximage.h" | |||
#include "texstate.h" | |||
#include "texobj.h" | |||
@@ -83,13 +74,13 @@ gl_alloc_texture_object( struct gl_shared_state *shared, GLuint name, | |||
obj->BaseLevel = 0; | |||
obj->MaxLevel = 1000; | |||
obj->MinMagThresh = 0.0F; | |||
obj->Palette[0] = 255; | |||
obj->Palette[1] = 255; | |||
obj->Palette[2] = 255; | |||
obj->Palette[3] = 255; | |||
obj->PaletteSize = 1; | |||
obj->PaletteIntFormat = GL_RGBA; | |||
obj->PaletteFormat = GL_RGBA; | |||
obj->Palette.Table[0] = 255; | |||
obj->Palette.Table[1] = 255; | |||
obj->Palette.Table[2] = 255; | |||
obj->Palette.Table[3] = 255; | |||
obj->Palette.Size = 1; | |||
obj->Palette.IntFormat = GL_RGBA; | |||
obj->Palette.Format = GL_RGBA; | |||
/* insert into linked list */ | |||
if (shared) { | |||
@@ -334,8 +325,10 @@ void gl_test_texture_object_completeness( const GLcontext *ctx, struct gl_textur | |||
/* | |||
* Execute glGenTextures | |||
*/ | |||
void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *texName ) | |||
void | |||
_mesa_GenTextures( GLsizei n, GLuint *texName ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint first; | |||
GLint i; | |||
@@ -365,8 +358,10 @@ void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *texName ) | |||
/* | |||
* Execute glDeleteTextures | |||
*/ | |||
void gl_DeleteTextures( GLcontext *ctx, GLsizei n, const GLuint *texName) | |||
void | |||
_mesa_DeleteTextures( GLsizei n, const GLuint *texName) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint i; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDeleteTextures"); | |||
@@ -409,8 +404,10 @@ void gl_DeleteTextures( GLcontext *ctx, GLsizei n, const GLuint *texName) | |||
/* | |||
* Execute glBindTexture | |||
*/ | |||
void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texName ) | |||
void | |||
_mesa_BindTexture( GLenum target, GLuint texName ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint unit = ctx->Texture.CurrentUnit; | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[unit]; | |||
struct gl_texture_object *oldTexObj; | |||
@@ -501,10 +498,11 @@ void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texName ) | |||
/* | |||
* Execute glPrioritizeTextures | |||
*/ | |||
void gl_PrioritizeTextures( GLcontext *ctx, | |||
GLsizei n, const GLuint *texName, | |||
const GLclampf *priorities ) | |||
void | |||
_mesa_PrioritizeTextures( GLsizei n, const GLuint *texName, | |||
const GLclampf *priorities ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint i; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glPrioritizeTextures"); | |||
@@ -533,10 +531,11 @@ void gl_PrioritizeTextures( GLcontext *ctx, | |||
/* | |||
* Execute glAreTexturesResident | |||
*/ | |||
GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n, | |||
const GLuint *texName, | |||
GLboolean *residences ) | |||
GLboolean | |||
_mesa_AreTexturesResident( GLsizei n, const GLuint *texName, | |||
GLboolean *residences ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLboolean resident = GL_TRUE; | |||
GLint i; | |||
@@ -575,8 +574,10 @@ GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n, | |||
/* | |||
* Execute glIsTexture | |||
*/ | |||
GLboolean gl_IsTexture( GLcontext *ctx, GLuint texture ) | |||
GLboolean | |||
_mesa_IsTexture( GLuint texture ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glIsTextures", | |||
GL_FALSE); | |||
if (texture>0 && HashLookup(ctx->Shared->TexObjects, texture)) { |
@@ -1,8 +1,8 @@ | |||
/* $Id: texobj.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: texobj.h,v 1.2 1999/11/11 01:22:28 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,9 +25,6 @@ | |||
*/ | |||
#ifndef TEXTOBJ_H | |||
#define TEXTOBJ_H | |||
@@ -59,27 +56,30 @@ extern void gl_test_texture_object_completeness( const GLcontext *ctx, struct gl | |||
* API functions | |||
*/ | |||
extern void gl_GenTextures( GLcontext *ctx, GLsizei n, GLuint *textures ); | |||
extern void | |||
_mesa_GenTextures( GLsizei n, GLuint *textures ); | |||
extern void gl_DeleteTextures( GLcontext *ctx, | |||
GLsizei n, const GLuint *textures); | |||
extern void | |||
_mesa_DeleteTextures( GLsizei n, const GLuint *textures ); | |||
extern void gl_BindTexture( GLcontext *ctx, GLenum target, GLuint texture ); | |||
extern void | |||
_mesa_BindTexture( GLenum target, GLuint texture ); | |||
extern void gl_PrioritizeTextures( GLcontext *ctx, | |||
GLsizei n, const GLuint *textures, | |||
const GLclampf *priorities ); | |||
extern void | |||
_mesa_PrioritizeTextures( GLsizei n, const GLuint *textures, | |||
const GLclampf *priorities ); | |||
extern GLboolean gl_AreTexturesResident( GLcontext *ctx, GLsizei n, | |||
const GLuint *textures, | |||
GLboolean *residences ); | |||
extern GLboolean | |||
_mesa_AreTexturesResident( GLsizei n, const GLuint *textures, | |||
GLboolean *residences ); | |||
extern GLboolean gl_IsTexture( GLcontext *ctx, GLuint texture ); | |||
extern GLboolean | |||
_mesa_IsTexture( GLuint texture ); | |||
#endif |
@@ -1,8 +1,8 @@ | |||
/* $Id: texstate.c,v 1.4 1999/11/05 06:43:11 brianp Exp $ */ | |||
/* $Id: texstate.c,v 1.5 1999/11/11 01:22:28 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
* Version: 3.1 | |||
* Version: 3.3 | |||
* | |||
* Copyright (C) 1999 Brian Paul All Rights Reserved. | |||
* | |||
@@ -25,16 +25,10 @@ | |||
*/ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <assert.h> | |||
#include <stdio.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "enums.h" | |||
#include "macros.h" | |||
@@ -66,9 +60,10 @@ | |||
/**********************************************************************/ | |||
void gl_TexEnvfv( GLcontext *ctx, | |||
GLenum target, GLenum pname, const GLfloat *param ) | |||
void | |||
_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexEnv"); | |||
@@ -128,12 +123,40 @@ void gl_TexEnvfv( GLcontext *ctx, | |||
} | |||
void | |||
_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ) | |||
{ | |||
_mesa_TexEnvfv( target, pname, ¶m ); | |||
} | |||
void | |||
_mesa_TexEnvi( GLenum target, GLenum pname, GLint param ) | |||
{ | |||
GLfloat p[4]; | |||
p[0] = (GLfloat) param; | |||
p[1] = p[2] = p[3] = 0.0; | |||
_mesa_TexEnvfv( target, pname, p ); | |||
} | |||
void | |||
_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ) | |||
{ | |||
GLfloat p[4]; | |||
p[0] = INT_TO_FLOAT( param[0] ); | |||
p[1] = INT_TO_FLOAT( param[1] ); | |||
p[2] = INT_TO_FLOAT( param[2] ); | |||
p[3] = INT_TO_FLOAT( param[3] ); | |||
_mesa_TexEnvfv( target, pname, p ); | |||
} | |||
void gl_GetTexEnvfv( GLcontext *ctx, | |||
GLenum target, GLenum pname, GLfloat *params ) | |||
void | |||
_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
if (target!=GL_TEXTURE_ENV) { | |||
gl_error( ctx, GL_INVALID_ENUM, "glGetTexEnvfv(target)" ); | |||
@@ -152,9 +175,10 @@ void gl_GetTexEnvfv( GLcontext *ctx, | |||
} | |||
void gl_GetTexEnviv( GLcontext *ctx, | |||
GLenum target, GLenum pname, GLint *params ) | |||
void | |||
_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
if (target!=GL_TEXTURE_ENV) { | |||
gl_error( ctx, GL_INVALID_ENUM, "glGetTexEnviv(target)" ); | |||
@@ -183,9 +207,17 @@ void gl_GetTexEnviv( GLcontext *ctx, | |||
/**********************************************************************/ | |||
void gl_TexParameterfv( GLcontext *ctx, | |||
GLenum target, GLenum pname, const GLfloat *params ) | |||
void | |||
_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ) | |||
{ | |||
_mesa_TexParameterfv(target, pname, ¶m); | |||
} | |||
void | |||
_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
GLenum eparam = (GLenum) (GLint) params[0]; | |||
struct gl_texture_object *texObj; | |||
@@ -330,20 +362,41 @@ void gl_TexParameterfv( GLcontext *ctx, | |||
} | |||
void | |||
_mesa_TexParameteri( GLenum target, GLenum pname, const GLint param ) | |||
{ | |||
GLfloat fparam[4]; | |||
fparam[0] = (GLfloat) param; | |||
fparam[1] = fparam[2] = fparam[3] = 0.0; | |||
_mesa_TexParameterfv(target, pname, fparam); | |||
} | |||
void | |||
_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ) | |||
{ | |||
GLfloat fparam[4]; | |||
fparam[0] = (GLfloat) params[0]; | |||
fparam[1] = fparam[2] = fparam[3] = 0.0; | |||
_mesa_TexParameterfv(target, pname, fparam); | |||
} | |||
void gl_GetTexLevelParameterfv( GLcontext *ctx, GLenum target, GLint level, | |||
GLenum pname, GLfloat *params ) | |||
void | |||
_mesa_GetTexLevelParameterfv( GLenum target, GLint level, | |||
GLenum pname, GLfloat *params ) | |||
{ | |||
GLint iparam; | |||
gl_GetTexLevelParameteriv( ctx, target, level, pname, &iparam ); | |||
_mesa_GetTexLevelParameteriv( target, level, pname, &iparam ); | |||
*params = (GLfloat) iparam; | |||
} | |||
void gl_GetTexLevelParameteriv( GLcontext *ctx, GLenum target, GLint level, | |||
GLenum pname, GLint *params ) | |||
void | |||
_mesa_GetTexLevelParameteriv( GLenum target, GLint level, | |||
GLenum pname, GLint *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
const struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
const struct gl_texture_image *img = NULL; | |||
GLuint dimensions; | |||
@@ -448,10 +501,10 @@ void gl_GetTexLevelParameteriv( GLcontext *ctx, GLenum target, GLint level, | |||
void gl_GetTexParameterfv( GLcontext *ctx, | |||
GLenum target, GLenum pname, GLfloat *params ) | |||
void | |||
_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
struct gl_texture_object *obj; | |||
@@ -516,9 +569,10 @@ void gl_GetTexParameterfv( GLcontext *ctx, | |||
} | |||
void gl_GetTexParameteriv( GLcontext *ctx, | |||
GLenum target, GLenum pname, GLint *params ) | |||
void | |||
_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[ctx->Texture.CurrentUnit]; | |||
struct gl_texture_object *obj; | |||
@@ -597,9 +651,10 @@ void gl_GetTexParameteriv( GLcontext *ctx, | |||
/**********************************************************************/ | |||
void gl_TexGenfv( GLcontext *ctx, | |||
GLenum coord, GLenum pname, const GLfloat *params ) | |||
void | |||
_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint tUnit = ctx->Texture.CurrentTransformUnit; | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit]; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glTexGenfv"); | |||
@@ -610,7 +665,7 @@ void gl_TexGenfv( GLcontext *ctx, | |||
gl_lookup_enum_by_nr(pname), | |||
*(int *)params); | |||
switch( coord ) { | |||
switch (coord) { | |||
case GL_S: | |||
if (pname==GL_TEXTURE_GEN_MODE) { | |||
GLenum mode = (GLenum) (GLint) *params; | |||
@@ -796,10 +851,57 @@ void gl_TexGenfv( GLcontext *ctx, | |||
} | |||
void | |||
_mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) | |||
{ | |||
GLfloat p[4]; | |||
p[0] = params[0]; | |||
p[1] = params[1]; | |||
p[2] = params[2]; | |||
p[3] = params[3]; | |||
_mesa_TexGenfv(coord, pname, p); | |||
} | |||
void | |||
_mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) | |||
{ | |||
GLfloat p = (GLfloat) param; | |||
_mesa_TexGenfv( coord, pname, &p ); | |||
} | |||
void | |||
_mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) | |||
{ | |||
GLfloat p[4]; | |||
p[0] = params[0]; | |||
p[1] = params[1]; | |||
p[2] = params[2]; | |||
p[3] = params[3]; | |||
_mesa_TexGenfv( coord, pname, p ); | |||
} | |||
void gl_GetTexGendv( GLcontext *ctx, | |||
GLenum coord, GLenum pname, GLdouble *params ) | |||
void | |||
_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) | |||
{ | |||
_mesa_TexGenfv(coord, pname, ¶m); | |||
} | |||
void | |||
_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) | |||
{ | |||
_mesa_TexGeniv( coord, pname, ¶m ); | |||
} | |||
void | |||
_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint tUnit = ctx->Texture.CurrentTransformUnit; | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit]; | |||
@@ -874,9 +976,10 @@ void gl_GetTexGendv( GLcontext *ctx, | |||
void gl_GetTexGenfv( GLcontext *ctx, | |||
GLenum coord, GLenum pname, GLfloat *params ) | |||
void | |||
_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint tUnit = ctx->Texture.CurrentTransformUnit; | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit]; | |||
@@ -951,9 +1054,10 @@ void gl_GetTexGenfv( GLcontext *ctx, | |||
void gl_GetTexGeniv( GLcontext *ctx, | |||
GLenum coord, GLenum pname, GLint *params ) | |||
void | |||
_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint tUnit = ctx->Texture.CurrentTransformUnit; | |||
struct gl_texture_unit *texUnit = &ctx->Texture.Unit[tUnit]; | |||
@@ -983,7 +1087,7 @@ void gl_GetTexGeniv( GLcontext *ctx, | |||
break; | |||
case GL_T: | |||
if (pname==GL_TEXTURE_GEN_MODE) { | |||
params[0] = (GLint) texUnit->GenModeT; | |||
params[0] = texUnit->GenModeT; | |||
} | |||
else if (pname==GL_OBJECT_PLANE) { | |||
params[0] = (GLint) texUnit->ObjectPlaneT[0]; | |||
@@ -1004,7 +1108,7 @@ void gl_GetTexGeniv( GLcontext *ctx, | |||
break; | |||
case GL_R: | |||
if (pname==GL_TEXTURE_GEN_MODE) { | |||
params[0] = (GLint) texUnit->GenModeR; | |||
params[0] = texUnit->GenModeR; | |||
} | |||
else if (pname==GL_OBJECT_PLANE) { | |||
params[0] = (GLint) texUnit->ObjectPlaneR[0]; | |||
@@ -1025,7 +1129,7 @@ void gl_GetTexGeniv( GLcontext *ctx, | |||
break; | |||
case GL_Q: | |||
if (pname==GL_TEXTURE_GEN_MODE) { | |||
params[0] = (GLint) texUnit->GenModeQ; | |||
params[0] = texUnit->GenModeQ; | |||
} | |||
else if (pname==GL_OBJECT_PLANE) { | |||
params[0] = (GLint) texUnit->ObjectPlaneQ[0]; | |||
@@ -1038,7 +1142,7 @@ void gl_GetTexGeniv( GLcontext *ctx, | |||
params[1] = (GLint) texUnit->EyePlaneQ[1]; | |||
params[2] = (GLint) texUnit->EyePlaneQ[2]; | |||
params[3] = (GLint) texUnit->EyePlaneQ[3]; | |||
} | |||
} | |||
else { | |||
gl_error( ctx, GL_INVALID_ENUM, "glGetTexGeniv(pname)" ); | |||
return; | |||
@@ -1052,8 +1156,10 @@ void gl_GetTexGeniv( GLcontext *ctx, | |||
/* GL_ARB_multitexture */ | |||
void gl_ActiveTexture( GLcontext *ctx, GLenum target ) | |||
void | |||
_mesa_ActiveTextureARB( GLenum target ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint maxUnits = ctx->Const.MaxTextureUnits; | |||
ASSERT_OUTSIDE_BEGIN_END( ctx, "glActiveTextureARB" ); | |||
@@ -1077,8 +1183,10 @@ void gl_ActiveTexture( GLcontext *ctx, GLenum target ) | |||
/* GL_ARB_multitexture */ | |||
void gl_ClientActiveTexture( GLcontext *ctx, GLenum target ) | |||
void | |||
_mesa_ClientActiveTextureARB( GLenum target ) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLint maxUnits = ctx->Const.MaxTextureUnits; | |||
ASSERT_OUTSIDE_BEGIN_END( ctx, "glClientActiveTextureARB" ); |
@@ -1,4 +1,4 @@ | |||
/* $Id: texstate.h,v 1.1 1999/08/19 00:55:41 jtg Exp $ */ | |||
/* $Id: texstate.h,v 1.2 1999/11/11 01:22:28 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -37,46 +37,80 @@ | |||
/*** Called from API ***/ | |||
extern void gl_GetTexEnvfv( GLcontext *ctx, | |||
GLenum target, GLenum pname, GLfloat *params ); | |||
extern void | |||
_mesa_GetTexEnvfv( GLenum target, GLenum pname, GLfloat *params ); | |||
extern void gl_GetTexEnviv( GLcontext *ctx, | |||
GLenum target, GLenum pname, GLint *params ); | |||
extern void | |||
_mesa_GetTexEnviv( GLenum target, GLenum pname, GLint *params ); | |||
extern void gl_GetTexGendv( GLcontext *ctx, | |||
GLenum coord, GLenum pname, GLdouble *params ); | |||
extern void | |||
_mesa_GetTexGendv( GLenum coord, GLenum pname, GLdouble *params ); | |||
extern void gl_GetTexGenfv( GLcontext *ctx, | |||
GLenum coord, GLenum pname, GLfloat *params ); | |||
extern void | |||
_mesa_GetTexGenfv( GLenum coord, GLenum pname, GLfloat *params ); | |||
extern void gl_GetTexGeniv( GLcontext *ctx, | |||
GLenum coord, GLenum pname, GLint *params ); | |||
extern void | |||
_mesa_GetTexGeniv( GLenum coord, GLenum pname, GLint *params ); | |||
extern void gl_GetTexLevelParameterfv( GLcontext *ctx, | |||
GLenum target, GLint level, | |||
GLenum pname, GLfloat *params ); | |||
extern void | |||
_mesa_GetTexLevelParameterfv( GLenum target, GLint level, | |||
GLenum pname, GLfloat *params ); | |||
extern void gl_GetTexLevelParameteriv( GLcontext *ctx, | |||
GLenum target, GLint level, | |||
GLenum pname, GLint *params ); | |||
extern void | |||
_mesa_GetTexLevelParameteriv( GLenum target, GLint level, | |||
GLenum pname, GLint *params ); | |||
extern void gl_GetTexParameterfv( GLcontext *ctx, GLenum target, | |||
GLenum pname, GLfloat *params ); | |||
extern void | |||
_mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ); | |||
extern void gl_GetTexParameteriv( GLcontext *ctx, | |||
GLenum target, GLenum pname, GLint *params ); | |||
extern void | |||
_mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ); | |||
extern void gl_TexEnvfv( GLcontext *ctx, | |||
GLenum target, GLenum pname, const GLfloat *param ); | |||
extern void | |||
_mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ); | |||
extern void | |||
_mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ); | |||
extern void gl_TexParameterfv( GLcontext *ctx, GLenum target, GLenum pname, | |||
const GLfloat *params ); | |||
extern void | |||
_mesa_TexEnvi( GLenum target, GLenum pname, GLint param ); | |||
extern void | |||
_mesa_TexEnviv( GLenum target, GLenum pname, const GLint *param ); | |||
extern void gl_TexGenfv( GLcontext *ctx, | |||
GLenum coord, GLenum pname, const GLfloat *params ); | |||
extern void | |||
_mesa_TexParameterfv( GLenum target, GLenum pname, const GLfloat *params ); | |||
extern void | |||
_mesa_TexParameterf( GLenum target, GLenum pname, GLfloat param ); | |||
extern void | |||
_mesa_TexParameteri( GLenum target, GLenum pname, GLint param ); | |||
extern void | |||
_mesa_TexParameteriv( GLenum target, GLenum pname, const GLint *params ); | |||
extern void | |||
_mesa_TexGend( GLenum coord, GLenum pname, GLdouble param ); | |||
extern void | |||
_mesa_TexGendv( GLenum coord, GLenum pname, const GLdouble *params ); | |||
extern void | |||
_mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ); | |||
extern void | |||
_mesa_TexGenfv( GLenum coord, GLenum pname, const GLfloat *params ); | |||
extern void | |||
_mesa_TexGeni( GLenum coord, GLenum pname, GLint param ); | |||
extern void | |||
_mesa_TexGeniv( GLenum coord, GLenum pname, const GLint *params ); | |||
@@ -86,9 +120,11 @@ extern void gl_SelectTextureTransform( GLcontext *ctx, GLenum target ); | |||
/* | |||
* GL_ARB_multitexture | |||
*/ | |||
extern void gl_ActiveTexture( GLcontext *ctx, GLenum target ); | |||
extern void | |||
_mesa_ActiveTextureARB( GLenum target ); | |||
extern void gl_ClientActiveTexture( GLcontext *ctx, GLenum target ); | |||
extern void | |||
_mesa_ClientActiveTextureARB( GLenum target ); | |||
@@ -1,4 +1,4 @@ | |||
/* $Id: varray.c,v 1.13 1999/11/09 17:26:15 keithw Exp $ */ | |||
/* $Id: varray.c,v 1.14 1999/11/11 01:22:28 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -27,15 +27,8 @@ | |||
#ifdef PC_HEADER | |||
#include "all.h" | |||
#else | |||
#ifndef XFree86Server | |||
#include <stdlib.h> | |||
#include <stdio.h> | |||
#include <string.h> | |||
#else | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#include "glheader.h" | |||
#include "context.h" | |||
#include "api.h" | |||
#include "cva.h" | |||
#include "enable.h" | |||
#include "enums.h" | |||
@@ -54,24 +47,14 @@ | |||
#include "vbindirect.h" | |||
#include "vbxform.h" | |||
#include "xform.h" | |||
#ifdef XFree86Server | |||
#include "GL/xf86glx.h" | |||
#endif | |||
#endif | |||
#if defined(GLX_DIRECT_RENDERING) && !defined(XFree86Server) && !defined(GLX_USE_DLOPEN) | |||
#define NEED_MESA_FUNCS_WRAPPED | |||
#include "mesa_api.h" | |||
#endif | |||
void GLAPIENTRY glVertexPointer(CTX_ARG GLint size, GLenum type, GLsizei stride, | |||
const GLvoid *ptr ) | |||
void | |||
_mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) | |||
{ | |||
GLcontext *ctx; | |||
GET_CONTEXT; | |||
CHECK_CONTEXT; | |||
ctx = CC; | |||
GET_CURRENT_CONTEXT(ctx); | |||
if (size<2 || size>4) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glVertexPointer(size)" ); | |||
@@ -120,13 +103,10 @@ void GLAPIENTRY glVertexPointer(CTX_ARG GLint size, GLenum type, GLsizei stride, | |||
void GLAPIENTRY glNormalPointer(CTX_ARG GLenum type, GLsizei stride, | |||
const GLvoid *ptr ) | |||
void | |||
_mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr ) | |||
{ | |||
GLcontext *ctx; | |||
GET_CONTEXT; | |||
CHECK_CONTEXT; | |||
ctx = CC; | |||
GET_CURRENT_CONTEXT(ctx); | |||
if (stride<0) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glNormalPointer(stride)" ); | |||
@@ -172,13 +152,11 @@ void GLAPIENTRY glNormalPointer(CTX_ARG GLenum type, GLsizei stride, | |||
void GLAPIENTRY glColorPointer(CTX_ARG GLint size, GLenum type, GLsizei stride, | |||
const GLvoid *ptr ) | |||
void | |||
_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) | |||
{ | |||
GLcontext *ctx; | |||
GET_CONTEXT; | |||
CHECK_CONTEXT; | |||
ctx = CC; | |||
GET_CURRENT_CONTEXT(ctx); | |||
if (size<3 || size>4) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glColorPointer(size)" ); | |||
return; | |||
@@ -237,13 +215,10 @@ void GLAPIENTRY glColorPointer(CTX_ARG GLint size, GLenum type, GLsizei stride, | |||
void GLAPIENTRY glIndexPointer(CTX_ARG GLenum type, GLsizei stride, | |||
const GLvoid *ptr ) | |||
void | |||
_mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr) | |||
{ | |||
GLcontext *ctx; | |||
GET_CONTEXT; | |||
CHECK_CONTEXT; | |||
ctx = CC; | |||
GET_CURRENT_CONTEXT(ctx); | |||
if (stride<0) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glIndexPointer(stride)" ); | |||
@@ -284,16 +259,12 @@ void GLAPIENTRY glIndexPointer(CTX_ARG GLenum type, GLsizei stride, | |||
void GLAPIENTRY glTexCoordPointer(CTX_ARG GLint size, GLenum type, | |||
GLsizei stride, const GLvoid *ptr ) | |||
void | |||
_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLuint texUnit; | |||
GLcontext *ctx; | |||
GET_CONTEXT; | |||
CHECK_CONTEXT; | |||
ctx = CC; | |||
texUnit = ctx->Array.ActiveTexture; | |||
if (size<1 || size>4) { | |||
@@ -346,14 +317,11 @@ void GLAPIENTRY glTexCoordPointer(CTX_ARG GLint size, GLenum type, | |||
void GLAPIENTRY glEdgeFlagPointer(CTX_ARG GLsizei stride, const void *vptr ) | |||
void | |||
_mesa_EdgeFlagPointer(GLsizei stride, const void *vptr) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
const GLboolean *ptr = (GLboolean *)vptr; | |||
GLcontext *ctx; | |||
GET_CONTEXT; | |||
CHECK_CONTEXT; | |||
ctx = CC; | |||
if (stride<0) { | |||
gl_error( ctx, GL_INVALID_VALUE, "glEdgeFlagPointer(stride)" ); | |||
@@ -470,8 +438,42 @@ void gl_exec_array_elements( GLcontext *ctx, struct immediate *IM, | |||
void gl_DrawArrays( GLcontext *ctx, GLenum mode, GLint start, GLsizei count ) | |||
/* Enough funny business going on in here it might be quicker to use a | |||
* function pointer. | |||
*/ | |||
#define ARRAY_ELT( IM, i ) \ | |||
{ \ | |||
GLuint count = IM->Count; \ | |||
IM->Elt[count] = i; \ | |||
IM->Flag[count] = ((IM->Flag[count] & IM->ArrayAndFlags) | \ | |||
VERT_ELT); \ | |||
IM->FlushElt |= IM->ArrayEltFlush; \ | |||
IM->Count = count += IM->ArrayIncr; \ | |||
if (count == VB_MAX) \ | |||
IM->maybe_transform_vb( IM ); \ | |||
} | |||
void | |||
_mesa_ArrayElement( GLint i ) | |||
{ | |||
GET_IMMEDIATE; | |||
ARRAY_ELT( IM, i ); | |||
} | |||
void gl_ArrayElement( GLcontext *CC, GLint i ) | |||
{ | |||
struct immediate *im = CC->input; | |||
ARRAY_ELT( im, i ); | |||
} | |||
void | |||
_mesa_DrawArrays(GLenum mode, GLint start, GLsizei count) | |||
{ | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct vertex_buffer *VB = ctx->VB; | |||
GLint i; | |||
@@ -781,16 +783,13 @@ static GLuint natural_stride[0x10] = | |||
0 /* f */ | |||
}; | |||
void GLAPIENTRY glDrawElements(CTX_ARG GLenum mode, GLsizei count, | |||
GLenum type, const GLvoid *indices ) | |||
void | |||
_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices) | |||
{ | |||
GLcontext *ctx; | |||
GET_CURRENT_CONTEXT(ctx); | |||
struct gl_cva *cva; | |||
GET_CONTEXT; | |||
CHECK_CONTEXT; | |||
ctx = CC; | |||
cva = &ctx->CVA; | |||
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glDrawElements"); | |||
@@ -900,10 +899,10 @@ void GLAPIENTRY glDrawElements(CTX_ARG GLenum mode, GLsizei count, | |||
void GLAPIENTRY glInterleavedArrays(CTX_ARG GLenum format, GLsizei stride, | |||
const GLvoid *pointer ) | |||
void | |||
_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer) | |||
{ | |||
GLcontext *ctx; | |||
GET_CURRENT_CONTEXT(ctx); | |||
GLboolean tflag, cflag, nflag; /* enable/disable flags */ | |||
GLint tcomps, ccomps, vcomps; /* components per texcoord, color, vertex */ | |||
@@ -913,11 +912,6 @@ void GLAPIENTRY glInterleavedArrays(CTX_ARG GLenum format, GLsizei stride, | |||
GLint c, f; | |||
GLint coordUnitSave; | |||
GET_CONTEXT; | |||
CHECK_CONTEXT; | |||
ctx = CC; | |||
f = sizeof(GLfloat); | |||
c = f * ((4*sizeof(GLubyte) + (f-1)) / f); | |||
@@ -1041,8 +1035,8 @@ void GLAPIENTRY glInterleavedArrays(CTX_ARG GLenum format, GLsizei stride, | |||
stride = defstride; | |||
} | |||
gl_DisableClientState( ctx, GL_EDGE_FLAG_ARRAY ); | |||
gl_DisableClientState( ctx, GL_INDEX_ARRAY ); | |||
_mesa_DisableClientState( GL_EDGE_FLAG_ARRAY ); | |||
_mesa_DisableClientState( GL_INDEX_ARRAY ); | |||
/* Texcoords */ | |||
coordUnitSave = ctx->Array.ActiveTexture; | |||
@@ -1050,63 +1044,61 @@ void GLAPIENTRY glInterleavedArrays(CTX_ARG GLenum format, GLsizei stride, | |||
GLint i; | |||
GLint factor = ctx->Array.TexCoordInterleaveFactor; | |||
for (i = 0; i < factor; i++) { | |||
gl_ClientActiveTexture( ctx, (GLenum) (GL_TEXTURE0_ARB + i) ); | |||
gl_EnableClientState( ctx, GL_TEXTURE_COORD_ARRAY ); | |||
glTexCoordPointer(CTX_PRM tcomps, GL_FLOAT, stride, | |||
_mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + i) ); | |||
_mesa_EnableClientState( GL_TEXTURE_COORD_ARRAY ); | |||
glTexCoordPointer( tcomps, GL_FLOAT, stride, | |||
(GLubyte *) pointer + i * coffset ); | |||
} | |||
for (i = factor; i < ctx->Const.MaxTextureUnits; i++) { | |||
gl_ClientActiveTexture( ctx, (GLenum) (GL_TEXTURE0_ARB + i) ); | |||
gl_DisableClientState( ctx, GL_TEXTURE_COORD_ARRAY ); | |||
_mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + i) ); | |||
_mesa_DisableClientState( GL_TEXTURE_COORD_ARRAY ); | |||
} | |||
} | |||
else { | |||
GLint i; | |||
for (i = 0; i < ctx->Const.MaxTextureUnits; i++) { | |||
gl_ClientActiveTexture( ctx, (GLenum) (GL_TEXTURE0_ARB + i) ); | |||
gl_DisableClientState( ctx, GL_TEXTURE_COORD_ARRAY ); | |||
_mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + i) ); | |||
_mesa_DisableClientState( GL_TEXTURE_COORD_ARRAY ); | |||
} | |||
} | |||
/* Restore texture coordinate unit index */ | |||
gl_ClientActiveTexture( ctx, (GLenum) (GL_TEXTURE0_ARB + coordUnitSave) ); | |||
_mesa_ClientActiveTextureARB( (GLenum) (GL_TEXTURE0_ARB + coordUnitSave) ); | |||
/* Color */ | |||
if (cflag) { | |||
gl_EnableClientState( ctx, GL_COLOR_ARRAY ); | |||
glColorPointer(CTX_PRM ccomps, ctype, stride, | |||
_mesa_EnableClientState( GL_COLOR_ARRAY ); | |||
glColorPointer( ccomps, ctype, stride, | |||
(GLubyte*) pointer + coffset ); | |||
} | |||
else { | |||
gl_DisableClientState( ctx, GL_COLOR_ARRAY ); | |||
_mesa_DisableClientState( GL_COLOR_ARRAY ); | |||
} | |||
/* Normals */ | |||
if (nflag) { | |||
gl_EnableClientState( ctx, GL_NORMAL_ARRAY ); | |||
glNormalPointer(CTX_PRM GL_FLOAT, stride, | |||
_mesa_EnableClientState( GL_NORMAL_ARRAY ); | |||
glNormalPointer( GL_FLOAT, stride, | |||
(GLubyte*) pointer + noffset ); | |||
} | |||
else { | |||
gl_DisableClientState( ctx, GL_NORMAL_ARRAY ); | |||
_mesa_DisableClientState( GL_NORMAL_ARRAY ); | |||
} | |||
gl_EnableClientState( ctx, GL_VERTEX_ARRAY ); | |||
glVertexPointer(CTX_PRM vcomps, GL_FLOAT, stride, | |||
_mesa_EnableClientState( GL_VERTEX_ARRAY ); | |||
glVertexPointer( vcomps, GL_FLOAT, stride, | |||
(GLubyte *) pointer + voffset ); | |||
} | |||
void GLAPIENTRY glDrawRangeElements(CTX_ARG GLenum mode, GLuint start, | |||
GLuint end, GLsizei count, | |||
GLenum type, const GLvoid *indices ) | |||
void | |||
_mesa_DrawRangeElements(GLenum mode, GLuint start, | |||
GLuint end, GLsizei count, | |||
GLenum type, const GLvoid *indices) | |||
{ | |||
GLcontext *ctx; | |||
GET_CONTEXT; | |||
CHECK_CONTEXT; | |||
ctx = CC; | |||
GET_CURRENT_CONTEXT(ctx); | |||
if (end < start) { | |||
gl_error(ctx, GL_INVALID_VALUE, "glDrawRangeElements( end < start )"); | |||
@@ -1114,11 +1106,11 @@ void GLAPIENTRY glDrawRangeElements(CTX_ARG GLenum mode, GLuint start, | |||
} | |||
if (!ctx->Array.LockCount && 2*count > (GLint) 3*(end-start)) { | |||
glLockArraysEXT(CTX_PRM start, end ); | |||
glDrawElements(CTX_PRM mode, count, type, indices ); | |||
glUnlockArraysEXT(CTX_VPRM ); | |||
glLockArraysEXT( start, end ); | |||
glDrawElements( mode, count, type, indices ); | |||
glUnlockArraysEXT(); | |||
} else { | |||
glDrawElements(CTX_PRM mode, count, type, indices ); | |||
glDrawElements( mode, count, type, indices ); | |||
} | |||
} | |||
@@ -1,4 +1,4 @@ | |||
/* $Id: varray.h,v 1.4 1999/10/19 18:37:05 keithw Exp $ */ | |||
/* $Id: varray.h,v 1.5 1999/11/11 01:22:28 brianp Exp $ */ | |||
/* | |||
* Mesa 3-D graphics library | |||
@@ -32,70 +32,67 @@ | |||
#include "types.h" | |||
extern void gl_VertexPointer( GLcontext *ctx, | |||
GLint size, GLenum type, GLsizei stride, | |||
const GLvoid *ptr ); | |||
extern void | |||
_mesa_VertexPointer(GLint size, GLenum type, GLsizei stride, | |||
const GLvoid *ptr); | |||
extern void gl_NormalPointer( GLcontext *ctx, | |||
GLenum type, GLsizei stride, const GLvoid *ptr ); | |||
extern void | |||
_mesa_NormalPointer(GLenum type, GLsizei stride, const GLvoid *ptr); | |||
extern void gl_ColorPointer( GLcontext *ctx, | |||
GLint size, GLenum type, GLsizei stride, | |||
const GLvoid *ptr ); | |||
extern void | |||
_mesa_ColorPointer(GLint size, GLenum type, GLsizei stride, const GLvoid *ptr); | |||
extern void gl_IndexPointer( GLcontext *ctx, | |||
GLenum type, GLsizei stride, | |||
const GLvoid *ptr ); | |||
extern void | |||
_mesa_IndexPointer(GLenum type, GLsizei stride, const GLvoid *ptr); | |||
extern void gl_TexCoordPointer( GLcontext *ctx, | |||
GLint size, GLenum type, GLsizei stride, | |||
const GLvoid *ptr ); | |||
extern void | |||
_mesa_TexCoordPointer(GLint size, GLenum type, GLsizei stride, | |||
const GLvoid *ptr); | |||
extern void gl_EdgeFlagPointer( GLcontext *ctx, | |||
GLsizei stride, const GLboolean *ptr ); | |||
extern void | |||
_mesa_EdgeFlagPointer(GLsizei stride, const GLvoid *ptr); | |||
extern void gl_GetPointerv( GLcontext *ctx, GLenum pname, GLvoid **params ); | |||
extern void | |||
_mesa_DrawArrays(GLenum mode, GLint first, GLsizei count); | |||
extern void | |||
_mesa_save_DrawArrays(GLenum mode, GLint first, GLsizei count); | |||
extern void gl_DrawArrays( GLcontext *ctx, | |||
GLenum mode, GLint first, GLsizei count ); | |||
extern void gl_save_DrawArrays( GLcontext *ctx, | |||
GLenum mode, GLint first, GLsizei count ); | |||
extern void | |||
_mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, | |||
const GLvoid *indices); | |||
extern void gl_DrawElements( GLcontext *ctx, | |||
GLenum mode, GLsizei count, | |||
GLenum type, const GLvoid *indices ); | |||
extern void gl_save_DrawElements( GLcontext *ctx, | |||
GLenum mode, GLsizei count, | |||
GLenum type, const GLvoid *indices ); | |||
extern void | |||
_mesa_save_DrawElements(GLenum mode, GLsizei count, | |||
GLenum type, const GLvoid *indices); | |||
extern void gl_InterleavedArrays( GLcontext *ctx, | |||
GLenum format, GLsizei stride, | |||
const GLvoid *pointer ); | |||
extern void | |||
_mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer); | |||
extern void gl_save_InterleavedArrays( GLcontext *ctx, | |||
GLenum format, GLsizei stride, | |||
const GLvoid *pointer ); | |||
extern void | |||
_mesa_save_InterleavedArrays(GLenum format, GLsizei stride, | |||
const GLvoid *pointer); | |||
extern void gl_DrawRangeElements( GLcontext *ctx, GLenum mode, GLuint start, | |||
GLuint end, GLsizei count, GLenum type, | |||
const GLvoid *indices ); | |||
extern void | |||
_mesa_DrawRangeElements(GLenum mode, GLuint start, | |||
GLuint end, GLsizei count, GLenum type, | |||
const GLvoid *indices); | |||
extern void gl_save_DrawRangeElements( GLcontext *ctx, GLenum mode, | |||
GLuint start, GLuint end, GLsizei count, | |||
GLenum type, const GLvoid *indices ); | |||
extern void | |||
_mesa_save_DrawRangeElements(GLenum mode, | |||
GLuint start, GLuint end, GLsizei count, | |||
GLenum type, const GLvoid *indices ); | |||
extern void gl_exec_array_elements( GLcontext *ctx, | |||
@@ -105,4 +102,5 @@ extern void gl_exec_array_elements( GLcontext *ctx, | |||
extern void gl_update_client_state( GLcontext *ctx ); | |||
#endif |