Jump to content
Xtreme .Net Talk

LDV

Avatar/Signature
  • Posts

    31
  • Joined

  • Last visited

Everything posted by LDV

  1. Hi Guys, I wrote a short game in C# Managed DirectX, using the Direct3D interface. In my computer and Graphic Card, the FPS is being controlled by the Screen Refresh Rate ... means 85FPS when using PresentationInterval=default. When i'm using PresentationInterval=immidiate it gets to 300FPS ! On others computers the PresentationInterval - default doest not work !! - and i can't see the graphics ... why is it? - and the Refresh Rate is not being used to synchronize the program. I want it always to work with PresentationInterval - default so i can use the screen refresh rate to update the screen and not to have 300FPS. 10x, LDV
  2. Hi Guys, I had an amazing nice beurifull program i wrote in C# .NET 1.1 in VS Pro 2003. Then, one day, i divided my code to the normal code, and an additional project called myCommon, which is a .dll for common code. Suddenly the program started yelling for: System.MethodAccessException An unhandled exception of type 'System.MethodAccessException' occurred in Unknown Module. Additional information: System.Threading.WaitHandle.Dispose(Boolean) It's happens in normal code, that worked fine before ..... Why is it hapening to me ??? Thanks, LDV
  3. First thanks, It does fixes the resolution idea...but how can i check for the BitDepth? BTW: Is there a way also to change it? 10x, LDV
  4. Hi Guys, How do i get the Screen Resolution? In GDI .NET - i want to know if the user is in 1024x768x16BitColor .. how do i check it? LDV.
  5. Hi Guys, I hold in my application a various of Graphics objcets: Surfaces, Textures and Vertices. Some of them are loaded to Pool.Default, some to .Managed and some to SystemMemory. I also have some "non regular objects", like the BackBuffer Surface, and a Sprite object After my device is lost, and i want to reset it, how do i know which objects are lost and i need to rebuild them or load them ??? I gues the backBuffer and sprite i need to rebuild, but what about the textures and surfaces?? Thanks, LDV.
  6. I don't know about meshes ... but i use Sprite class for viewing textures. I initiate the sprite.begin function with SpriteFlags.AlphaBlend LDV
  7. Just plain expiriance: When i draw using Surface i get to 60FPS And when i draw Texture using Sprite class i get 30FPS. LDV
  8. Hi Guys, I'm using DirectX3D, I'm trying to draw a Surface with a Transprent color - any idea of how i do that? How can i set Surface ColorKey ? And even when i set it, how do i StrechRectangle or UpdateSurface with this ColorKey as transperent? I know i can use Texture - and ColorKey or Alpha, but i want to use Surface which is much faster. Thanks, LDV
  9. Hi, 1. I'm not sure - but make sure you use the same PixelFormat of the Screen and the Bitmap. 2. The Bitmap have a function called: .MakeTransperent(Color) - it will make any color you want to be Transperent regardless the .PNG transperent color. 3. I'm drawing .PNG with transperent color with no problem. 4. Check the Transprency / ColorKey in teh properties. LDV
  10. First, DrunkenHyana i want to thank you for your truely help. I tried to set them all Z to 0, and i checked i draw the Preimitve after i draw the Sprite and it didn't help. I found another thing that was the problem. I called Sprite.Flush() before i draw the primetives - that made it almost ok. There are two new problems now: 1. Somehow i don't get the full fae out now, i set it all to Alpha-255,RGB 0,0,0 and still it looks darker but now totally black - before - it was all black, except for the Sprite object ofcousre. 2. The program is much slower now. Thanks, LDV
  11. Just use the Argb color. Color.FromArgb(Alpha, red, green, blue);
  12. Do you work With DirecX3D ? How do you draw the Square? Where do you want to have the AlphaBlend - Transperency? LDV
  13. Ok, Guys, Thanks i did it. But there is still a problem. If i draw somethings uding .UpdateSurface or .StrechRectangle the quad shows transpernet on them. - that's OK. But if i draw something using the Sprite object (Yes - with Alpha flags) it draw over the Quad, and i can not see the transpernt quad. Maybe it's something for the order i do the: m_sprite.Begin(SpriteFlags.AlphaBlend);?? Or maybe it's something using the .Z property?? Here is some code: The Vertex: m_device.RenderState.CullMode = Cull.None; m_device.VertexFormat = CustomVertex.PositionColored.Format; m_vertexFade = new VertexBuffer(typeof(CustomVertex.PositionColored), 6, m_device, 0, CustomVertex.PositionColored.Format, Pool.Default); CustomVertex.PositionColored[] fverts = (CustomVertex.PositionColored[]) m_vertexFade.Lock(0, 0); fverts[0] = new CustomVertex.PositionColored(0, 0, 1, m_clrFade.ToArgb()); fverts[1] = new CustomVertex.PositionColored(0, 768, 1, m_clrFade.ToArgb()); fverts[2] = new CustomVertex.PositionColored(1024, 768, 1, m_clrFade.ToArgb()); fverts[3] = new CustomVertex.PositionColored(0, 0, 1, m_clrFade.ToArgb()); fverts[4] = new CustomVertex.PositionColored(1024, 0, 1, m_clrFade.ToArgb()); fverts[5] = new CustomVertex.PositionColored(1024, 768, 1, m_clrFade.ToArgb()); m_vertexFade.Unlock(); The drawing of the obeject with Sprite object: sprite.Draw(m_texture, m_rect[num], new Vector3(0, 0, 0), new Vector3(x, y, 0.5F), Color.FromArgb(255, 255, 255, 255)); Thank you all in advance, LDV
  14. More problems ... Ok, Guys, Thanks i did it. But there is still a problem. If i draw somethings uding .UpdateSurface or .StrechRectangle the quad shows transpernet on them. - that's OK. But if i draw something using the Sprite object (Yes - with Alpha flags) it draw over the Quad, and i can not see the transpernt quad. Maybe it's something for the order i do the: m_sprite.Begin(SpriteFlags.AlphaBlend);?? Or maybe it's something using the .Z property?? Here is some code: The Vertex: m_device.RenderState.CullMode = Cull.None; m_device.VertexFormat = CustomVertex.PositionColored.Format; m_vertexFade = new VertexBuffer(typeof(CustomVertex.PositionColored), 6, m_device, 0, CustomVertex.PositionColored.Format, Pool.Default); CustomVertex.PositionColored[] fverts = (CustomVertex.PositionColored[]) m_vertexFade.Lock(0, 0); fverts[0] = new CustomVertex.PositionColored(0, 0, 1, m_clrFade.ToArgb()); fverts[1] = new CustomVertex.PositionColored(0, 768, 1, m_clrFade.ToArgb()); fverts[2] = new CustomVertex.PositionColored(1024, 768, 1, m_clrFade.ToArgb()); fverts[3] = new CustomVertex.PositionColored(0, 0, 1, m_clrFade.ToArgb()); fverts[4] = new CustomVertex.PositionColored(1024, 0, 1, m_clrFade.ToArgb()); fverts[5] = new CustomVertex.PositionColored(1024, 768, 1, m_clrFade.ToArgb()); m_vertexFade.Unlock(); The drawing of the obeject with Sprite object: sprite.Draw(m_texture, m_rect[num], new Vector3(0, 0, 0), new Vector3(x, y, 0.5F), Color.FromArgb(255, 255, 255, 255)); Thank you all in advance, LDV
  15. I found this article very helping too: http://staff.develop.com/candera/weblog2/articleview.aspx/DirectX/Direct3D/13%20Device%20Recovery.xml LDV
  16. Pardon me for asking, but how do i do that. I mean creating the traingles. Untill now i used only Textures and Surfaces with the Sprite class or UpdateSurface. :-\ I have the Device3D, and i have the back buffer surface. Thanks, LDV.
  17. Hi Guys, I'm using DirectX - Direct3d - 9 - Managed, to build a 2d game. Although it's 2D i'm using the 3D interfaces. Some time i uses Textures to display images, using the Sprite object, and sometime i uses Surfaces using the UpdateSurface or StretchRectangle methods. I would like to know, generally, which is better to use? surface or texture? Which consume more memory? Which one is faster to draw? Thanks a lot. LDV
  18. Hey, Thank you all guys... as i understood correctly.. I'm building a black full screen texture and paste it over the current screen playing with it's alpha value. I haven't tried it yet - but it should work. Thanks.
  19. Hi Guys, Any ideas how to create a full screen fadein / fadeout in Managed DirectX3d? Thanks.
  20. Great Thanks !
  21. http://download.microsoft.dom - under the DirectX SDK LDV
  22. I had this problem. And i solved it by: 1. Installing .NET framework 1.1 2. Installing the latest DirectX9 SDK Managed 3. Visual Studio .NET 2003 As much as i know, you must use the VS.NET 2003 (it is version 7.1.3088 - check it in the help-about menu) LDV
  23. use a newer VS.NET Hi, I ran into this problem. You are using older version of DirectX9 or VS.NET 1. Be sure to use the Managed DirectX9 DLLs build 1126. 2. Be sure to use VS.NET 2003 LDV.
  24. Hi, I'm trying to view a portion of a texture using DirectX3D. I'm using the Sprite class. When using TextureLoader.FromFile(device, fileName); It draws the Texture not with the right size..... Why is it?? When using TextureLoader.FromFile(device, fileName, size, size, Filter, usgae etc') It draws the Texture in the right size but with no Alpha blending. Why? LDV
  25. Hi, I'm having some troubles with Textures in DirectX3D. I'm trying to create textures: like: m_texture = new Texture(dev, m_bitmap, Usage.SoftwareProcessing, Pool.Default); But i get InvalidCallException ! So i'm using: m_texture = TextureLoader.FromFile(dev, fileName); But when i try to show part of the texuture using Sprite class: sprite.Draw(m_texture, m_rect[num], new Vector3(0, 0, 0), new Vector3(x, y, 1), Color.FromArgb(255, 255, 255, 255)); I get it all very deformed. Any ideas? Thansk, LDV.
×
×
  • Create New...