⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 dlist.c

📁 mesa-6.5-minigui源码
💻 C
📖 第 1 页 / 共 5 页
字号:
save_LightModelf(GLenum pname, GLfloat param){   save_LightModelfv(pname, &param);}static void GLAPIENTRYsave_LightModeliv(GLenum pname, const GLint *params){   GLfloat fparam[4];   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 */      ;   }   save_LightModelfv(pname, fparam);}static void GLAPIENTRYsave_LightModeli(GLenum pname, GLint param){   save_LightModeliv(pname, &param);}static void GLAPIENTRYsave_LineStipple(GLint factor, GLushort pattern){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_LINE_STIPPLE, 2);   if (n) {      n[1].i = factor;      n[2].us = pattern;   }   if (ctx->ExecuteFlag) {      CALL_LineStipple(ctx->Exec, (factor, pattern));   }}static void GLAPIENTRYsave_LineWidth(GLfloat width){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_LINE_WIDTH, 1);   if (n) {      n[1].f = width;   }   if (ctx->ExecuteFlag) {      CALL_LineWidth(ctx->Exec, (width));   }}static void GLAPIENTRYsave_ListBase(GLuint base){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_LIST_BASE, 1);   if (n) {      n[1].ui = base;   }   if (ctx->ExecuteFlag) {      CALL_ListBase(ctx->Exec, (base));   }}static void GLAPIENTRYsave_LoadIdentity(void){   GET_CURRENT_CONTEXT(ctx);   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   (void) ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_IDENTITY, 0);   if (ctx->ExecuteFlag) {      CALL_LoadIdentity(ctx->Exec, ());   }}static void GLAPIENTRYsave_LoadMatrixf(const GLfloat * m){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_MATRIX, 16);   if (n) {      GLuint i;      for (i = 0; i < 16; i++) {         n[1 + i].f = m[i];      }   }   if (ctx->ExecuteFlag) {      CALL_LoadMatrixf(ctx->Exec, (m));   }}static void GLAPIENTRYsave_LoadMatrixd(const GLdouble * m){   GLfloat f[16];   GLint i;   for (i = 0; i < 16; i++) {      f[i] = (GLfloat) m[i];   }   save_LoadMatrixf(f);}static void GLAPIENTRYsave_LoadName(GLuint name){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_LOAD_NAME, 1);   if (n) {      n[1].ui = name;   }   if (ctx->ExecuteFlag) {      CALL_LoadName(ctx->Exec, (name));   }}static void GLAPIENTRYsave_LogicOp(GLenum opcode){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_LOGIC_OP, 1);   if (n) {      n[1].e = opcode;   }   if (ctx->ExecuteFlag) {      CALL_LogicOp(ctx->Exec, (opcode));   }}static void GLAPIENTRYsave_Map1d(GLenum target, GLdouble u1, GLdouble u2, GLint stride,           GLint order, const GLdouble * points){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6);   if (n) {      GLfloat *pnts = _mesa_copy_map_points1d(target, stride, order, points);      n[1].e = target;      n[2].f = (GLfloat) u1;      n[3].f = (GLfloat) u2;      n[4].i = _mesa_evaluator_components(target);      /* stride */      n[5].i = order;      n[6].data = (void *) pnts;   }   if (ctx->ExecuteFlag) {      CALL_Map1d(ctx->Exec, (target, u1, u2, stride, order, points));   }}static void GLAPIENTRYsave_Map1f(GLenum target, GLfloat u1, GLfloat u2, GLint stride,           GLint order, const GLfloat * points){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP1, 6);   if (n) {      GLfloat *pnts = _mesa_copy_map_points1f(target, stride, order, points);      n[1].e = target;      n[2].f = u1;      n[3].f = u2;      n[4].i = _mesa_evaluator_components(target);      /* stride */      n[5].i = order;      n[6].data = (void *) pnts;   }   if (ctx->ExecuteFlag) {      CALL_Map1f(ctx->Exec, (target, u1, u2, stride, order, points));   }}static void GLAPIENTRYsave_Map2d(GLenum target,           GLdouble u1, GLdouble u2, GLint ustride, GLint uorder,           GLdouble v1, GLdouble v2, GLint vstride, GLint vorder,           const GLdouble * points){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10);   if (n) {      GLfloat *pnts = _mesa_copy_map_points2d(target, ustride, uorder,                                              vstride, vorder, points);      n[1].e = target;      n[2].f = (GLfloat) u1;      n[3].f = (GLfloat) u2;      n[4].f = (GLfloat) v1;      n[5].f = (GLfloat) v2;      /* XXX verify these strides are correct */      n[6].i = _mesa_evaluator_components(target) * vorder;     /*ustride */      n[7].i = _mesa_evaluator_components(target);      /*vstride */      n[8].i = uorder;      n[9].i = vorder;      n[10].data = (void *) pnts;   }   if (ctx->ExecuteFlag) {      CALL_Map2d(ctx->Exec, (target,                             u1, u2, ustride, uorder,                             v1, v2, vstride, vorder, points));   }}static void GLAPIENTRYsave_Map2f(GLenum target,           GLfloat u1, GLfloat u2, GLint ustride, GLint uorder,           GLfloat v1, GLfloat v2, GLint vstride, GLint vorder,           const GLfloat * points){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_MAP2, 10);   if (n) {      GLfloat *pnts = _mesa_copy_map_points2f(target, ustride, uorder,                                              vstride, vorder, points);      n[1].e = target;      n[2].f = u1;      n[3].f = u2;      n[4].f = v1;      n[5].f = v2;      /* XXX verify these strides are correct */      n[6].i = _mesa_evaluator_components(target) * vorder;     /*ustride */      n[7].i = _mesa_evaluator_components(target);      /*vstride */      n[8].i = uorder;      n[9].i = vorder;      n[10].data = (void *) pnts;   }   if (ctx->ExecuteFlag) {      CALL_Map2f(ctx->Exec, (target, u1, u2, ustride, uorder,                             v1, v2, vstride, vorder, points));   }}static void GLAPIENTRYsave_MapGrid1f(GLint un, GLfloat u1, GLfloat u2){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_MAPGRID1, 3);   if (n) {      n[1].i = un;      n[2].f = u1;      n[3].f = u2;   }   if (ctx->ExecuteFlag) {      CALL_MapGrid1f(ctx->Exec, (un, u1, u2));   }}static void GLAPIENTRYsave_MapGrid1d(GLint un, GLdouble u1, GLdouble u2){   save_MapGrid1f(un, (GLfloat) u1, (GLfloat) u2);}static void GLAPIENTRYsave_MapGrid2f(GLint un, GLfloat u1, GLfloat u2,               GLint vn, GLfloat v1, GLfloat v2){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_MAPGRID2, 6);   if (n) {      n[1].i = un;      n[2].f = u1;      n[3].f = u2;      n[4].i = vn;      n[5].f = v1;      n[6].f = v2;   }   if (ctx->ExecuteFlag) {      CALL_MapGrid2f(ctx->Exec, (un, u1, u2, vn, v1, v2));   }}static void GLAPIENTRYsave_MapGrid2d(GLint un, GLdouble u1, GLdouble u2,               GLint vn, GLdouble v1, GLdouble v2){   save_MapGrid2f(un, (GLfloat) u1, (GLfloat) u2,                  vn, (GLfloat) v1, (GLfloat) v2);}static void GLAPIENTRYsave_MatrixMode(GLenum mode){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_MATRIX_MODE, 1);   if (n) {      n[1].e = mode;   }   if (ctx->ExecuteFlag) {      CALL_MatrixMode(ctx->Exec, (mode));   }}static void GLAPIENTRYsave_Minmax(GLenum target, GLenum internalFormat, GLboolean sink){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_MIN_MAX, 3);   if (n) {      n[1].e = target;      n[2].e = internalFormat;      n[3].b = sink;   }   if (ctx->ExecuteFlag) {      CALL_Minmax(ctx->Exec, (target, internalFormat, sink));   }}static void GLAPIENTRYsave_MultMatrixf(const GLfloat * m){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_MULT_MATRIX, 16);   if (n) {      GLuint i;      for (i = 0; i < 16; i++) {         n[1 + i].f = m[i];      }   }   if (ctx->ExecuteFlag) {      CALL_MultMatrixf(ctx->Exec, (m));   }}static void GLAPIENTRYsave_MultMatrixd(const GLdouble * m){   GLfloat f[16];   GLint i;   for (i = 0; i < 16; i++) {      f[i] = (GLfloat) m[i];   }   save_MultMatrixf(f);}static void GLAPIENTRYsave_NewList(GLuint list, GLenum mode){   GET_CURRENT_CONTEXT(ctx);   /* It's an error to call this function while building a display list */   _mesa_error(ctx, GL_INVALID_OPERATION, "glNewList");   (void) list;   (void) mode;}static void GLAPIENTRYsave_Ortho(GLdouble left, GLdouble right,           GLdouble bottom, GLdouble top, GLdouble nearval, GLdouble farval){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_ORTHO, 6);   if (n) {      n[1].f = (GLfloat) left;      n[2].f = (GLfloat) right;      n[3].f = (GLfloat) bottom;      n[4].f = (GLfloat) top;      n[5].f = (GLfloat) nearval;      n[6].f = (GLfloat) farval;   }   if (ctx->ExecuteFlag) {      CALL_Ortho(ctx->Exec, (left, right, bottom, top, nearval, farval));   }}static void GLAPIENTRYsave_PixelMapfv(GLenum map, GLint mapsize, const GLfloat *values){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_MAP, 3);   if (n) {      n[1].e = map;      n[2].i = mapsize;      n[3].data = (void *) _mesa_malloc(mapsize * sizeof(GLfloat));      MEMCPY(n[3].data, (void *) values, mapsize * sizeof(GLfloat));   }   if (ctx->ExecuteFlag) {      CALL_PixelMapfv(ctx->Exec, (map, mapsize, values));   }}static void GLAPIENTRYsave_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]);      }   }   save_PixelMapfv(map, mapsize, fvalues);}static void GLAPIENTRYsave_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]);      }   }   save_PixelMapfv(map, mapsize, fvalues);}static void GLAPIENTRYsave_PixelTransferf(GLenum pname, GLfloat param){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_TRANSFER, 2);   if (n) {      n[1].e = pname;      n[2].f = param;   }   if (ctx->ExecuteFlag) {      CALL_PixelTransferf(ctx->Exec, (pname, param));   }}static void GLAPIENTRYsave_PixelTransferi(GLenum pname, GLint param){   save_PixelTransferf(pname, (GLfloat) param);}static void GLAPIENTRYsave_PixelZoom(GLfloat xfactor, GLfloat yfactor){   GET_CURRENT_CONTEXT(ctx);   Node *n;   ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx);   n = ALLOC_INSTRUCTION(ctx, OPCODE_PIXEL_ZOOM, 2);   if (n) {      n[1].f = xfactor;      n[2].f = yfactor;   }   if (ctx->ExecuteFlag) 

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -