Ported osgUtil, osgDB, osgGA, NodeKits and plugins to compile against OpenGL ES 1.1 and OpenGL ES 2.0.

This commit is contained in:
Robert Osfield
2009-10-28 20:31:57 +00:00
parent 7e7135be59
commit d17d7159a1
37 changed files with 318 additions and 146 deletions

View File

@@ -12,7 +12,7 @@
*/
//
// OpenFlight<EFBFBD> loader for OpenSceneGraph
// OpenFlight (R) loader for OpenSceneGraph
//
// Copyright (C) 2005-2007 Brede Johansen
//
@@ -30,6 +30,17 @@
#include "AttrData.h"
#include "RecordInputStream.h"
#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE)
#define GL_RGB5 0x8050
#define GL_RGBA4 0x8056
#define GL_RGBA8 0x8058
#define GL_RGBA12 0x805A
#define GL_RGB12 0x8053
#define GL_LUMINANCE12_ALPHA4 0x8046
#define GL_LUMINANCE12_ALPHA12 0x8047
#define GL_INTENSITY16 0x804D
#endif
namespace flt {
class VertexPalette : public Record

View File

@@ -1,4 +1,3 @@
#include <osg/TexEnv>
#include <osg/CullFace>
@@ -21,6 +20,9 @@
#include "Q3BSPReader.h"
#include "Q3BSPLoad.h"
#ifndef GL_RGBA8
#define GL_RGBA8 0x8058
#endif
using namespace bsp;

View File

@@ -35,6 +35,10 @@
#include <stdio.h>
#include <string.h>
#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE)
#define GL_RED 0x1903
#define GL_LUMINANCE4_ALPHA4 0x8043
#endif
// NOTICE ON WIN32:
// typedef DWORD unsigned long;

View File

@@ -45,6 +45,15 @@
#include "hdrloader.h"
#include "hdrwriter.h"
#ifndef GL_RGBA8
#define GL_RGBA8 0x8058
#endif
#ifndef GL_RGB8
#define GL_RGB8 0x8051
#endif
class ReaderWriterHDR : public osgDB::ReaderWriter
{
public:

View File

@@ -95,6 +95,8 @@ class Logos: public osg::Drawable
virtual void drawImplementation(osg::RenderInfo& renderInfo) const
{
#if !defined(OSG_GLES1_AVAILABLE) && !defined(OSG_GLES2_AVAILABLE)
if( renderInfo.getContextID() != _contextID )
return;
@@ -164,7 +166,10 @@ class Logos: public osg::Drawable
glPopMatrix();
glMatrixMode( GL_PROJECTION );
glPopMatrix();
glMatrixMode( GL_MODELVIEW );
glMatrixMode( GL_MODELVIEW );
#else
osg::notify(osg::NOTICE)<<"Warning: Logos::drawImplementation(..) not supported."<<std::endl;
#endif
}
void addLogo( RelativePosition pos, std::string name )

View File

@@ -1,7 +1,11 @@
#include <osg/StateSet>
#include <osg/Texture1D>
#include <osg/Texture2D>
#include <osg/TextureCubeMap>
#include <osg/TextureRectangle>
#include <osg/TexGen>
#include <osg/PolygonOffset>
#include <osg/LineStipple>
#include <osgDB/Registry>
#include <osgDB/Input>

View File

@@ -22,6 +22,14 @@
# define SEEK_SET 0
#endif
#if defined(OSG_GLES1_AVAILABLE) || defined(OSG_GLES2_AVAILABLE)
#define GL_BITMAP 0x1A00
#define GL_RED 0x1903
#define GL_GREEN 0x1904
#define GL_BLUE 0x1905
#define GL_COLOR_INDEX 0x1900
#endif
using namespace osg;