directx

Code leaks memory, seems to be coming from ID3DXBuffer, unsure why..

I load a shader with the following: ID3DXBuffer* errors = 0; ID3DXEffect *effect = 0; HR(D3DXCreateEffectFromFile( gd3dDevice, L"Shader.fx", 0, 0, D3DXSHADER_DEBUG|D3DXSHADER_SKIPOPTIMIZATION, 0, &effect, &errors) ); for(int i = 0; i < 3; i++) { if(errors) { errors->Release(); if(effect) ef...

textureMappingu/v in common Vertex structures?

Looking through some directx examples, I'm often seeing the structure for a vertex to be defined as such: struct Vertex { vector position; vector normal; int textureMappingu; int textureMappingv; } Under this type of vertex, what are textureMappingu/v for? ...

HLSL DirectX9: Is there a getTime() function or similar?

Hi all. I'm currently working on a project using C++ and DirectX9 and I'm looking into creating a light source which varies in colour as time goes on. I know C++ has a timeGetTime() function, but was wondering if anyone knows of a function in HLSL that will allow me to do this? Regards. Mike. ...

play avi using c++

i want to play an avi file using c++ and direct X with a mfc interface ...

How do you set up a menuing system (clickable buttons) in C++/directx?

I'm lead to believe that function pointers are going to be needed to assign functions to the images that will be used as buttons somehow, but I can't find any decent resources on this. How can you set up a button menu in C++? For example, having buttons for save, load, exit, new. edit: I am not worried about portability for this exa...

Matrix classes Directx & OpenGL

I have the following C++ matrix class: transform.h transform.cpp I am using this coupled with a renderer, for which there is an opengl and a directx implementation. I have a test example where the coordinates of the mouse within the window are used to position a graphic under the cursor. This works as expected under OpenGL. Because d...

Hiding the Cursor

I have a windows program with directx/opengl renderers, and a custom mouse rendered as a quad. The program currently runs windowed. The problem is the standard windows mouse is overlaid ontop of my custom cursor. How do I hide it when its inside my window? ...

Rendering multiple different textures with 1 image? (such as fonts)

Let's say I have a texture which is one file with separate 20 px by 20 px blocks. Within each of these blocks is a new character and I'd like to render different characters on screen as textures using these blocks. How can I use directx to render separate pieces of a texture file? ...

I3D3XFont::DrawTextW - Expanding tabs wrong?

I'm wondering if it's an issue with I3D3XFont::DrawTextW, I pass it a string with \t in it, which it expands. However, it doesn't always do it correctly. If I print the same string that I pass to it, the tabs are expanded correctly. For example, dxfont->DrawTextW(NULL, msg, wcslen(msg), &textbox, DT_LEFT | DT_TOP | DT_EXPANDTAB...

compiling DirectX transform (DES effect) for x64

Hello, I've got a DirectX transform working perfectly on XP, Vista and Windows 7 32 bit. Like most DirectX transforms it compiles against part of the DirectX6 media SDK, with DirectShow headers from Microsoft DirectX SDK Extras from 2006 My application now needs to be ported to 64 bit, to handle the large memory requirements of HD. I w...

where are the official directx forums?

I have been checking around MSDN and Microsoft.com but i can only find Archived forums. Are there any microsoft run forums for DirectX anymore? ...

Running a WPF User control or Managed Directx control on JFrame

If I have developed a user control as mentioned in the tile and I use this http://www.ikvm.net/ to convert my .dll to a Jar file, Can I then embed that control on my JFrame? If so can you give an example please. ...

Multiplying by inverse matrices?

If I have a matrix which is a combination of World*View*Projection and I multiply it by the inverse of the projection does it yield the World*View matrix or something else? If not then how can I extract the World*View matrix from a World*View*Projection matrix? Thanks for any help :) ...

How to get the x,y coordinate of a mouse-click with win32 C++ on a directx object?

How can I get the x,y coordinate of a mouse click, to see if it is over my menu button drawn by directx? Currently, my codebase has the following mouse-related class that doesn't seem to be able to give me this..I'm not sure how this might work. InputMouse::InputMouse() : m_LastX(-1), m_LastY(-1) { m_MouseActionEvent.clear(...

DirectShow IVideoWindow and Fullscreen--Can I write to my D3D Primary Surface?

Writing a game, and I'd like some cutscenes in the middle. In windowed mode, the DirectShow classes work perfectly and are easy to use. But when the game is fullscreen, I can't get DirectShow to show a fullscreen cutscene. Basically, when I have a D3D Device initialized, I can't get the video to display, even with IVideoWindow.put_Fulls...

Who can tell me what this bit of C++ does?

CUSTOMVERTEX* pVertexArray; if( FAILED( m_pVB->Lock( 0, 0, (void**)&pVertexArray, 0 ) ) ) { return E_FAIL; } pVertexArray[0].position = D3DXVECTOR3(-1.0, -1.0, 1.0); pVertexArray[1].position = D3DXVECTOR3(-1.0, 1.0, 1.0); pVertexArray[2].position = D3DXVECTOR3( 1.0, -1.0, 1.0); ... I've not touched C++ for a while - hence th...

API to get the graphics or video memory

Hi, I want to get the adpater RAM or graphics RAM which you can see in Display settings or Device manager using API. I am in C++ application. I have tried seraching on net and as per my RnD I have come to conclusion that we can get the graphics memory info from 1. DirectX SDK structure called DXGI_ADAPTER_DESC. But what if I dont want...

Check when the application has gone fullscreen. (DXGI/DirectX10)

Hi, this is my question... There is a way to check when the application has gone fullscreen in DXGI (DX10/11). For going Fullscreen I mean that the system has COMPLETED the mode change. Cause i need it for my application to prevent deadlock and to adjust timing. (I have a multithreaded engine and the Present is not on the message pump ...

What might cause IDirectDraw::GetCaps returns DDERR_INVALIDPARAMS?

Hello, I have this little snippet of code with IDirectDraw::GetCaps returning DDERR_INVALIDPARAMS (a.k.a. E_INVALIDARG, a.k.a. 0x80070057). The loaded dll is ddraw.dll 5.03.2600.5512 (xpsp.080413-0845) I need to check whether the display hardware has 3D acceleration (DDCAPS_3D). I have no idea to solve the problem, the snippet is so s...

DirectX having a sphere orbit a point at a given distance, over time.

I'm trying to make a basic model of the solar system in Direct X. I want to have the planets orbit the sun and the moon orbit the planets. So I have the planet/star/moon which takes a pointer to it's parent position vector. From that, how would I be able to make the object orbit at a set speed? So for example the moon would have a point...