1 /*
2    (c) Copyright 2001-2009  The world wide DirectFB Open Source Community (directfb.org)
3    (c) Copyright 2000-2004  Convergence (integrated media) GmbH
4 
5    All rights reserved.
6 
7    Written by Denis Oliver Kropp <dok@directfb.org>,
8               Andreas Hundt <andi@fischlustig.de>,
9               Sven Neumann <neo@directfb.org>,
10               Ville Syrjälä <syrjala@sci.fi> and
11               Claudio Ciccani <klan@users.sf.net>.
12 
13    This library is free software; you can redistribute it and/or
14    modify it under the terms of the GNU Lesser General Public
15    License as published by the Free Software Foundation; either
16    version 2 of the License, or (at your option) any later version.
17 
18    This library is distributed in the hope that it will be useful,
19    but WITHOUT ANY WARRANTY; without even the implied warranty of
20    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
21    Lesser General Public License for more details.
22 
23    You should have received a copy of the GNU Lesser General Public
24    License along with this library; if not, write to the
25    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
26    Boston, MA 02111-1307, USA.
27 */
28 
29 #ifndef __DIRECTFBGL_H__
30 #define __DIRECTFBGL_H__
31 
32 #include <directfb.h>
33 
34 #ifdef __cplusplus
35 extern "C"
36 {
37 #endif
38 
39 /*
40  * The DirectFBGL interface version.
41  */
42 #define DIRECTFBGL_INTERFACE_VERSION  1
43 
44 
45 /*
46  * Attributes of an OpenGL context.
47  */
48 typedef struct {
49      int        buffer_size;
50      int        depth_size;
51      int        stencil_size;
52      int        aux_buffers;
53 
54      int        red_size;
55      int        green_size;
56      int        blue_size;
57      int        alpha_size;
58 
59      int        accum_red_size;
60      int        accum_green_size;
61      int        accum_blue_size;
62      int        accum_alpha_size;
63 
64      DFBBoolean double_buffer;
65      DFBBoolean stereo;
66 } DFBGLAttributes;
67 
68 
69 /***************
70  * IDirectFBGL *
71  ***************/
72 
73 /*
74  * <i>No summary yet...</i>
75  */
76 DEFINE_INTERFACE(   IDirectFBGL,
77 
78    /** Context handling **/
79 
80      /*
81       * Acquire the hardware lock.
82       */
83      DFBResult (*Lock) (
84           IDirectFBGL              *thiz
85      );
86 
87      /*
88       * Release the lock.
89       */
90      DFBResult (*Unlock) (
91           IDirectFBGL              *thiz
92      );
93 
94      /*
95       * Query the OpenGL attributes.
96       */
97      DFBResult (*GetAttributes) (
98           IDirectFBGL              *thiz,
99           DFBGLAttributes          *attributes
100      );
101 
102      /*
103       * Get the address of an OpenGL function.
104       */
105      DFBResult (*GetProcAddress) (
106           IDirectFBGL              *thiz,
107           const char               *name,
108           void                    **ret_address
109      );
110 
111      /*
112       * Set a surface to be used by the current texture object.
113       */
114      DFBResult (*TextureSurface) (
115           IDirectFBGL              *thiz,
116           int                       target,
117           int                       level,
118           IDirectFBSurface         *surface
119      );
120 )
121 
122 
123 #ifdef __cplusplus
124 }
125 #endif
126 
127 #endif
128 
129