本文整理汇总了C++中AppWarning函数的典型用法代码示例。如果您正苦于以下问题:C++ AppWarning函数的具体用法?C++ AppWarning怎么用?C++ AppWarning使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了AppWarning函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: traceInFast
Texture *ResourceManager::GetTexture(CTSTR lpName, BOOL bGenMipMaps)
{
traceInFast(ResourceManager::GetTexture);
assert(lpName);
for(DWORD i=0; i<TextureList.Num(); i++)
{
TextureResource &res = TextureList[i];
if(res.name.CompareI(lpName))
{
if(res.texture->IsOf(GetClass(Texture)))
{
++res.refs;
return (Texture*)res.texture;
}
else
return NULL;
}
}
//----------------------------------------
String path;
if(!Engine::ConvertResourceName(lpName, TEXT("textures"), path))
return NULL;
//----------------------------------------
Texture *texOut = GS->CreateTextureFromFile(path, bGenMipMaps);
if(!texOut)
{
AppWarning(TEXT("Could not create texture '%s'"), path.Array());
return NULL;
}
TextureResource &res = *TextureList.CreateNew();
res.texture = texOut;
res.name = lpName;
res.refs = 1;
if(texOut)
texOut->bGenMipMaps = bGenMipMaps;
return texOut;
traceOutFast;
}
开发者ID:alanzw,项目名称:JimEngine,代码行数:49,代码来源:ResourceManager.cpp
示例17: Encode
bool Encode(float *input, UINT numInputFrames, DataPacket &packet, QWORD ×tamp)
{
if(bFirstFrame)
{
curEncodeTimestamp = timestamp;
bFirstFrame = false;
}
//------------------------------------------------
UINT lastSampleSize = frameCounter;
frameCounter += numInputFrames;
if(frameCounter > outputFrameSize)
{
frameCounter -= outputFrameSize;
bufferedTimestamps << curEncodeTimestamp;
curEncodeTimestamp = timestamp + ((outputFrameSize-lastSampleSize)*1000/App->GetSampleRateHz());
}
int ret = lame_encode_buffer_interleaved_ieee_float(lgf, (float*)input, numInputFrames, MP3OutputBuffer.Array()+1, dwMP3MaxSize);
if(ret < 0)
{
AppWarning(TEXT("MP3 encode failed"));
return false;
}
if(ret > 0)
{
if(bFirstPacket)
{
header.CopyArray(MP3OutputBuffer.Array(), ret);
bFirstPacket = false;
ret = 0;
}
else
{
packet.lpPacket = MP3OutputBuffer.Array();
packet.size = ret+1;
timestamp = bufferedTimestamps[0];
bufferedTimestamps.Remove(0);
}
}
return ret > 0;
}
开发者ID:Alucard014,项目名称:OBS,代码行数:49,代码来源:Encoder_MP3.cpp
示例18: AppWarning
Shader* D3D10VertexShader::CreateVertexShaderFromBlob(ShaderBlob const &blob, CTSTR lpShader, CTSTR lpFileName)
{
ShaderProcessor shaderProcessor;
if (!shaderProcessor.ProcessShader(lpShader, lpFileName))
AppWarning(TEXT("Unable to process vertex shader '%s'"), lpFileName); //don't exit, leave it to the actual shader compiler to tell the errors
//-----------------------------------------------
if (!blob.size())
return nullptr;
ComPtr<ID3D11VertexShader> vShader;
ID3D11InputLayout *vShaderLayout;
HRESULT err = GetD3D()->CreateVertexShader(&blob.front(), blob.size(), NULL, vShader.Assign());
if (FAILED(err))
{
CrashError(TEXT("Unable to create vertex shader '%s', result = %08lX"), lpFileName, err);
return NULL;
}
err = GetD3D()->CreateInputLayout(shaderProcessor.generatedLayout.Array(), shaderProcessor.generatedLayout.Num(), &blob.front(), blob.size(), &vShaderLayout);
if (FAILED(err))
{
CrashError(TEXT("Unable to create vertex layout for vertex shader '%s', result = %08lX"), lpFileName, err);
return NULL;
}
//-----------------------------------------------
D3D10VertexShader *shader = new D3D10VertexShader;
shader->vertexShader = vShader.Detach();
shader->inputLayout = vShaderLayout;
if (!shader->ProcessData(shaderProcessor, lpFileName))
{
delete shader;
return NULL;
}
shader->bHasNormals = shaderProcessor.bHasNormals;
shader->bHasColors = shaderProcessor.bHasColors;
shader->bHasTangents = shaderProcessor.bHasTangents;
shader->nTextureCoords = shaderProcessor.numTextureCoords;
shader->hViewProj = shader->GetParameterByName(TEXT("ViewProj"));
return shader;
}
开发者ID:Heli-GitHub,项目名称:OBS,代码行数:47,代码来源:D3D10Shader.cpp
示例19: traceIn
void Mesh::SaveMeshFile()
{
traceIn(Mesh::SaveMeshFile);
String path;
Engine::ConvertResourceName(strName, TEXT("models"), path, FALSE);
XFileOutputSerializer modelFile;
if(!modelFile.Open(path, XFILE_CREATEALWAYS))
{
AppWarning(TEXT("Could not create model file '%s'"), path);
return;
}
VBData *vbd = VertBuffer->GetData();
DWORD temp = MODELFILE_VER;
modelFile << temp;
Vect::SerializeList(modelFile, vbd->VertList);
Vect::SerializeList(modelFile, vbd->NormalList);
modelFile << vbd->TVList[0];
if(vbd->TVList.Num() < 2)
{
temp = 0;
modelFile << temp;
}
else
modelFile << vbd->TVList[1];
Vect::SerializeList(modelFile, vbd->TangentList);
modelFile << nFaces;
modelFile.Serialize(FaceList, nFaces*sizeof(Face));
modelFile << nEdges;
if(nEdges) modelFile.Serialize(EdgeList, nEdges*sizeof(Edge));
modelFile << DefaultMaterialList;
modelFile << nSections;
modelFile.Serialize(SectionList, nSections*sizeof(DrawSection));
modelFile << bounds;
modelFile.Close();
traceOut;
}
开发者ID:alanzw,项目名称:JimEngine,代码行数:47,代码来源:Mesh.cpp
示例20: __uuidof
bool MMDeviceAudioSource::Initialize(bool bMic, CTSTR lpID)
{
const IID IID_IMMDeviceEnumerator = __uuidof(IMMDeviceEnumerator);
const CLSID CLSID_MMDeviceEnumerator = __uuidof(MMDeviceEnumerator);
bIsMic = bMic;
deviceId = lpID;
HRESULT err = CoCreateInstance(CLSID_MMDeviceEnumerator, NULL, CLSCTX_ALL, IID_IMMDeviceEnumerator, (void**)&mmEnumerator);
if(FAILED(err))
{
AppWarning(TEXT("MMDeviceAudioSource::Initialize(%d): Could not create IMMDeviceEnumerator = %08lX"), (BOOL)bIsMic, err);
return false;
}
return Reinitialize();
}
开发者ID:ArtBears,项目名称:OBS,代码行数:17,代码来源:MMDeviceAudioSource.cpp
注:本文中的AppWarning函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论