directx

Hooking DirectX EndScene from an injected DLL

给你一囗甜甜゛ 提交于 2019-11-26 11:54:19
问题 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

The purpose of Model View Projection Matrix

懵懂的女人 提交于 2019-11-26 08:42:32
问题 For what purposes are we using Model View Projection Matrix? Why do shaders require Model View Projection Matrix? 回答1: The model, view and projection matrices are three separate matrices. Model maps from an object's local coordinate space into world space, view from world space to camera space, projection from camera to screen. If you compose all three, you can use the one result to map all the way from object space to screen space, making you able to work out what you need to pass on to the

Take screenshot of DirectX full-screen application

*爱你&永不变心* 提交于 2019-11-26 08:09:01
问题 This boggles me. DirectX bypasses everything and talks directly to the device driver, thus GDI and other usual methods won\'t work - unless Aero is disabled (or unavailable), all that appears is a black rectangle at the top left of the screen. I have tried what other have suggested on several forums, using DirectX to get the back buffer and save it, but I get the same result: device->GetFrontBufferData(0, surface); D3DXSaveSurfaceToFile(\"fileName\", D3DXIFF_BMP, surface, NULL, NULL); Is

Capture screen using DirectX

一笑奈何 提交于 2019-11-26 08:05:18
问题 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

Overlaying on a 3D fullscreen application

本小妞迷上赌 提交于 2019-11-26 07:23:58
问题 I want to display some custom graphics on top of a 3rd party fullscreen Windows application. Have you played any Steam games? It has an executable, GameOverlayUI.exe that lets you access Steam windows from within a game. (The GUI elements look custom-drawn, I don\'t know if that is a necessity; but they look exactly the same inside a game as they do on the desktop.) It even goes as far to \'dim\' the game graphics in the background. I\'m wondering how one could go about writing such an

Implementing Ray Picking

旧城冷巷雨未停 提交于 2019-11-26 06:21:03
问题 I have a renderer using directx and openGL, and a 3d scene. The viewport and the window are of the same dimensions. How do I implement picking given mouse coordinates x and y in a platform independent way? 回答1: If you can, do the picking on the CPU by calculating a ray from the eye through the mouse pointer and intersect it with your models. If this isn't an option I would go with some type of ID rendering. Assign each object you want to pick a unique color, render the objects with these

How to smooth ugly jitter/flicker/jumping when resizing windows, especially dragging left/top border (Win 7-10; bg, bitblt and DWM)?

99封情书 提交于 2019-11-26 04:44:08
问题 THE PROBLEM: When I grab the resize border of my Windows app, especially the top or left borders, and resize the window, the contents of the window do resize \"live\" as I drag, but they resize in a hideous manner that looks like a blatant bug to even the most novice user: the contents at the opposite edge of the window from the edge I am dragging jitter/flicker/jump back and forth wildly. Depending on the situation, the phenomenon may look like: contents that seem to walk off the edge of the