Home | History | Annotate | Download | only in EGL
      1 #ifndef EGL_INTERNAL_PLATFORM_H
      2 #define EGL_INTERNAL_PLATFORM_H
      3 
      4 /*
      5 * Copyright (C) 2011 The Android Open Source Project
      6 *
      7 * Licensed under the Apache License, Version 2.0 (the "License");
      8 * you may not use this file except in compliance with the License.
      9 * You may obtain a copy of the License at
     10 *
     11 * http://www.apache.org/licenses/LICENSE-2.0
     12 *
     13 * Unless required by applicable law or agreed to in writing, software
     14 * distributed under the License is distributed on an "AS IS" BASIS,
     15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     16 * See the License for the specific language governing permissions and
     17 * limitations under the License.
     18 */
     19 
     20 class SrfcInfo; //defined in Egl{$platform}Api.cpp
     21 typedef SrfcInfo* SURFACE;
     22 typedef SURFACE EGLNativeSurfaceType;
     23 
     24 #if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
     25 #ifndef WIN32_LEAN_AND_MEAN
     26 #define WIN32_LEAN_AND_MEAN 1
     27 #endif
     28 
     29 #include <GL/gl.h>
     30 #define WGL_WGLEXT_PROTOTYPES
     31 #include <GL/wglext.h>
     32 
     33 class WinDisplay; //defined in EglWindows.cpp
     34 typedef WinDisplay* DISPLAY;
     35 
     36 typedef PIXELFORMATDESCRIPTOR  EGLNativePixelFormatType;
     37 #define PIXEL_FORMAT_INITIALIZER {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
     38 typedef HGLRC                  EGLNativeContextType;
     39 typedef HPBUFFERARB            EGLNativePbufferType;
     40 typedef DISPLAY                EGLNativeInternalDisplayType;
     41 
     42 #elif defined(__APPLE__)
     43 
     44 typedef void*                  EGLNativePixelFormatType;
     45 #define PIXEL_FORMAT_INITIALIZER NULL
     46 typedef void*                  EGLNativeContextType;
     47 typedef void*                  EGLNativePbufferType;
     48 typedef EGLNativeDisplayType   EGLNativeInternalDisplayType;
     49 
     50 
     51 #elif defined(__unix__)
     52 
     53 /* X11 (tentative)  */
     54 #include <GL/glx.h>
     55 #include <X11/Xlib.h>
     56 #include <X11/Xutil.h>
     57 
     58 typedef GLXFBConfig           EGLNativePixelFormatType;
     59 #define PIXEL_FORMAT_INITIALIZER 0;
     60 typedef GLXContext            EGLNativeContextType;
     61 typedef GLXPbuffer            EGLNativePbufferType;
     62 typedef EGLNativeDisplayType  EGLNativeInternalDisplayType;
     63 
     64 #else
     65 #error "Platform not recognized"
     66 #endif
     67 
     68 
     69 #endif
     70