/+junk/c_sdl_joypad

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/%2Bjunk/c_sdl_joypad

« back to all changes in this revision

Viewing changes to MousePointer.h

  • Committer: Gustav Hartvigsson
  • Date: 2013-09-27 18:52:09 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20130927185209-x6tnykj2lfj0qxwt
Initial code.
This is just an experiment on different techniques that can be used.
It is pseudo object orientated. And has a few util functions to make life
easier.

All code is provided as is. Copy, Learn, Refactor, Have Fun!

TODO: make the MousePointer use an image and add an object drawing lists.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#ifndef __H_MOUSE_POINTER__
 
2
#define __H_MOUSE_POINTER__
 
3
 
 
4
#include <SDL2/SDL.h>
 
5
#include <stdbool.h>
 
6
 
 
7
typedef struct _MousePointer MousePointer;
 
8
 
 
9
struct _MousePointer {
 
10
  SDL_Point possision; /* True posision */
 
11
  bool pressed;
 
12
  SDL_Color box_colour;
 
13
  SDL_Rect * draw_rect;
 
14
  SDL_Rect * bounding_box;
 
15
  SDL_Texture * image;
 
16
};
 
17
 
 
18
MousePointer * mouse_pointer_new (int  b_box_h, int b_box_w);
 
19
void mouse_pointer_move (MousePointer * self, int delta_x, int delta_y);
 
20
void mouse_pointer_move_to (MousePointer * self, int x, int y);
 
21
void mouse_pointer_draw (MousePointer * self, SDL_Renderer * renderer);
 
22
void mouse_pointer_free (MousePointer * self);
 
23
void mouse_pointer_force_pos (MousePointer * self);
 
24
 
 
25
#endif