OpenGL.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /**
  2. * Copyright (c) 2006-2012 LOVE Development Team
  3. *
  4. * This software is provided 'as-is', without any express or implied
  5. * warranty. In no event will the authors be held liable for any damages
  6. * arising from the use of this software.
  7. *
  8. * Permission is granted to anyone to use this software for any purpose,
  9. * including commercial applications, and to alter it and redistribute it
  10. * freely, subject to the following restrictions:
  11. *
  12. * 1. The origin of this software must not be misrepresented; you must not
  13. * claim that you wrote the original software. If you use this software
  14. * in a product, an acknowledgment in the product documentation would be
  15. * appreciated but is not required.
  16. * 2. Altered source versions must be plainly marked as such, and must not be
  17. * misrepresented as being the original software.
  18. * 3. This notice may not be removed or altered from any source distribution.
  19. **/
  20. #ifndef LOVE_GRAPHICS_OPENGL_OPENGL_H
  21. #define LOVE_GRAPHICS_OPENGL_OPENGL_H
  22. #include "GLee.h"
  23. namespace love
  24. {
  25. namespace graphics
  26. {
  27. namespace opengl
  28. {
  29. void initializeContext();
  30. void uninitializeContext();
  31. /**
  32. * Helper for setting the active texture unit
  33. *
  34. * @param textureunit The GL texture unit to set
  35. **/
  36. void setActiveTextureUnit(GLenum textureunit);
  37. /**
  38. * Helper for binding an OpenGL texture.
  39. * Makes sure we aren't redundantly binding textures.
  40. *
  41. * @param texture The texture to bind.
  42. **/
  43. void bindTexture(GLuint texture);
  44. /**
  45. * Helper for binding a texture to a specific texture unit
  46. *
  47. * @param texture The texture to bind
  48. * @param textureunit The texture unit to switch to
  49. * @param resoreprev Restore previous texture unit when done
  50. **/
  51. void bindTextureToUnit(GLuint texture, GLenum textureunit, bool restoreprev);
  52. /**
  53. * Helper for deleting an OpenGL texture.
  54. * Cleans up if the texture is currently bound.
  55. *
  56. * @param texture The texture to delete.
  57. **/
  58. void deleteTexture(GLuint texture);
  59. } // opengl
  60. } // graphics
  61. } // love
  62. #endif