directx

DirectX::XMMATRIX __declspec(align('16')) won't be aligned

假如想象 提交于 2019-12-04 14:38:20
I am using DirectXMath in building my 3D simulation project void SetConstantBuffer(ID3D11DeviceContext*_device_context, DirectX::XMMATRIX _world, DirectX::XMMATRIX _view, DirectX::XMMATRIX _projection) { ConstantBuffer const_buffer; const_buffer.View = DirectX::XMMatrixTranspose(_world); const_buffer.World = DirectX::XMMatrixTranspose(_view); const_buffer.Projection = DirectX::XMMatrixTranspose(_projection); _device_context->UpdateSubresource(m_const_buffer, 0, NULL, &const_buffer, 0, 0); } I get these kind of compiler errors probably on SIMD flag inside DirectXMath: error C2719: '_world':

DirectX: World to view matrix - where is my misconception?

血红的双手。 提交于 2019-12-04 14:34:04
I'm starting with DirectX (and SharpDX, therefore programming only in C#/hlsl) and am trying to build my own camera class. It should be rotatable, allow forward and backward moving and also "sideways" movement (the classical first person movement often mapped to A and D, plus up and down in my case). For easier bugfixing model and world space are the same in my case, perspective projection is not yet implemented, as is rotating the camera, and my camera is supposed to look in the positive Z-axis (into the screen). My bugfixing model is a simple quad with 1.f width and height, z = 0 and being

How to enable VSYNC in D3D windowed app?

雨燕双飞 提交于 2019-12-04 13:49:17
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, image below the line shows on the monitor and the above part follows.) Some sites say D3DPRESENT

Detecting full-screen Direct3D applications

瘦欲@ 提交于 2019-12-04 13:26:29
问题 Is there any way to detect - through the Direct3D API - Direct3D applications running in full-screen mode? SHQueryUserNotificationState, which can indicate such applications, is only supported on Vista and up. It also only works when the Explorer shell is running. 回答1: I found how to detect full-screen Direct3D and OpenGL (for example Minecraft) applications. Call IDirectDraw7::TestCooperativeLevel(). This function returns DDERR_EXCLUSIVEMODEALREADYSET if active full-screen Direct3D

api-ms-win-core-libraryloader-l1-2-0.dll missing when d3dcompiler_47.dll is redistributed

回眸只為那壹抹淺笑 提交于 2019-12-04 12:15:14
As per instruction from the Windows 8.1 DirectX SDK, d3dcompiler_47.dll is to be redistributed with any Direct3D program from now on. When I try and run my program on a Windows 7 machine with this dll in the same folder, I get a "api-ms-win-core-libraryloader-l1-2-0.dll missing" error. A quick google search suggests this is because of a version mix-up somewhere - is d3dcompiler_47.dll incompatible with this machine? I've checked to make sure it has DirectX 11 installed, which is the version of DirectX that I'm using, and can't figure out why this is happening. This can only go wrong if you

How to read vertices from vertex buffer in Direct3d11

泪湿孤枕 提交于 2019-12-04 11:43:09
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. Where your code is wrong: You asking GPU to give you an address to its memory( Map() ), Storing this adress ( operator=() ), Then saying: "Thanks, I don't

NSIS script - download .NET framework, DirectX

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 11:35:59
Can a NSIS script download .NET and DirectX from microsoft, then install it? I don't want to include the installers in my installer because they are huge. Here's an example for .Net : Function GetDotnet ;// looks for local copy before downloading, returns path in $0 Pop $0 ${If} ${FileExists} "$InitDir\dotnetfx35.exe" StrCpy $0 "$InitDir\dotnetfx35.exe" ${ElseIf} ${FileExists} "$InitDir\dotnetfx35setup.exe" StrCpy $0 "$InitDir\dotnetfx35setup.exe" ${Else} Call DownloadDotnet StrCpy $0 $0 ${EndIf} Push $0 FunctionEnd Function DownloadDotnet ;// downloads .Net, returns download path in $0 NSISDL

Cannot open file 'dxguid.lib'

空扰寡人 提交于 2019-12-04 10:52:48
I'm having annoying linker issues - VS2010 claims it cannot find this file, but it's clearly there, and the path is correct - I'm using other lib's in the same folder that all work no problem. (d3d9.lib, and dinput8.lib) I'm using the February 2010 version of DXSDK (DX9) in case that's relevant. I've even tried copy/pasting the file name so I know I didn't mis-type it. My "Additional Dependencies" line looks like this: Library.lib;d3d9.lib;dinput8.lib;dxguid.lib;%(AdditionalDependencies) and the Additional Library Directories line is (for Debug build): $(DXSDK_DIR)\Lib\;$(SolutionDir)\Debug;%

Cleaning up in Shutdown() method instead of destructor

£可爱£侵袭症+ 提交于 2019-12-04 10:41:01
In Rastertek DirectX tutorials they have empty constructors and destructors and instead use initialize() and shutdown() functions for objects initialization and cleaning up. After using this design for a while I can somewhat understand the benefits of having an initialize() method, but I can't see how using a shutdown() method is any better than putting all the clean-up code in the destructor. The reason they provide is the following: You will also notice I don't do any object clean up in the class destructor. I instead do all my object clean up in the Shutdown function you will see further

Where can I find 'winmm.lib' (I'm using Visual Studio 2012)

烂漫一生 提交于 2019-12-04 10:35:57
My OS is 64Bit Windows 7. I wanted to build the DirectX Sample in C:\Program Files (x86)\Microsoft DirectX SDK (June 2010)\Samples\C++\Direct3D10\Tutorials\Tutorial02. but when I build error occured with fatal error LNK1104: 'winmm.lib' can't open the file. I reinstalled Direct SDK, but no change. I also added the path (include, lib) to the settings. If I remove 'winmm.lib' from the project settings, 'comctl32.lib' can't be opened. both libs were already present in properties>Linker>Input. How can I solve this problem? winmm.lib isn't part of the DirectX SDK but is part of the Windows SDK .