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