Handmade Hero»Forums»Code
jacob
3 posts
is any ony one working on a c# build using vs
im trying to follow along but im using c# instead c++
Mārtiņš Možeiko
2559 posts / 2 projects
is any ony one working on a c# build using vs
Edited by Mārtiņš Možeiko on
Using managed language will be problematic with Handmade Hero approach. Managed languages typically don't allow to place objects at specific addresses - which is done with memory arenas and render buffers. So you'll need to redesign whole memory management system. Or just do "new" and rely on Garbage Collector, ...yuck.
jacob
3 posts
is any ony one working on a c# build using vs
I should mention that im using the 2015 version of visual studio
Cristián Donoso
6 posts
is any ony one working on a c# build using vs
I made a gameboy emulator in C# using many of the techniques explained by Casey.
As mmozeiko said, you have less control over what exactly the memory does, but that is no limitation to implementing many of the features (say, dll reloading) without having to even modify the memory management. That technique relies in having a conscious packing of the state, rather than some language specific construct.

Now, you have to keep in mind of what are you trying to accomplish in C#. Handmade hero is purposely low-level, both in it's API approach to the system and (specially) the use of the resources provided by the machine. Having a managed language makes it difficult in achieving that (though there is a fair amount you can actually do). But the "architectural" side of handmade hero is portable pretty much anywhere.
Mārtiņš Možeiko
2559 posts / 2 projects
is any ony one working on a c# build using vs
The architecture of memory management in HH is not really only for dll reloading. It's main advantage is for saving state and reloading it later with trivial amount of code. No complex serialization and deserialization needed.
Cristián Donoso
6 posts
is any ony one working on a c# build using vs
By all means, the dll reloading was just an example. The point I'm trying to make is that that particular architecture is not language dependent and those features could be implemented in C# almost as is. So that kind of knowledge is "transferable" without too much hassle.