directx

Microsoft objects, the Release() functions return value?

橙三吉。 提交于 2019-12-07 04:48:28
问题 I'm curious because I couldn't find out about this on MSDN. I've found the Release() function is present in various COM objects which I'm obviously supposed to use for deleting pointers. But I'm not sure what does it return exactly? I used to think it would return the number of references which still exist to the object remaining, therefore something like: while( pointer->Release() > 0 ); Would obviously release all references to that pointer? Or am I not seeing something? *note I'm talking

Displaying a video in DirectX

别等时光非礼了梦想. 提交于 2019-12-07 04:16:51
问题 What is the best/easiest way to display a video (with sound!) in an application using XAudio2 and Direct3D9/10? At the very least it needs to be able to stream potentially larger videos, and take care of the fact that the windows aspect ratio may differ from the videos (eg by adding letter boxes), although ideally Id like the ability to embed the video into a 3D scene. I could of course work out a way to load each frame into a texture, discarding/reusing the textures once rendered, and

c# text/winForm overlay video games like xfire,PIX,steam,fraps etc

女生的网名这么多〃 提交于 2019-12-07 04:06:59
问题 I know there is plenty of post about this topic , however I've been looking for a solution to this for months. I checked about 300 posts on google about this. The only good thing I found was a c++ program that was drawing a colored rectangle over League's window. I am not very familiar with directx. My program is in c# and I would to write text or if possible make a winForm visible over a full screen video game. I tried every single sample found on forums but 50% of them are old and links

How does Olive (Mono) implement (W)PF?

时光毁灭记忆、已成空白 提交于 2019-12-07 03:58:46
问题 While reading an article about Mono on Wikipedia, I found out there is a Mono sub/side-project called Olive which aims to bring the remaining bits of .NET to Mono - currently focusing on Workflow Foundation and WPF - though they for obvious reason call it only "Presentation Foundation". This made me think: WPF is closely tied to DirectX, which in turn is closely tied to Windows. How do they plan to make it run on wider variety of OSes? They don't use any GPU acceleration at all? Or do they

Shader's function parameters performance

我怕爱的太早我们不能终老 提交于 2019-12-07 02:05:28
问题 I'm trying to understand how passing parameters is implemented in shader languages. I've read several articles and documentation, but still I have some doubts. In particular I'm trying to understand the differences with a C++ function call, with a particular emphasis on performances. There are slightly differences between HSLS,Cg and GLSL but I guess the underline implementation is quite similar. What I've understood so far: Unless otherwise specified a function parameter is always passed by

DirectX Math function confusion

微笑、不失礼 提交于 2019-12-07 01:02:27
While I was going over some older DirectX code, I came by the functions D3DXVec3Transform and D3DXVec3TransformCoord. Upon looking up the descriptions for them, they seemed rather similar but I don't see what the difference between the two are. Can someone please explain what is the difference between D3DXVec3Transform and D3DXVec3TransformCoord are, along with the math behind them? When you transform a 3D vector by matrix it results in a 4D vector where w!=1 a 3D vector can be described as 4D vector where w=1. D3DXVec3Transform returns the 4D vector where w!=1. D3DXVec3TransformCoord gets the

directx - texture render result is incorrect

依然范特西╮ 提交于 2019-12-07 00:13:24
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 the texture by D3DXCreateTextureFromFile(device, "e:\\test.bmp", &texture); and do not update the

anyone can explain the “field of view”

微笑、不失礼 提交于 2019-12-06 19:22:01
问题 In graphics software, sometimes we saw "field of view" for camera. Can someone explain what does it mean? 回答1: The field of view (in the gluPerspective call) is the angle in degrees between a plane which passes through the camera position and the top of your screen and another plane which passes through the camera position and the bottom of your screen. Edit: Since you need not have a full-screen viewport: Any line which is projected to (x1, 0)-(x2, 0) lies in the first plane, any line that

Directsound logarithm volume to linear volume slider

青春壹個敷衍的年華 提交于 2019-12-06 16:44:48
I am developing an music player with DirectX.DirectSound. I have a problem with the volume. The directsound volume is logarithm. This means that with silent sounds, is much more sensitive to small variations in amplitude than with loud sounds. It also means that with a linear volume slider we have a logarithmic sensation of volume variations, and that just doesn't feel right. My question is: How can I make it linear? My code until here is: if (trkBalance.Value == trkBalance.Minimum) { foreGroundSound.Volume = (int)DS.Volume.Min; } else if (trkBalance.Value == trkBalance.Maximum) {

DirectX Firefox Plugin rendering artifacts

时光总嘲笑我的痴心妄想 提交于 2019-12-06 16:17:36
QUICK ANSWER : For those of you who reach this page via Google looking for a solution to the same problem, try this quick fix (suggested by Goz) - Add D3DCREATE_FPU_PRESERVE to the behavior flags on your CreateDevice() call. That cleared it up for me! I'm creating a DirectX 9-based NPAPI plugin. It seems to be working well in Chrome and Opera, but in Firefox I get strange rendering artifacts. Upon initializing DirectX (no rendering needs to be done for the artifact to appear) all or parts of the Firefox UI will turn black. Resizing the window (IE: Initiating a repaint) clears up the artifacts