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 // Copyright 2009-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 
4 #pragma once
5 
6 #include "rtcore_common.h"
7 
9 
10 /* Opaque device type */
11 typedef struct RTCDeviceTy* RTCDevice;
12 
13 /* Creates a new Embree device. */
14 RTC_API RTCDevice rtcNewDevice(const char* config);
15 
16 /* Retains the Embree device (increments the reference count). */
17 RTC_API void rtcRetainDevice(RTCDevice device);
18 
19 /* Releases an Embree device (decrements the reference count). */
21 
22 /* Device properties */
24 {
29 
34 
41 
48 
52 };
53 
54 /* Gets a device property. */
55 RTC_API ssize_t rtcGetDeviceProperty(RTCDevice device, enum RTCDeviceProperty prop);
56 
57 /* Sets a device property. */
58 RTC_API void rtcSetDeviceProperty(RTCDevice device, const enum RTCDeviceProperty prop, ssize_t value);
59 
60 /* Error codes */
62 {
70 };
71 
72 /* Returns the error code. */
74 
75 /* Error callback function */
76 typedef void (*RTCErrorFunction)(void* userPtr, enum RTCError code, const char* str);
77 
78 /* Sets the error callback function. */
80 
81 /* Memory monitor callback function */
82 typedef bool (*RTCMemoryMonitorFunction)(void* ptr, ssize_t bytes, bool post);
83 
84 /* Sets the memory monitor callback function. */
85 RTC_API void rtcSetDeviceMemoryMonitorFunction(RTCDevice device, RTCMemoryMonitorFunction memoryMonitor, void* userPtr);
86 
RTC_API enum RTCError rtcGetDeviceError(RTCDevice device)
void
Definition: png.h:1083
#define RTC_API
Definition: rtcore_config.h:55
RTCError
Definition: rtcore_device.h:61
typedefRTC_NAMESPACE_BEGIN struct RTCDeviceTy * RTCDevice
Definition: rtcore_device.h:11
bool(* RTCMemoryMonitorFunction)(void *ptr, ssize_t bytes, bool post)
Definition: rtcore_device.h:82
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:76
RTCDeviceProperty
Definition: rtcore_device.h:23
RTC_API void rtcSetDeviceProperty(RTCDevice device, const enum RTCDeviceProperty prop, ssize_t value)
RTC_API RTCDevice rtcNewDevice(const char *config)
#define RTC_NAMESPACE_END
Definition: rtcore_config.h:23
RTC_API void rtcRetainDevice(RTCDevice device)
RTC_API void rtcSetDeviceErrorFunction(RTCDevice device, RTCErrorFunction error, void *userPtr)
auto ptr(T p) -> const void *
Definition: format.h:2448
Definition: core.h:1131
Definition: format.h:2459
RTC_API void rtcSetDeviceMemoryMonitorFunction(RTCDevice device, RTCMemoryMonitorFunction memoryMonitor, void *userPtr)
#define RTC_NAMESPACE_BEGIN
Definition: rtcore_config.h:22