Home | History | Annotate | Download | only in EGL
      1 #ifndef  MAC_NATIVE_H
      2 #define  MAC_NATIVE_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 typedef enum {                               // Mac equivalence
     21                  MAC_HAS_DOUBLE_BUFFER = 5,  // NSOpenGLPFADoubleBuffer
     22                  MAC_DRAW_TO_WINDOW    = 80, // NSOpenGLPFAWindow
     23                  MAC_DRAW_TO_PBUFFER   = 90, // NSOpenGLPFAPixelBuffer
     24                  MAC_SAMPLES_PER_PIXEL = 56, // NSOpenGLPFASamples
     25                  MAC_COLOR_SIZE        = 8,  // NSOpenGLPFAColorSize
     26                  MAC_ALPHA_SIZE        = 11, // NSOpenGLPFAAlphaSize
     27                  MAC_DEPTH_SIZE        = 12, // NSOpenGLPFADepthSize
     28                  MAC_STENCIL_SIZE      = 13  // NSOpenGLPFAStencilSize
     29              } MacPixelFormatAttribs;
     30 
     31 
     32 extern "C"{
     33 
     34 int   getNumPixelFormats();
     35 void* getPixelFormat(int i);
     36 void  getPixelFormatAttrib(void* pixelFormat,int attrib,int* val);
     37 void* nsCreateContext(void* format,void* share);
     38 void  nsWindowMakeCurrent(void* context,void* nativeWin);
     39 void  nsPBufferMakeCurrent(void* context,void* nativePBuffer,int level);
     40 void  nsSwapBuffers();
     41 void  nsSwapInterval(int *interval);
     42 void  nsDestroyContext(void* context);
     43 void* nsCreatePBuffer(GLenum target,GLenum format,int maxMip,int width,int height);
     44 void  nsDestroyPBuffer(void* pbuffer);
     45 bool  nsGetWinDims(void* win,unsigned int* width,unsigned int* height);
     46 bool  nsCheckColor(void* win,int colorSize);
     47 
     48 }
     49 
     50 #endif
     51