【问题标题】:Failed to create Direct3D11 device in D3D11RenderSystem::D3D11RenderSystem在 D3D11RenderSystem::D3D11RenderSystem 中创建 Direct3D11 设备失败
【发布时间】:2020-11-23 04:31:12
【问题描述】:

我在使用Ogre-sdk时遇到了问题,我的系统是win10、VisualStudio和GTX1660。 当我下载 SDK 并运行 SampleBrowser.exe 时它运行良好,然后我从源代码编译它也运行良好。但是经过一些简单的操作(我不知道),我遇到了这个错误。即使我下载一个新的。 my problem

我想知道如何解决它,非常感谢这里的任何帮助!

【问题讨论】:

  • 请在您的帖子中包含错误消息。外部链接将来可能会消失。您已经尝试过什么来解决此错误?
  • HRESULT 80070057E_INVALIDARG 所以不清楚这里有什么功能失败。第298行的源码是什么?
  • 嗨,错误消息:“Ogre::RenderingAPIException::RenderingAPIException:Failed to create Direct3D11 device in D3D11RenderSystem::D3D11RenderSystem as ...PATH_TO_OgreD3D11RenderSystem.cpp(line298)”。源代码已发布如下。其他电脑可以运行EXE。我不知道怎么解决。

标签: visual-studio-2015 graphics direct3d11 ogre3d


【解决方案1】:
// create device
    ID3D11DeviceN* device = NULL;
    HRESULT hr = D3D11CreateDeviceN(pAdapter, driverType, NULL, deviceFlags, pFirstFL, pLastFL - pFirstFL + 1, D3D11_SDK_VERSION, &device, pFeatureLevel, 0);

    if(FAILED(hr) && 0 != (deviceFlags & D3D11_CREATE_DEVICE_DEBUG))
    {
        StringStream error;
        error << "Failed to create Direct3D11 device with debug layer (" << hr << ")\nRetrying without debug layer.";
        Ogre::LogManager::getSingleton().logMessage(error.str());

        // create device - second attempt, without debug layer
        deviceFlags &= ~D3D11_CREATE_DEVICE_DEBUG;
        hr = D3D11CreateDeviceN(pAdapter, driverType, NULL, deviceFlags, pFirstFL, pLastFL - pFirstFL + 1, D3D11_SDK_VERSION, &device, pFeatureLevel, 0);
    }
    if(FAILED(hr))
    {
        OGRE_EXCEPT_EX(Exception::ERR_RENDERINGAPI_ERROR, hr, "Failed to create Direct3D11 device", "D3D11RenderSystem::D3D11RenderSystem");
    }

你好,功能如上。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-06-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-20
    相关资源
    最近更新 更多