PolyGLTexture.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /*
  2. * PolyGLTexture.h
  3. * TAU
  4. *
  5. * Created by Ivan Safrin on 3/16/08.
  6. * Copyright 2008 __MyCompanyName__. All rights reserved.
  7. *
  8. */
  9. // @package Renderer
  10. #pragma once
  11. #ifdef _WINDOWS
  12. #include <windows.h>
  13. #endif
  14. #include "PolyString.h"
  15. #include "PolyGlobals.h"
  16. #include "PolyTexture.h"
  17. #include "PolyGLRenderer.h"
  18. #if defined(__APPLE__) && defined(__MACH__)
  19. #include <OpenGL/gl.h>
  20. #include <OpenGL/glext.h>
  21. #include <OpenGL/glu.h>
  22. #else
  23. #include <GL/gl.h>
  24. #include <GL/glu.h>
  25. #endif
  26. namespace Polycode {
  27. class _PolyExport OpenGLTexture : public Texture {
  28. public:
  29. OpenGLTexture(unsigned int width, unsigned int height);
  30. OpenGLTexture(unsigned int width, unsigned int height, char *textureData, bool clamp, int filteringMode, int type);
  31. virtual ~OpenGLTexture();
  32. void recreateFromImageData();
  33. GLuint getTextureID();
  34. GLuint getFrameBufferID();
  35. void setGLInfo(GLuint textureID, GLuint frameBufferID);
  36. void setTextureData(char *data);
  37. private:
  38. bool glTextureLoaded;
  39. GLuint glTextureType;
  40. int filteringMode;
  41. GLuint textureID;
  42. GLuint frameBufferID;
  43. };
  44. }