File: ospExample.cpp

package info (click to toggle)
ospray 3.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 10,048 kB
  • sloc: cpp: 80,569; ansic: 951; sh: 805; makefile: 170; python: 69
file content (34 lines) | stat: -rw-r--r-- 841 bytes parent folder | download | duplicates (2)
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
// Copyright 2018 Intel Corporation
// SPDX-License-Identifier: Apache-2.0

#include "GLFWOSPRayWindow.h"
#include "example_common.h"

using namespace ospray;
using rkcommon::make_unique;

int main(int argc, const char *argv[])
{
  initializeOSPRay(argc, argv, false);

  const bool denoiserAvailable = ospLoadModule("denoiser") == OSP_NO_ERROR;

  bool denoiserGPUSupport = false;
  if (denoiserAvailable) {
    const void *sym =
        rkcommon::getSymbol("ospray_module_denoiser_gpu_supported");
    if (sym) {
      auto denoiserGPUSupported = (int (*)())sym;
      denoiserGPUSupport = denoiserGPUSupported();
    }
  }

  auto glfwOSPRayWindow = make_unique<GLFWOSPRayWindow>(
      vec2i(1024, 768), denoiserAvailable, denoiserGPUSupport);
  glfwOSPRayWindow->mainLoop();
  glfwOSPRayWindow.reset();

  ospShutdown();

  return 0;
}