本文整理汇总了C++中OVR_DEBUG_LOG函数的典型用法代码示例。如果您正苦于以下问题:C++ OVR_DEBUG_LOG函数的具体用法?C++ OVR_DEBUG_LOG怎么用?C++ OVR_DEBUG_LOG使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了OVR_DEBUG_LOG函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: OVR_DEBUG_LOG
HMDState* HMDState::CreateHMDState(NetClient* client, const HMDNetworkInfo& netInfo)
{
// HMDState works through a handle to service HMD....
HMDInfo hinfo;
if (!client->Hmd_GetHmdInfo(netInfo.NetId, &hinfo))
{
OVR_DEBUG_LOG(("[HMDState] Unable to get HMD info"));
return nullptr;
}
#if !defined(HEADLESS_APP)
#ifdef OVR_OS_WIN32
OVR_DEBUG_LOG(("[HMDState] Setting up display shim"));
// Initialize the display shim before reporting the display to the user code
// so that this will happen before the D3D display object is created.
Win32::DisplayShim::GetInstance().Update(&hinfo.ShimInfo);
#endif
#endif /* !defined(HEADLESS_APP) */
Ptr<Profile> pDefaultProfile = *ProfileManager::GetInstance()->GetDefaultUserProfile(&hinfo);
OVR_DEBUG_LOG(("[HMDState] Using profile %s", pDefaultProfile->GetValue(OVR_KEY_USER)));
HMDState* hmds = new HMDState(hinfo, pDefaultProfile, &netInfo, client);
if (!hmds->InitializeSharedState())
{
delete hmds;
return nullptr;
}
return hmds;
}
开发者ID:JogAmp,项目名称:oculusvr-sdk,代码行数:33,代码来源:CAPI_HMDState.cpp
示例2: OVR_DEBUG_LOG
HMDState* HMDState::CreateHMDState(NetClient* client, const HMDNetworkInfo& netInfo)
{
// HMDState works through a handle to service HMD....
HMDInfo hinfo;
if (!client->Hmd_GetHmdInfo(netInfo.NetId, &hinfo))
{
OVR_DEBUG_LOG(("[HMDState] Unable to get HMD info"));
return NULL;
}
#ifdef OVR_OS_WIN32
OVR_DEBUG_LOG(("Setting up display shim"));
// Initialize the display shim before reporting the display to the user code
// so that this will happen before the D3D display object is created.
Win32::DisplayShim::GetInstance().Update(&hinfo.ShimInfo);
#endif
Ptr<Profile> pDefaultProfile = *ProfileManager::GetInstance()->GetDefaultUserProfile(&hinfo);
OVR_DEBUG_LOG(("Using profile %s", pDefaultProfile->GetValue(OVR_KEY_USER)));
HMDState* hmds = new HMDState(netInfo, hinfo, pDefaultProfile, client);
if (!hmds->SharedStateReader.Open(netInfo.SharedMemoryName.ToCStr()))
{
delete hmds;
return NULL;
}
hmds->TheSensorStateReader.SetUpdater(hmds->SharedStateReader.Get());
hmds->TheLatencyTestStateReader.SetUpdater(hmds->SharedStateReader.Get());
return hmds;
}
开发者ID:ArthurTorrente,项目名称:4A_Anim_Numerique_Genetic_Algorithm,代码行数:34,代码来源:CAPI_HMDState.cpp
示例3: STR1
void OculusWorldDemoApp::InitMainFilePath()
{
// We try alternative relative locations for the file.
const String contentBase = pPlatform->GetContentDirectory() + "/" + WORLDDEMO_ASSET_PATH;
const char* baseDirectories[] = { "",
contentBase.ToCStr(),
#ifdef SHRDIR
#define STR1(x) #x
#define STR(x) STR1(x)
STR(SHRDIR) "/OculusWorldDemo/Assets/Tuscany/"
#endif
};
String newPath;
for(size_t i = 0; i < OVR_ARRAY_COUNT(baseDirectories); ++i)
{
newPath = baseDirectories[i];
newPath += WORLDDEMO_ASSET_FILE;
OVR_DEBUG_LOG(("Trying to load the scene at: %s...", newPath.ToCStr()));
if (SysFile(newPath).IsValid())
{
OVR_DEBUG_LOG(("Success loading %s", newPath.ToCStr()));
MainFilePath = newPath;
return;
}
}
OVR_DEBUG_LOG(("Unable to find any version of %s. Do you have your working directory set right?", WORLDDEMO_ASSET_FILE));
}
开发者ID:Interaptix,项目名称:OvrvisionPro,代码行数:31,代码来源:OculusWorldDemo_Scene.cpp
示例4: defined
void PerformanceTimer::Initialize()
{
#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
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
OSVERSIONINFOEX ver;
ZeroMemory(&ver, sizeof(OSVERSIONINFOEX));
ver.dwOSVersionInfoSize = sizeof(OSVERSIONINFOEX);
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 = VerifyVersionInfo(&ver, VER_MAJORVERSION, condMask) != 0;
#else
UsingVistaOrLater = true;
#endif
OVR_DEBUG_LOG(("PerformanceTimer UsingVistaOrLater = %d", (int)UsingVistaOrLater));
#if defined(OVR_BUILD_DEBUG) && defined(OVR_OS_WIN32)
HMODULE hNtDll = LoadLibrary(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:Michaelangel007,项目名称:openclamdrenderer,代码行数:51,代码来源:OVR_Timer.cpp
示例5: hid_get_feature_report
//-----------------------------------------------------------------------------
bool HIDDevice::GetFeatureReport(UByte* data, UInt32 length)
{
if (DeviceHandle < 0)
return false;
int skipped_report_id = 0;
int report_number = data[0];
if (report_number == 0x0) {
/* Offset the return buffer by 1, so that the report ID
will remain in byte 0. */
data++;
length--;
skipped_report_id = 1;
}
int r = hid_get_feature_report(DeviceHandle, data, length);
// int r = ioctl(DeviceHandle, HIDIOCGFEATURE(length), data);
if(r < 0)
{
OVR_DEBUG_LOG(("Error in LibOVR GetFeatureReport: %s",strerror(errno)));
}
return (r >= 0);
}
开发者ID:sebjf,项目名称:OculusSDK_0.3.2_CentOS,代码行数:27,代码来源:OVR_Linux_HIDDevice.cpp
示例6: Reset
bool SensorFusion::AttachToSensor(SensorDevice* sensor)
{
if (sensor != NULL)
{
MessageHandler* pCurrentHandler = sensor->GetMessageHandler();
if (pCurrentHandler == &Handler)
{
Reset();
return true;
}
if (pCurrentHandler != NULL)
{
OVR_DEBUG_LOG(
("SensorFusion::AttachToSensor failed - sensor %p already has handler", sensor));
return false;
}
}
if (Handler.IsHandlerInstalled())
{
Handler.RemoveHandlerFromDevices();
}
if (sensor != NULL)
{
sensor->SetMessageHandler(&Handler);
}
Reset();
return true;
}
开发者ID:UofMBIomedEng,项目名称:Kinetica_Occulus,代码行数:34,代码来源:OVR_SensorFusion.cpp
示例7: OVR_DEBUG_LOG
bool LatencyTest::SetDevice(LatencyTestDevice* device)
{
if (device != Device)
{
if (device != NULL)
{
if (device->GetMessageHandler() != NULL)
{
OVR_DEBUG_LOG(
("LatencyTest::AttachToDevice failed - device %p already has handler", device));
return false;
}
}
if (Device != NULL)
{
Device->SetMessageHandler(0);
}
Device = device;
if (Device != NULL)
{
Device->SetMessageHandler(&Handler);
// Set trigger threshold.
LatencyTestConfiguration configuration(SENSOR_DETECT_THRESHOLD, false); // No samples streaming.
Device->SetConfiguration(configuration, true);
}
}
return true;
}
开发者ID:ReallyRad,项目名称:ofxOculusRift,代码行数:33,代码来源:Util_LatencyTest.cpp
示例8: OVR_DEBUG_LOG
bool Thread::Start(ThreadState initialState)
{
if (initialState == NotRunning)
return 0;
if (GetThreadState() != NotRunning)
{
OVR_DEBUG_LOG(("Thread::Start failed - thread %p already running", this));
return 0;
}
// Free old thread handle before creating the new one
CleanupSystemThread();
ExitCode = NULL;
ThreadFlags = (initialState == Running) ? OVR_THREAD_STARTED : OVR_THREAD_START_SUSPENDED;
ThreadHandle = (HANDLE) _beginthreadex(0, (unsigned)StackSize,
Thread_Win32StartFn, this, 0, (unsigned*)&IdValue);
// Failed? Fail the function
if (ThreadHandle == 0)
{
ThreadFlags = 0;
return 0;
}
return 1;
}
开发者ID:8BitRick,项目名称:GearVRNative,代码行数:26,代码来源:OVR_ThreadsWinAPI.cpp
示例9: defined
// Initializes System core, installing allocator.
void System::Init()
{
#if defined(_MSC_VER)
// Make it so that failure of the C malloc family of functions results in the same behavior as C++ operator new failure.
// This allows us to throw exceptions for malloc usage the same as for operator new bad_alloc.
_set_new_mode(1);
// Tells the standard library to direct new (and malloc) failures to us. Normally we wouldn't need to do this, as the
// C++ Standard Library already throws std::bad_alloc on operator new failure. The problem is that the Standard Library doesn't
// throw std::bad_alloc upon malloc failure, and we can only intercept malloc failure via this means. _set_new_handler specifies
// a global handler for the current running Standard Library. If the Standard Library is being dynamically linked instead
// of statically linked, then this is a problem because a call to _set_new_handler would override anything the application
// has already set.
_set_new_handler(OVRNewFailureHandler);
#else
// This allows us to throw OVR::bad_alloc instead of std::bad_alloc, which provides less information.
// Question: Does this set the handler for all threads or just the current thread? The C++ Standard doesn't
// explicitly state this, though it may be implied from other parts of the Standard.
std::set_new_handler(OVRNewFailureHandler);
#endif
if (++System_Init_Count == 1)
{
Timer::initializeTimerSystem();
}
else
{
OVR_DEBUG_LOG(("[System] Init recursively called; depth = %d", System_Init_Count));
}
}
开发者ID:PLUSToolkit,项目名称:OvrvisionPro,代码行数:31,代码来源:OVR_System.cpp
示例10: memset
bool HIDDevice::openDevice()
{
memset(&ReadOverlapped, 0, sizeof(OVERLAPPED));
Device = HIDManager->CreateHIDFile(DevDesc.Path.ToCStr());
if (Device == INVALID_HANDLE_VALUE)
{
OVR_DEBUG_LOG(("Failed 'CreateHIDFile' while opening device, error = 0x%X.",
::GetLastError()));
Device = 0;
return false;
}
if (!HIDManager->HidD_SetNumInputBuffers(Device, 128))
{
OVR_ASSERT_LOG(false, ("Failed 'HidD_SetNumInputBuffers' while initializing device."));
::CloseHandle(Device);
Device = 0;
return false;
}
// Create a manual-reset non-signaled event.
ReadOverlapped.hEvent = ::CreateEvent(0, TRUE, FALSE, 0);
if (!ReadOverlapped.hEvent)
{
OVR_ASSERT_LOG(false, ("Failed to create event."));
::CloseHandle(Device);
Device = 0;
return false;
}
if (!initInfo())
{
OVR_ASSERT_LOG(false, ("Failed to get HIDDevice info."));
::CloseHandle(ReadOverlapped.hEvent);
memset(&ReadOverlapped, 0, sizeof(OVERLAPPED));
::CloseHandle(Device);
Device = 0;
return false;
}
if (!initializeRead())
{
OVR_ASSERT_LOG(false, ("Failed to get intialize read for HIDDevice."));
::CloseHandle(ReadOverlapped.hEvent);
memset(&ReadOverlapped, 0, sizeof(OVERLAPPED));
::CloseHandle(Device);
Device = 0;
return false;
}
return true;
}
开发者ID:josephwinston,项目名称:minko,代码行数:59,代码来源:OVR_Win32_HIDDevice.cpp
示例11: SetThreadName
int DeviceManagerThread::Run()
{
ThreadCommand::PopBuffer command;
SetThreadName("OVR::DeviceManagerThread");
LogText("OVR::DeviceManagerThread - running (ThreadId=%p).\n", GetThreadId());
while(!IsExiting())
{
// PopCommand will reset event on empty queue.
if (PopCommand(&command))
{
command.Execute();
}
else
{
bool commands = 0;
do
{
int n = poll(&PollFds[0], PollFds.GetSize(), -1);
for (int i = 0; i < PollFds.GetSize(); i++)
{
if (PollFds[i].revents & POLLERR)
{
OVR_DEBUG_LOG(("poll: error on [%d]: %d", i, PollFds[i].fd));
}
else if (PollFds[i].revents & POLLIN)
{
if (FdNotifiers[i])
FdNotifiers[i]->OnEvent(i, PollFds[i].fd);
else if (i == 0) // command
{
char dummy[128];
read(PollFds[i].fd, dummy, 128);
commands = 1;
}
}
if (PollFds[i].revents & POLLHUP)
PollFds[i].events = 0;
if (PollFds[i].revents != 0)
{
n--;
if (n == 0)
break;
}
}
} while (PollFds.GetSize() > 0 && !commands);
}
}
LogText("OVR::DeviceManagerThread - exiting (ThreadId=%p).\n", GetThreadId());
return 0;
}
开发者ID:BigRobCoder,项目名称:ohmd-plugin,代码行数:57,代码来源:OVR_Linux_DeviceManager.cpp
示例12: defined
bool HSWDisplay::Initialize(const ovrRenderAPIConfig* apiConfig)
{
const ovrGLConfig* config = (const ovrGLConfig*)apiConfig;
if(config)
{
// The following is essentially copied from CAPI_GL_DistortionRender.cpp's
// Initialize function. To do: Merge this to a central location.
RenderParams.Multisample = config->OGL.Header.Multisample;
RenderParams.RTSize = config->OGL.Header.RTSize;
#if defined(OVR_OS_WIN32)
RenderParams.Window = (config->OGL.Window) ? config->OGL.Window : GetActiveWindow();
RenderParams.DC = config->OGL.DC;
#elif defined(OVR_OS_LINUX)
if (config->OGL.Disp)
RenderParams.Disp = config->OGL.Disp;
if (!RenderParams.Disp)
RenderParams.Disp = XOpenDisplay(NULL);
if (!RenderParams.Disp)
{
OVR_DEBUG_LOG(("XOpenDisplay failed."));
return false;
}
if (config->OGL.Win)
RenderParams.Win= config->OGL.Win;
if (!RenderParams.Win)
RenderParams.Win = glXGetCurrentDrawable();
if (!RenderParams.Win)
{
OVR_DEBUG_LOG(("XGetInputFocus failed."));
return false;
}
#endif
}
else
{
UnloadGraphics();
}
return true;
}
开发者ID:Michaelangel007,项目名称:openclamdrenderer,代码行数:44,代码来源:CAPI_GL_HSWDisplay.cpp
示例13: 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
示例14: OVR_DEBUG_LOG
// Initializes System core, installing allocator.
void System::Init(Log* log, Allocator *palloc)
{
if (!Allocator::GetInstance())
{
Log::SetGlobalLog(log);
Allocator::setInstance(palloc);
}
else
{
OVR_DEBUG_LOG(("[System] Init failed - duplicate call."));
}
}
开发者ID:ejeinc,项目名称:Meganekko,代码行数:13,代码来源:OVR_System.cpp
示例15: clock_gettime
UInt64 Timer::GetTicksNanos()
{
// Choreographer vsync timestamp is based on.
struct timespec tp;
const int status = clock_gettime(CLOCK_MONOTONIC, &tp);
if (status != 0)
{
OVR_DEBUG_LOG(("clock_gettime status=%i", status ));
}
const UInt64 result = (UInt64)tp.tv_sec * (UInt64)(1000 * 1000 * 1000) + UInt64(tp.tv_nsec);
return result;
}
开发者ID:1107979819,项目名称:OculusVRStudy,代码行数:13,代码来源:OVR_Timer.cpp
示例16: OVR_DEBUG_LOG
void LatencyTest::BeginTest()
{
if (State == State_WaitingForButton)
{
// Set color to black and wait a while.
RenderColor = CALIBRATE_BLACK;
State = State_WaitingForSettlePreCalibrationColorBlack;
OVR_DEBUG_LOG(("State_WaitingForButton -> State_WaitingForSettlePreCalibrationColorBlack."));
setTimer(TIME_TO_WAIT_FOR_SETTLE_PRE_CALIBRATION);
}
}
开发者ID:imclab,项目名称:max_oculus,代码行数:13,代码来源:Util_LatencyTest.cpp
示例17: Thread_Win32StartFn
// The actual first function called on thread start
unsigned WINAPI Thread_Win32StartFn(void * phandle)
{
Thread * pthread = (Thread*)phandle;
if (pthread->Processor != -1)
{
DWORD_PTR ret = SetThreadAffinityMask(GetCurrentThread(), (DWORD)pthread->Processor);
if (ret == 0)
OVR_DEBUG_LOG(("Could not set hardware processor for the thread"));
}
BOOL ret = ::SetThreadPriority(GetCurrentThread(), Thread::GetOSPriority(pthread->Priority));
if (ret == 0)
OVR_DEBUG_LOG(("Could not set thread priority"));
OVR_UNUSED(ret);
// Ensure that ThreadId is assigned once thread is running, in case
// beginthread hasn't filled it in yet.
pthread->IdValue = (ThreadId)::GetCurrentThreadId();
pthread->PRun();
// Signal the thread as done and release it atomically.
pthread->Finish();
return 0;
}
开发者ID:8BitRick,项目名称:GearVRNative,代码行数:24,代码来源:OVR_ThreadsWinAPI.cpp
示例18: SelectSensorRampValue
UInt16 SelectSensorRampValue(const UInt16* ramp, unsigned count,
float val, float factor, const char* label)
{
UInt16 threshold = (UInt16)(val * factor);
for (unsigned i = 0; i<count; i++)
{
if (ramp[i] >= threshold)
return ramp[i];
}
OVR_DEBUG_LOG(("SensorDevice::SetRange - %s clamped to %0.4f",
label, float(ramp[count-1]) / factor));
OVR_UNUSED2(factor, label);
return ramp[count-1];
}
开发者ID:e1e8,项目名称:max_oculus,代码行数:15,代码来源:OVR_SensorImpl_Common.cpp
示例19: OVR_DEBUG_LOG
HWND RenderFocusReader::ReadActiveWindow()
{
FocusState = Reader.Get();
if (!FocusState || NoSharedMemory)
{
if (!Reader.Open(OVR_FOCUS_OBSERVER_SHARE_NAME))
{
OVR_DEBUG_LOG(("[Win32ShimFunctions] Unable to open the shared memory space"));
// Note: This should only warn and not assert because it is normal behavior when the server is not running.
NoSharedMemory = true;
return 0;
}
FocusState = Reader.Get();
if (!FocusState)
{
OVR_DEBUG_LOG(("[Win32ShimFunctions] Unable to get the shared memory space"));
NoSharedMemory = true;
return 0;
}
}
return (HWND)Ptr64ToPtr(FocusState->ActiveWindowHandle);
}
开发者ID:GEMISIS,项目名称:Project-Virtua-Demos,代码行数:24,代码来源:OVR_Win32_FocusReader.cpp
示例20: DirectDisplayInitialize
// Initializes System core, installing allocator.
void System::Init(Log* log, Allocator *palloc)
{
if (!Allocator::GetInstance())
{
Log::SetGlobalLog(log);
Timer::initializeTimerSystem();
Allocator::setInstance(palloc);
Display::Initialize();
DirectDisplayInitialize();
}
else
{
OVR_DEBUG_LOG(("System::Init failed - duplicate call."));
}
}
开发者ID:geekmaster,项目名称:ShaderToyVR,代码行数:16,代码来源:OVR_System.cpp
注:本文中的OVR_DEBUG_LOG函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论