/+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: 2014-01-11 23:32:10 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20140111233210-2lnw8934cjd5p848
* reorganising code to be remove extra typedefs.

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#include <SDL2/SDL.h>
13
13
#include <stdbool.h>
14
14
 
15
 
typedef struct _GameObject GameObject;
16
 
 
17
 
typedef struct _GameObjectClass GameObjectClass;
18
 
 
19
 
typedef struct _GameObjectPriv GameObjectPriv;
20
 
 
 
15
/******************************************************************************
 
16
 * Object declaration.
 
17
 *****************************************************************************/
 
18
 
 
19
typedef struct GameObjectClass {
 
20
  GameObjectFreeFunc                     free_func;
 
21
  GameObjectDrawFunc                     draw_func;
 
22
  GameObjectCallbackHandlerFunc          callback_handler_func;
 
23
  GameObjectSetCallbackFunc              set_callback_func;
 
24
  GameObjectMoveFunc                     move_func;
 
25
  GameObjectSetMovementDeltaFunc         set_movement_delta_func;
 
26
  GameObjectGetBoundingBoxFunc           get_bounding_box_func;
 
27
  GameObjectGetIsAliveFunc               get_is_alive_func;
 
28
  GameObjectGetIsCollideFunc             get_is_collide_func;
 
29
} GameObjectClass;
 
30
 
 
31
 
 
32
typedef struct GameObject {
 
33
  GameObjectClass *      klass; /**< the class that holds all the virtual
 
34
                                  * functions. */
 
35
  void *       priv; /**< The private data. */
 
36
} GameObject;
21
37
 
22
38
/******************************************************************************
23
39
 * Function pointer declarations.
47
63
typedef bool (* GameObjectGetIsCollideFunc)(GameObject * self,
48
64
                                            GameObject * other);
49
65
 
50
 
/******************************************************************************
51
 
 * Object declaration.
52
 
 *****************************************************************************/
53
 
 
54
 
struct _GameObjectClass {
55
 
  GameObjectFreeFunc                     free_func;
56
 
  GameObjectDrawFunc                     draw_func;
57
 
  GameObjectCallbackHandlerFunc          callback_handler_func;
58
 
  GameObjectSetCallbackFunc              set_callback_func;
59
 
  GameObjectMoveFunc                     move_func;
60
 
  GameObjectSetMovementDeltaFunc         set_movement_delta_func;
61
 
  GameObjectGetBoundingBoxFunc           get_bounding_box_func;
62
 
  GameObjectGetIsAliveFunc               get_is_alive_func;
63
 
  GameObjectGetIsCollideFunc             get_is_collide_func;
64
 
};
65
 
 
66
 
struct _GameObjectPriv {}; /**< prototype for the private data */
67
 
 
68
 
struct _GameObject {
69
 
  GameObjectClass *      klass; /**< the class that holds all the virtual
70
 
                                  * functions. */
71
 
  GameObjectPriv *       priv; /**< The private data. */
72
 
};
73
66
 
74
67
/******************************************************************************
75
68
 * Game Object base functions.