direct3d

Displaying a video in DirectX

别等时光非礼了梦想. 提交于 2019-12-07 04:16:51
问题 What is the best/easiest way to display a video (with sound!) in an application using XAudio2 and Direct3D9/10? At the very least it needs to be able to stream potentially larger videos, and take care of the fact that the windows aspect ratio may differ from the videos (eg by adding letter boxes), although ideally Id like the ability to embed the video into a 3D scene. I could of course work out a way to load each frame into a texture, discarding/reusing the textures once rendered, and

windows phone 8 的技术架构

a 夏天 提交于 2019-12-06 23:59:35
从Windows phone7 到Windows phone8最大的区别就是把 winCE内核更换为winRT内核,并且底层的架构使用了Windows运行时的架构。 在该平台上支持编程语言C++、C#、VB.NET,在XAML应用程序开发框架中可以用C#和VB.NET,使用C++编程需要Windows运行组件来调用 不能直接与XAML页面进行交互。 Windows phone 8 应用程序模型 wp8平台支持多种应用程序模型,各种应用模型都有自己的开发规则和使用场景,下面一一介绍这些场景: 1、托管应用 托管应用程序是指普通使用XAML作为界面的Windows phone应用程序,可以使用C#/VB.NET作为托管应用程序的编程语言。在托管的wp8应用程序中 兼容wp7的应用程序。 2、托管应用+Windows运行组件 在wp8中不支持直接用C++语言来编写XAML应用程序(Windows 8支持),如果要在XAML程序中使用C++进行编程就需要通过Windows运行组件来调用基于C++ 的API或者标准的C++代码。wp8新增加了Windows运行时的API,Windows运行时的API支持C#和VB.NET编程语言。也包含大量win8SDK子集,是两个平台可以共 享代码。 3、Direct3D游戏 wp8中新增了支持C++编程的Direct3D游戏的应用程序

Can D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT be passed with D3D_FEATURE_LEVEL_11_0?

只愿长相守 提交于 2019-12-06 13:43:36
MSDN on D3D11_CREATE_DEVICE_DISABLE_GPU_TIMEOUT says: Direct3D 11: This value is not supported until Direct3D 11.1. Does this mean runtime version or feature level? Can I pass the flag to D3D11CreateDevice but only pass feature level 11_0? Is the feature level irrelevant and it just depends on the installed runtime version? What happens if I pass the flag to a DX runtime 11.0? Will it just be ignored silently? Or do I first have to detect the DX runtime version somehow, and then pass the flag only if the DX runtime version is at least 11.1? The 'correct' way to determine if you have the

SlimDX: Cannot see Direct3D debug output in Visual Studio 2010

北慕城南 提交于 2019-12-06 09:02:40
I've installed the June 2010 SDK Enabled the Debug Runtime in the DirectX Control Panel set the Debug Output Level to maximum (More) Enabled unmanaged code debugging. Result: The debug output from Direct3D is missing However if I start the application externally and use dbgview.exe, the output is shown there. What could be the reason for that? After hours of trial and error I found a solution to my problem. Export your settings and check the value of the following setting: <PropertyValue name="OutputOnOutputDebugString">1</PropertyValue> I had 0 there. The most likely reason for this is that I

How to read vertices from vertex buffer in Direct3d11

放肆的年华 提交于 2019-12-06 08:09:49
问题 I have a question regarding vertex buffers. How does one read the vertices from the vertex buffer in D3D11? I want to get a particular vertex's position for calculations, if this approach is wrong, how would one do it? The following code does not (obviously) work. VERTEX* vert; D3D11_MAPPED_SUBRESOURCE ms; devcon->Map(pVBufferSphere, NULL, D3D11_MAP_READ, NULL, &ms); vert = (VERTEX*) ms.pData; devcon->Unmap(pVBufferSphere, NULL); Thanks. 回答1: Where your code is wrong: You asking GPU to give

How to enable VSYNC in D3D windowed app?

淺唱寂寞╮ 提交于 2019-12-06 07:18:18
问题 So, Im using D3D in a windowed application. I inited D3D with the following parameters: windowed: true; backbufferformat: D3DFMT_X8R8G8B8; presentinterval: D3DPRESENT_INTERVAL_ONE; swapeffect: DISCARD Each time OnPaint is called, I render the image to the backbuffer and present it to front. As far as I know (and so does MSDN say), once I set D3DPRESENT_INTERVAL_ONE , vsync will work. But in this case, the image is teared when dragging horizontally. (It seems there's a line across the image,

Render a BMP, JPEG, or PNG Image with DirectX?

▼魔方 西西 提交于 2019-12-06 03:02:31
问题 How do you render a BMP, JPEG, or PNG image file in 3D with DirectX in Windows? (E.g. let's say I want to render four images so that they look like a cubicle or something.) I've seen this done easily with a Java OpenGL library (JME I think?), but it seems like DirectX needs textures, and doesn't take in regular images. :( Is this correct? If so, how do I convert it to a texture programmatically? 回答1: DirectX 9: D3DXCreateTextureFromFile DirectX 10: D3DX10CreateTextureFromFile and

How to find out real screen refresh rate (not the rounded number)

白昼怎懂夜的黑 提交于 2019-12-06 02:29:48
问题 According to this article by Microsoft the screen refresh rate set by the user can be (and is mostly) a fractional number. The user sets 59Hz but the screen runs according to the on screen display at 60Hz, but in reality it's 59.94Hz. What I need for a extremely smooth animation is the 59.94Hz. Using IDirect3DDevice9::GetDisplayMode I only get an int value which cannot by definition represent the real timing (same goes for EnumDisplaySettings). I encounter a visible stutter about every second

Displaying a video in DirectX

梦想与她 提交于 2019-12-05 09:49:12
What is the best/easiest way to display a video (with sound!) in an application using XAudio2 and Direct3D9/10? At the very least it needs to be able to stream potentially larger videos, and take care of the fact that the windows aspect ratio may differ from the videos (eg by adding letter boxes), although ideally Id like the ability to embed the video into a 3D scene. I could of course work out a way to load each frame into a texture, discarding/reusing the textures once rendered, and playing the audio separately through XAudio2, however as well as writing a loader for at least one format,

How do I use a Direct3D 11 pointer wrapped in ComPtr to get a 11.1 interface?

≡放荡痞女 提交于 2019-12-05 04:25:35
I'm following tutorials and I've converted the usual initialisation to using ComPtrs up to this line: ID3D11Device* g_pd3dDevice = nullptr; ID3D11Device1* g_pd3dDevice1 = nullptr; // Obtain the Direct3D 11.1 versions if available hr = g_pd3dDevice->QueryInterface( __uuidof( ID3D11Device1 ), reinterpret_cast<void**>( &g_pd3dDevice1 ) ); Here's what I expected to be the straight analog: Microsoft::WRL::ComPtr<ID3D11Device> device = nullptr; Microsoft::WRL::ComPtr<ID3D11Device1> device1 = nullptr; // Obtain the Direct3D 11.1 versions if available hr = device->QueryInterface(__uuidof(ID3D11Device1