Browse Source

Nicer documentation

Thomas Buck 11 years ago
parent
commit
a201d29b7a
4 changed files with 49 additions and 132 deletions
  1. 1
    1
      Doxyfile
  2. 9
    3
      include/Light.h
  3. 3
    47
      include/OpenGLMesh.h
  4. 36
    81
      include/System.h

+ 1
- 1
Doxyfile View File

@@ -768,7 +768,7 @@ RECURSIVE              = YES
768 768
 # Note that relative paths are relative to the directory from which doxygen is
769 769
 # run.
770 770
 
771
-EXCLUDE                = bin data mac_dist
771
+EXCLUDE                = bin data mac_dist test/greatest.h
772 772
 
773 773
 # The EXCLUDE_SYMLINKS tag can be used to select whether or not files or
774 774
 # directories that are symbolic links (a Unix file system feature) are excluded

+ 9
- 3
include/Light.h View File

@@ -9,12 +9,18 @@
9 9
 
10 10
 #include <MatMath.h>
11 11
 
12
+/*!
13
+ * \brief The GL light class
14
+ */
12 15
 class Light {
13 16
 public:
17
+    /*!
18
+     * \brief Type a light can be of
19
+     */
14 20
     typedef enum {
15
-        typePoint = 1,
16
-        typeSpot = 2,
17
-        typeDirectional = 3
21
+        typePoint       = 1, //!< Point light
22
+        typeSpot        = 2, //!< Spot light
23
+        typeDirectional = 3  //!< Directional light
18 24
     } LightType;
19 25
 
20 26
     // These aren't used anywhere? -- xythobuz

+ 3
- 47
include/OpenGLMesh.h View File

@@ -12,6 +12,9 @@
12 12
 
13 13
 #include <MatMath.h>
14 14
 
15
+/*!
16
+ * \brief OpenGL Mesh
17
+ */
15 18
 class OpenGLMesh {
16 19
 public:
17 20
 
@@ -78,10 +81,6 @@ public:
78 81
 
79 82
     } rect_t;
80 83
 
81
-    ////////////////////////////////////////////////////////////
82
-    // Constructors
83
-    ////////////////////////////////////////////////////////////
84
-
85 84
     /*!
86 85
      * \brief Constructs an object of OpenGLMesh
87 86
      */
@@ -92,83 +91,52 @@ public:
92 91
      */
93 92
     ~OpenGLMesh();
94 93
 
95
-
96
-    ////////////////////////////////////////////////////////////
97
-    // Public Accessors
98
-    ////////////////////////////////////////////////////////////
99
-
100
-
101 94
     void drawAlpha();
102 95
 
103
-
104 96
     void drawSolid();
105 97
 
106
-
107
-    ////////////////////////////////////////////////////////////
108
-    // Public Mutators
109
-    ////////////////////////////////////////////////////////////
110
-
111
-
112 98
     void allocateColors(unsigned int n);
113 99
 
114
-
115 100
     void allocateNormals(unsigned int n);
116 101
 
117
-
118 102
     void allocateRectangles(unsigned int n);
119 103
 
120
-
121 104
     void allocateTriangles(unsigned int n);
122 105
 
123
-
124 106
     void allocateVertices(unsigned int n);
125 107
 
126
-
127 108
     void bufferColorArray(unsigned int colorCount, vec_t *colors,
128 109
                                  unsigned int colorWidth);
129 110
 
130
-
131 111
     void bufferNormalArray(unsigned int normalCount, vec_t *normals);
132 112
 
133
-
134 113
     void bufferTriangles(unsigned int count,
135 114
                                 unsigned int *indices, vec_t *texCoords,
136 115
                                 int *textures, unsigned int *flags);
137 116
 
138 117
     void bufferVertexArray(unsigned int vertexCount, vec_t *vertices);
139 118
 
140
-
141 119
     void setColor(unsigned int index, float r, float g, float b, float a);
142 120
 
143
-
144 121
     void setColor(unsigned int index, float rgba[4]);
145 122
 
146
-
147 123
     void setNormal(unsigned int index, float i, float j, float k);
148 124
 
149
-
150 125
     void setVertex(unsigned int index, float x, float y, float z);
151 126
 
152 127
 #ifdef NOT_IMPLEMENTED
153
-
154
-
155 128
     void sortFacesByTexture();
156 129
 
157
-
158 130
     void addFace(int textureIndex, int textureIndexB, unsigned int flags,
159 131
                      unsigned int vertexIndexCount, vec_t *vertexIndices);
160 132
 
161
-
162 133
     void addTexTiledFace(int textureIndex, int textureIndexB,
163 134
                                 unsigned int flags, unsigned int indexCount,
164 135
                                 vec_t *vertexIndices, vec_t *texcoords);
165 136
 
166
-
167 137
     void bufferTexcoords(unsigned int texcoordCount, vec_t *texcoords);
168 138
 
169
-
170 139
     void duplicateArraysForTexTiledTexcoords();
171
-
172 140
 #endif
173 141
 
174 142
     unsigned int mFlags;
@@ -199,18 +167,6 @@ public:
199 167
     vec_t *mVertexArray;
200 168
     vec_t *mNormalArray;
201 169
     vec_t *mColorArray;
202
-
203
-private:
204
-
205
-    ////////////////////////////////////////////////////////////
206
-    // Private Accessors
207
-    ////////////////////////////////////////////////////////////
208
-
209
-
210
-    ////////////////////////////////////////////////////////////
211
-    // Private Mutators
212
-    ////////////////////////////////////////////////////////////
213
-
214 170
 };
215 171
 
216 172
 #endif

+ 36
- 81
include/System.h View File

@@ -53,14 +53,8 @@ typedef enum {
53 53
 /*!
54 54
  * \brief Basic Interface for System implementations (SDLSystem)
55 55
  */
56
-class System
57
-{
56
+class System {
58 57
 public:
59
-
60
-    ////////////////////////////////////////////////////////////
61
-    // Constructors
62
-    ////////////////////////////////////////////////////////////
63
-
64 58
     /*!
65 59
      * \brief Constructs an object of System
66 60
      */
@@ -71,11 +65,6 @@ public:
71 65
      */
72 66
     virtual ~System();
73 67
 
74
-
75
-    ////////////////////////////////////////////////////////////
76
-    // Public Accessors
77
-    ////////////////////////////////////////////////////////////
78
-
79 68
     /*!
80 69
      * \brief Generates a buufered string for the printf call
81 70
      * \param string Format string like for printf
@@ -113,8 +102,7 @@ public:
113 102
      * \param size size of  buffer
114 103
      * \returns < 0 on error, 0 on success
115 104
      */
116
-    static int downloadToBuffer(char *urlString,
117
-                                         unsigned char **buffer, unsigned int *size);
105
+    static int downloadToBuffer(char *urlString, unsigned char **buffer, unsigned int *size);
118 106
 
119 107
     /*!
120 108
      * \brief Downloads something into a disk file.
@@ -132,11 +120,6 @@ public:
132 120
      */
133 121
     static int createDir(char *path);
134 122
 
135
-
136
-    ////////////////////////////////////////////////////////////
137
-    // Public Mutators
138
-    ////////////////////////////////////////////////////////////
139
-
140 123
     /*!
141 124
      * \brief Created a new Command Mode.
142 125
      * \param command valid command mode for the resource file, eg "[Engine.OpenGL.Driver]"
@@ -158,10 +141,8 @@ public:
158 141
      */
159 142
     virtual void command(const char *cmd);
160 143
 
161
-
162 144
     virtual void gameFrame() = 0;
163 145
 
164
-
165 146
     virtual void handleMouseMotionEvent(float x, float y) = 0;
166 147
 
167 148
     /*!
@@ -188,21 +169,15 @@ public:
188 169
      * \param key is a valid keyboard code
189 170
      * \param mod modifier key
190 171
      */
191
-    virtual void handleConsoleKeyPressEvent(unsigned int key,
192
-                                                         unsigned int mod) = 0;
193
-
172
+    virtual void handleConsoleKeyPressEvent(unsigned int key, unsigned int mod) = 0;
194 173
 
195 174
     virtual void handleKeyPressEvent(unsigned int key, unsigned int mod) = 0;
196 175
 
197
-
198 176
     virtual void handleKeyReleaseEvent(unsigned int key, unsigned int mod) = 0;
199 177
 
200
-
201 178
     virtual void initGL();
202 179
 
203
-
204
-    virtual void initVideo(unsigned int width, unsigned int height,
205
-                                  bool fullscreen) = 0;
180
+    virtual void initVideo(unsigned int width, unsigned int height, bool fullscreen) = 0;
206 181
 
207 182
     /*!
208 183
      * \brief Init the resource vars
@@ -211,13 +186,10 @@ public:
211 186
      */
212 187
     virtual int loadResourceFile(const char *filename);
213 188
 
214
-
215 189
     static void resetTicks();
216 190
 
217
-
218 191
     virtual void resizeGL(unsigned int width, unsigned int height);
219 192
 
220
-
221 193
     virtual void runGame() = 0;
222 194
 
223 195
     /*!
@@ -227,73 +199,56 @@ public:
227 199
      */
228 200
     void setConsoleMode(bool on);
229 201
 
230
-
231 202
     void setDriverGL(const char *driver);
232 203
 
233
-
234 204
     void setFastCardPerformance(bool isFast);
235 205
 
236
-
237 206
     virtual void shutdown(int code) = 0;
238 207
 
239
-
240 208
     virtual void swapBuffersGL() = 0;
241 209
 
242
-
243 210
     virtual void toggleFullscreen() = 0;
244 211
 
245 212
 protected:
246
-
247
-    unsigned int m_width; //!< Width of the viewport
248
-    unsigned int m_height; //!< Height of the viewport
249
-    bool m_fastCard; //!< Assume expensive calls are fine if true
250
-    char *m_driver; //!< String for dynamic use of GL library
251
-    float m_clipNear; //!< Clip near distance
252
-    float m_clipFar; //!< Clip far distance
253
-    float m_fovY; //!< Field of vision
213
+    unsigned int m_width;              //!< Width of the viewport
214
+    unsigned int m_height;             //!< Height of the viewport
215
+    bool m_fastCard;                   //!< Assume expensive calls are fine if true
216
+    char *m_driver;                    //!< String for dynamic use of GL library
217
+    float m_clipNear;                  //!< Clip near distance
218
+    float m_clipFar;                   //!< Clip far distance
219
+    float m_fovY;                      //!< Field of vision
254 220
     Map<unsigned int, int> mKeyEvents; //!< Single key press event mappings
255
-    bool mConsoleMode; //!< Using text (console) event handler?
256
-    Vector<const char *> mCmdModes; //!< Dynamic resource command collection
257
-    unsigned int mCommandMode; //!< Current resource command mode
258
-    unsigned int mConsoleKey; //!< Console toggle event now handled lower
259
-
260
-private:
261
-
262
-    ////////////////////////////////////////////////////////////
263
-    // Private Accessors
264
-    ////////////////////////////////////////////////////////////
265
-
266
-
267
-    ////////////////////////////////////////////////////////////
268
-    // Private Mutators
269
-    ////////////////////////////////////////////////////////////
221
+    bool mConsoleMode;                 //!< Using text (console) event handler?
222
+    Vector<const char *> mCmdModes;    //!< Dynamic resource command collection
223
+    unsigned int mCommandMode;         //!< Current resource command mode
224
+    unsigned int mConsoleKey;          //!< Console toggle event now handled lower
270 225
 };
271 226
 
272 227
 
273 228
 //! \todo Could make these static methods later, depends on API evolution
274 229
 
275
-    /*!
276
-     * \brief Checks if Command matches Symbol.
277
-     * Returns the rest of the argument list back in command buffer, if any
278
-     * \param symbol command string
279
-     * \param command with arguments
280
-     * \returns true if command matches symbol
281
-     */
282
-    bool rc_command(const char *symbol, char *command);
230
+/*!
231
+ * \brief Checks if Command matches Symbol.
232
+ * Returns the rest of the argument list back in command buffer, if any
233
+ * \param symbol command string
234
+ * \param command with arguments
235
+ * \returns true if command matches symbol
236
+ */
237
+bool rc_command(const char *symbol, char *command);
283 238
 
284
-    /*!
285
-     * \brief Interpret a string as a bool
286
-     * \param buffer "true" or "false"
287
-     * \param val is set to boolean interpretation of buffer
288
-     * \returns -1 for null string, -2 if string is not "true" or "false"
289
-     */
290
-    int rc_get_bool(char *buffer, bool *val);
239
+/*!
240
+ * \brief Interpret a string as a bool
241
+ * \param buffer "true" or "false"
242
+ * \param val is set to boolean interpretation of buffer
243
+ * \returns -1 for null string, -2 if string is not "true" or "false"
244
+ */
245
+int rc_get_bool(char *buffer, bool *val);
291 246
 
292
-    /*!
293
-     * \brief Sets timer state and returns number of ticks
294
-     * \param state 0 - reset, 1 - get number of ticks
295
-     * \returns number of ticks
296
-     */
297
-    unsigned int system_timer(int state);
247
+/*!
248
+ * \brief Sets timer state and returns number of ticks
249
+ * \param state 0 - reset, 1 - get number of ticks
250
+ * \returns number of ticks
251
+ */
252
+unsigned int system_timer(int state);
298 253
 
299 254
 #endif

Loading…
Cancel
Save