1 #pragma once 2 3 #include "Backend.h" 4 #include "Types.h" 5 #include <set> 6 7 void rtwInit(); 8 RTW::Backend *rtwSwitch(const char *name); 9 void rtwShutdown(); 10 11 std::set<RTWBackendType> rtwGetAvailableBackends(); 12 13 // --- Define-based mapping from OSPRay to RTWrapper ---- 14 #define OSPObject RTWObject 15 #define OSPGroup RTWGroup 16 #define OSPRenderer RTWRenderer 17 #define OSPWorld RTWWorld 18 #define OSPInstance RTWInstance 19 #define OSPGeometricModel RTWGeometricModel 20 #define OSPData RTWData 21 #define OSPCamera RTWCamera 22 #define OSPLight RTWLight 23 #define OSPTexture2D RTWTexture2D 24 #define OSPTexture RTWTexture2D 25 #define OSPTextureFormat RTWTextureFormat 26 #define OSPMaterial RTWMaterial 27 #define OSPGeometry RTWGeometry 28 #define OSPFrameBuffer RTWFrameBuffer 29 #define OSPVolume RTWVolume 30 #define OSPVolumetricModel RTWVolumetricModel 31 #define OSPTransferFunction RTWTransferFunction 32 #define OSPDataType RTWDataType 33 34 #define OSP_FLOAT RTW_FLOAT 35 #define OSP_VEC2F RTW_VEC2F 36 #define OSP_VEC3F RTW_VEC3F 37 #define OSP_VEC4F RTW_VEC4F 38 #define OSP_BOX3F RTW_BOX3F 39 40 #define OSP_INT RTW_INT 41 #define OSP_VEC2I RTW_VEC2I 42 #define OSP_VEC3I RTW_VEC3I 43 #define OSP_VEC4I RTW_VEC4I 44 #define OSP_BOX3I RTW_BOX3I 45 46 #define OSP_UINT RTW_UINT 47 #define OSP_VEC2UI RTW_VEC2UI 48 #define OSP_VEC3UI RTW_VEC3UI 49 #define OSP_VEC4UI RTW_VEC4UI 50 51 #define OSP_UCHAR RTW_UCHAR 52 #define OSP_VEC2UC RTW_VEC2UC 53 #define OSP_VEC3UC RTW_VEC3UC 54 #define OSP_VEC4UC RTW_VEC4UC 55 #define OSP_USHORT RTW_USHORT 56 57 #define OSP_LONG RTW_LONG 58 #define OSP_ULONG RTW_ULONG 59 60 #define OSP_SHORT RTW_SHORT 61 #define OSP_USHORT RTW_USHORT 62 63 #define OSP_DOUBLE RTW_DOUBLE 64 65 #define OSP_OBJECT RTW_OBJECT 66 #define OSP_RAW RTW_RAW 67 // Object reference type. 68 #define OSP_DEVICE RTW_DEVICE 69 // Void pointer type. 70 #define OSP_VOID_PTR RTW_VOID_PTR 71 // Booleans, same size as RTW_INT. 72 #define OSP_BOOL RTW_BOOL 73 // object subtypes 74 #define OSP_CAMERA RTW_CAMERA 75 #define OSP_DATA RTW_DATA 76 #define OSP_FRAMEBUFFER RTW_FRAMEBUFFER 77 #define OSP_FUTURE RTW_FUTURE 78 #define OSP_GEOMETRIC_MODEL RTW_GEOMETRIC_MODEL 79 #define OSP_GEOMETRY RTW_GEOMETRY 80 #define OSP_GROUP RTW_GROUP 81 #define OSP_IMAGE_OPERATION RTW_IMAGE_OPERATION 82 #define OSP_INSTANCE RTW_INSTANCE 83 #define OSP_LIGHT RTW_LIGHT 84 #define OSP_MATERIAL RTW_MATERIAL 85 #define OSP_RENDERER RTW_RENDERER 86 #define OSP_TEXTURE RTW_TEXTURE 87 #define OSP_TRANSFER_FUNCTION RTW_TRANSFER_FUNCTION 88 #define OSP_VOLUME RTW_VOLUME 89 #define OSP_VOLUMETRIC_MODEL RTW_VOLUMETRIC_MODEL 90 #define OSP_WORLD RTW_WORLD 91 // Pointer to a C-style NULL-terminated character string. 92 #define OSP_STRING RTW_STRING 93 // Character scalar type. 94 #define OSP_CHAR RTW_CHAR 95 #define OSP_UNKNOWN RTW_UNKNOWN 96 97 #define OSP_TEXTURE_FILTER_NEAREST RTW_TEXTURE_FILTER_NEAREST 98 #define OSP_TEXTURE_FILTER_BILINEAR RTW_TEXTURE_FILTER_BILINEAR 99 100 #define OSP_TEXTURE_RGB8 RTW_TEXTURE_RGB8 101 #define OSP_TEXTURE_R32F RTW_TEXTURE_R32F 102 #define OSP_TEXTURE_RGB32F RTW_TEXTURE_RGB32F 103 #define OSP_TEXTURE_RGBA32F RTW_TEXTURE_RGBA32F 104 #define OSP_TEXTURE_R8 RTW_TEXTURE_R8 105 #define OSP_TEXTURE_RGB8 RTW_TEXTURE_RGB8 106 #define OSP_TEXTURE_RGBA8 RTW_TEXTURE_RGBA8 107 #define OSP_TEXTURE_L8 RTW_TEXTURE_L8 108 #define OSP_TEXTURE_LA8 RTW_TEXTURE_LA8 109 #define OSP_TEXTURE_SRGB RTW_TEXTURE_SRGB 110 #define OSP_TEXTURE_SRGBA RTW_TEXTURE_SRGBA 111 112 #define OSP_FB_RGBA32F RTW_FB_RGBA32F 113 #define OSP_FB_RGBA8 RTW_FB_RGBA8 114 #define OSP_FB_SRGBA RTW_FB_SRGBA 115 #define OSP_FB_COLOR RTW_FB_COLOR 116 #define OSP_FB_DEPTH RTW_FB_DEPTH 117 #define OSP_FB_ACCUM RTW_FB_ACCUM 118 #define OSP_FB_NORMAL RTW_FB_NORMAL 119 #define OSP_FB_ALBEDO RTW_FB_ALBEDO 120 121 #define OSP_TETRAHEDRON RTW_TETRAHEDRON 122 #define OSP_HEXAHEDRON RTW_HEXAHEDRON 123 #define OSP_WEDGE RTW_WEDGE 124 #define OSP_PYRAMID RTW_PYRAMID 125 126 #define OSP_ROUND RTW_ROUND 127 #define OSP_FLAT RTW_FLAT 128 #define OSP_RIBBON RTW_RIBBON 129 #define OSP_UNKNOWN_CURVE_TYPE RTW_UNKNOWN_CURVE_TYPE 130 131 #define OSP_LINEAR RTW_LINEAR 132 #define OSP_BEZIER RTW_BEZIER 133 #define OSP_BSPLINE RTW_BSPLINE 134 #define OSP_HERMITE RTW_HERMITE 135 #define OSP_CATMULL_ROM RTW_CATMULL_ROM 136 #define OSP_UNKNOWN_CURVE_BASIS RTW_UNKOWN_CURVE_BASIS 137 138 #define ospSetFloat backend->SetFloat 139 #define ospSetBool backend->SetBool 140 #define ospSetInt backend->SetInt 141 #define ospSetVec2i backend->SetVec2i 142 #define ospSetVec3i backend->SetVec3i 143 #define ospSetVec2f backend->SetVec2f 144 #define ospSetVec3f backend->SetVec3f 145 #define ospSetVec4f backend->SetVec4f 146 #define ospSetString backend->SetString 147 #define ospSetParam backend->SetParam 148 #define ospSetObject backend->SetObject 149 #define ospSetObjectAsData backend->SetObjectAsData 150 151 #define ospRemoveParam backend->RemoveParam 152 153 #define ospCommit backend->Commit 154 #define ospRelease backend->Release 155 156 #define ospNewData backend->NewData 157 #define ospNewCopyData1D backend->NewCopyData1D 158 #define ospNewCopyData2D backend->NewCopyData2D 159 #define ospNewCopyData3D backend->NewCopyData3D 160 #define ospNewSharedData1D backend->NewSharedData1D 161 #define ospNewSharedData2D backend->NewSharedData2D 162 #define ospNewSharedData3D backend->NewSharedData3D 163 #define ospNewGroup backend->NewGroup 164 #define ospNewCamera backend->NewCamera 165 #define ospNewLight backend->NewLight 166 #define ospNewTexture backend->NewTexture 167 #define ospNewMaterial backend->NewMaterial 168 #define ospNewTransferFunction backend->NewTransferFunction 169 #define ospNewVolume backend->NewVolume 170 #define ospNewGeometry backend->NewGeometry 171 #define ospNewModel backend->NewModel 172 #define ospNewGeometricModel backend->NewGeometricModel 173 #define ospNewVolumetricModel backend->NewVolumetricModel 174 #define ospNewWorld backend->NewWorld 175 #define ospNewInstance backend->NewInstance 176 #define ospNewFrameBuffer backend->NewFrameBuffer 177 #define ospNewRenderer backend->NewRenderer 178 #define ospFrameBufferClear backend->FrameBufferClear 179 #define ospRenderFrame backend->RenderFrame 180 #define ospMapFrameBuffer backend->MapFrameBuffer 181 #define ospUnmapFrameBuffer backend->UnmapFrameBuffer 182 183 #define ospAddGeometry backend->AddGeometry 184 #define ospAddVolume backend->AddVolume 185 186 #define ospcommon rtw 187 #define osp rtw 188