Lemmih/hsSDL2 — pull request #41 by Drezil (2014-03-26 17:34:02+00:00)
Title: fixed createWindowAndRenderer

the createWindowAndRenderer-Function was wrong.

It was TAKING a Window (though it should yield one), giving the pointer off to C for overwriting, did not handle all errors and did not clean up the window it destroyed in the process.

I had to import the ```sdlDestroyWindow_finalizer``` from the ```Video```-Package to register the Destructor on the newly acquired Pointer and i wanted to prevent Code-Doubling. This is not a nice solution as it exports the internal C-Function to everybody.

Also the error-Code was ignored and the pointer was only checked against ```NULL```.

I could not use ```handleErrorI```, because that fails on ```return == 0``` and i need to fail on ```return == -1``` as ```0``` indicates a "correct" call. This could be abstracted as well.

--

For my tests this function now works as expected.