directx

Hooking DirectX EndScene from an injected DLL

允我心安 提交于 2019-11-27 06:07:50
I want to detour EndScene from an arbitrary DirectX 9 application to create a small overlay. As an example, you could take the frame counter overlay of FRAPS, which is shown in games when activated. I know the following methods to do this: Creating a new d3d9.dll , which is then copied to the games path. Since the current folder is searched first, before going to system32 etc., my modified DLL gets loaded, executing my additional code. Downside: You have to put it there before you start the game. Same as the first method, but replacing the DLL in system32 directly. Downside: You cannot add

Managed DirectX running from .Net Framework 4.0 app dont hunt

我只是一个虾纸丫 提交于 2019-11-27 05:59:24
问题 I work on a product that uses Managed DirectX for data visualizations. I was trying to upgrade this product to .net framework 4.0, but I think I'm having issues with Managed DirectX and .Net 4.0 playing together. The main assembly does not reference managed directX. But when it tries to call into an assembly that does reference managed directX...everthing "halts". Its like the debugger just decided not to step into the assembly. I get no exception, nothing. And when I hit the pause button,

Why clipping should be done in CCS, not NDCS

前提是你 提交于 2019-11-27 05:53:58
问题 Why clipping should be done in CCS, not NDCS. I think it is easier to clip in NDCS, but many book said the clipping should be done in CCS. They give an example that a line is laid over eye from behind and front. I could not understand why it can be a problem. 回答1: The only difference between Normalized Device Coordinates (NDCS) and Clip Space (CCS) is, that CCS is before the perspective divide and NDCS is afterwards. The reason why clipping doesn't work well in NDCS is that the perspective

How do I draw simple graphics in C#?

末鹿安然 提交于 2019-11-27 05:51:36
问题 I just want to draw simple 2D objects like circle, line, square etc in C#. How do I do that? Back in the Turbo C++ days I remember initializing some graphics library for doing the same. Do I need to do something similar in .NET? Is it any different for 3D objects? Will things like DirectX make this any easier? Any links to tutorials or samples much appreciated. 回答1: As others have said, check out System.Drawing. (I'm only repeating that for completeness.) System.Drawing exposes the GDI+

Unresolved external symbol __vsnprintf … (in dxerr.lib)?

北城余情 提交于 2019-11-27 05:22:22
问题 I am running a DirectX 11 application on windows 7 and visual studio community 2015 RC. I'm still using functions from the DX SDK. It worked fine on VS2013 but when I switched over I get only the following error: Error LNK2019 unresolved external symbol __vsnprintf referenced in function "long __stdcall StringVPrintfWorkerA(char *,unsigned int,unsigned int *,char const *,char *)" (?StringVPrintfWorkerA@@YGJPADIPAIPBD0@Z) Ancora D:\Moody\Moody\Projects\Projects\Ancora\Ancora\dxerr.lib(dxerra

Desktop Duplication API & switchable graphics

老子叫甜甜 提交于 2019-11-27 03:41:08
问题 The problem : calling IDXGIOutput1::DuplicateOutput method returns DXGI_ERROR_UNSUPPORTED when you run an application using discrete graphics controller on a machine with switchable graphics. This answer shed some light on the issue. In short, the discrete graphics renders only a part of the screen and sends the data to the framebuffer of the intergrated graphics controller -- in other words all output always goes through the integrated graphics controller. It seems that this is why

How to compile a DirectX 11 app in MinGW

会有一股神秘感。 提交于 2019-11-27 03:24:19
问题 I've looked, and I can't find any material relating to using Direct3d 10 or 11 with MinGW. What do I have to do to get things working? I'm getting errors in the header files supplied by the DX SDK. And don't anyone even think of suggesting Visual Studio. 回答1: It seems that here it is explained how to get DX headers from SDK work with MinGW: http://d.hatena.ne.jp/tbk/20110115/1295080728 Use Google Translate to translate page to english. Alternatively try using DirectX headers from mingw64

Capture screen using DirectX

血红的双手。 提交于 2019-11-27 03:06:39
I know how to use GDI to capture screen, however it is very slow (it barely captures 10 fps) I have read that DirectX offers the best speed. But before I start learning DirectX I wanted to test a sample to see if it is really that fast. I have found this question that offers a sample code to do that: void dump_buffer() { IDirect3DSurface9* pRenderTarget=NULL; IDirect3DSurface9* pDestTarget=NULL; const char file[] = "Pickture.bmp"; // sanity checks. if (Device == NULL) return; // get the render target surface. HRESULT hr = Device->GetRenderTarget(0, &pRenderTarget); // get the current adapter

How to achieve smooth tangent space normals?

久未见 提交于 2019-11-27 02:02:45
I'm trying to add bump mapping functionality to my application but I'm getting very faceted models: The reason it is happening is because I'm calculating tangent, binormal and normal on per face basis and completely ignoring the normals I'm getting from the model file. The calculation currently uses two edges of the triangle and texture space vectors to get tangent and binormal, which are then used to calculate normal by cross product. It is all done on the CPU as soon as the model loads and the values are then stored as a part of model's geometry. vector1 = vertex2.coords - vertex1.coords;

How do I capture the audio that is being played?

一曲冷凌霜 提交于 2019-11-27 00:11:13
问题 Does anyone know how to programmatically capture the sound that is being played (that is, everything that is coming from the sound card, not the input devices such as a microphone). 回答1: Assuming that you are talking about Windows, there are essentially three ways to do this. The first is to open the audio device's main output as a recording source. This is only possible when the driver supports it, although most do these days. Common names for the virtual device are "What You Hear" or "Wave