sync with tizen_2.2
[sdk/emulator/qemu.git] / gl / dgles2 / src / EGL / hcocoa.h
1 /* Copyright (C) 2011  Nokia Corporation All Rights Reserved.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining a
4  * copy of this software and associated documentation files (the "Software"),
5  * to deal in the Software without restriction, including without limitation
6  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
7  * and/or sell copies of the Software, and to permit persons to whom the
8  * Software is furnished to do so, subject to the following conditions:
9  *
10  * The above copyright notice and this permission notice shall be included
11  * in all copies or substantial portions of the Software.
12  *
13  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
14  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
16  * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
17  * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
19  */
20
21 #ifndef HCOCOA_H_
22 #define HCOCOA_H_
23
24 #include "common.h"
25
26 #include <ApplicationServices/ApplicationServices.h>
27 #include <OpenGL/OpenGL.h>
28
29 #ifndef GL_TEXTURE_RECTANGLE_EXT
30 #define GL_TEXTURE_RECTANGLE_EXT          0x84F5
31 #endif
32
33 #define HCOCOA_FUNCS \
34
35
36 typedef struct HCocoa
37 {
38 #define HCOCOA_FUNC(ret, name, attr) ret (*name) attr;
39         HCOCOA_FUNCS
40 #undef HCOCOA_FUNC
41         void *(*CreateContext)(CGLContextObj ctx);
42         void (*DestroyContext)(void *nsctx);
43         void *(*CreateView)(EGLSurface s, void *nsview, unsigned *w, unsigned *h);
44         void (*DestroyView)(void *cview);
45         void (*SetView)(void *nsctx, void *cview);
46         void (*BindTexImageFromView)(void *nsctx, void *cview);
47 } HCocoa;
48
49 extern HCocoa hcocoa;
50
51 extern int hcocoaLoad(void);
52
53 #endif // HCOCOA_H_