5 * Revision 1.2 2004/11/18 19:10:34 curt
6 * Abstract out location of gl.h, glut.h, and glu.h includes so that we can
7 * make the Mac platform happy since they put these in a different place compared
8 * to the rest of the world.
10 * Revision 1.1.1.1 2002/09/07 02:58:19 curt
11 * Initial revsion of Simgear-0.3.0
13 * Revision 1.1 2001/06/26 15:19:39 curt
14 * Added tr.cxx / tr.h, Brian Paul's LGPL'd tiled rendering support libs for
15 * rendering ultra high res "tiled" screen shots.
17 * Revision 1.5 1997/07/21 17:34:07 brianp
18 * added tile borders, incremented version to 1.1
20 * Revision 1.4 1997/07/21 15:47:35 brianp
21 * renamed all "near" and "far" variables
23 * Revision 1.3 1997/04/26 21:23:25 brianp
24 * added trRasterPos3f function
26 * Revision 1.2 1997/04/19 23:26:10 brianp
29 * Revision 1.1 1997/04/18 21:53:05 brianp
36 * Tiled Rendering library
38 * Copyright (C) Brian Paul
41 * This library allows one to render arbitrarily large images with OpenGL.
42 * The basic idea is to break the image into tiles which are rendered one
43 * at a time. The tiles are assembled together to form the final, large
44 * image. Tiles and images can be of any size.
48 * 1. Allocate a tile rendering context:
49 * TRcontext t = trNew();
51 * 2. Specify the final image buffer and tile size:
52 * GLubyte image[W][H][4]
53 * trImageSize(t, W, H);
54 * trImageBuffer(t, GL_RGBA, GL_UNSIGNED_BYTE, (GLubyte *) image);
56 * 3. Setup your projection:
57 * trFrustum(t, left, right, bottom top, near, far);
59 * trOrtho(t, left, right, bottom top, near, far);
61 * trPerspective(t, fovy, aspect, near, far);
63 * 4. Render the tiles:
67 * } while (trEndTile(t));
69 * You provide the DrawMyScene() function which calls glClear() and
70 * draws all your stuff.
72 * 5. The image array is now complete. Display it, write it to a file, etc.
74 * 6. Delete the tile rendering context when finished:
83 #include <simgear/compiler.h>
93 #define TR_VERSION "1.1"
94 #define TR_MAJOR_VERSION 1
95 #define TR_MINOR_VERSION 1
98 typedef struct _TRctx TRcontext;
111 TR_CURRENT_TILE_WIDTH,
112 TR_CURRENT_TILE_HEIGHT,
126 extern TRcontext *trNew(void);
128 extern void trDelete(TRcontext *tr);
131 extern void trTileSize(TRcontext *tr, GLint width, GLint height, GLint border);
133 extern void trTileBuffer(TRcontext *tr, GLenum format, GLenum type,
137 extern void trImageSize(TRcontext *tr, GLint width, GLint height);
139 extern void trImageBuffer(TRcontext *tr, GLenum format, GLenum type,
143 extern void trRowOrder(TRcontext *tr, TRenum order);
146 extern GLint trGet(TRcontext *tr, TRenum param);
147 extern GLdouble trGetD(TRcontext *tr, TRenum param);
150 extern void trOrtho(TRcontext *tr,
151 GLdouble left, GLdouble right,
152 GLdouble bottom, GLdouble top,
153 GLdouble zNear, GLdouble zFar);
155 extern void trFrustum(TRcontext *tr,
156 GLdouble left, GLdouble right,
157 GLdouble bottom, GLdouble top,
158 GLdouble zNear, GLdouble zFar);
160 extern void trPerspective(TRcontext *tr,
161 GLdouble fovy, GLdouble aspect,
162 GLdouble zNear, GLdouble zFar );
165 extern void trBeginTile(TRcontext *tr);
167 extern int trEndTile(TRcontext *tr);
170 extern void trRasterPos3f(TRcontext *tr, GLfloat x, GLfloat y, GLfloat z);