directx-9

How to get the screenshot of the desktop from back buffer with DirectX

喜欢而已 提交于 2019-11-30 09:16:45
问题 I asked how to take the screen shot in DirectX and "Use GetFrontBufferData()" was answered. However, "This function is very slow, by design, and should not be used in any performance-critical path" was described at MSDN. When I asked other persons the measure, "Transfer the data of a back buffer to the system memory" was answered. But, I was not able to find a concrete method. This is an example of failure. Please let me know the right code. #include <stdio.h> #include <Windows.h> #include

How to get the screenshot of the desktop from back buffer with DirectX

丶灬走出姿态 提交于 2019-11-29 14:16:04
I asked how to take the screen shot in DirectX and "Use GetFrontBufferData()" was answered. However, "This function is very slow, by design, and should not be used in any performance-critical path" was described at MSDN . When I asked other persons the measure, "Transfer the data of a back buffer to the system memory" was answered. But, I was not able to find a concrete method. This is an example of failure. Please let me know the right code. #include <stdio.h> #include <Windows.h> #include <d3d9.h> #include <d3dx9tex.h> void main() { CoInitialize(NULL); HWND hwnd = GetDesktopWindow();

Cannot open include file “d3dx9.h”

时间秒杀一切 提交于 2019-11-28 23:12:52
Edit: Of course, immediately after working on it for an hour then posting here, I found the stupid mistake... I'm getting compiler errors when trying to #include <d3dx9.h> in a project. I'm receiving "fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory". I do have the DirectX SDK installed (I also just tried reinstalling it to no avail). In the Project Properties: VC++ Directories are set to " $(DXSDK_DIR)Include;$(IncludePath) " and " $(DXSDK_DIR)Lib\x86;$(LibraryPath) " for Include and Library directories respectively for all configurations—and the environment

Cannot open include file “d3dx9.h”

对着背影说爱祢 提交于 2019-11-27 14:36:52
问题 Edit: Of course, immediately after working on it for an hour then posting here, I found the stupid mistake... I'm getting compiler errors when trying to #include <d3dx9.h> in a project. I'm receiving "fatal error C1083: Cannot open include file: 'd3dx9.h': No such file or directory". I do have the DirectX SDK installed (I also just tried reinstalling it to no avail). In the Project Properties: VC++ Directories are set to " $(DXSDK_DIR)Include;$(IncludePath) " and " $(DXSDK_DIR)Lib\x86;$

Can I generate a random number inside a pixel shader?

耗尽温柔 提交于 2019-11-27 12:56:11
I'm trying to write a very simple shader that adds random sparkle to applicable objects. The way I'd like to do this is by adding a random shade of white (R = G = B) to the pixel value within the pixel shader. It seems that noise() doesn't work the way I hope it does: float multiplier = noise(float3(Input.Position[0], Input.Position[1], time)); It gives me "error X4532: cannot map expression to pixel shader instruction set" referring to the call to noise() . Since I don't know of a way to retain a number between calls to the shader, I don't think I can just write a simple random number

Can I generate a random number inside a pixel shader?

巧了我就是萌 提交于 2019-11-26 16:22:29
问题 I'm trying to write a very simple shader that adds random sparkle to applicable objects. The way I'd like to do this is by adding a random shade of white (R = G = B) to the pixel value within the pixel shader. It seems that noise() doesn't work the way I hope it does: float multiplier = noise(float3(Input.Position[0], Input.Position[1], time)); It gives me "error X4532: cannot map expression to pixel shader instruction set" referring to the call to noise() . Since I don't know of a way to