Jump to content
  • Advertisement
Sign in to follow this  

c# async drawing

This topic is 4999 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I decided I was going to experiment in c# with making a raytracer. So I write my class structure for my rendering engine my lightsources etc etc All my code is working fine. All my small tests for each piece is working nicely. check. happy days! So to make it easier to check each new feature as I add it I decided to create a UI framework to work with to easily test. I created a nice menu for loading/unloading test scenes, a nice menu for starting/stoping/pausing rendering, and finally three tabbed windows one to display the scene file another to display the image as it is rendering and finally a tab with a tree display to show each object and its values. So far so good. So I create a thread to render on and find i am constantly getting a race condition with my picture box with the rendering on it. so i tried to use lockign and it seemed to work but i keep getting wierd bugs with it. so I tried this article on called 'Draw Asynchronously With .NET' http://www.fawcette.com/vsm/2002_08/magazine/columns/desktopdeveloper/ yay! problem solved...um no. all this 'should' work for me but I can't make heads or tails of this gobble gook! I read the article figuring ah all this seems easy so then i tried to implement the code as it is written. well he uses some functions in his example that he doesn't explain very well (at all) the functions work as he describes them but 'how' they do what they do is not explained at all example: Kill(_thread); // ah kills the thread! glory easy peasy yes? when you look at the kill method though it is a ton of gobbled lock unlock join wait etc etc that makes no sense has no comments and even better...no formatting >.< anyone have a good article on threading in C#? a good article on drawing using GDI+ in C#? I HAVE seen an article on raytracing in C# (I have this part down pat no worries there, graphics section of this site was VERY helpfull), unfortunatly this program was not multithreaded. =-( if you would like to see my render engine program as it is i can post it on my web site somewhere but as it is not really worth it. soem times works great some times um yah hehe.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!