]> git.mxchange.org Git - flightgear.git/blob - Scenery/tile.hxx
Working on sorting by, and rendering by material properties.
[flightgear.git] / Scenery / tile.hxx
1 // tile.hxx -- routines to handle a scenery tile
2 //
3 // Written by Curtis Olson, started May 1998.
4 //
5 // Copyright (C) 1998  Curtis L. Olson  - curt@infoplane.com
6 //
7 // This program is free software; you can redistribute it and/or
8 // modify it under the terms of the GNU General Public License as
9 // published by the Free Software Foundation; either version 2 of the
10 // License, or (at your option) any later version.
11 //
12 // This program is distributed in the hope that it will be useful, but
13 // WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15 // General Public License for more details.
16 //
17 // You should have received a copy of the GNU General Public License
18 // along with this program; if not, write to the Free Software
19 // Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 //
21 // $Id$
22 // (Log is kept at end of this file)
23
24
25 #ifndef _TILE_HXX
26 #define _TILE_HXX
27
28
29 #ifndef __cplusplus                                                          
30 # error This library requires C++
31 #endif                                   
32
33 #ifdef HAVE_CONFIG_H
34 #  include <config.h>
35 #endif
36
37 #ifdef HAVE_WINDOWS_H
38 #  include <windows.h>
39 #endif
40
41 #include <GL/glut.h>
42 #include <XGL/xgl.h>
43
44 #include <list>         // STL list
45
46 #include <Bucket/bucketutils.h>
47 #include <Include/fg_types.h>
48
49
50 // Object fragment data class
51 class fgFRAGMENT {
52
53 public:
54     // positional data for this object fragment
55     fgCartesianPoint3d tile_center;
56
57     // culling data for this object fragment (fine grain culling)
58     fgCartesianPoint3d center;
59     double bounding_radius;
60
61     // material property pointer
62     void *material_ptr;
63
64     // OpenGL display list for fragment data
65     GLint display_list;
66
67     // Constructor
68     fgFRAGMENT ( void );
69
70     // Destructor
71     ~fgFRAGMENT ( void );
72 };
73
74
75 // Scenery tile class
76 class fgTILE {
77
78 public:
79
80     // culling data for whole tile (course grain culling)
81     fgCartesianPoint3d center;
82     double bounding_radius;
83
84     // this tile's official location in the world
85     struct fgBUCKET tile_bucket;
86
87     // the tile cache will mark here if the tile is being used
88     int used;
89
90     list < fgFRAGMENT > fragment_list;
91
92     // Constructor
93     fgTILE ( void );
94
95     // Destructor
96     ~fgTILE ( void );
97 };
98
99
100 #endif // _TILE_HXX 
101
102
103 // $Log$
104 // Revision 1.3  1998/06/05 22:39:54  curt
105 // Working on sorting by, and rendering by material properties.
106 //
107 // Revision 1.2  1998/06/03 00:47:50  curt
108 // No .h for STL includes.
109 // Minor view culling optimizations.
110 //
111 // Revision 1.1  1998/05/23 14:09:21  curt
112 // Added tile.cxx and tile.hxx.
113 // Working on rewriting the tile management system so a tile is just a list
114 // fragments, and the fragment record contains the display list for that fragment.
115 //