util_view.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. /*
  2. * Copyright 2011-2013 Blender Foundation
  3. *
  4. * Licensed under the Apache License, Version 2.0 (the "License");
  5. * you may not use this file except in compliance with the License.
  6. * You may obtain a copy of the License at
  7. *
  8. * http://www.apache.org/licenses/LICENSE-2.0
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #ifndef __UTIL_VIEW_H__
  17. #define __UTIL_VIEW_H__
  18. /* Functions to display a simple OpenGL window using GLUT, simplified to the
  19. * bare minimum we need to reduce boilerplate code in tests apps. */
  20. CCL_NAMESPACE_BEGIN
  21. typedef void (*ViewInitFunc)();
  22. typedef void (*ViewExitFunc)();
  23. typedef void (*ViewResizeFunc)(int width, int height);
  24. typedef void (*ViewDisplayFunc)();
  25. typedef void (*ViewKeyboardFunc)(unsigned char key);
  26. typedef void (*ViewMotionFunc)(int x, int y, int button);
  27. void view_main_loop(const char *title,
  28. int width,
  29. int height,
  30. ViewInitFunc initf,
  31. ViewExitFunc exitf,
  32. ViewResizeFunc resize,
  33. ViewDisplayFunc display,
  34. ViewKeyboardFunc keyboard,
  35. ViewMotionFunc motion);
  36. void view_display_info(const char *info);
  37. void view_display_help();
  38. void view_redraw();
  39. CCL_NAMESPACE_END
  40. #endif /*__UTIL_VIEW_H__*/