tr.h

00001 /* $Id: tr_8h-source.html,v 1.15 2007-12-17 15:37:16 curt Exp $ */
00002 
00003 /*
00004  * $Log: tr.h,v $
00005  * Revision 1.3  2006-02-21 10:47:21  ehofman
00006  * Back out the previous patch.
00007  *
00008  * Revision 1.2  2004/11/18 19:10:34  curt
00009  * Abstract out location of gl.h, glut.h, and glu.h includes so that we can
00010  * make the Mac platform happy since they put these in a different place compared
00011  * to the rest of the world.
00012  *
00013  * Revision 1.1.1.1  2002/09/07 02:58:19  curt
00014  * Initial revsion of Simgear-0.3.0
00015  *
00016  * Revision 1.1  2001/06/26 15:19:39  curt
00017  * Added tr.cxx / tr.h, Brian Paul's LGPL'd tiled rendering support libs for
00018  * rendering ultra high res "tiled" screen shots.
00019  *
00020  * Revision 1.5  1997/07/21  17:34:07  brianp
00021  * added tile borders, incremented version to 1.1
00022  *
00023  * Revision 1.4  1997/07/21  15:47:35  brianp
00024  * renamed all "near" and "far" variables
00025  *
00026  * Revision 1.3  1997/04/26  21:23:25  brianp
00027  * added trRasterPos3f function
00028  *
00029  * Revision 1.2  1997/04/19  23:26:10  brianp
00030  * many API changes
00031  *
00032  * Revision 1.1  1997/04/18  21:53:05  brianp
00033  * Initial revision
00034  *
00035  */
00036 
00037 
00038 /*
00039  * Tiled Rendering library
00040  * Version 1.1
00041  * Copyright (C) Brian Paul
00042  *
00043  *
00044  * This library allows one to render arbitrarily large images with OpenGL.
00045  * The basic idea is to break the image into tiles which are rendered one
00046  * at a time.  The tiles are assembled together to form the final, large
00047  * image.  Tiles and images can be of any size.
00048  *
00049  * Basic usage:
00050  *
00051  * 1. Allocate a tile rendering context:
00052  *       TRcontext t = trNew();
00053  *
00054  * 2. Specify the final image buffer and tile size:
00055  *       GLubyte image[W][H][4]
00056  *       trImageSize(t, W, H);
00057  *       trImageBuffer(t, GL_RGBA, GL_UNSIGNED_BYTE, (GLubyte *) image);
00058  *
00059  * 3. Setup your projection:
00060  *       trFrustum(t, left, right, bottom top, near, far);
00061  *    or
00062  *       trOrtho(t, left, right, bottom top, near, far);
00063  *    or
00064  *       trPerspective(t, fovy, aspect, near, far);
00065  *
00066  * 4. Render the tiles:
00067  *       do {
00068  *           trBeginTile(t);
00069  *           DrawMyScene();
00070  *       } while (trEndTile(t));
00071  *
00072  *    You provide the DrawMyScene() function which calls glClear() and
00073  *    draws all your stuff.
00074  *
00075  * 5. The image array is now complete.  Display it, write it to a file, etc.
00076  *
00077  * 6. Delete the tile rendering context when finished:
00078  *       trDelete(t);
00079  *
00080  */
00081 
00082 
00083 #ifndef TR_H
00084 #define TR_H
00085 
00086 #include <simgear/compiler.h>
00087 
00088 #include SG_GL_H
00089 
00090 
00091 //#ifdef __cplusplus
00092 //extern "C" {
00093 //#endif
00094 
00095 
00096 #define TR_VERSION "1.1"
00097 #define TR_MAJOR_VERSION 1
00098 #define TR_MINOR_VERSION 1
00099 
00100 
00101 typedef struct _TRctx TRcontext;
00102 
00103 
00104 typedef enum {
00105         TR_TILE_WIDTH = 100,
00106         TR_TILE_HEIGHT,
00107         TR_TILE_BORDER,
00108         TR_IMAGE_WIDTH,
00109         TR_IMAGE_HEIGHT,
00110         TR_ROWS,
00111         TR_COLUMNS,
00112         TR_CURRENT_ROW,
00113         TR_CURRENT_COLUMN,
00114         TR_CURRENT_TILE_WIDTH,
00115         TR_CURRENT_TILE_HEIGHT,
00116         TR_ROW_ORDER,
00117         TR_TOP_TO_BOTTOM,
00118         TR_BOTTOM_TO_TOP,
00119         TR_LEFT,
00120         TR_RIGHT,
00121         TR_BOTTOM,
00122         TR_TOP,
00123         TR_NEAR,
00124         TR_FAR
00125 } TRenum;
00126 
00127 
00128 
00129 extern TRcontext *trNew(void);
00130 
00131 extern void trDelete(TRcontext *tr);
00132 
00133 
00134 extern void trTileSize(TRcontext *tr, GLint width, GLint height, GLint border);
00135 
00136 extern void trTileBuffer(TRcontext *tr, GLenum format, GLenum type,
00137                                                  GLvoid *image);
00138 
00139 
00140 extern void trImageSize(TRcontext *tr, GLint width, GLint height);
00141 
00142 extern void trImageBuffer(TRcontext *tr, GLenum format, GLenum type,
00143                                                   GLvoid *image);
00144 
00145 
00146 extern void trRowOrder(TRcontext *tr, TRenum order);
00147 
00148 
00149 extern GLint trGet(TRcontext *tr, TRenum param);
00150 extern GLdouble trGetD(TRcontext *tr, TRenum param);
00151 
00152 
00153 extern void trOrtho(TRcontext *tr,
00154                                         GLdouble left, GLdouble right,
00155                                         GLdouble bottom, GLdouble top,
00156                                         GLdouble zNear, GLdouble zFar);
00157 
00158 extern void trFrustum(TRcontext *tr,
00159                                           GLdouble left, GLdouble right,
00160                                           GLdouble bottom, GLdouble top,
00161                                           GLdouble zNear, GLdouble zFar);
00162 
00163 extern void trPerspective(TRcontext *tr,
00164                                                   GLdouble fovy, GLdouble aspect,
00165                                                   GLdouble zNear, GLdouble zFar );
00166 
00167 
00168 extern void trBeginTile(TRcontext *tr);
00169 
00170 extern int trEndTile(TRcontext *tr);
00171 
00172 
00173 extern void trRasterPos3f(TRcontext *tr, GLfloat x, GLfloat y, GLfloat z);
00174 
00175 
00176 
00177 //#ifdef __cplusplus
00178 //}
00179 //#endif
00180 
00181 
00182 #endif

Generated on Mon Dec 17 09:30:56 2007 for SimGear by  doxygen 1.5.1