]> git.mxchange.org Git - flightgear.git/blob - Scenery/tilecache.h
Code reorganizations. Added a Lib/ directory for more general libraries.
[flightgear.git] / Scenery / tilecache.h
1 /**************************************************************************
2  * tilecache.h -- routines to handle scenery tile caching
3  *
4  * Written by Curtis Olson, started January 1998.
5  *
6  * Copyright (C) 1997  Curtis L. Olson  - curt@infoplane.com
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License as
10  * published by the Free Software Foundation; either version 2 of the
11  * License, or (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful, but
14  * WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program; if not, write to the Free Software
20  * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21  *
22  * $Id$
23  * (Log is kept at end of this file)
24  **************************************************************************/
25
26
27 #ifndef _TILECACHE_H
28 #define _TILECACHE_H
29
30
31 #include <config.h>
32
33 #ifdef HAVE_WINDOWS_H
34 #  include <windows.h>
35 #endif
36
37 #include <GL/glut.h>
38 #include <XGL/xgl.h>
39
40 #include <Bucket/bucketutils.h>
41 #include <Include/fg_types.h>
42
43 /* For best results ... i.e. to avoid tile load problems and blank areas
44  *
45  * FG_TILE_CACHE_SIZE >= FG_LOCAL_X_Y + 2*max(FG_LOCAL_X, FG_LOCAL_Y) + 1 */
46 #define FG_TILE_CACHE_SIZE 100
47
48
49 /* Tile cache record */
50 struct fgTILE {
51     struct fgBUCKET tile_bucket;
52     GLint display_list;
53     struct fgCartesianPoint local_ref;
54     double bounding_radius;
55     int used;
56     int priority;
57 };
58
59 /* tile cache */
60 extern struct fgTILE tile_cache[FG_TILE_CACHE_SIZE];
61
62
63 /* Initialize the tile cache subsystem */
64 void fgTileCacheInit( void );
65
66 /* Search for the specified "bucket" in the cache */
67 int fgTileCacheExists( struct fgBUCKET *p );
68
69 /* Return index of next available slot in tile cache */
70 int fgTileCacheNextAvail( void );
71
72 /* Fill in a tile cache entry with real data for the specified bucket */
73 void fgTileCacheEntryFillIn( int index, struct fgBUCKET *p );
74
75 /* Return info for a tile cache entry */
76 void fgTileCacheEntryInfo( int index, GLint *display_list, 
77                            struct fgCartesianPoint *local_ref );
78
79
80 #endif /* _TILECACHE_H */
81
82
83 /* $Log$
84 /* Revision 1.9  1998/04/14 02:23:17  curt
85 /* Code reorganizations.  Added a Lib/ directory for more general libraries.
86 /*
87  * Revision 1.8  1998/04/08 23:30:08  curt
88  * Adopted Gnu automake/autoconf system.
89  *
90  * Revision 1.7  1998/04/03 22:11:38  curt
91  * Converting to Gnu autoconf system.
92  *
93  * Revision 1.6  1998/02/18 15:07:10  curt
94  * Tweaks to build with SGI OpenGL (and therefor hopefully other accelerated
95  * drivers will work.)
96  *
97  * Revision 1.5  1998/02/16 13:39:45  curt
98  * Miscellaneous weekend tweaks.  Fixed? a cache problem that caused whole
99  * tiles to occasionally be missing.
100  *
101  * Revision 1.4  1998/01/31 00:43:27  curt
102  * Added MetroWorks patches from Carmen Volpe.
103  *
104  * Revision 1.3  1998/01/29 00:51:40  curt
105  * First pass at tile cache, dynamic tile loading and tile unloading now works.
106  *
107  * Revision 1.2  1998/01/27 00:48:04  curt
108  * Incorporated Paul Bleisch's <bleisch@chromatic.com> new debug message
109  * system and commandline/config file processing code.
110  *
111  * Revision 1.1  1998/01/24 00:03:29  curt
112  * Initial revision.
113  *
114  */
115
116