ReactOS  r76032
get.h File Reference
#include "glheader.h"
Include dependency graph for get.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void GLAPIENTRY _mesa_GetBooleanv (GLenum pname, GLboolean *params)
 
void GLAPIENTRY _mesa_GetDoublev (GLenum pname, GLdouble *params)
 
void GLAPIENTRY _mesa_GetFloatv (GLenum pname, GLfloat *params)
 
void GLAPIENTRY _mesa_GetIntegerv (GLenum pname, GLint *params)
 
void GLAPIENTRY _mesa_GetInteger64v (GLenum pname, GLint64 *params)
 
void GLAPIENTRY _mesa_GetFixedv (GLenum pname, GLfixed *params)
 
void GLAPIENTRY _mesa_GetInteger64Indexedv (GLenum pname, GLuint index, GLint64 *params)
 
void GLAPIENTRY _mesa_GetPointerv (GLenum pname, GLvoid **params)
 
const GLubyte *GLAPIENTRY _mesa_GetString (GLenum name)
 
GLenum GLAPIENTRY _mesa_GetError (void)
 

Detailed Description

State query functions.

Definition in file get.h.

Function Documentation

void GLAPIENTRY _mesa_GetBooleanv ( GLenum  pname,
GLboolean params 
)

Definition at line 1191 of file get.c.

1192 {
1193  const struct value_desc *d;
1194  union value v;
1195  GLmatrix *m;
1196  int shift, i;
1197  void *p;
1198  GET_CURRENT_CONTEXT(ctx);
1199 
1201 
1202  d = find_value("glGetBooleanv", pname, &p, &v);
1203  switch (d->type) {
1204  case TYPE_INVALID:
1205  break;
1206  case TYPE_CONST:
1207  params[0] = INT_TO_BOOLEAN(d->offset);
1208  break;
1209 
1210  case TYPE_FLOAT_4:
1211  case TYPE_FLOATN_4:
1212  params[3] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[3]);
1213  case TYPE_FLOAT_3:
1214  case TYPE_FLOATN_3:
1215  params[2] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[2]);
1216  case TYPE_FLOAT_2:
1217  case TYPE_FLOATN_2:
1218  params[1] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[1]);
1219  case TYPE_FLOAT:
1220  case TYPE_FLOATN:
1221  params[0] = FLOAT_TO_BOOLEAN(((GLfloat *) p)[0]);
1222  break;
1223 
1224  case TYPE_DOUBLEN:
1225  params[0] = FLOAT_TO_BOOLEAN(((GLdouble *) p)[0]);
1226  break;
1227 
1228  case TYPE_INT_4:
1229  params[3] = INT_TO_BOOLEAN(((GLint *) p)[3]);
1230  case TYPE_INT_3:
1231  params[2] = INT_TO_BOOLEAN(((GLint *) p)[2]);
1232  case TYPE_INT_2:
1233  case TYPE_ENUM_2:
1234  params[1] = INT_TO_BOOLEAN(((GLint *) p)[1]);
1235  case TYPE_INT:
1236  case TYPE_ENUM:
1237  params[0] = INT_TO_BOOLEAN(((GLint *) p)[0]);
1238  break;
1239 
1240  case TYPE_INT_N:
1241  for (i = 0; i < v.value_int_n.n; i++)
1242  params[i] = INT_TO_BOOLEAN(v.value_int_n.ints[i]);
1243  break;
1244 
1245  case TYPE_INT64:
1246  params[0] = INT64_TO_BOOLEAN(((GLint64 *) p)[0]);
1247  break;
1248 
1249  case TYPE_BOOLEAN:
1250  params[0] = ((GLboolean*) p)[0];
1251  break;
1252 
1253  case TYPE_MATRIX:
1254  m = *(GLmatrix **) p;
1255  for (i = 0; i < 16; i++)
1256  params[i] = FLOAT_TO_BOOLEAN(m->m[i]);
1257  break;
1258 
1259  case TYPE_MATRIX_T:
1260  m = *(GLmatrix **) p;
1261  for (i = 0; i < 16; i++)
1262  params[i] = FLOAT_TO_BOOLEAN(m->m[transpose[i]]);
1263  break;
1264 
1265  case TYPE_BIT_0:
1266  case TYPE_BIT_1:
1267  case TYPE_BIT_2:
1268  case TYPE_BIT_3:
1269  case TYPE_BIT_4:
1270  case TYPE_BIT_5:
1271  case TYPE_BIT_6:
1272  case TYPE_BIT_7:
1273  shift = d->type - TYPE_BIT_0;
1274  params[0] = (*(GLbitfield *) p >> shift) & 1;
1275  break;
1276  }
1277 }
Definition: get.c:83
Definition: get.c:139
Definition: get.c:93
#define shift
Definition: input.c:1594
double GLdouble
Definition: gl.h:163
Definition: get.c:94
int offset
Definition: get.c:135
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:68
GLsizei GLboolean transpose
Definition: glext.h:6077
Definition: get.c:80
#define ASSERT_OUTSIDE_BEGIN_END(ctx)
Definition: context.h:253
GLenum GLclampf GLint i
Definition: glfuncs.h:14
GLenum const GLfloat * params
Definition: glext.h:5645
#define INT64_TO_BOOLEAN(I)
Definition: get.c:65
unsigned char GLboolean
Definition: gl.h:151
Definition: get.c:79
Definition: get.c:90
float GLfloat
Definition: gl.h:161
Definition: get.c:92
#define d
Definition: ke_i.h:81
Definition: get.c:95
Definition: get.c:88
#define FLOAT_TO_BOOLEAN(X)
Definition: get.c:55
static const struct value_desc * find_value(const char *func, GLenum pname, void **p, union value *v)
Definition: get.c:1125
Definition: get.c:84
int64_t GLint64
Definition: glext.h:5567
Definition: get.c:82
#define INT_TO_BOOLEAN(I)
Definition: get.c:60
Definition: get.c:89
const GLdouble * v
Definition: gl.h:2040
Definition: get.c:78
unsigned int GLbitfield
Definition: gl.h:152
Definition: get.c:81
CONST GLfloat m[16]
Definition: m_xform.h:144
GLubyte type
Definition: get.c:134
Definition: get.c:91
GLfloat GLfloat p
Definition: glext.h:8902
Definition: get.c:87
const GLint const GLsizei GLint
Definition: dispatch.h:5271
void GLAPIENTRY _mesa_GetDoublev ( GLenum  pname,
GLdouble params 
)

Definition at line 1465 of file get.c.

1466 {
1467  const struct value_desc *d;
1468  union value v;
1469  GLmatrix *m;
1470  int shift, i;
1471  void *p;
1472  GET_CURRENT_CONTEXT(ctx);
1473 
1475 
1476  d = find_value("glGetDoublev", pname, &p, &v);
1477  switch (d->type) {
1478  case TYPE_INVALID:
1479  break;
1480  case TYPE_CONST:
1481  params[0] = d->offset;
1482  break;
1483 
1484  case TYPE_FLOAT_4:
1485  case TYPE_FLOATN_4:
1486  params[3] = ((GLfloat *) p)[3];
1487  case TYPE_FLOAT_3:
1488  case TYPE_FLOATN_3:
1489  params[2] = ((GLfloat *) p)[2];
1490  case TYPE_FLOAT_2:
1491  case TYPE_FLOATN_2:
1492  params[1] = ((GLfloat *) p)[1];
1493  case TYPE_FLOAT:
1494  case TYPE_FLOATN:
1495  params[0] = ((GLfloat *) p)[0];
1496  break;
1497 
1498  case TYPE_DOUBLEN:
1499  params[0] = ((GLdouble *) p)[0];
1500  break;
1501 
1502  case TYPE_INT_4:
1503  params[3] = ((GLint *) p)[3];
1504  case TYPE_INT_3:
1505  params[2] = ((GLint *) p)[2];
1506  case TYPE_INT_2:
1507  case TYPE_ENUM_2:
1508  params[1] = ((GLint *) p)[1];
1509  case TYPE_INT:
1510  case TYPE_ENUM:
1511  params[0] = ((GLint *) p)[0];
1512  break;
1513 
1514  case TYPE_INT_N:
1515  for (i = 0; i < v.value_int_n.n; i++)
1516  params[i] = v.value_int_n.ints[i];
1517  break;
1518 
1519  case TYPE_INT64:
1520  params[0] = ((GLint64 *) p)[0];
1521  break;
1522 
1523  case TYPE_BOOLEAN:
1524  params[0] = *(GLboolean*) p;
1525  break;
1526 
1527  case TYPE_MATRIX:
1528  m = *(GLmatrix **) p;
1529  for (i = 0; i < 16; i++)
1530  params[i] = m->m[i];
1531  break;
1532 
1533  case TYPE_MATRIX_T:
1534  m = *(GLmatrix **) p;
1535  for (i = 0; i < 16; i++)
1536  params[i] = m->m[transpose[i]];
1537  break;
1538 
1539  case TYPE_BIT_0:
1540  case TYPE_BIT_1:
1541  case TYPE_BIT_2:
1542  case TYPE_BIT_3:
1543  case TYPE_BIT_4:
1544  case TYPE_BIT_5:
1545  case TYPE_BIT_6:
1546  case TYPE_BIT_7:
1547  shift = d->type - TYPE_BIT_0;
1548  params[0] = (*(GLbitfield *) p >> shift) & 1;
1549  break;
1550  }
1551 }
Definition: get.c:83
Definition: get.c:139
Definition: get.c:93
#define shift
Definition: input.c:1594
double GLdouble
Definition: gl.h:163
Definition: get.c:94
int offset
Definition: get.c:135
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:68
GLsizei GLboolean transpose
Definition: glext.h:6077
Definition: get.c:80
#define ASSERT_OUTSIDE_BEGIN_END(ctx)
Definition: context.h:253
GLenum GLclampf GLint i
Definition: glfuncs.h:14
GLenum const GLfloat * params
Definition: glext.h:5645
unsigned char GLboolean
Definition: gl.h:151
Definition: get.c:79
Definition: get.c:90
float GLfloat
Definition: gl.h:161
Definition: get.c:92
#define d
Definition: ke_i.h:81
Definition: get.c:95
Definition: get.c:88
static const struct value_desc * find_value(const char *func, GLenum pname, void **p, union value *v)
Definition: get.c:1125
Definition: get.c:84
int64_t GLint64
Definition: glext.h:5567
Definition: get.c:82
Definition: get.c:89
const GLdouble * v
Definition: gl.h:2040
Definition: get.c:78
unsigned int GLbitfield
Definition: gl.h:152
Definition: get.c:81
CONST GLfloat m[16]
Definition: m_xform.h:144
GLubyte type
Definition: get.c:134
Definition: get.c:91
GLfloat GLfloat p
Definition: glext.h:8902
Definition: get.c:87
const GLint const GLsizei GLint
Definition: dispatch.h:5271
GLenum GLAPIENTRY _mesa_GetError ( void  )

Returns the current GL error code, or GL_NO_ERROR.

Returns
current error code

Returns __struct gl_contextRec::ErrorValue.

Definition at line 141 of file getstring.c.

142 {
143  GET_CURRENT_CONTEXT(ctx);
144  GLenum e = ctx->ErrorValue;
146 
148  _mesa_debug(ctx, "glGetError <-- %s\n", _mesa_lookup_enum_by_nr(e));
149 
150  ctx->ErrorValue = (GLenum) GL_NO_ERROR;
151  ctx->ErrorDebugCount = 0;
152  return e;
153 }
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:68
#define GL_NO_ERROR
Definition: gl.h:693
void _mesa_debug(const struct gl_context *ctx, const char *fmtString,...)
Definition: imports.c:889
#define e
Definition: ke_i.h:82
int MESA_VERBOSE
Definition: context.c:86
const char * _mesa_lookup_enum_by_nr(int nr)
Definition: enums.c:6332
const GLvoid GLenum
Definition: dispatch.h:4336
#define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval)
Definition: context.h:239
void GLAPIENTRY _mesa_GetFixedv ( GLenum  pname,
GLfixed params 
)
void GLAPIENTRY _mesa_GetFloatv ( GLenum  pname,
GLfloat params 
)

Definition at line 1280 of file get.c.

1281 {
1282  const struct value_desc *d;
1283  union value v;
1284  GLmatrix *m;
1285  int shift, i;
1286  void *p;
1287  GET_CURRENT_CONTEXT(ctx);
1288 
1290 
1291  d = find_value("glGetFloatv", pname, &p, &v);
1292  switch (d->type) {
1293  case TYPE_INVALID:
1294  break;
1295  case TYPE_CONST:
1296  params[0] = (GLfloat) d->offset;
1297  break;
1298 
1299  case TYPE_FLOAT_4:
1300  case TYPE_FLOATN_4:
1301  params[3] = ((GLfloat *) p)[3];
1302  case TYPE_FLOAT_3:
1303  case TYPE_FLOATN_3:
1304  params[2] = ((GLfloat *) p)[2];
1305  case TYPE_FLOAT_2:
1306  case TYPE_FLOATN_2:
1307  params[1] = ((GLfloat *) p)[1];
1308  case TYPE_FLOAT:
1309  case TYPE_FLOATN:
1310  params[0] = ((GLfloat *) p)[0];
1311  break;
1312 
1313  case TYPE_DOUBLEN:
1314  params[0] = ((GLdouble *) p)[0];
1315  break;
1316 
1317  case TYPE_INT_4:
1318  params[3] = (GLfloat) (((GLint *) p)[3]);
1319  case TYPE_INT_3:
1320  params[2] = (GLfloat) (((GLint *) p)[2]);
1321  case TYPE_INT_2:
1322  case TYPE_ENUM_2:
1323  params[1] = (GLfloat) (((GLint *) p)[1]);
1324  case TYPE_INT:
1325  case TYPE_ENUM:
1326  params[0] = (GLfloat) (((GLint *) p)[0]);
1327  break;
1328 
1329  case TYPE_INT_N:
1330  for (i = 0; i < v.value_int_n.n; i++)
1331  params[i] = INT_TO_FLOAT(v.value_int_n.ints[i]);
1332  break;
1333 
1334  case TYPE_INT64:
1335  params[0] = ((GLint64 *) p)[0];
1336  break;
1337 
1338  case TYPE_BOOLEAN:
1339  params[0] = BOOLEAN_TO_FLOAT(*(GLboolean*) p);
1340  break;
1341 
1342  case TYPE_MATRIX:
1343  m = *(GLmatrix **) p;
1344  for (i = 0; i < 16; i++)
1345  params[i] = m->m[i];
1346  break;
1347 
1348  case TYPE_MATRIX_T:
1349  m = *(GLmatrix **) p;
1350  for (i = 0; i < 16; i++)
1351  params[i] = m->m[transpose[i]];
1352  break;
1353 
1354  case TYPE_BIT_0:
1355  case TYPE_BIT_1:
1356  case TYPE_BIT_2:
1357  case TYPE_BIT_3:
1358  case TYPE_BIT_4:
1359  case TYPE_BIT_5:
1360  case TYPE_BIT_6:
1361  case TYPE_BIT_7:
1362  shift = d->type - TYPE_BIT_0;
1363  params[0] = BOOLEAN_TO_FLOAT((*(GLbitfield *) p >> shift) & 1);
1364  break;
1365  }
1366 }
Definition: get.c:83
Definition: get.c:139
Definition: get.c:93
#define shift
Definition: input.c:1594
double GLdouble
Definition: gl.h:163
Definition: get.c:94
#define INT_TO_FLOAT(I)
Definition: macros.h:99
int offset
Definition: get.c:135
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:68
GLsizei GLboolean transpose
Definition: glext.h:6077
Definition: get.c:80
#define ASSERT_OUTSIDE_BEGIN_END(ctx)
Definition: context.h:253
GLenum GLclampf GLint i
Definition: glfuncs.h:14
GLenum const GLfloat * params
Definition: glext.h:5645
unsigned char GLboolean
Definition: gl.h:151
Definition: get.c:79
Definition: get.c:90
float GLfloat
Definition: gl.h:161
Definition: get.c:92
#define d
Definition: ke_i.h:81
Definition: get.c:95
#define BOOLEAN_TO_FLOAT(B)
Definition: get.c:70
Definition: get.c:88
static const struct value_desc * find_value(const char *func, GLenum pname, void **p, union value *v)
Definition: get.c:1125
Definition: get.c:84
int64_t GLint64
Definition: glext.h:5567
Definition: get.c:82
Definition: get.c:89
const GLdouble * v
Definition: gl.h:2040
Definition: get.c:78
unsigned int GLbitfield
Definition: gl.h:152
Definition: get.c:81
CONST GLfloat m[16]
Definition: m_xform.h:144
GLubyte type
Definition: get.c:134
Definition: get.c:91
GLfloat GLfloat p
Definition: glext.h:8902
Definition: get.c:87
const GLint const GLsizei GLint
Definition: dispatch.h:5271
void GLAPIENTRY _mesa_GetInteger64Indexedv ( GLenum  pname,
GLuint  index,
GLint64 params 
)
void GLAPIENTRY _mesa_GetInteger64v ( GLenum  pname,
GLint64 params 
)
void GLAPIENTRY _mesa_GetIntegerv ( GLenum  pname,
GLint params 
)

Definition at line 1369 of file get.c.

1370 {
1371  const struct value_desc *d;
1372  union value v;
1373  GLmatrix *m;
1374  int shift, i;
1375  void *p;
1376  GET_CURRENT_CONTEXT(ctx);
1377 
1379 
1380  d = find_value("glGetIntegerv", pname, &p, &v);
1381  switch (d->type) {
1382  case TYPE_INVALID:
1383  break;
1384  case TYPE_CONST:
1385  params[0] = d->offset;
1386  break;
1387 
1388  case TYPE_FLOAT_4:
1389  params[3] = IROUND(((GLfloat *) p)[3]);
1390  case TYPE_FLOAT_3:
1391  params[2] = IROUND(((GLfloat *) p)[2]);
1392  case TYPE_FLOAT_2:
1393  params[1] = IROUND(((GLfloat *) p)[1]);
1394  case TYPE_FLOAT:
1395  params[0] = IROUND(((GLfloat *) p)[0]);
1396  break;
1397 
1398  case TYPE_FLOATN_4:
1399  params[3] = FLOAT_TO_INT(((GLfloat *) p)[3]);
1400  case TYPE_FLOATN_3:
1401  params[2] = FLOAT_TO_INT(((GLfloat *) p)[2]);
1402  case TYPE_FLOATN_2:
1403  params[1] = FLOAT_TO_INT(((GLfloat *) p)[1]);
1404  case TYPE_FLOATN:
1405  params[0] = FLOAT_TO_INT(((GLfloat *) p)[0]);
1406  break;
1407 
1408  case TYPE_DOUBLEN:
1409  params[0] = FLOAT_TO_INT(((GLdouble *) p)[0]);
1410  break;
1411 
1412  case TYPE_INT_4:
1413  params[3] = ((GLint *) p)[3];
1414  case TYPE_INT_3:
1415  params[2] = ((GLint *) p)[2];
1416  case TYPE_INT_2:
1417  case TYPE_ENUM_2:
1418  params[1] = ((GLint *) p)[1];
1419  case TYPE_INT:
1420  case TYPE_ENUM:
1421  params[0] = ((GLint *) p)[0];
1422  break;
1423 
1424  case TYPE_INT_N:
1425  for (i = 0; i < v.value_int_n.n; i++)
1426  params[i] = v.value_int_n.ints[i];
1427  break;
1428 
1429  case TYPE_INT64:
1430  params[0] = INT64_TO_INT(((GLint64 *) p)[0]);
1431  break;
1432 
1433  case TYPE_BOOLEAN:
1434  params[0] = BOOLEAN_TO_INT(*(GLboolean*) p);
1435  break;
1436 
1437  case TYPE_MATRIX:
1438  m = *(GLmatrix **) p;
1439  for (i = 0; i < 16; i++)
1440  params[i] = FLOAT_TO_INT(m->m[i]);
1441  break;
1442 
1443  case TYPE_MATRIX_T:
1444  m = *(GLmatrix **) p;
1445  for (i = 0; i < 16; i++)
1446  params[i] = FLOAT_TO_INT(m->m[transpose[i]]);
1447  break;
1448 
1449  case TYPE_BIT_0:
1450  case TYPE_BIT_1:
1451  case TYPE_BIT_2:
1452  case TYPE_BIT_3:
1453  case TYPE_BIT_4:
1454  case TYPE_BIT_5:
1455  case TYPE_BIT_6:
1456  case TYPE_BIT_7:
1457  shift = d->type - TYPE_BIT_0;
1458  params[0] = (*(GLbitfield *) p >> shift) & 1;
1459  break;
1460  }
1461 }
#define IROUND(f)
Definition: imports.h:321
Definition: get.c:83
Definition: get.c:139
Definition: get.c:93
#define shift
Definition: input.c:1594
double GLdouble
Definition: gl.h:163
Definition: get.c:94
#define BOOLEAN_TO_INT(B)
Definition: get.c:68
int offset
Definition: get.c:135
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:68
GLsizei GLboolean transpose
Definition: glext.h:6077
Definition: get.c:80
#define ASSERT_OUTSIDE_BEGIN_END(ctx)
Definition: context.h:253
GLenum GLclampf GLint i
Definition: glfuncs.h:14
GLenum const GLfloat * params
Definition: glext.h:5645
unsigned char GLboolean
Definition: gl.h:151
Definition: get.c:79
Definition: get.c:90
float GLfloat
Definition: gl.h:161
Definition: get.c:92
#define FLOAT_TO_INT(X)
Definition: macros.h:106
#define d
Definition: ke_i.h:81
Definition: get.c:95
Definition: get.c:88
static const struct value_desc * find_value(const char *func, GLenum pname, void **p, union value *v)
Definition: get.c:1125
Definition: get.c:84
int64_t GLint64
Definition: glext.h:5567
Definition: get.c:82
Definition: get.c:89
const GLdouble * v
Definition: gl.h:2040
Definition: get.c:78
#define INT64_TO_INT(I)
Definition: get.c:66
unsigned int GLbitfield
Definition: gl.h:152
Definition: get.c:81
CONST GLfloat m[16]
Definition: m_xform.h:144
GLubyte type
Definition: get.c:134
Definition: get.c:91
GLfloat GLfloat p
Definition: glext.h:8902
Definition: get.c:87
const GLint const GLsizei GLint
Definition: dispatch.h:5271
void GLAPIENTRY _mesa_GetPointerv ( GLenum  pname,
GLvoid **  params 
)

Return pointer-valued state, such as a vertex array pointer.

Parameters
pnamenames state to be queried
paramsreturns the pointer value
See Also
glGetPointerv().

Tries to get the specified pointer via dd_function_table::GetPointerv, otherwise gets the specified pointer from the current context.

Definition at line 88 of file getstring.c.

89 {
92 
93  if (!params)
94  return;
95 
97  _mesa_debug(ctx, "glGetPointerv %s\n", _mesa_lookup_enum_by_nr(pname));
98 
99  switch (pname) {
101  *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_POS].Ptr;
102  break;
104  *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_NORMAL].Ptr;
105  break;
107  *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR].Ptr;
108  break;
110  *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_FOG].Ptr;
111  break;
113  *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_COLOR_INDEX].Ptr;
114  break;
116  *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_TEX].Ptr;
117  break;
119  *params = (GLvoid *) ctx->Array.VertexAttrib[VERT_ATTRIB_EDGEFLAG].Ptr;
120  break;
122  *params = ctx->Feedback.Buffer;
123  break;
125  *params = ctx->Select.Buffer;
126  break;
127  default:
128  _mesa_error( ctx, GL_INVALID_ENUM, "glGetPointerv" );
129  return;
130  }
131 }
#define GL_VERTEX_ARRAY_POINTER
Definition: gl.h:222
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:68
void _mesa_debug(const struct gl_context *ctx, const char *fmtString,...)
Definition: imports.c:889
#define ASSERT_OUTSIDE_BEGIN_END(ctx)
Definition: context.h:253
#define GL_COLOR_ARRAY_POINTER
Definition: gl.h:224
#define GL_INDEX_ARRAY_POINTER
Definition: gl.h:225
#define GL_SELECTION_BUFFER_POINTER
Definition: gl.h:410
#define GL_FEEDBACK_BUFFER_POINTER
Definition: gl.h:405
int MESA_VERBOSE
Definition: context.c:86
#define GL_EDGE_FLAG_ARRAY_POINTER
Definition: gl.h:227
const char * _mesa_lookup_enum_by_nr(int nr)
Definition: enums.c:6332
#define GL_INVALID_ENUM
Definition: gl.h:694
#define GL_NORMAL_ARRAY_POINTER
Definition: gl.h:223
#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT
Definition: glext.h:3202
#define GL_TEXTURE_COORD_ARRAY_POINTER
Definition: gl.h:226
void _mesa_error(struct gl_context *ctx, GLenum error, const char *fmtString,...)
Definition: imports.c:832
const GLubyte* GLAPIENTRY _mesa_GetString ( GLenum  name)

Query string-valued state. The return value should not be freed by the caller.

Parameters
namethe state variable to query.
See Also
glGetString().

Tries to get the string from dd_function_table::GetString, otherwise returns the hardcoded strings.

Definition at line 39 of file getstring.c.

40 {
42  static const char *vendor = "Brian Paul";
43  static const char *renderer = "Mesa";
44 
45  if (!ctx)
46  return NULL;
47 
49 
50  /* this is a required driver function */
51  assert(ctx->Driver.GetString);
52  {
53  /* Give the driver the chance to handle this query */
54  const GLubyte *str = (*ctx->Driver.GetString)(ctx, name);
55  if (str)
56  return str;
57  }
58 
59  switch (name) {
60  case GL_VENDOR:
61  return (const GLubyte *) vendor;
62  case GL_RENDERER:
63  return (const GLubyte *) renderer;
64  case GL_VERSION:
65  return (const GLubyte *) ctx->VersionString;
66  case GL_EXTENSIONS:
67  return (const GLubyte *) ctx->Extensions.String;
68  default:
69  _mesa_error( ctx, GL_INVALID_ENUM, "glGetString" );
70  return (const GLubyte *) 0;
71  }
72 }
#define GL_RENDERER
Definition: gl.h:688
#define GL_VENDOR
Definition: gl.h:687
#define GET_CURRENT_CONTEXT(__ctx__)
Definition: glheader.h:68
#define assert(x)
Definition: debug.h:53
#define GL_EXTENSIONS
Definition: gl.h:690
#define GL_VERSION
Definition: gl.h:689
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:557
const WCHAR * vendor
Definition: db.cpp:798
unsigned char GLubyte
Definition: gl.h:157
#define GL_INVALID_ENUM
Definition: gl.h:694
#define ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, retval)
Definition: context.h:239
void _mesa_error(struct gl_context *ctx, GLenum error, const char *fmtString,...)
Definition: imports.c:832