directx

DirectX InvalidCallException unhandled

I am getting an unhandled exception when trying to create a D3d device. This is literally the whole code in C#. I am just testing and trying to learn directx. I am getting the Unhandled exception on this line : device = new Device(0, DeviceType.Hardware, this,CreateFlags.SoftwareVertexProcessing, presentParams); using System; ...

Fast software rendering on iOS.

Bad news everyone! I'm trying to port old Windows game to iPad and I have a problem. Much of all graphics written without hardware acceleration. On Windows it uses LockRect() call from IDirect3DSurface8 class to get colorbuffer from backbuffer and write some graphics data. After this it uses UnlockRect to send our pixel color data to v...

A problem with translating

I am writing a car rally game. for road i am used from "PositionNormalTextured" vertex type but for car i am used from a Mesh. Car is fixed and road moves below it and i have one "Device" that i render car and road with it. Now i want to move the car left and right but car and road move together. What should i do? ...

A problem with translating

I am writing a car car rally game. for modeling the road i am used from "PositionNormalTextured" vertex type and for modeling the car i am used from a Mesh. the car is fixed and road moves below it an i have one Device that i render car and road with it. Now i want to move car left and right but car and road move together. What should i ...

What's a good 2D graphics drawing API for Windows/C++?

Hey, I've been working on a small little application, and I've been using DirectX/3D to draw textures to the screen (all 2-dimensional elements). The API, I find, is pretty easy to use and to incorporate using OOP principles, but I can't help but feel that using DirectX on something this small is insanely over-kill. I can't seem to fin...

Using DirectX to save a texture to a file in C#

Hey everyone, I recently got the June 2010 DirectX SDK and I'm trying to make a small WinForm application through it. At the moment I have a texture displaying out to a window which will be replaced by a small animation. What I'm trying to do is to save the texture to a file. I searched around online and found references to a TextureLoa...

How can I alphablend only certain parts of a texture in DX 9?

Hello everyone! How can I alphablend only certain parts of a texture in DX 9? For example, layers in Photoshop (or any other photo editing program that supports layers). You can draw something in a layer (background filled with alpha), then place the layer over the original image (draw the texture on the screen) which leads to the or...

how to implement windows 7/vista window flip on windows xp?

I have try using DirectX to capture and rotate output, but the output effect is static, not like in windows 7 win+tab. ...

SDK for in-game overlays

What little information I managed to dig out on developing in-game overlays (similar to what Steam does) mentions having to intercept calls graphics API's frame swapping function, and hook my own drawing routine in it. This appears to be what Mumble (a gaming VoIP) is doing. Since I've never done anything that involves hooking, and sinc...

Recording a live video stream in C#/XNA

Hey everyone, I have a project that renders the web cam stream onto a texture. I was wondering if there was a way, either through DirectX's Audio/Video functionality or through XNA directly where I can record the stream into an avi file format? Thanks in advance for the help. ...

Moving a 3d camera on XNA

Hello, Im doing some practices on XNA, and i created a class that represents a Camera. My objective is that when the user press some keys make a translation of the camera (not the target) 90 degrees in the X axys (to see an object that i placed in the scene from different angles). By the moment i move the camera in X, Y, and Z without...

What is the best way for starting graphical interfaces programming in C?

I have some knowledge in C/C++ but only using the Console. I'd like to start programming some graphical interfaces, but I don't have the minimal idea where to start. I've heard of GUI applications and DirectX applications. I'd like to know which is the best for start programming? Which libraries also is good to use and some tutorials...

Zooming in and out in Direct3D

Hello, I have a 3D scene and I want to be able to zoom in and out. What implementations are good, and which has some flaws? Will I be changing viewport, clipping panes? I totally don't know. Thanks ...

How to adapt DirectX-style world/view/projection matrices to OpenGL?

I have an application which uses DirectX, and hence a left-handed world-coordinate systen, a view which looks down positive z and a projection which projects into the unit cube but with z from 0..1. I'm porting this application to OpenGL, and OpenGL has a different coordinate system etc. In particular, it's right-handed, the view looks ...

C# Automation Framework for DirectX

What should I use for automating DirectX applications from C# code? I'd like to send key and mouse messages to a DirectX game, from within a C# application. I've tried the pInvoke solutions to no avail, having code like INPUT[] InputData = new INPUT[1]; InputData[0].type = (UInt32)InputType.KEYBOARD; InputData[0].ki.wScan = (ushort)0x...

OpenGL DirectX "Abstraction Layer"

Hey guys, I was reading about creating abstraction layers to make it easy to switch between platforms. They did not go into much detail but here is what I got out if it. Is it just something like this? void pushMatrix(){ if (directx){ // do directx function }else if (opengl){ // do opengl function } } Is this how it ...

DirectX rotation along a different plane

Is there a way to rotate an object along a different plane? I am making a 3D model of the solar system, and I'd like to get Pluto to revolve around the sun on a different plane to that of the other planets. I currently have the first eight planets revolving around the sun in the xz plane(rotation about the y-axis). Is there an easy wa...

C++ & DirectX - geometry question

Hello! I am working on my own 3d engine and have the following question: I have an abstract object, that handles geometry (vertices and faces). It uses internal storage for this geometry, allows editing and my renderer object has a method RenderGeometry. With this design my rendering process includes a geometry caching step. So, rende...

c++ directx gaming: images vs vertices

In video games, do they use images or do they draw everything using vertices? ...

C++ matrix-vector multiplication

Hello! When working with 3d graphics, sample shaders USUALLY use the following operation for vector position transformation: result = mul(matrix, vector); This obviously means the same as: result = mul(vector, matrix_transposed); Also, just to mention, most linear algebra libraries prefer to only leave the vector * matrix multiplic...