Panda3D
iPhoneGraphicsStateGuardian.h
Go to the documentation of this file.
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 iPhoneGraphicsStateGuardian.h
10  * @author drose
11  * @date 2009-04-08
12  */
13 
14 #ifndef IPHONEGRAPHICSSTATEGUARDIAN_H
15 #define IPHONEGRAPHICSSTATEGUARDIAN_H
16 
17 #include "pandabase.h"
18 #include "glesgsg.h"
19 
20 #include "iPhoneGraphicsWindow.h"
21 
23 
24 /**
25  *
26  */
27 class IPhoneGraphicsStateGuardian : public GLESGraphicsStateGuardian {
28 public:
30  IPhoneGraphicsStateGuardian *share_with);
31  virtual ~IPhoneGraphicsStateGuardian();
32  virtual void reset();
33 
34 protected:
35  virtual void *get_extension_func(const char *prefix, const char *name);
36 
37 private:
38  void describe_pixel_format(FrameBufferProperties &fb_props);
39 
40  // We have to save a pointer to the GSG we intend to share texture context
41  // with, since we don't create our own context in the constructor.
42  PT(IPhoneGraphicsStateGuardian) _share_with;
43 
44 public:
45  GLint _shared_buffer;
46 
47 public:
48  static TypeHandle get_class_type() {
49  return _type_handle;
50  }
51  static void init_type() {
52  GLESGraphicsStateGuardian::init_type();
53  register_type(_type_handle, "IPhoneGraphicsStateGuardian",
54  GLESGraphicsStateGuardian::get_class_type());
55  }
56  virtual TypeHandle get_type() const {
57  return get_class_type();
58  }
59  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
60 
61 private:
62  static TypeHandle _type_handle;
63 
64  friend class IPhoneGraphicsBuffer;
65 };
66 
67 
68 #endif
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
Definition: register_type.I:22
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An object to create GraphicsOutputs that share a particular 3-D API.
Definition: graphicsPipe.h:52
An interface to the osx/ system for managing GL windows under X.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
This class is the main interface to controlling the render process.
TypeHandle is the identifier used to differentiate C++ class types.
Definition: typeHandle.h:81
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...