directx

DirectX 9 or 10 Overlay

梦想的初衷 提交于 2019-12-23 06:15:21
问题 How is it possible to draw an overlay over an game with DirectX 9 or 10? I found code with deprecated DirectShow code, but it will not run. 回答1: If this is what you have already found then ignore it, but try this: Direct3D Hooking Example 来源: https://stackoverflow.com/questions/1421487/directx-9-or-10-overlay

FreeType generates multiple textures

守給你的承諾、 提交于 2019-12-23 06:14:18
问题 I'm trying to use FreeType under DirectX 11, in order to draw some text on my screen. For the moment i'm able to convert a FT_Bitmap* to a ID3D11Texture2D* , then I create a ID3D11ShaderResourceView* . I then use a shader to draw this shader resource view. The problem is that this code only draws the last letter of the text 4 times , and I don't really see why. First, here is how I render a UI Element : Graph.cpp : void Graph::DrawSprite(Object* p_object) { /*...*/ // Problem here Text* text

DX12 Descriptor Heaps management

前提是你 提交于 2019-12-23 06:06:15
问题 So after watching the dx12 binding videos and reading through some docs, I'm not 100% sure if I understood correctly how to manage my heaps. Let me explain what I wan't to achieve in my application: During the initialisation, I'll be filling two heaps, one holding Samplers and the other one holding SRV, CBV and UAV. Those heaps will contain all the resources the application will be using during its life time. Now starts the interesting part. To build the Root Signatures, I'll be using for the

which header file contains ThrowIfFailed() in DirectX 12

强颜欢笑 提交于 2019-12-23 05:46:51
问题 some part of code image, another part of code image, I am beginner to DirectX 12 (or Game Programming) and studying from Microsoft documentation. While using function ThrowIfFailed() I get an error from intellisense of vs2015 editor This declaration has no storage class or type specifier. Can anyone help. 回答1: As you are new to DirectX programming, I strongly recommend starting with DirectX 11 rather than DirectX 12. DirectX 12 assumes you are already an expert DirectX 11 developer, and is a

c++ first person camera in directx

十年热恋 提交于 2019-12-23 04:49:10
问题 m a beginner programmer and im creating a project which allows me to walk around rooms via a first person camera so far i have the buildings drawn etc but now im stuck and don't know how to make a first person camera to allow me to walk around could anyone point me towards a camera class i could use or some useful code? thanks in advance below is the code for one of my buildings but not my full project, its rotating so i could see what i was drawing. i want to be able to move forwards and

DirectX 11 backward compatibility

耗尽温柔 提交于 2019-12-23 04:28:53
问题 I am learning DirectX by following code examples from here. I am at Code Set 1, chapter 6 Box code example. When I try to compile code of chapter 6 in DirectX 11 compatible machine, it runs fine but when I run that code in FEATURE LEVEL of directX 10 in DirectX 11 machine with shader 5.0 //d3App.cpp. //In InitDirect3D() method D3D_FEATURE_LEVEL a[]={D3D_FEATURE_LEVEL_10_0}; HRESULT hr = D3D11CreateDevice( 0, // default adapter md3dDriverType, 0, // no software device createDeviceFlags, a, 1,

Find out DirectX Version

和自甴很熟 提交于 2019-12-23 04:04:08
问题 how can you detect if the directx version on a windows 7 machine is 11 or 11.1 ? preferably using a .NET language maybe via PInvoke or SharpDX? 回答1: Just try to create a device with a specific feature level (along with other parameters). In native code (use one of the D3D11CreateDevice* functions) . If function will not succeed - feature level is not supported. To make it easier, we usually pass array of feature levels, and then, if device is not nullptr , we can check which one is highest

directx - texture render result is incorrect

佐手、 提交于 2019-12-23 02:20:36
问题 case 1 : I create the texture by D3DXCreateTexture(device, width, height, 0, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &texture) and update the texture with white color. D3DLOCKED_RECT lr; HRESULT hr = texture->LockRect(0, &lr, NULL, 0); ConvertRGB2RGBA(width, height, pixels, stride, (unsigned char*)(lr.pBits), lr.Pitch); texture->UnlockRect(0); the render result shows as: What I want is pure white on the surface. The z value of all the vertexes equals to 0.0f. case 2 : If I create

directx - texture render result is incorrect

随声附和 提交于 2019-12-23 02:20:12
问题 case 1 : I create the texture by D3DXCreateTexture(device, width, height, 0, D3DUSAGE_DYNAMIC, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &texture) and update the texture with white color. D3DLOCKED_RECT lr; HRESULT hr = texture->LockRect(0, &lr, NULL, 0); ConvertRGB2RGBA(width, height, pixels, stride, (unsigned char*)(lr.pBits), lr.Pitch); texture->UnlockRect(0); the render result shows as: What I want is pure white on the surface. The z value of all the vertexes equals to 0.0f. case 2 : If I create

Is there anyway to know when the screen has been updated/refreshed (OpenGL or DirectX maybe?)

﹥>﹥吖頭↗ 提交于 2019-12-22 18:29:16
问题 I currently have an application I'm writing in c# (using .NET) that requires me to start a timer as soon as a user sees an image on screen up until they respond with a key press. Now I realise that practically this is very difficult given the monitor input lag and response time, the time the keyboard takes to physically send the message, the OS to process it, etc. But I'm trying my best to reduce it down to mostly a constant error (the response time results will be used to compare one user to