Ejemplo n.º 1
0
GLboolean SERVER_DISPATCH_APIENTRY crServerDispatchIsShader(GLuint shader)
{
    GLboolean retval;
    retval = cr_server.head_spu->dispatch_table.IsShader(crStateGetShaderHWID(shader));
    crServerReturnValue(&retval, sizeof(retval));
    return retval; /* ignored */
}
Ejemplo n.º 2
0
void SERVER_DISPATCH_APIENTRY crServerDispatchGetShaderInfoLog(GLuint shader, GLsizei bufSize, GLsizei *length, char *infoLog)
{
    GLsizei *pLocal;

    pLocal = (GLsizei*) crAlloc(bufSize+sizeof(GLsizei));
    if (!pLocal)
    {
        GLsizei zero=0;
        crServerReturnValue(&zero, sizeof(zero));
    }
    cr_server.head_spu->dispatch_table.GetShaderInfoLog(crStateGetShaderHWID(shader), bufSize, pLocal, (char*)&pLocal[1]);
    crServerReturnValue(pLocal, pLocal[0]+sizeof(GLsizei));
    crFree(pLocal);
}
Ejemplo n.º 3
0
DECLEXPORT(GLuint) STATE_APIENTRY crStateDeleteObjectARB( GLhandleARB obj )
{
    GLuint hwId = crStateGetProgramHWID(obj);
    if (hwId)
    {
        crStateDeleteProgram(obj);
    }
    else
    {
        hwId = crStateGetShaderHWID(obj);
        crStateDeleteShader(obj);
    }
    return hwId;
}
Ejemplo n.º 4
0
void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteObjectARB(GLhandleARB obj)
{
    GLuint hwid = crStateGetProgramHWID(obj);

    if (!hwid)
    {
        hwid = crStateGetShaderHWID(obj);
        crStateDeleteShader(obj);
    }
    else
    {
        crStateDeleteProgram(obj);
    }

    cr_server.head_spu->dispatch_table.DeleteObjectARB(hwid);
}
Ejemplo n.º 5
0
void SERVER_DISPATCH_APIENTRY crServerDispatchGetObjectParameterivARB( GLhandleARB obj, GLenum pname, GLint * params )
{
    GLint local_params[1];
    GLuint hwid = crStateGetProgramHWID(obj);
    if (!hwid)
    {
        hwid = crStateGetShaderHWID(obj);
        if (!hwid)
        {
            crWarning("Unknown object %i, in crServerDispatchGetObjectParameterivARB", obj);
        }
    }

    (void) params;
    cr_server.head_spu->dispatch_table.GetObjectParameterivARB( hwid, pname, local_params );
    crServerReturnValue( &(local_params[0]), 1*sizeof(GLint) );
}
Ejemplo n.º 6
0
void SERVER_DISPATCH_APIENTRY crServerDispatchGetShaderSource(GLuint shader, GLsizei bufSize, GLsizei *length, char *source)
{
    GLsizei *pLocal;

    pLocal = (GLsizei*) crAlloc(bufSize+sizeof(GLsizei));
    if (!pLocal)
    {
        GLsizei zero=0;
        crServerReturnValue(&zero, sizeof(zero));
    }
    /* initial (fallback )value */
    *pLocal = 0;
    cr_server.head_spu->dispatch_table.GetShaderSource(crStateGetShaderHWID(shader), bufSize, pLocal, (char*)&pLocal[1]);
    CRASSERT(pLocal[0] <= bufSize);
    crServerReturnValue(pLocal, pLocal[0]+sizeof(GLsizei));
    crFree(pLocal);
}
Ejemplo n.º 7
0
void SERVER_DISPATCH_APIENTRY crServerDispatchGetInfoLogARB(GLhandleARB obj, GLsizei maxLength, GLsizei * length, GLcharARB * infoLog)
{
    GLsizei *pLocal;
    GLuint hwid;

    pLocal = (GLsizei*) crAlloc(maxLength+sizeof(GLsizei));
    if (!pLocal)
    {
        GLsizei zero=0;
        crServerReturnValue(&zero, sizeof(zero));
    }
    /*@todo: recheck*/
    hwid = crStateGetProgramHWID(obj);
    if (!hwid) hwid = crStateGetShaderHWID(obj);
    cr_server.head_spu->dispatch_table.GetInfoLogARB(hwid, maxLength, pLocal, (char*)&pLocal[1]);
    crServerReturnValue(pLocal, (*pLocal)+sizeof(GLsizei));
    crFree(pLocal);
}
Ejemplo n.º 8
0
void SERVER_DISPATCH_APIENTRY crServerDispatchDetachShader(GLuint program, GLuint shader)
{
    crStateDetachShader(program, shader);
    cr_server.head_spu->dispatch_table.DetachShader(crStateGetProgramHWID(program), crStateGetShaderHWID(shader));
}
Ejemplo n.º 9
0
void SERVER_DISPATCH_APIENTRY crServerDispatchDeleteShader(GLuint shader)
{
    crStateDeleteShader(shader);
    cr_server.head_spu->dispatch_table.DeleteShader(crStateGetShaderHWID(shader));
}
Ejemplo n.º 10
0
void SERVER_DISPATCH_APIENTRY crServerDispatchShaderSource(GLuint shader, GLsizei count, const char ** string, const GLint * length)
{
    /*@todo?crStateShaderSource(shader...);*/
    cr_server.head_spu->dispatch_table.ShaderSource(crStateGetShaderHWID(shader), count, string, length);
}