directx

F# type mismatch problem in DirectX demo

Hi, I've been wanting to try out the FDX demo however it gave me a series of errors and warnings due to compatibility issues, so I've been trying to get it working correctly. The full code is on a pastebin. I'm having trouble with the code here : let drawSurf f (device:Device) = let m,n = meshDims !mesh in let data = Array.init ...

Calculation of vertex normals in DirectX

As a learning experience, I'm writing an Immediate mode managed DirectX 9 application. I'm manually calculating Vertex normals across all triangles in a scene to allow smooth Gouraud shading. This works as expected, but I'm guessing this is not the most efficient approach. Is it possible to get the GPU to do this for me? ...

Detect movie being played (Windows)

Watching a movie is quite a different user activity. User doesn't touch neither mouse nor keyboard. Yet he 'actively' uses the computer. Thus, screensaver shouldn't run, indexing should be performed with care etc. On the other side, playing video requires either using direct write to video memory, or DirectShow, or some other API. This...

Creating another Window from code?

I'm currently working on a game and relaly want to add an external console to it (right now it's built into the main game window). What I would really like is to create a new Window which acts as the console with maybe a text box in the bottom to add new commands into it and a larger text box on top which outputs information. I'm using...

Deferred Shading DirectX demos?

I've been reading a lot about deferred shading and want to try and get into it. Problem is I can't find a sample which demonstrates how deferred shading can support so many lights simultaneously - I found one demo which was very simple with a single light in Code Sampler and an nVidia HDR sample butnothing beyond that. Would anyone know...

DirectX9 Texture of arbitrary size (non 2^n)

Hi, I'm relatively new to DirectX and have to work on an existing C++ DX9 application. The app does tracking on a camera images and displays some DirectDraw (ie. 2d) content. The camera has an aspect ratio of 4:3 (always) and the screen is undefined. I want to load a texture and use this texture as a mask, so tracking and displaying of...

'D3DRS_SEPARATEDESTALPHAENABLE' : undeclared identifier - even though it's mentioned in the DirectX comments?

In d3d9types.h in the _D3DRENDERSTATETYPE struct the last 3 types are: D3DRS_SRCBLENDALPHA = 207, /* SRC blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */ D3DRS_DESTBLENDALPHA = 208, /* DST blend factor for the alpha channel when D3DRS_SEPARATEDESTALPHAENABLE is TRUE */ D3DRS_BLEN...

Creating a particle attractor in DirectX [solved]

Edit: Solved it on my own, had one of those small typos that are hard to notice in a different section, works perfectly now. I have a particle generator in C++ that I got off the internet. It was basically a sample of some things you can do, so I have studied it and know what is going on and what I need to do to add the features I want ...

Acquire direct write access to window's backbuffer, yet still allow read access to what is on the screen already

I was wondering; is it possible to acquire write access to the graphics card's primary buffer though the windows api, yet still allow read access to what should be there? To clarify, here is what I want: Create a directx device on a window and hide it. Use the stencil buffer to apply an alpha channel to pixels not written to by my code...

Passing D3DFMT_UNKNOWN into IDirect3DDevice9::CreateTexture()

I'm kind of wondering about this, if you create a texture in memory in DirectX with the CreateTexture function: HRESULT CreateTexture( UINT Width, UINT Height, UINT Levels, DWORD Usage, D3DFORMAT Format, D3DPOOL Pool, IDirect3DTexture9** ppTexture, HANDLE* pSharedHandle ); ...and pass in D3DFMT_UNKNOWN format what is s...

Real time dynamic shadows to compliment deffered shading?

I currently have a deffered rendering system setup and can render point lights and directional lights. My question is what are my options for different forms of shadowing which can make shadows based on point lights and directional lights which can maybe make use of a deffered shading setup? ...

Adding Windows Form to a DirectX application?

I'm working on a directx application and was wondering how I could add a regular window to the application, one which has text boxes, command buttons and all. ...

Detecting full-screen Direct3D applications

Is there any way to detect - through the Direct3D API - Direct3D applications running in full-screen mode? SHQueryUserNotificationState, which can indicate such applications, is only supported on Vista and up. It also only works when the Explorer shell is running. ...

SlimDX (DirectX10) - How to change a texel in Texture?

Hi, I try to change the texels of a Texture which is already loaded. My assumption was to use the Texture2D::Map and UnMap functions, but there is no change when I change the data of given DataRectangle. I need a simple example like, creating a texture of 128x128 with a gradient from black to white from each side. Thx ps: A Direct3D...

OpenGL or DirectX?

I know this is probably a very subjective question, but I just want to start with the one which is the easiest and fastest to learn, so that I can get started with a small project of mine as fast as possible, it's a a little 2D game, to start with at least.. Which one would you recommend me to go with? And I'm using C++ ...

WPF window resizing - no preview / show rubber band

Is there a way to force a WPF window to use a rubber band (no live preview of contents during resize) when resizing? I realize this is usually a user preference on Windows but my application uses D3D windows and there is significant flicker when resizing (particularly from the top left corner outward). -- I should have mentioned I am ...

D3DImage using DX10

Is it possible to use DirectX 10 (I am using SlimDX) with WPF's D3DImage? The only examples and docs I can find only show using DX9 surfaces. ...

Creating planar shadows with 4x3 matrices?

Hi All, Was just wondering how I would go about creating a planar shadow from a 4x3 matrix, all online demos I've seen use 4x4 matrices instead. ...

directx audio video error message in debugmode

I have a c#/winforms application that uses directx to play some video and audio. whenever i start my application in debugmode i get this annoying message. i can click "continue" and everything seems to work fine. but i still want to get rid of this message. it does not show up in releasemode. Managed Debugging Assistant 'LoaderLock' ...

XNA Target Audience

This might sound like a stupid question, but who is the target audience for the XNA framework? The following is located on the Microsoft XNA Game Sudio website: XNA Game Studio 3.1 enables hobbyists, academics, and independent game developers to easily create video games for Windows, Xbox 360, and the Zune digital media playe...