DirectX is a set of multimedia APIs from Microsoft aimed primarily at game developers. Popular APIs within the DirectX collection include Direct3D, XInput, and XAudio.

learn more… | top users | synonyms (1)

1
vote
2answers
184 views

temperamental ID3D10EffectVectorVariable

I am setting an HLSL effect variable in the following way in a number of places. extern ID3D10EffectVectorVariable* pColour; pColour = pEffect->GetVariableByName("Colour")->AsVector(); ...
-1
votes
1answer
2k views

loading images to the backbuffer / direct3d / c++

i think i just found the solution. 1) the problem is that backbuffer surface and source surface are of different formats - that is why exception was thrown. 2) the image path needed double slash ...
0
votes
1answer
325 views

LPD3DX10FONT::DrawTextA/W messes up the depth buffer!

why does calling this function mess up the depth buffer? I read somewhere that it cheekily changes the blend state, but to be totally honest I don't even know what that means. What is it doing, why is ...
2
votes
2answers
925 views

How do I keep a triangle strip between geometry shader invocations?

I'm using a small geometry shader to build a "ribbon" from a set of points. For each point, I create 4 vertices that represent a section of the ribbon: [maxvertexcount(4)] void GS( point GS_Input ...
4
votes
1answer
3k views

Non axis aligned bounding box collision and physics

Exactly how much more expensive, and while we're at it, difficult, is it to have non-axis aligned bounding boxes in your framework? I realise that it very much depends on what you're trying to do, so ...
3
votes
1answer
2k views

Does the latest DirectX SDK support both Direct3D 9.0c and 11?

1) What is the latest version of DirectX SDK? 2) For my purposes I need DirectX 9.0c SDK and DirectX 11 SDK. Do I need to install these libraries separately or last DirectX SDK package contains both ...
1
vote
1answer
1k views

DirectX 2D Sprite Texture

I am trying to make DirectX display a sprite from a sprite sheet I found on the internet but it doesn't seem to be displaying the texture in the correct position as I am specifying it. D3DXVECTOR2 ...
4
votes
1answer
2k views

What is instancing, and how can I update my graphics code to do it?

This question directly follows on from this one: How can I implement a renderer that can draw many kinds of primitives? I have a small amount of drawing code structured in the following way: A mesh ...
3
votes
5answers
4k views

XNA - Drawing 2D Primitives (Boxes) and Understanding Matrices in Computer Graphics

I have two issues which I wish to solve by creating 2D primitives in XNA. In my game, I wish to have a "debug mode" which will draw a red box around all hitboxes in the game (Red outline, ...
2
votes
1answer
195 views

What is the relationship between ID3D10Buffer and ID3DX10Mesh?

I'm new to Direct3D, I'm currently learning Direct3D 10 in Uni. I'm confused about buffers and meshes. We've been shown code to draw cubes etc that use ID3D10Buffer. However I've seen some stuff ...
3
votes
2answers
1k views

Converting from different handedness coordinate systems

I am currently porting a demo from XNA to DirectX which, as I understand it, both have coordinate systems with different handednesses. What are the things I need to bare in mind when converting ...
1
vote
1answer
400 views

Planar shadow matrix and plane b value

I implemented planar shadows with the function D3DXMatrixShadow. As you know, we need plane and light factor to calculate a shadow matrix. The problem is that when I set the plane as D3DXPLANE p(0, ...
5
votes
4answers
214 views

Is there any guarantee about the graphical output of different GPUs in DirectX?

Let's say that I run the same game in two different computers with different GPUs. If for example they are both certified for DirectX 10. Is there a guarantee that the output for a given program ...
0
votes
1answer
177 views

What does SetTextureStage(0, D3DTSS_COLORARG2, 0) in DirectX mean?

I'm trying to convert some DirectX code to Ogre3D and was wondering what the following translates to: pDev->SetTextureStage(0, D3DTSS_TEXCOORDINDEX, 0) pDev->SetTextureStage(0, ...
0
votes
1answer
208 views

ID3D10Device::RSSetState to be called every frame?

I am trying to create a ID3D10RasterizerState with direct3D10, and then call ID3D10Device::RSSetState() with the proper information. However, whenever the window get rescaled, or when the app goes ...
7
votes
3answers
7k views

How should I implement a first-person camera?

I'm a beginner programmer and I'm creating a project which allows me to walk around rooms via a first person camera. So far, I have the buildings drawn and on, but now I'm stuck and don't know how to ...
2
votes
2answers
1k views

How does one avoid hundreds of copies into a vertex buffer each frame?

Assume a Direct3D9-based 2D game, high resolution, very busy. Performance critical. A particle system has 2,000 particles. They are scattered throughout the world with only a subset visible on screen ...
4
votes
2answers
996 views

Ara matrices calculated on the GPU or on the CPU? Would built-in matrix functions be faster than my custom ones?

If I add a math library (for example containing a Matrix class) and use it in my program drawing with OpenGL, will my be work slower than if I used standard OpenGL functions for matrix calculations? ...
29
votes
9answers
4k views

Should I continue studying OpenGL or just switch to DirectX to give me a better chance of landing a job in the game industry? [closed]

I've been learning graphics programming for some time now using OpenGL and Linux. I'm pretty familiar with most of the concepts, but I would really like to further my knowledge and eventually pursue a ...
6
votes
1answer
382 views

Why would I support multiple rendering engines simultaneously?

I've seen some games from the early 2000s that had a launcher where you could select the rendering engine you wanted to use: DirectX or OpenGL. Maybe I haven't looked hard enough, but I haven't seen ...
3
votes
2answers
1k views

Creating Font Textures in Direct3d without D3DX

Update: The completed solution using Nathan Reed's answer is posted in my answer below A few open source programs I've seen that render installed fonts do something like this... Create a texture for ...
0
votes
3answers
470 views

Why am I seeing this assertion error during Collada DOM loading?

D3DXMATRIX ColladaFileLoader::processMatrix(daeElement* node) { D3DXMATRIX matWorld; daeTArray<daeElementRef> nodeChildren = node->getChildren(); for (int i = 0; i < ...
8
votes
1answer
816 views

How can I implement a renderer that can draw many kinds of primitives?

This is somewhat linked to a question I previously asked concerning the drawing of indexed primitives. My problem was that I was only drawing one cube when I wanted to draw many. I was told that the ...
2
votes
2answers
1k views

How do I use D3DXVec3Normalize()?

It accepts two parameters, the first is an out parameter - a pointer type, so a referenced variable or a pointer to a variable - the second parameter is an in parameter of the same type but const. ...
2
votes
2answers
542 views

How can one access the depth buffer for Unreal Tournament 2004?

I'm looking for a way of getting depth buffer data for a virtual 3D sensor. Currently the method used is raycasting (implemented in UnrealScript), but I want to use the depth buffer data instead for ...
1
vote
1answer
2k views

How can I draw many objects on screen instead of just one?

Like many beginner graphics programmers I followed a tutorial which showed me how to set up buffer descriptions and fill out the vertex buffer etc... - the steps involved in drawing a simple indexed ...
3
votes
2answers
1k views

Where have the cross and dot products gone in DirectX10?

In D3D9 there were functions to deal with D3DXVECTOR3's in order to calculate dot and cross products. However these have disappeared from the math library in D3D10. I assume they must have gone ...
6
votes
2answers
1k views

How to get the maximum installed version of DirectX?

Okay, So I would like my engine to detect weather or not it can use DirectX 10, if it can't it defaults to DirectX 9.0c but, the function DirectXSetupGetVersion() will only return Versions 5 through ...
4
votes
1answer
2k views

How do I create a CPU read/write buffer in SlimDX (what are the legal combinations of Usage and CPUAccess flags)?

Currently, I create a vertex buffer in SlimDX like so: SlimDX.Direct3D11.BufferDescription Description = new SlimDX.Direct3D11.BufferDescription(); Description.BindFlags = ...
0
votes
1answer
410 views

DirectXCollision.h missing

I am using DirectX10, June release and I am trying to #include <DirectXCollision.h> so that I can use the bounding objects, however it does not seem to be there. Am I missing something ...
4
votes
2answers
3k views

How does one write to another process's OpenGL/DirectX context?

I want to write a short of chat client that display the messages in-game (OpenGL/DirectX), but I really don't know how to handle this. It is easy to write my client in my graphic context... but what ...
1
vote
1answer
143 views

How to prevent a certain textured quad from the effect of the pixel Shader at the run time in slimdxdirect3d9 or directx9?

I am having a video and and image slide show being rendered simultaneously. Both video and the image is being rendered by the help of texture and two different quads. Video is being rendered on the ...
0
votes
1answer
2k views

How to resize an image texture according to the size of a sprite in directx9 or slimdxDirect3d9?

I want to know that is there any way of resizing our texture to the size of a sprite in slimdx direct3d9 or directx9. That is if my image size is 1024x768 and sprite size is 500x500, how can i resize ...
3
votes
2answers
2k views

What is the “DirectX for Managed Code Update”?

I came upon this site while looking for information about working with DX in managed code and saw that MS released something containing a 'DirectX for Managed Code Update'. This sounds promising but ...
-2
votes
2answers
496 views

ID3D10Device pointer problem

sorry in advance for the large chunk of code. Basically when placed in the same file this works fine, but if placed in separate files (and I have tested this) just after Init() is called, the pointer ...
5
votes
2answers
254 views

What use does the unary & operator have in this piece of C++ code?

In an example for a little game framework (that does work), there are the lines: ID3D10Device* device; ID3D10Buffer* pBuffer; followed by the line device()->CreateBuffer(&bd, NULL, ...
1
vote
0answers
2k views

Directshow VMR9 Allocator presenter present image problem [closed]

I am working with DirectShow for video playback and trying to get the video displayed on a D3D9 texture via SlimDX. I am using IVMRSurfaceAllocator9, IVMRImagePresenter9 for getting a surface from the ...
21
votes
3answers
9k views

For voxel rendering, what is more efficient: pre-made VBO or a geometry shader?

Given a fairly static voxel array, what is more efficient: using the CPU to pre-generate a VBO to render the voxel faces (ignoring more advanced forms of rendering like marching cubes for now) or ...
1
vote
1answer
821 views

Zoom to mouse cursor DirectX

I have a DirectX scene. I want zoom in using mouse wheel to the mouse location. I am able to zoom the view to center of screen but I need to zoom to mouse location. Please suggest how it can be done. ...
0
votes
1answer
216 views

How fill gutter using ID3DXTextureGutterHelper interface?

Using UVAtlas (Direct3D 9) Packed charts are separated by a user-specified gutter width. The gutter width is the amount of separation between charts, and allows for bilinear interpolation and ...
0
votes
1answer
1k views

How to not-unroll loops in Shader Model 3 HLSL

I'm working on raycaster in HLSL, unfortunately it have to be in DX9. But it cannot be compiled I did similar raycaster in DX11 and i know that there is always problem with FXC compiler that it tries ...
37
votes
1answer
1k views

How do I create particles that react to the player and enemies?

I'm currently making a game with my own game engine which I've written in C++ and I'm using the most recent directx SDK. The game is a top down space shooter (with a pretty interesting twist) and ...
2
votes
1answer
1k views

Direct3D11 feature level

If I set the directx feature level to D3D_FEATURE_LEVEL_9_3 but I have a graphics card which supports D3D_FEATURE_LEVEL_11_0 does that prevent directx11 features from working even though my graphics ...
2
votes
0answers
649 views

Problem of tearing in Slimdx and DirectShow video [closed]

I have written a video player using SlimDX and DirectShow which is displaying the video on a SlimDX texture. I am extracting the video frames using the ISampleGrabberCB interface from DirectShow and ...
6
votes
3answers
2k views

Direct3D and OpenGL Matrix representation

As I read in OpenGL matrices are column major. It means that if I create a 16 element array first four elements are the first column in matrix. Is it the same for Direct3D or any transformation's ...
2
votes
1answer
356 views

What is an OpenGL equivalent to ID3DXSprite?

As a Direct3D developer I can use the ID3DXSprite class (in D3DX library) for drawing 2D graphics. What's the best way to implement this functionality in OpenGL?
0
votes
1answer
176 views

Under what circumstances will a PIX 'Render' be different to the actual 'render'?

I am trying to implement dual-pass alpha sorting using Ogre material scripts, as part of my debugging attempts I want to compare two PIX captures, but when I attempt to debug a pixel in PIX, ...
3
votes
2answers
3k views

How can I draw multiple lines connected via “nodes” with SlimDX?

I currently read out XML data with the following scheme: Position x,y,z I try to add one new Vertex for each position node and add it to a Vertex array. Then I try to render this list of vertices so ...
4
votes
2answers
6k views

Mapping a Vertex Buffer in DirectX11

I have a VertexBuffer that I am remapping on a per frame base for a bunch of quads that are constantly updated, sharing the same material\index buffer but have different width/heights. However, ...
1
vote
3answers
637 views

What should I use to handle input? [closed]

What should I use to handle input? I am wanting to use OpenGL so that my games are cross platform. DirectX provides input libraries, and OpenGL does not. Because my games need to be cross platform, I ...