ohai / ruby-sdl2

A Ruby wrapper for SDL 2.x

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

SDL_GetError?

hukaidong opened this issue · comments

Is there any reason we are not including this function in this binding? I'm trying to build a SDL project, but seems window.destroy not working well. How should we destroy a window without terminate the program?

commented

That is because the SDL2 document says that "The message is only applicable when an SDL function has signaled an error". Ruby/SDL2 users do not need to call SDL_GetError directly. Instead, Ruby/SDL2 detects all errors from a return value of an SDL function and raises an exception.

In fact, Window.destroy did not work because Ruby/SDL2 forgot calling SDL_DestroyWindow. The problem was fixed in 7f1404e. The new version 0.3.5 is released now to fix some problems including this one.

nice to hear that