directx

Activemovie window pop up Microsoft.DirectX.AudioVideoPlayback in C#

∥☆過路亽.° 提交于 2019-12-11 08:39:50
问题 I had create a simple windows form which display a video with Microsoft.DirectX.AudioVideoPlayback. When the video load to the panel, it pop up for milliseconds a activemovie window. How i could fix it because it is annoy every time start playing a video throws this activemovie window. It is like the application have delay. Here is my code : string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), @"Photos\test.avi"); var ofd = path; var video = new Video

DirectXTK spriteFont in 3D space

北城余情 提交于 2019-12-11 08:29:40
问题 I was hoping to display an "X" at (50,0,0) using DirectXTK and following an article about billboarding. however i do not seem to have it correct. Could somebody help me out. XMVECTOR textPosition = XMVectorSet(50, 0, 0, 0); unique_ptr<BasicEffect> basicEffect(new BasicEffect(m_pd3dDevice)); unique_ptr<CommonStates> commonStates(new CommonStates(m_pd3dDevice)); /*basicEffect->SetWorld(XMMatrixScaling(1,-1, 1) * XMMatrixTranslationFromVector(textPosition));*/ /* basicEffect->SetWorld(

directx mouse click simulation

独自空忆成欢 提交于 2019-12-11 07:49:36
问题 How can I simulate the mouse click in a directx application? mouse_event and PostMessage with WM_LBUTTONDOWN don't work... so it must be something to do with the DirectInput I haven't found out nothing useful with google, so you may be knowing the answer... thanks in advance //update I wrote the text wrongly, what I want is to make the directx app believe that the mouse has just clicked, but without effectively using the mouse and without using SendInput or mouse_event, which need that the

reading GPU resource data by CPU

偶尔善良 提交于 2019-12-11 07:49:35
问题 i am learning directx11 these days. and i have been stuck in compute shader section. so i made four resource and three corresponding view. immutable input buffer = {1,1,1,1,1} / SRV immutable input buffer = {2,2,2,2,2} / SRV output buffer / UAV staging buffer for reading / No View and i succeeded to create all things, and dispatch cs function, and copy data from output buffer to staging buffer, and i read/check data. // INPUT BUFFER1-------------------------------------------------- const int

Dx11 Crash when accessing XMMATRIX

假装没事ソ 提交于 2019-12-11 07:23:14
问题 I've been creating a flocking swarm project in DirectX 11 and had an error where I try and create a vector of Pointers to objects and on the 3rd iteration of pushing back it will crash and jump to this: XMFINLINE _XMMATRIX& _XMMATRIX::operator= ( CONST _XMMATRIX& M ) { r[0] = M.r[0]; r[1] = M.r[1]; r[2] = M.r[2]; r[3] = M.r[3]; return *this; } the crash happens when I execute this code: Populate(); for (unsigned int i = 0; i < m_numOfPrey; i++) { m_preyVec[i]->LoadContent(dx, colour, yaw,

DirectX unresolved external error

假如想象 提交于 2019-12-11 06:51:57
问题 So I'm trying to get into some directX programming so I'm following this book called "Beginning DirectX 11 Game Programming", but I'm stuck already at the second example. I've spend roughly an hour searching for a solution to this problem, but havn't been able to find anything that could help me. So the error code I'm getting is this.: Main.obj : error LNK2019: unresolved external symbol "long __stdcall WndProc(struct HWND__ *,unsigned int,unsigned int,long)" (?WndProc@@YGJPAUHWND__@@IIJ@Z)

Volumetric Fog Shader - Camera Issue

流过昼夜 提交于 2019-12-11 06:03:59
问题 I am trying to build an infinite fog shader. This fog is applied on a 3D plane. For the moment I have a Z-Depth Fog. And I encounter some issues. As you can see in the screenshot, there are two views. The green color is my 3D plane. The problem is in the red line. It seems that the this line depends of my camera which is not good because when I rotate my camera the line is affected by my camera position and rotation. I don't know where does it comes from and how to have my fog limit not based

Very high CPU usage directx 9

谁说胖子不能爱 提交于 2019-12-11 05:58:56
问题 I'm going to use DirectX, so I'm using directxtutorial.com tutorial. When I run my game, it has very high cpu usage. It takes all power of the first core of my processor. I have Celeron e3400. I think it's much more than I need to run my game without anything. Sorry for that bunch of code. I have no idea what could be wrong. Here is my code: #include <windows.h> #include <windowsx.h> #include <d3d9.h> #pragma (lib, "d3d9.lib") #define Width_X 1024 #define Height_Y 768 LPDIRECT3D9 d3d;

How to clip the texture in rounded shape

為{幸葍}努か 提交于 2019-12-11 05:42:35
问题 I need to display texture of image with the rounded shape,my code as follow texture = Texture.FromBitmap(device,myBitmap, Usage.RenderTarget, Pool.Default); _sprite.Begin(SpriteFlags.SortTexture | SpriteFlags.DoNotModifyRenderState); _sprite.Draw(_allocator.Texture, Vector3.Empty, new Vector3(_objectLocation.X, _objectLocation.Y, 0), RenderingColor); _sprite.End(); But it always show rectangle texture, how can clip this texture in rounded shape. 回答1: Use the alpha channel of the texture (255

Spot the flaw c++ code

强颜欢笑 提交于 2019-12-11 05:37:04
问题 Could someone please spot the flaw in this code section i have spent hours trying to figure out what's wrong with it.I am bassicaly reciving massive lag on a basic directx app could someone explain to me what's wrong and why this is causing it. #include <Windows.h> #include <d3d9.h> // Function Prototypes LRESULT CALLBACK MsgProc(HWND Wnd,UINT message,WPARAM wParam,LPARAM lParam); INT CreateAndRegisterWindow(HINSTANCE hInst); INT initilizeD3D(HWND hWnd); VOID Render(); //Globals HWND