I have a couple noobish questions about SDL.Net. The first is this:
Every SDL or SdlDotNet tutorial I have seen has used a defined Surface as the main screen. For example
[source lang="csharp"]private static Surface videoscreen;videoscreen = SetVideoMode(800, 600, 16, false, false, false, true);videoscreen.Fill(Color.Black);videoscreen.Blit(sprite);videoscreen.Update();[/source]
However, while trying to build a game with SdlDotNet I noticed that I can simply use Video.Screen for any action I normally would have preformed on the Surface screen. For example:
[source lang="csharp"]Video.SetVideoMode(800, 600, 16, false, false, false, true);Video.Screen.Fill(Color.Black);Video.Screen.Blit(sprite);Video.Screen.Update();[/source]
Is there a reason why everyone still uses a defined Surface? I'm assuming there is some sort of performance or stability issue that I haven't encountered within the scope of my little game, but I would like to know in case I might run into trouble later on.
My next question is about freeing unused surfaces. I understand that it is good practice to free any surfaces that are no longer in use while the program is running to free up memory space, but is it necessary to free all surfaces when the program closes? Can Windows (or other OSs) tell that the program associated with that memory space is no longer running and allow other programs to use it? If the program using SDL crashes what happens with the allocated memory?
DaveWHMember Since 12 Jul 2012
Offline Last Active Jul 20 2012 08:33 PM
There isn't much to say about me. I have always been a gamer, but I recently realised that the world of games just didn't offer me what I wanted - so I decided to make my own. I took some computer graphics classes in high school that gave me a solid understanding of Photoshop (I use GIMP now) as well as a basic intro to 3D modeling, Flash, and HTML. I have recently taken a couple of intro to programming courses in college that focused on VB.Net. After some fiddling around I think I have settled on C# and SDL.Net to build my game with, but the process has been agonizingly slow. I doesn't help that my kids and my job siphon away most of my time.
- Group Members
- Active Posts 5
- Profile Views 608
- Submitted Links 0
- Member Title Member
- Age 29 years old
- Birthday January 11, 1985