Example #1
0
int
ephyrGLXQueryVersionSwap (__GLXclientState *a_cl, GLbyte *a_pc)
{
    xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) a_pc;
    __GLX_DECLARE_SWAP_VARIABLES;

    __GLX_SWAP_SHORT (&req->length);
    __GLX_SWAP_INT (&req->majorVersion);
    __GLX_SWAP_INT (&req->minorVersion);
    return ephyrGLXQueryVersion (a_cl, a_pc) ;
}
Example #2
0
int
ephyrGLXQueryVersion(__GLXclientState * a_cl, GLbyte * a_pc)
{
    ClientPtr client = a_cl->client;
    xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) a_pc;
    xGLXQueryVersionReply reply;
    int major, minor;
    int res = BadImplementation;

    EPHYR_LOG("enter\n");

    major = req->majorVersion;
    minor = req->minorVersion;

    if (!ephyrHostGLXQueryVersion(&major, &minor)) {
        EPHYR_LOG_ERROR("ephyrHostGLXQueryVersion() failed\n");
        goto out;
    }
    EPHYR_LOG("major:%d, minor:%d\n", major, minor);
    reply = (xGLXQueryVersionReply) {
        .type = X_Reply,
        .sequenceNumber = client->sequence,
        .length = 0,
        .majorVersion = major,
        .minorVersion = minor
    };

    if (client->swapped) {
        __glXSwapQueryVersionReply(client, &reply);
    }
    else {
        WriteToClient(client, sz_xGLXQueryVersionReply, &reply);
    }

    res = Success;
 out:
    EPHYR_LOG("leave\n");
    return res;
}

int
ephyrGLXQueryVersionSwap(__GLXclientState * a_cl, GLbyte * a_pc)
{
    xGLXQueryVersionReq *req = (xGLXQueryVersionReq *) a_pc;

    __GLX_DECLARE_SWAP_VARIABLES;

    __GLX_SWAP_SHORT(&req->length);
    __GLX_SWAP_INT(&req->majorVersion);
    __GLX_SWAP_INT(&req->minorVersion);
    return ephyrGLXQueryVersion(a_cl, a_pc);
}