summaryrefslogtreecommitdiff
path: root/sources/rl/shapes.h
blob: 47e736c8cf2ff56adc8de85b3c312d24a979ef0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include "raylib.h"
#include "s7/s7.h"
#include <stdio.h>
#include <stdlib.h>

static s7_pointer rl_draw_rectangle(s7_scheme *s7, s7_pointer args) {
  Color *c = (Color *)s7_c_object_value(s7_car(s7_cdr(s7_cdr(s7_cdr(s7_cdr(args))))));
  
  DrawRectangle(s7_real(s7_car(args)),
		s7_real(s7_car(s7_cdr(args))),
		s7_real(s7_car(s7_cdr(s7_cdr(args)))),
		s7_real(s7_car(s7_cdr(s7_cdr(s7_cdr(args))))),
		*c);

  return(NULL);
}

static s7_pointer rl_draw_line(s7_scheme *s7, s7_pointer args) {
  Color *c = (Color *)s7_c_object_value(s7_car(s7_cdr(s7_cdr(s7_cdr(s7_cdr(args))))));
  
  DrawLine(s7_real(s7_car(args)),
		s7_real(s7_car(s7_cdr(args))),
		s7_real(s7_car(s7_cdr(s7_cdr(args)))),
		s7_real(s7_car(s7_cdr(s7_cdr(s7_cdr(args))))),
		*c);

  return(NULL);
}


static void rl_shapes_define_methods(s7_scheme *s7) {
  s7_define_function(s7, "rl-draw-rectangle", rl_draw_rectangle, 5, 0, false, "test");
  s7_define_function(s7, "rl-draw-line", rl_draw_line, 5, 0, false, "test");
}