]> git.mxchange.org Git - flightgear.git/blob - Scenery/tile.hxx
Build only static libraries.
[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 #ifdef __sun__
45 extern "C" void *memmove(void *, const void *, size_t);
46 extern "C" void *memset(void *, int, size_t);
47 #endif
48
49 #include <list>         // STL list
50
51 #include <Bucket/bucketutils.h>
52 #include <Include/fg_types.h>
53
54
55 // Object fragment data class
56 class fgFRAGMENT {
57
58 public:
59     // culling data for this object fragment (fine grain culling)
60     fgCartesianPoint3d center;
61     double bounding_radius;
62
63     // variable offset data for this object fragment for this frame
64     fgCartesianPoint3d tile_offset;
65
66     // saved transformation matrix for this fragment (used by renderer)
67     // GLfloat matrix[16];
68
69     // material property pointer
70     void *material_ptr;
71
72     // OpenGL display list for fragment data
73     GLint display_list;
74
75     // Constructor
76     fgFRAGMENT ( void );
77
78     // Destructor
79     ~fgFRAGMENT ( void );
80 };
81
82
83 // Scenery tile class
84 class fgTILE {
85
86 public:
87
88     // culling data for whole tile (course grain culling)
89     fgCartesianPoint3d center;
90     double bounding_radius;
91     fgCartesianPoint3d offset;
92
93     // this tile's official location in the world
94     struct fgBUCKET tile_bucket;
95
96     // the tile cache will mark here if the tile is being used
97     int used;
98
99     list < fgFRAGMENT > fragment_list;
100
101     // Constructor
102     fgTILE ( void );
103
104     // Destructor
105     ~fgTILE ( void );
106 };
107
108
109 #endif // _TILE_HXX 
110
111
112 // $Log$
113 // Revision 1.7  1998/06/12 00:58:05  curt
114 // Build only static libraries.
115 // Declare memmove/memset for Sloaris.
116 //
117 // Revision 1.6  1998/06/08 17:57:54  curt
118 // Working first pass at material proporty sorting.
119 //
120 // Revision 1.5  1998/06/06 01:09:32  curt
121 // I goofed on the log message in the last commit ... now fixed.
122 //
123 // Revision 1.4  1998/06/06 01:07:18  curt
124 // Increased per material fragment list size from 100 to 400.
125 // Now correctly draw viewable fragments in per material order.
126 //
127 // Revision 1.3  1998/06/05 22:39:54  curt
128 // Working on sorting by, and rendering by material properties.
129 //
130 // Revision 1.2  1998/06/03 00:47:50  curt
131 // No .h for STL includes.
132 // Minor view culling optimizations.
133 //
134 // Revision 1.1  1998/05/23 14:09:21  curt
135 // Added tile.cxx and tile.hxx.
136 // Working on rewriting the tile management system so a tile is just a list
137 // fragments, and the fragment record contains the display list for that fragment.
138 //