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


C++ GetContextSuspended函数代码示例

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


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

示例1: alGetBuffer3i

AL_API void AL_APIENTRY alGetBuffer3i(ALuint buffer, ALenum eParam, ALint* plValue1, ALint* plValue2, ALint* plValue3)
{
    ALCcontext    *pContext;
    ALCdevice     *device;

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

    device = pContext->Device;
    if(!plValue1 || !plValue2 || !plValue3)
        alSetError(pContext, AL_INVALID_VALUE);
    else if(LookupBuffer(device->BufferMap, buffer) == NULL)
        alSetError(pContext, AL_INVALID_NAME);
    else
    {
        switch(eParam)
        {
        default:
            alSetError(pContext, AL_INVALID_ENUM);
            break;
        }
    }

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

示例2: 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

示例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: 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

示例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: 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

示例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 = 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)
    {
        ALsource *source = Context->SourceList;
        while(source)
        {
            source->NeedsUpdate = AL_TRUE;
            source = source->next;
        }
    }

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

示例9: alDopplerVelocity

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

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

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

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

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

示例10: alFilteri

AL_API ALvoid AL_APIENTRY alFilteri(ALuint filter, ALenum param, ALint iValue)
{
    ALCcontext *Context;
    ALCdevice  *Device;
    ALfilter   *ALFilter;

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

    Device = Context->Device;
    if((ALFilter=LookupFilter(Device->FilterMap, filter)) != NULL)
    {
        switch(param)
        {
        case AL_FILTER_TYPE:
            if(iValue == AL_FILTER_NULL ||
               iValue == AL_FILTER_LOWPASS)
                InitFilterParams(ALFilter, iValue);
            else
                alSetError(Context, AL_INVALID_VALUE);
            break;

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

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

示例11: alGetFilteriv

AL_API ALvoid AL_APIENTRY alGetFilteriv(ALuint filter, ALenum param, ALint *piValues)
{
    ALCcontext *Context;
    ALCdevice  *Device;

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

    Device = Context->Device;
    if(LookupFilter(Device->FilterMap, filter) != NULL)
    {
        switch(param)
        {
        case AL_FILTER_TYPE:
            alGetFilteri(filter, param, piValues);
            break;

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

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

示例12: alGetListener3i

AL_API void AL_APIENTRY alGetListener3i(ALenum eParam, ALint *plValue1, ALint *plValue2, ALint *plValue3)
{
    ALCcontext *pContext;

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

    if(plValue1 && plValue2 && plValue3)
    {
        switch (eParam)
        {
            case AL_POSITION:
                *plValue1 = (ALint)pContext->Listener.Position[0];
                *plValue2 = (ALint)pContext->Listener.Position[1];
                *plValue3 = (ALint)pContext->Listener.Position[2];
                break;

            case AL_VELOCITY:
                *plValue1 = (ALint)pContext->Listener.Velocity[0];
                *plValue2 = (ALint)pContext->Listener.Velocity[1];
                *plValue3 = (ALint)pContext->Listener.Velocity[2];
                break;

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

    ProcessContext(pContext);
}
开发者ID:JSansalone,项目名称:OpenAL,代码行数:33,代码来源:alListener.c

示例13: alGetListenerf

AL_API ALvoid AL_APIENTRY alGetListenerf(ALenum eParam, ALfloat *pflValue)
{
    ALCcontext *pContext;

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

    if(pflValue)
    {
        switch(eParam)
        {
            case AL_GAIN:
                *pflValue = pContext->Listener.Gain;
                break;

            case AL_METERS_PER_UNIT:
                *pflValue = pContext->Listener.MetersPerUnit;
                break;

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

    ProcessContext(pContext);
}
开发者ID:JSansalone,项目名称:OpenAL,代码行数:29,代码来源:alListener.c

示例14: 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

示例15: alGetFloat

AL_API ALfloat AL_APIENTRY alGetFloat(ALenum pname)
{
    ALCcontext *Context;
    ALfloat value = 0.0f;

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

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

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

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

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

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

    ProcessContext(Context);

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


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