oculus1

diff libovr/Src/Kernel/OVR_System.h @ 3:b069a5c27388

added a couple more stuff, fixed all the LibOVR line endings
author John Tsiombikas <nuclear@member.fsf.org>
date Sun, 15 Sep 2013 04:10:05 +0300
parents e2f9e4603129
children
line diff
     1.1 --- a/libovr/Src/Kernel/OVR_System.h	Sat Sep 14 17:51:03 2013 +0300
     1.2 +++ b/libovr/Src/Kernel/OVR_System.h	Sun Sep 15 04:10:05 2013 +0300
     1.3 @@ -1,1 +1,67 @@
     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
    1.72 +/************************************************************************************
    1.73 +
    1.74 +PublicHeader:   OVR
    1.75 +Filename    :   OVR_System.h
    1.76 +Content     :   General kernel initialization/cleanup, including that
    1.77 +                of the memory allocator.
    1.78 +Created     :   September 19, 2012
    1.79 +Notes       : 
    1.80 +
    1.81 +Copyright   :   Copyright 2012 Oculus VR, Inc. All Rights reserved.
    1.82 +
    1.83 +Use of this software is subject to the terms of the Oculus license
    1.84 +agreement provided at the time of installation or download, or which
    1.85 +otherwise accompanies this software in either electronic or hard copy form.
    1.86 +
    1.87 +************************************************************************************/
    1.88 +
    1.89 +#ifndef OVR_System_h
    1.90 +#define OVR_System_h
    1.91 +
    1.92 +#include "OVR_Allocator.h"
    1.93 +#include "OVR_Log.h"
    1.94 +
    1.95 +namespace OVR {
    1.96 +
    1.97 +// ***** System Core Initialization class
    1.98 +
    1.99 +// System initialization must take place before any other OVR_Kernel objects are used;
   1.100 +// this is done my calling System::Init(). Among other things, this is necessary to
   1.101 +// initialize the memory allocator. Similarly, System::Destroy must be
   1.102 +// called before program exist for proper cleanup. Both of these tasks can be achieved by
   1.103 +// simply creating System object first, allowing its constructor/destructor do the work.
   1.104 +
   1.105 +// TBD: Require additional System class for Oculus Rift API?
   1.106 +
   1.107 +class System
   1.108 +{
   1.109 +public:
   1.110 +
   1.111 +    // System constructor expects allocator to be specified, if it is being substituted.
   1.112 +    System(Log* log = Log::ConfigureDefaultLog(LogMask_Debug),
   1.113 +           Allocator* palloc = DefaultAllocator::InitSystemSingleton())
   1.114 +    {
   1.115 +        Init(log, palloc);
   1.116 +    }
   1.117 +
   1.118 +    ~System()
   1.119 +    {
   1.120 +        Destroy();
   1.121 +    }
   1.122 +
   1.123 +    // Returns 'true' if system was properly initialized.
   1.124 +    static bool OVR_CDECL IsInitialized();
   1.125 +
   1.126 +    // Initializes System core.  Users can override memory implementation by passing
   1.127 +    // a different Allocator here.
   1.128 +    static void OVR_CDECL Init(Log* log = Log::ConfigureDefaultLog(LogMask_Debug),
   1.129 +                               Allocator *palloc = DefaultAllocator::InitSystemSingleton());
   1.130 +
   1.131 +    // De-initializes System more, finalizing the threading system and destroying
   1.132 +    // the global memory allocator.
   1.133 +    static void OVR_CDECL Destroy();    
   1.134 +};
   1.135 +
   1.136 +} // OVR
   1.137 +
   1.138 +#endif