zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Texture.cpp
Go to the documentation of this file.
1 /* This file is part of the Zenipex Library (zenilib).
2  * Copyright (C) 2011 Mitchell Keith Bloch (bazald).
3  *
4  * zenilib is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser 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.
8  *
9  * zenilib 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 Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public License
15  * along with zenilib. If not, see <http://www.gnu.org/licenses/>.
16  */
17 
18 #include <zeni_graphics.h>
19 
20 #include <iostream>
21 
22 #include <Zeni/GLU.h>
23 
24 #ifndef DISABLE_DX9
25 #include <d3dx9.h>
26 #endif
27 
28 #include <Zeni/Define.h>
29 
30 namespace Zeni {
31 
33  : Texture(false),
34  m_frame(0)
35  {
36  }
37 
38  Sprite::Sprite(const Sprite &rhs)
39  : Texture(false),
40  m_frames(rhs.m_frames),
41  m_frame(rhs.m_frame)
42  {
43  }
44 
46  Sprite lhs(rhs);
47  std::swap(lhs.m_frames, m_frames);
48  std::swap(lhs.m_frame, m_frame);
49  return *this;
50  }
51 
53  append_frame(name, get_Textures().get_id(name));
54  }
55 
56  void Sprite::append_frame(const String &name, const unsigned long &id) {
57  m_frames.push_back(std::make_pair(name, id));
58  }
59 
60  int Sprite::find_frame(const String &name, const int &starting_point) const {
61  if(starting_point < 0)
62  throw Frame_Out_of_Range();
63 
64  for(int i = starting_point, end = int(m_frames.size()); i < end; ++i)
65  if(m_frames[size_t(i)].first == name)
66  return i;
67  return -1;
68  }
69 
70  void Sprite::insert_frame(const String &name, const int &at_this_index) {
71  insert_frame(name, get_Textures().get_id(name), at_this_index);
72  }
73 
74  void Sprite::insert_frame(const String &name, const unsigned long &id, const int &at_this_index) {
75  std::pair<String, unsigned long> new_frame = std::make_pair(name, id);
76 
77  if(at_this_index < 0 || at_this_index > int(m_frames.size()))
78  throw Frame_Out_of_Range();
79 
80  m_frames.push_back(new_frame);
81 
82  memmove(
83  &m_frames + at_this_index + 1,
84  &m_frames + at_this_index,
85  (m_frames.size() - at_this_index - 1) * sizeof(std::pair<String, unsigned long>));
86 
87  m_frames[size_t(at_this_index)] = new_frame;
88  }
89 
90  void Sprite::remove_frame(const int &frame_number) {
91  if(frame_number < 0 || frame_number > int(m_frames.size()))
92  throw Frame_Out_of_Range();
93 
94  memmove(
95  &m_frames + frame_number,
96  &m_frames + frame_number + 1,
97  (m_frames.size() - frame_number - 1) * sizeof(std::pair<String, unsigned long>));
98 
99  m_frames.pop_back();
100  }
101 
103  return int(m_frames.size());
104  }
105 
107  if(m_frames.empty())
108  return -1;
109  return m_frame;
110  }
111 
112  void Sprite::set_current_frame(const int &frame_number) {
113  if(frame_number < 0 || frame_number > int(m_frames.size()))
114  throw Frame_Out_of_Range();
115 
116  m_frame = frame_number;
117  }
118 
119  void Sprite::apply_Texture() const {
120  static bool no_recurse = true;
121 
122  if(no_recurse)
123  no_recurse = false;
124  else
125  throw Sprite_Containing_Sprite();
126 
127  if(m_frames.empty() || m_frame < 0 || m_frame >= int(m_frames.size()))
128  throw Frame_Out_of_Range();
129 
130  try {
131  get_Textures().apply_Texture(m_frames[size_t(m_frame)].second);
132  }
133  catch(Database_Entry_Not_Found &) {
134  try {
135  m_frames[size_t(m_frame)].second = get_Textures().get_id(m_frames[size_t(m_frame)].first);
136  get_Textures().apply_Texture(m_frames[size_t(m_frame)].second);
137  }
138  catch(...) {
139  no_recurse = true;
140  throw;
141  }
142  }
143  catch(...) {
144  no_recurse = true;
145  throw;
146  }
147  no_recurse = true;
148  }
149 
150 #ifndef DISABLE_GL
151  Texture_GL::Texture_GL(const String &filename, const bool &repeat, const bool &lazy_loading)
152  : Texture(repeat),
153  m_texture_id(0),
154  m_render_buffer(0),
155  m_frame_buffer_object(0),
156  m_filename(filename)
157  {
158  if(!lazy_loading)
159  load(m_filename, m_repeat);
160  }
161 
162  Texture_GL::Texture_GL(const Image &image)
163  : Texture(image.tileable()),
164  m_size(Point2i(image.width(), image.height())),
165  m_texture_id(build_from_Image(image)),
166  m_render_buffer(0),
167  m_frame_buffer_object(0)
168 #ifdef TEMP_DISABLE
169  , m_filename(1, '\0')
170 #endif
171  {
172  }
173 
174  Texture_GL::Texture_GL(const Point2i &size, const bool &repeat)
175  : Texture(repeat),
176  m_size(size),
177  m_texture_id(build_from_Image(Image(size, Image::RGBA, repeat))),
178  m_render_buffer(0),
179  m_frame_buffer_object(0)
180 #ifdef TEMP_DISABLE
181  , m_filename(1, '\0')
182 #endif
183  {
184  }
185 
187  if(m_render_buffer)
188 #ifdef REQUIRE_GL_ES
189  glDeleteBuffers(1, &m_render_buffer);
190 #else
191  glDeleteRenderbuffersEXT(1, &m_render_buffer);
192 #endif
193  if(m_frame_buffer_object)
194 #ifdef REQUIRE_GL_ES
195  glDeleteBuffers(1, &m_frame_buffer_object);
196 #else
197  glDeleteFramebuffersEXT(1, &m_frame_buffer_object);
198 #endif
199 
200  if(m_texture_id)
201  glDeleteTextures(1, &m_texture_id);
202  }
203 
205  if(!m_texture_id)
206  load(m_filename, m_repeat);
207 
209 
210  glBindTexture(GL_TEXTURE_2D, m_texture_id);
211 
213  }
214 
215  GLuint Texture_GL::build_from_Image(const Image &image) {
216  GLuint texture_id = 0;
217 
218  const GLenum format =
221  image.color_space() == Image::RGB ? GL_RGB :
222  GL_RGBA;
223 
224  int bit_count = 0;
225  for(int bit = 1; bit; bit <<= 1)
226  bit_count += ((image.width() & bit) != 0) + ((image.height() & bit) != 0);
227  if(bit_count != 2) {
228  ZENI_LOGE("Dimensions of textures must be powers of 2.");
229  throw Texture_Init_Failure();
230  }
231 
232  glGenTextures(1, &texture_id);
233  if(!texture_id) {
234  ZENI_LOGE("glGenTextures(...) failed.");
235  throw Texture_Init_Failure();
236  }
237 
238  glBindTexture(GL_TEXTURE_2D, texture_id);
239 
242 
243  if(glGetError() == GL_INVALID_ENUM) {
244  static bool printed = false;
245  if(!printed) {
246  ZENI_LOGW("Quality Warning: Your graphics card does not support GL_CLAMP_TO_EDGE in OpenGL.");
247  printed = true;
248  }
249  }
250 
252 
257 
258 #ifndef REQUIRE_GL_ES
260  if(Textures::get_anisotropic_filtering() < 0 || Textures::get_anisotropic_filtering() > get_Video().get_maximum_anisotropy())
262 
264  }
265 #endif
266 
267  /*
268  glHint(GL_POINT_SMOOTH_HINT, GL_NICEST);
269  glHint(GL_LINE_SMOOTH_HINT, GL_NICEST);
270  glHint(GL_POLYGON_SMOOTH_HINT, GL_NICEST);
271  glHint(GL_FOG_HINT, GL_NICEST);
272  */
274 
275  if(
276 #ifndef REQUIRE_GL_ES
278 #endif
280  {
282  }
283 #ifndef REQUIRE_GL_ES
285 #endif
286  {
287  glTexImage2D(GL_TEXTURE_2D, 0, format, image.width(), image.height(), 0, format, GL_UNSIGNED_BYTE, static_cast<const GLvoid *>(image.get_data()));
288  }
289 #ifndef REQUIRE_GL_ES
290  else {
291  Zeni::gluBuild2DMipmaps(GL_TEXTURE_2D, format, image.width(), image.height(), format, GL_UNSIGNED_BYTE, static_cast<const GLvoid *>(image.get_data()));
292  }
293 #endif
294 
295  return texture_id;
296  }
297 
298  void Texture_GL::load(const String &filename, const bool &repeat) const {
299  Image image(filename, repeat);
300 
301  m_size.x = image.width();
302  m_size.y = image.height();
303 
304  m_texture_id = build_from_Image(image);
305  }
306 
307 #endif
308 
309 #ifndef TEMP_DISABLE
310 #ifndef DISABLE_DX9
311  Texture_DX9::Texture_DX9(const String &filename, const bool &repeat)
312  : Texture(repeat),
313  m_texture(0),
314  m_render_to_surface(0)
315  {
316  load(filename);
317  }
318 
319  Texture_DX9::Texture_DX9(const Image &image)
320  : Texture(image.tileable()),
321  m_size(image.size()),
322  m_texture(build_from_Image(image)),
323  m_render_to_surface(0)
324  {
325  }
326 
327  Texture_DX9::Texture_DX9(const Point2i &size, const bool &repeat)
328  : Texture(repeat),
329  m_size(size),
330  m_texture(0),
331  m_render_to_surface(0)
332  {
333  Video_DX9 &vr = static_cast<Video_DX9 &>(get_Video());
334 
335  set_sampler_states(true);
336 
338  UINT(size.x), UINT(size.y),
339  D3DX_DEFAULT,
343  &m_texture)))
344  {
345  throw Texture_Init_Failure();
346  }
347 
349  UINT(size.x), UINT(size.y),
351  true,
352  D3DFMT_D16,
353  &m_render_to_surface)))
354  {
355  if(m_texture)
356  m_texture->Release();
357 
358  throw Texture_Init_Failure();
359  }
360  }
361 
363  if(m_render_to_surface)
364  m_render_to_surface->Release();
365 
366  if(m_texture)
367  m_texture->Release();
368  }
369 
371  Video_DX9 &vdx = static_cast<Video_DX9 &>(get_Video());
372 
374  vdx.get_d3d_device()->SetSamplerState(0, D3DSAMP_ADDRESSV, m_repeat ? D3DTADDRESS_WRAP : D3DTADDRESS_CLAMP);
375 
376  vdx.get_d3d_device()->SetTexture(0, m_texture);
377 
378  if(vdx.get_lighting()) {
379  vdx.get_d3d_device()->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_DIFFUSE);
380  vdx.get_d3d_device()->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_DIFFUSE);
381  }
382  else {
383  vdx.get_d3d_device()->SetTextureStageState(0, D3DTSS_COLORARG1, D3DTA_TFACTOR);
384  vdx.get_d3d_device()->SetTextureStageState(0, D3DTSS_ALPHAARG1, D3DTA_TFACTOR);
385  }
386 
387  vdx.get_d3d_device()->SetTextureStageState(0, D3DTSS_COLOROP, D3DTOP_MODULATE);
388  vdx.get_d3d_device()->SetTextureStageState(0, D3DTSS_ALPHAOP, D3DTOP_MODULATE);
389  }
390 
391  void Texture_DX9::set_sampler_states(const bool &disable_mipmapping) {
392  Video_DX9 &vr = static_cast<Video_DX9 &>(get_Video());
393 
397 
398  vr.get_d3d_device()->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_ANISOTROPIC);
399  vr.get_d3d_device()->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_ANISOTROPIC);
401  }
403  vr.get_d3d_device()->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_LINEAR);
404  vr.get_d3d_device()->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR);
405  }
406  else {
407  vr.get_d3d_device()->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_POINT);
408  vr.get_d3d_device()->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_POINT);
409  }
410 
411  vr.get_d3d_device()->SetSamplerState(0, D3DSAMP_MIPFILTER, (!disable_mipmapping && Textures::get_mipmapping() ? D3DTEXF_LINEAR : D3DTEXF_NONE));
412  }
413 
414  IDirect3DTexture9 * Texture_DX9::build_from_Image(const Image &image) {
415  Video_DX9 &vdx = dynamic_cast<Video_DX9 &>(get_Video());
416 
417  IDirect3DTexture9 * ppTexture;
418 
420  switch(image.color_space()) {
421  case Image::Luminance:
422  format = D3DFMT_L8;
423  break;
424 
426  format = D3DFMT_A8B8G8R8;
427  break;
428 
429  case Image::RGB:
430  format = D3DFMT_A8B8G8R8;
431  break;
432 
433  case Image::RGBA:
434  format = D3DFMT_A8B8G8R8;
435  break;
436 
437  default:
438  format = D3DFMT_UNKNOWN;
439  abort();
440  }
441 
442  set_sampler_states();
443 
444  if(FAILED(Video_DX9::D3DXCreateTexture()(vdx.get_d3d_device(),
445  UINT(image.width()), UINT(image.height()),
446  D3DX_DEFAULT,
447  0,
448  format,
450  &ppTexture)))
451  throw Texture_Init_Failure();
452 
453  D3DLOCKED_RECT rect;
454  if(FAILED(ppTexture->LockRect(0, &rect, 0, 0))) {
455  ppTexture->Release();
456  throw Texture_Init_Failure();
457  }
458 
459  if(image.color_space() == Image::Luminance) {
460  memcpy(rect.pBits, image.get_data(), image.width() * image.height());
461  }
462  else if(image.color_space() == Image::Luminance_Alpha) {
463  Uint8 * dest = reinterpret_cast<Uint8 *>(rect.pBits);
464  const Uint8 * src = image.get_data();
465  for(Uint8 * const dest_end = dest + image.width() * image.height() * 4; dest != dest_end; dest += 4, src += 2) {
466  dest[0] = src[0];
467  dest[1] = src[0];
468  dest[2] = src[0];
469  dest[3] = src[1];
470  }
471  }
472  else if(image.color_space() == Image::RGB) {
473  Uint8 * dest = reinterpret_cast<Uint8 *>(rect.pBits);
474  const Uint8 * src = image.get_data();
475  for(Uint8 * const dest_end = dest + image.width() * image.height() * 4; dest != dest_end; dest += 4, src += 3) {
476  dest[0] = src[2];
477  dest[1] = src[1];
478  dest[2] = src[0];
479  dest[3] = 0xFF;
480  }
481  }
482  else /*if(image.color_space() == Image::RGBA)*/ {
483  Uint8 * dest = reinterpret_cast<Uint8 *>(rect.pBits);
484  const Uint8 * src = image.get_data();
485  for(Uint8 * const dest_end = dest + image.width() * image.height() * 4; dest != dest_end; dest += 4, src += 4) {
486  dest[0] = src[2];
487  dest[1] = src[1];
488  dest[2] = src[0];
489  dest[3] = src[3];
490  }
491  }
492 
493  if(FAILED(ppTexture->UnlockRect(0))) {
494  ppTexture->Release();
495  throw Texture_Init_Failure();
496  }
497 
498  if(FAILED(Video_DX9::D3DXFilterTexture()(ppTexture, 0, D3DX_DEFAULT, D3DX_DEFAULT))) {
499  ppTexture->Release();
500  throw Texture_Init_Failure();
501  }
502 
503  return ppTexture;
504  }
505 
506  void Texture_DX9::load(const String &filename) const {
507  //Video_DX9 &vr = reinterpret_cast<Video_DX9 &>(get_Video());
508 
509  //set_sampler_states();
510 
511  //if(FAILED(D3DXCreateTextureFromFile(vr.get_d3d_device(), filename.c_str(), &m_texture)))
512  // throw Texture_Init_Failure();
513 
514  Image image(filename);
515 
516  m_texture = build_from_Image(image);
517  m_size = image.size();
518  }
519 #endif
520 #endif
521 
522 }
523 
524 #include <Zeni/Undefine.h>
#define glHint
Definition: gl_mangle.h:918
#define GL_NICEST
Definition: gl2.h:229
#define glTexParameteri
Definition: gl_mangle.h:1763
#define GL_TRUE
Definition: gl2.h:51
#define GLEW_VERSION_1_4
Definition: glew.h:1602
#define GL_LINEAR_MIPMAP_LINEAR
Definition: gl2.h:316
Definition: Database.h:142
#define GL_LUMINANCE_ALPHA
Definition: gl2.h:250
The Direct3D9 Rendering System.
Definition: Video_DX9.h:62
#define GL_MODULATE
Definition: glew_head.h:620
GLint gluBuild2DMipmaps(GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data)
Definition: GLU.cpp:22
#define GL_TEXTURE_ENV_MODE
Definition: glew_head.h:622
LPDIRECT3DDEVICE9 & get_d3d_device()
See DirectX Documentation for details.
Definition: Video_DX9.hxx:48
void insert_frame(const String &name, const int &at_this_index)
Insert a frame.
Definition: Texture.cpp:70
#define GL_CLAMP_TO_EDGE
Definition: gl2.h:375
unsigned int GLenum
Definition: gl2.h:23
friend class Video_DX9
Definition: Texture.h:149
#define D3DUSAGE_AUTOGENMIPMAP
Definition: d3d9types.h:1596
#define GL_TEXTURE_2D
Definition: gl2.h:145
static bool get_lighting()
Determine whether dynamic lighting is enabled.
Definition: Video.hxx:41
#define memmove
Definition: SDL_qsort.c:81
static int get_anisotropic_filtering()
Check the current level of anisotropy.
Definition: Textures.hxx:40
const Uint8 * get_data() const
Get access to the raw image data.
Definition: Image.hxx:29
#define glTexEnvf
Definition: gl_mangle.h:1741
unsigned long get_id(const String &name) const
Get an id by name, possibly throwing an Error.
Definition: Database.hxx:172
EGLSurface EGLint EGLint EGLint EGLint height
Definition: eglext.h:293
#define GL_LUMINANCE
Definition: gl2.h:249
#define GL_RGB
Definition: gl2.h:247
EGLImageKHR EGLint * name
Definition: eglext.h:284
#define GL_TEXTURE_MAG_FILTER
Definition: gl2.h:319
bool tileable() const
Determine if the given Image is tileable.
Definition: Image.hxx:49
typedef UINT(WINAPI *PFNWGLGETCONTEXTGPUIDAMDPROC)(HGLRC hglrc)
#define glTexImage2D
Definition: gl_mangle.h:1753
#define glDeleteFramebuffersEXT
Definition: glew.h:9002
Image.
Definition: Image.h:52
#define GL_REPEAT
Definition: gl2.h:374
Sprite & operator=(const Sprite &rhs)
Definition: Texture.cpp:45
EGLImageKHR image
Definition: eglext.h:88
virtual ~Texture_GL()
Definition: Texture.cpp:186
void ZENI_LOGW(const Zeni::String &str)
Definition: Android.h:56
#define GL_PERSPECTIVE_CORRECTION_HINT
Definition: glew_head.h:417
#define D3DX_DEFAULT
Definition: d3dx9.h:21
enum _D3DFORMAT D3DFORMAT
An Abstraction of a Texture.
Definition: Texture.h:61
void set_current_frame(const int &frame_number)
Set this frame.
Definition: Texture.cpp:112
#define D3DUSAGE_RENDERTARGET
Definition: d3d9types.h:1580
GLint first
Definition: gl2ext.h:1011
#define GL_TEXTURE_MIN_FILTER
Definition: gl2.h:320
#define GL_TEXTURE_ENV
Definition: glew_head.h:624
virtual ~Texture_DX9()
Definition: Texture.cpp:362
int
Definition: SDL_systhread.c:37
virtual void apply_Texture() const
Apply the current Texture frame to upcoming polygons.
Definition: Texture.cpp:119
int find_frame(const String &name, const int &starting_point=0) const
Search for a frame.
Definition: Texture.cpp:60
EGLSurface EGLint EGLint EGLint width
Definition: eglext.h:293
int get_maximum_anisotropy() const
Get the current level of anisotrophy.
Definition: Video_DX9.cpp:254
#define glEnable
Definition: gl_mangle.h:441
#define glDeleteTextures
Definition: gl_mangle.h:371
void append_frame(const String &name)
Add a frame to the Sprite.
Definition: Texture.cpp:52
#define glGenTextures
Definition: gl_mangle.h:575
static D3DXCreateRenderToSurface_fcn D3DXCreateRenderToSurface()
Definition: Video_DX9.h:114
#define GL_TEXTURE_MAX_ANISOTROPY_EXT
Definition: gl2ext.h:405
#define glDeleteRenderbuffersEXT
Definition: glew.h:9003
Color_Space color_space() const
Determine the Color_Space of the raw image data.
Definition: Image.hxx:25
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum format
Definition: gl2ext.h:845
#define D3DTA_TFACTOR
Definition: d3d9types.h:618
#define GL_GENERATE_MIPMAP
Definition: glew.h:1474
void remove_frame(const int &frame_number)
Remove a frame.
Definition: Texture.cpp:90
static D3DXCreateTexture_fcn D3DXCreateTexture()
Definition: Video_DX9.h:115
static D3DXFilterTexture_fcn D3DXFilterTexture()
Definition: Video_DX9.h:116
void ZENI_LOGE(const Zeni::String &str)
Definition: Android.h:59
#define GL_LINEAR
Definition: gl2.h:308
Textures & get_Textures()
Get access to the singleton.
Definition: Textures.cpp:64
#define GL_INVALID_ENUM
Definition: gl2.h:158
#define GL_RGBA
Definition: gl2.h:248
void apply_Texture(const String &name)
Apply a texture for upcoming polygons (Called by Video::apply_Texture)
Definition: Textures.cpp:68
#define glGetError
Definition: gl_mangle.h:643
int width() const
Get the number of pixels in the image in the x-direction.
Definition: Image.hxx:41
unsigned int GLuint
Definition: gl2.h:32
int get_current_frame() const
Get the currently selected frame number.
Definition: Texture.cpp:106
virtual void apply_Texture() const
Apply a Texture to upcoming polygons.
Definition: Texture.cpp:204
void swap(Zeni::String &lhs, Zeni::String &rhs)
Definition: String.cpp:578
#define memcpy
Definition: SDL_malloc.c:634
#define GL_TEXTURE_WRAP_T
Definition: gl2.h:322
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:129
typedef DWORD(WINAPI *XInputGetState_t)(DWORD dwUserIndex
#define GL_UNSIGNED_BYTE
Definition: gl2.h:236
#define GL_TEXTURE_WRAP_S
Definition: gl2.h:321
int get_num_frames() const
Get the number of frames.
Definition: Texture.cpp:102
int height() const
Get the number of pixels in the image in the y-direction.
Definition: Image.hxx:45
interface IDirect3DTexture9 IDirect3DTexture9
Definition: d3d9.h:264
const bool m_repeat
Definition: Texture.h:74
GLuint GLuint end
Definition: glew.h:1239
static void set_texturing_mode(const int &anisotropic_filtering_, const bool &bilinear_filtering_, const bool &mipmapping_)
Check to see if Textures is set to use lazy loading if possible.
Definition: Textures.cpp:104
#define glBindTexture
Definition: gl_mangle.h:98
Video & get_Video()
Get access to the singleton.
Definition: Video.cpp:149
void GLvoid
Definition: gl2.h:21
GLenum src
Definition: glew.h:2396
static bool get_mipmapping()
Check if mipmapping is in use.
Definition: Textures.hxx:32
int i
Definition: pngrutil.c:1377
#define D3DTA_DIFFUSE
Definition: d3d9types.h:615
static bool get_bilinear_filtering()
Check if bilinear filtering is in use.
Definition: Textures.hxx:28
GL_APICALL void GL_APIENTRY glDeleteBuffers(GLsizei n, const GLuint *buffers)
virtual void apply_Texture() const
Apply a Texture to upcoming polygons.
Definition: Texture.cpp:370
#define GL_NEAREST_MIPMAP_NEAREST
Definition: gl2.h:313
#define false
Definition: ftrandom.c:50
#define GL_NEAREST
Definition: gl2.h:307
unsigned int size_t
GLsizei size
Definition: gl2ext.h:1467
A 2D Point represented with integers.
Definition: Coordinate.h:85