1 /* 2 * Copyright (C) 2011 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 #ifndef EGL_OS_API_H 17 #define EGL_OS_API_H 18 19 #include <EGL/egl.h> 20 #include <EGL/eglinternalplatform.h> 21 #ifdef __APPLE__ 22 #include <OpenGL/gl.h> 23 #else 24 #include <GL/gl.h> 25 #endif 26 #include "EglConfig.h" 27 #include "EglDisplay.h" 28 #include "EglPbufferSurface.h" 29 30 #define PBUFFER_MAX_WIDTH 32767 31 #define PBUFFER_MAX_HEIGHT 32767 32 #define PBUFFER_MAX_PIXELS 32767*32767 33 34 namespace EglOS{ 35 36 void queryConfigs(EGLNativeInternalDisplayType dpy,int renderable_type,ConfigsList& listOut); 37 bool releasePbuffer(EGLNativeInternalDisplayType dis,EGLNativeSurfaceType pb); 38 bool destroyContext(EGLNativeInternalDisplayType dpy,EGLNativeContextType ctx); 39 bool releaseDisplay(EGLNativeInternalDisplayType dpy); 40 bool validNativeWin(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType win); 41 bool validNativeWin(EGLNativeInternalDisplayType dpy,EGLNativeWindowType win); 42 bool validNativePixmap(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType pix); 43 bool checkWindowPixelFormatMatch(EGLNativeInternalDisplayType dpy,EGLNativeWindowType win,EglConfig* cfg,unsigned int* width,unsigned int* height); 44 bool checkPixmapPixelFormatMatch(EGLNativeInternalDisplayType dpy,EGLNativePixmapType pix,EglConfig* cfg,unsigned int* width,unsigned int* height); 45 bool makeCurrent(EGLNativeInternalDisplayType dpy,EglSurface* read,EglSurface* draw,EGLNativeContextType); 46 void swapBuffers(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType srfc); 47 void swapInterval(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType win,int interval); 48 void waitNative(); 49 50 EGLNativeInternalDisplayType getDefaultDisplay(); 51 EGLNativeInternalDisplayType getInternalDisplay(EGLNativeDisplayType dpy); 52 void deleteDisplay(EGLNativeInternalDisplayType idpy); 53 EGLNativeSurfaceType createPbufferSurface(EGLNativeInternalDisplayType dpy,EglConfig* cfg,EglPbufferSurface* pb); 54 EGLNativeContextType createContext(EGLNativeInternalDisplayType dpy,EglConfig* cfg,EGLNativeContextType sharedContext); 55 EGLNativeSurfaceType createWindowSurface(EGLNativeWindowType wnd); 56 EGLNativeSurfaceType createPixmapSurface(EGLNativePixmapType pix); 57 void destroySurface(EGLNativeSurfaceType srfc); 58 #ifdef _WIN32 59 void initPtrToWglFunctions(); 60 #endif 61 }; 62 63 #endif 64