Panda3D
androidGraphicsPipe.h
1 // Filename: androidGraphicsPipe.h
2 // Created by: rdb (11Jan13)
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 ANDROIDGRAPHICSPIPE_H
16 #define ANDROIDGRAPHICSPIPE_H
17 
18 #include "pandabase.h"
19 #include "graphicsWindow.h"
20 #include "graphicsPipe.h"
21 
22 #ifdef OPENGLES_2
23  #include "gles2gsg.h"
24 // #define NativeDisplayType EGLNativeDisplayType
25 // #define NativePixmapType EGLNativePixmapType
26 // #define NativeWindowType EGLNativeWindowType
27 #else
28  #include "glesgsg.h"
29 #endif
30 #include <EGL/egl.h>
31 
33 
34 class AndroidGraphicsBuffer;
35 class AndroidGraphicsPixmap;
37 
38 ////////////////////////////////////////////////////////////////////
39 // Class : AndroidGraphicsPipe
40 // Description : This graphics pipe represents the interface for
41 // creating OpenGL ES graphics windows on an X-based
42 // (e.g. Unix) client.
43 ////////////////////////////////////////////////////////////////////
45 public:
47  virtual ~AndroidGraphicsPipe();
48 
49  virtual string get_interface_name() const;
50  static PT(GraphicsPipe) pipe_constructor();
51 
52 public:
53  virtual PreferredWindowThread get_preferred_window_thread() const;
54 
55 protected:
56  virtual PT(GraphicsOutput) make_output(const string &name,
57  const FrameBufferProperties &fb_prop,
58  const WindowProperties &win_prop,
59  int flags,
60  GraphicsEngine *engine,
62  GraphicsOutput *host,
63  int retry,
64  bool &precertify);
65 
66 private:
67  EGLDisplay _egl_display;
68  GraphicsWindow *_window;
69 
70 public:
71  static TypeHandle get_class_type() {
72  return _type_handle;
73  }
74  static void init_type() {
75  GraphicsPipe::init_type();
76  register_type(_type_handle, "AndroidGraphicsPipe",
77  GraphicsPipe::get_class_type());
78  }
79  virtual TypeHandle get_type() const {
80  return get_class_type();
81  }
82  virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
83 
84 private:
85  static TypeHandle _type_handle;
86 
87  friend class AndroidGraphicsBuffer;
88  friend class AndroidGraphicsPixmap;
89  friend class AndroidGraphicsWindow;
90 };
91 
92 #include "androidGraphicsPipe.I"
93 
94 #endif
This graphics pipe represents the interface for creating OpenGL ES graphics windows on an X-based (e...
virtual PreferredWindowThread get_preferred_window_thread() const
Returns an indication of the thread in which this GraphicsPipe requires its window processing to be p...
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...
A container for the various kinds of properties we might ask to have on a graphics window before we o...
virtual string get_interface_name() const
Returns the name of the rendering interface associated with this GraphicsPipe.
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...
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...