Home | History | Annotate | Download | only in opengl
      1 #ifndef _GLUSTRUTIL_HPP
      2 #define _GLUSTRUTIL_HPP
      3 /*-------------------------------------------------------------------------
      4  * drawElements Quality Program OpenGL ES Utilities
      5  * ------------------------------------------------
      6  *
      7  * Copyright 2014 The Android Open Source Project
      8  *
      9  * Licensed under the Apache License, Version 2.0 (the "License");
     10  * you may not use this file except in compliance with the License.
     11  * You may obtain a copy of the License at
     12  *
     13  *      http://www.apache.org/licenses/LICENSE-2.0
     14  *
     15  * Unless required by applicable law or agreed to in writing, software
     16  * distributed under the License is distributed on an "AS IS" BASIS,
     17  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     18  * See the License for the specific language governing permissions and
     19  * limitations under the License.
     20  *
     21  *//*!
     22  * \file
     23  * \brief OpenGL value to string utilities.
     24  *//*--------------------------------------------------------------------*/
     25 
     26 #include "gluDefs.hpp"
     27 #include "gluRenderContext.hpp"
     28 #include "tcuFormatUtil.hpp"
     29 
     30 namespace glu
     31 {
     32 
     33 // Internal format utilities.
     34 namespace detail
     35 {
     36 
     37 class EnumPointerFmt
     38 {
     39 public:
     40 	typedef const char* (*GetEnumNameFunc) (int value);
     41 
     42 	const deUint32*		value;
     43 	deUint32			size;
     44 	GetEnumNameFunc		getName;
     45 
     46 	EnumPointerFmt (const deUint32* value_, deUint32 size_, GetEnumNameFunc getName_) : value(value_), size(size_), getName(getName_) {}
     47 };
     48 
     49 class TextureUnitStr
     50 {
     51 public:
     52 	deUint32 texUnit;
     53 	TextureUnitStr (deUint32 texUnit_) : texUnit(texUnit_) {}
     54 };
     55 
     56 class TextureParameterValueStr
     57 {
     58 public:
     59 	deUint32	param;
     60 	int			value;
     61 	TextureParameterValueStr (deUint32 param_, int value_) : param(param_), value(value_) {}
     62 };
     63 
     64 std::ostream&		operator<<		(std::ostream& str, TextureUnitStr unitStr);
     65 std::ostream&		operator<<		(std::ostream& str, const TextureParameterValueStr& valueStr);
     66 std::ostream&		operator<<		(std::ostream& str, EnumPointerFmt fmt);
     67 
     68 } // detail
     69 
     70 inline detail::TextureUnitStr			getTextureUnitStr			(deUint32 unit) { return detail::TextureUnitStr(unit); }
     71 inline detail::TextureParameterValueStr	getTextureParameterValueStr	(deUint32 param, int value) { return detail::TextureParameterValueStr(param, value); }
     72 detail::EnumPointerFmt					getInvalidateAttachmentStr	(const deUint32* attachments, int numAttachments);
     73 
     74 std::ostream&							operator<<					(std::ostream& str, ApiType apiType);
     75 std::ostream&							operator<<					(std::ostream& str, ContextType contextType);
     76 
     77 #include "gluStrUtilPrototypes.inl"
     78 
     79 } // glu
     80 
     81 #endif // _GLUSTRUTIL_HPP
     82