// Copyright 2009-2021 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include "../common/tutorial/tutorial_device.isph"
#include "../common/math/random_sampler.isph"
#include "../common/core/differential_geometry.isph"
#include "../common/tutorial/scene_device.h"

extern uniform ISPCScene* uniform g_ispc_scene;
extern uniform int g_instancing_mode;
extern uniform float g_min_width;
extern uniform int g_animation_mode;
extern uniform bool g_motion_blur;

struct TutorialData
{
  uniform ISPCScene* uniform ispc_scene;
  uniform int instancing_mode;
  RTCRayQueryFlags iflags_coherent;
  
  /* scene data */
  RTCScene scene;
  uniform bool subdiv_mode;
  uniform bool motion_blur;

  uniform float min_width;
};

void TutorialData_Constructor(uniform TutorialData* uniform This)
{
  This->ispc_scene = g_ispc_scene;
  This->instancing_mode = g_instancing_mode;
  This->iflags_coherent = g_iflags_coherent;
  This->scene = NULL;
  This->subdiv_mode = false;
  This->motion_blur = g_motion_blur;
  This->min_width = g_min_width;
}

void TutorialData_Destructor(uniform TutorialData* uniform This)
{
  rtcReleaseScene (This->scene); This->scene = NULL;
}
