13464ebd5Sriastradh/* 23464ebd5Sriastradh Copyright (c) 2008, 2009 Apple Inc. 33464ebd5Sriastradh 43464ebd5Sriastradh Permission is hereby granted, free of charge, to any person 53464ebd5Sriastradh obtaining a copy of this software and associated documentation files 63464ebd5Sriastradh (the "Software"), to deal in the Software without restriction, 73464ebd5Sriastradh including without limitation the rights to use, copy, modify, merge, 83464ebd5Sriastradh publish, distribute, sublicense, and/or sell copies of the Software, 93464ebd5Sriastradh and to permit persons to whom the Software is furnished to do so, 103464ebd5Sriastradh subject to the following conditions: 113464ebd5Sriastradh 123464ebd5Sriastradh The above copyright notice and this permission notice shall be 133464ebd5Sriastradh included in all copies or substantial portions of the Software. 143464ebd5Sriastradh 153464ebd5Sriastradh THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 163464ebd5Sriastradh EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 173464ebd5Sriastradh MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 183464ebd5Sriastradh NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT 193464ebd5Sriastradh HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 203464ebd5Sriastradh WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 213464ebd5Sriastradh OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 223464ebd5Sriastradh DEALINGS IN THE SOFTWARE. 233464ebd5Sriastradh 243464ebd5Sriastradh Except as contained in this notice, the name(s) of the above 253464ebd5Sriastradh copyright holders shall not be used in advertising or otherwise to 263464ebd5Sriastradh promote the sale, use or other dealings in this Software without 273464ebd5Sriastradh prior written authorization. 283464ebd5Sriastradh*/ 293464ebd5Sriastradh 303464ebd5Sriastradh#ifndef APPLE_CGL_H 313464ebd5Sriastradh#define APPLE_CGL_H 323464ebd5Sriastradh 333464ebd5Sriastradh#include <stdio.h> 343464ebd5Sriastradh#include <OpenGL/CGLCurrent.h> 353464ebd5Sriastradh#include <OpenGL/CGLTypes.h> 363464ebd5Sriastradh#include <OpenGL/OpenGL.h> 373464ebd5Sriastradh 383464ebd5Sriastradh/* For GLint and GLsizei on Tiger */ 393464ebd5Sriastradh#include <OpenGL/gl.h> 403464ebd5Sriastradh 413464ebd5Sriastradhstruct apple_cgl_api 423464ebd5Sriastradh{ 433464ebd5Sriastradh GLint version_major, version_minor; 443464ebd5Sriastradh void (*get_version) (GLint * version_major, GLint * version_minor); 453464ebd5Sriastradh 463464ebd5Sriastradh CGLError(*choose_pixel_format) (const CGLPixelFormatAttribute * attribs, 473464ebd5Sriastradh CGLPixelFormatObj * pix, GLint * npix); 483464ebd5Sriastradh CGLError(*destroy_pixel_format) (CGLPixelFormatObj pix); 493464ebd5Sriastradh 503464ebd5Sriastradh CGLError(*clear_drawable) (CGLContextObj ctx); 513464ebd5Sriastradh CGLError(*flush_drawable) (CGLContextObj ctx); 523464ebd5Sriastradh 533464ebd5Sriastradh CGLError(*create_context) (CGLPixelFormatObj pix, CGLContextObj share, 543464ebd5Sriastradh CGLContextObj * ctx); 553464ebd5Sriastradh CGLError(*destroy_context) (CGLContextObj pix); 563464ebd5Sriastradh 573464ebd5Sriastradh CGLError(*set_current_context) (CGLContextObj ctx); 583464ebd5Sriastradh CGLContextObj(*get_current_context) (void); 593464ebd5Sriastradh const char *(*error_string) (CGLError error); 603464ebd5Sriastradh 613464ebd5Sriastradh CGLError(*set_off_screen) (CGLContextObj ctx, 623464ebd5Sriastradh GLsizei width, GLsizei height, GLint rowbytes, 633464ebd5Sriastradh void *baseaddr); 643464ebd5Sriastradh 653464ebd5Sriastradh CGLError(*copy_context) (CGLContextObj src, CGLContextObj dst, 663464ebd5Sriastradh GLbitfield mask); 673464ebd5Sriastradh 683464ebd5Sriastradh CGLError(*create_pbuffer) (GLsizei width, 693464ebd5Sriastradh GLsizei height, 703464ebd5Sriastradh GLenum target, 713464ebd5Sriastradh GLenum internalFormat, 723464ebd5Sriastradh GLint max_level, CGLPBufferObj * pbuffer); 733464ebd5Sriastradh 743464ebd5Sriastradh CGLError(*destroy_pbuffer) (CGLPBufferObj pbuffer); 753464ebd5Sriastradh 763464ebd5Sriastradh CGLError(*set_pbuffer) (CGLContextObj ctx, 773464ebd5Sriastradh CGLPBufferObj pbuffer, 783464ebd5Sriastradh GLenum face, GLint level, GLint screen); 793464ebd5Sriastradh}; 803464ebd5Sriastradh 813464ebd5Sriastradhextern struct apple_cgl_api apple_cgl; 823464ebd5Sriastradh 833464ebd5Sriastradhextern void apple_cgl_init(void); 843464ebd5Sriastradh 853464ebd5Sriastradhextern void *apple_cgl_get_dl_handle(void); 863464ebd5Sriastradh 873464ebd5Sriastradh#endif 88