directx

Why not use GDI to repeatedly fill a window with RGB data from an array?

六月ゝ 毕业季﹏ 提交于 2019-12-03 01:55:35
This is a follow-up to this question . I'm currently writing a simple game and am looking for the fastest way to (repeatedly) display an array of RGB data in a Win32 window, without flickering or other artifacts. Several different approaches were recommended in the answers to the previous question, but there was no consensus on which would be the fastest. So, I threw together a test program. The code simply displays a framebuffer on the screen repeatedly, as fast as possible. These are the results I obtained, for 32-bit data running in a 32-bit video mode - they may surprise some people: -

Why is there no DirectX API for Linux?

匆匆过客 提交于 2019-12-03 01:49:19
Upon considering the driver side implementation for DirectX API on windows systems for modern video cards I was wondering why this implementation is not available on non-windows system, most notably linux. Since there is an obvious absence of this functionality I can only assume there is a good reason which I am blind to, but in my primitive understanding I simply see the DirectX calls as no more than function entry points on the hardware device. And for the record I am not referring to a compatibility layer (most notably WINE, a project I am amazed by every single day) but a library making

Problems to understand DXGI DirectX 11 Desktop Duplication to get a Buffer or Array

匿名 (未验证) 提交于 2019-12-03 01:36:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I want to understand DXGI Desktop Duplication. I have read a lot and this is the code I copied from parts of the DesktopDuplication sample on the Microsoft Website. My plan is to get the Buffer or Array from the DesktopImage because I want to make a new Texture for an other program. I hope somebody can explain me what I can do to get it. void DesktopDublication::GetFrame(_Out_ FRAME_DATA* Data, _Out_ bool* Timeout) { IDXGIResource* DesktopResource = nullptr; DXGI_OUTDUPL_FRAME_INFO FrameInfo; // Get new frame HRESULT hr = m_DeskDupl-

Using Qt with DirectX?

匿名 (未验证) 提交于 2019-12-03 01:08:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: What exactly are my options? I have programs I need to write in OpenGL and DirectX , and I'd like to use Qt for OpenGL, and not have to re-implement half my program for the DirectX components of my task. I've looked on Google and I have found references to people complaining about Direct3D being a dependency of Qt, and people talking about implementing QD3DWidget sub-classing QWidget in a similar fashion to QGLWidget, yet nobody talked about how to implement it or where any examples are. I need help. I want to know if it is

DirectX Lighting

匿名 (未验证) 提交于 2019-12-03 01:05:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Hi. I've got a small game using directX10 and C++. However, I started making it using the meshloaderfromOBJ10 direct X sample and I have just been building on it. However, my objects are all looking just plain black althought they have colour. I know this is because of the light, but seemingly changing any of the code to do with the light does nothing from this sample. I was wondering if anyone knows a simple(ish) method to just light everything, as in make it bright everywhere. I don't care about shadows or reflection or anything

用DirectX 12进行3D游戏编程入门「2」――渲染

匿名 (未验证) 提交于 2019-12-03 00:36:02
璁剧疆 root signature 璁剧疆 viewport and scissor rectangles mCommandAllocator->Reset(); mCommandList->Reset(mCommandAllocator.Get(), mPSO.Get()); 璁剧疆 root signature mCommandList->SetGraphicsRootSignature(mRootSignature.Get()); 璁剧疆 viewport and scissor rectangles mCommandList->RSSetViewports( 1 , &mViewPort); mCommandList->RSSetScissorRects( 1 , &mRectScissor); mCommandList->ResourceBarrier( 1 , &CD3DX12_RESOURCE_BARRIER::Transition(mRenderTarget.Get(), D3D12_RESOURCE_STATE_PRESENT, D3D12_RESOURCE_STATE_RENDER_TARGET)); float clearColor[] = { 0.0f , 0.2f , 0.4f , 1.0f }; mCommandList-

DirectX:Matrix

匿名 (未验证) 提交于 2019-12-03 00:00:02
Tag DirectX下的博客主要用于记录DirectX的学习过程,主要参考《DirectX 12 3D 游戏实战开发》。 Matrix in DirectX 3D数学最重要的就是描述几何体的变换,其中肯定会涉及到矩阵。本篇的主要内容即是DirectXMath库中与矩阵相关的部分。 首先温习矩阵运算的几个特点。 矩阵加法满足交换律和结合律 矩阵A、B相乘有意义,当且仅当A的列数与B的行数相同 矩阵乘法一般不满足交换律 标量乘法对矩阵加法、矩阵乘法对标量加法满足分配律 向量与矩阵相乘实际上是一种线性组合 单位矩阵即主对角线均为一、其余为零的方阵 方阵可逆当且仅当方阵的行列式不等于零 一个方阵关于i行j列的余子式即该方阵去掉第i行和第j列剩下的部分构成的方阵,代数余子式即在余子式的基础上乘上-1的i+j次方 把方阵关于i行j列的余子式都放到对应的行和列上构成的矩阵称为方阵的代数余子式矩阵,该方阵的伴随矩阵即为代数余子式矩阵的转置 方阵的逆矩阵为该方阵的伴随矩阵除以其行列式 在3D图形学中,通常最多涉及到4维的内容,对应4维向量和4*4的矩阵。DirectXMath库提供了 XMMATRIX 类型来表示矩阵。 #if (defined(_M_IX86) || defined(_M_X64) || defined(_M_ARM)) && defined(_XM_NO_INTRINSICS)

How to implement a voice changer?

只谈情不闲聊 提交于 2019-12-02 23:38:44
I want to write a app which change the microphone input voice and make it like robot or some funny man's voice.It must support send changed voice to all application like IM Software or Game Client. Which technology should I pick up? Windows WaveForm Api? DirectX? audio driver? Thank you very much! There's an MSDN Coding4Fun article that explains how to create a voice changer that operates over Skype, in C# (.NET). The full source code is also hosted as a project on CodePlex . In addition, it should be fairly easy do something else with the audio (as opposed to streaming it via Skype), since

Directx教程(23) 简单的光照模型(2)

匿名 (未验证) 提交于 2019-12-02 23:32:01
原文: Directx教程(23) 简单的光照模型(2) 在工程myTutorialD3D11_16中,我在文件light.vs中定义了一个 材质光源属性常量缓冲 。 //const buffer最好为4 float的倍数,否则创建const buffer会fail cbuffer LightMaterialBuffer { float4 lightPosition; //光源位置 float4 lightColor; //光源颜色 float4 globalAmbient; //光源的环境光反射系数 float4 cameraPosition; //摄像机的位置 float4 Ke; //材质的自发光 float4 Ka; //材质的环境光系数 float4 Kd; //材质的漫反射系数 float4 Ks; //材质的高光系数 float3 lightDirection; //平行光方向 float shininess; //高光指数 }; 通过定义这个const buffer,我们可以在lightShaderClass中,来设置顶点材质和光源的各种属性。 同时,我也修改了lightShaderClass类中的Render和SetShaderParameters函数接口,以便传入各种参数。 bool Render(ID3D11DeviceContext*, int,

C# and Arrow Keys

随声附和 提交于 2019-12-02 22:15:12
I am new to C# and am doing some work in an existing application. I have a DirectX viewport that has components in it that I want to be able to position using arrow keys. Currently I am overriding ProcessCmdKey and catching arrow input and send an OnKeyPress event. This works, but I want to be able to use modifiers( ALT + CTRL + SHIFT ). As soon as I am holding a modifier and press an arrow no events are triggered that I am listening to. Does anyone have any ideas or suggestions on where I should go with this? Within your overridden ProcessCmdKey how are you determining which key has been