directx

D3D11 screen desktop copy to ID3D11Texture2D

烈酒焚心 提交于 2020-01-01 07:09:13
问题 I am writing a DLL plugin that will read the desktop frame buffer (whole screen) and render it directly into a Texture2D pointer that is passed in. The goal is to keep everything in video memory (and avoid the cost of copying back to system memory and back to video memory). I am able to pass the Texture2D (showing up as a ID3D11Texture2D), but I am having issues grabbing the desktop frame buffer with D3D11. D3D9 offered GetFrontBufferData() but it seems D3D11 solution is to use GetBuffer().

LNK2001 and LNK2019 errors - DirectX unresolved external symbols

风流意气都作罢 提交于 2020-01-01 07:03:16
问题 I am following along with the book "Introduction to 3D Game Programming with DirectX11" by Frank D. Luna. And I am getting these errors when I try and build my project. >BoxDemo.obj : error LNK2019: unresolved external symbol _D3DX11CompileFromFileW@44 referenced in function "private: void __thiscall BoxApp::BuildFX(void)" (?BuildFX@BoxApp@@AAEXXZ) >BoxDemo.obj : error LNK2019: unresolved external symbol _D3DX11CreateEffectFromMemory@20 referenced in function "private: void __thiscall BoxApp:

I thought *.DDS files were meant to be quick to load?

≡放荡痞女 提交于 2020-01-01 05:47:26
问题 Ok, so I'm trying to weigh up the pro's and con's of using various different texture compression techniques. I spend 99.999% of my time coding 2D sprite games for Windows machines using DirectX. So far I have looked at texture packing (SpriteSheets) with alpha-trimming and that seems like a decent way to get a bit more performance. Now I am starting to look at the texture format that they are stored in; currently everything is stored as *.PNGs. I have heard that *.DDS files are good,

View Matrix from Quaternion

倖福魔咒の 提交于 2020-01-01 05:22:07
问题 I'm currently building my own quaternion camera. As far as I know, you only need one quaternion to fully specify the camera's orientation (correct me if I'm wrong). So, how would I go about creating the view matrix? I'm using C++ as a programming language by the way. Any help would be appreciated. 回答1: First some caveats. You'll see lots of apparently conflicting formulae on the 'net and in literature on this subject. Most of the conflicts are apparent only. A few are real conflicts, but that

why D3DXCreateCylinder is not creating a cylinder?

Deadly 提交于 2019-12-31 05:29:11
问题 I am trying to make a ball trail. rBallPos is correctly updating. Following code is not working creating a cylinder as ball's trail. How to solve it? LPD3DXMESH /*ID3DXMesh*/ ppMeshCylinder = NULL; hr = D3DXCreateCylinder(g_d3d_device,0.1f,0.1f,0.1f,1,1,&ppMeshCylinder,0); hr is FAILED here also hr != D3D_OK D3DXMATRIX cylinder, cylinder2, cylinderRotate, cylinderTrans; D3DXMatrixRotationX(&cylinderRotate, 1.5f); D3DXMatrixTranslation(&cylinderTrans, rBallPos.fX, rBallPos.fY, rBallPos.fZ);

C# directx sprite origin

六月ゝ 毕业季﹏ 提交于 2019-12-31 03:32:29
问题 i have this problem when my Sprite rotation origin is fixed at top left corner of window (same with sprite.Draw and sprite.Draw2D ) Either way if i change rotation center it's still at top left. I need sprite to rotate around its Z axis. Edit: I have tried this: hereMatrix pm = Matrix.Translation(_playerPos.X + 8, _playerPos.Y + 8, 0); sprite.Transform = Matrix.RotationZ(_angle) * pm; sprite.Draw(playerTexture, textureSize, new Vector3(8, 8, 0), new Vector3(_playerPos.X, _playerPos.Y, 0),

Error 1 error LNK1104: cannot open file 'winmm.lib'

这一生的挚爱 提交于 2019-12-31 03:01:30
问题 Ok, so I am running Visual Basic 2010 Express and I tried to run Tutorial # 2 in the Direct X SDK; however, the program won't compile for some reason, although in the tutorial I am reading now it said that I only needed the Direct X SDK and Visual Basic 2010 Express. I opened Tutorial02_2010.sln, and tried to compile it. Here's the code of the main file: //-------------------------------------------------------------------------------------- // File: Tutorial02.cpp // // This application

用DirectX实现魔方(二)

六眼飞鱼酱① 提交于 2019-12-31 02:00:56
这篇说一下如何构造魔方,主要包括魔方几何体的构造及纹理贴图。以下论述皆以三阶魔方为例,三阶魔方共有3 x 3 x 3 = 27个小立方体。 构造魔方 在第一篇里面说过,最初模型用的是微软的.x文件格式,由于魔方要实现按层旋转,所以不能将整个模型做成一个.x文件,只能分成若干个小立方体,每个立方体对应一个.x文件。这导致在发布程序的时候也要发布这些模型文件,而且.x文件已经逐渐为微软遗弃,所以就干脆不用了,自己画吧。魔方由27个小立方体构成,所以只要绘制一个小立方体,并复制27分,再将这个27个小立方体按一定顺序堆叠在一起,最后贴上纹理,就可以构成一个完整的魔方了。 一个小立方体包含六个面,由于每个面的纹理可能不同,所以需要逐个面绘制,这样可以方便的为每个面单独设置纹理。 一个面由两个三角形构成,这里采用TriangleStrip的方式进行绘制,只需要指定四个顶点即可,如果是TriangleList,则需要六个顶点。 顶点结构 下面来分析一下顶点的数据结构,首先要有一个位置坐标(位置是一个顶点必须要包含的信息),其次,为了添加光照效果,还需要一个法向量。最后,为了实现纹理贴图,需要有纹理坐标。所以一个完整的顶点有以下三部分构成: 位置 法向量 纹理坐标 用一个结构体来表示顶点,如下: struct Vertex { float x, y, z; // position float

Low level mouse hook and DirectX

…衆ロ難τιáo~ 提交于 2019-12-30 04:24:25
问题 I'm building an application which needs to filter some mouse clicks system-wide. That is, I need to make the system ignore some mouse button clicks at special occasions. I use low level mouse hook and SetWindowsHookEx to filter out these clicks. It works relatively well, except for WPF applications. I guess that's because these applications use DirectX and DirectInput for input processing, and that's why I can't filter out clicks in these applications, since they get the input directly from

FXC : error X3501: 'main': entrypoint not found

孤者浪人 提交于 2019-12-30 04:20:06
问题 I am following an example book called: Introduction to 3D Game Programming with DirectX 11 It is all written in VS2010. I would like to try using VS2013... It is an example project for Windows Desktop Program I have a program with the following in it (including some other files as part of common use): color.fx //*************************************************************************************** // color.fx by Frank Luna (C) 2011 All Rights Reserved. // // Transforms and colors geometry. /