PolyGLTexture.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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 "PolyGlobals.h"
  15. #include "PolyTexture.h"
  16. #include "PolyGLRenderer.h"
  17. #if defined(__APPLE__) && defined(__MACH__)
  18. #include <OpenGL/gl.h>
  19. #include <OpenGL/glext.h>
  20. #include <OpenGL/glu.h>
  21. #else
  22. #include <GL/gl.h>
  23. #include <GL/glu.h>
  24. #endif
  25. namespace Polycode {
  26. class _PolyExport OpenGLTexture : public Texture {
  27. public:
  28. OpenGLTexture(unsigned int width, unsigned int height);
  29. OpenGLTexture(unsigned int width, unsigned int height, char *textureData, bool clamp, int filteringMode, int type);
  30. virtual ~OpenGLTexture();
  31. void recreateFromImageData();
  32. GLuint getTextureID();
  33. GLuint getFrameBufferID();
  34. void setGLInfo(GLuint textureID, GLuint frameBufferID);
  35. void setTextureData(char *data);
  36. private:
  37. bool glTextureLoaded;
  38. GLuint glTextureType;
  39. int filteringMode;
  40. GLuint textureID;
  41. GLuint frameBufferID;
  42. };
  43. }