5 * Revision 1.4 2008/07/27 16:10:37 ehofman
8 * - remove the SG_GLxxxx_H #defines, since OSG provides its own versions
9 * - this exposed a bizarre issue on Mac where dragging in <AGL/agl.h> in
10 * extensions.hxx was pulling in all of Carbon to the global namespace
11 * - very scary. As a result, I now need to explicitly include CoreFoundation
13 * - change SG_USING_STD(x) to using std::x
17 * - the logic for X11 and Win32 in RenderTexture and extensions is tortured,
18 * please see if you agree I got all the ifdefs correct.
20 * Revision 1.3 2006/02/21 10:47:21 ehofman
21 * Back out the previous patch.
23 * Revision 1.2 2004/11/18 19:10:34 curt
24 * Abstract out location of gl.h, glut.h, and glu.h includes so that we can
25 * make the Mac platform happy since they put these in a different place compared
26 * to the rest of the world.
28 * Revision 1.1.1.1 2002/09/07 02:58:19 curt
29 * Initial revsion of Simgear-0.3.0
31 * Revision 1.1 2001/06/26 15:19:39 curt
32 * Added tr.cxx / tr.h, Brian Paul's LGPL'd tiled rendering support libs for
33 * rendering ultra high res "tiled" screen shots.
35 * Revision 1.5 1997/07/21 17:34:07 brianp
36 * added tile borders, incremented version to 1.1
38 * Revision 1.4 1997/07/21 15:47:35 brianp
39 * renamed all "near" and "far" variables
41 * Revision 1.3 1997/04/26 21:23:25 brianp
42 * added trRasterPos3f function
44 * Revision 1.2 1997/04/19 23:26:10 brianp
47 * Revision 1.1 1997/04/18 21:53:05 brianp
54 * Tiled Rendering library
56 * Copyright (C) Brian Paul
59 * This library allows one to render arbitrarily large images with OpenGL.
60 * The basic idea is to break the image into tiles which are rendered one
61 * at a time. The tiles are assembled together to form the final, large
62 * image. Tiles and images can be of any size.
66 * 1. Allocate a tile rendering context:
67 * TRcontext t = trNew();
69 * 2. Specify the final image buffer and tile size:
70 * GLubyte image[W][H][4]
71 * trImageSize(t, W, H);
72 * trImageBuffer(t, GL_RGBA, GL_UNSIGNED_BYTE, (GLubyte *) image);
74 * 3. Setup your projection:
75 * trFrustum(t, left, right, bottom top, near, far);
77 * trOrtho(t, left, right, bottom top, near, far);
79 * trPerspective(t, fovy, aspect, near, far);
81 * 4. Render the tiles:
85 * } while (trEndTile(t));
87 * You provide the DrawMyScene() function which calls glClear() and
88 * draws all your stuff.
90 * 5. The image array is now complete. Display it, write it to a file, etc.
92 * 6. Delete the tile rendering context when finished:
101 #include <simgear/compiler.h>
111 #define TR_VERSION "1.1"
112 #define TR_MAJOR_VERSION 1
113 #define TR_MINOR_VERSION 1
116 typedef struct _TRctx TRcontext;
129 TR_CURRENT_TILE_WIDTH,
130 TR_CURRENT_TILE_HEIGHT,
144 extern TRcontext *trNew(void);
146 extern void trDelete(TRcontext *tr);
149 extern void trTileSize(TRcontext *tr, GLint width, GLint height, GLint border);
151 extern void trTileBuffer(TRcontext *tr, GLenum format, GLenum type,
155 extern void trImageSize(TRcontext *tr, GLint width, GLint height);
157 extern void trImageBuffer(TRcontext *tr, GLenum format, GLenum type,
161 extern void trRowOrder(TRcontext *tr, TRenum order);
164 extern GLint trGet(TRcontext *tr, TRenum param);
165 extern GLdouble trGetD(TRcontext *tr, TRenum param);
168 extern void trOrtho(TRcontext *tr,
169 GLdouble left, GLdouble right,
170 GLdouble bottom, GLdouble top,
171 GLdouble zNear, GLdouble zFar);
173 extern void trFrustum(TRcontext *tr,
174 GLdouble left, GLdouble right,
175 GLdouble bottom, GLdouble top,
176 GLdouble zNear, GLdouble zFar);
178 extern void trPerspective(TRcontext *tr,
179 GLdouble fovy, GLdouble aspect,
180 GLdouble zNear, GLdouble zFar );
183 extern void trBeginTile(TRcontext *tr);
185 extern int trEndTile(TRcontext *tr);
188 extern void trRasterPos3f(TRcontext *tr, GLfloat x, GLfloat y, GLfloat z);