Procházet zdrojové kódy

added GetInteger/Float/Double/Boolean/Pointer device driver functions

tags/mesa_3_5
Brian Paul před 26 roky
rodič
revize
042066887b
2 změnil soubory, kde provedl 50 přidání a 5 odebrání
  1. 12
    1
      src/mesa/main/dd.h
  2. 38
    4
      src/mesa/main/get.c

+ 12
- 1
src/mesa/main/dd.h Zobrazit soubor

/* $Id: dd.h,v 1.27 2000/08/08 16:15:14 brianp Exp $ */


/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
* Version: 3.3
* Version: 3.4
* *
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved. * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
* *
void (*StencilMask)(GLcontext *ctx, GLuint mask); void (*StencilMask)(GLcontext *ctx, GLuint mask);
void (*StencilOp)(GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass); void (*StencilOp)(GLcontext *ctx, GLenum fail, GLenum zfail, GLenum zpass);
void (*Viewport)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h); void (*Viewport)(GLcontext *ctx, GLint x, GLint y, GLsizei w, GLsizei h);

/* State-query functions
*
* Return GL_TRUE if query was completed, GL_FALSE otherwise.
*/
GLboolean (*GetBooleanv)(GLcontext *ctx, GLenum pname, GLboolean *result);
GLboolean (*GetDoublev)(GLcontext *ctx, GLenum pname, GLdouble *result);
GLboolean (*GetFloatv)(GLcontext *ctx, GLenum pname, GLfloat *result);
GLboolean (*GetIntegerv)(GLcontext *ctx, GLenum pname, GLint *result);
GLboolean (*GetPointerv)(GLcontext *ctx, GLenum pname, GLvoid **result);
}; };





+ 38
- 4
src/mesa/main/get.c Zobrazit soubor

/* $Id: get.c,v 1.30 2000/07/21 15:41:08 brianp Exp $ */
/* $Id: get.c,v 1.31 2000/08/08 16:15:14 brianp Exp $ */


/* /*
* Mesa 3-D graphics library * Mesa 3-D graphics library
* Version: 3.3
* Version: 3.5
* *
* Copyright (C) 1999-2000 Brian Paul All Rights Reserved. * Copyright (C) 1999-2000 Brian Paul All Rights Reserved.
* *


ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetBooleanv"); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetBooleanv");


if (!params)
return;

if (MESA_VERBOSE & VERBOSE_API) if (MESA_VERBOSE & VERBOSE_API)
fprintf(stderr, "glGetBooleanv %s\n", gl_lookup_enum_by_nr(pname)); fprintf(stderr, "glGetBooleanv %s\n", gl_lookup_enum_by_nr(pname));


if (ctx->Driver.GetBooleanv
&& (*ctx->Driver.GetBooleanv)(ctx, pname, params))
return;

switch (pname) { switch (pname) {
case GL_ACCUM_RED_BITS: case GL_ACCUM_RED_BITS:
*params = INT_TO_BOOL(ctx->Visual->AccumRedBits); *params = INT_TO_BOOL(ctx->Visual->AccumRedBits);


ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetDoublev"); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetDoublev");


if (!params)
return;

if (MESA_VERBOSE & VERBOSE_API) if (MESA_VERBOSE & VERBOSE_API)
fprintf(stderr, "glGetDoublev %s\n", gl_lookup_enum_by_nr(pname)); fprintf(stderr, "glGetDoublev %s\n", gl_lookup_enum_by_nr(pname));


if (ctx->Driver.GetDoublev && (*ctx->Driver.GetDoublev)(ctx, pname, params))
return;

switch (pname) { switch (pname) {
case GL_ACCUM_RED_BITS: case GL_ACCUM_RED_BITS:
*params = (GLdouble) ctx->Visual->AccumRedBits; *params = (GLdouble) ctx->Visual->AccumRedBits;


ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetFloatv"); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetFloatv");


if (!params)
return;

if (MESA_VERBOSE & VERBOSE_API) if (MESA_VERBOSE & VERBOSE_API)
fprintf(stderr, "glGetFloatv %s\n", gl_lookup_enum_by_nr(pname)); fprintf(stderr, "glGetFloatv %s\n", gl_lookup_enum_by_nr(pname));


if (ctx->Driver.GetFloatv && (*ctx->Driver.GetFloatv)(ctx, pname, params))
return;

switch (pname) { switch (pname) {
case GL_ACCUM_RED_BITS: case GL_ACCUM_RED_BITS:
*params = (GLfloat) ctx->Visual->AccumRedBits; *params = (GLfloat) ctx->Visual->AccumRedBits;


ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetIntegerv"); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetIntegerv");


if (!params)
return;

if (MESA_VERBOSE & VERBOSE_API) if (MESA_VERBOSE & VERBOSE_API)
fprintf(stderr, "glGetIntegerv %s\n", gl_lookup_enum_by_nr(pname)); fprintf(stderr, "glGetIntegerv %s\n", gl_lookup_enum_by_nr(pname));


if (ctx->Driver.GetIntegerv
&& (*ctx->Driver.GetIntegerv)(ctx, pname, params))
return;

switch (pname) { switch (pname) {
case GL_ACCUM_RED_BITS: case GL_ACCUM_RED_BITS:
*params = (GLint) ctx->Visual->AccumRedBits; *params = (GLint) ctx->Visual->AccumRedBits;
{ {
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
GLuint texUnit = ctx->Texture.CurrentUnit; GLuint texUnit = ctx->Texture.CurrentUnit;
/*GLuint texTransformUnit = ctx->Texture.CurrentTransformUnit;*/

ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx, "glGetPointerv");

if (!params)
return;


if (MESA_VERBOSE & VERBOSE_API) if (MESA_VERBOSE & VERBOSE_API)
fprintf(stderr, "glGetPointerv %s\n", gl_lookup_enum_by_nr(pname)); fprintf(stderr, "glGetPointerv %s\n", gl_lookup_enum_by_nr(pname));


if (ctx->Driver.GetPointerv
&& (*ctx->Driver.GetPointerv)(ctx, pname, params))
return;

switch (pname) { switch (pname) {
case GL_VERTEX_ARRAY_POINTER: case GL_VERTEX_ARRAY_POINTER:
*params = ctx->Array.Vertex.Ptr; *params = ctx->Array.Vertex.Ptr;
GET_CURRENT_CONTEXT(ctx); GET_CURRENT_CONTEXT(ctx);
static const char *vendor = "Brian Paul"; static const char *vendor = "Brian Paul";
static const char *renderer = "Mesa"; static const char *renderer = "Mesa";
static const char *version = "1.2 Mesa 3.3";
static const char *version = "1.2 Mesa 3.5 beta";


ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetString", 0); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, "glGetString", 0);



Načítá se…
Zrušit
Uložit