Panda3D
androidGraphicsPipe.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 androidGraphicsPipe.h
10  * @author rdb
11  * @date 2013-01-11
12  */
13 
14 #ifndef ANDROIDGRAPHICSPIPE_H
15 #define ANDROIDGRAPHICSPIPE_H
16 
17 #include "pandabase.h"
18 #include "graphicsWindow.h"
19 #include "graphicsPipe.h"
20 
21 #ifdef OPENGLES_2
22  #include "gles2gsg.h"
23 // #define NativeDisplayType EGLNativeDisplayType #define NativePixmapType
24 // EGLNativePixmapType #define NativeWindowType EGLNativeWindowType
25 #else
26  #include "glesgsg.h"
27 #endif
28 #include <EGL/egl.h>
29 
31 
32 class AndroidGraphicsBuffer;
33 class AndroidGraphicsPixmap;
35 
36 /**
37  * This graphics pipe represents the interface for creating OpenGL ES graphics
38  * windows on an X-based (e.g. Unix) client.
39  */
41 public:
43  virtual ~AndroidGraphicsPipe();
44 
45  virtual std::string get_interface_name() const;
46  static PT(GraphicsPipe) pipe_constructor();
47 
48 public:
49  virtual PreferredWindowThread get_preferred_window_thread() const;
50 
51 protected:
52  virtual PT(GraphicsOutput) make_output(const std::string &name,
53  const FrameBufferProperties &fb_prop,
54  const WindowProperties &win_prop,
55  int flags,
56  GraphicsEngine *engine,
58  GraphicsOutput *host,
59  int retry,
60  bool &precertify);
61 
62 private:
63  EGLDisplay _egl_display;
64  GraphicsWindow *_window;
65 
66 public:
67  static TypeHandle get_class_type() {
68  return _type_handle;
69  }
70  static void init_type() {
71  GraphicsPipe::init_type();
72  register_type(_type_handle, "AndroidGraphicsPipe",
73  GraphicsPipe::get_class_type());
74  }
75  virtual TypeHandle get_type() const {
76  return get_class_type();
77  }
78  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
79 
80 private:
81  static TypeHandle _type_handle;
82 
83  friend class AndroidGraphicsBuffer;
84  friend class AndroidGraphicsPixmap;
85  friend class AndroidGraphicsWindow;
86 };
87 
88 #include "androidGraphicsPipe.I"
89 
90 #endif
This graphics pipe represents the interface for creating OpenGL ES graphics windows on an X-based (e....
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.
virtual PreferredWindowThread get_preferred_window_thread() const
Returns an indication of the thread in which this GraphicsPipe requires its window processing to be p...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An interface to manage Android windows and their appropriate EGL surfaces.
A window, fullscreen or on a desktop, into which a graphics device sends its output for interactive d...
virtual std::string get_interface_name() const
Returns the name of the rendering interface associated with this GraphicsPipe.
A container for the various kinds of properties we might ask to have on a graphics window before we o...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
An object to create GraphicsOutputs that share a particular 3-D API.
Definition: graphicsPipe.h:52
This is a base class for the various different classes that represent the result of a frame of render...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
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:81
A container for the various kinds of properties we might ask to have on a graphics frameBuffer before...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.