oculus1
view 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 source
1 /************************************************************************************
3 PublicHeader: OVR
4 Filename : OVR_System.h
5 Content : General kernel initialization/cleanup, including that
6 of the memory allocator.
7 Created : September 19, 2012
8 Notes :
10 Copyright : Copyright 2012 Oculus VR, Inc. All Rights reserved.
12 Use of this software is subject to the terms of the Oculus license
13 agreement provided at the time of installation or download, or which
14 otherwise accompanies this software in either electronic or hard copy form.
16 ************************************************************************************/
18 #ifndef OVR_System_h
19 #define OVR_System_h
21 #include "OVR_Allocator.h"
22 #include "OVR_Log.h"
24 namespace OVR {
26 // ***** System Core Initialization class
28 // System initialization must take place before any other OVR_Kernel objects are used;
29 // this is done my calling System::Init(). Among other things, this is necessary to
30 // initialize the memory allocator. Similarly, System::Destroy must be
31 // called before program exist for proper cleanup. Both of these tasks can be achieved by
32 // simply creating System object first, allowing its constructor/destructor do the work.
34 // TBD: Require additional System class for Oculus Rift API?
36 class System
37 {
38 public:
40 // System constructor expects allocator to be specified, if it is being substituted.
41 System(Log* log = Log::ConfigureDefaultLog(LogMask_Debug),
42 Allocator* palloc = DefaultAllocator::InitSystemSingleton())
43 {
44 Init(log, palloc);
45 }
47 ~System()
48 {
49 Destroy();
50 }
52 // Returns 'true' if system was properly initialized.
53 static bool OVR_CDECL IsInitialized();
55 // Initializes System core. Users can override memory implementation by passing
56 // a different Allocator here.
57 static void OVR_CDECL Init(Log* log = Log::ConfigureDefaultLog(LogMask_Debug),
58 Allocator *palloc = DefaultAllocator::InitSystemSingleton());
60 // De-initializes System more, finalizing the threading system and destroying
61 // the global memory allocator.
62 static void OVR_CDECL Destroy();
63 };
65 } // OVR
67 #endif