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

📄 indirect.c

📁 Mesa is an open-source implementation of the OpenGL specification - a system for rendering interacti
💻 C
📖 第 1 页 / 共 5 页
字号:
#ifdef USE_XCB        xcb_connection_t *c = XGetXCBConnection(dpy);        (void) __glXFlushRenderBuffer(gc, gc->pc);        xcb_glx_gen_lists_reply_t *reply =            xcb_glx_gen_lists_reply(c,                                    xcb_glx_gen_lists(c,                                                      gc->currentContextTag,                                                      range), NULL);        retval = reply->ret_val;        free(reply);#else        GLubyte const *pc =            __glXSetupSingleRequest(gc, X_GLsop_GenLists, cmdlen);        (void) memcpy((void *) (pc + 0), (void *) (&range), 4);        retval = (GLuint) __glXReadReply(dpy, 0, NULL, GL_FALSE);        UnlockDisplay(dpy);        SyncHandle();#endif /* USE_XCB */    }    return retval;}#define X_GLrop_ListBase 3void__indirect_glListBase(GLuint base){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 8;    emit_header(gc->pc, X_GLrop_ListBase, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&base), 4);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Begin 4void__indirect_glBegin(GLenum mode){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 8;    emit_header(gc->pc, X_GLrop_Begin, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&mode), 4);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Bitmap 5void__indirect_glBitmap(GLsizei width, GLsizei height, GLfloat xorig,                    GLfloat yorig, GLfloat xmove, GLfloat ymove,                    const GLubyte *bitmap){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint compsize =        (bitmap != NULL) ? __glImageSize(width, height, 1, GL_COLOR_INDEX,                                         GL_BITMAP, 0) : 0;    const GLuint cmdlen = 48 + __GLX_PAD(compsize);    if (__builtin_expect(gc->currentDpy != NULL, 1)) {        if (cmdlen <= gc->maxSmallRenderCommandSize) {            if ((gc->pc + cmdlen) > gc->bufEnd) {                (void) __glXFlushRenderBuffer(gc, gc->pc);            }            emit_header(gc->pc, X_GLrop_Bitmap, cmdlen);            (void) memcpy((void *) (gc->pc + 24), (void *) (&width), 4);            (void) memcpy((void *) (gc->pc + 28), (void *) (&height), 4);            (void) memcpy((void *) (gc->pc + 32), (void *) (&xorig), 4);            (void) memcpy((void *) (gc->pc + 36), (void *) (&yorig), 4);            (void) memcpy((void *) (gc->pc + 40), (void *) (&xmove), 4);            (void) memcpy((void *) (gc->pc + 44), (void *) (&ymove), 4);            if (compsize > 0) {                (*gc->fillImage) (gc, 2, width, height, 1, GL_COLOR_INDEX,                                  GL_BITMAP, bitmap, gc->pc + 48, gc->pc + 4);            } else {                (void) memcpy(gc->pc + 4, default_pixel_store_2D,                              default_pixel_store_2D_size);            }            gc->pc += cmdlen;            if (gc->pc > gc->limit) {                (void) __glXFlushRenderBuffer(gc, gc->pc);            }        } else {            const GLint op = X_GLrop_Bitmap;            const GLuint cmdlenLarge = cmdlen + 4;            GLubyte *const pc = __glXFlushRenderBuffer(gc, gc->pc);            (void) memcpy((void *) (pc + 0), (void *) (&cmdlenLarge), 4);            (void) memcpy((void *) (pc + 4), (void *) (&op), 4);            (void) memcpy((void *) (pc + 28), (void *) (&width), 4);            (void) memcpy((void *) (pc + 32), (void *) (&height), 4);            (void) memcpy((void *) (pc + 36), (void *) (&xorig), 4);            (void) memcpy((void *) (pc + 40), (void *) (&yorig), 4);            (void) memcpy((void *) (pc + 44), (void *) (&xmove), 4);            (void) memcpy((void *) (pc + 48), (void *) (&ymove), 4);            __glXSendLargeImage(gc, compsize, 2, width, height, 1,                                GL_COLOR_INDEX, GL_BITMAP, bitmap, pc + 52,                                pc + 8);        }    }}#define X_GLrop_Color3bv 6void__indirect_glColor3b(GLbyte red, GLbyte green, GLbyte blue){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 8;    emit_header(gc->pc, X_GLrop_Color3bv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1);    (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1);    (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color3bv 6void__indirect_glColor3bv(const GLbyte *v){    generic_3_byte(X_GLrop_Color3bv, v);}#define X_GLrop_Color3dv 7void__indirect_glColor3d(GLdouble red, GLdouble green, GLdouble blue){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 28;    emit_header(gc->pc, X_GLrop_Color3dv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 8);    (void) memcpy((void *) (gc->pc + 12), (void *) (&green), 8);    (void) memcpy((void *) (gc->pc + 20), (void *) (&blue), 8);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color3dv 7void__indirect_glColor3dv(const GLdouble * v){    generic_24_byte(X_GLrop_Color3dv, v);}#define X_GLrop_Color3fv 8void__indirect_glColor3f(GLfloat red, GLfloat green, GLfloat blue){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 16;    emit_header(gc->pc, X_GLrop_Color3fv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4);    (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4);    (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color3fv 8void__indirect_glColor3fv(const GLfloat * v){    generic_12_byte(X_GLrop_Color3fv, v);}#define X_GLrop_Color3iv 9void__indirect_glColor3i(GLint red, GLint green, GLint blue){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 16;    emit_header(gc->pc, X_GLrop_Color3iv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4);    (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4);    (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color3iv 9void__indirect_glColor3iv(const GLint * v){    generic_12_byte(X_GLrop_Color3iv, v);}#define X_GLrop_Color3sv 10void__indirect_glColor3s(GLshort red, GLshort green, GLshort blue){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 12;    emit_header(gc->pc, X_GLrop_Color3sv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2);    (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2);    (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color3sv 10void__indirect_glColor3sv(const GLshort * v){    generic_6_byte(X_GLrop_Color3sv, v);}#define X_GLrop_Color3ubv 11void__indirect_glColor3ub(GLubyte red, GLubyte green, GLubyte blue){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 8;    emit_header(gc->pc, X_GLrop_Color3ubv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1);    (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1);    (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color3ubv 11void__indirect_glColor3ubv(const GLubyte *v){    generic_3_byte(X_GLrop_Color3ubv, v);}#define X_GLrop_Color3uiv 12void__indirect_glColor3ui(GLuint red, GLuint green, GLuint blue){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 16;    emit_header(gc->pc, X_GLrop_Color3uiv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4);    (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4);    (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color3uiv 12void__indirect_glColor3uiv(const GLuint * v){    generic_12_byte(X_GLrop_Color3uiv, v);}#define X_GLrop_Color3usv 13void__indirect_glColor3us(GLushort red, GLushort green, GLushort blue){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 12;    emit_header(gc->pc, X_GLrop_Color3usv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2);    (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2);    (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color3usv 13void__indirect_glColor3usv(const GLushort * v){    generic_6_byte(X_GLrop_Color3usv, v);}#define X_GLrop_Color4bv 14void__indirect_glColor4b(GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 8;    emit_header(gc->pc, X_GLrop_Color4bv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1);    (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1);    (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1);    (void) memcpy((void *) (gc->pc + 7), (void *) (&alpha), 1);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color4bv 14void__indirect_glColor4bv(const GLbyte *v){    generic_4_byte(X_GLrop_Color4bv, v);}#define X_GLrop_Color4dv 15void__indirect_glColor4d(GLdouble red, GLdouble green, GLdouble blue,                     GLdouble alpha){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 36;    emit_header(gc->pc, X_GLrop_Color4dv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 8);    (void) memcpy((void *) (gc->pc + 12), (void *) (&green), 8);    (void) memcpy((void *) (gc->pc + 20), (void *) (&blue), 8);    (void) memcpy((void *) (gc->pc + 28), (void *) (&alpha), 8);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color4dv 15void__indirect_glColor4dv(const GLdouble * v){    generic_32_byte(X_GLrop_Color4dv, v);}#define X_GLrop_Color4fv 16void__indirect_glColor4f(GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 20;    emit_header(gc->pc, X_GLrop_Color4fv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4);    (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4);    (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4);    (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color4fv 16void__indirect_glColor4fv(const GLfloat * v){    generic_16_byte(X_GLrop_Color4fv, v);}#define X_GLrop_Color4iv 17void__indirect_glColor4i(GLint red, GLint green, GLint blue, GLint alpha){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 20;    emit_header(gc->pc, X_GLrop_Color4iv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 4);    (void) memcpy((void *) (gc->pc + 8), (void *) (&green), 4);    (void) memcpy((void *) (gc->pc + 12), (void *) (&blue), 4);    (void) memcpy((void *) (gc->pc + 16), (void *) (&alpha), 4);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color4iv 17void__indirect_glColor4iv(const GLint * v){    generic_16_byte(X_GLrop_Color4iv, v);}#define X_GLrop_Color4sv 18void__indirect_glColor4s(GLshort red, GLshort green, GLshort blue, GLshort alpha){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 12;    emit_header(gc->pc, X_GLrop_Color4sv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 2);    (void) memcpy((void *) (gc->pc + 6), (void *) (&green), 2);    (void) memcpy((void *) (gc->pc + 8), (void *) (&blue), 2);    (void) memcpy((void *) (gc->pc + 10), (void *) (&alpha), 2);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color4sv 18void__indirect_glColor4sv(const GLshort * v){    generic_8_byte(X_GLrop_Color4sv, v);}#define X_GLrop_Color4ubv 19void__indirect_glColor4ub(GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha){    __GLXcontext *const gc = __glXGetCurrentContext();    const GLuint cmdlen = 8;    emit_header(gc->pc, X_GLrop_Color4ubv, cmdlen);    (void) memcpy((void *) (gc->pc + 4), (void *) (&red), 1);    (void) memcpy((void *) (gc->pc + 5), (void *) (&green), 1);    (void) memcpy((void *) (gc->pc + 6), (void *) (&blue), 1);    (void) memcpy((void *) (gc->pc + 7), (void *) (&alpha), 1);    gc->pc += cmdlen;    if (__builtin_expect(gc->pc > gc->limit, 0)) {        (void) __glXFlushRenderBuffer(gc, gc->pc);    }}#define X_GLrop_Color4ubv 19void__indirect_glColor4ubv(const GLubyte *v){    generic_4_byte(X_GLrop_Color4ubv, v);}#define X_GLrop_Color4uiv 20void

⌨️ 快捷键说明

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