/+junk/c_sdl_joypad_ducktape

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/c_sdl_joypad_ducktape
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil
 * vi: set shiftwidth=2 tabstop=2 expandtab:
 * :indentSize=2:tabSize=2:noTabs=true:
 */

#ifndef __H_MOUSE_POINTER__
#define __H_MOUSE_POINTER__

/** @file
 *
 * Author Gustav Hartvigsson <gustav.hartvigsson _at_ gmail.com> 2014
 */

#include <SDL2/SDL.h>
#include <stdbool.h>
/******************************************************************************/

/**
 * An object that represents a mounse pointer.
 *
 * 
 */
typedef struct MousePointer MousePointer;

struct MousePointer {
  SDL_Point possision; /* True posision */
  bool pressed;
  SDL_Color * box_color;
  SDL_Rect * draw_rect;
  SDL_Rect * bounding_box;
  SDL_Texture * image;
};

/**
 * create a new mouse pointer.
 * 
 * 
 * 
 * @param b_box_h the height of the bounding box of the pointer.
 * @param b_box_w the width of the bounding box of the pointer.
 * @param color the color of the bouningbox of the pointer, @c NULL allowed.
 */
MousePointer * mouse_pointer_new (int  b_box_h, int b_box_w, SDL_Color * color);

void mouse_pointer_move (MousePointer * self, int delta_x, int delta_y);

void mouse_pointer_move_to (MousePointer * self, int x, int y);

void mouse_pointer_draw (MousePointer * self, SDL_Renderer * renderer);

void mouse_pointer_free (MousePointer * self);

void mouse_pointer_force_pos (MousePointer * self);

#endif