Home | History | Annotate | Download | only in eglwrapper
      1 // Generated Code - DO NOT EDIT !!
      2 // generated by 'emugen'
      3 #include <stdio.h>
      4 #include <stdlib.h>
      5 #include "egl_wrapper_context.h"
      6 
      7 extern "C" {
      8 	EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint* attrib_list, EGLConfig* configs, EGLint config_size, EGLint* num_config);
      9 	EGLBoolean eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
     10 	EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint* attrib_list);
     11 	EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint* attrib_list);
     12 	EGLSurface eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint* attrib_list);
     13 	EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint* attrib_list);
     14 	EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext context);
     15 	EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
     16 	EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint* value);
     17 	EGLBoolean eglGetConfigs(EGLDisplay dpy, EGLConfig* configs, EGLint config_size, EGLint* num_config);
     18 	EGLDisplay eglGetCurrentDisplay();
     19 	EGLSurface eglGetCurrentSurface(EGLint readdraw);
     20 	EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id);
     21 	EGLint eglGetError();
     22 	__eglMustCastToProperFunctionPointerType eglGetProcAddress(const char* procname);
     23 	EGLBoolean eglInitialize(EGLDisplay dpy, EGLint* major, EGLint* minor);
     24 	EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext context);
     25 	EGLBoolean eglQueryContext(EGLDisplay dpy, EGLContext context, EGLint attribute, EGLint* value);
     26 	EGLconstcharptr eglQueryString(EGLDisplay dpy, EGLint name);
     27 	EGLBoolean eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint* value);
     28 	EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
     29 	EGLBoolean eglTerminate(EGLDisplay dpy);
     30 	EGLBoolean eglWaitGL();
     31 	EGLBoolean eglWaitNative(EGLint engine);
     32 	EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
     33 	EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
     34 	EGLBoolean eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
     35 	EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval);
     36 	EGLBoolean eglBindAPI(EGLenum api);
     37 	EGLenum eglQueryAPI();
     38 	EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint* attrib_list);
     39 	EGLBoolean eglReleaseThread();
     40 	EGLBoolean eglWaitClient();
     41 	EGLContext eglGetCurrentContext();
     42 	EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint* attrib_list);
     43 	EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync);
     44 	EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
     45 	EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint* value);
     46 	EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext context, EGLenum target, EGLClientBuffer buffer, const EGLint* attrib_list);
     47 	EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image);
     48 };
     49 
     50 #ifndef GET_CONTEXT
     51 static egl_wrapper_context_t::CONTEXT_ACCESSOR_TYPE *getCurrentContext = NULL;
     52 void egl_wrapper_context_t::setContextAccessor(CONTEXT_ACCESSOR_TYPE *f) { getCurrentContext = f; }
     53 #define GET_CONTEXT egl_wrapper_context_t * ctx = getCurrentContext()
     54 #endif
     55 
     56 EGLBoolean eglChooseConfig(EGLDisplay dpy, const EGLint* attrib_list, EGLConfig* configs, EGLint config_size, EGLint* num_config)
     57 {
     58 	GET_CONTEXT;
     59 	return ctx->eglChooseConfig( dpy, attrib_list, configs, config_size, num_config);
     60 }
     61 
     62 EGLBoolean eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target)
     63 {
     64 	GET_CONTEXT;
     65 	return ctx->eglCopyBuffers( dpy, surface, target);
     66 }
     67 
     68 EGLContext eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint* attrib_list)
     69 {
     70 	GET_CONTEXT;
     71 	return ctx->eglCreateContext( dpy, config, share_context, attrib_list);
     72 }
     73 
     74 EGLSurface eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint* attrib_list)
     75 {
     76 	GET_CONTEXT;
     77 	return ctx->eglCreatePbufferSurface( dpy, config, attrib_list);
     78 }
     79 
     80 EGLSurface eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint* attrib_list)
     81 {
     82 	GET_CONTEXT;
     83 	return ctx->eglCreatePixmapSurface( dpy, config, pixmap, attrib_list);
     84 }
     85 
     86 EGLSurface eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint* attrib_list)
     87 {
     88 	GET_CONTEXT;
     89 	return ctx->eglCreateWindowSurface( dpy, config, win, attrib_list);
     90 }
     91 
     92 EGLBoolean eglDestroyContext(EGLDisplay dpy, EGLContext context)
     93 {
     94 	GET_CONTEXT;
     95 	return ctx->eglDestroyContext( dpy, context);
     96 }
     97 
     98 EGLBoolean eglDestroySurface(EGLDisplay dpy, EGLSurface surface)
     99 {
    100 	GET_CONTEXT;
    101 	return ctx->eglDestroySurface( dpy, surface);
    102 }
    103 
    104 EGLBoolean eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint* value)
    105 {
    106 	GET_CONTEXT;
    107 	return ctx->eglGetConfigAttrib( dpy, config, attribute, value);
    108 }
    109 
    110 EGLBoolean eglGetConfigs(EGLDisplay dpy, EGLConfig* configs, EGLint config_size, EGLint* num_config)
    111 {
    112 	GET_CONTEXT;
    113 	return ctx->eglGetConfigs( dpy, configs, config_size, num_config);
    114 }
    115 
    116 EGLDisplay eglGetCurrentDisplay()
    117 {
    118 	GET_CONTEXT;
    119 	return ctx->eglGetCurrentDisplay();
    120 }
    121 
    122 EGLSurface eglGetCurrentSurface(EGLint readdraw)
    123 {
    124 	GET_CONTEXT;
    125 	return ctx->eglGetCurrentSurface( readdraw);
    126 }
    127 
    128 EGLDisplay eglGetDisplay(EGLNativeDisplayType display_id)
    129 {
    130 	GET_CONTEXT;
    131 	return ctx->eglGetDisplay( display_id);
    132 }
    133 
    134 EGLint eglGetError()
    135 {
    136 	GET_CONTEXT;
    137 	return ctx->eglGetError();
    138 }
    139 
    140 __eglMustCastToProperFunctionPointerType eglGetProcAddress(const char* procname)
    141 {
    142 	GET_CONTEXT;
    143 	return ctx->eglGetProcAddress( procname);
    144 }
    145 
    146 EGLBoolean eglInitialize(EGLDisplay dpy, EGLint* major, EGLint* minor)
    147 {
    148 	GET_CONTEXT;
    149 	return ctx->eglInitialize( dpy, major, minor);
    150 }
    151 
    152 EGLBoolean eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext context)
    153 {
    154 	GET_CONTEXT;
    155 	return ctx->eglMakeCurrent( dpy, draw, read, context);
    156 }
    157 
    158 EGLBoolean eglQueryContext(EGLDisplay dpy, EGLContext context, EGLint attribute, EGLint* value)
    159 {
    160 	GET_CONTEXT;
    161 	return ctx->eglQueryContext( dpy, context, attribute, value);
    162 }
    163 
    164 EGLconstcharptr eglQueryString(EGLDisplay dpy, EGLint name)
    165 {
    166 	GET_CONTEXT;
    167 	return ctx->eglQueryString( dpy, name);
    168 }
    169 
    170 EGLBoolean eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint* value)
    171 {
    172 	GET_CONTEXT;
    173 	return ctx->eglQuerySurface( dpy, surface, attribute, value);
    174 }
    175 
    176 EGLBoolean eglSwapBuffers(EGLDisplay dpy, EGLSurface surface)
    177 {
    178 	GET_CONTEXT;
    179 	return ctx->eglSwapBuffers( dpy, surface);
    180 }
    181 
    182 EGLBoolean eglTerminate(EGLDisplay dpy)
    183 {
    184 	GET_CONTEXT;
    185 	return ctx->eglTerminate( dpy);
    186 }
    187 
    188 EGLBoolean eglWaitGL()
    189 {
    190 	GET_CONTEXT;
    191 	return ctx->eglWaitGL();
    192 }
    193 
    194 EGLBoolean eglWaitNative(EGLint engine)
    195 {
    196 	GET_CONTEXT;
    197 	return ctx->eglWaitNative( engine);
    198 }
    199 
    200 EGLBoolean eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
    201 {
    202 	GET_CONTEXT;
    203 	return ctx->eglBindTexImage( dpy, surface, buffer);
    204 }
    205 
    206 EGLBoolean eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer)
    207 {
    208 	GET_CONTEXT;
    209 	return ctx->eglReleaseTexImage( dpy, surface, buffer);
    210 }
    211 
    212 EGLBoolean eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value)
    213 {
    214 	GET_CONTEXT;
    215 	return ctx->eglSurfaceAttrib( dpy, surface, attribute, value);
    216 }
    217 
    218 EGLBoolean eglSwapInterval(EGLDisplay dpy, EGLint interval)
    219 {
    220 	GET_CONTEXT;
    221 	return ctx->eglSwapInterval( dpy, interval);
    222 }
    223 
    224 EGLBoolean eglBindAPI(EGLenum api)
    225 {
    226 	GET_CONTEXT;
    227 	return ctx->eglBindAPI( api);
    228 }
    229 
    230 EGLenum eglQueryAPI()
    231 {
    232 	GET_CONTEXT;
    233 	return ctx->eglQueryAPI();
    234 }
    235 
    236 EGLSurface eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint* attrib_list)
    237 {
    238 	GET_CONTEXT;
    239 	return ctx->eglCreatePbufferFromClientBuffer( dpy, buftype, buffer, config, attrib_list);
    240 }
    241 
    242 EGLBoolean eglReleaseThread()
    243 {
    244 	GET_CONTEXT;
    245 	return ctx->eglReleaseThread();
    246 }
    247 
    248 EGLBoolean eglWaitClient()
    249 {
    250 	GET_CONTEXT;
    251 	return ctx->eglWaitClient();
    252 }
    253 
    254 EGLContext eglGetCurrentContext()
    255 {
    256 	GET_CONTEXT;
    257 	return ctx->eglGetCurrentContext();
    258 }
    259 
    260 EGLSyncKHR eglCreateSyncKHR(EGLDisplay dpy, EGLenum type, const EGLint* attrib_list)
    261 {
    262 	GET_CONTEXT;
    263 	return ctx->eglCreateSyncKHR( dpy, type, attrib_list);
    264 }
    265 
    266 EGLBoolean eglDestroySyncKHR(EGLDisplay dpy, EGLSyncKHR sync)
    267 {
    268 	GET_CONTEXT;
    269 	return ctx->eglDestroySyncKHR( dpy, sync);
    270 }
    271 
    272 EGLint eglClientWaitSyncKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout)
    273 {
    274 	GET_CONTEXT;
    275 	return ctx->eglClientWaitSyncKHR( dpy, sync, flags, timeout);
    276 }
    277 
    278 EGLBoolean eglGetSyncAttribKHR(EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint* value)
    279 {
    280 	GET_CONTEXT;
    281 	return ctx->eglGetSyncAttribKHR( dpy, sync, attribute, value);
    282 }
    283 
    284 EGLImageKHR eglCreateImageKHR(EGLDisplay dpy, EGLContext context, EGLenum target, EGLClientBuffer buffer, const EGLint* attrib_list)
    285 {
    286 	GET_CONTEXT;
    287 	return ctx->eglCreateImageKHR( dpy, context, target, buffer, attrib_list);
    288 }
    289 
    290 EGLBoolean eglDestroyImageKHR(EGLDisplay dpy, EGLImageKHR image)
    291 {
    292 	GET_CONTEXT;
    293 	return ctx->eglDestroyImageKHR( dpy, image);
    294 }
    295 
    296