directx

DirectX11 ClearRenderTargetViewback with transparent buffer?

时光总嘲笑我的痴心妄想 提交于 2020-01-04 17:50:14
问题 I'm trying to create a window that uses directx to draw opaque content on top of a transparent view (i.e. the desktop shows through). With DirectX11 I'm trying to do the following, but it's not making the background transparent. In fact, any opacity value I put in gives me the exact same results. What I'm doing: float color[4] = { 0.0f, 0.0f, 0.0f, 0.0f }; deviceContext->ClearRenderTargetView(backBuffer, color); Working repro code (main.cpp): #include <Windows.h> #include <windowsx.h> #pragma

Creating spherical meshes with Direct x?

筅森魡賤 提交于 2020-01-04 15:17:13
问题 How do you go about creating a sphere with meshes in Direct-x? I'm using C++ and the program will be run on windows, only. Everything is currently rendered through an IDiRECT3DDEVICE9 object. 回答1: You could use the D3DXCreateSphere function. 回答2: There are lots of ways to create a sphere. One is to use polar coordinates to generate slices of the sphere. struct Vertex { float x, y, z; float nx, ny, nz; }; Given that struct you'd generate the sphere as follows (I haven't tested this so I may

(DirectX) Generating a rotation matrix to match a vector

纵然是瞬间 提交于 2020-01-04 14:03:28
问题 How can I take a vector and generate a matrix that will rotate a mesh to face along that vector? Specifics: I want the model for my player to rotate to face the direction that the camera is looking. Right now, it always points in the direction it started in, and turning just makes the camera look at the player's side. I have experimented with D3DXMatrixYawPitchRoll, with partial success. However, I noticed some drift in time from perfect alignment, and it had some strange wobbly issues when I

DirectX and WPF

时光总嘲笑我的痴心妄想 提交于 2020-01-04 02:18:47
问题 I am trying to develop an application where the UI part is designed by WPF and the engine is developed using C++. I am trying to render a scene using DirectX in native code by getting the window's handle from WPF using WindowsFormsHost method. Though i do not get any error, no image renders on the screen. As far as the handle is concerned, I dont see a problem because when i render the scene using OpenGL using the same handle in native code, it works properly. As far as the initialization

Prevent screen capturing softwares to capture an application screen

℡╲_俬逩灬. 提交于 2020-01-03 20:39:33
问题 I am working on examination system, as a security part of the system I don't want anyone should leak the paper by screen recording or by giving remote using so many free applications for desktop sharing. First I searched for can I block such applications? But I don't think so, as there so many ways to record/share a screen. Then I got to know about HDCP but I guess it will only application to videos and not to HTML (correct me if I am wrong). SO I want something like HDCP or VLC player's

Multisampling doesn't work in exclusive mode

自闭症网瘾萝莉.ら 提交于 2020-01-03 13:58:32
问题 I would like to enable multisampling when drawing triangles like on the following picture: I found a way to do with SlimDX in another question but it doesn't work in exclusive mode. Here is my code: void Form1_Load(object sender, EventArgs e) { Direct3D d3d = new Direct3D(); PresentParameters presentParams; presentParams.Windowed = false; presentParams.BackBufferFormat = Format.X8R8G8B8; presentParams.BackBufferWidth = 800; presentParams.BackBufferHeight = 600; presentParams

Multisampling doesn't work in exclusive mode

那年仲夏 提交于 2020-01-03 13:55:41
问题 I would like to enable multisampling when drawing triangles like on the following picture: I found a way to do with SlimDX in another question but it doesn't work in exclusive mode. Here is my code: void Form1_Load(object sender, EventArgs e) { Direct3D d3d = new Direct3D(); PresentParameters presentParams; presentParams.Windowed = false; presentParams.BackBufferFormat = Format.X8R8G8B8; presentParams.BackBufferWidth = 800; presentParams.BackBufferHeight = 600; presentParams

Native WPF vs. Custom DirectX for displaying large images

隐身守侯 提交于 2020-01-03 11:35:14
问题 I need to speed up my image viewer, and wondering if I should be looking into creating my own DirectX control to do so. My image viewer displays medical images. They can be pretty large. We're talking 55mb when it comes to mammography. The pixel data is 16bit greyscale stored in a ushort array. Without getting into the gory details, my current approach is loading the pixel data into an ImageSource, and using the WPF Image control. I've never done anything with DirectX. Is it worth diving into

Native WPF vs. Custom DirectX for displaying large images

旧巷老猫 提交于 2020-01-03 11:35:13
问题 I need to speed up my image viewer, and wondering if I should be looking into creating my own DirectX control to do so. My image viewer displays medical images. They can be pretty large. We're talking 55mb when it comes to mammography. The pixel data is 16bit greyscale stored in a ushort array. Without getting into the gory details, my current approach is loading the pixel data into an ImageSource, and using the WPF Image control. I've never done anything with DirectX. Is it worth diving into

UWP Game Capture on Xbox DirectX or MMF

时光总嘲笑我的痴心妄想 提交于 2020-01-03 06:39:11
问题 I'm investigating building a "Game Capture" App that works within UWP on Xbox One, as for capturing the actual content of the screen during game-play, it appears there are two ways to go within the wider eco-system of Microsoft libraries: DirectX (Now part of Windows API) Microsoft Media Foundation With that in mind, my assumption is that DirectX is natively accessible by UWP apps via the Windows Runtime API, and aside from limitations on the DirectX feature-sets and hardware, basic APIs