directx

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

Stereoscopic 3D on WPF

[亡魂溺海] 提交于 2019-12-06 02:13:29
问题 I have to show stereoscopic 3D graphics on a WPF control. I already have the code which create two DirectX-9 textures to show, one texture for each eye. I want to use 3D Vision (not anaglyph). I considered the following ways to show the two pictures as 3D stereo: Using OpenGL or DirectX 11.1 Stereo API. Using NvAPI_Stereo_SetActiveEye as described here: http://www.nvidia.com/docs/IO/40505/WP-05482-001_v01-final.pdf Using NVidia stereo signature as described here: NV_STEREO_IMAGE_SIGNATURE and

How to determine the system DirectX is 11 or 11.1?

会有一股神秘感。 提交于 2019-12-06 01:39:23
I am running Windows 7. When I use DxDiag, it shows the version as 11. When I use Visual Studio 2012 which can access Windows API, it can run the code with feature level D3D_FEATURE_LEVEL_11_1 So I agot confused, what is the exact version of my DirectX version? There are a number of confounding factors at work here, so let's take them one at a time: DXDIAG is part of the OS along with the DirectX Runtime but is also manually updated for that string, so it is often less than detailed/accurate about reporting "DirectX" version. For Windows Vista SP1 it doesn't say "DirectX 10.1" and says

3D Graphics Batching

筅森魡賤 提交于 2019-12-06 01:05:46
问题 A lot of sites/articles say 'batch! batch! batch!'. Can someone explain what 'batching' represents with respect to shaders? Namely, does changing textures changing arbitrary shader variables mean something can't be 'batched'? (Sorry if this is a retarded question :D) 回答1: The easiest way to summarize it is to try to make as few API calls as you can to draw what you need to draw. Using vertex arrays or VBOs (not even optional in modern APIs), texture atlases and avoiding the need for state

Media player/recorder (phonon)

a 夏天 提交于 2019-12-05 23:44:57
I would like to develop a media player/recorder. The primary target platform is Windows, support for other OSs would be nice, but that's not a high priority. It should be able to play formats like wav, mp3, avi. It should also be able to record audio (microphone) and video (webcam or capture card). As I have some experience with QT and C++, I looked at QT (4.7.2) phonon with DS backend. But unfortunately I was unable to play a simple AVI, even with the MediaPlayer sample that comes with the QT demos. I could only hear sound, but saw no video. The developer machine is a 64-bit Vista. I also

DirectX world view matrix multiplications - GPU or CPU the place

醉酒当歌 提交于 2019-12-05 19:58:54
I am new to directx, but have been surprised that most examples I have seen the world matrix and view matrix are multiplied as part of the vertex shader, rather than being multiplied by the CPU and the result being passed to the shader. For rigid objects this means you multiply the same two matrices once for every single vertex of the object. I know that the GPU can do this in parallel over a number of vertices (don't really have an idea how many), but isn't this really inefficient, or am I just missing something? I am still new and clueless. In general, you want to do it on the CPU. However,

How do I inject custom audio buffers into a DirectX filter graph using DSPACK?

末鹿安然 提交于 2019-12-05 18:32:40
I am using Delphi 6 with DSPACK to do several operations involving audio and DirectX. I have the "input" side figured out where I assign one of the enumerated audio input devices to a TFilter object and connect that filter to a TSampleGrabber object and that gives me the audio buffers I need to send audio to Skype. It is the logical inverse of that graph that I need to figure out. I receive audio buffers from Skype via a socket. I need to create a graph that has a filter that would be the complement to TSampleGrabber. In other words, a TFilter that instead of delivering audio buffers during an

Debugging/bypassing BSOD without source code

巧了我就是萌 提交于 2019-12-05 18:23:53
Hello and good day to you. Need a bit of assitance here: Situation : I have an obscure DirectX 9 application (name and application details are irrelevant to the question) that causes blue screen of death on all nvidia cards (GeForce 8400GS and up) since certain driver version. I believe that the problem is indirectly caused by DirectX 9 call or a flag that triggers driver bug. Goal : I'd like to track down offending flag/function call (for fun, this isn't my job/homework) and bypass error condition by writing proxy dll. I already have a finished proxy dll that provides wrappers for IDirect3D9,

Is there an efficient\\easy way to draw a concave polygon in Direct3d

℡╲_俬逩灬. 提交于 2019-12-05 17:29:01
I'm trying to draw a polygon using c# and directx All I get is an ordered list of points from a file and I need to draw the flat polygon in a 3d world. I can load the points and draw a convex shape using a trianglefan and drawuserprimitives. This obviously leads to incorrect results when the polygon is very concave (which it may be). I can't imagine I'm the only person to grapple with this problem (tho I'm a gfx/directx neophyte - my background is in gui\windows application development). Can anyone point me towards a simple to follow resource\tutorial\algorithm which may assist me? Direct3D