本文整理汇总了C++中OVR_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ OVR_ASSERT函数的具体用法?C++ OVR_ASSERT怎么用?C++ OVR_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OVR_ASSERT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: OVR_ASSERT
UPInt String::InsertCharAt(UInt32 c, UPInt posAt)
{
char buf[8];
SPInt index = 0;
UTF8Util::EncodeChar(buf, &index, c);
OVR_ASSERT(index >= 0);
buf[(UPInt)index] = 0;
Insert(buf, posAt, index);
return (UPInt)index;
}
示例2: switch
eMsgStatus OvrAnimComponent::OnEvent_Impl( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr, VRMenuObject * self, VRMenuEvent const & event )
{
switch ( event.EventType )
{
case VRMENU_EVENT_FRAME_UPDATE:
return Frame( app, vrFrame, menuMgr, self, event );
default:
OVR_ASSERT( !"Event flags mismatch!" ); // the constructor is specifying a flag that's not handled
return MSG_STATUS_ALIVE;
}
}
示例3: return
unsigned char FrameLatencyTracker::GetNextDrawColor()
{
if (!TrackerEnabled || (WaitMode == SampleWait_Zeroes) ||
(FrameIndex >= FramesTracked))
{
return (unsigned char)Util::FrameTimeRecord::ReadbackIndexToColor(0);
}
OVR_ASSERT(FrameIndex < FramesTracked);
return (unsigned char)Util::FrameTimeRecord::ReadbackIndexToColor(FrameIndex+1);
}
示例4: switch
//==============================
// OvrSurfaceToggleComponent::OnEvent_Impl
eMsgStatus OvrSurfaceToggleComponent::OnEvent_Impl( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr,
VRMenuObject * self, VRMenuEvent const & event )
{
switch ( event.EventType )
{
case VRMENU_EVENT_FRAME_UPDATE:
return Frame( app, vrFrame, menuMgr, self, event );
default:
OVR_ASSERT( !"Event flags mismatch!" );
return MSG_STATUS_ALIVE;
}
}
示例5: QueryPerformanceCounter
double PerformanceTimer::GetTimeSecondsDouble()
{
if (UsingVistaOrLater)
{
LARGE_INTEGER li;
QueryPerformanceCounter(&li);
OVR_ASSERT(PerfFrequencyInverse != 0);
return (li.QuadPart * PerfFrequencyInverse);
}
return (GetTimeNanos() * .0000000001);
}
示例6: OVR_UNUSED
//-----------------------------------------------------------------------------
void HIDDevice::closeDevice(bool wasUnplugged)
{
OVR_UNUSED(wasUnplugged);
OVR_ASSERT(DeviceHandle >= 0);
HIDManager->DevManager->pThread->RemoveSelectFd(this,-1);
hid_close(DeviceHandle);
DeviceHandle = NULL;
LogText("OVR::Linux::HIDDevice - HID Device Closed '%s'\n", DevDesc.Path.ToCStr());
}
示例7: OVR_DEBUG_LOG
void RefCountNTSImplCore::checkInvalidDelete(RefCountNTSImplCore *pmem)
{
#ifdef OVR_BUILD_DEBUG
if (pmem->RefCount != 0)
{
OVR_DEBUG_LOG( ("Invalid delete call on ref-counted object at %p. Please use Release()", pmem) );
OVR_ASSERT(0);
}
#else
OVR_UNUSED( pmem );
#endif
}
示例8: VersionCheckInitOnceCallback
BOOL CALLBACK VersionCheckInitOnceCallback(PINIT_ONCE, PVOID, PVOID*)
{
typedef NTSTATUS(WINAPI * pfnRtlGetVersion)(PRTL_OSVERSIONINFOEXW lpVersionInformation);
NTSTATUS status = STATUS_DLL_NOT_FOUND;
HMODULE hNTDll = LoadLibraryW(L"ntdll.dll");
OVR_ASSERT(hNTDll);
if (hNTDll)
{
status = STATUS_ENTRYPOINT_NOT_FOUND;
pfnRtlGetVersion pRtlGetVersion = (pfnRtlGetVersion)GetProcAddress(hNTDll, "RtlGetVersion");
OVR_ASSERT(pRtlGetVersion);
if (pRtlGetVersion)
{
RTL_OSVERSIONINFOEXW OSVersionInfoEx;
OSVersionInfoEx.dwOSVersionInfoSize = sizeof(OSVersionInfoEx);
status = pRtlGetVersion(&OSVersionInfoEx);
OVR_ASSERT(status == 0);
if (status == 0)
{
OSVersion = OSVersionInfoEx.dwMajorVersion * 100 + OSVersionInfoEx.dwMinorVersion;
OSBuildNumber = OSVersionInfoEx.dwBuildNumber;
}
}
FreeLibrary(hNTDll);
}
if (status != 0)
{
LogError("[VersionCheckInitOnceCallback] Failed to obtain OS version information. 0x%08x\n", status);
}
return (status == 0);
}
示例9: UIDiscreteSliderComponent
void UIDiscreteSlider::AddCells( unsigned int maxValue, unsigned int startValue, float cellSpacing )
{
MaxValue = maxValue;
StartValue = startValue;
DiscreteSliderComponent = new UIDiscreteSliderComponent( *this, StartValue );
OVR_ASSERT( DiscreteSliderComponent );
AddComponent( DiscreteSliderComponent );
float cellOffset = 0.0f;
const float pixelCellSpacing = cellSpacing * VRMenuObject::DEFAULT_TEXEL_SCALE;
VRMenuFontParms fontParms( HORIZONTAL_CENTER, VERTICAL_CENTER, false, false, false, 1.0f );
Vector3f defaultScale( 1.0f );
for ( unsigned int cellIndex = 0; cellIndex <= MaxValue; ++cellIndex )
{
const Posef pose( Quatf( Vector3f( 0.0f, 1.0f, 0.0f ), 0.0f ),
Vector3f( cellOffset, 0.f, 0.0f ) );
cellOffset += pixelCellSpacing;
VRMenuObjectParms cellParms( VRMENU_BUTTON, Array< VRMenuComponent* >(), VRMenuSurfaceParms(),
"", pose, defaultScale, fontParms, Menu->AllocId(),
VRMenuObjectFlags_t(), VRMenuObjectInitFlags_t( VRMENUOBJECT_INIT_FORCE_POSITION ) );
UICell * cellObject = new UICell( GuiSys );
cellObject->AddToDiscreteSlider( Menu, this, cellParms );
cellObject->SetImage( 0, SURFACE_TEXTURE_DIFFUSE, CellOffTexture );
UICellComponent * cellComp = new UICellComponent( *DiscreteSliderComponent, cellIndex );
VRMenuObject * object = cellObject->GetMenuObject();
OVR_ASSERT( object );
object->AddComponent( cellComp );
DiscreteSliderComponent->AddCell( cellObject );
}
DiscreteSliderComponent->HighlightCells( StartValue );
}
示例10: IsDebugMessage
void Log::DefaultLogOutput(const char* formattedText, LogMessageType messageType, int bufferSize)
{
bool debug = IsDebugMessage(messageType);
OVR_UNUSED(bufferSize);
#if defined(OVR_OS_WIN32)
// Under Win32, output regular messages to console if it exists; debug window otherwise.
static DWORD dummyMode;
static bool hasConsole = (GetStdHandle(STD_OUTPUT_HANDLE) != INVALID_HANDLE_VALUE) &&
(GetConsoleMode(GetStdHandle(STD_OUTPUT_HANDLE), &dummyMode));
if (!hasConsole || debug)
{
::OutputDebugStringA(formattedText);
}
fputs(formattedText, stdout);
#elif defined(OVR_OS_MS) // Any other Microsoft OSs
::OutputDebugStringA(formattedText);
#elif defined(OVR_OS_ANDROID)
// To do: use bufferSize to deal with the case that Android has a limited output length.
__android_log_write(ANDROID_LOG_INFO, "OVR", formattedText);
#else
fputs(formattedText, stdout);
#endif
if (messageType == Log_Error)
{
#if defined(OVR_OS_WIN32)
if (!ReportEventA(hEventSource, EVENTLOG_ERROR_TYPE, 0, 0, NULL, 1, 0, &formattedText, NULL))
{
OVR_ASSERT(false);
}
#elif defined(OVR_OS_MS) // Any other Microsoft OSs
// TBD
#elif defined(OVR_OS_ANDROID)
// TBD
#elif defined(OVR_OS_MAC) || defined(OVR_OS_LINUX)
syslog(LOG_ERR, "%s", formattedText);
#else
// TBD
#endif
}
// Just in case.
OVR_UNUSED2(formattedText, debug);
}
示例11: getFrequency
void PerformanceTimer::Initialize()
{
::InitializeCriticalSection(&TimeCS);
MMTimeWrapCounter = 0;
getFrequency();
#if defined(OVR_OS_WIN32) // Desktop Windows only
// Set Vista flag. On Vista, we can just use QPC() without all the extra work
OSVERSIONINFOEXW ver;
ZeroMemory(&ver, sizeof(OSVERSIONINFOEXW));
ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEXW);
ver.dwMajorVersion = 6; // Vista+
DWORDLONG condMask = 0;
VER_SET_CONDITION(condMask, VER_MAJORVERSION, VER_GREATER_EQUAL);
// VerifyVersionInfo returns true if the OS meets the conditions set above
UsingVistaOrLater = ::VerifyVersionInfoW(&ver, VER_MAJORVERSION, condMask) != 0;
#else
UsingVistaOrLater = true;
#endif
if (!UsingVistaOrLater)
{
#if defined(OVR_OS_WIN32) // Desktop Windows only
// The following has the effect of setting the NT timer resolution (NtSetTimerResolution) to 1 millisecond.
MMRESULT mmr = timeBeginPeriod(1);
OVR_ASSERT(TIMERR_NOERROR == mmr);
OVR_UNUSED(mmr);
#endif
#if defined(OVR_BUILD_DEBUG) && defined(OVR_OS_WIN32)
HMODULE hNtDll = ::LoadLibraryW(L"NtDll.dll");
if (hNtDll)
{
pNtQueryTimerResolution = (NtQueryTimerResolutionType)::GetProcAddress(hNtDll, "NtQueryTimerResolution");
//pNtSetTimerResolution = (NtSetTimerResolutionType)::GetProcAddress(hNtDll, "NtSetTimerResolution");
if (pNtQueryTimerResolution)
{
ULONG MinimumResolution; // in 100-ns units
ULONG MaximumResolution;
ULONG ActualResolution;
pNtQueryTimerResolution(&MinimumResolution, &MaximumResolution, &ActualResolution);
OVR_DEBUG_LOG(("NtQueryTimerResolution = Min %ld us, Max %ld us, Current %ld us", MinimumResolution / 10, MaximumResolution / 10, ActualResolution / 10));
}
::FreeLibrary(hNtDll);
}
#endif
}
}
示例12: OVR_ASSERT
RenderDevice* PlatformCore::SetupGraphics(const SetupGraphicsDeviceSet& setupGraphicsDesc,
const char* type, const Render::RendererParams& rp)
{
const SetupGraphicsDeviceSet* setupDesc = setupGraphicsDesc.PickSetupDevice(type);
OVR_ASSERT(setupDesc);
pRender = *setupDesc->pCreateDevice(rp, (void*)hWnd);
if (pRender)
pRender->SetWindowSize(Width, Height);
::ShowWindow(hWnd, SW_RESTORE);
return pRender.GetPtr();
}
示例13: defined
void PerformanceTimer::Shutdown()
{
::DeleteCriticalSection(&TimeCS);
if (!UsingVistaOrLater)
{
#if defined(OVR_OS_WIN32) // Desktop Windows only
MMRESULT mmr = timeEndPeriod(1);
OVR_ASSERT(TIMERR_NOERROR == mmr);
OVR_UNUSED(mmr);
#endif
}
}
示例14: GetSize
// Append a string
void StringBuffer::AppendString(const wchar_t* pstr, intptr_t len)
{
if (!pstr || !len)
return;
intptr_t srcSize = UTF8Util::GetEncodeStringSize(pstr, len);
size_t origSize = GetSize();
size_t size = srcSize + origSize;
Resize(size);
OVR_ASSERT(pData != NULL);
UTF8Util::EncodeString(pData + origSize, pstr, len);
}
示例15: switch
//==============================
// OvrScrollBarComponent::OnEvent_Impl
eMsgStatus OvrScrollBarComponent::OnEvent_Impl( OvrGuiSys & guiSys, VrFrame const & vrFrame,
VRMenuObject * self, VRMenuEvent const & event )
{
switch ( event.EventType )
{
case VRMENU_EVENT_FRAME_UPDATE:
return OnFrameUpdate( guiSys, vrFrame, self, event );
default:
OVR_ASSERT( false );
break;
}
return MSG_STATUS_ALIVE;
}