OSVR-Core  0.6-1962-g59773924
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
MinimalInit.c
Go to the documentation of this file.
1 
11 /*
12 // Copyright 2014 Sensics, Inc.
13 //
14 // Licensed under the Apache License, Version 2.0 (the "License");
15 // you may not use this file except in compliance with the License.
16 // You may obtain a copy of the License at
17 //
18 // http://www.apache.org/licenses/LICENSE-2.0
19 //
20 // Unless required by applicable law or agreed to in writing, software
21 // distributed under the License is distributed on an "AS IS" BASIS,
22 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 // See the License for the specific language governing permissions and
24 // limitations under the License.
25 */
26 
27 /* Internal Includes */
29 
30 /* Library/third-party includes */
31 /* none */
32 
33 /* Standard includes */
34 #include <stdio.h>
35 
36 int main() {
37  OSVR_ClientContext ctx =
38  osvrClientInit("com.osvr.exampleclients.MinimalInit", 0);
39  printf("OK, library initialized.\n");
40 
41  /* Pretend that this is your application's mainloop. */
42  int i;
43  for (i = 0; i < 1000000; ++i) {
44  osvrClientUpdate(ctx);
45  }
46 
47  osvrClientShutdown(ctx);
48  printf("Library shut down, exiting.\n");
49  return 0;
50 }
OSVR_ClientContext osvrClientInit(const char applicationIdentifier[], uint32_t flags=0)
Initialize the library.
OSVR_ReturnCode osvrClientShutdown(OSVR_ClientContext ctx)
Shutdown the library.
struct OSVR_ClientContextObject * OSVR_ClientContext
Opaque handle that should be retained by your application. You need only and exactly one...
OSVR_ReturnCode osvrClientUpdate(OSVR_ClientContext ctx)
Updates the state of the context - call regularly in your mainloop.
Header.