directx

DirectX DirectInput won't detect connected devices

I'm trying to use a joystick in my C# WPF application using directX (using Microsoft.DirectX.DirectInput;), but for some odd reason I keep getting an error in the first line where I try to detect all the connected devices. All I have in my application so far is the following line of code in the contructor: DeviceList gameControllerList...

DirectX captured image is a little darker, how to adjust it ?

I use this project to capture frame from a video. http://www.codeproject.com/KB/directx/DirXVidStrm.aspx But when I captured a image from the video, It seems that it's more darker than the video, How can I make them the same ? ...

How to get rotations from btTransform to D3DXMatrixRotationYawPitchRoll ?

I need to get rotation data from Bullets rigid body world transform ( getWorldTransform() ) to the suitable format to pass to D3DXMatrixRotationYawPitchRoll function to generate the rotation matrix for DirectX. My solutions structure is built up this way so I need to pass the data this way. You can provide other solutions, maybe I can s...

Loading textures using TextureLoader from Resources

Hello, I'd like to ask how could I load textures from program resources. This code works fine, but its only from file. How about loading from resources? texture = TextureLoader.FromFile(device, "file.png"); ...

Using DirectShow in Python

I'd like to call this method inside a Python script, with as few extra dependencies as possible. How can I do it? I've tried DirectPython, but it's installer installs only for 32-bit architectures, it seems. I've tried comtypes, but the installer can't find my Python installation. ...

DXSDK linker problem

Hi, sorry my noobinity. I have installed VS2k10 and DXSDK on my comp. I have started a new project, then added the include and the lib/x64 dir in the VC++ directories. I have also added d3dx10.lib and d3d10.lib in additional dependencies. But I am keep getting the " error LNK2019: unresolved external symbol _D3D10CreateDeviceAndSwapChain...

Crash at Clearrendertargetview

I have got a crash at calling function Clearrendertargetview(). Below is the code: HWND hwnd; ID3D10Device* device; IDXGISwapChain* swapChain; ID3D10RenderTargetView* renderTarget; D3D10_VIEWPORT viewPort; DXGI_SWAP_CHAIN_DESC swapchaind; SecureZeroMemory(&swapchaind, sizeof(DXGI_SWAP_CHAIN_DESC)); swapchai...

C# Rendering 'player' sprite from differend class

Hello, i was wondering how could i display 'player' sprite from Player.cs class. So far everything was happening in Program.cs file, witch had 'device' for rendering. Now i want to do same but using different classes. Do i need to create device for each class to render stuff thats happening within them, or i need to somehow access the de...

C# directx sprite origin

Hello, 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. Thank you. Edit: I have tried this: hereMatrix pm = Matrix.Translation(_playerPos.X + 8,...

Total/texture accessible memory by DirectX/Cuda/OpenGL

Hi, Can someone please explain the difference in texture memory as used in the context of Cuda as opposed to texture memory used in the context of DirectX. Suppose a graphics card has 512 MB of advertised memory, how is it divided into constant memory/texture memory and global memory. E.g. I have a tesla card that has totalConstMem as ...

Displaying mesh using DirectX 9

#include <windows.h> #include <d3d9.h> #include <D3DX9Mesh.h> #define THROW_ERROR_AND_EXIT(x) { \ MessageBox(0,x,0,0); \ return -1; \ } LRESULT CALLBACK WndProc( HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { // Handle close event switch( msg ) { case WM_DESTROY: PostQuitMessage( 0 ); ...

Problem downloading the last DirectX SDK

I can't manage to download the last version of the DirectX SDK (june 2010) : http://www.microsoft.com/downloads/details.aspx?FamilyID=3021d52b-514e-41d3-ad02-438a3ba730ba&amp;displaylang=en When I try to install it by double clicking the DXSDK_June10.exe I get the following message: It seems that the file is corrupted. Is there anoth...

Where are reference to DirectX assemblies in Visual Studio 2010

I installed the new Visual Studio 2010. I want to create a C# Winform DirectX application, but I can't find the following assembly when adding the .Net reference list: Microsoft.DirectX Microsoft.DirectX.Direct3D Microsoft.DirectX.Direct3DX How can I use DirectX with Visual Studio 2010? ...

C++ & DirectX - setting shader

Hello! Does someone know a fast way to invoke shader processing via DirectX? Right now I'm setting shaders using D3DXCreateEffectFromFile calls, which create shaders in runtime (once per each shader) from *.fx files. Rendering part for every object (every patch in my case - see further) then means something like: // -----------------...

Displaying mesh using DirectX 9 - Mesh differences

This is my program to display a .x mesh. I am able to display the mesh tiger.x but not able to display ball.x. What is the difference between the two meshes? Is there something I should handle in the code? But I am able to view both the meshes using standard mesh viewers like the one which come with DirectX SDK. Thanks. ...

DirectX 9 C++ program crashes and wont re-open

I am just beginning to learn how to program DirectX 9 applications in C++, so I'm still not very good, and I'm messing it around quite a bit. When I reopen the program after it crashes, the D3D Device fails to create with the result being D3DERR_INVALIDCALL. I am compiling with G++ in MinGW, using the DirectX August 2009 SDK. I'm guessi...

Using D3DImage in C++ .net

Hi, I think this is an easy question, sorry I am not really familiar with C++. I am using D3DImage in C++.Net project which is using it's SetBackBuffer method, and I am also using DX Surface. I don't know how to convert IDirect3DSurface9 to IntPtr as parameter in SetBackBuffer method. Anyone knows? please help. ...

What does Up Vector exactly do in DirectX?

Hi. As you know when we want to draw a three demensional object in DirectX we should define a camera. Now we have a Device object that it's name is 'device1'.it is my question : device1.View = Matrix.Look...(New Vector3(),New Vector3(),New Vector3()); Argument #3 is Up Vector. What does it exactly do? ...

DirectX depth buffering not working

Hey, For some strange reason my depth buffer is not working, i.e. the triangles drawn later always overlap, regardless of their position. I have these presenter parameters D3DPRESENT_PARAMETERS d3dpp; ZeroMemory(&d3dpp, sizeof(d3dpp)); d3dpp.Windowed = TRUE; d3dpp.SwapEffect = D3DSWAPEFFECT_DISCARD; d3dpp.hDeviceWindow = mWindow; d3...

Use WPF in combination with Hardware Rendering instead of RenderTargetBitmap

Hi all, The WPF application I have build has a Viewport3D containg all kinds of UIElement3D objects. Now I would like to save a high resolution snapshot of a certain view to a file. I have tried RenderTargetBitmap in the past, but I do not like this approach because of the following downsides: Memory leakage (at least with .NET 3.5 S...