directx

Doing readback from Direct3D textures and surfaces

依然范特西╮ 提交于 2019-11-28 06:56:48
I need to figure out how to get the data from D3D textures and surfaces back to system memory. What's the fastest way to do such things and how? Also if I only need one subrect, how can one read back only that portion without having to read back the entire thing to system memory? In short I'm looking for concise descriptions of how to copy the following to system memory : a texture a subset of a texture a surface a subset of a surface a D3DUSAGE_RENDERTARGET texture a subset of a D3DUSAGE_RENDERTARGET texture This is Direct3D 9, but answers about newer versions of D3D would be appreciated too.

DirectX 11 framebuffer capture (C++, no Win32 or D3DX)

北战南征 提交于 2019-11-28 06:06:05
I would like to capture the contents of my front or back buffer using DirectX 11 into an array of bytes which I can then use as a texture or as a source for creating a file. I have a swap chain setup, lots of rendering happening and the following code so far - which I make sure to call after the call to Present. ID3D11Texture2D* pSurface; HRESULT hr = m_swapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D ), reinterpret_cast< void** >( &pSurface ) ); if( pSurface ) { const int width = static_cast<int>(m_window->Bounds.Width * m_dpi / 96.0f); const int height = static_cast<int>(m_window->Bounds

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

吃可爱长大的小学妹 提交于 2019-11-28 04:44:11
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.obj) 1 I only use the DXGetErrorDescriptionA function from the dxerr library and when I comment it out,

How to eliminate tearing from animation?

爱⌒轻易说出口 提交于 2019-11-28 04:10:34
问题 I'm running an animation in a WinForms app at 18.66666... frames per second (it's synced with music at 140 BPM, which is why the frame rate is weird). Each cel of the animation is pre-calculated, and the animation is driven by a high-resolution multimedia timer. The animation itself is smooth, but I am seeing a significant amount of "tearing", or artifacts that result from cels being caught partway through a screen refresh. When I take the set of cels rendered by my program and write them out

How do I capture the audio that is being played?

人走茶凉 提交于 2019-11-28 03:59:15
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). 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 Out". You will need to use a suitable API (see WaveIn or DirectSound in MSDN) to do the capturing. The

DirectX/C++ 3D Engine programming: Learn now, or wait for DirectX 12? [closed]

六月ゝ 毕业季﹏ 提交于 2019-11-28 01:32:29
I'm a relatively ok-ish programmer, but my main focus has been in application development with C# so far. I have almost zero experience with game development and 3d engines - I've begun reading up on how 3d Engines work in general, e.g. there was a wonderful guide explaining how to develop a very simple software-based 3D engine in C#. Very helpful, but that pretty much summarizes my whole experience with the topic. Also, I haven't really been working with C++ much so far (even though I'm aware of the basic conceptual differences to C#, and would consider getting up to at least "sufficient"

Whole screen capture and render in DirectX [PERFORMANCE]

自闭症网瘾萝莉.ら 提交于 2019-11-28 01:01:33
问题 I need some way to get screen data and pass them to DX9 surface/texture in my aplication and render it at at least 25fps at 1600*900 resolution, 30 would be better. I tried BitBliting but even after that I am at 20fps and after loading data into texture and rendering it I am at 11fps which is far behind what I need. GetFrontBufferData is out of question. Here is something about using Windows Media API , but I am not familiar with it. Sample is saving data right into file, maybe it can be set

Alternative to __uuidof in C

梦想与她 提交于 2019-11-27 23:42:20
问题 I'm working with a C project that's using DirectX and I've run into a problem. Certain DX calls require a IID object, typically generated with __uuidof . One thing this is required for is creating a RenderTargetView. The DirectX samples/tutorials do this: ID3D11Texture2D* pBackBuffer = NULL; hr = g_pSwapChain->GetBuffer( 0, __uuidof( ID3D11Texture2D ), ( LPVOID* )&pBackBuffer ); When I try to call __uuidof in my C code, I get an compiler error: Error 19 error C4233: nonstandard extension used

Non-interleaved vertex buffers DirectX11

感情迁移 提交于 2019-11-27 21:57:17
问题 If my vertex positions are shared, but my normals and UVs are not (to preserve hard edges and the likes), is it possible to use non-interleaved buffers in DirectX11 to solve this memory representation, such that I could use indice buffer with it? Or should I stick with duplicated vertex positions in an interleaved buffer? And is there any performance concerns between interleaved and non-interleaved vertex buffers? Thank you! 回答1: How to There are several ways. I'll describe the simplest one.

How to overlay graphics on Windows games?

安稳与你 提交于 2019-11-27 19:54:01
I want my program to be able to launch any Windows game, and while the user is playing it, intermittently display some text or pictures in some part of the game window. The game may be in windowed or full-screen mode. From what I have been able to figure out from online resources, this could be done using a graphics library that supports overlays and using Windows Hooks to keep track of the target application's window. In this context I have some questions. Will the overlays affect the game's performance? How will hooking the application affect performance? Is there any other way one could