directx

How do I use Hardware accelerated video/H.264 decoding with directx 11 and windows 7?

↘锁芯ラ 提交于 2019-11-29 22:38:50
I've been researching all day and not gotten very far. I'm on windows 7, using directx 11. (My final output is to be a frame of video onto a DX11 texture) I want to decode some very large H.264 video files, and the CPU (using libav) doesn't cut it. I've looked at the hwaccel capabilities of libav using DXVA2, but hit a road block when I need to create a IDirectXVideoDecoder, which can only be created with a D3D9 interface. (which I don't have using DX11) Whenever I've looked up DXVA documentation, it doesn't reference DX11, was this removed in DX10 or 11? (Can't find any confirmation of this,

Can the Android phone use the windows DirectX library?

六眼飞鱼酱① 提交于 2019-11-29 19:57:47
问题 I have some functions which draws the game screen using the Direct X library in Windows. So, I am trying to use the functions in Android phone using the ndk. But I have some problems. Dose the Android phone which use the Java recognize the Direct X functions? If it is possible, then I must have some controls about it? I want your help... 回答1: Android (and iOS as well) doesn't support DirectX but OpenGL ES. Check out 3D with OpenGL on the Android developer site. 回答2: Android uses a linux

GetFrontBufferData returns black screen on any game

随声附和 提交于 2019-11-29 18:37:38
I am writing a screen capture application. I used the code mentioned on this link for the application. Following is my entire code for your reference: // WangsNotesScrCapt2.cpp : Defines the entry point for the application. // #include "stdafx.h" #include "WangsNotesScrCapt2.h" //include d3d library #include <d3d9.h> #include <d3dx9tex.h> #include <dinput.h> //link d3d library #pragma comment (lib, "d3d9.lib") #pragma comment (lib, "D3dx9.lib") #define MAX_LOADSTRING 100 #define WM_KEYDOWN 0x0100 // Global Variables: HINSTANCE hInst; // current instance TCHAR szTitle[MAX_LOADSTRING]; // The

Directx control in browser plugin

一笑奈何 提交于 2019-11-29 18:10:31
I have to insert a directx control to a firebreath plug in for a browser. Can anyone post a sample how to do it? I have no knowledge in plugins... 10x I don't have an example that I can give you, but I can tell you roughly what you need to do. First, read this: http://colonelpanic.net/2010/11/firebreath-tips-drawing-on-windows/ That will give you an overview of how drawing works in FireBreath. First, you set everything up when handling AttachedEvent. Create a new thread to handle drawing (your DirectX drawing must not be on the main thread) Get the HWND from the PluginWindowWin object (cast

DirectX from C#

风流意气都作罢 提交于 2019-11-29 17:36:23
问题 I'm looking into various options for using DirectX in C#; ideally I want to use whatever technology is preferred by Microsoft. Non-Microsoft Technologies: SharpDX Slim DX Direct2D Manager Wrapper Microsoft Technologies: WPF DirectX 9.0 for managed code (deprecated) XNA Framework (deprecated) Rationale behind the technology I want to use: I want a code-first framework (as opposed to writing XAML in WPF) I want (ideally) a Microsoft supported framework that isn't deprecated I want to build

MF SinkWriter Write Sample Failed

拥有回忆 提交于 2019-11-29 16:30:43
问题 I'm trying to encode the ID3D11Texture2D to mp4 using MediaFoundation. Below is my current code. Initializing Sink Writer private int InitializeSinkWriter(String outputFile, int videoWidth, int videoHeight) { IMFMediaType mediaTypeIn = null; IMFMediaType mediaTypeOut = null; IMFAttributes attributes = null; int hr = 0; if (Succeeded(hr)) hr = (int)MFExtern.MFCreateAttributes(out attributes, 1); if (Succeeded(hr)) hr = (int)attributes.SetUINT32(MFAttributesClsid.MF_READWRITE_ENABLE_HARDWARE

OpenGL sutherland-hodgman polygon clipping algorithm in homogeneous coordinates (4D, CCS)

倾然丶 夕夏残阳落幕 提交于 2019-11-29 16:20:40
I have two questions. (I marked 1, 2 below) In OpenGl, the clipping is done by sutherland-hodgman. However, I wonder how to work sutherland-hodgman algorithm in homogeneous system (4D) I made a situation. In VCS, there is a line, R= (0, 3, -2, 1), S = (0, 0, 1, 1) (End points of the line) And a frustum is right = 1, left = -1, near = 1, far = 3, top = 4, bottom = -4 Therefore, the projection matrix P is 1 0 0 0 0 1/4 0 0 0 0 -2 -3 0 0 -1 0 If we calculate the line with the P, then the each end points is like that R' = (0, 3/4, 1, 2), S' = (0, 0, -5, -1) I know that perspective division should

Get angle between point and origin

让人想犯罪 __ 提交于 2019-11-29 15:53:54
问题 This might have been answered before, sorry if it has. I basically need to get the angle from origin to point. So lets say Origin is (0, 0) and my target point is (3, 0) . 3 O'clock = 90 degrees 6 O'clock = 180 degrees 9 O'clock = 270 degrees 12 O'clock = 0 degrees Somehow, I gotta do some math magic, and find out that the angle is 90 degrees (Top is 0). The origin can vary, so I need a method with two parameters, Origin, and TargetPoint, which returns double Angle in Degrees. Yea, I realize

How to get the screenshot of the desktop from back buffer with DirectX

丶灬走出姿态 提交于 2019-11-29 14:16:04
I asked how to take the screen shot in DirectX and "Use GetFrontBufferData()" was answered. However, "This function is very slow, by design, and should not be used in any performance-critical path" was described at MSDN . When I asked other persons the measure, "Transfer the data of a back buffer to the system memory" was answered. But, I was not able to find a concrete method. This is an example of failure. Please let me know the right code. #include <stdio.h> #include <Windows.h> #include <d3d9.h> #include <d3dx9tex.h> void main() { CoInitialize(NULL); HWND hwnd = GetDesktopWindow();

Crash after m = XMMatrixIdentity() - alignment memory in classes?

一曲冷凌霜 提交于 2019-11-29 13:47:10
I was looking at the tutorials in DirectX SDK. Tutorial 5 works fine, but after I have copied and separated the code to my own classes, I got strange error during launching my application. The line is: g_World1 = XMMatrixIdentity(); Because of it, I got error in xnamathmatrix.int operator= which looks like that: 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; } And the error message is: Access violation reading location 0xffffffff I have read somewhere that it could be caused by something connected to