or any c++ stuff:
Maybe use SFML then?
You're not doing yourself any favors by avoiding C++ containers and practices.
If you want to write C, you shouldn't try and go with a trade off, of using C++ libraries, they don't mix (well).
Additionally, it's fine to put some restriction up on yourself for fun and playing around, but once you have to ask others to spend their free time fixing your problems due to the abscure restrictions, then you really have to ask yourself if that's fair.
This code crashes :
This is not a problem description.
You have a debugger that can output where exactly it crashes and why. I even suspect that this doesn't even compile, because I don't think you can call a constructor like that.
Additionally, I have no idea if you can safely construct C++ classes with malloc. If anything, you could allocate the space and then maybe use placement-new (oh no C++ feature) to create the class in place.
Again, if you want to write C, then use the CSFML binding.