/+junk/c_sdl_joypad_ducktape

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

« back to all changes in this revision

Viewing changes to GameObject.h

  • Committer: Gustav Hartvigsson
  • Date: 2013-09-29 21:11:58 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20130929211158-9z71h0uymetjelsz
fixed the callback stuff..

Show diffs side-by-side

added added

removed removed

Lines of Context:
2
2
#ifndef __H_GAME_OBJECT__
3
3
#define __H_GAME_OBJECT__
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> 2014
10
 
 */
11
 
 
12
5
#include <SDL2/SDL.h>
13
6
#include <stdbool.h>
14
7
 
15
 
typedef struct GameObject GameObject;
 
8
typedef struct _GameObject GameObject;
 
9
 
 
10
typedef struct _GameObjectClass GameObjectClass;
 
11
 
 
12
typedef struct _GameObjectPriv GameObjectPriv;
 
13
 
16
14
 
17
15
/******************************************************************************
18
16
 * Function pointer declarations.
30
28
                                      GameObjectCallbackFunc callback_func,
31
29
                                      void * data);
32
30
 
 
31
typedef void (* GameObjectDoCallbackFunc)(GameObject * self, char * name);
 
32
 
33
33
typedef void (* GameObjectMoveFunc)(GameObject * self);
34
34
 
35
35
typedef void (* GameObjectSetMovementDeltaFunc)(GameObject * self, int delta_x,\
46
46
 * Object declaration.
47
47
 *****************************************************************************/
48
48
 
49
 
typedef struct GameObjectClass {
 
49
struct _GameObjectClass {
50
50
  GameObjectFreeFunc                     free_func;
51
51
  GameObjectDrawFunc                     draw_func;
52
52
  GameObjectCallbackHandlerFunc          callback_handler_func;
56
56
  GameObjectGetBoundingBoxFunc           get_bounding_box_func;
57
57
  GameObjectGetIsAliveFunc               get_is_alive_func;
58
58
  GameObjectGetIsCollideFunc             get_is_collide_func;
59
 
} GameObjectClass;
60
 
 
61
 
 
62
 
typedef struct GameObject {
 
59
};
 
60
 
 
61
struct _GameObjectPriv {}; /**< prototype for the private data */
 
62
 
 
63
struct _GameObject {
63
64
  GameObjectClass *      klass; /**< the class that holds all the virtual
64
65
                                  * functions. */
65
 
  void *       priv; /**< The private data. */
66
 
} GameObject;
67
 
 
68
 
 
 
66
  GameObjectPriv *       priv; /**< The private data. */
 
67
};
69
68
 
70
69
/******************************************************************************
71
70
 * Game Object base functions.