Function create

Synopsis

#include <Source/Falcor/Core/API/Device.h>

static SharedPtr create(Window::SharedPtr &pWindow, const Desc &desc)

Description

Create a new device.

Parameters

[ in ] pWindow - a previously-created window object

[ in ] desc - Device configuration descriptor.

Returns
nullptr if the function failed, otherwise a new device object

Source

Lines 38-48 in Source/Falcor/Core/API/Device.cpp. Line 90 in Source/Falcor/Core/API/Device.h.

Device::SharedPtr Device::create(Window::SharedPtr& pWindow, const Device::Desc& desc)
{
    if (gpDevice)
    {
        logError("Falcor only supports a single device");
        return nullptr;
    }
    gpDevice = SharedPtr(new Device(pWindow, desc));
    if (gpDevice->init() == false) { gpDevice = nullptr;}
    return gpDevice;
}





Add Discussion as Guest

Log in