From 77d0e9d9ca8ed451a40f9b54f20365727ad76f5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Wed, 2 Apr 2014 14:09:18 +0200 Subject: Add a bullet engine example 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. --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d47278b..ed7c196 100644 --- a/Makefile +++ b/Makefile @@ -17,5 +17,5 @@ all: mkdir -p ebin/ erlc -o ebin/ src/*.erl cd c_src && make - erlc -o examples/hello_sdl examples/hello_sdl/*.erl - cd examples/hello_sdl && ./start.sh + erlc -o examples/bullet_engine examples/bullet_engine/*.erl + cd examples/bullet_engine && ./start.sh -- cgit v1.2.3