directx

DirectX programming in C?

情到浓时终转凉″ 提交于 2019-12-01 05:28:29
In the past I have created DirectX applications in the C++ programming language, however, I would like to know if it is possible to do this using the C programming language. Thanks. Yes it is possible. DirectX exposes a COM interface and C is capable of consuming them. It won't be a whole boat load of fun though! The Open Watcom C/C++ compiler comes with DirectX sample applications in both C++ and C. Both work. They are under WATCOM\samples\directx\cpp and WATCOM\samples\directx\c respectively in OW 1.9. This is what the code looks like in C++: hr = d3d->GetDeviceCaps(D3DADAPTER_DEFAULT,

Working with Direct X and VS2012

守給你的承諾、 提交于 2019-12-01 05:07:10
问题 I have both Visual Studio 2012 Express for Desktop and for Windows 8, and I wanted to create Direct X applications and games. I know that there is a Windows SDK now, and in VS 2012 exp for win8 the IDE is pre-installed with the SDK (I know that from the new Direct3D project). My question is, if I wanted to develop applications for Windows Desktop (using VS2012exp) does it come Windows SDK or do I need to install Direct X SDK? And how do I know if my graphics card support which version of

error C2719: '_Val': formal parameter with __declspec(align('16')) won't be aligned?

ぃ、小莉子 提交于 2019-12-01 03:17:31
I'm trying to create a vector for D3DXMATRIXA16 like so: vector<D3DXMATRIXA16> matrices; and am getting the error: d:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(717) : error C2719: '_Val': formal parameter with __declspec(align('16')) won't be aligned e:\projects\emuntitled\em\emscratch\emshadow.h(60) : :see reference to class template instantiation 'std::vector<_Ty>' being compiled with [ _Ty=D3DXMATRIXA16 ] Why is that exactly? Thanks for any help! It is a known issue [link dead] that stl::vector cannot properly contain aligned data, such as D3DXMATRIXA16. One poster pinned

Can WPF run without DirectX?

女生的网名这么多〃 提交于 2019-12-01 02:12:03
问题 This might sound like a stupid question but ... will WPF stop running in absence of a DirectX/Direct3D capable graphics card/drivers or will it just run slower? I know WPF is based on DirectX/Direct3D (even for simple controls) but I cannot find any reference on the topic which provides a good overview of borderline scenarios. Any help appreciated! 回答1: WPF has a dependency on the DirectX runtime. However, both DirectX and WPF have their own software fallback modes so that, in the absence of

Under windows, WebGL makes use of DirectX Runtime or OpenGL runtime?

99封情书 提交于 2019-12-01 02:05:13
问题 Under windows, there are two main 3D libraries. I am wondering WebGL use which? is it configurable? Is it configurable per browser? 回答1: Google Chrome and Firefox will by default make use of ANGLE wrapper to convert OpenGL API calls to Direct3D 9.0 (to achieve better compatibility with most hardware). Users can change this default behavior but it seems to be very inconvenient to override this (currently it's not possible to change this settings programatically). All other major browsers (on

Sending keys to a DirectX Game

╄→尐↘猪︶ㄣ 提交于 2019-12-01 01:37:28
I got into a little trouble sending keys. It seems like when ever I want to send keys It doesn't work. I'm thinking about sending alphabetic characters such as T to bring the chat up from example, but If I write It to the enum, nothing happens whenever I use them. Any ideas? [DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = false)] public static extern IntPtr SendMessage(IntPtr hWnd, int Msg, int wParam, int lParam); [DllImport("user32.dll", SetLastError = true)] public static extern IntPtr FindWindow(string lpClassName, string lpWindowName); /// <summary> /// Virtual Keys /// <

D3DImage using DX10

徘徊边缘 提交于 2019-11-30 23:58:35
问题 Is it possible to use DirectX 10 (I am using SlimDX) with WPF's D3DImage? The only examples and docs I can find only show using DX9 surfaces. 回答1: Yes, you can use DirectX 10, 11, and DirectWrite using the D3DImage in WPF by creating your render target surface as shared, and then creating a DX9 texture based on that shared texture handle to use in WPF. This means that essentially you can use 10, 11, and DirectWrite the same way you use DX9 with no additional overhead, and no airspace issues.

error C2719: '_Val': formal parameter with __declspec(align('16')) won't be aligned?

拥有回忆 提交于 2019-11-30 23:55:54
问题 I'm trying to create a vector for D3DXMATRIXA16 like so: vector<D3DXMATRIXA16> matrices; and am getting the error: d:\Program Files\Microsoft Visual Studio 9.0\VC\include\vector(717) : error C2719: '_Val': formal parameter with __declspec(align('16')) won't be aligned e:\projects\emuntitled\em\emscratch\emshadow.h(60) : :see reference to class template instantiation 'std::vector<_Ty>' being compiled with [ _Ty=D3DXMATRIXA16 ] Why is that exactly? Thanks for any help! 回答1: It is a known issue

SlimDX Device.Reset crashes with a “D3DERR_INVALIDCALL: Invalid call (-2005530516)” error

谁说胖子不能爱 提交于 2019-11-30 22:28:13
We recently upgraded from VS 2005 to VS 2008 (Windows XP). We use SlimDx in one of our projects. All was working ok after the upgrade, except my Recover function, which gets called on devicelost/device reset which crashes with D3DERR_INVALIDCALL: Invalid call (-2005530516) I use Ctrl - Alt - Del and then Escape to simulate device lost. void Recover() { try { if (res.Code == D3DERR_DEVICENOTRESET) { res = m_device.Reset(m_presentParams); //Crashes on this. if (res.IsSuccess) { m_deviceLost = false; } } } catch(Exception e) {} } Is this something to do with VS 2008 , as it used to work nicely

SlimDX/DirectX9/C# - How to access pixel-data in a Texture

跟風遠走 提交于 2019-11-30 22:26:09
This is my first question ever on StackOverflow, hurray! I can honestly say I use StackOverflow on daily basis for both my work and personal programming mysteries. 99,9% of the time I actually find the answer I need on here too, which is great! My current problem actually stumped me a little as I can't seem to find anything which actually works. I've already read several posts on GameDev.net and found other resources around the net but can't sort it out. I am in the process of porting a small 2D engine I wrote for XNA to SlimDX (just DirectX9 at the moment), which has been a good move as I