directx

How to detect when a WPF control has been redrawn?

China☆狼群 提交于 2021-02-19 03:34:04
问题 I am using D3DImage to display a sequence of frames that are rendered unto the same Direct3D Surface one after the other. My current logic is thus: Display last rendered frame (i.e.D3DImage.Lock()/AddDirtyRect()/Unlock()) Start rendering next frame Wait for next frame to be ready and that it's time to display it Display last rendered frame ... The problem with this approach is that when we are done calling Unlock() on D3DImage, the image isn't actually copied, it's only scheduled to be copied

How to detect when a WPF control has been redrawn?

丶灬走出姿态 提交于 2021-02-19 03:33:09
问题 I am using D3DImage to display a sequence of frames that are rendered unto the same Direct3D Surface one after the other. My current logic is thus: Display last rendered frame (i.e.D3DImage.Lock()/AddDirtyRect()/Unlock()) Start rendering next frame Wait for next frame to be ready and that it's time to display it Display last rendered frame ... The problem with this approach is that when we are done calling Unlock() on D3DImage, the image isn't actually copied, it's only scheduled to be copied

Simplest way to draw line in DirectX 11 (C++)?

假如想象 提交于 2021-02-18 18:15:15
问题 I want to draw a line in my DirectX 11 application. I want it to have constant width (not depending on distance from camera), but it has to be a line in space (3D) , so something like lines of objects in wireframe mode . I will render my line in a scene full of other objects with some shaders. What would be the best and simplest way to achive it in DirectX 11 with C++ (not C#)? Code sample will be appreciated ;) 回答1: The most common solution would be to use D3D11_PRIMITIVE_TOPOLOGY_LINELIST

Increase precision in DirectX with high range positions?

依然范特西╮ 提交于 2021-02-16 13:12:34
问题 I am creating an little game in c++ with directx 9 with a randomly created world and have an issue when the player goes far from the 3d origins (0,0,0) 3d rendering become very imprecise causing visual issues. I think it's because the values sent to the shader are floats and floats become less precise when increasing. I though about a solution to move all the models instead of moving the camera but it makes more calculating, I 'm afraid about the possible performances decrease. Is there a

Increase precision in DirectX with high range positions?

假装没事ソ 提交于 2021-02-16 13:10:12
问题 I am creating an little game in c++ with directx 9 with a randomly created world and have an issue when the player goes far from the 3d origins (0,0,0) 3d rendering become very imprecise causing visual issues. I think it's because the values sent to the shader are floats and floats become less precise when increasing. I though about a solution to move all the models instead of moving the camera but it makes more calculating, I 'm afraid about the possible performances decrease. Is there a

Drawing visual behind a window using directx

孤者浪人 提交于 2021-02-11 17:17:09
问题 Is there any way to draw the content behind a window using directx. For example: the magnifier used by windows. I was trying to achieve the acrylic blur effect of windows 10. What I need to do is to capture the portion behind the window and blur it using direct 2D Gaussian Blur effect. So is there any way to get the backdrop (visual behind the window) using direct x? Note: i tried using magnifier api of windows and it is flickering the screen while resizing or moving the window Here is a

Drawing visual behind a window using directx

淺唱寂寞╮ 提交于 2021-02-11 17:12:12
问题 Is there any way to draw the content behind a window using directx. For example: the magnifier used by windows. I was trying to achieve the acrylic blur effect of windows 10. What I need to do is to capture the portion behind the window and blur it using direct 2D Gaussian Blur effect. So is there any way to get the backdrop (visual behind the window) using direct x? Note: i tried using magnifier api of windows and it is flickering the screen while resizing or moving the window Here is a

How to make directShow to Create graph automatically with available filters

让人想犯罪 __ 提交于 2021-02-11 13:30:57
问题 I want to use the Medialooks multisource filter in my application, This has entry in HKEY_CURRENT_USER\SOFTWARE\Classes\CLSID\ But still i have to Add this filter manually using CLS_ID and AddFilter Function. Is there any way so that Renderfile function of Dshow will automatically creates a graph by enumerating the filters from registry Checked in Grphedt tool but if i manually insert and connect Filters I can play the videos properly.Otherwise it wont render automatically by building the

Direct Composition, IDCompositionGaussianBlurEffect Throwing Access Violation Exception

霸气de小男生 提交于 2021-02-10 22:42:22
问题 I was working on a project which uses direct composition based on this Article: Windows with C++ : High-Performance Window Layering Using the Windows Composition Engine I was able to recreate the example and it is working. Currently i'm trying to apply IDCompositionGaussianBlurEffect to My Visual (variable: visual) but the Compiler Throws an Access Violation Exception. Is there any way to Apply the Blur Effect on to my visual using Direct Composition. The Exception: Exception thrown at

Failing to properly initialize a 2D texture from memory in Direct3D 11

白昼怎懂夜的黑 提交于 2021-02-10 15:28:13
问题 I am trying to produce a simple array in system memory that represent a R8G8B8A8 texture and than transfer that texture to the GPU memory. First, I allocate an array and fill it with the desired green color data: frame.width = 3; frame.height = 1; auto components = 4; auto length = components * frame.width * frame.height; frame.data = new uint8_t[length]; frame.data[0 + 0 * frame.width] = 0; frame.data[1 + 0 * frame.width] = 255; frame.data[2 + 0 * frame.width] = 0; frame.data[3 + 0 * frame