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


C++ AppWarning函数代码示例

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


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

示例1: AppWarning

String  String::Left(UINT iOffset)
{
    if(iOffset > curLength)
    {
        AppWarning(TEXT("Bad call to String::Left.  iOffset is bigger than the current length."));
        return String();
    }

    return String(*this).SetLength(iOffset);
}
开发者ID:Eridia,项目名称:OBS,代码行数:10,代码来源:XString.cpp

示例2: FAILED

HANDLE D3D10Texture::GetSharedHandle()
{
    HRESULT err;
    HANDLE handle = NULL;
    IDXGIResource *pDXGIResource;
    if FAILED(err = texture->QueryInterface(__uuidof(IDXGIResource), (void **)&pDXGIResource))
    {
        AppWarning(TEXT("D3D10Texture::GetSharedHandle: QueryInterface failed, result = %08lX"), err);
        return handle;
    }
开发者ID:greigs,项目名称:OBS,代码行数:10,代码来源:D3D10Texture.cpp

示例3: CoCreateInstance

bool DeviceSource::Init(XElement *data)
{
    HRESULT err;
    err = CoCreateInstance(CLSID_FilterGraph, NULL, CLSCTX_INPROC_SERVER, (REFIID)IID_IFilterGraph, (void**)&graph);
    if(FAILED(err))
    {
        AppWarning(TEXT("DShowAudioPlugin: Failed to build IGraphBuilder, result = %08lX"), err);
        return false;
    }

    err = CoCreateInstance(CLSID_CaptureGraphBuilder2, NULL, CLSCTX_INPROC_SERVER, (REFIID)IID_ICaptureGraphBuilder2, (void**)&capture);
    if(FAILED(err))
    {
        AppWarning(TEXT("DShowAudioPlugin: Failed to build ICaptureGraphBuilder2, result = %08lX"), err);
        return false;
    }

    hSampleMutex = OSCreateMutex();
    if(!hSampleMutex)
    {
        AppWarning(TEXT("DShowAudioPlugin: could not create sample mutex"));
        return false;
    }

    capture->SetFiltergraph(graph);

    int numThreads = MAX(OSGetTotalCores()-2, 1);
    hConvertThreads = (HANDLE*)Allocate(sizeof(HANDLE)*numThreads);
    convertData = (ConvertData*)Allocate(sizeof(ConvertData)*numThreads);

    zero(hConvertThreads, sizeof(HANDLE)*numThreads);
    zero(convertData, sizeof(ConvertData)*numThreads);

    this->data = data;
    UpdateSettings();

    //if(!bFiltersLoaded)
    //    return false;

    Log(TEXT("Using directshow audio input"));

    return true;
}
开发者ID:Jack0r,项目名称:OBS-DShowAudioPlugin,代码行数:43,代码来源:DeviceSource.cpp

示例4: AppWarning

void SceneItem::SetRender(bool render)
{
    element->SetInt(TEXT("render"), (int)((render)?1:0));
    bRender = render;
    CTSTR lpClass = element->GetString(TEXT("class"));

    if (bRender) {
        if (!lpClass) {
            AppWarning(TEXT("No class for source '%s' in scene '%s'"), element->GetName(), API->GetSceneElement()->GetName());
        } else {
            XElement *data = element->GetElement(TEXT("data"));
            source = API->CreateImageSource(lpClass, data);
            if(!source) {
                AppWarning(TEXT("Could not create image source '%s' in scene '%s'"), element->GetName(), API->GetSceneElement()->GetName());
            } else {
                API->EnterSceneMutex();
                if (parent && parent->bSceneStarted) {
                    source->BeginScene();

                    if(scmp(lpClass, L"GlobalSource") == 0)
                        source->GlobalSourceEnterScene();
                }
                API->LeaveSceneMutex();
            }
        }
    } else {
        if (source) {
            API->EnterSceneMutex();

            ImageSource *src = source;
            source = NULL;

            if(scmp(lpClass, L"GlobalSource") == 0)
                src->GlobalSourceLeaveScene();

            if (parent && parent->bSceneStarted)
                src->EndScene();
            delete src;

            API->LeaveSceneMutex();
        }
    }
}
开发者ID:373137461,项目名称:OBS,代码行数:43,代码来源:Scene.cpp

示例5: AppWarning

VBData* D3D10VertexBuffer::GetData()
{
    if(!bDynamic)
    {
        AppWarning(TEXT("D3D10VertexBuffer::GetData: Cannot get vertex data of a non-dynamic vertex buffer"));
        return NULL;
    }

    return data;
}
开发者ID:wwllww,项目名称:LiveStream_MultiIntance,代码行数:10,代码来源:D3D10VertexBuffer.cpp

示例6: LoadPlugin

bool LoadPlugin()
{
    textureMutexes[0] = CreateMutex(NULL, NULL, TEXTURE_MUTEX1);
    if(!textureMutexes[0])
    {
        AppWarning(TEXT("Could not create texture mutex 1, GetLastError = %u"), GetLastError());
        return false;
    }

    textureMutexes[1] = CreateMutex(NULL, NULL, TEXTURE_MUTEX2);
    if(!textureMutexes[1])
    {
        AppWarning(TEXT("Could not create texture mutex 2, GetLastError = %u"), GetLastError());
        return false;
    }

    API->RegisterImageSourceClass(GRAPHICSCAPTURE_CLASSNAME, Str("Sources.GameCaptureSource"), (OBSCREATEPROC)CreateGraphicsCaptureSource, (OBSCONFIGPROC)ConfigureGraphicsCaptureSource);

    return true;
}
开发者ID:AndrewHolder,项目名称:OBS,代码行数:20,代码来源:GraphicsCapture.cpp

示例7: return

Scene* OBS::CreateScene(CTSTR lpClassName, XElement *data)
{
    for(UINT i=0; i<sceneClasses.Num(); i++)
    {
        if(sceneClasses[i].strClass.CompareI(lpClassName))
            return (Scene*)sceneClasses[i].createProc(data);
    }

    AppWarning(TEXT("OBS::CreateScene: Could not find scene class '%s'"), lpClassName);
    return NULL;
}
开发者ID:aharrison,项目名称:OBS,代码行数:11,代码来源:API.cpp

示例8: AppWarning

void D3D10Texture::ReleaseDC()
{
    if(!surface)
    {
        AppWarning(TEXT("D3D10Texture::ReleaseDC: no DC to release"));
        return;
    }

    surface->ReleaseDC(NULL);
    SafeRelease(surface);
}
开发者ID:greigs,项目名称:OBS,代码行数:11,代码来源:D3D10Texture.cpp

示例9: UIntString

bool SharedTexCapture::Init(CaptureInfo &info)
{
    String strFileMapName;
    strFileMapName << TEXTURE_MEMORY << UIntString(info.mapID);

    hFileMap = OpenFileMapping(FILE_MAP_ALL_ACCESS, FALSE, strFileMapName);
    if(hFileMap == NULL)
    {
        AppWarning(TEXT("SharedTexCapture::Init: Could not open file mapping: %d"), GetLastError());
        return false;
    }

    sharedMemory = (LPBYTE)MapViewOfFile(hFileMap, FILE_MAP_ALL_ACCESS, 0, 0, info.mapSize);
    if(!sharedMemory)
    {
        AppWarning(TEXT("SharedTexCapture::Init: Could not map view of file"));
        return false;
    }

    //Log(TEXT("using shared texture capture"));

    //---------------------------------------

    texData = (SharedTexData*)sharedMemory;
    texData->frameTime = 1000000/API->GetMaxFPS()/2;

    sharedTexture = GS->CreateTextureFromSharedHandle(info.cx, info.cy, (HANDLE)texData->texHandle);
    if(!sharedTexture)
    {
        AppWarning(TEXT("SharedTexCapture::Init: Could not create shared texture"));
        return false;
    }

    copyTexture = GS->CreateTexture(info.cx, info.cy, (GSColorFormat)info.format, 0, FALSE, TRUE);

    Log(TEXT("SharedTexCapture hooked"));

    bInitialized = true;
    return true;
}
开发者ID:373137461,项目名称:OBS,代码行数:40,代码来源:SharedTexCapture.cpp

示例10: ConfigureCloudSource

bool STDCALL ConfigureCloudSource(XElement *element, bool bCreating)
{
    if (!element)
    {
        AppWarning(TEXT("ConfigureIVASource: NULL element"));
        return false;
    }

    XElement *data = element->GetElement(TEXT("data"));
    if (!data)
        data = element->CreateElement(TEXT("data"));

    ConfigIVAInfo configInfo;
    configInfo.data = data;

    if (OBSDialogBox(hinstMain, MAKEINTRESOURCE(IDD_IVACLOUD), API->GetMainWindow(), IVACloudProc, (LPARAM)&configInfo) == IDOK)
    {
        int nIndex = data->GetInt(TEXT("SelIndex"));

        std::string strPath = g_pCloudData->m_vIPicDesc[nIndex].strFileName;
        std::wstring wstrPath;
        StringToWString(strPath, wstrPath);

        CTSTR lpBitmap = wstrPath.c_str();

        D3DX10_IMAGE_INFO ii;
        if (SUCCEEDED(D3DX10GetImageInfoFromFile(lpBitmap, NULL, &ii, NULL)))
        {
            element->SetInt(TEXT("cx"), ii.Width);
            element->SetInt(TEXT("cy"), ii.Height);
        }
        else
            AppWarning(TEXT("ConfigureBitmapSource: could not get image info for bitmap '%s'"), lpBitmap);

        return true;
    }

    return false;
}
开发者ID:Venvy-dev,项目名称:OBS,代码行数:39,代码来源:IVACloud.cpp

示例11: LogVideoCardStats

void LogVideoCardStats()
{
    HRESULT err;

#ifdef USE_DXGI1_2
    REFIID iidVal = OSGetVersion() >= 8 ? __uuidof(IDXGIFactory2) : __uuidof(IDXGIFactory1);
#else
    REFIIF iidVal = __uuidof(IDXGIFactory1);
#endif

    IDXGIFactory1 *factory;
    if(SUCCEEDED(err = CreateDXGIFactory1(iidVal, (void**)&factory)))
    {
        UINT i=0;
        IDXGIAdapter1 *giAdapter;

        while(factory->EnumAdapters1(i++, &giAdapter) == S_OK)
        {
            DXGI_ADAPTER_DESC adapterDesc;
            if(SUCCEEDED(err = giAdapter->GetDesc(&adapterDesc)))
            {
                if (!(adapterDesc.VendorId == 0x1414 && adapterDesc.DeviceId == 0x8c)) { // Ignore Microsoft Basic Render Driver
                    Log(TEXT("------------------------------------------"));
                    Log(TEXT("Adapter %u"), i);
                    Log(TEXT("  Video Adapter: %s"), adapterDesc.Description);
                    Log(TEXT("  Video Adapter Dedicated Video Memory: %u"), adapterDesc.DedicatedVideoMemory);
                    Log(TEXT("  Video Adapter Shared System Memory: %u"), adapterDesc.SharedSystemMemory);

                    UINT j = 0;
                    IDXGIOutput *output;
                    while(SUCCEEDED(giAdapter->EnumOutputs(j++, &output)))
                    {
                        DXGI_OUTPUT_DESC desc;
                        if(SUCCEEDED(output->GetDesc(&desc)))
                            Log(TEXT("  Video Adapter Output %u: pos={%d, %d}, size={%d, %d}, attached=%s"), j,
                                desc.DesktopCoordinates.left, desc.DesktopCoordinates.top,
                                desc.DesktopCoordinates.right-desc.DesktopCoordinates.left, desc.DesktopCoordinates.bottom-desc.DesktopCoordinates.top,
                                desc.AttachedToDesktop ? L"true" : L"false");
                        output->Release();
                    }
                }
            }
            else
                AppWarning(TEXT("Could not query adapter %u"), i);

            giAdapter->Release();
        }

        factory->Release();
    }
}
开发者ID:neilzar,项目名称:OBS,代码行数:51,代码来源:D3D10System.cpp

示例12: AppWarning

void D3D10System::DrawSpriteEx(Texture *texture, DWORD color, float x, float y, float x2, float y2, float u, float v, float u2, float v2)
{
    if(!curPixelShader)
        return;

    if(!texture)
    {
        AppWarning(TEXT("Trying to draw a sprite with a NULL texture"));
        return;
    }

    HANDLE hColor = curPixelShader->GetParameterByName(TEXT("outputColor"));

    if(hColor)
        curPixelShader->SetColor(hColor, color);

    if(x2 == -998.0f && y2 == -998.0f)
    {
        x2 = float(texture->Width());
        y2 = float(texture->Height());
    }
    if(u == -998.0f && v == -998.0f)
    {
        u = 0.0f;
        v = 0.0f;
    }
    if(u2 == -998.0f && v2 == -998.0f)
    {
        u2 = 1.0f;
        v2 = 1.0f;
    }

    VBData *data = spriteVertexBuffer->GetData();
    data->VertList[0].Set(x,  y,  0.0f);
    data->VertList[1].Set(x,  y2, 0.0f);
    data->VertList[2].Set(x2, y,  0.0f);
    data->VertList[3].Set(x2, y2, 0.0f);

    List<UVCoord> &coords = data->UVList[0];
    coords[0].Set(u,  v);
    coords[1].Set(u,  v2);
    coords[2].Set(u2, v);
    coords[3].Set(u2, v2);

    spriteVertexBuffer->FlushBuffers();

    LoadVertexBuffer(spriteVertexBuffer);
    LoadTexture(texture);

    Draw(GS_TRIANGLESTRIP);
}
开发者ID:Erowlin,项目名称:OBS,代码行数:51,代码来源:D3D10System.cpp

示例13: AppWarning

void DeviceSource::Start()
{
    if(bCapturing || !control)
        return;

    HRESULT err;
    if(FAILED(err = control->Run()))
    {
        AppWarning(TEXT("DShowAudioPlugin: control->Run failed, result = %08lX"), err);
        return;
    }

    bCapturing = true;
}
开发者ID:Jack0r,项目名称:OBS-DShowAudioPlugin,代码行数:14,代码来源:DeviceSource.cpp

示例14: LoadPlugin

bool LoadPlugin()
{
    pluginLocale = new LocaleStringLookup;

    if(!pluginLocale->LoadStringFile(TEXT("plugins/PSVPlugin/locale/en.txt")))
        AppWarning(TEXT("Could not open locale string file '%s'"), TEXT("plugins/PSVPlugin/locale/en.txt"));

    if(scmpi(API->GetLanguage(), TEXT("en")) != 0)
    {
        String pluginStringFile;
        pluginStringFile << TEXT("plugins/PSVPlugin/locale/") << API->GetLanguage() << TEXT(".txt");
        if(!pluginLocale->LoadStringFile(pluginStringFile))
            AppWarning(TEXT("Could not open locale string file '%s'"), pluginStringFile.Array());
    }

    config.Open(OBSGetPluginDataPath() + CONFIG_FILE, true);

    LoadSettings();

    OnSceneSwitch(OBSGetSceneName());

    return true;
}
开发者ID:Alucard014,项目名称:OBS,代码行数:23,代码来源:psvplugin.cpp

示例15: AppWarning

void D3D10System::Draw(GSDrawMode drawMode, DWORD startVert, DWORD nVerts)
{
    if(!curVertexBuffer)
    {
        AppWarning(TEXT("Tried to call draw without setting a vertex buffer"));
        return;
    }

    if(!curVertexShader)
    {
        AppWarning(TEXT("Tried to call draw without setting a vertex shader"));
        return;
    }

    if(!curPixelShader)
    {
        AppWarning(TEXT("Tried to call draw without setting a pixel shader"));
        return;
    }

    curVertexShader->SetMatrix(curVertexShader->GetViewProj(), curViewProjMatrix);

    curVertexShader->UpdateParams();
    curPixelShader->UpdateParams();

    D3D10_PRIMITIVE_TOPOLOGY newTopology = topologies[(int)drawMode];
    if(newTopology != curTopology)
    {
        d3d->IASetPrimitiveTopology(newTopology);
        curTopology = newTopology;
    }

    if(nVerts == 0)
        nVerts = static_cast<D3D10VertexBuffer*>(curVertexBuffer)->numVerts;

    d3d->Draw(nVerts, startVert);
}
开发者ID:FMJaguar,项目名称:OBS,代码行数:37,代码来源:D3D10System.cpp


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