1 /* $Id: tr.h,v 1.5 1997/07/21 17:34:07 brianp Exp $ */
5 * Revision 1.5 1997/07/21 17:34:07 brianp
6 * added tile borders, incremented version to 1.1
8 * Revision 1.4 1997/07/21 15:47:35 brianp
9 * renamed all "near" and "far" variables
11 * Revision 1.3 1997/04/26 21:23:25 brianp
12 * added trRasterPos3f function
14 * Revision 1.2 1997/04/19 23:26:10 brianp
17 * Revision 1.1 1997/04/18 21:53:05 brianp
24 * Tiled Rendering library
26 * Copyright (C) Brian Paul
29 * This library allows one to render arbitrarily large images with OpenGL.
30 * The basic idea is to break the image into tiles which are rendered one
31 * at a time. The tiles are assembled together to form the final, large
32 * image. Tiles and images can be of any size.
36 * 1. Allocate a tile rendering context:
37 * TRcontext t = trNew();
39 * 2. Specify the final image buffer and tile size:
40 * GLubyte image[W][H][4]
41 * trImageSize(t, W, H);
42 * trImageBuffer(t, GL_RGBA, GL_UNSIGNED_BYTE, (GLubyte *) image);
44 * 3. Setup your projection:
45 * trFrustum(t, left, right, bottom top, near, far);
47 * trOrtho(t, left, right, bottom top, near, far);
49 * trPerspective(t, fovy, aspect, near, far);
51 * 4. Render the tiles:
55 * } while (trEndTile(t));
57 * You provide the DrawMyScene() function which calls glClear() and
58 * draws all your stuff.
60 * 5. The image array is now complete. Display it, write it to a file, etc.
62 * 6. Delete the tile rendering context when finished:
80 #define TR_VERSION "1.1"
81 #define TR_MAJOR_VERSION 1
82 #define TR_MINOR_VERSION 1
85 typedef struct _TRctx TRcontext
;
98 TR_CURRENT_TILE_WIDTH
,
99 TR_CURRENT_TILE_HEIGHT
,
107 extern TRcontext
*trNew(void);
109 extern void trDelete(TRcontext
*tr
);
112 extern void trTileSize(TRcontext
*tr
, GLint width
, GLint height
, GLint border
);
114 extern void trTileBuffer(TRcontext
*tr
, GLenum format
, GLenum type
,
118 extern void trImageSize(TRcontext
*tr
, GLint width
, GLint height
);
120 extern void trImageBuffer(TRcontext
*tr
, GLenum format
, GLenum type
,
124 extern void trRowOrder(TRcontext
*tr
, TRenum order
);
127 extern GLint
trGet(TRcontext
*tr
, TRenum param
);
130 extern void trOrtho(TRcontext
*tr
,
131 GLdouble left
, GLdouble right
,
132 GLdouble bottom
, GLdouble top
,
133 GLdouble zNear
, GLdouble zFar
);
135 extern void trFrustum(TRcontext
*tr
,
136 GLdouble left
, GLdouble right
,
137 GLdouble bottom
, GLdouble top
,
138 GLdouble zNear
, GLdouble zFar
);
140 extern void trPerspective(TRcontext
*tr
,
141 GLdouble fovy
, GLdouble aspect
,
142 GLdouble zNear
, GLdouble zFar
);
145 extern void trBeginTile(TRcontext
*tr
);
147 extern int trEndTile(TRcontext
*tr
);
150 extern void trRasterPos3f(TRcontext
*tr
, GLfloat x
, GLfloat y
, GLfloat z
);