/*
* $Log$
+ * Revision 1.5 2008/07/27 16:10:37 ehofman
+ *
+ *
+ * - remove the SG_GLxxxx_H #defines, since OSG provides its own versions
+ * - this exposed a bizarre issue on Mac where dragging in <AGL/agl.h> in
+ * extensions.hxx was pulling in all of Carbon to the global namespace
+ * - very scary. As a result, I now need to explicitly include CoreFoundation
+ * in fg_init.cxx.
+ * - change SG_USING_STD(x) to using std::x
+ *
+ * Issues:
+ *
+ * - the logic for X11 and Win32 in RenderTexture and extensions is tortured,
+ * please see if you agree I got all the ifdefs correct.
+ *
+ * Revision 1.4 2006/10/29 19:27:11 frohlich
+ * Modified Files:
+ * configure.ac simgear/environment/visual_enviro.cxx
+ * simgear/ephemeris/ephemeris.cxx
+ * simgear/ephemeris/ephemeris.hxx simgear/ephemeris/stardata.cxx
+ * simgear/ephemeris/stardata.hxx simgear/math/SGMatrix.hxx
+ * simgear/math/SGQuat.hxx simgear/math/SGVec3.hxx
+ * simgear/math/SGVec4.hxx simgear/scene/Makefile.am
+ * simgear/scene/material/mat.cxx simgear/scene/material/mat.hxx
+ * simgear/scene/material/matlib.cxx
+ * simgear/scene/material/matlib.hxx
+ * simgear/scene/material/matmodel.cxx
+ * simgear/scene/material/matmodel.hxx
+ * simgear/scene/model/Makefile.am
+ * simgear/scene/model/animation.cxx
+ * simgear/scene/model/animation.hxx
+ * simgear/scene/model/custtrans.hxx
+ * simgear/scene/model/model.cxx simgear/scene/model/model.hxx
+ * simgear/scene/model/modellib.cxx
+ * simgear/scene/model/modellib.hxx
+ * simgear/scene/model/personality.cxx
+ * simgear/scene/model/personality.hxx
+ * simgear/scene/model/placement.cxx
+ * simgear/scene/model/placement.hxx
+ * simgear/scene/model/placementtrans.cxx
+ * simgear/scene/model/placementtrans.hxx
+ * simgear/scene/model/shadanim.cxx
+ * simgear/scene/model/shadowvolume.hxx
+ * simgear/scene/sky/cloud.cxx simgear/scene/sky/cloud.hxx
+ * simgear/scene/sky/cloudfield.cxx simgear/scene/sky/dome.cxx
+ * simgear/scene/sky/dome.hxx simgear/scene/sky/moon.cxx
+ * simgear/scene/sky/moon.hxx simgear/scene/sky/newcloud.cxx
+ * simgear/scene/sky/oursun.cxx simgear/scene/sky/oursun.hxx
+ * simgear/scene/sky/sky.cxx simgear/scene/sky/sky.hxx
+ * simgear/scene/sky/sphere.cxx simgear/scene/sky/sphere.hxx
+ * simgear/scene/sky/stars.cxx simgear/scene/sky/stars.hxx
+ * simgear/scene/tgdb/apt_signs.cxx
+ * simgear/scene/tgdb/apt_signs.hxx simgear/scene/tgdb/leaf.cxx
+ * simgear/scene/tgdb/leaf.hxx simgear/scene/tgdb/obj.cxx
+ * simgear/scene/tgdb/obj.hxx simgear/scene/tgdb/pt_lights.cxx
+ * simgear/scene/tgdb/pt_lights.hxx
+ * simgear/scene/tgdb/userdata.cxx
+ * simgear/scene/tgdb/userdata.hxx simgear/scene/tgdb/vasi.hxx
+ * simgear/screen/jpgfactory.cxx simgear/screen/tr.cxx
+ * simgear/structure/Makefile.am simgear/threads/SGThread.hxx
+ * Added Files:
+ * simgear/scene/util/Makefile.am
+ * simgear/scene/util/SGDebugDrawCallback.hxx
+ * simgear/scene/util/SGNodeMasks.hxx
+ * simgear/scene/util/SGStateAttributeVisitor.hxx
+ * simgear/scene/util/SGTextureStateAttributeVisitor.hxx
+ * simgear/scene/util/SGUpdateVisitor.hxx
+ * Removed Files:
+ * simgear/screen/ssgEntityArray.cxx
+ * simgear/screen/ssgEntityArray.hxx
+ * simgear/structure/ssgSharedPtr.hxx
+ * Big BLOB on the way to OSG.
+ *
+ * Revision 1.3 2006-02-21 10:47:21 ehofman
+ * Back out the previous patch.
+ *
+ * Revision 1.2 2004/11/18 19:10:34 curt
+ * Abstract out location of gl.h, glut.h, and glu.h includes so that we can
+ * make the Mac platform happy since they put these in a different place compared
+ * to the rest of the world.
+ *
+ * Revision 1.1.1.1 2002/09/07 02:58:19 curt
+ * Initial revsion of Simgear-0.3.0
+ *
+ * Revision 1.3 2001/07/30 20:34:21 curt
+ * Various MSVC fixes.
+ *
+ * Revision 1.2 2001/06/27 02:48:01 curt
+ * Fixed a type conversion bug that could trip up some of the pickier compilers
+ * out there.
+ *
* Revision 1.1 2001/06/26 15:19:39 curt
* Added tr.cxx / tr.h, Brian Paul's LGPL'd tiled rendering support libs for
* rendering ultra high res "tiled" screen shots.
*/
+#include <simgear/compiler.h>
+
#include <assert.h>
#include <math.h>
#include <stdlib.h>
#ifdef WIN32
#include <windows.h>
#endif
-#include <GL/gl.h>
-#include <GL/glu.h>
-#include <plib/ssg.h>
+
+#include <simgear/scene/util/project.hxx>
+
#include "tr.h"
{
GLint matrixMode;
GLint tileWidth, tileHeight, border;
- GLdouble left, right, bottom, top;
+// GLdouble left, right, bottom, top;
if (!tr)
return;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
+ // OSGFIXME
/* compute projection parameters */
+ /*
left = tr->Left + (tr->Right - tr->Left)
* (tr->CurrentColumn * tr->TileWidthNB - border) / tr->ImageWidth;
right = left + (tr->Right - tr->Left) * tileWidth / tr->ImageWidth;
* (tr->CurrentRow * tr->TileHeightNB - border) / tr->ImageHeight;
top = bottom + (tr->Top - tr->Bottom) * tileHeight / tr->ImageHeight;
- ssgSetFrustum ( left, right, bottom, top, tr->Near, tr->Far );
+ ssgSetFrustum ( left, right, bottom, top, tr->Near, tr->Far );
+ */
/* restore user's matrix mode */
- glMatrixMode(matrixMode);
+ glMatrixMode( (GLenum)matrixMode );
}
return 1;
}
-
/*
* Replacement for glRastePos3f() which avoids the problem with invalid
* raster pos.
viewport[3] = tr->CurrentTileHeight;
/* Project object coord to window coordinate */
- if (gluProject(x, y, z, modelview, proj, viewport, &winX, &winY, &winZ)){
+ if (simgear::project(x, y, z, modelview, proj, viewport,
+ &winX, &winY, &winZ)){
/* set raster pos to window coord (0,0) */
glMatrixMode(GL_MODELVIEW);