source: OGRE/trunk/ogrenew/RenderSystems/GL/include/OgreGLPixelFormat.h @ 657

Revision 657, 3.1 KB checked in by mattausch, 19 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4    (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2005 The OGRE Team
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23-----------------------------------------------------------------------------
24*/
25#ifndef __GLPIXELFORMAT_H__
26#define __GLPIXELFORMAT_H__
27
28#include "OgreGLPrerequisites.h"
29#include "OgrePixelFormat.h"
30namespace Ogre {
31        /**
32        * Class to do pixel format mapping between GL and OGRE
33        */
34        class GLPixelUtil {
35        public:
36                /** Takes the OGRE pixel format and returns the appropriate GL one
37                        @returns a GLenum describing the format, or 0 if there is no exactly matching
38                        one (and conversion is needed)
39                */
40                static GLenum getGLOriginFormat(PixelFormat mFormat);
41       
42                /** Takes the OGRE pixel format and returns type that must be provided
43                        to GL as data type for reading it into the GPU
44                        @returns a GLenum describing the data type, or 0 if there is no exactly matching
45                        one (and conversion is needed)
46                */
47                static GLenum getGLOriginDataType(PixelFormat mFormat);
48       
49                /**     Takes the OGRE pixel format and returns the type that must be provided
50                        to GL as internal format.
51                */
52                static GLenum getClosestGLInternalFormat(PixelFormat mFormat);
53               
54                /**     Function to get the closest matching OGRE format to an internal GL format. To be
55                        precise, the format will be chosen that is most efficient to transfer to the card
56                        without losing precision.
57                        @remarks It is valid for this function to always return PF_A8R8G8B8.
58                */
59                static PixelFormat getClosestOGREFormat(GLenum fmt);
60       
61                /** Returns the maximum number of Mipmaps that can be generated until we reach
62                        the mininum format possible. This does not count the base level.
63                        @param width
64                                The width of the area
65                        @param height
66                                The height of the area
67                        @param depth
68                                The depth of the area
69                        @param format
70                                The format of the area
71                        @remarks
72                                In case that the format is non-compressed, this simply returns
73                                how many times we can divide this texture in 2 until we reach 1x1.
74                                For compressed formats, constraints apply on minimum size and alignment
75                                so this might differ.
76                */
77                static size_t getMaxMipmaps(size_t width, size_t height, size_t depth, PixelFormat format);
78        };
79};
80
81#endif
Note: See TracBrowser for help on using the repository browser.