Jump to content
Xtreme .Net Talk

Contrast

Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by Contrast

  1. I'm trying to get action mapping to work, but I don't find any of the predefined enumerations to have as many button definitions as I'd like, so I want to use the Any enumeration. In C++ this enumeration features many axes, some hat switches, and a button macro that you can feed a number to. In C#, which I'm using, the enumeration is missing the button macro, so I can't map buttons. Furthermore, I'd like to select a genre for the ActionFormat that corresponds to Any, but there doesn't seem to be one in the Any enumeration like there is in the other, predefined enumerations. What can I do to give my ActionFormat a good genre, and what's the C# equivalent of this button macro?
  2. I understand your dilemma - I had a look at DirectDraw for use in my own sprite engine, but the limited abilities with regard to translucency were a big factor in my choosing Direct3D in the end. I haven't had a good look at D3D sprites yet, but I have textures mapped onto rectangles with full alpha blending, transformations, etc. Besides, accelerating through the 3d card is probably faster than just using DirectDraw in the first place. So that's my recommendation.
  3. Thanks a lot, I turned on that unmanaged debugging flag and was provided immediate insight, after MSDN didn't give me a thing (of course that's partly due to the SQL Server worm slowing us all down). It turns out that it creates the texture surface and then draws the image onto it, not vice-versa, so that the texture has to either be dynamic or be in a different pool. Since my driver apparently doesn't support dynamic textures, I switched it to the managed pool and it works like a charm. Thanks a bunch.
  4. I'm trying to piece together a bitmap and then make a nondynamic texture from it. I use the static method Texture.FromBitmap() in the Microsoft.DirectX.Direct3D namespace, but I get an IllegalArgumentException regardless of the arguments I feed it. My code looks like this: Bitmap bitmap = new Bitmap(blockWidth, blockHeight, System.Drawing.Imaging.PixelFormat.Format32bppPArgb); Graphics graphics = Graphics.FromImage(bitmap); (... draw with graphics object ...) Texture texture = Texture.FromBitmap(Game.device, bitmap, 0, Pool.Default); The last line throws the exception. I've tried several different Usage enumerations (3rd argument), and three or four PixelFormats for the Bitmap object, but I can't get rid of the exception. The worst part is that the exception doesn't explicitly tell me what's wrong, and neither does MSDN and it's 'preliminary documentation.' Can anybody point me in the right direction please? Thanks in advance, Contrast
×
×
  • Create New...