tinyOsxGraphicsPipe.h 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file tinyOsxGraphicsPipe.h
  10. * @author drose
  11. * @date 2008-05-12
  12. */
  13. #ifndef TINYOSXGRAPHICSPIPE_H
  14. #define TINYOSXGRAPHICSPIPE_H
  15. #include "pandabase.h"
  16. #if defined(IS_OSX) && !defined(BUILD_IPHONE) && defined(HAVE_CARBON) && !__LP64__
  17. // We have to include this early, before anyone includes netinettcp.h, which
  18. // will define TCP_NODELAY and other symbols and confuse the Apple system
  19. // headers.
  20. #include <Carbon/Carbon.h>
  21. #include "graphicsPipe.h"
  22. #include "tinyGraphicsStateGuardian.h"
  23. /**
  24. * This graphics pipe represents the interface for creating TinyPanda graphics
  25. * windows on a Mac client.
  26. */
  27. class EXPCL_TINYDISPLAY TinyOsxGraphicsPipe : public GraphicsPipe {
  28. public:
  29. TinyOsxGraphicsPipe();
  30. virtual ~TinyOsxGraphicsPipe();
  31. virtual std::string get_interface_name() const;
  32. static PT(GraphicsPipe) pipe_constructor();
  33. static CGImageRef create_cg_image(const PNMImage &pnm_image);
  34. private:
  35. static void release_data(void *info, const void *data, size_t size);
  36. protected:
  37. virtual PT(GraphicsOutput) make_output(const std::string &name,
  38. const FrameBufferProperties &fb_prop,
  39. const WindowProperties &win_prop,
  40. int flags,
  41. GraphicsEngine *engine,
  42. GraphicsStateGuardian *gsg,
  43. GraphicsOutput *host,
  44. int retry,
  45. bool &precertify);
  46. public:
  47. static TypeHandle get_class_type() {
  48. return _type_handle;
  49. }
  50. static void init_type() {
  51. GraphicsPipe::init_type();
  52. register_type(_type_handle, "TinyOsxGraphicsPipe",
  53. GraphicsPipe::get_class_type());
  54. }
  55. virtual TypeHandle get_type() const {
  56. return get_class_type();
  57. }
  58. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  59. private:
  60. static TypeHandle _type_handle;
  61. };
  62. #include "tinyOsxGraphicsPipe.I"
  63. #endif // IS_OSX
  64. #endif