directx

C# and Arrow Keys

I am new to C# and am doing some work in an existing application. I have a DirectX viewport that has components in it that I want to be able to position using arrow keys. Currently I am overriding ProcessCmdKey and catching arrow input and send an OnKeyPress event. This works, but I want to be able to use modifiers(ALT + CTRL + SHIFT). ...

In a DDS file can you detect textures with 0/1 alpha bits?

In my engine I have a need to be able to detect DXT1 textures that have texels with 0 alpha (e.g. a cutout for a window frame). This is easy for textures I compress myself, but I'm not sure about textures that are already compressed. Is there an easy way to tell from the header whether a DDS image contains alpha? ...

Suggested gaming platform to learn - Direct X (C++), Open GL or XNA

My nephew is an aspiring game developer. I have taught him a bit of C/C++, and suggested he learn that for a start. Once he has come to grips with that, which game/graphics API's do people suggest he learn? I would think DirectX would be current industry standard, but with more games looking to go X-platform then maybe Open-GL would be...

How can I reverse engineer a DirectShow graph?

I have a DirectShow graph to render MPEG2/4 movies from a network stream. When I assemble the graph by connecting the pins manually it doesn't render. But when I call Render on the GraphBuilder it renders fine. Obviously there is some setup step that I'm not performing on some filter in the graph that GraphBuilder is performing. Is t...

Viewing DirectX application remotely

We're working on an application that displays information through a Direct3D visualisation. A late client request is the ability to view this application via some Remote Desktop solution. Has anyone done anything similar? What options are available / unavailable? I'm thinking RDC, VNC, Citrix... Any advice? ...

OpenGL or Direct3D for a new Windows game project? Or something else?

I'm starting a hobby game project on Windows that will make heavy use of 3D graphics effects. It will most likely be written in C++. Should I use OpenGL or Direct3D for my graphics backend? Why? Or should I use a ready-made graphics engine such as OGRE 3D? Which one? Some "how to get started" links would be useful. (On either technolo...

Is it possible to develop DirectX apps in Linux?

More out of interest than anything else, but can you compile a DirectX app under linux? Obviously there's no official SDK, but I was thinking it might be possible with wine. Presumably wine has an implementation of the DirectX interface in order to run games? Is it possible to link against that? (edit: This is called winelib) Failing ...

What can cause a reduction in frame rate when upgrading a graphics card?

We have a two-screen DirectX application that previously ran at a consistent 60 FPS (the monitors' sync rate) using a NVIDIA 8400GS (256MB). However, when we swapped out the card for one with 512 MB of RAM the frame rate struggles to get above 40 FPS. (It only gets this high because we're using triple-buffering.) The two cards are from t...

Apps that support both DirectX 9 and 10

I have a noobish question for any graphics programmer. I am confused how some games (like Crysis) can support both DirectX 9 (in XP) and 10 (in Vista)? What I understand so far is that if you write a DX10 app, then it can only runs in Vista. Maybe they have 2 code bases -- one written in DX9 and another in DX10? But isn't that an over...

How do I make the lights stay fixed in the world with Direct3D

I've been using OpenGL for years, but after trying to use D3D for the first time, I wasted a significant amount of time trying figure out how to make my scene lights stay fixed in the world rather than fixed on my objects. In OpenGL light positions get transformed just like everything else with the MODELVIEW matrix, so to get lights fix...

Making a game in C++ using parallel processing

I wanted to "emulate" a popular flash game, Chrontron, in C++ and needed some help getting started. (NOTE: Not for release, just practicing for myself) Basics: Player has a time machine. On each iteration of using the time machine, a parallel state is created, co-existing with a previous state. One of the states must complete all the o...

Is there an efficient\easy way to draw a concave polygon in Direct3d

I'm trying to draw a polygon using c# and directx All I get is an ordered list of points from a file and I need to draw the flat polygon in a 3d world. I can load the points and draw a convex shape using a trianglefan and drawuserprimitives. This obviously leads to incorrect results when the polygon is very concave (which it may be). ...

Why do some wav files play in my c# directsound app but some don't?

Hi, I've got a c# application that plays simple wav files through directsound. With the test data I had, the code worked fine. However when I used real-world data, it produced a very unhelpful error on creation of the secondary buffer: "ArgumentException: Value does not fall within the expected range." The test wavs had a 512kbps bit...

Doing readback from Direct3D textures and surfaces

I need to figure out how to get the data from D3D textures and surfaces back to system memory. What's the fastest way to do such things and how? Also if I only need one subrect, how can one read back only that portion without having to read back the entire thing to system memory? In short I'm looking for concise descriptions of how ...

OpenGL still better than Direct3D for non-games ?

The standard model has been that OpenGL is for professional apps (CAD) and Direct3D is for games. With the debacle of openGL 3.0, is openGl still the natural choice for technical 3D apps (cad/GIS)? Are there scenegraph libraries for Direct3D? (Of course Direct3D is windows only.) ...

How can I use WPF's D3DImage with managed DirectX or XNA?

I'd really like to get into some D3D coding, but I don't have the time lately to learn C++ for what will amount to a hobby project. ...

How do I draw transparent DirectX content in a transparent window?

I want to draw DirectX content so that it appears to be floating over top of the desktop and any other applications that are running. I also need to be able to make the directx content semi-transparent, so other things show through. Is there a way of doing this? I am using Managed DX with C#. ...

Is DirectSound the best audio abstraction layer for Windows?

Is DirectSound the best audio abstraction layer for Windows? Switching my app from a very bad sound implementation, built to a specific chipset, to an abstration layer. App is native Winform, .net 3.5. DirectX/DirectSound is the likely choice, but a little concerned about the overhead. Any other options? Or is it silly to even THINK ...

Example code for Resizing an image using DirectX

I know it is possible, and a lot faster than using GDI+. However I haven't found any good example of using DirectX to resize an image and save it to disk. I have implemented this over and over in GDI+, thats not difficult. However GDI+ does not use any hardware acceleration, and I was hoping to get better performance by tapping into t...

Direct3D Camera Problem

I'm using SlimDX/C# to write a Direct3D application. I configured the camera as per textbox way: private float cameraZ = 5.0f; camera = new Camera(); camera.FieldOfView =(float)(Math.PI/2); camera.NearPlane = 0.5f; camera.FarPlane = 1000.0f; camera.Location = new Vector3(0.0f, 0.0f, cameraZ); camera.Target = Vector3.Z...