init_render_to_texture.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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_OPENGL_INIT_RENDER_TO_TEXTURE_H
  9. #define IGL_OPENGL_INIT_RENDER_TO_TEXTURE_H
  10. #include "../igl_inline.h"
  11. #include "OpenGL_convenience.h"
  12. #include <cstdlib>
  13. namespace igl
  14. {
  15. namespace opengl
  16. {
  17. // Create a texture+framebuffer+depthbuffer triplet bound for rendering into
  18. // the texture;
  19. //
  20. // Inputs:
  21. // width image width
  22. // height image height
  23. // Outputs:
  24. // tex_id id of the texture
  25. // fbo_id id of the frame buffer object
  26. // dfbo_id id of the depth frame buffer object
  27. IGL_INLINE void init_render_to_texture(
  28. const size_t width,
  29. const size_t height,
  30. GLuint & tex_id,
  31. GLuint & fbo_id,
  32. GLuint & dfbo_id);
  33. }
  34. }
  35. #ifndef IGL_STATIC_LIBRARY
  36. # include "init_render_to_texture.cpp"
  37. #endif
  38. #endif