]> git.mxchange.org Git - flightgear.git/blob - Scenery/tilecache.h
Initial revision.
[flightgear.git] / Scenery / tilecache.h
1 /**************************************************************************
2  * tilecache.h -- routines to hancle 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 #ifdef WIN32
32 #  include <windows.h>
33 #endif
34
35 #include <GL/glut.h>
36 #include <XGL/xgl.h>
37
38 #include <Scenery/bucketutils.h>
39 #include <Include/types.h>
40
41
42 #define FG_TILE_CACHE_SIZE 100   /* Must be > FG_LOCAL_X_Y */
43
44
45 /* Tile cache record */
46 struct fgTILE {
47     struct fgBUCKET tile_bucket;
48     GLint display_list;
49     struct fgCartesianPoint local_ref;
50     int used;
51 };
52
53 /* tile cache */
54 extern struct fgTILE tile_cache[FG_TILE_CACHE_SIZE];
55
56
57 /* Initialize the tile cache subsystem */
58 void fgTileCacheInit( void );
59
60 /* Return index of next available slot in tile cache */
61 int fgTileCacheNextAvail( void );
62
63 /* Fill in a tile cache entry with real data for the specified bucket */
64 void fgTileCacheEntryFillIn( int index, struct fgBUCKET *p );
65
66 /* Return info for a tile cache entry */
67 void fgTileCacheEntryInfo( int index, GLint *display_list, 
68                            struct fgCartesianPoint *local_ref );
69
70
71 #endif /* _TILECACHE_H */
72
73
74 /* $Log$
75 /* Revision 1.1  1998/01/24 00:03:29  curt
76 /* Initial revision.
77 /*
78  */
79
80