checkpoint on winsys headers
This commit is contained in:
parent
a6ab9e6295
commit
d9124364d0
12 changed files with 5777 additions and 22239 deletions
621
include/GL/RegalCGL.h
Normal file
621
include/GL/RegalCGL.h
Normal file
|
|
@ -0,0 +1,621 @@
|
|||
/* NOTE: Do not edit this file, it is generated by a script:
|
||||
Export.py --api gl 4.4 --api wgl 4.4 --api glx 4.4 --api cgl 1.4 --api egl 1.0 --outdir .
|
||||
*/
|
||||
|
||||
/*
|
||||
Copyright (c) 2011-2013 NVIDIA Corporation
|
||||
Copyright (c) 2011-2013 Cass Everitt
|
||||
Copyright (c) 2012-2013 Scott Nations
|
||||
Copyright (c) 2012 Mathias Schott
|
||||
Copyright (c) 2012-2013 Nigel Stewart
|
||||
Copyright (c) 2012-2013 Google Inc.
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation
|
||||
and/or other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
|
||||
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
|
||||
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
|
||||
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
|
||||
OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
Intended formatting conventions:
|
||||
$ astyle --style=allman --indent=spaces=2 --indent-switches
|
||||
*/
|
||||
|
||||
#include <GL/Regal.h>
|
||||
|
||||
#ifndef __REGAL_CGL_H__
|
||||
#define __REGAL_CGL_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if REGAL_SYS_OSX
|
||||
typedef struct _CGLContextObject * CGLContextObj;
|
||||
typedef struct _CGLPixelFormatObject * CGLPixelFormatObj;
|
||||
typedef struct _CGLRendererInfoObject * CGLRendererInfoObj;
|
||||
typedef struct _CGLPBufferObject * CGLPBufferObj;
|
||||
typedef void * CGLShareGroupObj;
|
||||
typedef struct __IOSurface * IOSurfaceRef;
|
||||
typedef void * CGSConnectionID;
|
||||
typedef int CGSWindowID;
|
||||
typedef int CGSSurfaceID;
|
||||
#endif // REGAL_SYS_OSX
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if REGAL_SYS_OSX
|
||||
|
||||
typedef enum _CGLPixelFormatAttribute {
|
||||
kCGLPFAAllRenderers = 1,
|
||||
kCGLPFATripleBuffer = 3,
|
||||
kCGLPFADoubleBuffer = 5,
|
||||
kCGLPFAStereo = 6,
|
||||
kCGLPFAAuxBuffers = 7,
|
||||
kCGLPFAColorSize = 8,
|
||||
kCGLPFAAlphaSize = 11,
|
||||
kCGLPFADepthSize = 12,
|
||||
kCGLPFAStencilSize = 13,
|
||||
kCGLPFAAccumSize = 14,
|
||||
kCGLPFAMinimumPolicy = 51,
|
||||
kCGLPFAMaximumPolicy = 52,
|
||||
kCGLPFAOffScreen = 53,
|
||||
kCGLPFAFullScreen = 54,
|
||||
kCGLPFASampleBuffers = 55,
|
||||
kCGLPFASamples = 56,
|
||||
kCGLPFAAuxDepthStencil = 57,
|
||||
kCGLPFAColorFloat = 58,
|
||||
kCGLPFAMultisample = 59,
|
||||
kCGLPFASupersample = 60,
|
||||
kCGLPFASampleAlpha = 61,
|
||||
kCGLPFARendererID = 70,
|
||||
kCGLPFASingleRenderer = 71,
|
||||
kCGLPFANoRecovery = 72,
|
||||
kCGLPFAAccelerated = 73,
|
||||
kCGLPFAClosestPolicy = 74,
|
||||
kCGLPFARobust = 75,
|
||||
kCGLPFABackingStore = 76,
|
||||
kCGLPFAMPSafe = 78,
|
||||
kCGLPFAWindow = 80,
|
||||
kCGLPFAMultiScreen = 81,
|
||||
kCGLPFACompliant = 83,
|
||||
kCGLPFADisplayMask = 84,
|
||||
kCGLPFAPBuffer = 90,
|
||||
kCGLPFARemotePBuffer = 91,
|
||||
kCGLPFAAllowOfflineRenderers = 96,
|
||||
kCGLPFAAcceleratedCompute = 97,
|
||||
kCGLPFAOpenGLProfile = 99,
|
||||
kCGLPFAVirtualScreenCount = 128,
|
||||
} CGLPixelFormatAttribute;
|
||||
|
||||
typedef enum _CGLRendererProperty {
|
||||
kCGLRPOffScreen = 53,
|
||||
kCGLRPFullScreen = 54,
|
||||
kCGLRPRendererID = 70,
|
||||
kCGLRPAccelerated = 73,
|
||||
kCGLRPRobust = 75,
|
||||
kCGLRPBackingStore = 76,
|
||||
kCGLRPMPSafe = 78,
|
||||
kCGLRPWindow = 80,
|
||||
kCGLRPMultiScreen = 81,
|
||||
kCGLRPCompliant = 83,
|
||||
kCGLRPDisplayMask = 84,
|
||||
kCGLRPBufferModes = 100,
|
||||
kCGLRPColorModes = 103,
|
||||
kCGLRPAccumModes = 104,
|
||||
kCGLRPDepthModes = 105,
|
||||
kCGLRPStencilModes = 106,
|
||||
kCGLRPMaxAuxBuffers = 107,
|
||||
kCGLRPMaxSampleBuffers = 108,
|
||||
kCGLRPMaxSamples = 109,
|
||||
kCGLRPSampleModes = 110,
|
||||
kCGLRPSampleAlpha = 111,
|
||||
kCGLRPVideoMemory = 120,
|
||||
kCGLRPTextureMemory = 121,
|
||||
kCGLRPGPUVertProcCapable = 122,
|
||||
kCGLRPGPUFragProcCapable = 123,
|
||||
kCGLRPRendererCount = 128,
|
||||
kCGLRPOnline = 129,
|
||||
kCGLRPAcceleratedCompute = 130,
|
||||
kCGLRPVideoMemoryMegabytes = 131,
|
||||
kCGLRPTextureMemoryMegabytes = 132,
|
||||
} CGLRendererProperty;
|
||||
|
||||
typedef enum _CGLContextEnable {
|
||||
kCGLCESwapRectangle = 201,
|
||||
kCGLCESwapLimit = 203,
|
||||
kCGLCERasterization = 221,
|
||||
kCGLCEStateValidation = 301,
|
||||
kCGLCESurfaceBackingSize = 305,
|
||||
kCGLCEDisplayListOptimization = 307,
|
||||
kCGLCEMPEngine = 313,
|
||||
kCGLCECrashOnRemovedFunctions = 316,
|
||||
} CGLContextEnable;
|
||||
|
||||
typedef enum _CGLContextParameter {
|
||||
kCGLCPSwapRectangle = 200,
|
||||
kCGLCPSwapInterval = 222,
|
||||
kCGLCPDispatchTableSize = 224,
|
||||
kCGLCPClientStorage = 226,
|
||||
kCGLCPSurfaceTexture = 228,
|
||||
kCGLCPSurfaceOrder = 235,
|
||||
kCGLCPSurfaceOpacity = 236,
|
||||
kCGLCPSurfaceBackingSize = 304,
|
||||
kCGLCPSurfaceSurfaceVolatile = 306,
|
||||
kCGLCPReclaimResources = 308,
|
||||
kCGLCPCurrentRendererID = 309,
|
||||
kCGLCPGPUVertexProcessing = 310,
|
||||
kCGLCPGPUFragmentProcessing = 311,
|
||||
kCGLCPHasDrawable = 314,
|
||||
kCGLCPMPSwapsInFlight = 315,
|
||||
} CGLContextParameter;
|
||||
|
||||
typedef enum _CGLGlobalOption {
|
||||
kCGLGOFormatCacheSize = 501,
|
||||
kCGLGOClearFormatCache = 502,
|
||||
kCGLGORetainRenderers = 503,
|
||||
kCGLGOResetLibrary = 504,
|
||||
kCGLGOUseErrorHandler = 505,
|
||||
kCGLGOUseBuildCache = 506,
|
||||
} CGLGlobalOption;
|
||||
|
||||
typedef enum _CGLOpenGLProfile {
|
||||
kCGLOGLPVersion_Legacy = 4096,
|
||||
kCGLOGLPVersion_3_2_Core = 12800,
|
||||
} CGLOpenGLProfile;
|
||||
|
||||
typedef enum _CGLError {
|
||||
kCGLNoError = 0,
|
||||
kCGLBadAttribute = 10000,
|
||||
kCGLBadProperty = 10001,
|
||||
kCGLBadPixelFormat = 10002,
|
||||
kCGLBadRendererInfo = 10003,
|
||||
kCGLBadContext = 10004,
|
||||
kCGLBadDrawable = 10005,
|
||||
kCGLBadDisplay = 10006,
|
||||
kCGLBadState = 10007,
|
||||
kCGLBadValue = 10008,
|
||||
kCGLBadMatch = 10009,
|
||||
kCGLBadEnumeration = 10010,
|
||||
kCGLBadOffScreen = 10011,
|
||||
kCGLBadFullScreen = 10012,
|
||||
kCGLBadWindow = 10013,
|
||||
kCGLBadAddress = 10014,
|
||||
kCGLBadCodeModule = 10015,
|
||||
kCGLBadAlloc = 10016,
|
||||
kCGLBadConnection = 10017,
|
||||
} CGLError;
|
||||
|
||||
#endif // REGAL_SYS_OSX
|
||||
|
||||
#if REGAL_SYS_OSX
|
||||
#define kCGL0Bit 0x1
|
||||
#define kCGLMonoscopicBit 0x1
|
||||
#define kCGLSupersampleBit 0x1
|
||||
#define kCGL4Bit 0x10 /* 16 */
|
||||
#define kCGLTripleBufferBit 0x10 /* 16 */
|
||||
#define kCGL10Bit 0x100 /* 256 */
|
||||
#define kCGLRGB444A8Bit 0x100 /* 256 */
|
||||
#define kCGL32Bit 0x1000 /* 4096 */
|
||||
#define kCGLRGB565Bit 0x1000 /* 4096 */
|
||||
#define kCGL128Bit 0x10000 /* 65536 */
|
||||
#define kCGLRGB888A8Bit 0x10000 /* 65536 */
|
||||
#define kCGLRGB121212Bit 0x100000 /* 1048576 */
|
||||
#define kCGLRGBFloat64Bit 0x1000000 /* 16777216 */
|
||||
#define kCGLRGBFloat256Bit 0x10000000 /* 268435456 */
|
||||
#define kCGL1Bit 0x2
|
||||
#define kCGLMultisampleBit 0x2
|
||||
#define kCGLStereoscopicBit 0x2
|
||||
#define kCGL5Bit 0x20 /* 32 */
|
||||
#define kCGL12Bit 0x200 /* 512 */
|
||||
#define kCGLRGB555Bit 0x200 /* 512 */
|
||||
#define kCGL48Bit 0x2000 /* 8192 */
|
||||
#define kCGLRGB565A8Bit 0x2000 /* 8192 */
|
||||
#define kCGLRGB101010Bit 0x20000 /* 131072 */
|
||||
#define kCGLARGB12121212Bit 0x200000 /* 2097152 */
|
||||
#define kCGLRGBAFloat64Bit 0x2000000 /* 33554432 */
|
||||
#define kCGLRGBAFloat256Bit 0x20000000 /* 536870912 */
|
||||
#define kCGL2Bit 0x4
|
||||
#define kCGLSingleBufferBit 0x4
|
||||
#define kCGL6Bit 0x40 /* 64 */
|
||||
#define kCGLRGB444Bit 0x40 /* 64 */
|
||||
#define kCGL16Bit 0x400 /* 1024 */
|
||||
#define kCGLARGB1555Bit 0x400 /* 1024 */
|
||||
#define kCGL64Bit 0x4000 /* 16384 */
|
||||
#define kCGLRGB888Bit 0x4000 /* 16384 */
|
||||
#define kCGLARGB2101010Bit 0x40000 /* 262144 */
|
||||
#define kCGLRGB161616Bit 0x400000 /* 4194304 */
|
||||
#define kCGLRGBFloat128Bit 0x4000000 /* 67108864 */
|
||||
#define kCGL3Bit 0x8
|
||||
#define kCGLDoubleBufferBit 0x8
|
||||
#define kCGL8Bit 0x80 /* 128 */
|
||||
#define kCGLARGB4444Bit 0x80 /* 128 */
|
||||
#define kCGL24Bit 0x800 /* 2048 */
|
||||
#define kCGLRGB555A8Bit 0x800 /* 2048 */
|
||||
#define kCGL96Bit 0x8000 /* 32768 */
|
||||
#define kCGLARGB8888Bit 0x8000 /* 32768 */
|
||||
#define kCGLRGB101010_A8Bit 0x80000 /* 524288 */
|
||||
#define kCGLRGBA16161616Bit 0x800000 /* 8388608 */
|
||||
#define kCGLRGBAFloat128Bit 0x8000000 /* 134217728 */
|
||||
|
||||
/**
|
||||
** CGL_VERSION_1_0
|
||||
**/
|
||||
|
||||
#if (defined(CGL_VERSION_1_0) || defined(REGAL_NO_ENUM) || defined(REGAL_NO_CGL_VERSION_1_0)) && !defined(REGAL_NO_ENUM_CGL_VERSION_1_0)
|
||||
#define REGAL_NO_ENUM_CGL_VERSION_1_0
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_0) || defined(REGAL_NO_TYPEDEF) || defined(REGAL_NO_CGL_VERSION_1_0)) && !defined(REGAL_NO_TYPEDEF_CGL_VERSION_1_0)
|
||||
#define REGAL_NO_TYPEDEF_CGL_VERSION_1_0
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_0) || !defined(REGAL_NAMESPACE) || defined(REGAL_NO_CGL_VERSION_1_0)) && !defined(REGAL_NO_NAMESPACE_CGL_VERSION_1_0)
|
||||
#define REGAL_NO_NAMESPACE_CGL_VERSION_1_0
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_0) || !defined(REGAL_PLUGIN_MODE) || defined(REGAL_NO_CGL_VERSION_1_0)) && !defined(REGAL_NO_PLUGIN_CGL_VERSION_1_0)
|
||||
#define REGAL_NO_PLUGIN_CGL_VERSION_1_0
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_0) || defined(REGAL_NO_DECLARATION) || defined(REGAL_NO_CGL_VERSION_1_0)) && !defined(REGAL_NO_DECLARATION_CGL_VERSION_1_0)
|
||||
#define REGAL_NO_DECLARATION_CGL_VERSION_1_0
|
||||
#endif
|
||||
|
||||
#ifndef CGL_VERSION_1_0
|
||||
#define CGL_VERSION_1_0 1
|
||||
#endif
|
||||
|
||||
#ifndef REGAL_NO_TYPEDEF_CGL_VERSION_1_0
|
||||
typedef CGLError (REGAL_CALL *PFNCGLCHOOSEPIXELFORMATPROC)(const CGLPixelFormatAttribute *attribs, CGLPixelFormatObj *pix, GLint *npix);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLCLEARDRAWABLEPROC)(CGLContextObj ctx);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLCOPYCONTEXTPROC)(CGLContextObj src, CGLContextObj dst, GLbitfield mask);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLCREATECONTEXTPROC)(CGLPixelFormatObj pix, CGLContextObj share, CGLContextObj *ctx);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLDESCRIBEPIXELFORMATPROC)(CGLPixelFormatObj pix, GLint pix_num, CGLPixelFormatAttribute attrib, GLint *value);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLDESCRIBERENDERERPROC)(CGLRendererInfoObj rend, GLint rend_num, CGLRendererProperty prop, GLint *value);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLDESTROYCONTEXTPROC)(CGLContextObj ctx);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLDESTROYPIXELFORMATPROC)(CGLPixelFormatObj pix);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLDESTROYRENDERERINFOPROC)(CGLRendererInfoObj rend);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLDISABLEPROC)(CGLContextObj ctx, CGLContextEnable pname);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLENABLEPROC)(CGLContextObj ctx, CGLContextEnable pname);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLFLUSHDRAWABLEPROC)(CGLContextObj ctx);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLGETOFFSCREENPROC)(CGLContextObj ctx, GLsizei *width, GLsizei *height, GLsizei *rowbytes, void **baseaddr);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLGETOPTIONPROC)(CGLGlobalOption pname, GLint *param);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLGETPARAMETERPROC)(CGLContextObj ctx, CGLContextParameter pname, GLint *params);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLGETVIRTUALSCREENPROC)(CGLContextObj ctx, GLint *screen);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLISENABLEDPROC)(CGLContextObj ctx, CGLContextEnable pname, GLint *enable);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLQUERYRENDERERINFOPROC)(GLuint display_mask, CGLRendererInfoObj *rend, GLint *nrend);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLSETFULLSCREENPROC)(CGLContextObj ctx);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLSETOFFSCREENPROC)(CGLContextObj ctx, GLsizei width, GLsizei height, GLsizei rowbytes, void *baseaddr);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLSETOPTIONPROC)(CGLGlobalOption pname, GLint param);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLSETPARAMETERPROC)(CGLContextObj ctx, CGLContextParameter pname, const GLint *params);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLSETVIRTUALSCREENPROC)(CGLContextObj ctx, GLint screen);
|
||||
typedef const char *(REGAL_CALL *PFNCGLERRORSTRINGPROC)(CGLError error);
|
||||
typedef void (REGAL_CALL *PFNCGLGETVERSIONPROC)(GLint *majorvers, GLint *minorvers);
|
||||
#endif
|
||||
|
||||
#ifndef REGAL_NO_NAMESPACE_CGL_VERSION_1_0
|
||||
#define CGLChoosePixelFormat rCGLChoosePixelFormat
|
||||
#define CGLClearDrawable rCGLClearDrawable
|
||||
#define CGLCopyContext rCGLCopyContext
|
||||
#define CGLCreateContext rCGLCreateContext
|
||||
#define CGLDescribePixelFormat rCGLDescribePixelFormat
|
||||
#define CGLDescribeRenderer rCGLDescribeRenderer
|
||||
#define CGLDestroyContext rCGLDestroyContext
|
||||
#define CGLDestroyPixelFormat rCGLDestroyPixelFormat
|
||||
#define CGLDestroyRendererInfo rCGLDestroyRendererInfo
|
||||
#define CGLDisable rCGLDisable
|
||||
#define CGLEnable rCGLEnable
|
||||
#define CGLErrorString rCGLErrorString
|
||||
#define CGLFlushDrawable rCGLFlushDrawable
|
||||
#define CGLGetOffScreen rCGLGetOffScreen
|
||||
#define CGLGetOption rCGLGetOption
|
||||
#define CGLGetParameter rCGLGetParameter
|
||||
#define CGLGetVersion rCGLGetVersion
|
||||
#define CGLGetVirtualScreen rCGLGetVirtualScreen
|
||||
#define CGLIsEnabled rCGLIsEnabled
|
||||
#define CGLQueryRendererInfo rCGLQueryRendererInfo
|
||||
#define CGLSetFullScreen rCGLSetFullScreen
|
||||
#define CGLSetOffScreen rCGLSetOffScreen
|
||||
#define CGLSetOption rCGLSetOption
|
||||
#define CGLSetParameter rCGLSetParameter
|
||||
#define CGLSetVirtualScreen rCGLSetVirtualScreen
|
||||
#endif
|
||||
|
||||
#ifndef REGAL_NO_DECLARATION_CGL_VERSION_1_0
|
||||
REGAL_DECL CGLError REGAL_CALL CGLChoosePixelFormat(const CGLPixelFormatAttribute *attribs, CGLPixelFormatObj *pix, GLint *npix);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLClearDrawable(CGLContextObj ctx);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLCopyContext(CGLContextObj src, CGLContextObj dst, GLbitfield mask);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLCreateContext(CGLPixelFormatObj pix, CGLContextObj share, CGLContextObj *ctx);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLDescribePixelFormat(CGLPixelFormatObj pix, GLint pix_num, CGLPixelFormatAttribute attrib, GLint *value);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLDescribeRenderer(CGLRendererInfoObj rend, GLint rend_num, CGLRendererProperty prop, GLint *value);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLDestroyContext(CGLContextObj ctx);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLDestroyPixelFormat(CGLPixelFormatObj pix);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLDestroyRendererInfo(CGLRendererInfoObj rend);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLDisable(CGLContextObj ctx, CGLContextEnable pname);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLEnable(CGLContextObj ctx, CGLContextEnable pname);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLFlushDrawable(CGLContextObj ctx);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLGetOffScreen(CGLContextObj ctx, GLsizei *width, GLsizei *height, GLsizei *rowbytes, void **baseaddr);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLGetOption(CGLGlobalOption pname, GLint *param);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLGetParameter(CGLContextObj ctx, CGLContextParameter pname, GLint *params);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLGetVirtualScreen(CGLContextObj ctx, GLint *screen);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLIsEnabled(CGLContextObj ctx, CGLContextEnable pname, GLint *enable);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLQueryRendererInfo(GLuint display_mask, CGLRendererInfoObj *rend, GLint *nrend);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLSetFullScreen(CGLContextObj ctx);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLSetOffScreen(CGLContextObj ctx, GLsizei width, GLsizei height, GLsizei rowbytes, void *baseaddr);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLSetOption(CGLGlobalOption pname, GLint param);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLSetParameter(CGLContextObj ctx, CGLContextParameter pname, const GLint *params);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLSetVirtualScreen(CGLContextObj ctx, GLint screen);
|
||||
|
||||
REGAL_DECL const char *REGAL_CALL CGLErrorString(CGLError error);
|
||||
|
||||
REGAL_DECL void REGAL_CALL CGLGetVersion(GLint *majorvers, GLint *minorvers);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
** CGL_VERSION_1_1
|
||||
**/
|
||||
|
||||
#if (defined(CGL_VERSION_1_1) || defined(REGAL_NO_ENUM) || defined(REGAL_NO_CGL_VERSION_1_1)) && !defined(REGAL_NO_ENUM_CGL_VERSION_1_1)
|
||||
#define REGAL_NO_ENUM_CGL_VERSION_1_1
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_1) || defined(REGAL_NO_TYPEDEF) || defined(REGAL_NO_CGL_VERSION_1_1)) && !defined(REGAL_NO_TYPEDEF_CGL_VERSION_1_1)
|
||||
#define REGAL_NO_TYPEDEF_CGL_VERSION_1_1
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_1) || !defined(REGAL_NAMESPACE) || defined(REGAL_NO_CGL_VERSION_1_1)) && !defined(REGAL_NO_NAMESPACE_CGL_VERSION_1_1)
|
||||
#define REGAL_NO_NAMESPACE_CGL_VERSION_1_1
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_1) || !defined(REGAL_PLUGIN_MODE) || defined(REGAL_NO_CGL_VERSION_1_1)) && !defined(REGAL_NO_PLUGIN_CGL_VERSION_1_1)
|
||||
#define REGAL_NO_PLUGIN_CGL_VERSION_1_1
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_1) || defined(REGAL_NO_DECLARATION) || defined(REGAL_NO_CGL_VERSION_1_1)) && !defined(REGAL_NO_DECLARATION_CGL_VERSION_1_1)
|
||||
#define REGAL_NO_DECLARATION_CGL_VERSION_1_1
|
||||
#endif
|
||||
|
||||
#ifndef CGL_VERSION_1_1
|
||||
#define CGL_VERSION_1_1 1
|
||||
#endif
|
||||
|
||||
#ifndef REGAL_NO_TYPEDEF_CGL_VERSION_1_1
|
||||
typedef CGLError (REGAL_CALL *PFNCGLCREATEPBUFFERPROC)(GLsizei width, GLsizei height, GLenum target, GLenum internalFormat, GLint max_level, CGLPBufferObj *pbuffer);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLDESCRIBEPBUFFERPROC)(CGLPBufferObj pbuffer, GLsizei *width, GLsizei *height, GLenum *target, GLenum *internalFormat, GLint *mipmap);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLDESTROYPBUFFERPROC)(CGLPBufferObj pbuffer);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLGETPBUFFERPROC)(CGLContextObj ctx, CGLPBufferObj *pbuffer, GLenum *face, GLint *level, GLint *screen);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLSETPBUFFERPROC)(CGLContextObj ctx, CGLPBufferObj pbuffer, GLenum face, GLint level, GLint screen);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLTEXIMAGEPBUFFERPROC)(CGLContextObj ctx, CGLPBufferObj pbuffer, GLenum source);
|
||||
#endif
|
||||
|
||||
#ifndef REGAL_NO_NAMESPACE_CGL_VERSION_1_1
|
||||
#define CGLCreatePBuffer rCGLCreatePBuffer
|
||||
#define CGLDescribePBuffer rCGLDescribePBuffer
|
||||
#define CGLDestroyPBuffer rCGLDestroyPBuffer
|
||||
#define CGLGetPBuffer rCGLGetPBuffer
|
||||
#define CGLSetPBuffer rCGLSetPBuffer
|
||||
#define CGLTexImagePBuffer rCGLTexImagePBuffer
|
||||
#endif
|
||||
|
||||
#ifndef REGAL_NO_DECLARATION_CGL_VERSION_1_1
|
||||
REGAL_DECL CGLError REGAL_CALL CGLCreatePBuffer(GLsizei width, GLsizei height, GLenum target, GLenum internalFormat, GLint max_level, CGLPBufferObj *pbuffer);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLDescribePBuffer(CGLPBufferObj pbuffer, GLsizei *width, GLsizei *height, GLenum *target, GLenum *internalFormat, GLint *mipmap);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLDestroyPBuffer(CGLPBufferObj pbuffer);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLGetPBuffer(CGLContextObj ctx, CGLPBufferObj *pbuffer, GLenum *face, GLint *level, GLint *screen);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLSetPBuffer(CGLContextObj ctx, CGLPBufferObj pbuffer, GLenum face, GLint level, GLint screen);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLTexImagePBuffer(CGLContextObj ctx, CGLPBufferObj pbuffer, GLenum source);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
** CGL_VERSION_1_2
|
||||
**/
|
||||
|
||||
#if (defined(CGL_VERSION_1_2) || defined(REGAL_NO_ENUM) || defined(REGAL_NO_CGL_VERSION_1_2)) && !defined(REGAL_NO_ENUM_CGL_VERSION_1_2)
|
||||
#define REGAL_NO_ENUM_CGL_VERSION_1_2
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_2) || defined(REGAL_NO_TYPEDEF) || defined(REGAL_NO_CGL_VERSION_1_2)) && !defined(REGAL_NO_TYPEDEF_CGL_VERSION_1_2)
|
||||
#define REGAL_NO_TYPEDEF_CGL_VERSION_1_2
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_2) || !defined(REGAL_NAMESPACE) || defined(REGAL_NO_CGL_VERSION_1_2)) && !defined(REGAL_NO_NAMESPACE_CGL_VERSION_1_2)
|
||||
#define REGAL_NO_NAMESPACE_CGL_VERSION_1_2
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_2) || !defined(REGAL_PLUGIN_MODE) || defined(REGAL_NO_CGL_VERSION_1_2)) && !defined(REGAL_NO_PLUGIN_CGL_VERSION_1_2)
|
||||
#define REGAL_NO_PLUGIN_CGL_VERSION_1_2
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_2) || defined(REGAL_NO_DECLARATION) || defined(REGAL_NO_CGL_VERSION_1_2)) && !defined(REGAL_NO_DECLARATION_CGL_VERSION_1_2)
|
||||
#define REGAL_NO_DECLARATION_CGL_VERSION_1_2
|
||||
#endif
|
||||
|
||||
#ifndef CGL_VERSION_1_2
|
||||
#define CGL_VERSION_1_2 1
|
||||
#endif
|
||||
|
||||
#ifndef REGAL_NO_TYPEDEF_CGL_VERSION_1_2
|
||||
typedef CGLContextObj (REGAL_CALL *PFNCGLRETAINCONTEXTPROC)(CGLContextObj ctx);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLGETGLOBALOPTIONPROC)(CGLGlobalOption pname, GLint *params);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLLOCKCONTEXTPROC)(CGLContextObj ctx);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLSETGLOBALOPTIONPROC)(CGLGlobalOption pname, const GLint *params);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLUNLOCKCONTEXTPROC)(CGLContextObj ctx);
|
||||
typedef CGLPBufferObj (REGAL_CALL *PFNCGLRETAINPBUFFERPROC)(CGLPBufferObj pbuffer);
|
||||
typedef CGLPixelFormatObj (REGAL_CALL *PFNCGLGETPIXELFORMATPROC)(CGLContextObj ctx);
|
||||
typedef CGLPixelFormatObj (REGAL_CALL *PFNCGLRETAINPIXELFORMATPROC)(CGLPixelFormatObj pix);
|
||||
typedef GLuint (REGAL_CALL *PFNCGLGETCONTEXTRETAINCOUNTPROC)(CGLContextObj ctx);
|
||||
typedef GLuint (REGAL_CALL *PFNCGLGETPBUFFERRETAINCOUNTPROC)(CGLPBufferObj pbuffer);
|
||||
typedef GLuint (REGAL_CALL *PFNCGLGETPIXELFORMATRETAINCOUNTPROC)(CGLPixelFormatObj pix);
|
||||
typedef void (REGAL_CALL *PFNCGLRELEASECONTEXTPROC)(CGLContextObj ctx);
|
||||
typedef void (REGAL_CALL *PFNCGLRELEASEPBUFFERPROC)(CGLPBufferObj pbuffer);
|
||||
typedef void (REGAL_CALL *PFNCGLRELEASEPIXELFORMATPROC)(CGLPixelFormatObj pix);
|
||||
#endif
|
||||
|
||||
#ifndef REGAL_NO_NAMESPACE_CGL_VERSION_1_2
|
||||
#define CGLGetContextRetainCount rCGLGetContextRetainCount
|
||||
#define CGLGetGlobalOption rCGLGetGlobalOption
|
||||
#define CGLGetPBufferRetainCount rCGLGetPBufferRetainCount
|
||||
#define CGLGetPixelFormat rCGLGetPixelFormat
|
||||
#define CGLGetPixelFormatRetainCount rCGLGetPixelFormatRetainCount
|
||||
#define CGLLockContext rCGLLockContext
|
||||
#define CGLReleaseContext rCGLReleaseContext
|
||||
#define CGLReleasePBuffer rCGLReleasePBuffer
|
||||
#define CGLReleasePixelFormat rCGLReleasePixelFormat
|
||||
#define CGLRetainContext rCGLRetainContext
|
||||
#define CGLRetainPBuffer rCGLRetainPBuffer
|
||||
#define CGLRetainPixelFormat rCGLRetainPixelFormat
|
||||
#define CGLSetGlobalOption rCGLSetGlobalOption
|
||||
#define CGLUnlockContext rCGLUnlockContext
|
||||
#endif
|
||||
|
||||
#ifndef REGAL_NO_DECLARATION_CGL_VERSION_1_2
|
||||
REGAL_DECL CGLContextObj REGAL_CALL CGLRetainContext(CGLContextObj ctx);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLGetGlobalOption(CGLGlobalOption pname, GLint *params);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLLockContext(CGLContextObj ctx);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLSetGlobalOption(CGLGlobalOption pname, const GLint *params);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLUnlockContext(CGLContextObj ctx);
|
||||
|
||||
REGAL_DECL CGLPBufferObj REGAL_CALL CGLRetainPBuffer(CGLPBufferObj pbuffer);
|
||||
|
||||
REGAL_DECL CGLPixelFormatObj REGAL_CALL CGLGetPixelFormat(CGLContextObj ctx);
|
||||
|
||||
REGAL_DECL CGLPixelFormatObj REGAL_CALL CGLRetainPixelFormat(CGLPixelFormatObj pix);
|
||||
|
||||
REGAL_DECL GLuint REGAL_CALL CGLGetContextRetainCount(CGLContextObj ctx);
|
||||
|
||||
REGAL_DECL GLuint REGAL_CALL CGLGetPBufferRetainCount(CGLPBufferObj pbuffer);
|
||||
|
||||
REGAL_DECL GLuint REGAL_CALL CGLGetPixelFormatRetainCount(CGLPixelFormatObj pix);
|
||||
|
||||
REGAL_DECL void REGAL_CALL CGLReleaseContext(CGLContextObj ctx);
|
||||
|
||||
REGAL_DECL void REGAL_CALL CGLReleasePBuffer(CGLPBufferObj pbuffer);
|
||||
|
||||
REGAL_DECL void REGAL_CALL CGLReleasePixelFormat(CGLPixelFormatObj pix);
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
** CGL_VERSION_1_3
|
||||
**/
|
||||
|
||||
#if (defined(CGL_VERSION_1_3) || defined(REGAL_NO_ENUM) || defined(REGAL_NO_CGL_VERSION_1_3)) && !defined(REGAL_NO_ENUM_CGL_VERSION_1_3)
|
||||
#define REGAL_NO_ENUM_CGL_VERSION_1_3
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_3) || defined(REGAL_NO_TYPEDEF) || defined(REGAL_NO_CGL_VERSION_1_3)) && !defined(REGAL_NO_TYPEDEF_CGL_VERSION_1_3)
|
||||
#define REGAL_NO_TYPEDEF_CGL_VERSION_1_3
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_3) || !defined(REGAL_NAMESPACE) || defined(REGAL_NO_CGL_VERSION_1_3)) && !defined(REGAL_NO_NAMESPACE_CGL_VERSION_1_3)
|
||||
#define REGAL_NO_NAMESPACE_CGL_VERSION_1_3
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_3) || !defined(REGAL_PLUGIN_MODE) || defined(REGAL_NO_CGL_VERSION_1_3)) && !defined(REGAL_NO_PLUGIN_CGL_VERSION_1_3)
|
||||
#define REGAL_NO_PLUGIN_CGL_VERSION_1_3
|
||||
#endif
|
||||
|
||||
#if (defined(CGL_VERSION_1_3) || defined(REGAL_NO_DECLARATION) || defined(REGAL_NO_CGL_VERSION_1_3)) && !defined(REGAL_NO_DECLARATION_CGL_VERSION_1_3)
|
||||
#define REGAL_NO_DECLARATION_CGL_VERSION_1_3
|
||||
#endif
|
||||
|
||||
#ifndef CGL_VERSION_1_3
|
||||
#define CGL_VERSION_1_3 1
|
||||
#endif
|
||||
|
||||
#ifndef REGAL_NO_TYPEDEF_CGL_VERSION_1_3
|
||||
typedef CGLContextObj (REGAL_CALL *PFNCGLGETCURRENTCONTEXTPROC)(void);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLGETSURFACEPROC)(CGLContextObj ctx, CGSConnectionID *conn, CGSWindowID *win, CGSSurfaceID *srf);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLSETCURRENTCONTEXTPROC)(CGLContextObj ctx);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLSETSURFACEPROC)(CGLContextObj ctx, CGSConnectionID conn, CGSWindowID win, CGSSurfaceID srf);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLTEXIMAGEIOSURFACE2DPROC)(CGLContextObj ctx, GLenum target, GLenum internal_format, GLsizei width, GLsizei height, GLenum format, GLenum type, IOSurfaceRef ioSurface, GLuint plane);
|
||||
typedef CGLError (REGAL_CALL *PFNCGLUPDATECONTEXTPROC)(CGLContextObj ctx);
|
||||
typedef CGLShareGroupObj (REGAL_CALL *PFNCGLGETSHAREGROUPPROC)(CGLContextObj ctx);
|
||||
#endif
|
||||
|
||||
#ifndef REGAL_NO_NAMESPACE_CGL_VERSION_1_3
|
||||
#define CGLGetCurrentContext rCGLGetCurrentContext
|
||||
#define CGLGetShareGroup rCGLGetShareGroup
|
||||
#define CGLGetSurface rCGLGetSurface
|
||||
#define CGLSetCurrentContext rCGLSetCurrentContext
|
||||
#define CGLSetSurface rCGLSetSurface
|
||||
#define CGLTexImageIOSurface2D rCGLTexImageIOSurface2D
|
||||
#define CGLUpdateContext rCGLUpdateContext
|
||||
#endif
|
||||
|
||||
#ifndef REGAL_NO_DECLARATION_CGL_VERSION_1_3
|
||||
REGAL_DECL CGLContextObj REGAL_CALL CGLGetCurrentContext(void);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLGetSurface(CGLContextObj ctx, CGSConnectionID *conn, CGSWindowID *win, CGSSurfaceID *srf);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLSetCurrentContext(CGLContextObj ctx);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLSetSurface(CGLContextObj ctx, CGSConnectionID conn, CGSWindowID win, CGSSurfaceID srf);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLTexImageIOSurface2D(CGLContextObj ctx, GLenum target, GLenum internal_format, GLsizei width, GLsizei height, GLenum format, GLenum type, IOSurfaceRef ioSurface, GLuint plane);
|
||||
|
||||
REGAL_DECL CGLError REGAL_CALL CGLUpdateContext(CGLContextObj ctx);
|
||||
|
||||
REGAL_DECL CGLShareGroupObj REGAL_CALL CGLGetShareGroup(CGLContextObj ctx);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* REGAL_SYS_OSX */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __REGAL_CGL_H__ */
|
||||
1797
include/GL/RegalEGL.h
Normal file
1797
include/GL/RegalEGL.h
Normal file
File diff suppressed because it is too large
Load diff
18093
include/GL/RegalGLEW.h
18093
include/GL/RegalGLEW.h
File diff suppressed because it is too large
Load diff
|
|
@ -1,361 +0,0 @@
|
|||
/*
|
||||
* SGI FREE SOFTWARE LICENSE B (Version 2.0, Sept. 18, 2008)
|
||||
* Copyright (C) 1991-2000 Silicon Graphics, Inc. All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice including the dates of first publication and
|
||||
* either this permission notice or a reference to
|
||||
* http://oss.sgi.com/projects/FreeB/
|
||||
* shall be included in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* SILICON GRAPHICS, INC. BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
|
||||
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
|
||||
* OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
* SOFTWARE.
|
||||
*
|
||||
* Except as contained in this notice, the name of Silicon Graphics, Inc.
|
||||
* shall not be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in this Software without prior written authorization from
|
||||
* Silicon Graphics, Inc.
|
||||
*/
|
||||
|
||||
#ifndef __glu_h__
|
||||
#define __glu_h__
|
||||
|
||||
#include <GL/Regal.h>
|
||||
|
||||
#if REGAL_SYS_WGL
|
||||
# define REGALGLU_CALL __stdcall
|
||||
#else
|
||||
# define REGALGLU_CALL
|
||||
#endif
|
||||
|
||||
/* REGALGLU_DECL specified in the build, or inferred here... */
|
||||
|
||||
#ifndef REGALGLU_DECL
|
||||
# ifdef _WIN32
|
||||
# if REGALGLU_DECL_EXPORT
|
||||
# define REGALGLU_DECL
|
||||
# else
|
||||
# define REGALGLU_DECL __declspec(dllimport)
|
||||
# endif
|
||||
# elif defined(__GNUC__) && __GNUC__>=4
|
||||
# if REGALGLU_DECL_EXPORT
|
||||
# define REGALGLU_DECL __attribute__ ((visibility("default")))
|
||||
# else
|
||||
# define REGALGLU_DECL
|
||||
# endif
|
||||
# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
||||
# if REGALGLU_DECL_EXPORT
|
||||
# define REGALGLU_DECL __global
|
||||
# else
|
||||
# define REGALGLU_DECL
|
||||
# endif
|
||||
# else
|
||||
# define REGALGLU_DECL
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifndef REGALGLU_CALLP
|
||||
#define REGALGLU_CALLP REGALGLU_CALL *
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
/* Extensions */
|
||||
#define GLU_EXT_object_space_tess 1
|
||||
#define GLU_EXT_nurbs_tessellator 1
|
||||
|
||||
/* Boolean */
|
||||
#define GLU_FALSE 0
|
||||
#define GLU_TRUE 1
|
||||
|
||||
/* Version */
|
||||
#define GLU_VERSION_1_1 1
|
||||
#define GLU_VERSION_1_2 1
|
||||
#define GLU_VERSION_1_3 1
|
||||
|
||||
/* StringName */
|
||||
#define GLU_VERSION 100800
|
||||
#define GLU_EXTENSIONS 100801
|
||||
|
||||
/* ErrorCode */
|
||||
#define GLU_INVALID_ENUM 100900
|
||||
#define GLU_INVALID_VALUE 100901
|
||||
#define GLU_OUT_OF_MEMORY 100902
|
||||
#define GLU_INCOMPATIBLE_GL_VERSION 100903
|
||||
#define GLU_INVALID_OPERATION 100904
|
||||
|
||||
/* NurbsDisplay */
|
||||
/* GLU_FILL */
|
||||
#define GLU_OUTLINE_POLYGON 100240
|
||||
#define GLU_OUTLINE_PATCH 100241
|
||||
|
||||
/* NurbsCallback */
|
||||
#define GLU_NURBS_ERROR 100103
|
||||
#define GLU_ERROR 100103
|
||||
#define GLU_NURBS_BEGIN 100164
|
||||
#define GLU_NURBS_BEGIN_EXT 100164
|
||||
#define GLU_NURBS_VERTEX 100165
|
||||
#define GLU_NURBS_VERTEX_EXT 100165
|
||||
#define GLU_NURBS_NORMAL 100166
|
||||
#define GLU_NURBS_NORMAL_EXT 100166
|
||||
#define GLU_NURBS_COLOR 100167
|
||||
#define GLU_NURBS_COLOR_EXT 100167
|
||||
#define GLU_NURBS_TEXTURE_COORD 100168
|
||||
#define GLU_NURBS_TEX_COORD_EXT 100168
|
||||
#define GLU_NURBS_END 100169
|
||||
#define GLU_NURBS_END_EXT 100169
|
||||
#define GLU_NURBS_BEGIN_DATA 100170
|
||||
#define GLU_NURBS_BEGIN_DATA_EXT 100170
|
||||
#define GLU_NURBS_VERTEX_DATA 100171
|
||||
#define GLU_NURBS_VERTEX_DATA_EXT 100171
|
||||
#define GLU_NURBS_NORMAL_DATA 100172
|
||||
#define GLU_NURBS_NORMAL_DATA_EXT 100172
|
||||
#define GLU_NURBS_COLOR_DATA 100173
|
||||
#define GLU_NURBS_COLOR_DATA_EXT 100173
|
||||
#define GLU_NURBS_TEXTURE_COORD_DATA 100174
|
||||
#define GLU_NURBS_TEX_COORD_DATA_EXT 100174
|
||||
#define GLU_NURBS_END_DATA 100175
|
||||
#define GLU_NURBS_END_DATA_EXT 100175
|
||||
|
||||
/* NurbsError */
|
||||
#define GLU_NURBS_ERROR1 100251
|
||||
#define GLU_NURBS_ERROR2 100252
|
||||
#define GLU_NURBS_ERROR3 100253
|
||||
#define GLU_NURBS_ERROR4 100254
|
||||
#define GLU_NURBS_ERROR5 100255
|
||||
#define GLU_NURBS_ERROR6 100256
|
||||
#define GLU_NURBS_ERROR7 100257
|
||||
#define GLU_NURBS_ERROR8 100258
|
||||
#define GLU_NURBS_ERROR9 100259
|
||||
#define GLU_NURBS_ERROR10 100260
|
||||
#define GLU_NURBS_ERROR11 100261
|
||||
#define GLU_NURBS_ERROR12 100262
|
||||
#define GLU_NURBS_ERROR13 100263
|
||||
#define GLU_NURBS_ERROR14 100264
|
||||
#define GLU_NURBS_ERROR15 100265
|
||||
#define GLU_NURBS_ERROR16 100266
|
||||
#define GLU_NURBS_ERROR17 100267
|
||||
#define GLU_NURBS_ERROR18 100268
|
||||
#define GLU_NURBS_ERROR19 100269
|
||||
#define GLU_NURBS_ERROR20 100270
|
||||
#define GLU_NURBS_ERROR21 100271
|
||||
#define GLU_NURBS_ERROR22 100272
|
||||
#define GLU_NURBS_ERROR23 100273
|
||||
#define GLU_NURBS_ERROR24 100274
|
||||
#define GLU_NURBS_ERROR25 100275
|
||||
#define GLU_NURBS_ERROR26 100276
|
||||
#define GLU_NURBS_ERROR27 100277
|
||||
#define GLU_NURBS_ERROR28 100278
|
||||
#define GLU_NURBS_ERROR29 100279
|
||||
#define GLU_NURBS_ERROR30 100280
|
||||
#define GLU_NURBS_ERROR31 100281
|
||||
#define GLU_NURBS_ERROR32 100282
|
||||
#define GLU_NURBS_ERROR33 100283
|
||||
#define GLU_NURBS_ERROR34 100284
|
||||
#define GLU_NURBS_ERROR35 100285
|
||||
#define GLU_NURBS_ERROR36 100286
|
||||
#define GLU_NURBS_ERROR37 100287
|
||||
|
||||
/* NurbsProperty */
|
||||
#define GLU_AUTO_LOAD_MATRIX 100200
|
||||
#define GLU_CULLING 100201
|
||||
#define GLU_SAMPLING_TOLERANCE 100203
|
||||
#define GLU_DISPLAY_MODE 100204
|
||||
#define GLU_PARAMETRIC_TOLERANCE 100202
|
||||
#define GLU_SAMPLING_METHOD 100205
|
||||
#define GLU_U_STEP 100206
|
||||
#define GLU_V_STEP 100207
|
||||
#define GLU_NURBS_MODE 100160
|
||||
#define GLU_NURBS_MODE_EXT 100160
|
||||
#define GLU_NURBS_TESSELLATOR 100161
|
||||
#define GLU_NURBS_TESSELLATOR_EXT 100161
|
||||
#define GLU_NURBS_RENDERER 100162
|
||||
#define GLU_NURBS_RENDERER_EXT 100162
|
||||
|
||||
/* NurbsSampling */
|
||||
#define GLU_OBJECT_PARAMETRIC_ERROR 100208
|
||||
#define GLU_OBJECT_PARAMETRIC_ERROR_EXT 100208
|
||||
#define GLU_OBJECT_PATH_LENGTH 100209
|
||||
#define GLU_OBJECT_PATH_LENGTH_EXT 100209
|
||||
#define GLU_PATH_LENGTH 100215
|
||||
#define GLU_PARAMETRIC_ERROR 100216
|
||||
#define GLU_DOMAIN_DISTANCE 100217
|
||||
|
||||
/* NurbsTrim */
|
||||
#define GLU_MAP1_TRIM_2 100210
|
||||
#define GLU_MAP1_TRIM_3 100211
|
||||
|
||||
/* QuadricDrawStyle */
|
||||
#define GLU_POINT 100010
|
||||
#define GLU_LINE 100011
|
||||
#define GLU_FILL 100012
|
||||
#define GLU_SILHOUETTE 100013
|
||||
|
||||
/* QuadricCallback */
|
||||
/* GLU_ERROR */
|
||||
|
||||
/* QuadricNormal */
|
||||
#define GLU_SMOOTH 100000
|
||||
#define GLU_FLAT 100001
|
||||
#define GLU_NONE 100002
|
||||
|
||||
/* QuadricOrientation */
|
||||
#define GLU_OUTSIDE 100020
|
||||
#define GLU_INSIDE 100021
|
||||
|
||||
/* TessCallback */
|
||||
#define GLU_TESS_BEGIN 100100
|
||||
#define GLU_BEGIN 100100
|
||||
#define GLU_TESS_VERTEX 100101
|
||||
#define GLU_VERTEX 100101
|
||||
#define GLU_TESS_END 100102
|
||||
#define GLU_END 100102
|
||||
#define GLU_TESS_ERROR 100103
|
||||
#define GLU_TESS_EDGE_FLAG 100104
|
||||
#define GLU_EDGE_FLAG 100104
|
||||
#define GLU_TESS_COMBINE 100105
|
||||
#define GLU_TESS_BEGIN_DATA 100106
|
||||
#define GLU_TESS_VERTEX_DATA 100107
|
||||
#define GLU_TESS_END_DATA 100108
|
||||
#define GLU_TESS_ERROR_DATA 100109
|
||||
#define GLU_TESS_EDGE_FLAG_DATA 100110
|
||||
#define GLU_TESS_COMBINE_DATA 100111
|
||||
|
||||
/* TessContour */
|
||||
#define GLU_CW 100120
|
||||
#define GLU_CCW 100121
|
||||
#define GLU_INTERIOR 100122
|
||||
#define GLU_EXTERIOR 100123
|
||||
#define GLU_UNKNOWN 100124
|
||||
|
||||
/* TessProperty */
|
||||
#define GLU_TESS_WINDING_RULE 100140
|
||||
#define GLU_TESS_BOUNDARY_ONLY 100141
|
||||
#define GLU_TESS_TOLERANCE 100142
|
||||
|
||||
/* TessError */
|
||||
#define GLU_TESS_ERROR1 100151
|
||||
#define GLU_TESS_ERROR2 100152
|
||||
#define GLU_TESS_ERROR3 100153
|
||||
#define GLU_TESS_ERROR4 100154
|
||||
#define GLU_TESS_ERROR5 100155
|
||||
#define GLU_TESS_ERROR6 100156
|
||||
#define GLU_TESS_ERROR7 100157
|
||||
#define GLU_TESS_ERROR8 100158
|
||||
#define GLU_TESS_MISSING_BEGIN_POLYGON 100151
|
||||
#define GLU_TESS_MISSING_BEGIN_CONTOUR 100152
|
||||
#define GLU_TESS_MISSING_END_POLYGON 100153
|
||||
#define GLU_TESS_MISSING_END_CONTOUR 100154
|
||||
#define GLU_TESS_COORD_TOO_LARGE 100155
|
||||
#define GLU_TESS_NEED_COMBINE_CALLBACK 100156
|
||||
|
||||
/* TessWinding */
|
||||
#define GLU_TESS_WINDING_ODD 100130
|
||||
#define GLU_TESS_WINDING_NONZERO 100131
|
||||
#define GLU_TESS_WINDING_POSITIVE 100132
|
||||
#define GLU_TESS_WINDING_NEGATIVE 100133
|
||||
#define GLU_TESS_WINDING_ABS_GEQ_TWO 100134
|
||||
|
||||
/*************************************************************/
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
class GLUnurbs;
|
||||
class GLUquadric;
|
||||
class GLUtesselator;
|
||||
#else
|
||||
typedef struct GLUnurbs GLUnurbs;
|
||||
typedef struct GLUquadric GLUquadric;
|
||||
typedef struct GLUtesselator GLUtesselator;
|
||||
#endif
|
||||
|
||||
typedef GLUnurbs GLUnurbsObj;
|
||||
typedef GLUquadric GLUquadricObj;
|
||||
typedef GLUtesselator GLUtesselatorObj;
|
||||
typedef GLUtesselator GLUtriangulatorObj;
|
||||
|
||||
#define GLU_TESS_MAX_COORD 1.0e150
|
||||
|
||||
/* Internal convenience typedefs */
|
||||
typedef void (REGALGLU_CALLP _GLUfuncptr)(void);
|
||||
|
||||
REGALGLU_DECL void REGALGLU_CALL gluBeginCurve (GLUnurbs* nurb);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluBeginPolygon (GLUtesselator* tess);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluBeginSurface (GLUnurbs* nurb);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluBeginTrim (GLUnurbs* nurb);
|
||||
REGALGLU_DECL GLint REGALGLU_CALL gluBuild1DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
REGALGLU_DECL GLint REGALGLU_CALL gluBuild1DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLenum format, GLenum type, const void *data);
|
||||
REGALGLU_DECL GLint REGALGLU_CALL gluBuild2DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
REGALGLU_DECL GLint REGALGLU_CALL gluBuild2DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *data);
|
||||
REGALGLU_DECL GLint REGALGLU_CALL gluBuild3DMipmapLevels (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLint level, GLint base, GLint max, const void *data);
|
||||
REGALGLU_DECL GLint REGALGLU_CALL gluBuild3DMipmaps (GLenum target, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void *data);
|
||||
REGALGLU_DECL GLboolean REGALGLU_CALL gluCheckExtension (const GLubyte *extName, const GLubyte *extString);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluCylinder (GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluDeleteNurbsRenderer (GLUnurbs* nurb);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluDeleteQuadric (GLUquadric* quad);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluDeleteTess (GLUtesselator* tess);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluEndCurve (GLUnurbs* nurb);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluEndPolygon (GLUtesselator* tess);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluEndSurface (GLUnurbs* nurb);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluEndTrim (GLUnurbs* nurb);
|
||||
REGALGLU_DECL const GLubyte * REGALGLU_CALL gluErrorString (GLenum error);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluGetNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat* data);
|
||||
REGALGLU_DECL const GLubyte * REGALGLU_CALL gluGetString (GLenum name);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluGetTessProperty (GLUtesselator* tess, GLenum which, GLdouble* data);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluLoadSamplingMatrices (GLUnurbs* nurb, const GLfloat *model, const GLfloat *perspective, const GLint *view);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluLookAt (GLdouble eyeX, GLdouble eyeY, GLdouble eyeZ, GLdouble centerX, GLdouble centerY, GLdouble centerZ, GLdouble upX, GLdouble upY, GLdouble upZ);
|
||||
REGALGLU_DECL GLUnurbs* REGALGLU_CALL gluNewNurbsRenderer (void);
|
||||
REGALGLU_DECL GLUquadric* REGALGLU_CALL gluNewQuadric (void);
|
||||
REGALGLU_DECL GLUtesselator* REGALGLU_CALL gluNewTess (void);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluNextContour (GLUtesselator* tess, GLenum type);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluNurbsCallback (GLUnurbs* nurb, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluNurbsCallbackData (GLUnurbs* nurb, GLvoid* userData);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluNurbsCallbackDataEXT (GLUnurbs* nurb, GLvoid* userData);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluNurbsCurve (GLUnurbs* nurb, GLint knotCount, GLfloat *knots, GLint stride, GLfloat *control, GLint order, GLenum type);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluNurbsProperty (GLUnurbs* nurb, GLenum property, GLfloat value);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluNurbsSurface (GLUnurbs* nurb, GLint sKnotCount, GLfloat* sKnots, GLint tKnotCount, GLfloat* tKnots, GLint sStride, GLint tStride, GLfloat* control, GLint sOrder, GLint tOrder, GLenum type);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluOrtho2D (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluPartialDisk (GLUquadric* quad, GLdouble inner, GLdouble outer, GLint slices, GLint loops, GLdouble start, GLdouble sweep);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluPerspective (GLdouble fovy, GLdouble aspect, GLdouble zNear, GLdouble zFar);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluPickMatrix (GLdouble x, GLdouble y, GLdouble delX, GLdouble delY, GLint *viewport);
|
||||
REGALGLU_DECL GLint REGALGLU_CALL gluProject (GLdouble objX, GLdouble objY, GLdouble objZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* winX, GLdouble* winY, GLdouble* winZ);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluPwlCurve (GLUnurbs* nurb, GLint count, GLfloat* data, GLint stride, GLenum type);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluQuadricCallback (GLUquadric* quad, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluQuadricDrawStyle (GLUquadric* quad, GLenum draw);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluQuadricNormals (GLUquadric* quad, GLenum normal);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluQuadricOrientation (GLUquadric* quad, GLenum orientation);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluQuadricTexture (GLUquadric* quad, GLboolean texture);
|
||||
REGALGLU_DECL GLint REGALGLU_CALL gluScaleImage (GLenum format, GLsizei wIn, GLsizei hIn, GLenum typeIn, const void *dataIn, GLsizei wOut, GLsizei hOut, GLenum typeOut, GLvoid* dataOut);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluSphere (GLUquadric* quad, GLdouble radius, GLint slices, GLint stacks);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluTessBeginContour (GLUtesselator* tess);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluTessBeginPolygon (GLUtesselator* tess, GLvoid* data);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluTessCallback (GLUtesselator* tess, GLenum which, _GLUfuncptr CallBackFunc);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluTessEndContour (GLUtesselator* tess);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluTessEndPolygon (GLUtesselator* tess);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluTessNormal (GLUtesselator* tess, GLdouble valueX, GLdouble valueY, GLdouble valueZ);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluTessProperty (GLUtesselator* tess, GLenum which, GLdouble data);
|
||||
REGALGLU_DECL void REGALGLU_CALL gluTessVertex (GLUtesselator* tess, GLdouble *location, GLvoid* data);
|
||||
REGALGLU_DECL GLint REGALGLU_CALL gluUnProject (GLdouble winX, GLdouble winY, GLdouble winZ, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble* objX, GLdouble* objY, GLdouble* objZ);
|
||||
REGALGLU_DECL GLint REGALGLU_CALL gluUnProject4 (GLdouble winX, GLdouble winY, GLdouble winZ, GLdouble clipW, const GLdouble *model, const GLdouble *proj, const GLint *view, GLdouble nearVal, GLdouble farVal, GLdouble* objX, GLdouble* objY, GLdouble* objZ, GLdouble* objW);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __glu_h__ */
|
||||
|
|
@ -1,665 +0,0 @@
|
|||
#ifndef __glut_h__
|
||||
#define __glut_h__
|
||||
|
||||
/* Copyright (c) Mark J. Kilgard, 1994, 1995, 1996, 1998. */
|
||||
|
||||
/* This program is freely distributable without licensing fees and is
|
||||
provided without guarantee or warrantee expressed or implied. This
|
||||
program is -not- in the public domain. */
|
||||
|
||||
#if defined(_WIN32)
|
||||
# ifndef WIN32_LEAN_AND_MEAN
|
||||
# define WIN32_LEAN_AND_MEAN 1
|
||||
# endif
|
||||
# include <windows.h>
|
||||
#endif
|
||||
|
||||
#include <GL/Regal.h>
|
||||
#include <GL/RegalGLU.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32)
|
||||
|
||||
/* To disable automatic library usage for GLUT, define GLUT_NO_LIB_PRAGMA
|
||||
in your compile preprocessor options. */
|
||||
# if defined(_MSC_VER) && !defined(GLUT_BUILDING_LIB) && !defined(GLUT_NO_LIB_PRAGMA)
|
||||
# pragma comment (lib, "winmm.lib") /* link with Windows MultiMedia lib */
|
||||
/* To enable automatic SGI OpenGL for Windows library usage for GLUT,
|
||||
define GLUT_USE_SGI_OPENGL in your compile preprocessor options. */
|
||||
# ifdef GLUT_USE_SGI_OPENGL
|
||||
# pragma comment (lib, "opengl.lib") /* link with SGI OpenGL for Windows lib */
|
||||
# pragma comment (lib, "glu.lib") /* link with SGI OpenGL Utility lib */
|
||||
# pragma comment (lib, "glut.lib") /* link with Win32 GLUT for SGI OpenGL lib */
|
||||
# else
|
||||
# pragma comment (lib, "opengl32.lib") /* link with Microsoft OpenGL lib */
|
||||
# pragma comment (lib, "glu32.lib") /* link with Microsoft OpenGL Utility lib */
|
||||
# pragma comment (lib, "glut32.lib") /* link with Win32 GLUT lib */
|
||||
# endif
|
||||
# endif
|
||||
|
||||
/* To disable supression of annoying warnings about floats being promoted
|
||||
to doubles, define GLUT_NO_WARNING_DISABLE in your compile preprocessor
|
||||
options. */
|
||||
# if defined(_MSC_VER) && !defined(GLUT_NO_WARNING_DISABLE)
|
||||
# pragma warning (disable:4244) /* Disable bogus VC++ 4.2 conversion warnings. */
|
||||
# pragma warning (disable:4305) /* VC++ 5.0 version of above warning. */
|
||||
# endif
|
||||
|
||||
/* Win32 has an annoying issue where there are multiple C run-time
|
||||
libraries (CRTs). If the executable is linked with a different CRT
|
||||
from the GLUT DLL, the GLUT DLL will not share the same CRT static
|
||||
data seen by the executable. In particular, atexit callbacks registered
|
||||
in the executable will not be called if GLUT calls its (different)
|
||||
exit routine). GLUT is typically built with the
|
||||
"/MD" option (the CRT with multithreading DLL support), but the Visual
|
||||
C++ linker default is "/ML" (the single threaded CRT).
|
||||
|
||||
One workaround to this issue is requiring users to always link with
|
||||
the same CRT as GLUT is compiled with. That requires users supply a
|
||||
non-standard option. GLUT 3.7 has its own built-in workaround where
|
||||
the executable's "exit" function pointer is covertly passed to GLUT.
|
||||
GLUT then calls the executable's exit function pointer to ensure that
|
||||
any "atexit" calls registered by the application are called if GLUT
|
||||
needs to exit.
|
||||
|
||||
Note that the __glut*WithExit routines should NEVER be called directly.
|
||||
To avoid the atexit workaround, #define GLUT_DISABLE_ATEXIT_HACK. */
|
||||
|
||||
/* XXX This is from Win32's <process.h> */
|
||||
# if !defined(_MSC_VER) && !defined(__MINGW32__) && !defined(__cdecl)
|
||||
/* Define __cdecl for non-Microsoft compilers. */
|
||||
# define __cdecl
|
||||
# define GLUT_DEFINED___CDECL
|
||||
# endif
|
||||
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
/* GLUT callback calling convention for Win32. */
|
||||
# define GLUTCALLBACK __cdecl
|
||||
|
||||
/* for callback/function pointer defs */
|
||||
# define GLUTAPIENTRYV __cdecl
|
||||
|
||||
/* glut-win32 specific macros, defined to prevent collision with
|
||||
and redifinition of Windows system defs, also removes requirement of
|
||||
pretty much any standard windows header from this file */
|
||||
|
||||
#if (_MSC_VER >= 800) || defined(__MINGW32__) || defined(_STDCALL_SUPPORTED) || defined(__CYGWIN32__)
|
||||
# define GLUTAPIENTRY __stdcall
|
||||
#else
|
||||
# define GLUTAPIENTRY
|
||||
#endif
|
||||
|
||||
/* GLUT API entry point declarations for Win32. */
|
||||
#if (defined(BUILD_GLUT32) || defined(GLUT_BUILDING_LIB)) && !defined(GLUT_STATIC)
|
||||
# define GLUTAPI __declspec(dllexport)
|
||||
#elif !defined(GLUT_STATIC)
|
||||
# define GLUTAPI __declspec(dllimport)
|
||||
#else
|
||||
# define GLUTAPI extern
|
||||
#endif
|
||||
|
||||
#elif defined(__GNUC__)
|
||||
|
||||
# define GLUTAPIENTRY
|
||||
# define GLUTAPIENTRYV
|
||||
# define GLUTCALLBACK
|
||||
# define GLUTAPI extern __attribute__((visibility("default")))
|
||||
|
||||
#else
|
||||
|
||||
/* Define GLUTAPIENTRY and GLUTCALLBACK to nothing */
|
||||
# define GLUTAPIENTRY
|
||||
# define GLUTAPIENTRYV
|
||||
# define GLUTCALLBACK
|
||||
# define GLUTAPI extern
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
GLUT API revision history:
|
||||
|
||||
GLUT_API_VERSION is updated to reflect incompatible GLUT
|
||||
API changes (interface changes, semantic changes, deletions,
|
||||
or additions).
|
||||
|
||||
GLUT_API_VERSION=1 First public release of GLUT. 11/29/94
|
||||
|
||||
GLUT_API_VERSION=2 Added support for OpenGL/GLX multisampling,
|
||||
extension. Supports new input devices like tablet, dial and button
|
||||
box, and Spaceball. Easy to query OpenGL extensions.
|
||||
|
||||
GLUT_API_VERSION=3 glutMenuStatus added.
|
||||
|
||||
GLUT_API_VERSION=4 glutInitDisplayString, glutWarpPointer,
|
||||
glutBitmapLength, glutStrokeLength, glutWindowStatusFunc, dynamic
|
||||
video resize subAPI, glutPostWindowRedisplay, glutKeyboardUpFunc,
|
||||
glutSpecialUpFunc, glutIgnoreKeyRepeat, glutSetKeyRepeat,
|
||||
glutJoystickFunc, glutForceJoystickFunc (NOT FINALIZED!).
|
||||
|
||||
GLUT_API_VERSION=5 glutGetProcAddress (added by BrianP)
|
||||
**/
|
||||
#ifndef GLUT_API_VERSION /* allow this to be overriden */
|
||||
#define GLUT_API_VERSION 5
|
||||
#endif
|
||||
|
||||
/**
|
||||
GLUT implementation revision history:
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION is updated to reflect both GLUT
|
||||
API revisions and implementation revisions (ie, bug fixes).
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=1 mjk's first public release of
|
||||
GLUT Xlib-based implementation. 11/29/94
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=2 mjk's second public release of
|
||||
GLUT Xlib-based implementation providing GLUT version 2
|
||||
interfaces.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=3 mjk's GLUT 2.2 images. 4/17/95
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=4 mjk's GLUT 2.3 images. 6/?/95
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=5 mjk's GLUT 3.0 images. 10/?/95
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=7 mjk's GLUT 3.1+ with glutWarpPoitner. 7/24/96
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=8 mjk's GLUT 3.1+ with glutWarpPoitner
|
||||
and video resize. 1/3/97
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=9 mjk's GLUT 3.4 release with early GLUT 4 routines.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=11 Mesa 2.5's GLUT 3.6 release.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=12 mjk's GLUT 3.6 release with early GLUT 4 routines + signal handling.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=13 mjk's GLUT 3.7 beta with GameGLUT support.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=14 mjk's GLUT 3.7 beta with f90gl friend interface.
|
||||
|
||||
GLUT_XLIB_IMPLEMENTATION=15 mjk's GLUT 3.7 beta sync'ed with Mesa <GL/glut.h>
|
||||
**/
|
||||
#ifndef GLUT_XLIB_IMPLEMENTATION /* Allow this to be overriden. */
|
||||
#define GLUT_XLIB_IMPLEMENTATION 15
|
||||
#endif
|
||||
|
||||
/* Display mode bit masks. */
|
||||
#define GLUT_RGB 0
|
||||
#define GLUT_RGBA GLUT_RGB
|
||||
#define GLUT_INDEX 1
|
||||
#define GLUT_SINGLE 0
|
||||
#define GLUT_DOUBLE 2
|
||||
#define GLUT_ACCUM 4
|
||||
#define GLUT_ALPHA 8
|
||||
#define GLUT_DEPTH 16
|
||||
#define GLUT_STENCIL 32
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
#define GLUT_MULTISAMPLE 128
|
||||
#define GLUT_STEREO 256
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
#define GLUT_LUMINANCE 512
|
||||
#endif
|
||||
|
||||
/* Mouse buttons. */
|
||||
#define GLUT_LEFT_BUTTON 0
|
||||
#define GLUT_MIDDLE_BUTTON 1
|
||||
#define GLUT_RIGHT_BUTTON 2
|
||||
|
||||
/* Mouse button state. */
|
||||
#define GLUT_DOWN 0
|
||||
#define GLUT_UP 1
|
||||
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
/* function keys */
|
||||
#define GLUT_KEY_F1 1
|
||||
#define GLUT_KEY_F2 2
|
||||
#define GLUT_KEY_F3 3
|
||||
#define GLUT_KEY_F4 4
|
||||
#define GLUT_KEY_F5 5
|
||||
#define GLUT_KEY_F6 6
|
||||
#define GLUT_KEY_F7 7
|
||||
#define GLUT_KEY_F8 8
|
||||
#define GLUT_KEY_F9 9
|
||||
#define GLUT_KEY_F10 10
|
||||
#define GLUT_KEY_F11 11
|
||||
#define GLUT_KEY_F12 12
|
||||
/* directional keys */
|
||||
#define GLUT_KEY_LEFT 100
|
||||
#define GLUT_KEY_UP 101
|
||||
#define GLUT_KEY_RIGHT 102
|
||||
#define GLUT_KEY_DOWN 103
|
||||
#define GLUT_KEY_PAGE_UP 104
|
||||
#define GLUT_KEY_PAGE_DOWN 105
|
||||
#define GLUT_KEY_HOME 106
|
||||
#define GLUT_KEY_END 107
|
||||
#define GLUT_KEY_INSERT 108
|
||||
#endif
|
||||
|
||||
/* Entry/exit state. */
|
||||
#define GLUT_LEFT 0
|
||||
#define GLUT_ENTERED 1
|
||||
|
||||
/* Menu usage state. */
|
||||
#define GLUT_MENU_NOT_IN_USE 0
|
||||
#define GLUT_MENU_IN_USE 1
|
||||
|
||||
/* Visibility state. */
|
||||
#define GLUT_NOT_VISIBLE 0
|
||||
#define GLUT_VISIBLE 1
|
||||
|
||||
/* Window status state. */
|
||||
#define GLUT_HIDDEN 0
|
||||
#define GLUT_FULLY_RETAINED 1
|
||||
#define GLUT_PARTIALLY_RETAINED 2
|
||||
#define GLUT_FULLY_COVERED 3
|
||||
|
||||
/* Color index component selection values. */
|
||||
#define GLUT_RED 0
|
||||
#define GLUT_GREEN 1
|
||||
#define GLUT_BLUE 2
|
||||
|
||||
/* Layers for use. */
|
||||
#define GLUT_NORMAL 0
|
||||
#define GLUT_OVERLAY 1
|
||||
|
||||
#if defined(_WIN32) || defined (GLUT_IMPORT_LIB)
|
||||
/* Stroke font constants (use these in GLUT program). */
|
||||
#define GLUT_STROKE_ROMAN ((void*)0)
|
||||
#define GLUT_STROKE_MONO_ROMAN ((void*)1)
|
||||
|
||||
/* Bitmap font constants (use these in GLUT program). */
|
||||
#define GLUT_BITMAP_9_BY_15 ((void*)2)
|
||||
#define GLUT_BITMAP_8_BY_13 ((void*)3)
|
||||
#define GLUT_BITMAP_TIMES_ROMAN_10 ((void*)4)
|
||||
#define GLUT_BITMAP_TIMES_ROMAN_24 ((void*)5)
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
#define GLUT_BITMAP_HELVETICA_10 ((void*)6)
|
||||
#define GLUT_BITMAP_HELVETICA_12 ((void*)7)
|
||||
#define GLUT_BITMAP_HELVETICA_18 ((void*)8)
|
||||
#endif
|
||||
#else
|
||||
/* Stroke font opaque addresses (use constants instead in source code). */
|
||||
GLUTAPI void *glutStrokeRoman;
|
||||
GLUTAPI void *glutStrokeMonoRoman;
|
||||
|
||||
/* Stroke font constants (use these in GLUT program). */
|
||||
#define GLUT_STROKE_ROMAN (&glutStrokeRoman)
|
||||
#define GLUT_STROKE_MONO_ROMAN (&glutStrokeMonoRoman)
|
||||
|
||||
/* Bitmap font opaque addresses (use constants instead in source code). */
|
||||
GLUTAPI void *glutBitmap9By15;
|
||||
GLUTAPI void *glutBitmap8By13;
|
||||
GLUTAPI void *glutBitmapTimesRoman10;
|
||||
GLUTAPI void *glutBitmapTimesRoman24;
|
||||
GLUTAPI void *glutBitmapHelvetica10;
|
||||
GLUTAPI void *glutBitmapHelvetica12;
|
||||
GLUTAPI void *glutBitmapHelvetica18;
|
||||
|
||||
/* Bitmap font constants (use these in GLUT program). */
|
||||
#define GLUT_BITMAP_9_BY_15 (&glutBitmap9By15)
|
||||
#define GLUT_BITMAP_8_BY_13 (&glutBitmap8By13)
|
||||
#define GLUT_BITMAP_TIMES_ROMAN_10 (&glutBitmapTimesRoman10)
|
||||
#define GLUT_BITMAP_TIMES_ROMAN_24 (&glutBitmapTimesRoman24)
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
#define GLUT_BITMAP_HELVETICA_10 (&glutBitmapHelvetica10)
|
||||
#define GLUT_BITMAP_HELVETICA_12 (&glutBitmapHelvetica12)
|
||||
#define GLUT_BITMAP_HELVETICA_18 (&glutBitmapHelvetica18)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* glutGet parameters. */
|
||||
#define GLUT_WINDOW_X 100
|
||||
#define GLUT_WINDOW_Y 101
|
||||
#define GLUT_WINDOW_WIDTH 102
|
||||
#define GLUT_WINDOW_HEIGHT 103
|
||||
#define GLUT_WINDOW_BUFFER_SIZE 104
|
||||
#define GLUT_WINDOW_STENCIL_SIZE 105
|
||||
#define GLUT_WINDOW_DEPTH_SIZE 106
|
||||
#define GLUT_WINDOW_RED_SIZE 107
|
||||
#define GLUT_WINDOW_GREEN_SIZE 108
|
||||
#define GLUT_WINDOW_BLUE_SIZE 109
|
||||
#define GLUT_WINDOW_ALPHA_SIZE 110
|
||||
#define GLUT_WINDOW_ACCUM_RED_SIZE 111
|
||||
#define GLUT_WINDOW_ACCUM_GREEN_SIZE 112
|
||||
#define GLUT_WINDOW_ACCUM_BLUE_SIZE 113
|
||||
#define GLUT_WINDOW_ACCUM_ALPHA_SIZE 114
|
||||
#define GLUT_WINDOW_DOUBLEBUFFER 115
|
||||
#define GLUT_WINDOW_RGBA 116
|
||||
#define GLUT_WINDOW_PARENT 117
|
||||
#define GLUT_WINDOW_NUM_CHILDREN 118
|
||||
#define GLUT_WINDOW_COLORMAP_SIZE 119
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
#define GLUT_WINDOW_NUM_SAMPLES 120
|
||||
#define GLUT_WINDOW_STEREO 121
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
#define GLUT_WINDOW_CURSOR 122
|
||||
#endif
|
||||
#define GLUT_SCREEN_WIDTH 200
|
||||
#define GLUT_SCREEN_HEIGHT 201
|
||||
#define GLUT_SCREEN_WIDTH_MM 202
|
||||
#define GLUT_SCREEN_HEIGHT_MM 203
|
||||
#define GLUT_MENU_NUM_ITEMS 300
|
||||
#define GLUT_DISPLAY_MODE_POSSIBLE 400
|
||||
#define GLUT_INIT_WINDOW_X 500
|
||||
#define GLUT_INIT_WINDOW_Y 501
|
||||
#define GLUT_INIT_WINDOW_WIDTH 502
|
||||
#define GLUT_INIT_WINDOW_HEIGHT 503
|
||||
#define GLUT_INIT_DISPLAY_MODE 504
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
#define GLUT_ELAPSED_TIME 700
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||
#define GLUT_WINDOW_FORMAT_ID 123
|
||||
#endif
|
||||
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
/* glutDeviceGet parameters. */
|
||||
#define GLUT_HAS_KEYBOARD 600
|
||||
#define GLUT_HAS_MOUSE 601
|
||||
#define GLUT_HAS_SPACEBALL 602
|
||||
#define GLUT_HAS_DIAL_AND_BUTTON_BOX 603
|
||||
#define GLUT_HAS_TABLET 604
|
||||
#define GLUT_NUM_MOUSE_BUTTONS 605
|
||||
#define GLUT_NUM_SPACEBALL_BUTTONS 606
|
||||
#define GLUT_NUM_BUTTON_BOX_BUTTONS 607
|
||||
#define GLUT_NUM_DIALS 608
|
||||
#define GLUT_NUM_TABLET_BUTTONS 609
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||
#define GLUT_DEVICE_IGNORE_KEY_REPEAT 610
|
||||
#define GLUT_DEVICE_KEY_REPEAT 611
|
||||
#define GLUT_HAS_JOYSTICK 612
|
||||
#define GLUT_OWNS_JOYSTICK 613
|
||||
#define GLUT_JOYSTICK_BUTTONS 614
|
||||
#define GLUT_JOYSTICK_AXES 615
|
||||
#define GLUT_JOYSTICK_POLL_RATE 616
|
||||
#endif
|
||||
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
/* glutLayerGet parameters. */
|
||||
#define GLUT_OVERLAY_POSSIBLE 800
|
||||
#define GLUT_LAYER_IN_USE 801
|
||||
#define GLUT_HAS_OVERLAY 802
|
||||
#define GLUT_TRANSPARENT_INDEX 803
|
||||
#define GLUT_NORMAL_DAMAGED 804
|
||||
#define GLUT_OVERLAY_DAMAGED 805
|
||||
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
/* glutVideoResizeGet parameters. */
|
||||
#define GLUT_VIDEO_RESIZE_POSSIBLE 900
|
||||
#define GLUT_VIDEO_RESIZE_IN_USE 901
|
||||
#define GLUT_VIDEO_RESIZE_X_DELTA 902
|
||||
#define GLUT_VIDEO_RESIZE_Y_DELTA 903
|
||||
#define GLUT_VIDEO_RESIZE_WIDTH_DELTA 904
|
||||
#define GLUT_VIDEO_RESIZE_HEIGHT_DELTA 905
|
||||
#define GLUT_VIDEO_RESIZE_X 906
|
||||
#define GLUT_VIDEO_RESIZE_Y 907
|
||||
#define GLUT_VIDEO_RESIZE_WIDTH 908
|
||||
#define GLUT_VIDEO_RESIZE_HEIGHT 909
|
||||
#endif
|
||||
|
||||
/* glutUseLayer parameters. */
|
||||
#define GLUT_NORMAL 0
|
||||
#define GLUT_OVERLAY 1
|
||||
|
||||
/* glutGetModifiers return mask. */
|
||||
#define GLUT_ACTIVE_SHIFT 1
|
||||
#define GLUT_ACTIVE_CTRL 2
|
||||
#define GLUT_ACTIVE_ALT 4
|
||||
|
||||
/* glutSetCursor parameters. */
|
||||
/* Basic arrows. */
|
||||
#define GLUT_CURSOR_RIGHT_ARROW 0
|
||||
#define GLUT_CURSOR_LEFT_ARROW 1
|
||||
/* Symbolic cursor shapes. */
|
||||
#define GLUT_CURSOR_INFO 2
|
||||
#define GLUT_CURSOR_DESTROY 3
|
||||
#define GLUT_CURSOR_HELP 4
|
||||
#define GLUT_CURSOR_CYCLE 5
|
||||
#define GLUT_CURSOR_SPRAY 6
|
||||
#define GLUT_CURSOR_WAIT 7
|
||||
#define GLUT_CURSOR_TEXT 8
|
||||
#define GLUT_CURSOR_CROSSHAIR 9
|
||||
/* Directional cursors. */
|
||||
#define GLUT_CURSOR_UP_DOWN 10
|
||||
#define GLUT_CURSOR_LEFT_RIGHT 11
|
||||
/* Sizing cursors. */
|
||||
#define GLUT_CURSOR_TOP_SIDE 12
|
||||
#define GLUT_CURSOR_BOTTOM_SIDE 13
|
||||
#define GLUT_CURSOR_LEFT_SIDE 14
|
||||
#define GLUT_CURSOR_RIGHT_SIDE 15
|
||||
#define GLUT_CURSOR_TOP_LEFT_CORNER 16
|
||||
#define GLUT_CURSOR_TOP_RIGHT_CORNER 17
|
||||
#define GLUT_CURSOR_BOTTOM_RIGHT_CORNER 18
|
||||
#define GLUT_CURSOR_BOTTOM_LEFT_CORNER 19
|
||||
/* Inherit from parent window. */
|
||||
#define GLUT_CURSOR_INHERIT 100
|
||||
/* Blank cursor. */
|
||||
#define GLUT_CURSOR_NONE 101
|
||||
/* Fullscreen crosshair (if available). */
|
||||
#define GLUT_CURSOR_FULL_CROSSHAIR 102
|
||||
#endif
|
||||
|
||||
/* GLUT initialization sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
|
||||
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
|
||||
GLUTAPI void GLUTAPIENTRY __glutInitWithExit(int *argcp, char **argv, void (__cdecl *exitfunc)(int));
|
||||
#ifndef GLUT_BUILDING_LIB
|
||||
#define glutInit(__argcp, __argv) __glutInitWithExit(__argcp, __argv, exit)
|
||||
#endif
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutInitDisplayMode(unsigned int mode);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
GLUTAPI void GLUTAPIENTRY glutInitDisplayString(const char *string);
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutInitWindowPosition(int x, int y);
|
||||
GLUTAPI void GLUTAPIENTRY glutInitWindowSize(int width, int height);
|
||||
GLUTAPI void GLUTAPIENTRY glutMainLoop(void);
|
||||
|
||||
/* GLUT window sub-API. */
|
||||
GLUTAPI int GLUTAPIENTRY glutCreateWindow(const char *title);
|
||||
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
|
||||
GLUTAPI int GLUTAPIENTRY __glutCreateWindowWithExit(const char *title, void (__cdecl *exitfunc)(int));
|
||||
#ifndef GLUT_BUILDING_LIB
|
||||
#define glutCreateWindow(__title) __glutCreateWindowWithExit(__title, exit)
|
||||
#endif
|
||||
#endif
|
||||
GLUTAPI int GLUTAPIENTRY glutCreateSubWindow(int win, int x, int y, int width, int height);
|
||||
GLUTAPI void GLUTAPIENTRY glutDestroyWindow(int win);
|
||||
GLUTAPI void GLUTAPIENTRY glutPostRedisplay(void);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
|
||||
GLUTAPI void GLUTAPIENTRY glutPostWindowRedisplay(int win);
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutSwapBuffers(void);
|
||||
GLUTAPI int GLUTAPIENTRY glutGetWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetWindow(int win);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetWindowTitle(const char *title);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetIconTitle(const char *title);
|
||||
GLUTAPI void GLUTAPIENTRY glutPositionWindow(int x, int y);
|
||||
GLUTAPI void GLUTAPIENTRY glutReshapeWindow(int width, int height);
|
||||
GLUTAPI void GLUTAPIENTRY glutPopWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutPushWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutIconifyWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutShowWindow(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutHideWindow(void);
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
GLUTAPI void GLUTAPIENTRY glutFullScreen(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetCursor(int cursor);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
GLUTAPI void GLUTAPIENTRY glutWarpPointer(int x, int y);
|
||||
#endif
|
||||
|
||||
/* GLUT overlay sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutEstablishOverlay(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutRemoveOverlay(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutUseLayer(GLenum layer);
|
||||
GLUTAPI void GLUTAPIENTRY glutPostOverlayRedisplay(void);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 11)
|
||||
GLUTAPI void GLUTAPIENTRY glutPostWindowOverlayRedisplay(int win);
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutShowOverlay(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutHideOverlay(void);
|
||||
#endif
|
||||
|
||||
/* GLUT menu sub-API. */
|
||||
GLUTAPI int GLUTAPIENTRY glutCreateMenu(void (GLUTCALLBACK *func)(int));
|
||||
#if defined(_WIN32) && !defined(GLUT_DISABLE_ATEXIT_HACK)
|
||||
GLUTAPI int GLUTAPIENTRY __glutCreateMenuWithExit(void (GLUTCALLBACK *func)(int), void (__cdecl *exitfunc)(int));
|
||||
#ifndef GLUT_BUILDING_LIB
|
||||
#define glutCreateMenu(__func) __glutCreateMenuWithExit(__func, exit)
|
||||
#endif
|
||||
#endif
|
||||
GLUTAPI void GLUTAPIENTRY glutDestroyMenu(int menu);
|
||||
GLUTAPI int GLUTAPIENTRY glutGetMenu(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetMenu(int menu);
|
||||
GLUTAPI void GLUTAPIENTRY glutAddMenuEntry(const char *label, int value);
|
||||
GLUTAPI void GLUTAPIENTRY glutAddSubMenu(const char *label, int submenu);
|
||||
GLUTAPI void GLUTAPIENTRY glutChangeToMenuEntry(int item, const char *label, int value);
|
||||
GLUTAPI void GLUTAPIENTRY glutChangeToSubMenu(int item, const char *label, int submenu);
|
||||
GLUTAPI void GLUTAPIENTRY glutRemoveMenuItem(int item);
|
||||
GLUTAPI void GLUTAPIENTRY glutAttachMenu(int button);
|
||||
GLUTAPI void GLUTAPIENTRY glutDetachMenu(int button);
|
||||
|
||||
/* GLUT window callback sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutDisplayFunc(void (GLUTCALLBACK *func)(void));
|
||||
GLUTAPI void GLUTAPIENTRY glutReshapeFunc(void (GLUTCALLBACK *func)(int width, int height));
|
||||
GLUTAPI void GLUTAPIENTRY glutKeyboardFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutMouseFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutPassiveMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutEntryFunc(void (GLUTCALLBACK *func)(int state));
|
||||
GLUTAPI void GLUTAPIENTRY glutVisibilityFunc(void (GLUTCALLBACK *func)(int state));
|
||||
GLUTAPI void GLUTAPIENTRY glutIdleFunc(void (GLUTCALLBACK *func)(void));
|
||||
GLUTAPI void GLUTAPIENTRY glutTimerFunc(unsigned int millis, void (GLUTCALLBACK *func)(int value), int value);
|
||||
GLUTAPI void GLUTAPIENTRY glutMenuStateFunc(void (GLUTCALLBACK *func)(int state));
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
GLUTAPI void GLUTAPIENTRY glutSpecialFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutSpaceballMotionFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
|
||||
GLUTAPI void GLUTAPIENTRY glutSpaceballRotateFunc(void (GLUTCALLBACK *func)(int x, int y, int z));
|
||||
GLUTAPI void GLUTAPIENTRY glutSpaceballButtonFunc(void (GLUTCALLBACK *func)(int button, int state));
|
||||
GLUTAPI void GLUTAPIENTRY glutButtonBoxFunc(void (GLUTCALLBACK *func)(int button, int state));
|
||||
GLUTAPI void GLUTAPIENTRY glutDialsFunc(void (GLUTCALLBACK *func)(int dial, int value));
|
||||
GLUTAPI void GLUTAPIENTRY glutTabletMotionFunc(void (GLUTCALLBACK *func)(int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutTabletButtonFunc(void (GLUTCALLBACK *func)(int button, int state, int x, int y));
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
GLUTAPI void GLUTAPIENTRY glutMenuStatusFunc(void (GLUTCALLBACK *func)(int status, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutOverlayDisplayFunc(void (GLUTCALLBACK *func)(void));
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
GLUTAPI void GLUTAPIENTRY glutWindowStatusFunc(void (GLUTCALLBACK *func)(int state));
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||
GLUTAPI void GLUTAPIENTRY glutKeyboardUpFunc(void (GLUTCALLBACK *func)(unsigned char key, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutSpecialUpFunc(void (GLUTCALLBACK *func)(int key, int x, int y));
|
||||
GLUTAPI void GLUTAPIENTRY glutJoystickFunc(void (GLUTCALLBACK *func)(unsigned int buttonMask, int x, int y, int z), int pollInterval);
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* GLUT color index sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutSetColor(int ndx, GLfloat red, GLfloat green, GLfloat blue);
|
||||
GLUTAPI GLfloat GLUTAPIENTRY glutGetColor(int ndx, int component);
|
||||
GLUTAPI void GLUTAPIENTRY glutCopyColormap(int win);
|
||||
|
||||
/* GLUT state retrieval sub-API. */
|
||||
GLUTAPI int GLUTAPIENTRY glutGet(GLenum type);
|
||||
GLUTAPI int GLUTAPIENTRY glutDeviceGet(GLenum type);
|
||||
#if (GLUT_API_VERSION >= 2)
|
||||
/* GLUT extension support sub-API */
|
||||
GLUTAPI int GLUTAPIENTRY glutExtensionSupported(const char *name);
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 3)
|
||||
GLUTAPI int GLUTAPIENTRY glutGetModifiers(void);
|
||||
GLUTAPI int GLUTAPIENTRY glutLayerGet(GLenum type);
|
||||
#endif
|
||||
#if (GLUT_API_VERSION >= 5)
|
||||
typedef void (*GLUTproc)();
|
||||
GLUTAPI GLUTproc GLUTAPIENTRY glutGetProcAddress(const char *procName);
|
||||
#endif
|
||||
|
||||
/* GLUT font sub-API */
|
||||
GLUTAPI void GLUTAPIENTRY glutBitmapCharacter(void *font, int character);
|
||||
GLUTAPI int GLUTAPIENTRY glutBitmapWidth(void *font, int character);
|
||||
GLUTAPI void GLUTAPIENTRY glutStrokeCharacter(void *font, int character);
|
||||
GLUTAPI int GLUTAPIENTRY glutStrokeWidth(void *font, int character);
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
GLUTAPI int GLUTAPIENTRY glutBitmapLength(void *font, const unsigned char *string);
|
||||
GLUTAPI int GLUTAPIENTRY glutStrokeLength(void *font, const unsigned char *string);
|
||||
#endif
|
||||
|
||||
/* GLUT pre-built models sub-API */
|
||||
GLUTAPI void GLUTAPIENTRY glutWireSphere(GLdouble radius, GLint slices, GLint stacks);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidSphere(GLdouble radius, GLint slices, GLint stacks);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidCone(GLdouble base, GLdouble height, GLint slices, GLint stacks);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireCube(GLdouble size);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidCube(GLdouble size);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidTorus(GLdouble innerRadius, GLdouble outerRadius, GLint sides, GLint rings);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireDodecahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidDodecahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireTeapot(GLdouble size);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidTeapot(GLdouble size);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireOctahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidOctahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireTetrahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidTetrahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutWireIcosahedron(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutSolidIcosahedron(void);
|
||||
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 9)
|
||||
/* GLUT video resize sub-API. */
|
||||
GLUTAPI int GLUTAPIENTRY glutVideoResizeGet(GLenum param);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetupVideoResizing(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutStopVideoResizing(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutVideoResize(int x, int y, int width, int height);
|
||||
GLUTAPI void GLUTAPIENTRY glutVideoPan(int x, int y, int width, int height);
|
||||
|
||||
/* GLUT debugging sub-API. */
|
||||
GLUTAPI void GLUTAPIENTRY glutReportErrors(void);
|
||||
#endif
|
||||
|
||||
#if (GLUT_API_VERSION >= 4 || GLUT_XLIB_IMPLEMENTATION >= 13)
|
||||
/* GLUT device control sub-API. */
|
||||
/* glutSetKeyRepeat modes. */
|
||||
#define GLUT_KEY_REPEAT_OFF 0
|
||||
#define GLUT_KEY_REPEAT_ON 1
|
||||
#define GLUT_KEY_REPEAT_DEFAULT 2
|
||||
|
||||
/* Joystick button masks. */
|
||||
#define GLUT_JOYSTICK_BUTTON_A 1
|
||||
#define GLUT_JOYSTICK_BUTTON_B 2
|
||||
#define GLUT_JOYSTICK_BUTTON_C 4
|
||||
#define GLUT_JOYSTICK_BUTTON_D 8
|
||||
|
||||
GLUTAPI void GLUTAPIENTRY glutIgnoreKeyRepeat(int ignore);
|
||||
GLUTAPI void GLUTAPIENTRY glutSetKeyRepeat(int repeatMode);
|
||||
GLUTAPI void GLUTAPIENTRY glutForceJoystickFunc(void);
|
||||
|
||||
/* GLUT game mode sub-API. */
|
||||
/* glutGameModeGet. */
|
||||
#define GLUT_GAME_MODE_ACTIVE 0
|
||||
#define GLUT_GAME_MODE_POSSIBLE 1
|
||||
#define GLUT_GAME_MODE_WIDTH 2
|
||||
#define GLUT_GAME_MODE_HEIGHT 3
|
||||
#define GLUT_GAME_MODE_PIXEL_DEPTH 4
|
||||
#define GLUT_GAME_MODE_REFRESH_RATE 5
|
||||
#define GLUT_GAME_MODE_DISPLAY_CHANGED 6
|
||||
|
||||
GLUTAPI void GLUTAPIENTRY glutGameModeString(const char *string);
|
||||
GLUTAPI int GLUTAPIENTRY glutEnterGameMode(void);
|
||||
GLUTAPI void GLUTAPIENTRY glutLeaveGameMode(void);
|
||||
GLUTAPI int GLUTAPIENTRY glutGameModeGet(GLenum mode);
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __glut_h__ */
|
||||
3065
include/GL/RegalGLX.h
Normal file
3065
include/GL/RegalGLX.h
Normal file
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -38,9 +38,6 @@
|
|||
$ astyle --style=allman --indent=spaces=2 --indent-switches
|
||||
*/
|
||||
|
||||
#ifndef __REGAL_WGL_DECLARATIONS_H
|
||||
#define __REGAL_WGL_DECLARATIONS_H
|
||||
|
||||
#include <GL/Regal.h>
|
||||
|
||||
#ifndef __REGAL_WGL_H__
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -30,7 +30,7 @@ from ApiUtil import typeIsVoid
|
|||
from ApiCodeGen import *
|
||||
|
||||
from Regal import *
|
||||
from RegalWGL import generateWglPublicHeader
|
||||
from RegalWinSys import generateWinSysHeaders
|
||||
from RegalEnum import *
|
||||
from RegalSystem import *
|
||||
from RegalContext import *
|
||||
|
|
@ -208,7 +208,7 @@ def generate(apis, args):
|
|||
generateEmuInfoSource(apis, args)
|
||||
#generateTraceSource( apis, args )
|
||||
generatePublicHeader(apis, args)
|
||||
generateWglPublicHeader(apis, args)
|
||||
generateWinSysHeaders(apis, args)
|
||||
generateSource(apis, args)
|
||||
generateSystemHeader(apis, args)
|
||||
generateEmuSource( apis, args )
|
||||
|
|
|
|||
|
|
@ -17,9 +17,6 @@ from RegalSystem import regalSys
|
|||
publicHeaderTemplate = Template( '''${AUTOGENERATED}
|
||||
${LICENSE}
|
||||
|
||||
#ifndef __REGAL_WGL_DECLARATIONS_H
|
||||
#define __REGAL_WGL_DECLARATIONS_H
|
||||
|
||||
#include <GL/Regal.h>
|
||||
|
||||
#ifndef __${HEADER_NAME}_H__
|
||||
|
|
@ -49,12 +46,7 @@ ${API_FUNC_DECLARE}
|
|||
|
||||
''')
|
||||
|
||||
def generateWglPublicHeader(apis, args):
|
||||
|
||||
api = {}
|
||||
for a in apis:
|
||||
if a.name == "wgl":
|
||||
api = a
|
||||
def generateWglHeader(api, args):
|
||||
|
||||
apiTypedef = apiTypedefCode( api, args )
|
||||
apiEnum = apiEnumCode(api, args) # CodeGen for API enums
|
||||
|
|
|
|||
291
scripts/regal/RegalWinSys.py
Executable file
291
scripts/regal/RegalWinSys.py
Executable file
|
|
@ -0,0 +1,291 @@
|
|||
#!/usr/bin/python -B
|
||||
|
||||
from string import Template, upper, replace
|
||||
from ApiUtil import outputCode
|
||||
from ApiUtil import typeIsVoid
|
||||
from ApiUtil import typeIsVoidPointer
|
||||
from ApiUtil import toLong
|
||||
from ApiUtil import hexValue
|
||||
from ApiCodeGen import *
|
||||
from ApiRegal import logFunction
|
||||
from Emu import emuFindEntry, emuCodeGen
|
||||
|
||||
from RegalContext import emuRegal
|
||||
from RegalContextInfo import cond
|
||||
from RegalSystem import regalSys
|
||||
from RegalWGL import generateWglHeader
|
||||
|
||||
publicHeaderTemplate = Template( '''${AUTOGENERATED}
|
||||
${LICENSE}
|
||||
|
||||
#include <GL/Regal.h>
|
||||
|
||||
#ifndef __${HEADER_NAME}_H__
|
||||
#define __${HEADER_NAME}_H__
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
${API_TYPEDEF}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
${API_ENUM}
|
||||
|
||||
${API_FUNC_DECLARE}
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __${HEADER_NAME}_H__ */
|
||||
|
||||
''')
|
||||
|
||||
def generateWinSysHeaders(apis, args):
|
||||
|
||||
for api in apis:
|
||||
|
||||
if api.name == "gl":
|
||||
continue
|
||||
if api.name == "wgl":
|
||||
generateWglHeader( api, args )
|
||||
continue
|
||||
|
||||
apiTypedef = apiTypedefCode( api, args )
|
||||
apiEnum = apiEnumCode(api, args) # CodeGen for API enums
|
||||
apiFuncDeclare = apiFuncDeclareCode( api, args ) # CodeGen for API functions
|
||||
|
||||
# Output
|
||||
|
||||
substitute = {}
|
||||
substitute['LICENSE'] = args.license
|
||||
substitute['AUTOGENERATED'] = args.generated
|
||||
substitute['COPYRIGHT'] = args.copyright
|
||||
substitute['HEADER_NAME'] = "REGAL_%s" % api.name.upper()
|
||||
substitute['REGAL_SYS'] = regalSys
|
||||
substitute['API_TYPEDEF'] = apiTypedef
|
||||
substitute['API_ENUM'] = apiEnum
|
||||
substitute['API_FUNC_DECLARE'] = apiFuncDeclare
|
||||
|
||||
outputCode( '%s/Regal%s.h' % (args.incdir, api.name.upper() ), publicHeaderTemplate.substitute(substitute))
|
||||
|
||||
def apiTypedefCode( api, args ):
|
||||
|
||||
def printTypedef( name, type ):
|
||||
if re.search( '\(\s*\*\s*\)', type ):
|
||||
return 'typedef %s;' % ( re.sub( '\(\s*\*\s*\)', '(*%s)' % name, type ) )
|
||||
else:
|
||||
return'typedef %s %s;' % ( type, name )
|
||||
|
||||
code = ''
|
||||
code += '\n'
|
||||
if api.name in cond:
|
||||
code += '#if %s\n' % cond[api.name]
|
||||
|
||||
for typedef in api.typedefs:
|
||||
|
||||
if isinstance(typedef.type, str) or isinstance(typedef.type, unicode):
|
||||
code += printTypedef( typedef.name, typedef.type ) + '\n'
|
||||
else:
|
||||
type = {}
|
||||
mapping = { api.name : 'REGAL_SYS_%s' % api.name.upper(), '' : '' }
|
||||
for i in typedef.type:
|
||||
if i in mapping:
|
||||
type[mapping[i]] = printTypedef( typedef.name, typedef.type[i] )
|
||||
code += '\n'.join(wrapIf(type,None)) + '\n'
|
||||
|
||||
if api.name in cond:
|
||||
code += '#endif // %s\n' % cond[api.name]
|
||||
code += '\n'
|
||||
|
||||
return code
|
||||
|
||||
# CodeGen for custom API definitions.
|
||||
|
||||
def apiEnumCode( api, args ):
|
||||
|
||||
code = ''
|
||||
code += '\n'
|
||||
if api.name in cond:
|
||||
code += '#if %s\n' % cond[api.name]
|
||||
for enum in api.enums:
|
||||
if enum.name == 'defines':
|
||||
pass
|
||||
else:
|
||||
code += '\ntypedef enum _%s {\n' % enum.name
|
||||
for enumerant in enum.enumerants:
|
||||
code += ' %s = %s,\n' % ( enumerant.name, enumerant.value )
|
||||
code += '} %s;\n\n' % enum.name
|
||||
if api.name in cond:
|
||||
code += '#endif // %s\n' % cond[api.name]
|
||||
code += '\n'
|
||||
|
||||
return code
|
||||
|
||||
def apiVerInt( ver ):
|
||||
va = [ int( x ) for x in ver.split('.') ]
|
||||
while len( va ) < 3:
|
||||
va.append(0)
|
||||
return '%d%02d%02d' % tuple(va)
|
||||
|
||||
def apiFuncDecl( function ):
|
||||
name = function.name
|
||||
params = paramsDefaultCode(function.parameters, True)
|
||||
rType = typeCode(function.ret.type)
|
||||
funcDecl = ''
|
||||
guard = []
|
||||
funcDecl += 'REGAL_DECL %sREGAL_CALL %s(%s);\n' % (rType, name, params)
|
||||
return funcDecl;
|
||||
|
||||
# CodeGen for API function declaration.
|
||||
|
||||
def apiFuncDeclareCode(api, args):
|
||||
code = ''
|
||||
|
||||
|
||||
d = [] # defines
|
||||
e = [] # enums
|
||||
t = [] # function pointer typedefs
|
||||
m = [] # mangled names for REGAL_NAMESPACE support
|
||||
f = [] # gl names
|
||||
|
||||
for enum in api.enums:
|
||||
if enum.name == 'defines':
|
||||
for enumerant in enum.enumerants:
|
||||
|
||||
# Ignore enums that match category, a workaround
|
||||
# for EGL_VERSION_1_3 and EGL_VERSION_1_4
|
||||
|
||||
if enumerant.name==enumerant.category:
|
||||
continue
|
||||
|
||||
value = toLong(enumerant.value)
|
||||
if value==None:
|
||||
value = enumerant.value
|
||||
|
||||
# Don't bother with decimal for 0-10
|
||||
if isinstance(value, long) and value>=10:
|
||||
e.append((enumerant.category, '#define %s %s /* %s */'%(enumerant.name,hexValue(value),value)))
|
||||
else:
|
||||
e.append((enumerant.category, '#define %s %s'%(enumerant.name,hexValue(value))))
|
||||
|
||||
for function in api.functions:
|
||||
|
||||
name = function.name
|
||||
params = paramsDefaultCode(function.parameters, True)
|
||||
rparams = paramsDefaultCode(function.parameters, True, "void *_context")
|
||||
rType = typeCode(function.ret.type)
|
||||
category = getattr(function, 'category', None)
|
||||
version = getattr(function, 'version', None)
|
||||
|
||||
if category:
|
||||
category = category.replace('_DEPRECATED', '')
|
||||
elif version:
|
||||
category = version.replace('.', '_')
|
||||
category = 'GL_VERSION_' + category
|
||||
|
||||
t.append((category,funcProtoCode(function, version, 'REGAL_CALL', True)))
|
||||
m.append((category,'#define %-35s r%-35s' % (name, name) ))
|
||||
f.append((category, apiFuncDecl( function ) ))
|
||||
|
||||
def cmpEnum(a,b):
|
||||
if a[0]==b[0]:
|
||||
aValue = a[1].split(' ')[2]
|
||||
bValue = b[1].split(' ')[2]
|
||||
if aValue==bValue:
|
||||
return cmp(a[1].split(' ')[1], b[1].split(' ')[1])
|
||||
else:
|
||||
return cmp(aValue,bValue)
|
||||
return cmp(a[0],b[0])
|
||||
|
||||
def enumIfDef(category):
|
||||
return '#ifndef REGAL_NO_ENUM_%s'%(upper(category).replace(' ','_'))
|
||||
|
||||
def typedefIfDef(category):
|
||||
return '#ifndef REGAL_NO_TYPEDEF_%s'%(upper(category).replace(' ','_'))
|
||||
|
||||
def namespaceIfDef(category):
|
||||
return '#ifndef REGAL_NO_NAMESPACE_%s'%(upper(category).replace(' ','_'))
|
||||
|
||||
def declarationIfDef(category):
|
||||
return '#ifndef REGAL_NO_DECLARATION_%s'%(upper(category).replace(' ','_'))
|
||||
|
||||
categories = set()
|
||||
|
||||
if api.name=='egl':
|
||||
categories.add('EGL_VERSION_1_3')
|
||||
categories.add('EGL_VERSION_1_4')
|
||||
|
||||
categories.update([ i[0] for i in e ])
|
||||
categories.update([ i[0] for i in t ])
|
||||
categories.update([ i[0] for i in m ])
|
||||
categories.update([ i[0] for i in f ])
|
||||
|
||||
for i in categories:
|
||||
if len(i):
|
||||
cat = upper(i).replace(' ','_')
|
||||
|
||||
d.append((i,'#if (defined(%s) || defined(REGAL_NO_ENUM) || defined(REGAL_NO_%s)) && !defined(REGAL_NO_ENUM_%s)'%(cat,cat,cat)))
|
||||
d.append((i,'#define REGAL_NO_ENUM_%s'%(cat)))
|
||||
d.append((i,'#endif'))
|
||||
d.append((i,''))
|
||||
|
||||
d.append((i,'#if (defined(%s) || defined(REGAL_NO_TYPEDEF) || defined(REGAL_NO_%s)) && !defined(REGAL_NO_TYPEDEF_%s)'%(cat,cat,cat)))
|
||||
d.append((i,'#define REGAL_NO_TYPEDEF_%s'%(cat)))
|
||||
d.append((i,'#endif'))
|
||||
d.append((i,''))
|
||||
|
||||
d.append((i,'#if (defined(%s) || !defined(REGAL_NAMESPACE) || defined(REGAL_NO_%s)) && !defined(REGAL_NO_NAMESPACE_%s)'%(cat,cat,cat)))
|
||||
d.append((i,'#define REGAL_NO_NAMESPACE_%s'%(cat)))
|
||||
d.append((i,'#endif'))
|
||||
d.append((i,''))
|
||||
|
||||
d.append((i,'#if (defined(%s) || !defined(REGAL_PLUGIN_MODE) || defined(REGAL_NO_%s)) && !defined(REGAL_NO_PLUGIN_%s)'%(cat,cat,cat)))
|
||||
d.append((i,'#define REGAL_NO_PLUGIN_%s'%(cat)))
|
||||
d.append((i,'#endif'))
|
||||
d.append((i,''))
|
||||
|
||||
d.append((i,'#if (defined(%s) || defined(REGAL_NO_DECLARATION) || defined(REGAL_NO_%s)) && !defined(REGAL_NO_DECLARATION_%s)'%(cat,cat,cat)))
|
||||
d.append((i,'#define REGAL_NO_DECLARATION_%s'%(cat)))
|
||||
d.append((i,'#endif'))
|
||||
d.append((i,''))
|
||||
|
||||
d.append((i,'#ifndef %s'%(i)))
|
||||
d.append((i,'#define %s 1'%(i)))
|
||||
d.append((i,'#endif'))
|
||||
d.append((i,''))
|
||||
|
||||
e.sort(cmpEnum)
|
||||
e = alignDefineCategory(e)
|
||||
e = ifCategory(e,enumIfDef)
|
||||
e = spaceCategory(e)
|
||||
|
||||
t.sort()
|
||||
t = ifCategory(t,typedefIfDef)
|
||||
t = spaceCategory(t)
|
||||
|
||||
m.sort()
|
||||
m = ifCategory(m,namespaceIfDef)
|
||||
m = spaceCategory(m)
|
||||
|
||||
f.sort()
|
||||
f = ifCategory(f,declarationIfDef)
|
||||
f = spaceCategory(f)
|
||||
|
||||
d.extend(e)
|
||||
d.extend(t)
|
||||
d.extend(m)
|
||||
d.extend(f)
|
||||
|
||||
tmp = listToString(unfoldCategory(d,'/**\n ** %s\n **/',lambda x,y: cmp(x[0], y[0])))
|
||||
|
||||
if api.name in cond:
|
||||
tmp = wrapIf(cond[api.name], tmp)
|
||||
|
||||
code += '%s\n'%(tmp)
|
||||
|
||||
return code
|
||||
|
||||
Loading…
Reference in a new issue