From ecf0289776569cf9cf00accbc7cbcfe3ffa9a724 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Fri, 4 Apr 2014 12:27:47 +0200 Subject: Add sdl_renderer:get_draw_color/1 --- src/esdl2.erl | 4 ++++ src/sdl_renderer.erl | 8 ++++++++ 2 files changed, 12 insertions(+) (limited to 'src') diff --git a/src/esdl2.erl b/src/esdl2.erl index add7453..a64ee4c 100644 --- a/src/esdl2.erl +++ b/src/esdl2.erl @@ -56,6 +56,7 @@ -export([create_renderer/3]). -export([get_num_render_drivers/0]). -export([get_render_draw_blend_mode/1]). +-export([get_render_draw_color/1]). -export([render_clear/1]). -export([render_copy/4]). -export([render_present/1]). @@ -215,6 +216,9 @@ get_num_render_drivers() -> get_render_draw_blend_mode(_) -> erlang:nif_error({not_loaded, ?MODULE}). +get_render_draw_color(_) -> + erlang:nif_error({not_loaded, ?MODULE}). + render_clear(_) -> erlang:nif_error({not_loaded, ?MODULE}). diff --git a/src/sdl_renderer.erl b/src/sdl_renderer.erl index 18c368c..01bc314 100644 --- a/src/sdl_renderer.erl +++ b/src/sdl_renderer.erl @@ -17,6 +17,7 @@ -export([create/3]). -export([count_drivers/0]). -export([get_draw_blend_mode/1]). +-export([get_draw_color/1]). -export([clear/1]). -export([copy/2]). -export([copy/4]). @@ -39,6 +40,13 @@ get_draw_blend_mode(Renderer) -> Mode end. +get_draw_color(Renderer) -> + esdl2:get_render_draw_color(Renderer), + receive {'_nif_thread_ret_', Ret} -> + {ok, Mode} = Ret, + Mode + end. + clear(Renderer) -> esdl2:render_clear(Renderer), receive {'_nif_thread_ret_', Ret} -> Ret end. -- cgit v1.2.3