directx

How to access pixels data from ID3D11Texture2D?

时光怂恿深爱的人放手 提交于 2021-02-02 08:28:13
问题 I'm using Windows Desktop Duplication API to make my own mirroring protocol. I have this piece of code : // Get new frame HRESULT hr = m_DeskDupl->AcquireNextFrame(500, &FrameInfo, &DesktopResource); if (hr == DXGI_ERROR_WAIT_TIMEOUT) { *Timeout = true; return DUPL_RETURN_SUCCESS; } Here is the FrameInfo structure : `typedef struct _FRAME_DATA { ID3D11Texture2D* Frame; DXGI_OUTDUPL_FRAME_INFO FrameInfo; _Field_size_bytes_((MoveCount * sizeof(DXGI_OUTDUPL_MOVE_RECT)) + (DirtyCount * sizeof

How to access pixels data from ID3D11Texture2D?

坚强是说给别人听的谎言 提交于 2021-02-02 08:26:16
问题 I'm using Windows Desktop Duplication API to make my own mirroring protocol. I have this piece of code : // Get new frame HRESULT hr = m_DeskDupl->AcquireNextFrame(500, &FrameInfo, &DesktopResource); if (hr == DXGI_ERROR_WAIT_TIMEOUT) { *Timeout = true; return DUPL_RETURN_SUCCESS; } Here is the FrameInfo structure : `typedef struct _FRAME_DATA { ID3D11Texture2D* Frame; DXGI_OUTDUPL_FRAME_INFO FrameInfo; _Field_size_bytes_((MoveCount * sizeof(DXGI_OUTDUPL_MOVE_RECT)) + (DirtyCount * sizeof

C2065 undeclared identifier

人走茶凉 提交于 2021-01-29 18:19:05
问题 I have got a problem but I don't know why. I'm fallowing this to learn DirectX. I used this to configure the solution. This is my code: Header: #include <d3d11.h> #include <d3dx11.h> #include <d3d10.h> #include <d3dx10.h> #include <dxgi.h> #include <Windows.h> #include <windowsx.h> #pragma comment (lib, "d3d11.lib") #pragma comment (lib, "d3dx11.lib") #pragma comment (lib, "d3dx10.lib") class HelloWorld { private: IDXGISwapChain* swapchain; ID3D11Device* dev; ID3D11DeviceContext* devcon;

DirectX C# SolidBrush is drawing white

风格不统一 提交于 2021-01-29 07:29:07
问题 I want to draw on a window. To do that I created several brushes. For testing I used a normal red (255, 0, 0). Now I want to use more specific color like a 198, 17, 17 red. I am creating the brush like this: SolidColorBrush _redBrush = new SolidColorBrush(_device, new RawColor4(198, 17, 17, 1)); When I now draw in the window it is not red instead it is just white. Could anyone please tell me what is wrong with this and how I can draw with the color I actually want? Sorry if this is a really

DirectX 9 to 11 OpenSharedResource is leaking memory like crazy. Am I doing something wrong?

北城以北 提交于 2021-01-29 06:17:53
问题 I've been fighting a memory leak in my software, where the virtual address space of my application is slowly used up by shared memory. Based on the amount of memory leaked, it was very clearly in the form of texture objects. I've isolated the bug to the following code sample. I created a share-able DX9 texture object, I open it from a D3D11 device, and then I release it. In this sample, running on my NVIDIA GeForce 780 Ti on Windows 8.1, my 32-bit process very quickly runs out of VAS as these

How to disable Direct3D Acceleration on Windows 7?

拈花ヽ惹草 提交于 2021-01-29 05:49:13
问题 I have tried to disable 3D acceleration on my machine that operation system is Windows 7. I opened the DirectX Diagnostic Tool but DirectX Features can not be changed: In addition I also tried to change Troubleshoot settings. However, it also can't be changed: How can i disable directX featrues? Note: My directX version is 11. 回答1: If you mean for your own application, you can disable GPU hardware acceleration by opting for the WARP driver type ( D3D_DRIVER_TYPE_WARP ) when creating the

Overlay the word/number in the Windows game fullscreen (like in Fraps)

拜拜、爱过 提交于 2021-01-29 03:16:02
问题 I think a lot of people used application "Fraps" for recording video from game. I use it for displaying FPS (frames per second) in the games. Fraps can show digits at the corner of screen when game runs. I want to display core temperature of processor. The temperature I will find, but I need to khow, how can I display it in the game? (I need it for testing core temperatures in the game, because stress tests of Everest/AIDA64 doesn't much load the system). Want to use C# (but can listen to all

(DirectX 11) Dynamic Vertex/Index Buffers implementation with constant scene content changes

回眸只為那壹抹淺笑 提交于 2021-01-27 23:39:43
问题 Been delving into un-managed DirectX 11 for the first time (bear with me) and there's an issue that, although asked several times over the forums still leaves me with questions. I am developing as app in which objects are added to the scene over time. On each render loop I want to collect all vertices in the scene and render them reusing a single vertex and index buffer for performance and best practice. My question is regarding the usage of dynamic vertex and index buffers. I haven't been

How are multiple page views created in a game?

て烟熏妆下的殇ゞ 提交于 2021-01-27 14:31:39
问题 Many game examples/tutorials focus only on the rendering of the main game and don't show the rest of the game, like the first landing page, splash screen, high scores page, credits page and so on. For something like DirectX and XNA, how are these other screens created/rendered? 回答1: Alternatively to the Microsoft sample mentioned by Davidsbro, if you wanted to create your own basic game state management system you could do so through the use of an enum switch. For this approach you would

DXGI fails to scan 60 fps pixels

本小妞迷上赌 提交于 2020-12-15 05:26:34
问题 #include "D3D9.h" #include <Wincodec.h> #include <chrono> #include <shellapi.h> #include <d3d11.h> #include <dxgi1_2.h> #include <Atlbase.h> #include <comdef.h> #include <windows.h> #include <shlobj.h> #include <shellapi.h> #include <dxgi1_2.h> #include <d3d11.h> #include <memory> #include <algorithm> #include <string> #include <iostream> #pragma comment(lib, "D3D11.lib") #pragma comment(lib, "D3d9.lib") #pragma comment(lib, "dxgi.lib") #pragma comment(lib, "gdi32.lib") //using namespace