/+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 GameButton.h

  • Committer: Gustav Hartvigsson
  • Date: 2014-01-05 18:46:44 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20140105184644-7avawfjmlf0njm6c
* Added licensing information to the files.
* Started work on the JSParser
* Started work on a dynamic array (Untested).

TODO:
* Figure out how to actualy do the JS Parser.
* Firure out how to make the JS Parser interact with the game mainloop, or
  if I should just ditch the mainloop in the C code all together and just
  use JS to do the game stuffs.
    * The first alternative seems the hardest to implement, but would mean
      that it woud be less for the user of the pragram to do.
    * The second would mean less C code and perhaps less speed too.
      
      If I do the things in C I could, hypothetically, do threading later or
      pseudo threading with great effect/speed. Not that that is actually
      any problem on modern system, but non-blocking interaction is good from
      a usability perspective.

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#ifndef __H_GAME_BUTTON__
3
3
#define __H_GAME_BUTTON__
4
4
 
 
5
/**
 
6
 * This file, as the rest of the project is under MIT license.
 
7
 * see http://opensource.org/licenses/MIT
 
8
 *
 
9
 * Author Gustav Hartvigsson <gustav.hartvigsson _at_ gmail.com> 2013
 
10
 */
 
11
 
5
12
#include <SDL2/SDL.h>
6
13
#include <stdbool.h>
7
14
 
8
15
#include "MousePointer.h"
9
16
 
10
17
typedef struct _GameButton GameButton;
 
18
//typedef struct _GameButtonClass GameButtonClass; //TODO
11
19
 
12
20
typedef void (* BtnCallback)(GameButton * self, void * data);
13
21
 
17
25
  bool is_clicked;
18
26
  bool is_hover;
19
27
  bool is_stop_hover;
 
28
  
20
29
  SDL_Color colour;
 
30
  
21
31
  BtnCallback clicked;
22
32
  void * clicked_data;
 
33
  
23
34
  BtnCallback hover;
24
35
  void * hover_data;
 
36
  
25
37
  BtnCallback stop_hover;
26
38
  void * stop_hover_data;
27
39
};