5 * Revision 1.1 2001/06/26 15:19:39 curt
6 * Added tr.cxx / tr.h, Brian Paul's LGPL'd tiled rendering support libs for
7 * rendering ultra high res "tiled" screen shots.
9 * Revision 1.5 1997/07/21 17:34:07 brianp
10 * added tile borders, incremented version to 1.1
12 * Revision 1.4 1997/07/21 15:47:35 brianp
13 * renamed all "near" and "far" variables
15 * Revision 1.3 1997/04/26 21:23:25 brianp
16 * added trRasterPos3f function
18 * Revision 1.2 1997/04/19 23:26:10 brianp
21 * Revision 1.1 1997/04/18 21:53:05 brianp
28 * Tiled Rendering library
30 * Copyright (C) Brian Paul
33 * This library allows one to render arbitrarily large images with OpenGL.
34 * The basic idea is to break the image into tiles which are rendered one
35 * at a time. The tiles are assembled together to form the final, large
36 * image. Tiles and images can be of any size.
40 * 1. Allocate a tile rendering context:
41 * TRcontext t = trNew();
43 * 2. Specify the final image buffer and tile size:
44 * GLubyte image[W][H][4]
45 * trImageSize(t, W, H);
46 * trImageBuffer(t, GL_RGBA, GL_UNSIGNED_BYTE, (GLubyte *) image);
48 * 3. Setup your projection:
49 * trFrustum(t, left, right, bottom top, near, far);
51 * trOrtho(t, left, right, bottom top, near, far);
53 * trPerspective(t, fovy, aspect, near, far);
55 * 4. Render the tiles:
59 * } while (trEndTile(t));
61 * You provide the DrawMyScene() function which calls glClear() and
62 * draws all your stuff.
64 * 5. The image array is now complete. Display it, write it to a file, etc.
66 * 6. Delete the tile rendering context when finished:
84 #define TR_VERSION "1.1"
85 #define TR_MAJOR_VERSION 1
86 #define TR_MINOR_VERSION 1
89 typedef struct _TRctx TRcontext;
102 TR_CURRENT_TILE_WIDTH,
103 TR_CURRENT_TILE_HEIGHT,
117 extern TRcontext *trNew(void);
119 extern void trDelete(TRcontext *tr);
122 extern void trTileSize(TRcontext *tr, GLint width, GLint height, GLint border);
124 extern void trTileBuffer(TRcontext *tr, GLenum format, GLenum type,
128 extern void trImageSize(TRcontext *tr, GLint width, GLint height);
130 extern void trImageBuffer(TRcontext *tr, GLenum format, GLenum type,
134 extern void trRowOrder(TRcontext *tr, TRenum order);
137 extern GLint trGet(TRcontext *tr, TRenum param);
138 extern GLdouble trGetD(TRcontext *tr, TRenum param);
141 extern void trOrtho(TRcontext *tr,
142 GLdouble left, GLdouble right,
143 GLdouble bottom, GLdouble top,
144 GLdouble zNear, GLdouble zFar);
146 extern void trFrustum(TRcontext *tr,
147 GLdouble left, GLdouble right,
148 GLdouble bottom, GLdouble top,
149 GLdouble zNear, GLdouble zFar);
151 extern void trPerspective(TRcontext *tr,
152 GLdouble fovy, GLdouble aspect,
153 GLdouble zNear, GLdouble zFar );
156 extern void trBeginTile(TRcontext *tr);
158 extern int trEndTile(TRcontext *tr);
161 extern void trRasterPos3f(TRcontext *tr, GLfloat x, GLfloat y, GLfloat z);