Panda3D
 All Classes Functions Variables Enumerations
osxGraphicsBuffer.h
1 ////////////////////////////////////////////////////////////////////
2 //
3 // PANDA 3D SOFTWARE
4 // Copyright (c) Carnegie Mellon University. All rights reserved.
5 //
6 // All use of this software is subject to the terms of the revised BSD
7 // license. You should have received a copy of this license along
8 // with this source code in a file named "LICENSE."
9 //
10 ////////////////////////////////////////////////////////////////////
11 
12 #ifndef OSXGRAPHICSBUFFER_H
13 #define OSXGRAPHICSBUFFER_H
14 #include <Carbon/Carbon.h>
15 
16 #define __glext_h_
17 #include <OpenGL/gl.h>
18 #include <AGL/agl.h>
19 
20 #include "pandabase.h"
21 #include "graphicsBuffer.h"
22 #include "glgsg.h"
23 
24 ////////////////////////////////////////////////////////////////////
25 // Class : osxGraphicsBuffer
26 // Description : An offscreen buffer in the OSX environment. This
27 // creates an AGLPbuffer.
28 ////////////////////////////////////////////////////////////////////
30 public:
32  const string &name,
33  const FrameBufferProperties &fb_prop,
34  const WindowProperties &win_prop,
35  int flags,
37  GraphicsOutput *host);
38  virtual ~osxGraphicsBuffer();
39 
40  virtual bool begin_frame(FrameMode mode, Thread *current_thread);
41  virtual void end_frame(FrameMode mode, Thread *current_thread);
42 
43 protected:
44  virtual void close_buffer();
45  virtual bool open_buffer();
46 
47 private:
48  AGLPbuffer _pbuffer;
49 
50 public:
51  static TypeHandle get_class_type() {
52  return _type_handle;
53  }
54  static void init_type() {
55  GraphicsBuffer::init_type();
56  register_type(_type_handle, "osxGraphicsBuffer",
57  GraphicsBuffer::get_class_type());
58  }
59  virtual TypeHandle get_type() const {
60  return get_class_type();
61  }
62  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
63 
64 private:
65  static TypeHandle _type_handle;
66 
67  friend class osxGraphicsStateGuardian;
68 };
69 
70 
71 #endif
virtual void end_frame(FrameMode mode, Thread *current_thread)
This function will be called within the draw thread after rendering is completed for a given frame...
virtual bool begin_frame(FrameMode mode, Thread *current_thread)
This function will be called within the draw thread before beginning rendering for a given frame...
An offscreen buffer in the OSX environment.
A tiny specialization on GLGraphicsStateGuardian to add some wgl-specific information.
A container for the various kinds of properties we might ask to have on a graphics window before we o...
An offscreen buffer for rendering into.
An object to create GraphicsOutputs that share a particular 3-D API.
Definition: graphicsPipe.h:58
This is a base class for the various different classes that represent the result of a frame of render...
A thread; that is, a lightweight process.
Definition: thread.h:51
Encapsulates all the communication with a particular instance of a given rendering backend...
This class is the main interface to controlling the render process.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:85
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...