directx

MDX/SlimDX messes up WPF scrollbars?

I have a very simple WPF user control that is mixed in with a windows forms app. It has a list box that renders its scroll bar without the thumb (image below). I narrowed it down to a plugin in my app that uses Managed DirectX (MDX). If I remove the plugin, the scroll bar is just fine. I know MDX is deprecated, but I don't think toda...

Managed DirectX9 ColorKey

I've managed to load a texture with TextureLoader.LoadFromFile(), and provided it with Color.Black.ToArgb() for it's colorkey. Unfortunately, when I render it, using Device.DrawUserPrimitives, I'm still seeing black. Am I missing some code to enable the use of the ColorKey? Needed to set some renderstate on the Device: Device.Rende...

Using DXUTSetWindow in a MFC Direct3D application

I've been experimenting with the DXUT functions for Direct3D applications in the March 2009 DirectX SDK. They seem to have many useful features including auto detection of DirecX10 or DirectX9 and window management features that bypass a lot of the tedious window management tasks generally required by Direct3D. However, I'm having a pr...

How do I separate the colour and alpha blend functions in opengl?

In the process of trying to port my 2D shadow rendering technique from Directx to Opengl, I've run across a problem where I can't seem to get fine enough access to the opengl blender. But first, so that the following makes sense, my algorithm: I sort and render all sprites from back to front without using a depth buffer. Shadow sprit...

Catmull-Rom splines - how do they work?

From this site which seems to have the most detailed information about catmull-rom splines: http://www.mvps.org/directx/articles/catmull/ it makes mention of needing four points to create the spline. However it does not mention how the points p0 and p3 affect the values between p1 and p2. Another question I have is how would you create ...

Drawing a full screen Quad ?

What's wrong with this: pVertexBuffer[0].Position = D3DXVECTOR3(0.0f,0.0f,0.0f); pVertexBuffer[0].TexCoord = D3DXVECTOR2(0.0f,0.0f); pVertexBuffer[1].Position = D3DXVECTOR3(m_ScreenResolutionX,0.0f,0.0f); pVertexBuffer[1].TexCoord = D3DXVECTOR2(1.0f,0.0f); pVertexBuffer[2].Position = D3DXVECTOR3(0.0f,m_ScreenResolutionY,0.0f); pVertex...

Get the graphics card model?

hi all, I was wondering how I can get the graphics card model/brand from code particularly from DirectX 9.0c (from within C++ code). Thanks for any help! ...

What does GUID_SysMouse map to?

We have software that runs fine under a normal Windows installation but when we try running it under a hardened Windows OS with device drivers stripped out it crashes horribly on this call: this.mouse = new Device(SystemGuid.Mouse) underneath the hood SystemGuid.Mouse maps to GUID_SysMouse. If I knew what GUID_SysMouse was equal to I ...

16 bit grayscale image display in WPF

I am developing an application that displays 16 bit grayscale images. The UI for the application was originally created using Win Forms and since Win Forms does not support 16 bit grayscale I wrote a custom openGL control to display the image. Within the last few months we have convert the UI to WPF, but continued to use the openGL image...

What might cause IDirectDrawSurface::Release blocks and never return?

DirectDraw 7 is very old APIs but we have a lot legacy code written on that. Recently I found that directdraw might block on some of it's interface calls, like IDirectDrawSurface::Release, and never never return. But some times they don't. I can not find any information by Google so I came here. Hope you can help me or tell me where ...

Multiple Rendertargets in DX9

I've set m_lpD3DDevice->SetRenderTarget(0,Buffer1); m_lpD3DDevice->SetRenderTarget(1,Buffer2); m_lpD3DDevice->SetRenderTarget(2,Buffer2); and if I render the pixelshader only affects the first render target. It's output structure is struct PS_OUTPUT { float4 Color0 : COLOR0; float4 Color1 : COLOR1; float4 Color2...

Managed DirectX9 MDI

I'm writing an MDI app using Managed dx9. When I create the Device, I pass in a control. If I pass in one of the MDI child windows (or more specifically, a control in the MDI child window), everything renders fine. I can spawn new child MDI windows and draw to each of these individually. I can close any of the new windows, no problem...

DirectX 9: Vertex shader attribute source

That's about DirectX 9. In typical case of rendering with vertex shader, there's one or more stream sources set in device, and format of the source data is defined using vertex declaration. Now, if a vertex shader used need some attribute (for example, one with D3DDECLUSAGE_NORMAL and UsageIndex 1 or 2), but vertex declaration that's p...

Antialiasing/Multisampling in D3D9

I'm writing a 3d modeling application in D3D9 that I'd like to make as broadly compatible as possible. This means using few hardware-dependent features, i.e. multisampling. However, while the realtime render doesn't need to be flawless, I do need to provide nice-looking screen captures, which without multisampling, look quite aliased a...

How do I get all the shader constants (uniforms) from a ID3DXEffect?

I'm creating an effect using hr = D3DXCreateEffectFromFile( g_D3D_Device, shaderPath.c_str(), macros, NULL, 0, NULL, &pEffect, &pBufferErrors ); I would like to get all the uniforms that this shader is using. In OpenGL I used glGetActiveUniform and glGetUniformLocation to...

IDirect3DDevice8::CopyRects in DirectX 9? C++

How do I port DX8's IDirect3DDevie8::CopyRects to DirectX9? I have found a function (stretchRect), but it doesn't seem to work... //clear the window to blue m_pD3DDevice->Clear (0, NULL, D3DCLEAR_TARGET, D3DCOLOR_XRGB(0,0,255), 1.0f, 0); //get back buffer LPDIRECT3DSURFACE9 pBackBuffer; m_pD3DDevice->GetBackBuffer(0, 0, D3DBACKBUFFER_T...

Does System.Windows.Media.Imaging use DirectX (like WPF) or GDI+?

First I used SSRS to render a TIFF document and found out although it is possible to pass colour depth parameter to SSRS 2005 or 2008, it discards it and always generates a 24bpp file. Without luck, got this 24bpp file generated by SSRS render method, loaded it on a System.Drawing.Bitmap object and successfully scaled it to 1728 pixels b...

OpenGL V DirectX (the endless war)

Hi there, I'm trying to work out whether to learn DirectX or to continue on with OpenGL... I dev mainly games, and I know enough of OGL to get by, nothing more. I know that DirectX and D3D are popular amongst professional games developers, is there any reason behind this? Which API is easier to learn and use? Is there any difference i...

Displaying a video in DirectX

What is the best/easiest way to display a video (with sound!) in an application using XAudio2 and Direct3D9/10? At the very least it needs to be able to stream potentially larger videos, and take care of the fact that the windows aspect ratio may differ from the videos (eg by adding letter boxes), although ideally Id like the ability to...

Connecting Catmull-Rom splines together and calculating its length?

I'm trying to create a class which takes in any number of points (position and control) and creates a catmull-rom spline based on the information given. What I'm doing - and I'm really unsure if this is the right way to do it - is storing each individual point in a class like so: class Point { public: Vector3 position; Vector3 control...