#ifndef _GAPI_H
#define _GAPI_H
#include <gpac/list.h>
#include <gpac/thread.h>
#include <gpac/modules/video_out.h>
#ifdef GPAC_USE_GLES1X
#include "GLES/egl.h"
#endif
#ifdef __cplusplus
extern "C" {
#endif
typedef struct
{
HWND hWnd;
DWORD orig_wnd_proc;
GF_Mutex *mx;
unsigned char *raw_ptr;
Bool contiguous_mem;
GXKeyList keys;
u32 screen_w, screen_h;
u32 fs_w, fs_h;
u32 backup_w, backup_h;
s32 x_pitch, y_pitch;
Bool fullscreen;
u32 gx_mode;
u32 sys_w, sys_h;
Bool scale_coords;
char *backbuffer;
u32 bb_size, bb_width, bb_height, bb_pitch;
u32 pixel_format;
u32 BPP, bits_per_pixel;
GF_Window dst_blt;
DWORD ThreadID;
HANDLE hThread;
Bool owns_hwnd;
Bool erase_dest;
u32 off_x, off_y;
HBITMAP bitmap, old_bitmap;
DWORD * bits;
HDC hdcBitmap, hdc;
BITMAPINFO* bmi;
#ifdef GPAC_USE_GLES1X
u32 output_3d_type;
EGLDisplay egldpy;
EGLSurface surface;
EGLConfig eglconfig;
EGLContext eglctx;
HBITMAP gl_bitmap;
DWORD *gl_bits;
HWND gl_hwnd;
Bool use_pbuffer;
#endif
} GAPIPriv;
GF_Err GAPI_SetupOGL_ES_Offscreen(GF_VideoOutput *dr, u32 width, u32 height) ;
#ifdef __cplusplus
}
#endif
#endif