render_to_buffer.h 469 B

1234567891011121314151617
  1. #define GL_GLEXT_PROTOTYPES
  2. #include <GL/osmesa.h>
  3. // Inputs:
  4. // filename path to mesh
  5. // background background color
  6. // width width of image buffer
  7. // height height of image buffer
  8. // Outputs:
  9. // buffer width*height*4 buffer of bytes (should already be allocated) RGBA
  10. // Returns true only only upon success.
  11. bool render_to_buffer(
  12. const char * filename,
  13. const float *background_color,
  14. const int width,
  15. const int height,
  16. GLubyte * buffer);