forked from KhronosGroup/ANARI-SDK
-
Notifications
You must be signed in to change notification settings - Fork 0
/
HelideLibrary.cpp
52 lines (39 loc) · 1.44 KB
/
HelideLibrary.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
// Copyright 2023-2024 The Khronos Group
// SPDX-License-Identifier: Apache-2.0
#include "HelideDevice.h"
#include "anari/backend/LibraryImpl.h"
#include "anari_library_helide_export.h"
namespace helide {
const char **query_extensions();
struct HelideLibrary : public anari::LibraryImpl
{
HelideLibrary(
void *lib, ANARIStatusCallback defaultStatusCB, const void *statusCBPtr);
ANARIDevice newDevice(const char *subtype) override;
const char **getDeviceExtensions(const char *deviceType) override;
};
// Definitions ////////////////////////////////////////////////////////////////
HelideLibrary::HelideLibrary(
void *lib, ANARIStatusCallback defaultStatusCB, const void *statusCBPtr)
: anari::LibraryImpl(lib, defaultStatusCB, statusCBPtr)
{}
ANARIDevice HelideLibrary::newDevice(const char * /*subtype*/)
{
return (ANARIDevice) new HelideDevice(this_library());
}
const char **HelideLibrary::getDeviceExtensions(const char * /*deviceType*/)
{
return query_extensions();
}
} // namespace helide
// Define library entrypoint //////////////////////////////////////////////////
extern "C" HELIDE_EXPORT ANARI_DEFINE_LIBRARY_ENTRYPOINT(
helide, handle, scb, scbPtr)
{
return (ANARILibrary) new helide::HelideLibrary(handle, scb, scbPtr);
}
extern "C" HELIDE_EXPORT ANARIDevice anariNewHelideDevice(
ANARIStatusCallback defaultCallback, const void *userPtr)
{
return (ANARIDevice) new helide::HelideDevice(defaultCallback, userPtr);
}