No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

60 líneas
1.1 KiB

  1. //
  2. // Lol Engine
  3. //
  4. // Copyright: (c) 2010-2013 Sam Hocevar <sam@hocevar.net>
  5. // This program is free software; you can redistribute it and/or
  6. // modify it under the terms of the Do What The Fuck You Want To
  7. // Public License, Version 2, as published by Sam Hocevar. See
  8. // http://www.wtfpl.net/ for more details.
  9. //
  10. //
  11. // The Texture class
  12. // -----------------
  13. //
  14. #if !defined __LOL_TEXTURE_H__
  15. #define __LOL_TEXTURE_H__
  16. namespace lol
  17. {
  18. struct PixelFormat
  19. {
  20. /* XXX: make sure to update texture.cpp when this changes */
  21. enum Value
  22. {
  23. Unknown = 0,
  24. RGB_8,
  25. ARGB_8,
  26. ABGR_8,
  27. Y_8,
  28. }
  29. m_value;
  30. inline PixelFormat() : m_value(Unknown) {}
  31. inline PixelFormat(Value v) : m_value(v) {}
  32. inline operator Value() { return m_value; }
  33. };
  34. class Texture
  35. {
  36. public:
  37. Texture(ivec2 size, PixelFormat format);
  38. ~Texture();
  39. void Bind();
  40. void SetData(void *data);
  41. void SetSubData(ivec2 origin, ivec2 size, void *data);
  42. ShaderTexture GetTexture() const;
  43. private:
  44. class TextureData *m_data;
  45. };
  46. } /* namespace lol */
  47. #endif // __LOL_TEXTURE_H__