- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
好的,我关注了this tutorial (代码在页面下方,您可以点击显示代码的图片顶部)关于 DX10 和 C++基本上代码就像
// include and stuff
ID3D10Device* device; // adding = NULL wont change problem
ID3D10RenderTargetView* rtv;
IDXGISwapChain* swapchain;
// function predecs, winmain, winproc
// winmain calls initD3D(hWnd) just before entering msg loop
void initD3D(HWND hWnd){
DXGI_SWAP_CHAIN_DESC scd; // creates struct for swap chain info
ZeroMemory(&scd, sizeof(DXGI_SWAP_CHAIN_DESC)); // clear the struct for use
scd.BufferCount = 1; // create two buffers one front buffer one back buffer
scd.BufferDesc.Format = DXGI_FORMAT_B8G8R8A8_UNORM; // use 32-bit color
scd.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; // tell how chain is to be used
scd.OutputWindow = hWnd; // set window to be used by d3d
scd.SampleDesc.Count = 1; // set level of multi sampling
scd.SampleDesc.Quality = 0; // set quality of multisampling
scd.Windowed = true; // set to windowed or fullscreen
D3D10CreateDeviceAndSwapChain(NULL, D3D10_DRIVER_TYPE_HARDWARE,
NULL, 0, D3D10_SDK_VERSION, &scd,
&swapchain, &device);
// get the adress of the backbuffer and use it to create the render target
ID3D10Texture2D* pBackBuffer;
// AND HERE (NEXT LINE) THE ERROR OCCURS
swapchain->GetBuffer(0, __uuidof(ID3D10Texture2D), (LPVOID*)&pBackBuffer);
// on runtime debugger tells me swapchain value is 0x00000000
// why does it point to nowhere?
device->CreateRenderTargetView(pBackBuffer, NULL, &rtv);
pBackBuffer->Release();
// set the render target as the back buffer
device->OMSetRenderTargets(1, &rtv, NULL);
D3D10_VIEWPORT viewport; // create a struct to hold the viewport data
ZeroMemory(&viewport, sizeof(D3D10_VIEWPORT)); // clear the struct
//viewport.stuff
device->RSSetViewports(1, &viewport); //set the viewport
我省略了不必要的代码,我想如果你真的需要完整的代码,你可以自己弄清楚或者点击链接,我想专注于主要问题;)
正如代码中所述,我的调试器告诉我 swapchain
指向 0x00000000,通过查看值我发现它与 device
相同也指向 0x00000000。消息是:
First-chance exception at 0x........ in bla.exe: 0x........: Access violation reading location 0x00000000
我查看了整个代码,不知道可能是什么问题。
会不会是硬件问题?我在带有两个图形芯片(一个英特尔和一个 nVidia)的 Thinkpad T510 上,默认使用 nVidia 芯片会导致 Visual Studio 崩溃。
我不知道还有什么问题,因为教程指出代码将运行 :)我知道还有另一个主题有一个非常非常相关的问题,但据我了解它不一样。 (而且作者自己给的答案并没有解决我的问题)
编辑:我刚刚读取了调试输出,似乎无法加载 ** *.dll顺便说一句,我正在使用 DX SDK 的 x86 库
片段:
'AnotherWindowsApp.exe': Loaded 'E:\visual studio 2010 Projects\AnotherWindowsApp\Debug\AnotherWindowsApp.exe', Symbols loaded.
'AnotherWindowsApp.exe': Loaded 'C:\Windows\SysWOW64\ntdll.dll', Cannot find or open the PDB file
'AnotherWindowsApp.exe': Loaded 'C:\Windows\SysWOW64\kernel32.dll', Cannot find or open the PDB file
'AnotherWindowsApp.exe': Loaded 'C:\Windows\SysWOW64\KernelBase.dll', Cannot find or open the PDB file
[...]
'AnotherWindowsApp.exe': Loaded 'C:\Windows\SysWOW64\nvinit.dll', Binary was not built with debug information.
'AnotherWindowsApp.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\detoured.dll', Cannot find or open the PDB file
'AnotherWindowsApp.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\Nvd3d9wrap.dll', Cannot find or open the PDB file
[...]
'AnotherWindowsApp.exe': Loaded 'C:\Windows\SysWOW64\d3d9.dll', Cannot find or open the PDB file
'AnotherWindowsApp.exe': Loaded 'C:\Program Files (x86)\NVIDIA Corporation\coprocmanager\nvdxgiwrap.dll', Cannot find or open the PDB file
'AnotherWindowsApp.exe': Loaded 'C:\Windows\SysWOW64\d3d11.dll', Cannot find or open the PDB file
[...]
'AnotherWindowsApp.exe': Loaded 'C:\Windows\SysWOW64\igd10umd32.dll', Cannot find or open the PDB file
First-chance exception at 0x7623b727 in AnotherWindowsApp.exe: Microsoft C++ exception: _com_error at memory location 0x0045f06c..
First-chance exception at 0x7623b727 in AnotherWindowsApp.exe: Microsoft C++ exception: _com_error at memory location 0x0045ef90..
First-chance exception at 0x7623b727 in AnotherWindowsApp.exe: Microsoft C++ exception: _com_error at memory location 0x0045f0e0..
The thread 'Win32 Thread' (0x18b0) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x12dc) has exited with code 0 (0x0).
The thread 'Win32 Thread' (0x354) has exited with code 0 (0x0).
The thread 'UMDShimPresentThread' (0x1080) has exited with code 0 (0x0).
'AnotherWindowsApp.exe': Unloaded 'C:\Windows\SysWOW64\nvwgf2um.dll'
'AnotherWindowsApp.exe': Unloaded 'C:\Windows\SysWOW64\igd10umd32.dll'
First-chance exception at 0x01281758 in AnotherWindowsApp.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x01281758 in AnotherWindowsApp.exe: 0xC0000005: Access violation reading location 0x00000000.
First-chance exception at 0x01281758 in AnotherWindowsApp.exe: 0xC0000005: Access violation reading location 0x00000000.
Unhandled exception at 0x01281758 in AnotherWindowsApp.exe: 0xC0000005: Access violation reading location 0x00000000.
The program '[5912] AnotherWindowsApp.exe: Native' has exited with code -1073741819 (0xc0000005).
最佳答案
首先,您应该检查 D3D10CreateDeviceAndSwapChain 函数返回的错误代码。将错误代码与 this site 上的错误代码进行比较初步了解可能出了什么问题。
当 D3D10CreateDeviceAndSwapChain 函数不成功时,'swapchain' 和 'device' 设置为零 (0x00000000)。
二、根据docs DXGI_SWAP_CHAIN_DESC 结构是一个“输入”参数。可能这会导致您的错误。
更新(基于评论):与本教程不同的一件事是缓冲区格式。本教程使用 DXGI_FORMAT_R8G8B8A8_UNORM,但您使用的是 DXGI_FORMAT_B8G8R8A8_UNORM。
关于c++ - DirectX10 交换链和设备指向 0x00000000(导致运行时错误)(c++),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5282926/
iphone设备UDID、iphone设备ID和iphone设备Token之间有什么区别? 通常,当我们使用苹果推送通知服务时,会使用 iPhone 设备 token 。 但我的目标只是识别唯一的 i
我们使用 firebase 从服务器向 Android 和 IOS 设备发送通知,并且我们使用旧版 FCM 发送通知。但是当我们的应用程序在后台时,通知由系统本身处理,因此我们无法通过应用程序处理它。
在 Google 上搜索后,我发现人们说只能通过“MFi 程序”将 iOS 设备与非 iOS 设备连接起来。这是真的吗? 我的项目主要集中于直接通过蓝牙与Arduino设备发送和接收信息。 iOS和非
所以我有一个通用应用程序,我正在设置 UIScrollView 的内容大小。显然,iPhone 和 iPad 上的内容大小会有所不同。如何为 iPad 设置某种尺寸,为 iPhone 和 iPod t
问题:如何在 pod 中使用连接到主机的原始设备作为 block 设备。 我尝试使用类型为“BlockDevice”的“hostPath” volumes: - my-data: hostPath
Implemented GCKDeviceScannerListener Singleton Class on ViewController, however its delegate methods
我有一个 (PhoneGap) 应用程序,它将成功获得 Passbook 通行证,并且还将成功接收与 Passbook 分开的推送通知(当伪造设备 ID 时)。 我遇到的问题是发送给注册设备的设备 I
我正在尝试找到一种方法,通过我目前正在使用的 iOS 应用程序访问我的信标的电池电量。我正在使用 Kontakt 的 iBeacon 设备。我浏览了 Estimote iOS SDK,他们提供了一种实
我正在努力让 CUDA 应用程序也能监控 GPU 的核心温度。可通过 NVAPI 访问该信息。 问题是我想确保在运行代码时监控的是同一个 GPU。 但是,似乎有信息表明我从 NvAPI_EnumPhy
从沙箱模式到生产模式,设备 token 有何不同? 我认为我已将一些设备 token 锁定为生产模式,并且无法将它们从开发中插入。 关于如何检查有什么想法吗? 最佳答案 当您使用开发证书构建应用程序时
目录 /run/user/1000/gvfs 和 ~/.gvfs 分别是空的和不存在的。我的图形文件管理器 (Thunar) 能够检测和访问设备的内部和外部存储器。 命令 gvfs-mount -l
我有一个 Android 平板电脑,它有一个迷你 USB 端口和一个 USB 端口,我想编写一个与 USB key 通信的应用程序。我写了一个demo来找出U盘,但是没有任何反应。 令我不安的是,如果
我们将 PHP 版本从 5.4.25 更改为 5.4.45,并在服务器上安装了 MS SQL 驱动程序。在更改服务器之前,一切正常,但在更改服务器之后,我遇到了 Web 服务问题。我们的身份验证 So
我想知道是否有人使用此 API 在 Android 设备上同时从 2 个后置摄像头捕获图像或视频:https://source.android.com/docs/core/camera/concurr
我正在为客户构建一个物联网解决方案,网络管理员坚持要求设备仅通过访客网络进行连接,该网络有一个强制门户,其中的服务条款必须通过按下 UI 按钮来接受,然后才能获得外部互联网访问。到目前为止,我见过的大
我无法弄清楚这里的格式规则..在我的示例中,代码行太多,无法为每行添加 4 个空格,因此这里是我需要帮助的代码的链接 http://nitemsg.blogspot.com/2011/01/heres
如果我在我的设备上接受推送通知,并且不保存设备 token ,那么我如何在自定义 View 中查看设备 token 或恢复警报 View ? 我删除了应用程序并重新安装,但看不到设备 token 警报
我试图找出在尝试并行比较和复制设备 block 与 pthreads 时我做错了什么。看起来我正在脱离同步并且比较阶段无法正常工作。任何帮助将不胜感激 #ifndef __dbg_h__ #defin
我刚刚写完所有这些内容,但这个红色的小栏告诉我我不能发布图片或两个以上的链接。因此,如果您可以引用 this Imgur album , 那简直太好了。谢谢。 我在这里相对较新,甚至对 android
我需要启用 mysql 常规日志并将其通过 nsf 移动到我系统中的另一个驱动器/设备! 所以,我在 my.cnf 中启用了它: general_log = 1 general_log_fi
我是一名优秀的程序员,十分优秀!