Home | History | Annotate | Download | only in EGL
      1 /*
      2 * Copyright 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 
     17 #ifndef EGL_INTERNAL_PLATFORM_H
     18 #define EGL_INTERNAL_PLATFORM_H
     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