Home | History | Annotate | Download | only in EGL
      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 validNativeDisplay(EGLNativeInternalDisplayType dpy);
     41     bool validNativeWin(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType win);
     42     bool validNativeWin(EGLNativeInternalDisplayType dpy,EGLNativeWindowType win);
     43     bool validNativePixmap(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType pix);
     44     bool checkWindowPixelFormatMatch(EGLNativeInternalDisplayType dpy,EGLNativeWindowType win,EglConfig* cfg,unsigned int* width,unsigned int* height);
     45     bool checkPixmapPixelFormatMatch(EGLNativeInternalDisplayType dpy,EGLNativePixmapType pix,EglConfig* cfg,unsigned int* width,unsigned int* height);
     46     bool makeCurrent(EGLNativeInternalDisplayType dpy,EglSurface* read,EglSurface* draw,EGLNativeContextType);
     47     void swapBuffers(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType srfc);
     48     void swapInterval(EGLNativeInternalDisplayType dpy,EGLNativeSurfaceType win,int interval);
     49     void waitNative();
     50 
     51     EGLNativeInternalDisplayType getDefaultDisplay();
     52     EGLNativeInternalDisplayType getInternalDisplay(EGLNativeDisplayType dpy);
     53     void deleteDisplay(EGLNativeInternalDisplayType idpy);
     54     EGLNativeSurfaceType createPbufferSurface(EGLNativeInternalDisplayType dpy,EglConfig* cfg,EglPbufferSurface* pb);
     55     EGLNativeContextType createContext(EGLNativeInternalDisplayType dpy,EglConfig* cfg,EGLNativeContextType sharedContext);
     56     EGLNativeSurfaceType createWindowSurface(EGLNativeWindowType wnd);
     57     EGLNativeSurfaceType createPixmapSurface(EGLNativePixmapType pix);
     58     void destroySurface(EGLNativeSurfaceType srfc);
     59 #ifdef _WIN32
     60     void initPtrToWglFunctions();
     61 #endif
     62 };
     63 
     64 #endif
     65