本文整理匯總了C++中GET_DISPATCH函數的典型用法代碼示例。如果您正苦於以下問題:C++ GET_DISPATCH函數的具體用法?C++ GET_DISPATCH怎麽用?C++ GET_DISPATCH使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GET_DISPATCH函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: VertexAttrib1ivARB
static void GLAPIENTRY
VertexAttrib1ivARB(GLuint index, const GLint *v)
{
CALL_VertexAttrib1fARB(GET_DISPATCH(), (index, (GLfloat)v[0]));
}
示例2: VertexAttrib4dvARB
static void GLAPIENTRY
VertexAttrib4dvARB(GLuint index, const GLdouble *v)
{
CALL_VertexAttrib4dv(GET_DISPATCH(), (index, v));
}
示例3: VertexAttribI3ubv
static void GLAPIENTRY
VertexAttribI3ubv(GLuint index, const GLubyte *v)
{
CALL_VertexAttribI3uiEXT(GET_DISPATCH(), (index, v[0], v[1], v[2]));
}
示例4: vbo_exec_EvalMesh2
static void GLAPIENTRY
vbo_exec_EvalMesh2(GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2)
{
GET_CURRENT_CONTEXT(ctx);
GLfloat u, du, v, dv, v1, u1;
GLint i, j;
ASSERT_OUTSIDE_BEGIN_END(ctx);
switch (mode) {
case GL_POINT:
case GL_LINE:
case GL_FILL:
break;
default:
_mesa_error( ctx, GL_INVALID_ENUM, "glEvalMesh2(mode)" );
return;
}
/* No effect if vertex maps disabled.
*/
if (!ctx->Eval.Map2Vertex4 &&
!ctx->Eval.Map2Vertex3 &&
!(ctx->VertexProgram._Enabled && ctx->Eval.Map2Attrib[VERT_ATTRIB_POS]))
return;
du = ctx->Eval.MapGrid2du;
dv = ctx->Eval.MapGrid2dv;
v1 = ctx->Eval.MapGrid2v1 + j1 * dv;
u1 = ctx->Eval.MapGrid2u1 + i1 * du;
switch (mode) {
case GL_POINT:
CALL_Begin(GET_DISPATCH(), (GL_POINTS));
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
for (u=u1,i=i1;i<=i2;i++,u+=du) {
CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
}
}
CALL_End(GET_DISPATCH(), ());
break;
case GL_LINE:
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP));
for (u=u1,i=i1;i<=i2;i++,u+=du) {
CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
}
CALL_End(GET_DISPATCH(), ());
}
for (u=u1,i=i1;i<=i2;i++,u+=du) {
CALL_Begin(GET_DISPATCH(), (GL_LINE_STRIP));
for (v=v1,j=j1;j<=j2;j++,v+=dv) {
CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
}
CALL_End(GET_DISPATCH(), ());
}
break;
case GL_FILL:
for (v=v1,j=j1;j<j2;j++,v+=dv) {
CALL_Begin(GET_DISPATCH(), (GL_TRIANGLE_STRIP));
for (u=u1,i=i1;i<=i2;i++,u+=du) {
CALL_EvalCoord2f(GET_DISPATCH(), (u, v));
CALL_EvalCoord2f(GET_DISPATCH(), (u, v+dv));
}
CALL_End(GET_DISPATCH(), ());
}
break;
}
}
示例5: VertexAttrib4uivARB
static void GLAPIENTRY
VertexAttrib4uivARB(GLuint index, const GLuint *v)
{
CALL_VertexAttrib4fARB(GET_DISPATCH(), (index, (GLfloat)v[0], (GLfloat)v[1],
(GLfloat)v[2], (GLfloat)v[3]));
}
示例6: VertexAttrib3uivARB
static void GLAPIENTRY VertexAttrib3uivARB(GLuint index, const GLuint *v)
{
CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, v[0], v[1], v[2]));
}
示例7: gl_dispatch_stub_GetSeparableFilterEXT
/* it is defined to gl_dispatch_stub_NNN in indirect.h */
void gl_dispatch_stub_GetSeparableFilterEXT (GLenum target, GLenum format,
GLenum type, GLvoid * row,
GLvoid * column, GLvoid * span)
{
struct glx_context *const gc = __glXGetCurrentContext();
#if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
if (gc->isDirect) {
const _glapi_proc *const table = (_glapi_proc *) GET_DISPATCH();
PFNGLGETSEPARABLEFILTEREXTPROC p =
(PFNGLGETSEPARABLEFILTEREXTPROC) table[359];
p(target, format, type, row, column, span);
return;
}
else
#endif
{
Display *const dpy = gc->currentDpy;
const GLuint cmdlen = __GLX_PAD(13);
if (dpy != NULL) {
const __GLXattribute *const state = gc->client_state_private;
xGLXGetSeparableFilterReply reply;
GLubyte const *pc =
__glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply,
X_GLvop_GetSeparableFilterEXT, cmdlen);
unsigned compsize;
(void) memcpy((void *) (pc + 0), (void *) (&target), 4);
(void) memcpy((void *) (pc + 4), (void *) (&format), 4);
(void) memcpy((void *) (pc + 8), (void *) (&type), 4);
*(int8_t *) (pc + 12) = state->storePack.swapEndian;
(void) _XReply(dpy, (xReply *) & reply, 0, False);
compsize = reply.length << 2;
if (compsize != 0) {
const GLint width = reply.width;
const GLint height = reply.height;
const GLint widthsize =
__glImageSize(width, 1, 1, format, type, 0);
const GLint heightsize =
__glImageSize(height, 1, 1, format, type, 0);
GLubyte *const buf =
malloc((widthsize > heightsize) ? widthsize : heightsize);
if (buf == NULL) {
/* Throw data away */
_XEatData(dpy, compsize);
__glXSetError(gc, GL_OUT_OF_MEMORY);
UnlockDisplay(dpy);
SyncHandle();
return;
}
else {
int extra;
extra = 4 - (widthsize & 3);
_XRead(dpy, (char *) buf, widthsize);
if (extra < 4) {
_XEatData(dpy, extra);
}
__glEmptyImage(gc, 1, width, 1, 1, format, type, buf, row);
extra = 4 - (heightsize & 3);
_XRead(dpy, (char *) buf, heightsize);
if (extra < 4) {
_XEatData(dpy, extra);
}
__glEmptyImage(gc, 1, height, 1, 1, format, type, buf, column);
free((char *) buf);
}
}
}
}
}
示例8: VertexAttrib3usvNV
static void GLAPIENTRY VertexAttrib3usvNV(GLuint index, const GLushort *v)
{
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, v[0], v[1], v[2]));
}
示例9: VertexAttrib3NivNV
static void GLAPIENTRY VertexAttrib3NivNV(GLuint index, const GLint *v)
{
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, INT_TO_FLOAT(v[0]),
INT_TO_FLOAT(v[1]),
INT_TO_FLOAT(v[2])));
}
示例10: VertexAttrib3NbvNV
static void GLAPIENTRY VertexAttrib3NbvNV(GLuint index, const GLbyte *v)
{
CALL_VertexAttrib3fNV(GET_DISPATCH(), (index, BYTE_TO_FLOAT(v[0]),
BYTE_TO_FLOAT(v[1]),
BYTE_TO_FLOAT(v[2])));
}
示例11: VertexAttrib4ubvNV
static void GLAPIENTRY VertexAttrib4ubvNV(GLuint index, const GLubyte *v)
{
CALL_VertexAttrib4fNV(GET_DISPATCH(), (index, v[0], v[1], v[2], v[3]));
}
示例12: NAME
void NAME(_gloffset_GetSeparableFilter)(GLenum target, GLenum format, GLenum type,
GLvoid *row, GLvoid *column, GLvoid *span)
{
__GLXcontext * const gc = __glXGetCurrentContext();
if (gc->isDirect) {
CALL_GetSeparableFilter(GET_DISPATCH(),
(target, format, type, row, column, span));
return;
}
else {
Display *const dpy = gc->currentDpy;
const GLuint cmdlen = __GLX_PAD(13);
if (dpy != NULL) {
const __GLXattribute * const state = gc->client_state_private;
xGLXGetSeparableFilterReply reply;
GLubyte const *pc =
__glXSetupVendorRequest(gc, X_GLXVendorPrivateWithReply,
X_GLvop_GetSeparableFilterEXT, cmdlen);
unsigned compsize;
(void) memcpy((void *) (pc + 0), (void *) (&target), 4);
(void) memcpy((void *) (pc + 4), (void *) (&format), 4);
(void) memcpy((void *) (pc + 8), (void *) (&type), 4);
*(int8_t *) (pc + 12) = state->storePack.swapEndian;
(void) _XReply(dpy, (xReply *) & reply, 0, False);
compsize = reply.length << 2;
if (compsize != 0) {
const GLint width = reply.width;
const GLint height = reply.height;
const GLint widthsize =
__glImageSize(width, 1, 1, format, type, 0);
const GLint heightsize =
__glImageSize(height, 1, 1, format, type, 0);
GLubyte * const buf =
(GLubyte*) Xmalloc((widthsize > heightsize) ? widthsize : heightsize);
if (buf == NULL) {
/* Throw data away */
_XEatData(dpy, compsize);
__glXSetError(gc, GL_OUT_OF_MEMORY);
UnlockDisplay(dpy);
SyncHandle();
return;
} else {
int extra;
extra = 4 - (widthsize & 3);
_XRead(dpy, (char *)buf, widthsize);
if (extra < 4) {
_XEatData(dpy, extra);
}
__glEmptyImage(gc, 1, width, 1, 1, format, type, buf,
row);
extra = 4 - (heightsize & 3);
_XRead(dpy, (char *)buf, heightsize);
if (extra < 4) {
_XEatData(dpy, extra);
}
__glEmptyImage(gc, 1, height, 1, 1, format, type, buf,
column);
Xfree((char*) buf);
}
}
}
}
}
示例13: radeon_Begin
/* Begin/End
*/
static void radeon_Begin( GLenum mode )
{
GET_CURRENT_CONTEXT(ctx);
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
if (RADEON_DEBUG & DEBUG_VFMT)
fprintf(stderr, "%s( %s )\n", __FUNCTION__,
_mesa_lookup_enum_by_nr( mode ));
if (mode > GL_POLYGON) {
_mesa_error( ctx, GL_INVALID_ENUM, "glBegin" );
return;
}
if (rmesa->vb.prim[0] != GL_POLYGON+1) {
_mesa_error( ctx, GL_INVALID_OPERATION, "glBegin" );
return;
}
if (ctx->NewState)
_mesa_update_state( ctx );
if (rmesa->NewGLState)
radeonValidateState( ctx );
if (rmesa->vb.recheck)
radeonVtxfmtValidate( ctx );
if (!rmesa->vb.installed) {
CALL_Begin(GET_DISPATCH(), (mode));
return;
}
if (rmesa->dma.flush && rmesa->vb.counter < 12) {
if (RADEON_DEBUG & DEBUG_VFMT)
fprintf(stderr, "%s: flush almost-empty buffers\n", __FUNCTION__);
flush_prims( rmesa );
}
/* Need to arrange to save vertices here? Or always copy from dma (yuk)?
*/
if (!rmesa->dma.flush) {
/* FIXME: what are these constants? */
if (rmesa->dma.current.ptr + 12*rmesa->vb.vertex_size*4 >
rmesa->dma.current.end) {
RADEON_NEWPRIM( rmesa );
radeonRefillCurrentDmaRegion( rmesa );
}
rmesa->vb.dmaptr = (int *)(rmesa->dma.current.address + rmesa->dma.current.ptr);
rmesa->vb.counter = (rmesa->dma.current.end - rmesa->dma.current.ptr) /
(rmesa->vb.vertex_size * 4);
rmesa->vb.counter--;
rmesa->vb.initial_counter = rmesa->vb.counter;
rmesa->vb.notify = wrap_buffer;
rmesa->dma.flush = flush_prims;
ctx->Driver.NeedFlush |= FLUSH_STORED_VERTICES;
}
rmesa->vb.prim[0] = mode;
start_prim( rmesa, mode | PRIM_BEGIN );
}
示例14: VFMT_FALLBACK
static void VFMT_FALLBACK( const char *caller )
{
GET_CURRENT_CONTEXT(ctx);
radeonContextPtr rmesa = RADEON_CONTEXT(ctx);
GLfloat tmp[3][RADEON_MAX_VERTEX_SIZE];
GLuint i, prim;
GLuint ind = rmesa->vb.vertex_format;
GLuint nrverts;
GLfloat alpha = 1.0;
GLuint unit;
if (RADEON_DEBUG & (DEBUG_FALLBACKS|DEBUG_VFMT))
fprintf(stderr, "%s from %s\n", __FUNCTION__, caller);
if (rmesa->vb.prim[0] == GL_POLYGON+1) {
VFMT_FALLBACK_OUTSIDE_BEGIN_END( __FUNCTION__ );
return;
}
/* Copy vertices out of dma:
*/
nrverts = copy_dma_verts( rmesa, tmp );
/* Finish the prim at this point:
*/
note_last_prim( rmesa, 0 );
flush_prims( rmesa );
/* Update ctx->Driver.CurrentExecPrimitive and swap in swtnl.
*/
prim = rmesa->vb.prim[0];
ctx->Driver.CurrentExecPrimitive = GL_POLYGON+1;
_tnl_wakeup_exec( ctx );
ctx->Driver.FlushVertices = radeonFlushVertices;
assert(rmesa->dma.flush == 0);
rmesa->vb.fell_back = GL_TRUE;
rmesa->vb.installed = GL_FALSE;
CALL_Begin(GET_DISPATCH(), (prim));
if (rmesa->vb.installed_color_3f_sz == 4)
alpha = ctx->Current.Attrib[VERT_ATTRIB_COLOR0][3];
/* Replay saved vertices
*/
for (i = 0 ; i < nrverts; i++) {
GLuint offset = 3;
if (ind & RADEON_CP_VC_FRMT_N0) {
CALL_Normal3fv(GET_DISPATCH(), (&tmp[i][offset]));
offset += 3;
}
if (ind & RADEON_CP_VC_FRMT_PKCOLOR) {
radeon_color_t *col = (radeon_color_t *)&tmp[i][offset];
CALL_Color4ub(GET_DISPATCH(), (col->red, col->green, col->blue, col->alpha));
offset++;
}
else if (ind & RADEON_CP_VC_FRMT_FPALPHA) {
CALL_Color4fv(GET_DISPATCH(), (&tmp[i][offset]));
offset+=4;
}
else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) {
CALL_Color3fv(GET_DISPATCH(), (&tmp[i][offset]));
offset+=3;
}
if (ind & RADEON_CP_VC_FRMT_PKSPEC) {
radeon_color_t *spec = (radeon_color_t *)&tmp[i][offset];
CALL_SecondaryColor3ubEXT(GET_DISPATCH(), (spec->red, spec->green, spec->blue));
offset++;
}
for (unit = 0 ; unit < ctx->Const.MaxTextureUnits; unit++) {
if (ind & RADEON_ST_BIT(unit)) {
CALL_MultiTexCoord2fvARB(GET_DISPATCH(), ((GL_TEXTURE0 + unit), &tmp[i][offset]));
offset += 2;
}
}
CALL_Vertex3fv(GET_DISPATCH(), (&tmp[i][0]));
}
/* Replay current vertex
*/
if (ind & RADEON_CP_VC_FRMT_N0)
CALL_Normal3fv(GET_DISPATCH(), (rmesa->vb.normalptr));
if (ind & RADEON_CP_VC_FRMT_PKCOLOR)
CALL_Color4ub(GET_DISPATCH(), (rmesa->vb.colorptr->red, rmesa->vb.colorptr->green,
rmesa->vb.colorptr->blue, rmesa->vb.colorptr->alpha));
else if (ind & RADEON_CP_VC_FRMT_FPALPHA)
CALL_Color4fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr));
else if (ind & RADEON_CP_VC_FRMT_FPCOLOR) {
if (rmesa->vb.installed_color_3f_sz == 4 && alpha != 1.0)
CALL_Color4f(GET_DISPATCH(), (rmesa->vb.floatcolorptr[0],
rmesa->vb.floatcolorptr[1],
rmesa->vb.floatcolorptr[2],
alpha));
else
CALL_Color3fv(GET_DISPATCH(), (rmesa->vb.floatcolorptr));
}
//.........這裏部分代碼省略.........
示例15: VertexAttrib3NusvARB
static void GLAPIENTRY VertexAttrib3NusvARB(GLuint index, const GLushort *v)
{
CALL_VertexAttrib3fARB(GET_DISPATCH(), (index, USHORT_TO_FLOAT(v[0]),
USHORT_TO_FLOAT(v[1]),
USHORT_TO_FLOAT(v[2])));
}