当前位置: 首页>>代码示例>>C++>>正文


C++ ProcessContext函数代码示例

本文整理汇总了C++中ProcessContext函数的典型用法代码示例。如果您正苦于以下问题:C++ ProcessContext函数的具体用法?C++ ProcessContext怎么用?C++ ProcessContext使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了ProcessContext函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: alcMakeContextCurrent

/*
    alcMakeContextCurrent

    Makes the given Context the active Context
*/
ALCAPI ALCboolean ALCAPIENTRY alcMakeContextCurrent(ALCcontext *context)
{
    ALCcontext *ALContext;
    ALboolean bReturn = AL_TRUE;

    SuspendContext(NULL);

    // context must be a valid Context or NULL
    if ((IsContext(context)) || (context == NULL))
    {
        if ((ALContext=alcGetCurrentContext()))
        {
            SuspendContext(ALContext);
            ALContext->InUse=AL_FALSE;
            ProcessContext(ALContext);
        }

        if ((ALContext=context) && (ALContext->Device))
        {
            SuspendContext(ALContext);
            ALContext->InUse=AL_TRUE;
            ProcessContext(ALContext);
        }
    }
    else
    {
        SetALCError(ALC_INVALID_CONTEXT);
        bReturn = AL_FALSE;
    }

    ProcessContext(NULL);

    return bReturn;
}
开发者ID:xiaobinshe,项目名称:multitv,代码行数:39,代码来源:ALc.c

示例2: alcMakeContextCurrent

/*
    alcMakeContextCurrent

    Makes the given Context the active Context
*/
ALCAPI ALCboolean ALCAPIENTRY alcMakeContextCurrent(ALCcontext *context)
{
    ALCcontext *ALContext;
    ALboolean bReturn = AL_TRUE;

    SuspendContext(NULL);

    // context must be a valid Context or NULL
    if(context == NULL || IsContext(context))
    {
        if((ALContext=GetContextSuspended()) != NULL)
        {
            ALContext->InUse=AL_FALSE;
            ProcessContext(ALContext);
        }

        if((ALContext=context) != NULL && ALContext->Device)
        {
            SuspendContext(ALContext);
            ALContext->InUse=AL_TRUE;
            ProcessContext(ALContext);
        }

        tls_set(LocalContext, NULL);
    }
    else
    {
        alcSetError(ALC_INVALID_CONTEXT);
        bReturn = AL_FALSE;
    }

    ProcessContext(NULL);

    return bReturn;
}
开发者ID:SergeStinckwich,项目名称:openqwaq,代码行数:40,代码来源:ALc.c

示例3: alGetAuxiliaryEffectSlotf

ALvoid AL_APIENTRY alGetAuxiliaryEffectSlotf(ALuint effectslot, ALenum param, ALfloat *pflValue)
{
    ALCcontext *Context;

    Context = GetContextSuspended();
    if(!Context) return;

    if (alIsAuxiliaryEffectSlot(effectslot))
    {
        ALeffectslot *ALEffectSlot = (ALeffectslot*)ALTHUNK_LOOKUPENTRY(effectslot);

        switch(param)
        {
        case AL_EFFECTSLOT_GAIN:
            *pflValue = ALEffectSlot->Gain;
            break;

        default:
            alSetError(AL_INVALID_ENUM);
            break;
        }
    }
    else
        alSetError(AL_INVALID_NAME);

    ProcessContext(Context);
}
开发者ID:SergeStinckwich,项目名称:openqwaq,代码行数:27,代码来源:alAuxEffectSlot.c

示例4: alAuxiliaryEffectSlotiv

ALvoid AL_APIENTRY alAuxiliaryEffectSlotiv(ALuint effectslot, ALenum param, ALint *piValues)
{
    ALCcontext *Context;

    Context = GetContextSuspended();
    if(!Context) return;

    if (alIsAuxiliaryEffectSlot(effectslot))
    {
        switch(param)
        {
        case AL_EFFECTSLOT_EFFECT:
        case AL_EFFECTSLOT_AUXILIARY_SEND_AUTO:
            alAuxiliaryEffectSloti(effectslot, param, piValues[0]);
            break;

        default:
            alSetError(AL_INVALID_ENUM);
            break;
        }
    }
    else
        alSetError(AL_INVALID_NAME);

    ProcessContext(Context);
}
开发者ID:SergeStinckwich,项目名称:openqwaq,代码行数:26,代码来源:alAuxEffectSlot.c

示例5: alGetDatabufferivEXT

AL_API ALvoid AL_APIENTRY alGetDatabufferivEXT(ALuint buffer, ALenum eParam, ALint* plValues)
{
    ALCcontext    *pContext;
    ALCdevice     *Device;

    pContext = GetContextSuspended();
    if(!pContext) return;

    if(plValues)
    {
        Device = pContext->Device;
        if(LookupDatabuffer(Device->DatabufferMap, buffer) != NULL)
        {
            switch (eParam)
            {
            case AL_SIZE:
                alGetDatabufferiEXT(buffer, eParam, plValues);
                break;

            default:
                alSetError(pContext, AL_INVALID_ENUM);
                break;
            }
        }
        else
            alSetError(pContext, AL_INVALID_NAME);
    }
    else
        alSetError(pContext, AL_INVALID_VALUE);

    ProcessContext(pContext);
}
开发者ID:3dseals,项目名称:furseal,代码行数:32,代码来源:alDatabuffer.c

示例6: alGetDatabufferSubDataEXT

AL_API ALvoid AL_APIENTRY alGetDatabufferSubDataEXT(ALuint uiBuffer, ALintptrEXT start, ALsizeiptrEXT length, ALvoid *data)
{
    ALCcontext    *pContext;
    ALdatabuffer  *pBuffer;
    ALCdevice     *Device;

    pContext = GetContextSuspended();
    if(!pContext) return;

    Device = pContext->Device;
    if((pBuffer=LookupDatabuffer(Device->DatabufferMap, uiBuffer)) != NULL)
    {
        if(start >= 0 && length >= 0 && start+length <= pBuffer->size)
        {
            if(pBuffer->state == UNMAPPED)
                memcpy(data, pBuffer->data+start, length);
            else
                alSetError(pContext, AL_INVALID_OPERATION);
        }
        else
            alSetError(pContext, AL_INVALID_VALUE);
    }
    else
        alSetError(pContext, AL_INVALID_NAME);

    ProcessContext(pContext);
}
开发者ID:3dseals,项目名称:furseal,代码行数:27,代码来源:alDatabuffer.c

示例7: alSpeedOfSound

AL_API ALvoid AL_APIENTRY alSpeedOfSound(ALfloat flSpeedOfSound)
{
    ALCcontext *pContext;
    ALboolean updateSources = AL_FALSE;

    pContext = GetContextSuspended();
    if(!pContext) return;

    if(flSpeedOfSound > 0.0f)
    {
        pContext->flSpeedOfSound = float2ALfp(flSpeedOfSound);
        updateSources = AL_TRUE;
    }
    else
        alSetError(pContext, AL_INVALID_VALUE);

    if(updateSources)
    {
        ALsizei pos;
        for(pos = 0;pos < pContext->SourceMap.size;pos++)
        {
            ALsource *source = pContext->SourceMap.array[pos].value;
            source->NeedsUpdate = AL_TRUE;
        }
    }

    ProcessContext(pContext);
}
开发者ID:120pulsations,项目名称:Torque2D,代码行数:28,代码来源:alState.c

示例8: alDopplerFactor

AL_API ALvoid AL_APIENTRY alDopplerFactor(ALfloat value)
{
    ALCcontext *Context;
    ALboolean updateSources = AL_FALSE;

    Context = GetContextSuspended();
    if(!Context) return;

    if(value >= 0.0f)
    {
        Context->DopplerFactor = float2ALfp(value);
        updateSources = AL_TRUE;
    }
    else
        alSetError(Context, AL_INVALID_VALUE);

    // Force updating the sources for these parameters, since even head-
    // relative sources are affected
    if(updateSources)
    {
        ALsizei pos;
        for(pos = 0;pos < Context->SourceMap.size;pos++)
        {
            ALsource *source = Context->SourceMap.array[pos].value;
            source->NeedsUpdate = AL_TRUE;
        }
    }

    ProcessContext(Context);
}
开发者ID:120pulsations,项目名称:Torque2D,代码行数:30,代码来源:alState.c

示例9: alBufferiv

ALAPI void ALAPIENTRY alBufferiv(ALuint buffer, ALenum eParam, const ALint* plValues)
{
    ALCcontext    *pContext;

    (void)plValues;

    pContext = alcGetCurrentContext();
    SuspendContext(pContext);

    if (alIsBuffer(buffer) && (buffer != 0))
    {
        switch(eParam)
        {
        default:
            alSetError(AL_INVALID_ENUM);
            break;
        }
    }
    else
    {
        alSetError(AL_INVALID_NAME);
    }

    ProcessContext(pContext);
}
开发者ID:ghoulsblade,项目名称:vegaogre,代码行数:25,代码来源:alBuffer.c

示例10: alBuffer3f

ALAPI void ALAPIENTRY alBuffer3f(ALuint buffer, ALenum eParam, ALfloat flValue1, ALfloat flValue2, ALfloat flValue3)
{
    ALCcontext    *pContext;

    (void)flValue1;
    (void)flValue2;
    (void)flValue3;

    pContext = alcGetCurrentContext();
    SuspendContext(pContext);

    if (alIsBuffer(buffer) && (buffer != 0))
    {
        switch(eParam)
        {
        default:
            alSetError(AL_INVALID_ENUM);
            break;
        }
    }
    else
    {
        alSetError(AL_INVALID_NAME);
    }

    ProcessContext(pContext);
}
开发者ID:ghoulsblade,项目名称:vegaogre,代码行数:27,代码来源:alBuffer.c

示例11: alcCaptureCloseDevice

ALCAPI ALCboolean ALCAPIENTRY alcCaptureCloseDevice(ALCdevice *pDevice)
{
    ALCboolean bReturn = ALC_FALSE;
    ALCdevice **list;

    if ((pDevice)&&(pDevice->IsCaptureDevice))
    {
        SuspendContext(NULL);

        list = &g_pDeviceList;
        while(*list != pDevice)
            list = &(*list)->next;

        *list = (*list)->next;
        g_ulDeviceCount--;

        ProcessContext(NULL);

        ALCdevice_CloseCapture(pDevice);
        free(pDevice);

        bReturn = ALC_TRUE;
    }
    else
        SetALCError(ALC_INVALID_DEVICE);

    return bReturn;
}
开发者ID:ghoulsblade,项目名称:vegaogre,代码行数:28,代码来源:ALc.c

示例12: alDistanceModel

ALAPI ALvoid ALAPIENTRY alDistanceModel(ALenum value)
{
    ALCcontext *Context;
    ALsource *Source;

    Context = GetContextSuspended();
    if(!Context) return;

    switch(value)
    {
        case AL_NONE:
        case AL_INVERSE_DISTANCE:
        case AL_INVERSE_DISTANCE_CLAMPED:
        case AL_LINEAR_DISTANCE:
        case AL_LINEAR_DISTANCE_CLAMPED:
        case AL_EXPONENT_DISTANCE:
        case AL_EXPONENT_DISTANCE_CLAMPED:
            Context->DistanceModel = value;
            for(Source = Context->Source;Source != NULL;Source = Source->next)
                Source->DistanceModel = value;
            break;

        default:
            alSetError(AL_INVALID_VALUE);
            break;
    }

    ProcessContext(Context);
}
开发者ID:SergeStinckwich,项目名称:openqwaq,代码行数:29,代码来源:alState.c

示例13: alGetDouble

ALAPI ALdouble ALAPIENTRY alGetDouble(ALenum pname)
{
    ALCcontext *Context;
    ALdouble value = 0.0;

    Context = GetContextSuspended();
    if(!Context) return 0.0;

    switch(pname)
    {
        case AL_DOPPLER_FACTOR:
            value = (double)Context->DopplerFactor;
            break;

        case AL_DOPPLER_VELOCITY:
            value = (double)Context->DopplerVelocity;
            break;

        case AL_DISTANCE_MODEL:
            value = (double)Context->DistanceModel;
            break;

        case AL_SPEED_OF_SOUND:
            value = (double)Context->flSpeedOfSound;
            break;

        default:
            alSetError(AL_INVALID_ENUM);
            break;
    }

    ProcessContext(Context);

    return value;
}
开发者ID:SergeStinckwich,项目名称:openqwaq,代码行数:35,代码来源:alState.c

示例14: alDisable

AL_API ALvoid AL_APIENTRY alDisable(ALenum capability)
{
    ALCcontext *Context;
    ALboolean  updateSources = AL_FALSE;

    Context = GetContextSuspended();
    if(!Context) return;

    switch(capability)
    {
        case AL_SOURCE_DISTANCE_MODEL:
            Context->SourceDistanceModel = AL_FALSE;
            updateSources = AL_TRUE;
            break;

        default:
            alSetError(Context, AL_INVALID_ENUM);
            break;
    }

    if(updateSources)
    {
        ALsource *source = Context->SourceList;
        while(source)
        {
            source->NeedsUpdate = AL_TRUE;
            source = source->next;
        }
    }

    ProcessContext(Context);
}
开发者ID:SergeStinckwich,项目名称:openqwaq,代码行数:32,代码来源:alState.c

示例15: alSpeedOfSound

AL_API ALvoid AL_APIENTRY alSpeedOfSound(ALfloat flSpeedOfSound)
{
    ALCcontext *pContext;
    ALboolean updateSources = AL_FALSE;

    pContext = GetContextSuspended();
    if(!pContext) return;

    if(flSpeedOfSound > 0.0f)
    {
        pContext->flSpeedOfSound = flSpeedOfSound;
        updateSources = AL_TRUE;
    }
    else
        alSetError(pContext, AL_INVALID_VALUE);

    if(updateSources)
    {
        ALsource *source = pContext->SourceList;
        while(source)
        {
            source->NeedsUpdate = AL_TRUE;
            source = source->next;
        }
    }

    ProcessContext(pContext);
}
开发者ID:SergeStinckwich,项目名称:openqwaq,代码行数:28,代码来源:alState.c


注:本文中的ProcessContext函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。