Panda3D
 All Classes Functions Variables Enumerations
iPhoneGraphicsStateGuardian.h
1 // Filename: iPhoneGraphicsStateGuardian.h
2 // Created by: drose (08Apr09)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #ifndef IPHONEGRAPHICSSTATEGUARDIAN_H
16 #define IPHONEGRAPHICSSTATEGUARDIAN_H
17 
18 #include "pandabase.h"
19 #include "glesgsg.h"
20 
21 #include "iPhoneGraphicsWindow.h"
22 
24 
25 ////////////////////////////////////////////////////////////////////
26 // Class : IPhoneGraphicsStateGuardian
27 // Description :
28 ////////////////////////////////////////////////////////////////////
29 class IPhoneGraphicsStateGuardian : public GLESGraphicsStateGuardian {
30 public:
32  IPhoneGraphicsStateGuardian *share_with);
33  virtual ~IPhoneGraphicsStateGuardian();
34  virtual void reset();
35 
36 protected:
37  virtual void *get_extension_func(const char *prefix, const char *name);
38 
39 private:
40  void describe_pixel_format(FrameBufferProperties &fb_props);
41 
42  // We have to save a pointer to the GSG we intend to share texture
43  // context with, since we don't create our own context in the
44  // constructor.
45  PT(IPhoneGraphicsStateGuardian) _share_with;
46 
47 public:
48  GLint _shared_buffer;
49 
50 public:
51  static TypeHandle get_class_type() {
52  return _type_handle;
53  }
54  static void init_type() {
55  GLESGraphicsStateGuardian::init_type();
56  register_type(_type_handle, "IPhoneGraphicsStateGuardian",
57  GLESGraphicsStateGuardian::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 IPhoneGraphicsBuffer;
68 };
69 
70 
71 #endif
An object to create GraphicsOutputs that share a particular 3-D API.
Definition: graphicsPipe.h:58
An interface to the osx/ system for managing GL windows under X.
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...