Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

OgreSDLTexture.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://ogre.sourceforge.net/
00006 
00007 Copyright © 2000-2002 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 
00026 #ifndef __SDLTexture_H__
00027 #define __SDLTexture_H__
00028 
00029 #include "OgrePlatform.h"
00030 #include "OgreTexture.h"
00031 
00032 #if OGRE_PLATFORM == PLATFORM_WIN32
00033 #   include <windows.h>
00034 #   include <wingdi.h>
00035 #   include "gl.h"
00036 #   define GL_GLEXT_PROTOTYPES
00037 #   include "glprocs.h"
00038 #   include <GL/glu.h>
00039 #elif OGRE_PLATFORM == PLATFORM_LINUX
00040 #   include <GL/gl.h>
00041 #   include <GL/glu.h>
00042 #elif OGRE_PLATFORM == PLATFORM_APPLE
00043 #   include <OpenGL/gl.h>
00044 #   define GL_EXT_texture_env_combine 1
00045 #   include <OpenGL/glext.h>
00046 #   include <OpenGL/glu.h>
00047 #endif
00048 
00049 
00050 
00051 namespace Ogre {
00052 
00053     class SDLTexture : public Texture
00054     {
00055     public:
00056         // Constructor, called from SDLTextureManager
00057         SDLTexture( String name );
00058         virtual ~SDLTexture();        
00059         
00060         void load();
00061         void loadImage( const Image &img );
00062 
00063         void unload();
00064 
00065         void blitToTexture( const Image& src, 
00066             unsigned uStartX, unsigned uStartY );
00067 
00068         GLuint getGLID() const
00069         {
00070             return mTextureID;
00071         }
00072 
00073     protected:
00074         void generateMipMaps( uchar *data );
00075 
00076     private:
00077         GLuint mTextureID;
00078     };
00079 }
00080 
00081 #endif

Copyright © 2002 by The OGRE Team