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 MAC_NATIVE_H 18 #define MAC_NATIVE_H 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