Questions tagged [direct3d9]

161 questions
0
votes
3 answers

HLSL - How can I set sampler Min/Mag/Mip filters to disable all filtering/anti-aliasing?

I have a tex2D sampler I want to only return precisely those colours that are present on my texture. I am using Shader Model 3, so cannot use load. In the event of a texel overlapping multiple colours, I want it to pick one and have the whole texel…
RJFalconer
  • 8,488
  • 3
  • 44
  • 58
0
votes
2 answers

How can I optimise an SM3 HLSL pixel shader by only executing complex code for some pixels?

I have a really complex HLSL shader doing tons of texture reads, using shader model 3 in Direct3D9. The complex code is only used at some pixels so I put an if-statement around that block of code. To my surprise this gives no performance gain at…
Oogst
  • 198
  • 12
0
votes
1 answer

Direct3D9 game: Spaceship camera

I am working on a Direct3D9 space simulator game in which I need to create a camera that holds the position and point of view of the player's spaceship. For the moment I limited my code just for moving backward and forward, up and down as well as…
featherless biped
  • 153
  • 1
  • 4
  • 14
0
votes
2 answers

Direct3D9 fullscreen app - deformed renderering

I have been hardly coding on a Direct3D9 based game. Everything went excellent util I hit a big problem. I created a class that wraps the process of loading a mesh from a .x file. I successfully loaded a cube with only one face visible. In theory,…
featherless biped
  • 153
  • 1
  • 4
  • 14
0
votes
1 answer

How can I avoid competition between overlapping windows in Windows Forms/SlimDX

I'm creating a Windows Forms application in C# that utilizes the SlimDX(a managed wrapper of the Direct3D API) libraries. Problems arise when I try to take the application fullscreen(a state in which the main window covers the entire desktop area…
P. Avery
  • 631
  • 1
  • 14
  • 32
0
votes
1 answer

LPDIRECT3DDEVICE::DrawPrimitiveUP only drawing in black and white

struct tri_vertex { float x, y, z, h; D3DCOLOR color; }; void Draw2DLine(float x1, float y1, float x2, float y2, D3DCOLOR dwColor) { tri_vertex vertices[2] = { x1, y1, 0.0f, 1.0f, dwColor, x2, y2, 0.0f, 1.0f,…
John
  • 5,001
  • 3
  • 32
  • 60
0
votes
1 answer

HLSL and ID3DXFont/ID3DXSprite

I've started at the beginning, and my code will capably display the grand total of some text. I've been adding support for sprites. The trouble that I've run in to, is that it doesn't seem to recognize my HLSL. I set the technique, began it, began…
DeadMG
  • 111
  • 1
  • 5
0
votes
1 answer

D3D9 Windowed Mode Multi-monitor

I have just started looking into D3D9 using SlimDX. I have a device created off the primary display adapter and device.present only flips the backbuffer onto the primary monitor. When the window is moved to the secondary display, the surface is no…
Zach Saw
  • 4,130
  • 3
  • 30
  • 46
0
votes
1 answer

SharpDX: How to map Texture or Surface (D3D9)?

Good day! DirectX 11 support this method: http://sharpdx.org/documentation/api/m-sharpdx-dxgi-surface-map How do I get access to the color buffer of texture or surface using Direct3D9? Thx! Resolved: Discovered by accident, going through all the…
Albeoris
  • 89
  • 1
  • 6
0
votes
1 answer

How to render formatted text in Direct3D9?

I'm writing an application which needs to draw a lot of text - several lines, maybe tens of lines - in Direct3D9. The text can be heavily formatted (i.e. different typefaces, styles, sizes) and can contain unicode symbols from different charsets.…
himself
  • 11
  • 1
0
votes
1 answer

D3D9 circle primitive bug

I tried to draw a 2D circle with D3D9 per vertices and DrawPrimitive but failed somehow. The white points in the picture below representing my vertices and the cyan circle is rendered with my function. This is my ellipse function RETURN…
DevilsJin
  • 99
  • 11
0
votes
1 answer

Translate VertexBuffer

I have created a vertex buffer which holds the vertices for a circle at (0, 0) with radius 2.5. I want to draw this circle wherever the mouse is so I captured WM_MOUSEMOVE and I store the mouse's position in a point P. I've already setup by world,…
Brandon
  • 20,445
  • 9
  • 73
  • 162
0
votes
1 answer

rounded edges/corners in DirectX (D3D9)

I created my own little 2D-Engine with DirectX (okey, should be more like a GUI in the end) and tried to create rounded edges for a simple Rectangle. Since I never done this with a graphics framework before I had no idea how to supply this. For now,…
DevilsJin
  • 99
  • 11
0
votes
1 answer

Direct3d9 load texture fail

I am working on a sort of big project. And I have been facing a fatal problem at the end of the day of the project. I guess it might be from memory leak, anyways please listen to my voice. The first time I launch the program, it works fine. and I…
Phiru
  • 39
  • 1
  • 8
0
votes
1 answer

Full screen Direct3D9 device only displays at native resolution when second monitor is plugged in

With a single monitor my program works in both windowed and full screen mode (using any resolution chosen from EnumAdapterModes), but when I plug in my second monitor (running the same code) I can create a full screen device at any resolution from…
Alex
  • 201
  • 2
  • 10