directx

How to draw a transparent surface using SharpDX?

泄露秘密 提交于 2019-12-08 15:45:14
问题 ( This question is based on further investigations of this other question, but isn't the same question, this is very specific question about painting issues. ) I'm trying to draw a transparent surface overlapped on a target window, the problem is that I don't know how to paint it transparent, so by the moment my surface is black, and I cannot see the proper way to clear the black color of that surface in the code below. I'd read about pixelformats and alphamodes, however, seems I cannot use

Managed DirectX: Specifying the Depth (Z-Order) of Sprites containing Texture and Text

对着背影说爱祢 提交于 2019-12-08 11:22:41
问题 I am using managed DirectX to try and draw a texture and a piece of text to the screen using a Sprite. Unfortunately, if I place the text and the texture in the same sprite, the texture overwrites (overdraws?) the text regardless of the order I do the draw commands. Since I will eventually want to intersperse textures and text, how do I specify a Z-order for these sprites. Does each layer have to be in a separate sprite? Here is the current code: m_device.BeginScene(); m_device.Clear

How can I migrate between versions?

℡╲_俬逩灬. 提交于 2019-12-08 08:30:05
问题 What are changes from directx 10 to 11? Ive written some code in directx 10 and I want to change it to directx 11. Is this just about quality and I can do it just by changing headrs and dll files or functions and way of coding have been changed? ing. 回答1: First, I need to say, that nothing will change if you just change your D3D10DoSomething() functions to D3D11DoSomething() . They will do same things. No passive gain. You must use new features explicitly to make your app better. Those

DirectX Math function confusion

狂风中的少年 提交于 2019-12-08 08:24:24
问题 While I was going over some older DirectX code, I came by the functions D3DXVec3Transform and D3DXVec3TransformCoord. Upon looking up the descriptions for them, they seemed rather similar but I don't see what the difference between the two are. Can someone please explain what is the difference between D3DXVec3Transform and D3DXVec3TransformCoord are, along with the math behind them? 回答1: When you transform a 3D vector by matrix it results in a 4D vector where w!=1 a 3D vector can be described

Link two enumated type members

試著忘記壹切 提交于 2019-12-08 07:58:01
问题 I am wrapping the IDirect3D8 class (basically, re-implementing it) and I used DXGI to enumerate adapter modes. There comes the problem. D3DDISPLAYMODE's Format member requires that it be a member of the D3DFORMAT enumerated type, though IDXGIOutput::GetDisplayModeList returns, obviously, a member of the DXGI_FORMAT enumerated type, which is completely different from D3DFORMAT. I need to link the DXGI_FORMAT members to the D3DFORMAT ones. My first idea was to write a function which checks the

Rotate a sphere so that its pole heads towards the camera

情到浓时终转凉″ 提交于 2019-12-08 07:52:55
问题 I have a sphere whose north pole is at (0, 0, 1) and center at (0, 0, 0). I also have a camera arbitrarily positioned in the scene and looking at (0, 0, 0). I want to rotate the sphere so that its north pole lies on the line from (0, 0, 0) to camera position. I am performing this task in a vertex shader and I would like it to be as simple as possible to avoid FPS drop. Does anyone know any simple method how to calculate the rotation matrix or even a simpler way how to perform the rotation of

Direct3D11: Flipping ID3D11Texture2D

一曲冷凌霜 提交于 2019-12-08 04:31:25
I perform a capture of Direct3D back buffer. When I download the pixels the image frame is flipped along its vertical axis.Is it possible to "tell" D3D to flip the frame when copying resource,or when creating target ID3D11Texture2D ? Here is how I do it: The texture into which I copy the frame buffer is created like this: D3D11_TEXTURE2D_DESC description = { desc.BufferDesc.Width, desc.BufferDesc.Height, 1, 1, DXGI_FORMAT_R8G8B8A8_UNORM, { 1, 0 }, // DXGI_SAMPLE_DESC D3D11_USAGE_STAGING,//transder from GPU to CPU 0, D3D11_CPU_ACCESS_READ, 0 }; D3D11_SUBRESOURCE_DATA data = { buffer, desc

DirectX Firefox Plugin rendering artifacts

∥☆過路亽.° 提交于 2019-12-08 04:12:48
问题 QUICK ANSWER : For those of you who reach this page via Google looking for a solution to the same problem, try this quick fix (suggested by Goz) - Add D3DCREATE_FPU_PRESERVE to the behavior flags on your CreateDevice() call. That cleared it up for me! I'm creating a DirectX 9-based NPAPI plugin. It seems to be working well in Chrome and Opera, but in Firefox I get strange rendering artifacts. Upon initializing DirectX (no rendering needs to be done for the artifact to appear) all or parts of

undefined reference to Direct3DCreate9@4'

与世无争的帅哥 提交于 2019-12-08 03:57:56
问题 I have a problem with Code::Blocks (version 13.12) with TDM-GCC compiler (version 4.7.1, 32 bit) and DirectX SDK june_2010. I managed to link these DirectX libraries with my project somehow, at least it's not showing cannot find -ld3dx9 anymore. Now I get undefined reference to Direct3DCreate9@4' and it shows undefined reference to every Matrix function. Is this wrong/incompatible DX library linking related issue with codeblocks? I googled many sites with people having the same issues, but

How to turn on DX11 feature level 11.0

喜你入骨 提交于 2019-12-08 02:56:23
问题 I'm trying to run Dead by Daylight. I know I'm running DirectX 11, but it says feature level 11.0 is needed. how do I fix this? I am ready to post any log if necessary. 回答1: The version of the DirectX Runtime you have installed which describes what the OS software can support is not the same thing as the Direct3D Hardware Feature Level which describes the support your video hardware provides. See this blog post and MSDN: Direct3D feature levels For example, if you have Windows 7 installed,