Jump to content
Xtreme .Net Talk

EFileTahi-A

Avatar/Signature
  • Posts

    633
  • Joined

  • Last visited

Everything posted by EFileTahi-A

  1. Well, I discovered the problem, I needed to add the following lines to the Device Parameters: presentParamsDX1.SwapEffect = SwapEffect.Discard; presentParamsDX1.EnableAutoDepthStencil = false; presentParamsDX1.PresentFlag |= PresentFlag.LockableBackBuffer; presentParamsDX1.MultiSample = MultiSampleType.None; And it works fine :)
  2. I simply can't understand why this does not work... Surface s = dxDevice.GetBackBuffer(0, 0, BackBufferType.Mono); GraphicsStream gs = s.LockRectangle(LockFlags.ReadOnly); It gives me an error when executing the second line of code. I've tryed using many different parameters but, always give me "Error-in-application". Why is this happening?
  3. Hey a friend of mine gave me this piece of code: Surface s = dxDevice.GetBackBuffer(0, 0, BackBufferType.Mono); uint[,] data = (uint[,])s.LockRectangle(new Rectangle(0, 0, 32, 32), LockFlags.ReadOnly); for (int n = 0; n < 100; i++) { for (int j = 0; j < 100; j++) { data[n, j] = (uint)Color.White.ToArgb(); } } but it gives me error on the second line... you know the 'Error-in-application' one.
  4. lol! I'm using MDX Visual Studio 2008. Oh man, I'm 1 week long trying yo find for a cure for my problem, my development is alted until I discover it. I really hope you can help me. Your name will be in my credit list for sure. Here is a screeny btw, so you can understand better what I'm trying to do. Notice the blue ray, it was fired from the left-top robot. Now, when you enter fire mode everything is black and only collidible objects are shown (this is not shown bellow), units are represented as circles and the bigger the unit the better the chances of being hit. What I did in GDI+ was to scan ahead from the ray's path, each frame. so if the ray is moving 25px per second it should scan for the next 25 pixels so the ray stop at the right moment and does not passes through a collidible object.
  5. Sorry for the double post, Anyway, I see what you mean, unfortunately I don't know how to do it, not even a clue how to bound a box to the ray, plus how afterwards to perform the pixel by pixel collision, and worst, can't find anything on web related to this, except my very own posts... Thanks again for the post.
  6. Its a line which acts as laser ray that needs to be checked for collision. I know I could use boxes and detect intersections bewteen them but that would not be precise, not precise at all. I want it to detect collision whenever the the ray's head passes over a non-black pixel. I made this with GDI+ and it worked like a charm, even in ZX-Spectrum's basic it worked like a charm, I can't believe that using DX it will be slow.
  7. Its a line which acts as laser ray that needs to be checked for collision. I know I could use boxes and detect intersections bewteen them but that would not be precise with irregular surfaces, not precise at all. I want it to detect collision whenever the the ray's head passes over a non-black pixel. I made this with GDI+ and it worked like a charm, even in ZX-Spectrum's basic it worked like a charm, I can't believe that using DX it will be slow.
  8. Ok, thanks for the help anyway :) I'll try to post a solution, if I found any.
  9. Could you post a piece of code demonstrating this? Surface s = dxDevice.GetBackBuffer(0, 0, BackBufferType.Mono); s.LockRectangle(new Rectangle(0, 0, 1, 1), LockFlags.ReadOnly); After this what should I do next? Thanks for the help so far, I'll keep googling anyway
  10. Thank you for the replies. Well the concept is very simple, if I can access the DirectX's backbuffer where everything has been rendered I can probe for any pixel in it for any color match and thus create collision. When I make a laser ray traveling through the map I should just check for each pixel in front of the ray's path in advancement and check if it matches a specific color. Its really simple to do in GDI+: Color c = f_shootRoom.pBufferGfx.GetPixel(Convert.ToInt16(ptfRayStart.X + ptfDirection.X * i), Convert.ToInt16(ptfRayStart.Y + ptfDirection.Y * i)); I just would like to know how can I recreate the same effect in DX :(
  11. Just wondering, is this possible to do? Or my post kinda confusing? I will gladly explain it better if someone stats this.
  12. I know I have to GetBackBuffer... but, that's all I know... Can someone give me a hand on this matter? A need simply to pick the color from a pixel located at a certain x,y position. but from the backbuffer's itself, not from texutures. I already made it work in GDI+, and it works marvelous, but now I need to do it in DirectX. The whole idea is to create pixel precision collision.
  13. Well to simulate the dark night is easy, u simply use the sprite.render method with customized color palette: sprite.Draw(..., Color.FromArgb(255,60,60,80) This will darken all ur sprites as well make them slightly blue (to better simulate the night light). As for the light, like a torch in player's hand, well I think you would need two images, one rendered as night and another as day light, then you could mix them with some kind of mask applyed to the night rendered picture, which would be transparent in the middle to reveal a bit of day light... I really can't tell you how though... and I really don't know if it would work, but.. just a thought... The effect can be shown bellow It would be nice also to have a separate sky layer so u could change the day clouds with some night stars, and also add some flickering to the light. I hope this helps in any way.
  14. I'm already using double buffering (rendering to a bitmap and then showing all the graphics when done, I'm also using manual painting). As I said, it flickers only occasionally, like 3 times per minute or so, without double buffering it flickers every millisecond :) Anyway, is there any way to disable the panels refresh, invalidate, paint event, calls? I don't know, it seems to me that its a refresh issue, as with manage DX where we need also to disable the form's refresh. Unfortunately that seems to have no effect on this problem of mine. PS: I noticed that this happens specially when the OS displays some system messages like when we receive a pop-msn from message about receiving a new email... weird...
  15. I'm using a panel to draw my GDI+ graphics but sometimes the panel flickers to its predefined back color. How can I disable the a panel's painting / refresh function?
  16. Lucky to me I met someone at GameDev's live chat who is an expert in game coding and sent to me a full example of how to accomplish this. Anyway my thanks for those who showed interest in my thread. - THREAD CLOSED -
  17. Ok, I need to fire some ray from a certain x,y location to any direction (360º). This direction should be set by mouse pointer. Any ideas on how to do it? I'm using GDI+ and C# to accomplish this and I would like to use .DrawLine to make the thingie happen. Can't find anything regard this on the web, so, I don't know even where to start it...
  18. Actually I'm using MySQL... So, what are my choices? :)
  19. I'm interested on getting Reporting tools for my c# .NET application, I've tried Crystal Reports (which has some problems, regarding line breaks in string variables) and ComponentOne Reports (which is INCREDIBLE SLOW for major lists.)... Could someone please post me some other Reporting tools? Freeare and Non-freeware. Thanks
  20. Ok, after some google I managed to enable project solutions. It turns out that in release mode the project compiles correctly, but in debug mode it simply skips the compiling process.
  21. The funniest thing is that if I put the project in another computer with VS 2005 it will behave the same way... The combobox in the Toolbar in which I can define if it is set to Debug or Release its disabled... The only way I can fix this is creating a new project and then import the form from the problematic project. I did this yesterday and it worked.. Then I start to renaming the project and deleted the old one, after this the new project would no longer run... ***...
  22. VS 2005 C# SP1 always use the same executable file whenever I try to run my project, I've tryed to build, rebuild the project but the he puts always in the ...\Debug folder the same outdated .exe file. It also skips any error in my project which forces me to believe it is not compiling the code at all... Any Suggestions?
  23. Well... I've try the index thing and reinstalling VS 2005, but the problem was still there... The funny thing is that all my projects become all with the same error message when trying to opening any form. I formated the computer and reinstalled everything, the problem got fixed this way. The very same projects begun to work with no problem, just like that. Thank you anyway for the posts m8s. Glad to know there is still someone taking care of the forum :). Take care!
  24. All my project form's can not longer be shown. I get the following: "One or more errors encountered while loading the designer. The errors are listed below. Some errors can be fixed by rebuilding your project, while others may require code changes." at Microsoft.Win32.RegistryKey.Win32Error(Int32 errorCode, String str) at Microsoft.Win32.RegistryKey.GetValueNames() at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.AppendWindowPanes(RegistryKey parentKey, ArrayList windowPanes) at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.GetRegisteredPanes(String extension) at Microsoft.VisualStudio.Shell.Design.WindowPaneProviderService.CreateWindowPane(DesignSurface surface) at Microsoft.VisualStudio.Design.Serialization.CodeDom.DeferrableWindowPaneProviderService.CreateWindowPane(DesignSurface surface) at Microsoft.VisualStudio.Design.Serialization.CodeDom.DeferrableWindowPaneProviderService.DeferredWindowPane.EnsurePane() I've tryed to rebuild the solution with no success... Please help me on this one! My work is alted!!!
  25. Hello. I would just like to know how can I communicate with a scanner a make it scan something on my command, in C#. Thank you
×
×
  • Create New...