5 * Revision 1.1 2002/09/07 02:58:19 curt
8 * Revision 1.1 2001/06/26 15:19:39 curt
9 * Added tr.cxx / tr.h, Brian Paul's LGPL'd tiled rendering support libs for
10 * rendering ultra high res "tiled" screen shots.
12 * Revision 1.5 1997/07/21 17:34:07 brianp
13 * added tile borders, incremented version to 1.1
15 * Revision 1.4 1997/07/21 15:47:35 brianp
16 * renamed all "near" and "far" variables
18 * Revision 1.3 1997/04/26 21:23:25 brianp
19 * added trRasterPos3f function
21 * Revision 1.2 1997/04/19 23:26:10 brianp
24 * Revision 1.1 1997/04/18 21:53:05 brianp
31 * Tiled Rendering library
33 * Copyright (C) Brian Paul
36 * This library allows one to render arbitrarily large images with OpenGL.
37 * The basic idea is to break the image into tiles which are rendered one
38 * at a time. The tiles are assembled together to form the final, large
39 * image. Tiles and images can be of any size.
43 * 1. Allocate a tile rendering context:
44 * TRcontext t = trNew();
46 * 2. Specify the final image buffer and tile size:
47 * GLubyte image[W][H][4]
48 * trImageSize(t, W, H);
49 * trImageBuffer(t, GL_RGBA, GL_UNSIGNED_BYTE, (GLubyte *) image);
51 * 3. Setup your projection:
52 * trFrustum(t, left, right, bottom top, near, far);
54 * trOrtho(t, left, right, bottom top, near, far);
56 * trPerspective(t, fovy, aspect, near, far);
58 * 4. Render the tiles:
62 * } while (trEndTile(t));
64 * You provide the DrawMyScene() function which calls glClear() and
65 * draws all your stuff.
67 * 5. The image array is now complete. Display it, write it to a file, etc.
69 * 6. Delete the tile rendering context when finished:
87 #define TR_VERSION "1.1"
88 #define TR_MAJOR_VERSION 1
89 #define TR_MINOR_VERSION 1
92 typedef struct _TRctx TRcontext;
105 TR_CURRENT_TILE_WIDTH,
106 TR_CURRENT_TILE_HEIGHT,
120 extern TRcontext *trNew(void);
122 extern void trDelete(TRcontext *tr);
125 extern void trTileSize(TRcontext *tr, GLint width, GLint height, GLint border);
127 extern void trTileBuffer(TRcontext *tr, GLenum format, GLenum type,
131 extern void trImageSize(TRcontext *tr, GLint width, GLint height);
133 extern void trImageBuffer(TRcontext *tr, GLenum format, GLenum type,
137 extern void trRowOrder(TRcontext *tr, TRenum order);
140 extern GLint trGet(TRcontext *tr, TRenum param);
141 extern GLdouble trGetD(TRcontext *tr, TRenum param);
144 extern void trOrtho(TRcontext *tr,
145 GLdouble left, GLdouble right,
146 GLdouble bottom, GLdouble top,
147 GLdouble zNear, GLdouble zFar);
149 extern void trFrustum(TRcontext *tr,
150 GLdouble left, GLdouble right,
151 GLdouble bottom, GLdouble top,
152 GLdouble zNear, GLdouble zFar);
154 extern void trPerspective(TRcontext *tr,
155 GLdouble fovy, GLdouble aspect,
156 GLdouble zNear, GLdouble zFar );
159 extern void trBeginTile(TRcontext *tr);
161 extern int trEndTile(TRcontext *tr);
164 extern void trRasterPos3f(TRcontext *tr, GLfloat x, GLfloat y, GLfloat z);