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
|
/* 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__
/**
* This file, as the rest of the project is under MIT license.
* see http://opensource.org/licenses/MIT
*
* Author Gustav Hartvigsson <gustav.hartvigsson _at_ gmail.com> 2014
*/
#include <SDL2/SDL.h>
#include <stdbool.h>
typedef struct _MousePointer MousePointer;
struct _MousePointer {
SDL_Point possision; /* True posision */
bool pressed;
SDL_Color box_colour;
SDL_Rect * draw_rect;
SDL_Rect * bounding_box;
SDL_Texture * image;
};
MousePointer * mouse_pointer_new (int b_box_h, int b_box_w);
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
|