aboutsummaryrefslogtreecommitdiffstats
path: root/c_src/nif_helpers.c
AgeCommit message (Collapse)Author
2015-10-20We are in 2015Loïc Hoguin
2015-10-17Fix various warnings from recent GCCLoïc Hoguin
2015-10-17Fix conditionals for detecting OSXLoïc Hoguin
2015-10-16Steal the main thread on OSXLoïc Hoguin
Should fix issues with events not being handled properly, and possibly other things. Taken from Erlang's wx, which is proven to work. The function used is unfortunately undocumented. Not 100% sure everything is good with just that, it looks good enough on my VM, but I still have issues probably due to trying this on a VM.
2014-04-04Fix potential memory leaks and other small improvementsLoïc Hoguin
2014-04-02Add a bullet engine exampleLoïc Hoguin
A function sdl_renderer:set_logical_size/3 has been added. All the functions relative to the window, the renderer, textures and events now run in a separate thread inside the NIF. A few helper functions and macros have been added in order to abstract this out. The code reads like it is doing call or cast to the main thread. In the case of call, the result is then sent back to the calling process as a message (Erlang side catches it directly before returning). The functions relative to SDL init and surfaces have not been threaded yet. It may still be needed from the point of view of SDL or Erlang, but it seems to work fine as it is so they were left alone for now. The bullet example originally came from my submission to Spawnfest 2011, and has been reactualized to work with a modern Erlang, and SDL2.