Browse Source

Documented Texture.h

Thomas Buck 11 years ago
parent
commit
2c3c3a8f5f
2 changed files with 198 additions and 455 deletions
  1. 193
    427
      include/Texture.h
  2. 5
    28
      src/Texture.cpp

+ 193
- 427
include/Texture.h View File

1
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
1
+/*!
2
-/*==========================================================================
2
+ * \file include/Texture.h
3
+ * \brief Texture registry
3
  *
4
  *
4
- * Project : MTK, Freyja, OpenRaider
5
+ * \author Mongoose
5
- * Author  : Terry 'Mongoose' Hendrix II
6
+ */
6
- * Website : http://www.westga.edu/~stu7440
7
- * Email   : stu7440@westga.edu
8
- * Object  : MtkTexture
9
- * Comments: This is the Texture registery
10
- *
11
- *           See file COPYING for license details.
12
- *
13
- *
14
- *-- History ----------------------------------------------------------
15
- *
16
- * 2003.06.30,
17
- * Mongoose - API update, SDL_TTF support moved here, misc features
18
- *            SDL_TTF support based on Sam Lantinga's public domain
19
- *            SDL_TTF demo functions and algorithms
20
- *
21
- * 2001.05.29:
22
- * Mongoose - Removed legacy code and done clean up
23
- *
24
- * 2001.02.19:
25
- * Mongoose - Moved from GooseEgg to mtk
26
- *
27
- * 2000.04.29:
28
- * Mongoose - Created from old PPM/PCX codebases I have done before
29
- ==========================================================================*/
30
-
31
 
7
 
32
 #ifndef _TEXTURE_H
8
 #ifndef _TEXTURE_H
33
 #define _TEXTURE_H
9
 #define _TEXTURE_H
34
 
10
 
35
 #include <stdio.h>
11
 #include <stdio.h>
36
 
12
 
37
-typedef struct
13
+typedef struct {
38
-{
14
+    int x;
39
-    int x, y, w, h;
15
+    int y;
40
-    int minx; int maxx; int miny; int maxy; int advance;
16
+    int w;
41
-
17
+    int h;
18
+    int minx;
19
+    int maxx;
20
+    int miny;
21
+    int maxy;
22
+    int advance;
42
 } ttf_glyph_t;
23
 } ttf_glyph_t;
43
 
24
 
44
-typedef struct
25
+typedef struct {
45
-{
46
     unsigned int utf8Offset;
26
     unsigned int utf8Offset;
47
     unsigned int count;
27
     unsigned int count;
48
 
28
 
53
     0x303f -> 0x3093  Japanese hiragana kana,
33
     0x303f -> 0x3093  Japanese hiragana kana,
54
     0x301a -> 0x30f6  Japanese katakana kana */
34
     0x301a -> 0x30f6  Japanese katakana kana */
55
 
35
 
56
-    unsigned int width;     /* Width and height of RGBA texture */
36
+    unsigned int width;      //!< Width and height of RGBA texture
57
-    unsigned char *texture; /* RGBA texture data */
37
+    unsigned char *texture;  //!< RGBA texture data
58
-
38
+    ttf_glyph_t *glyphs;     //!< For typesetting and rendering use
59
-    ttf_glyph_t *glyphs;    /* For typesetting and rendering use */
60
     int fontHeight;
39
     int fontHeight;
61
     int fontAscent;
40
     int fontAscent;
62
     int fontDescent;
41
     int fontDescent;
63
     int fontSpacing;
42
     int fontSpacing;
64
-
65
 } ttf_texture_t;
43
 } ttf_texture_t;
66
 
44
 
67
-
45
+typedef struct {
68
-typedef struct
69
-{
70
     unsigned int utf8Offset;
46
     unsigned int utf8Offset;
71
     unsigned int count;
47
     unsigned int count;
72
     int textureId;
48
     int textureId;
73
     int drawListBase;
49
     int drawListBase;
74
-
75
 } gl_font_t;
50
 } gl_font_t;
76
 
51
 
52
+/*!
53
+ * \brief Texture registry
54
+ */
55
+class Texture {
56
+public:
77
 
57
 
78
-
58
+    enum ColorMode {
79
-class Texture
80
-{
81
- public:
82
-
83
-    enum ColorMode
84
-    {
85
         GREYSCALE = 1,
59
         GREYSCALE = 1,
86
         RGB,
60
         RGB,
87
         RGBA,
61
         RGBA,
88
         ARGB
62
         ARGB
89
     };
63
     };
90
 
64
 
91
-    enum TextureFlag
65
+    enum TextureFlag {
92
-    {
66
+        fUseMipmaps      = (1 << 0),
93
-        fUseMipmaps         = (1 << 0),
67
+        fUseMultiTexture = (1 << 1),
94
-        fUseMultiTexture    = (1 << 1),
68
+        fUseSDL_TTF      = (1 << 2)
95
-        fUseSDL_TTF         = (1 << 2)
96
     };
69
     };
97
 
70
 
98
-
71
+    /*!
99
-    ////////////////////////////////////////////////////////////
72
+    * \brief Constructs an object of Texture
100
-    // Constructors
73
+    */
101
-    ////////////////////////////////////////////////////////////
74
+    Texture();
102
-
75
+
103
-   Texture();
76
+   /*!
104
-    /*------------------------------------------------------
77
+    * \brief Deconstructs an object of Texture
105
-     * Pre  :
78
+    */
106
-     * Post : Constructs an object of Texture
79
+    ~Texture();
107
-     *
80
+
108
-     *-- History ------------------------------------------
81
+    /*!
109
-     *
82
+     * \brief Generates a texture buffer with (width * height * 4) bytes.
110
-     * 2001.05.29:
83
+     * \param rgba 32bpp RGBA color to fill into buffer
111
-     * Mongoose - Big code clean up, documentation
84
+     * \param width width of newly allocated buffer, power of 2, pref same as height
112
-     *
85
+     * \param height height of newly allocated buffer, power of 2, pref same as width
113
-     * 2000.10.05:
86
+     * \returns newly allocated texture buffer filled with specified color
114
-     * Mongoose - Created
87
+     */
115
-     ------------------------------------------------------*/
116
-
117
-   ~Texture();
118
-    /*------------------------------------------------------
119
-     * Pre  : This object exists
120
-     * Post : Deconstructs an object of Texture
121
-     *
122
-     *-- History ------------------------------------------
123
-     *
124
-     * 2001.05.29:
125
-     * Mongoose - Big code clean up, documentation
126
-     *
127
-     * 2000.10.05:
128
-     * Mongoose - Created
129
-     ------------------------------------------------------*/
130
-
131
-
132
-    ////////////////////////////////////////////////////////////
133
-    // Public Accessors
134
-    ////////////////////////////////////////////////////////////
135
-
136
     static unsigned char *generateColorTexture(unsigned char rgba[4],
88
     static unsigned char *generateColorTexture(unsigned char rgba[4],
137
-                                                             unsigned int width,
89
+                                                unsigned int width,
138
-                                                             unsigned int height);
90
+                                                unsigned int height);
139
-    /*------------------------------------------------------
140
-     * Pre  : <Rgba> is 32bpp RGBA color
141
-     *        <Width> and <Height> are powers of two, pref
142
-     *        the same number
143
-     * Post :
144
-     *
145
-     *-- History ------------------------------------------
146
-     *
147
-     * 2003.06.30:
148
-     * Mongoose - Created
149
-     ------------------------------------------------------*/
150
 
91
 
151
     gl_font_t *generateFont(ttf_texture_t *texture);
92
     gl_font_t *generateFont(ttf_texture_t *texture);
152
-    /*------------------------------------------------------
153
-     * Pre  :
154
-     * Post :
155
-     *
156
-     *-- History ------------------------------------------
157
-     *
158
-     * 2003.06.30:
159
-     * Mongoose - Created
160
-     ------------------------------------------------------*/
161
 
93
 
94
+    /*!
95
+     * \brief Generates a font texture with typeset info from TTF.
96
+     *
97
+     * Does not load the texture itself! Call loadFont() on returned ttf_texture_t
98
+     * \param filename filename of TTF font
99
+     * \param pointSize Point Size to generate
100
+     * \param textureWidth width of texture, height will match it
101
+     * \param color RGB 24bit color
102
+     * \param utf8Offset Offset into fonts encoding chart
103
+     * \param cound number of glyphs to read from offset start
104
+     * \param verboxe dumps debug info to stdout
105
+     * \returns font texture. Load it with loadFont()!
106
+     */
162
     ttf_texture_t *generateFontTexture(const char *filename, int pointSize,
107
     ttf_texture_t *generateFontTexture(const char *filename, int pointSize,
163
-                                                  unsigned int textureWidth,
108
+                                        unsigned int textureWidth,
164
-                                                  unsigned char color[3],
109
+                                        unsigned char color[3],
165
-                                                  unsigned int utf8Offset,
110
+                                        unsigned int utf8Offset,
166
-                                                  unsigned int count,
111
+                                        unsigned int count,
167
-                                                  char verbose);
112
+                                        char verbose);
168
-    /*------------------------------------------------------
113
+
169
-     * Pre  : <Filename> of TTF font
114
+    /*!
170
-     *        <PointSize> to generate
115
+     * \brief Get number of textures in use
171
-     *        <TextureWidth> is width of texture, height will match it
116
+     * \returns used texture count, or -1 on error (uninitialized)
172
-     *        <Color> is RGB 24bit color
117
+     */
173
-     *        <Utf8Offset> is offset into font's encoding chart
118
+    int getTextureCount();
174
-     *        <Count> is number of glyphs to read from offset start
119
+
175
-     *        <Verbose> dumps debug info to stdout
120
+    /*!
176
-     *
121
+     * \brief Dumps a screenshot to disk.
177
-     * Post : Generates a font texture with typeset info from TTF
122
+     *
178
-     *
123
+     * Avoids overwriting files with same base name.
179
-     *        DOES NOT load the texture itself, call loadFont()
124
+     * \param base base filename
180
-     *        on returned ttf_texture_t
125
+     * \param width viewport width
181
-     *
126
+     * \param height viewport height
182
-     *
127
+     */
183
-     *-- History ------------------------------------------
184
-     *
185
-     * 2003.06.03:
186
-     * Mongoose - Created
187
-     ------------------------------------------------------*/
188
-
189
-   int getTextureCount();
190
-    /*------------------------------------------------------
191
-     * Pre  :
192
-     * Post : Returns number of textures in use, or -1 for
193
-     *        error ( Not initalized )
194
-     *
195
-     *-- History ------------------------------------------
196
-     *
197
-     * 2001.05.29:
198
-     * Mongoose - Big code clean up, documentation
199
-     *
200
-     * 2000.10.05:
201
-     * Mongoose - Created
202
-     ------------------------------------------------------*/
203
-
204
     void glScreenShot(char *base, unsigned int width, unsigned int height);
128
     void glScreenShot(char *base, unsigned int width, unsigned int height);
205
-    /*------------------------------------------------------
206
-     * Pre  : <Base> is base filename,
207
-     *        <Width> and <Height> are viewport dim
208
-     *
209
-     * Post : Dumps a screenshot to disk,
210
-     *        avoids overwriting files with same base name
211
-     *
212
-     *-- History ------------------------------------------
213
-     *
214
-     * 2002.06.16:
215
-     * Mongoose - Created
216
-     ------------------------------------------------------*/
217
-
218
-
219
-    ////////////////////////////////////////////////////////////
220
-    // Public Mutators
221
-    ////////////////////////////////////////////////////////////
222
 
129
 
130
+    /*!
131
+     * \brief Sets up multitexture rendering with passed ids
132
+     * \param texture0 first texture for multitexture
133
+     * \param texture1 second texture for multitexture
134
+     */
223
     void bindMultiTexture(int texture0, int texture1);
135
     void bindMultiTexture(int texture0, int texture1);
224
-    /*------------------------------------------------------
225
-     * Pre  :
226
-     * Post : Sets up multitexture rendering with passed texture ids
227
-     *
228
-     *-- History ------------------------------------------
229
-     *
230
-     * 2002.12.24:
231
-     * Mongoose - Created
232
-     ------------------------------------------------------*/
233
-
234
-   void bindTextureId(unsigned int n);
235
-    /*------------------------------------------------------
236
-     * Pre  : n is valid texture index
237
-     * Post : Binds the texture for use in GL
238
-     *
239
-     *-- History ------------------------------------------
240
-     *
241
-     * 2001.05.29:
242
-     * Mongoose - Big code clean up, documentation
243
-     *
244
-     * 2000.10.05:
245
-     * Mongoose - Created
246
-     ------------------------------------------------------*/
247
 
136
 
137
+    /*!
138
+     * \brief Binds the texture for use in GL
139
+     * \param n valid texture index
140
+     */
141
+    void bindTextureId(unsigned int n);
142
+
143
+    /*!
144
+     * \brief Clears an option flag
145
+     * \param flag flag to clear
146
+     */
248
     void clearFlag(TextureFlag flag);
147
     void clearFlag(TextureFlag flag);
249
-    /*------------------------------------------------------
250
-     * Pre  :
251
-     * Post : CLears a option flag
252
-     *
253
-     *-- History ------------------------------------------
254
-     *
255
-     * 2003.01.05:
256
-     * Mongoose - Created
257
-     ------------------------------------------------------*/
258
 
148
 
259
     void disableMultiTexture();
149
     void disableMultiTexture();
260
-    /*------------------------------------------------------
261
-     * Pre  :
262
-     * Post :
263
-     *
264
-     *-- History ------------------------------------------
265
-     *
266
-     * 2002.12.24:
267
-     * Mongoose - Created
268
-     ------------------------------------------------------*/
269
 
150
 
151
+    /*!
152
+     * \brief Loads SDL_TTF
153
+     */
270
     void initSDL_TTF();
154
     void initSDL_TTF();
271
-    /*------------------------------------------------------
272
-     * Pre  :
273
-     * Post : Loads SDL_TTF if avalible
274
-     *
275
-     *-- History ------------------------------------------
276
-     *
277
-     * 2003.06.03:
278
-     * Mongoose - Created
279
-     ------------------------------------------------------*/
280
 
155
 
281
-   int loadBuffer(unsigned char *image,
156
+    /*!
157
+     * \brief Loads Buffer as texture
158
+     * \param image pixmap matching other params
159
+     * \param width width of image
160
+     * \param height height of image
161
+     * \param mode mode of image
162
+     * \param bpp bits per pixel of image
163
+     * \returns texture ID or < 0 on error
164
+     */
165
+    int loadBuffer(unsigned char *image,
166
+                    unsigned int width, unsigned int height,
167
+                    ColorMode mode, unsigned int bpp);
168
+
169
+    /*!
170
+     * \brief Loads Buffer as texture
171
+     * \param image pixmap matching other params
172
+     * \param width width of image
173
+     * \param height height of image
174
+     * \param mode mode of image
175
+     * \param bpp bits per pixel of image
176
+     * \param slot slot (ID) of image
177
+     * \returns texture ID or < 0 on error
178
+     */
179
+    int loadBufferSlot(unsigned char *image,
282
                         unsigned int width, unsigned int height,
180
                         unsigned int width, unsigned int height,
283
-                        ColorMode mode, unsigned int bpp);
181
+                        ColorMode mode, unsigned int bpp,
284
-    /*------------------------------------------------------
182
+                        unsigned int slot);
285
-     * Pre  : image must be a valid pixmap that agrees
183
+
286
-     *        with mode, width, and height
184
+    /*!
287
-     *
185
+     * \brief Generates and loads a solid color texture.
288
-     * Post : Returns texture id or < 0 error flag
186
+     * \param rgba color for new texture
289
-     *
187
+     * \param width width of new texture
290
-     *-- History ------------------------------------------
188
+     * \param height height of new texture
291
-     *
189
+     * \returns texture ID or -1 on error
292
-     * 2001.05.29:
190
+     */
293
-     * Mongoose - Big code clean up, documentation
294
-     *
295
-     * 2000.10.05:
296
-     * Mongoose - Created
297
-     ------------------------------------------------------*/
298
-
299
-   int loadBufferSlot(unsigned char *image,
300
-                             unsigned int width, unsigned int height,
301
-                             ColorMode mode, unsigned int bpp,
302
-                             unsigned int slot);
303
-    /*------------------------------------------------------
304
-     * Pre  : image must be a valid pixmap that agrees
305
-     *        with mode, width, and height, slot ( ID )
306
-     *
307
-     * Post : Returns texture id or < 0 error flag
308
-     *
309
-     *-- History ------------------------------------------
310
-     *
311
-     * 2002.09.05:
312
-     * Mongoose - Created
313
-     ------------------------------------------------------*/
314
-
315
     int loadColorTexture(unsigned char rgba[4],
191
     int loadColorTexture(unsigned char rgba[4],
316
-                                unsigned int width, unsigned int height);
192
+                            unsigned int width, unsigned int height);
317
-    /*------------------------------------------------------
193
+
318
-     * Pre  :
194
+    /*!
319
-     * Post : Generates and loads a solid color texture,
195
+     * \brief Loads a TTF, generates texture image, glyph list and drawlist
320
-     *        returns texture Id or -1 if failed
196
+     * \param filename Filename of TTF font
321
-     *
197
+     * \param utf8Offset Offset into Unicode table
322
-     *-- History ------------------------------------------
198
+     * \param cound number of glyphs to load
323
-     *
199
+     * \returns font id if successful, or < 0 on error
324
-     * 2003.06.30:
200
+     */
325
-     * Mongoose - Created
326
-     ------------------------------------------------------*/
327
-
328
     int loadFontTTF(const char *filename,
201
     int loadFontTTF(const char *filename,
329
-                         unsigned int utf8Offset, unsigned int count);
202
+                        unsigned int utf8Offset, unsigned int count);
330
-    /*------------------------------------------------------
331
-     * Pre  : <Filename> of TTF font
332
-     *        <Utf8Offset> is offset into UNICODE table
333
-     *        <Count> is number of glyphs to load
334
-     *
335
-     * Post : Loads a TTF,
336
-     *        Generates: texture image, glyph list, and drawlist
337
-     *
338
-     *        Returns font id if sucessful, or < 0 if error
339
-     *
340
-     *-- History ------------------------------------------
341
-     *
342
-     * 2003.07.05:
343
-     * Mongoose - Created
344
-     ------------------------------------------------------*/
345
-
346
-    int loadPNG(const char *filename);
347
-    /*------------------------------------------------------
348
-     * Pre  : Texture is init and filename/file is valid
349
-     * Post : Loads PNG as texture and returns ID or -1 error
350
-     *
351
-     *-- History ------------------------------------------
352
-     *
353
-     * 2002.06.16:
354
-     * Mongoose - Created, from Freyja
355
-     ------------------------------------------------------*/
356
 
203
 
204
+    /*!
205
+     * \brief Loads TGA file as texture
206
+     * \param filename Existing TGA file
207
+     * \returns ID of new texture or -1 on error
208
+     */
357
     int loadTGA(const char *filename);
209
     int loadTGA(const char *filename);
358
-    /*------------------------------------------------------
359
-     * Pre  : Texture is init and filename/file is valid
360
-     * Post : Loads TGA as texture and returns ID or -1 error
361
-     *
362
-     *-- History ------------------------------------------
363
-     *
364
-     * 2002.06.16:
365
-     * Mongoose - Created
366
-     ------------------------------------------------------*/
367
-
368
-   void reset();
369
-    /*------------------------------------------------------
370
-     * Pre  :
371
-     * Post : Resets all texture data
372
-     *
373
-     *-- History ------------------------------------------
374
-     *
375
-     * 2001.05.29:
376
-     * Mongoose - Big code clean up, documentation
377
-     *
378
-     * 2000.10.05:
379
-     * Mongoose - Created
380
-     ------------------------------------------------------*/
381
 
210
 
211
+    /*!
212
+     * \brief Resets all texture data
213
+     */
214
+    void reset();
215
+
216
+    /*!
217
+     * \brief Sets an option flag
218
+     * \param flag flag to set
219
+     */
382
     void setFlag(TextureFlag flag);
220
     void setFlag(TextureFlag flag);
383
-    /*------------------------------------------------------
384
-     * Pre  :
385
-     * Post : Sets a option flag
386
-     *
387
-     *-- History ------------------------------------------
388
-     *
389
-     * 2003.01.05:
390
-     * Mongoose - Created
391
-     ------------------------------------------------------*/
392
 
221
 
393
-    void setMaxTextureCount(unsigned int n);
222
+    /*!
394
-    /*------------------------------------------------------
223
+     * \brief Sets up GL texturing.
395
-     * Pre  : n is max number of textures you wish to allow
396
-     * Post : Sets up GL texturing, and must be called
397
-     *        as the first setup step
398
-     *
399
-     *-- History ------------------------------------------
400
-     *
401
-     * 2001.05.29:
402
-     * Mongoose - Big code clean up, documentation
403
      *
224
      *
404
-     * 2000.10.05:
225
+     * Must be called as first setup step!
405
-     * Mongoose - Created
226
+     * \param n maximum number of textures you wish to allow
406
-     ------------------------------------------------------*/
227
+     */
228
+    void setMaxTextureCount(unsigned int n);
407
 
229
 
408
     void useMultiTexture(float u, float v);
230
     void useMultiTexture(float u, float v);
409
-    /*------------------------------------------------------
410
-     * Pre  :
411
-     * Post :
412
-     *
413
-     *-- History ------------------------------------------
414
-     *
415
-     * 2002.12.24:
416
-     * Mongoose - Created
417
-     ------------------------------------------------------*/
418
 
231
 
419
     void useMultiTexture(float aU, float aV, float bU, float bV);
232
     void useMultiTexture(float aU, float aV, float bU, float bV);
420
-    /*------------------------------------------------------
421
-     * Pre  :
422
-     * Post :
423
-     *
424
-     *-- History ------------------------------------------
425
-     *
426
-     * 2002.12.24:
427
-     * Mongoose - Created
428
-     ------------------------------------------------------*/
429
-
430
-
431
- private:
432
 
233
 
433
-    ////////////////////////////////////////////////////////////
234
+private:
434
-    // Private Accessors
435
-    ////////////////////////////////////////////////////////////
436
 
235
 
437
     int nextPower(int seed);
236
     int nextPower(int seed);
438
-    /*------------------------------------------------------
439
-     * Pre  :
440
-     * Post :
441
-     *
442
-     *-- History ------------------------------------------
443
-     *
444
-     * 2002.06.16:
445
-     * Mongoose - Created
446
-     ------------------------------------------------------*/
447
 
237
 
448
     unsigned char *scaleBuffer(unsigned char *image, int width, int height,
238
     unsigned char *scaleBuffer(unsigned char *image, int width, int height,
449
-                                        int components);
239
+                                int components);
450
-    /*------------------------------------------------------
240
+
451
-     * Pre  :
241
+    unsigned int *mTextureIds;  //!< GL texture list
452
-     * Post :
242
+    unsigned int mTextureCount; //!< Texture counter
453
-     *
243
+    unsigned int mTextureLimit; //!< The texture limit
454
-     *-- History ------------------------------------------
244
+    unsigned int mFlags;        //!< Class options
455
-     *
245
+    int mTextureId;             //!< Currently bound texture id
456
-     * 2002.06.16:
246
+    int mTextureId2;            //!< Multitexture Texture Id
457
-     * Mongoose - Created
458
-     ------------------------------------------------------*/
459
-
460
-
461
-    ////////////////////////////////////////////////////////////
462
-    // Private Mutators
463
-    ////////////////////////////////////////////////////////////
464
-
465
-   unsigned int *mTextureIds;       /* GL texture list */
466
-
467
-   unsigned int mTextureCount;  /* Texture counter */
468
-
469
-   unsigned int mTextureLimit;  /* The texture limit */
470
-
471
-    unsigned int mFlags;                /* Class options */
472
-
473
-   int mTextureId;                  /* Currently bound texture id */
474
-
475
-    int mTextureId2;                    /* Multitexture Texture Id */
476
 };
247
 };
477
 
248
 
478
 
249
 
479
-/* Experimental testing */
250
+// Experimental testing
251
+
480
 void bufferedPrintf(char *string, unsigned int len, char *s, ...);
252
 void bufferedPrintf(char *string, unsigned int len, char *s, ...);
481
 
253
 
482
 void glPrint3d(float x, float y, float z,
254
 void glPrint3d(float x, float y, float z,
483
-                    float pitch, float yaw, float roll,
255
+                float pitch, float yaw, float roll,
484
-                    float scale,
256
+                float scale, char *string);
485
-                    char *string);
486
 
257
 
487
 void glPrint2d(float x, float y, float scale, char *string);
258
 void glPrint2d(float x, float y, float scale, char *string);
488
 
259
 
489
-    void glEnterMode2d(unsigned int width, unsigned int height);
260
+/*!
490
-    /*------------------------------------------------------
261
+ * \brief OpenGL ortho projection.
491
-     * Pre  :
262
+ *
492
-     * Post : OpenGL ortho projection
263
+ * Call before using glPrint2d()
493
-     *
264
+ * \param width window width
494
-     *-- History ------------------------------------------
265
+ * \param height window height
495
-     *
266
+ */
496
-     * 2003.06.03:
267
+void glEnterMode2d(unsigned int width, unsigned int height);
497
-     * Mongoose - Created
268
+
498
-     ------------------------------------------------------*/
269
+/*!
499
-
270
+ * \brief OpenGL model matrix projection.
500
-    void glExitMode2d();
271
+ *
501
-    /*------------------------------------------------------
272
+ * Call after using glPrint2d()
502
-     * Pre  :
273
+ */
503
-     * Post : OpenGL model matrix projection
274
+void glExitMode2d();
504
-     *
275
+
505
-     *-- History ------------------------------------------
506
-     *
507
-     * 2003.06.03:
508
-     * Mongoose - Created
509
-     ------------------------------------------------------*/
510
 #endif
276
 #endif

+ 5
- 28
src/Texture.cpp View File

1
-/* -*- Mode: C++; tab-width: 3; indent-tabs-mode: t; c-basic-offset: 3 -*- */
1
+/*!
2
-/*==========================================================================
2
+ * \file src/Texture.cpp
3
+ * \brief Texture registry
3
  *
4
  *
4
- * Project : Freyja, OpenRaider
5
+ * \author Mongoose
5
- * Author  : Terry 'Mongoose' Hendrix II
6
+ */
6
- * Website : http://www.westga.edu/~stu7440
7
- * Email   : stu7440@westga.edu
8
- * Object  : Texture
9
- * Comments: This is the Texture class.
10
- *
11
- *           See file COPYING for license details.
12
- *
13
- *
14
- *-- History ----------------------------------------------------------
15
- *
16
- * 2003.06.30,
17
- * Mongoose - API update, SDL_TTF support moved here, misc features
18
- *            SDL_TTF support based on Sam Lantinga's public domain
19
- *            SDL_TTF demo functions and algorithms
20
- *
21
- * 2001.05.29:
22
- * Mongoose - Removed legacy code and done clean up
23
- *
24
- * 2001.02.19:
25
- * Mongoose - Moved from GooseEgg to mtk
26
- *
27
- * 2000.04.29:
28
- * Mongoose - Created from old PPM/PCX codebases I have done before
29
- ==========================================================================*/
30
 
7
 
31
 #include <string.h>
8
 #include <string.h>
32
 #include <stdlib.h>
9
 #include <stdlib.h>

Loading…
Cancel
Save