1 /************************************************************************
2 This file is part of NE.
4 NE is free software: you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation, either version 3 of the License, or
7 (at your option) any later version.
9 NE is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with NE. If not, see <http://www.gnu.org/licenses/>.
16 ************************************************************************/
38 struct texture
*t_create();
40 void t_destroy(struct texture
*t
);
42 int t_ready(struct texture
*t
);
44 void t_load(struct texture
*t
, const char *filename
);
46 void t_unload(struct texture
*t
);
48 void t_apply(struct texture
*t
);
52 void t_set(struct texture
*t
, GLuint name
, GLuint value
);
54 struct texture
*t_screenshot();
63 Texture(const char *file
= 0, bool mipmap
=true)
75 m_tex
->gl_handle
= texid
;
83 static Texture
*Screenshot()
85 Texture
*t
= new Texture();
86 t
->m_tex
= t_screenshot();
95 inline int getHeight()
110 inline GLuint
getHandle()
112 return m_tex
->gl_handle
;
115 inline bool isReady()
117 return (m_tex
&& t_ready(m_tex
));
120 inline void set(GLuint name
, GLuint value
)
122 t_set(m_tex
,name
,value
);
125 inline void load(const char *file
, bool mipmap
=true)
146 struct texture
*m_tex
;
151 #endif /*TEXTURE_H_*/