本文整理汇总了C++中OVR_ASSERT函数的典型用法代码示例。如果您正苦于以下问题:C++ OVR_ASSERT函数的具体用法?C++ OVR_ASSERT怎么用?C++ OVR_ASSERT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OVR_ASSERT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:Circular-Studios,项目名称:Oculus-D-Rift,代码行数:11,代码来源:OVR_String.cpp
示例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;
}
}
开发者ID:1107979819,项目名称:OculusVRStudy,代码行数:11,代码来源:AnimComponents.cpp
示例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);
}
开发者ID:ReallyRad,项目名称:ofxOculusDK2,代码行数:11,代码来源:CAPI_FrameTimeManager.cpp
示例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;
}
}
开发者ID:mec0825,项目名称:VRLib,代码行数:14,代码来源:DefaultComponent.cpp
示例5: QueryPerformanceCounter
double PerformanceTimer::GetTimeSecondsDouble()
{
if (UsingVistaOrLater)
{
LARGE_INTEGER li;
QueryPerformanceCounter(&li);
OVR_ASSERT(PerfFrequencyInverse != 0);
return (li.QuadPart * PerfFrequencyInverse);
}
return (GetTimeNanos() * .0000000001);
}
开发者ID:Michaelangel007,项目名称:openclamdrenderer,代码行数:12,代码来源:OVR_Timer.cpp
示例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());
}
开发者ID:sebjf,项目名称:OculusSDK_0.3.2_CentOS,代码行数:13,代码来源:OVR_Linux_HIDDevice.cpp
示例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
}
开发者ID:ejeinc,项目名称:Meganekko,代码行数:12,代码来源:OVR_RefCount.cpp
示例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);
}
开发者ID:Interaptix,项目名称:OvrvisionPro,代码行数:40,代码来源:Util_SystemInfo.cpp
示例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 );
}
开发者ID:8BitRick,项目名称:GearVRNative,代码行数:40,代码来源:UIDiscreteSlider.cpp
示例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);
}
开发者ID:h3ll5ur7er,项目名称:SLProject,代码行数:52,代码来源:OVR_Log.cpp
示例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
}
}
开发者ID:Interaptix,项目名称:OvrvisionPro,代码行数:52,代码来源:OVR_Timer.cpp
示例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();
}
开发者ID:markrileybot,项目名称:OculusSDK,代码行数:13,代码来源:Win32_Platform.cpp
示例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
}
}
开发者ID:Interaptix,项目名称:OvrvisionPro,代码行数:13,代码来源:OVR_Timer.cpp
示例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);
}
开发者ID:Michaelangel007,项目名称:openclamdrenderer,代码行数:14,代码来源:OVR_String.cpp
示例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;
}
开发者ID:8BitRick,项目名称:GearVRNative,代码行数:15,代码来源:ScrollBarComponent.cpp
示例16: switch
//==============================
// OvrScrollBarComponent::OnEvent_Impl
eMsgStatus OvrScrollBarComponent::OnEvent_Impl( App * app, VrFrame const & vrFrame, OvrVRMenuMgr & menuMgr,
VRMenuObject * self, VRMenuEvent const & event )
{
switch ( event.EventType )
{
case VRMENU_EVENT_FRAME_UPDATE:
return OnFrameUpdate( app, vrFrame, menuMgr, self, event );
default:
OVR_ASSERT( false );
return MSG_STATUS_ALIVE;
}
return MSG_STATUS_CONSUMED;
}
开发者ID:beijingkaka,项目名称:shellspace,代码行数:15,代码来源:ScrollBarComponent.cpp
示例17: roundUpSize
// Allocates a state block of specified size and advances pointers,
// returning 0 if buffer is full.
UByte* CircularBuffer::Write(UPInt size)
{
UByte* p = 0;
size = roundUpSize(size);
// Since this is circular buffer, always allow at least one item.
OVR_ASSERT(size < Size/2);
if (Head >= Tail)
{
OVR_ASSERT(End == 0);
if (size <= (Size - Head))
{
p = pBuffer + Head;
Head += size;
}
else if (size < Tail)
{
p = pBuffer;
End = Head;
Head = size;
OVR_ASSERT(Head != Tail);
}
}
else
{
OVR_ASSERT(End != 0);
if ((Tail - Head) > size)
{
p = pBuffer + Head;
Head += size;
OVR_ASSERT(Head != Tail);
}
}
return p;
}
开发者ID:1107979819,项目名称:OculusVRStudy,代码行数:41,代码来源:OVR_ThreadCommandQueue.cpp
示例18: OVR_ASSERT
void ovrJobThread::Init( int const threadNum )
{
OVR_ASSERT( JobManager != nullptr );
OVR_ASSERT( MyThread == nullptr );
size_t const stackSize = 128 * 1024;
int const processorAffinity = -1;
OVR::Thread::ThreadState initialState = OVR::Thread::Running;
OVR_ASSERT( Jni == nullptr ); // this will be attached when the thread executes
Thread::CreateParams createParams(
ovrJobThread::Fn,
this,
stackSize,
processorAffinity,
initialState,
Thread::IdlePriority );
//MyThread = new OVR::Thread( ovrJobThread::Fn, this, stackSize, processorAffinity, initialState );
MyThread = new OVR::Thread( createParams );
}
开发者ID:ejeinc,项目名称:Meganekko,代码行数:22,代码来源:JobManager.cpp
示例19: OVR_ASSERT
bool DeviceManagerThread::AddSelectFd(Notifier* notify, int fd)
{
struct pollfd pfd;
pfd.fd = fd;
pfd.events = POLLIN|POLLHUP|POLLERR;
pfd.revents = 0;
FdNotifiers.PushBack(notify);
PollFds.PushBack(pfd);
OVR_ASSERT(FdNotifiers.GetSize() == PollFds.GetSize());
return true;
}
开发者ID:Enerccio,项目名称:Jift,代码行数:13,代码来源:OVR_Linux_DeviceManager.cpp
示例20: OVR_ASSERT
DeviceManagerImpl::~DeviceManagerImpl()
{
// Shutdown must've been called.
OVR_ASSERT(!pCreateDesc->pDevice);
// Remove all factories
while(!Factories.IsEmpty())
{
DeviceFactory* factory = Factories.GetFirst();
factory->RemovedFromManager();
factory->RemoveNode();
}
}
开发者ID:UofMBIomedEng,项目名称:Kinetica_Occulus,代码行数:13,代码来源:OVR_DeviceImpl.cpp
注:本文中的OVR_ASSERT函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论