Questions tagged [direct3d9]
167 questions
0
votes
2 answers
Applying a pixel Shader to a texture within a sprite with SlimDX Direct3D9
So, I am very new to Developing with DirectX, I'm slowly getting there... But!
I have this which instantiates the Direct3D9 runtime, creates a device and loads a Pixel Shader. - I can confirm the Pixel shader is loaded as 1) it works in other…

Marcus Davies
- 3
- 4
0
votes
1 answer
Loading HLSL shaders and multi-device directx 9 rendering
For a multi-device rendering setup using Shader Model 2.0:
1 LPDIRECT3D9 with 2 or more LPDIRECT3DDEVICE9 objects.
Should I load/compile my shaders (HLSL) based on number of LPDIRECT3DDEVICE9 objects.
Then provide each shader to its respective…

Hinchy
- 143
- 9
0
votes
1 answer
Drawing sprites on D3D device
I have a hooked DirectX used in C++ code that draws text and sprite. I tested it and it drew well onto 2D application. However, when I tried it with 3D application (some complex game actually), only text was visible. From that I deduced the sprite…

Mikulas Dite
- 7,790
- 9
- 59
- 99
0
votes
0 answers
Direct 3D can not draw after screen saver
I'm drawing YUV image onto window on Windows.
Every time a screen saver launched or screen turned off, the window can not show anything again after I woke up the screen. I mean, the window shows nothing even through every Direct 3D APIs returns…

Galaxy
- 1,129
- 11
- 27
0
votes
0 answers
connect lines to look symmetric in d3d9 c++
I have a problem with the function atan2.
Actually, I'm trying to connect the lines to look symmetric.
Currently it looks like this:
The calculation:
CRect rectCurrent = pCurrent->GetRect();
CRect rectNext = pNext>GetRect();
CPoint…

Cucy
- 1
- 1
0
votes
1 answer
How to convert ticks to clock cycles when profiling API calls
I am profiling Direct3D9 API calls. I have read a lot of documentation here that describes the process. I have a question though about calculating the elapsed clock cycles. Here is my current method:
// measurement vars
LARGE_INTEGER start, stop,…

P. Avery
- 779
- 1
- 16
- 34
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
- 10,890
- 5
- 51
- 66
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
- 358
- 2
- 14
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
- 163
- 1
- 5
- 16
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
- 163
- 1
- 5
- 16
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
- 779
- 1
- 16
- 34
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,942
- 3
- 42
- 79
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,308
- 3
- 33
- 49
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
- 109
- 1
- 7