oculus1

diff libovr/Src/Kernel/OVR_System.h @ 1:e2f9e4603129

added LibOVR and started a simple vr wrapper.
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 14 Sep 2013 16:14:59 +0300
parents
children b069a5c27388
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/libovr/Src/Kernel/OVR_System.h	Sat Sep 14 16:14:59 2013 +0300
     1.3 @@ -0,0 +1,1 @@
     1.4 +/************************************************************************************
     1.5 
     1.6 PublicHeader:   OVR
     1.7 Filename    :   OVR_System.h
     1.8 Content     :   General kernel initialization/cleanup, including that
     1.9                 of the memory allocator.
    1.10 Created     :   September 19, 2012
    1.11 Notes       : 
    1.12 
    1.13 Copyright   :   Copyright 2012 Oculus VR, Inc. All Rights reserved.
    1.14 
    1.15 Use of this software is subject to the terms of the Oculus license
    1.16 agreement provided at the time of installation or download, or which
    1.17 otherwise accompanies this software in either electronic or hard copy form.
    1.18 
    1.19 ************************************************************************************/
    1.20 
    1.21 #ifndef OVR_System_h
    1.22 #define OVR_System_h
    1.23 
    1.24 #include "OVR_Allocator.h"
    1.25 #include "OVR_Log.h"
    1.26 
    1.27 namespace OVR {
    1.28 
    1.29 // ***** System Core Initialization class
    1.30 
    1.31 // System initialization must take place before any other OVR_Kernel objects are used;
    1.32 // this is done my calling System::Init(). Among other things, this is necessary to
    1.33 // initialize the memory allocator. Similarly, System::Destroy must be
    1.34 // called before program exist for proper cleanup. Both of these tasks can be achieved by
    1.35 // simply creating System object first, allowing its constructor/destructor do the work.
    1.36 
    1.37 // TBD: Require additional System class for Oculus Rift API?
    1.38 
    1.39 class System
    1.40 {
    1.41 public:
    1.42 
    1.43     // System constructor expects allocator to be specified, if it is being substituted.
    1.44     System(Log* log = Log::ConfigureDefaultLog(LogMask_Debug),
    1.45            Allocator* palloc = DefaultAllocator::InitSystemSingleton())
    1.46     {
    1.47         Init(log, palloc);
    1.48     }
    1.49 
    1.50     ~System()
    1.51     {
    1.52         Destroy();
    1.53     }
    1.54 
    1.55     // Returns 'true' if system was properly initialized.
    1.56     static bool OVR_CDECL IsInitialized();
    1.57 
    1.58     // Initializes System core.  Users can override memory implementation by passing
    1.59     // a different Allocator here.
    1.60     static void OVR_CDECL Init(Log* log = Log::ConfigureDefaultLog(LogMask_Debug),
    1.61                                Allocator *palloc = DefaultAllocator::InitSystemSingleton());
    1.62 
    1.63     // De-initializes System more, finalizing the threading system and destroying
    1.64     // the global memory allocator.
    1.65     static void OVR_CDECL Destroy();    
    1.66 };
    1.67 
    1.68 } // OVR
    1.69 
    1.70 #endif
    1.71 \ No newline at end of file