direct3d

How to copy the pixel data from a texture into a bitmap (direct3d)?

I have rendered the scene into a texture, and then I want to save it into a bitmap, but after lock the texture, I found there is no pixel data in the lock area. The texture can be displayed correctly on the screen. I am not sure why? 1> the format is incorrect? A8R8G8B8 has been used. 2> have I missed some important steps before get the ...

Direct3D10: No 32bit ARGB format?

Im starting to add d3d10 support to go along with my existing d3d9 graphics backend. The problem is all the existing code (in several applications...) uses ARGB formatted colours however I couldnt find a format mode that matches for d3d10. Does d3d10 not support ARGB colour formats at all or have I just missed something? If I havnt miss...

Using a font from a ttf file in windows / direct3d

I'm using direct3d 9 and using D3DXCreateFont to create a font object that I can use to write text to the screen. However I want to use a font I have in TTF file instead of an installed font. Is there any way to create a font object from a TTF file without first installing the font into windows which I don't want to do? ...

How can I determine which displays are attached to the same physical device using Direct3D9?

Using Direct3D9, I can count the available adapters using IDirect3D9::GetAdapterCount(). However, this returns the number of outputs, i.e. 2 for a single dual-head graphics card. Using Win32 API, I can enumerate the display devices and the monitors attached using the following snippet: DISPLAY_DEVICE displayDevice; ::ZeroMemory(&display...

How to preserve other application windows sizes and positions when changing resolution? (eg. to and from full screen game in other resolution than desktop one)

Has anyone noticed this odd behavior of application that utilize D3D or OpenGL when they go to full screen in Windows? It applies only when applications go to full screen and then switch back to window or terminate. They either shuffle window positions of other applications (when I am on single monitor machine), or move all the other ap...

Direct3D & iPhone Accelerometer Matrix

Hi All, I am using a WinSock connection to get the accelerometer info off and iPhone and into a Direct3D application. I have modified Apples GLGravity's sample code to get my helicopter moving in relation to gravity, however I need to "cap" the movement so the helicopter can't fly upside down! I have tried to limit the output of the acc...

How do I set the color of a single pixel in a Direct3D texture?

I'm attempting to draw a 2D image to the screen in Direct3D, which I'm assuming must be done by mapping a texture to a rectangular billboard polygon projected to fill the screen. (I'm not interested or cannot use Direct2D.) All the texture information I've found in the SDK describes loading a bitmap from a file and assigning a texture ...

Is there COM exposure for Direct3D 10

Gentlemen and esteemed ladies. I posted this question in the COM forum at Code Project and got a snotty reply so hopefully you will be more helpful. I see that Microsoft has a COM library for Direct3D 9 exposed with GUID 81BDCBCA-64D4-426d-AE8D-AD0147F4275C. Has Microsoft exposed Direct3D 10 on COM and if so, what is the interface GUI...

Drawing 2D with SlimDX

Hello I'm having trouble rendering correctly sprite with SlimDX. It draws a little scaled just like .NET Drawing DrawImageUnscaled does. I'm not using any transformations. Init: Vector2 position; Sprite sprite; Size size; Texture texture; sprite = new Sprite(Device); string filename = /*some bitmap*/; using (Image b = Bitmap.FromFile(f...

Direct3D 10 and Shader Management

Hi, I am coding a 3d Application with DirectX 10 and I am wondering how the tackeling of the Shadermanagement is. Is it most effective to preload all shaders there are on application start and then use them as needed or does this train the resources of the hardware if the number gets higher. Also I wonder if it is a speed consideratio...

Graphics Profiling

Ive got an application which drops to around 10fps. I profiled it with xperf which showed my app was using just 20% of the CPU, with none of my methods using a larger than expected amount of that 20%. This seems to indicate that the vast drop in fps is because the graphics card isnt able to keep up with rendering the frame, resulting in...

Would it be possible to write a 3D game as large as World of Warcraft in pure Python?

Would it be possible to write a 3D game as large as World of Warcraft in pure Python? Assuming the use of DirectX / D3D bindings or OpenGL bindings. If not, what would be the largest hold-up to doing such a project in Python? I know games tend to fall into the realm of C and C++ but sometimes people do things out of habit! Any informat...

Building a MVVM 3D Editor Application -> Getting Mouse Position?

Hi, In my 3d editor application, I want to be able to click on and move a scene's entities (meshes, lights, cameras, etc). To do that, I imagine that I need to get the current mouse position relative to my Direct3d view and somehow give it to my ViewModel. How would I go about doing that, considering that my app is built with the MVVM p...

How to implement independent rendering layers in Direct3D9?

I'm working on a windowed Direct3D data plotting application that needs to display multiple overlays on top of the data (similar to HUDs in games). Since there could be a large amount of data that needs plotting, and not all overlays will be changed every time, I figured it wouldn't be a good idea to replot verticies when only one overl...

Can StretchRect be used with DF24 or INTZ surfaces? Can DF24 or INTZ be multisampled?

Can you StretchRect from a DF24 into another DF24 (ATI specific)? Can you StretchRect from a INTZ into another INTZ (nVidia specific)? Can you create DF24 or INTZ as multisampled surfaces? ...

What exactly is a surface in OpenGL ES or Direct3D?

I did not find a good definition of the concept of a drawing surface. What properties are associated with a surface? In the context of pure OpenGL there is no surface, since OpenGL has no notion of window system specific things. In OpenGL ES though you have the EGL API, which introduces the concept of a drawing surface, without defining ...

C++ D3DX Font and transformations (d3d9 and d3d10 solutions needed)

I want to render font in a way that takes account of the current transforms and similar settings, especially the projection transform and viewport. I'm thinking that the best way to do that is to have an off screen surface to render the text to, and then render that surface where I really want the text. However I'm not certain on a num...

Looking for a faster-than-GDI solution for rendering dynamic data plots

I've written a simple GDI-based data plotter using C++/CLI but it's not particularly fast (some basic profiling indicates it's the rendering to screen that's the problem). Is there any way to enable hardware acceleration for a UserControl or is there a .net interface for direct3D? ...or are there some other options I could consider. We...

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...

ID3DX10Mesh and ID3DXMesh Guids EXACTLY the same

I'm doing C# interop with Direct3D (I know about SlimDX and XNA so let's not get into the merits of this) and I'm calling D3DX10CreateMesh passing it my ID3DX10Mesh interface. I'm getting an error saying "No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE))". The D3DX10CreateMesh call comes while I am trying t...