Panda3D
Loading...
Searching...
No Matches
eglGraphicsPixmap.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 eglGraphicsPixmap.h
10 * @author rdb
11 * @date 2009-06-13
12 */
13
14#ifndef EGLGRAPHICSPIXMAP_H
15#define EGLGRAPHICSPIXMAP_H
16
17#include "pandabase.h"
18
19#ifdef USE_X11
20
21#include "eglGraphicsPipe.h"
22#include "graphicsBuffer.h"
23
24/**
25 * Another offscreen buffer in the EGL environment. This creates a Pixmap
26 * object, which is probably less efficient than an EGLPBuffer, so this class
27 * is a second choice to eglGraphicsBuffer.
28 */
29class eglGraphicsPixmap : public GraphicsBuffer {
30public:
31 eglGraphicsPixmap(GraphicsEngine *engine, GraphicsPipe *pipe,
32 const std::string &name,
33 const FrameBufferProperties &fb_prop,
34 const WindowProperties &win_prop,
35 int flags,
36 GraphicsStateGuardian *gsg,
37 GraphicsOutput *host);
38 virtual ~eglGraphicsPixmap();
39
40 virtual bool begin_frame(FrameMode mode, Thread *current_thread);
41 virtual void end_frame(FrameMode mode, Thread *current_thread);
42
43protected:
44 virtual void close_buffer();
45 virtual bool open_buffer();
46
47private:
48 X11_Display *_display;
49 X11_Window _drawable;
50 Pixmap _x_pixmap;
51 EGLSurface _egl_surface;
52 EGLDisplay _egl_display;
53
54public:
55 static TypeHandle get_class_type() {
56 return _type_handle;
57 }
58 static void init_type() {
59 GraphicsBuffer::init_type();
60 register_type(_type_handle, "eglGraphicsPixmap",
61 GraphicsBuffer::get_class_type());
62 }
63 virtual TypeHandle get_type() const {
64 return get_class_type();
65 }
66 virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
67
68private:
69 static TypeHandle _type_handle;
70};
71
72#endif // USE_X11
73
74#endif
An offscreen buffer for rendering into.
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.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...