public Scene(Context context, SceneType type, EmbreeDevice embreeDevice, RadeonRaysDevice radeonRaysDevice, ClosestHitCallback closestHitCallback, AnyHitCallback anyHitCallback) { mContext = context; var sceneSettings = new SceneSettings { }; sceneSettings.type = type; sceneSettings.embreeDevice = (embreeDevice != null) ? embreeDevice.Get() : IntPtr.Zero; sceneSettings.radeonRaysDevice = (radeonRaysDevice != null) ? radeonRaysDevice.Get() : IntPtr.Zero; sceneSettings.closestHitCallback = closestHitCallback; sceneSettings.anyHitCallback = anyHitCallback; var status = API.iplSceneCreate(context.Get(), ref sceneSettings, out mScene); if (status != Error.Success) { throw new Exception(string.Format("Unable to create scene [{0}]", status.ToString())); } }