00001 /*************************************************************************** 00002 gltexcoord.h - description 00003 ------------------- 00004 begin : Thu May 22 2003 00005 copyright : (C) 2003 by Jacques Gasselin de Richebourg 00006 email : jacquesgasselin@hotmail.com 00007 ***************************************************************************/ 00008 00009 /*************************************************************************** 00010 * * 00011 * This program is free software; you can redistribute it and/or modify * 00012 * it under the terms of the GNU Lesser General Public License as published by * 00013 * the Free Software Foundation; either version 2 of the License, or * 00014 * (at your option) any later version. * 00015 * * 00016 * This library is distributed in the hope that it will be useful, * 00017 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00018 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00019 * Lesser General Public License for more details. * 00020 * * 00021 * You should have received a copy of the GNU Lesser General Public * 00022 * License along with this library; if not, write to the Free Software * 00023 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * 00024 * * 00025 ***************************************************************************/ 00026 00027 #ifndef GLTEXCOORD_H 00028 #define GLTEXCOORD_H 00029 00030 00031 #include <GL/gl.h> 00032 #include <iostream> 00033 00038 class GLTexCoord 00039 { 00040 GLfloat uv[2]; 00041 public: 00042 static char tag[20]; 00043 00044 GLTexCoord(GLfloat u, GLfloat v); 00045 ~GLTexCoord(); 00046 00047 inline const GLfloat* get() const { return uv; } 00048 00049 inline const GLfloat getU() const { return uv[0]; } 00050 inline const GLfloat getV() const { return uv[1]; } 00051 00052 inline void setU(GLfloat u) { uv[0] = u; } 00053 inline void setV(GLfloat v) { uv[1] = v; } 00054 00055 inline void set(GLfloat u, GLfloat v); 00056 inline void set(GLfloat* _uv); 00057 inline void glTexCoord() const { glTexCoord2fv(uv); } 00058 00059 void saveToStream(std::ostream& out); 00060 00061 }; 00062 00063 #endif