Przeglądaj źródła

Nicer documentation

Thomas Buck 11 lat temu
rodzic
commit
a201d29b7a
4 zmienionych plików z 49 dodań i 132 usunięć
  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 Wyświetl plik

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

+ 9
- 3
include/Light.h Wyświetl plik

9
 
9
 
10
 #include <MatMath.h>
10
 #include <MatMath.h>
11
 
11
 
12
+/*!
13
+ * \brief The GL light class
14
+ */
12
 class Light {
15
 class Light {
13
 public:
16
 public:
17
+    /*!
18
+     * \brief Type a light can be of
19
+     */
14
     typedef enum {
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
     } LightType;
24
     } LightType;
19
 
25
 
20
     // These aren't used anywhere? -- xythobuz
26
     // These aren't used anywhere? -- xythobuz

+ 3
- 47
include/OpenGLMesh.h Wyświetl plik

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

+ 36
- 81
include/System.h Wyświetl plik

53
 /*!
53
 /*!
54
  * \brief Basic Interface for System implementations (SDLSystem)
54
  * \brief Basic Interface for System implementations (SDLSystem)
55
  */
55
  */
56
-class System
57
-{
56
+class System {
58
 public:
57
 public:
59
-
60
-    ////////////////////////////////////////////////////////////
61
-    // Constructors
62
-    ////////////////////////////////////////////////////////////
63
-
64
     /*!
58
     /*!
65
      * \brief Constructs an object of System
59
      * \brief Constructs an object of System
66
      */
60
      */
71
      */
65
      */
72
     virtual ~System();
66
     virtual ~System();
73
 
67
 
74
-
75
-    ////////////////////////////////////////////////////////////
76
-    // Public Accessors
77
-    ////////////////////////////////////////////////////////////
78
-
79
     /*!
68
     /*!
80
      * \brief Generates a buufered string for the printf call
69
      * \brief Generates a buufered string for the printf call
81
      * \param string Format string like for printf
70
      * \param string Format string like for printf
113
      * \param size size of  buffer
102
      * \param size size of  buffer
114
      * \returns < 0 on error, 0 on success
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
      * \brief Downloads something into a disk file.
108
      * \brief Downloads something into a disk file.
132
      */
120
      */
133
     static int createDir(char *path);
121
     static int createDir(char *path);
134
 
122
 
135
-
136
-    ////////////////////////////////////////////////////////////
137
-    // Public Mutators
138
-    ////////////////////////////////////////////////////////////
139
-
140
     /*!
123
     /*!
141
      * \brief Created a new Command Mode.
124
      * \brief Created a new Command Mode.
142
      * \param command valid command mode for the resource file, eg "[Engine.OpenGL.Driver]"
125
      * \param command valid command mode for the resource file, eg "[Engine.OpenGL.Driver]"
158
      */
141
      */
159
     virtual void command(const char *cmd);
142
     virtual void command(const char *cmd);
160
 
143
 
161
-
162
     virtual void gameFrame() = 0;
144
     virtual void gameFrame() = 0;
163
 
145
 
164
-
165
     virtual void handleMouseMotionEvent(float x, float y) = 0;
146
     virtual void handleMouseMotionEvent(float x, float y) = 0;
166
 
147
 
167
     /*!
148
     /*!
188
      * \param key is a valid keyboard code
169
      * \param key is a valid keyboard code
189
      * \param mod modifier key
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
     virtual void handleKeyPressEvent(unsigned int key, unsigned int mod) = 0;
174
     virtual void handleKeyPressEvent(unsigned int key, unsigned int mod) = 0;
196
 
175
 
197
-
198
     virtual void handleKeyReleaseEvent(unsigned int key, unsigned int mod) = 0;
176
     virtual void handleKeyReleaseEvent(unsigned int key, unsigned int mod) = 0;
199
 
177
 
200
-
201
     virtual void initGL();
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
      * \brief Init the resource vars
183
      * \brief Init the resource vars
211
      */
186
      */
212
     virtual int loadResourceFile(const char *filename);
187
     virtual int loadResourceFile(const char *filename);
213
 
188
 
214
-
215
     static void resetTicks();
189
     static void resetTicks();
216
 
190
 
217
-
218
     virtual void resizeGL(unsigned int width, unsigned int height);
191
     virtual void resizeGL(unsigned int width, unsigned int height);
219
 
192
 
220
-
221
     virtual void runGame() = 0;
193
     virtual void runGame() = 0;
222
 
194
 
223
     /*!
195
     /*!
227
      */
199
      */
228
     void setConsoleMode(bool on);
200
     void setConsoleMode(bool on);
229
 
201
 
230
-
231
     void setDriverGL(const char *driver);
202
     void setDriverGL(const char *driver);
232
 
203
 
233
-
234
     void setFastCardPerformance(bool isFast);
204
     void setFastCardPerformance(bool isFast);
235
 
205
 
236
-
237
     virtual void shutdown(int code) = 0;
206
     virtual void shutdown(int code) = 0;
238
 
207
 
239
-
240
     virtual void swapBuffersGL() = 0;
208
     virtual void swapBuffersGL() = 0;
241
 
209
 
242
-
243
     virtual void toggleFullscreen() = 0;
210
     virtual void toggleFullscreen() = 0;
244
 
211
 
245
 protected:
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
     Map<unsigned int, int> mKeyEvents; //!< Single key press event mappings
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
 //! \todo Could make these static methods later, depends on API evolution
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
 #endif
254
 #endif

Ładowanie…
Anuluj
Zapisz