HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
rtcore_device.h
Go to the documentation of this file.
1 // ======================================================================== //
2 // Copyright 2009-2018 Intel Corporation //
3 // //
4 // Licensed under the Apache License, Version 2.0 (the "License"); //
5 // you may not use this file except in compliance with the License. //
6 // You may obtain a copy of the License at //
7 // //
8 // http://www.apache.org/licenses/LICENSE-2.0 //
9 // //
10 // Unless required by applicable law or agreed to in writing, software //
11 // distributed under the License is distributed on an "AS IS" BASIS, //
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. //
13 // See the License for the specific language governing permissions and //
14 // limitations under the License. //
15 // ======================================================================== //
16 
17 #pragma once
18 
19 #include "rtcore_common.h"
20 
22 
23 /* Opaque device type */
24 typedef struct RTCDeviceTy* RTCDevice;
25 
26 /* Creates a new Embree device. */
27 RTC_API RTCDevice rtcNewDevice(const char* config);
28 
29 /* Retains the Embree device (increments the reference count). */
30 RTC_API void rtcRetainDevice(RTCDevice device);
31 
32 /* Releases an Embree device (decrements the reference count). */
34 
35 /* Device properties */
37 {
42 
47 
52 
59 
62 };
63 
64 /* Gets a device property. */
65 RTC_API ssize_t rtcGetDeviceProperty(RTCDevice device, enum RTCDeviceProperty prop);
66 
67 /* Sets a device property. */
68 RTC_API void rtcSetDeviceProperty(RTCDevice device, const enum RTCDeviceProperty prop, ssize_t value);
69 
70 /* Error codes */
72 {
80 };
81 
82 /* Returns the error code. */
84 
85 /* Error callback function */
86 typedef void (*RTCErrorFunction)(void* userPtr, enum RTCError code, const char* str);
87 
88 /* Sets the error callback function. */
89 RTC_API void rtcSetDeviceErrorFunction(RTCDevice device, RTCErrorFunction error, void* userPtr);
90 
91 /* Memory monitor callback function */
92 typedef bool (*RTCMemoryMonitorFunction)(void* ptr, ssize_t bytes, bool post);
93 
94 /* Sets the memory monitor callback function. */
95 RTC_API void rtcSetDeviceMemoryMonitorFunction(RTCDevice device, RTCMemoryMonitorFunction memoryMonitor, void* userPtr);
96 
RTC_API enum RTCError rtcGetDeviceError(RTCDevice device)
#define RTC_API
Definition: rtcore_config.h:65
RTCError
Definition: rtcore_device.h:71
typedefRTC_NAMESPACE_BEGIN struct RTCDeviceTy * RTCDevice
Definition: rtcore_device.h:24
bool(* RTCMemoryMonitorFunction)(void *ptr, ssize_t bytes, bool post)
Definition: rtcore_device.h:92
RTC_API void rtcReleaseDevice(RTCDevice device)
RTC_API ssize_t rtcGetDeviceProperty(RTCDevice device, enum RTCDeviceProperty prop)
void(* RTCErrorFunction)(void *userPtr, enum RTCError code, const char *str)
Definition: rtcore_device.h:86
RTCDeviceProperty
Definition: rtcore_device.h:36
RTC_API void rtcSetDeviceProperty(RTCDevice device, const enum RTCDeviceProperty prop, ssize_t value)
void
Definition: png.h:1083
RTC_API RTCDevice rtcNewDevice(const char *config)
#define RTC_NAMESPACE_END
Definition: rtcore_config.h:33
RTC_API void rtcRetainDevice(RTCDevice device)
const void * ptr(const T *p)
Definition: format.h:3292
RTC_API void rtcSetDeviceErrorFunction(RTCDevice device, RTCErrorFunction error, void *userPtr)
GLsizei const GLfloat * value
Definition: glew.h:1849
RTC_API void rtcSetDeviceMemoryMonitorFunction(RTCDevice device, RTCMemoryMonitorFunction memoryMonitor, void *userPtr)
#define RTC_NAMESPACE_BEGIN
Definition: rtcore_config.h:32