init_render_to_texture.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. // This file is part of libigl, a simple c++ geometry processing library.
  2. //
  3. // Copyright (C) 2015 Alec Jacobson <alecjacobson@gmail.com>
  4. //
  5. // This Source Code Form is subject to the terms of the Mozilla Public License
  6. // v. 2.0. If a copy of the MPL was not distributed with this file, You can
  7. // obtain one at http://mozilla.org/MPL/2.0/.
  8. #ifndef IGL_INIT_RENDER_TO_TEXTURE_H
  9. #define IGL_INIT_RENDER_TO_TEXTURE_H
  10. #include "igl_inline.h"
  11. #include "OpenGL_convenience.h"
  12. #include <cstdlib>
  13. namespace igl
  14. {
  15. #ifndef IGL_NO_OPENGL
  16. // Create a texture+framebuffer+depthbuffer triplet bound for rendering into
  17. // the texture;
  18. //
  19. // Inputs:
  20. // width image width
  21. // height image height
  22. // Outputs:
  23. // tex_id id of the texture
  24. // fbo_id id of the frame buffer object
  25. // dfbo_id id of the depth frame buffer object
  26. IGL_INLINE void init_render_to_texture(
  27. const size_t width,
  28. const size_t height,
  29. GLuint & tex_id,
  30. GLuint & fbo_id,
  31. GLuint & dfbo_id);
  32. #endif
  33. }
  34. #ifndef IGL_STATIC_LIBRARY
  35. # include "init_render_to_texture.cpp"
  36. #endif
  37. #endif