From 77cb1b8a76233ba152298c3a470a0cbce57a20cf Mon Sep 17 00:00:00 2001 From: Bart Trzynadlowski Date: Sun, 24 Apr 2011 01:14:00 +0000 Subject: [PATCH] Initial import of new Supermodel code. --- BlockFile.cpp | 258 + BlockFile.h | 170 + CPU/68K/Make68K.c | 8938 +++++++++++ CPU/68K/README.TXT | 1299 ++ CPU/68K/Turbo68K.h | 158 + CPU/PowerPC/PPCDisasm.cpp | 1260 ++ CPU/PowerPC/PPCDisasm.h | 58 + CPU/PowerPC/ppc.cpp | 1046 ++ CPU/PowerPC/ppc.h | 366 + CPU/PowerPC/ppc603.c | 329 + CPU/PowerPC/ppc_ops.c | 2832 ++++ CPU/PowerPC/ppc_ops.h | 170 + Games.cpp | 1051 ++ Games.h | 94 + Graphics/Error.cpp | 64 + Graphics/Models.cpp | 809 + Graphics/Render.h | 170 + Graphics/Render2D.cpp | 871 ++ Graphics/Render2D.h | 177 + Graphics/Render3D.cpp | 1388 ++ Graphics/Render3D.h | 412 + Graphics/Shader.cpp | 182 + Graphics/Shader.h | 73 + Graphics/Shaders/DIR.txt | 2 + Graphics/Shaders/Fragment.glsl | 194 + Graphics/Shaders/Fragment2D.glsl | 44 + Graphics/Shaders/Fragment_Flat.glsl | 142 + Graphics/Shaders/Fragment_NoSpotlight.glsl | 201 + Graphics/Shaders/Vertex.glsl | 144 + Graphics/Shaders/Vertex2D.glsl | 34 + Graphics/Shaders2D.h | 119 + Graphics/Shaders3D.h | 374 + INIFile.cpp | 580 + INIFile.h | 198 + Inputs/Input.cpp | 105 + Inputs/Input.h | 114 + Inputs/InputSource.cpp | 84 + Inputs/InputSource.h | 72 + Inputs/InputSystem.cpp | 1899 +++ Inputs/InputSystem.h | 925 ++ Inputs/InputTypes.cpp | 148 + Inputs/InputTypes.h | 135 + Inputs/Inputs.cpp | 535 + Inputs/Inputs.h | 195 + Inputs/MultiInputSource.cpp | 117 + Inputs/MultiInputSource.h | 51 + Model3/53C810.cpp | 506 + Model3/53C810.h | 202 + Model3/53C810Disasm.cpp | 281 + Model3/93C46.cpp | 263 + Model3/93C46.h | 127 + Model3/Bus.h | 81 + Model3/IRQ.cpp | 126 + Model3/IRQ.h | 148 + Model3/MPC10x.cpp | 357 + Model3/MPC10x.h | 178 + Model3/Model3.cpp | 2363 +++ Model3/Model3.h | 318 + Model3/PCI.cpp | 154 + Model3/PCI.h | 190 + Model3/RTC72421.cpp | 117 + Model3/RTC72421.h | 91 + Model3/Real3D.cpp | 945 ++ Model3/Real3D.h | 398 + Model3/SoundBoard.cpp | 379 + Model3/SoundBoard.h | 103 + Model3/TileGen.cpp | 205 + Model3/TileGen.h | 177 + OSD/SDL/Main.cpp | 1097 ++ OSD/SDL/SDLInputSystem.cpp | 386 + OSD/SDL/SDLInputSystem.h | 106 + OSD/SDL/SDLMain_tmpl.h | 11 + OSD/SDL/SDLMain_tmpl.m | 384 + OSD/SDL/Types.h | 51 + OSD/Windows/DirectInputSystem.cpp | 1135 ++ OSD/Windows/DirectInputSystem.h | 176 + Pkgs/glew.c | 15201 ++++++++++++++++++ Pkgs/glew.h | 15343 +++++++++++++++++++ Pkgs/glxew.h | 1537 ++ Pkgs/ioapi.c | 235 + Pkgs/ioapi.h | 200 + Pkgs/unzip.c | 2125 +++ Pkgs/unzip.h | 437 + Pkgs/wglew.h | 1287 ++ ROMLoad.cpp | 332 + ROMLoad.h | 118 + Sound/SCSP.cpp | 2021 +++ Sound/SCSP.h | 71 + Sound/SCSPDSP.cpp | 1101 ++ Sound/SCSPDSP.h | 59 + Sound/SCSPLFO.cpp | 153 + Supermodel.h | 188 + 92 files changed, 80050 insertions(+) create mode 100644 BlockFile.cpp create mode 100644 BlockFile.h create mode 100644 CPU/68K/Make68K.c create mode 100644 CPU/68K/README.TXT create mode 100644 CPU/68K/Turbo68K.h create mode 100644 CPU/PowerPC/PPCDisasm.cpp create mode 100644 CPU/PowerPC/PPCDisasm.h create mode 100644 CPU/PowerPC/ppc.cpp create mode 100644 CPU/PowerPC/ppc.h create mode 100644 CPU/PowerPC/ppc603.c create mode 100644 CPU/PowerPC/ppc_ops.c create mode 100644 CPU/PowerPC/ppc_ops.h create mode 100644 Games.cpp create mode 100644 Games.h create mode 100644 Graphics/Error.cpp create mode 100644 Graphics/Models.cpp create mode 100644 Graphics/Render.h create mode 100644 Graphics/Render2D.cpp create mode 100644 Graphics/Render2D.h create mode 100644 Graphics/Render3D.cpp create mode 100644 Graphics/Render3D.h create mode 100644 Graphics/Shader.cpp create mode 100644 Graphics/Shader.h create mode 100644 Graphics/Shaders/DIR.txt create mode 100644 Graphics/Shaders/Fragment.glsl create mode 100644 Graphics/Shaders/Fragment2D.glsl create mode 100644 Graphics/Shaders/Fragment_Flat.glsl create mode 100644 Graphics/Shaders/Fragment_NoSpotlight.glsl create mode 100644 Graphics/Shaders/Vertex.glsl create mode 100644 Graphics/Shaders/Vertex2D.glsl create mode 100644 Graphics/Shaders2D.h create mode 100644 Graphics/Shaders3D.h create mode 100644 INIFile.cpp create mode 100644 INIFile.h create mode 100644 Inputs/Input.cpp create mode 100644 Inputs/Input.h create mode 100644 Inputs/InputSource.cpp create mode 100644 Inputs/InputSource.h create mode 100644 Inputs/InputSystem.cpp create mode 100644 Inputs/InputSystem.h create mode 100644 Inputs/InputTypes.cpp create mode 100644 Inputs/InputTypes.h create mode 100644 Inputs/Inputs.cpp create mode 100644 Inputs/Inputs.h create mode 100644 Inputs/MultiInputSource.cpp create mode 100644 Inputs/MultiInputSource.h create mode 100644 Model3/53C810.cpp create mode 100644 Model3/53C810.h create mode 100644 Model3/53C810Disasm.cpp create mode 100644 Model3/93C46.cpp create mode 100644 Model3/93C46.h create mode 100644 Model3/Bus.h create mode 100644 Model3/IRQ.cpp create mode 100644 Model3/IRQ.h create mode 100644 Model3/MPC10x.cpp create mode 100644 Model3/MPC10x.h create mode 100644 Model3/Model3.cpp create mode 100644 Model3/Model3.h create mode 100644 Model3/PCI.cpp create mode 100644 Model3/PCI.h create mode 100644 Model3/RTC72421.cpp create mode 100644 Model3/RTC72421.h create mode 100644 Model3/Real3D.cpp create mode 100644 Model3/Real3D.h create mode 100644 Model3/SoundBoard.cpp create mode 100644 Model3/SoundBoard.h create mode 100644 Model3/TileGen.cpp create mode 100644 Model3/TileGen.h create mode 100644 OSD/SDL/Main.cpp create mode 100644 OSD/SDL/SDLInputSystem.cpp create mode 100644 OSD/SDL/SDLInputSystem.h create mode 100644 OSD/SDL/SDLMain_tmpl.h create mode 100644 OSD/SDL/SDLMain_tmpl.m create mode 100644 OSD/SDL/Types.h create mode 100644 OSD/Windows/DirectInputSystem.cpp create mode 100644 OSD/Windows/DirectInputSystem.h create mode 100644 Pkgs/glew.c create mode 100644 Pkgs/glew.h create mode 100644 Pkgs/glxew.h create mode 100644 Pkgs/ioapi.c create mode 100644 Pkgs/ioapi.h create mode 100644 Pkgs/unzip.c create mode 100644 Pkgs/unzip.h create mode 100644 Pkgs/wglew.h create mode 100644 ROMLoad.cpp create mode 100644 ROMLoad.h create mode 100644 Sound/SCSP.cpp create mode 100644 Sound/SCSP.h create mode 100644 Sound/SCSPDSP.cpp create mode 100644 Sound/SCSPDSP.h create mode 100644 Sound/SCSPLFO.cpp create mode 100644 Supermodel.h diff --git a/BlockFile.cpp b/BlockFile.cpp new file mode 100644 index 0000000..27f6fcc --- /dev/null +++ b/BlockFile.cpp @@ -0,0 +1,258 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * BlockFile.cpp + * + * Block format container file management. Implementation of the CBlockFile + * class. + */ + +#include +#include +#include "Supermodel.h" + + +/****************************************************************************** + Output Functions +******************************************************************************/ + +void CBlockFile::ReadString(char *str, unsigned strLen, unsigned maxLen) +{ + if (NULL == fp) + return; + if (strLen>maxLen) + strLen = maxLen; + fread(str, sizeof(char), strLen, fp); + str[strLen] = '\0'; +} + +unsigned CBlockFile::ReadBytes(void *data, unsigned numBytes) +{ + if (NULL == fp) + return 0; + return fread(data, sizeof(UINT8), numBytes, fp); +} + +unsigned CBlockFile::ReadDWord(UINT32 *data) +{ + if (NULL == fp) + return 0; + fread(data, sizeof(UINT32), 1, fp); + return 4; +} + +void CBlockFile::UpdateBlockSize(void) +{ + long int curPos; + unsigned newBlockSize; + + if (NULL == fp) + return; + curPos = ftell(fp); // save current file position + fseek(fp, blockStartPos, SEEK_SET); + newBlockSize = curPos - blockStartPos; + fwrite(&newBlockSize, sizeof(UINT32), 1, fp); + fseek(fp, curPos, SEEK_SET); // go back +} + +void CBlockFile::WriteByte(UINT8 data) +{ + if (NULL == fp) + return; + fwrite(&data, sizeof(UINT8), 1, fp); + UpdateBlockSize(); +} + +void CBlockFile::WriteDWord(UINT32 data) +{ + if (NULL == fp) + return; + fwrite(&data, sizeof(UINT32), 1, fp); + UpdateBlockSize(); +} + +void CBlockFile::WriteBytes(const void *data, unsigned numBytes) +{ + if (NULL == fp) + return; + fwrite(data, sizeof(UINT8), numBytes, fp); + UpdateBlockSize(); +} + +void CBlockFile::WriteBlockHeader(const char *name, const char *comment) +{ + unsigned nameLen, commentLen; + const char nullComment[1] = {'\0'}; + + if (NULL == fp) + return; + + if (comment == NULL) + comment = nullComment; + + nameLen = strlen(name); + commentLen = strlen(comment); + if (nameLen > 1024) + nameLen = 1024; + if (commentLen > 1024) + commentLen = 1024; + + // Record current block starting position + blockStartPos = ftell(fp); + + // Write the total block length field + WriteDWord(0); // will be automatically updated as we write the file + + // Write name and comment lengths + WriteDWord(nameLen+1); + WriteDWord(commentLen+1); + WriteBytes(name, nameLen); + WriteByte(0); + WriteBytes(comment, commentLen); + WriteByte(0); + + // Record the start of the current data section + dataStartPos = ftell(fp); +} + + +/****************************************************************************** + Block Format Container File Implementation + + Files are just a consecutive array of blocks that must be searched. + + Block Format + ------------ + blockLength (UINT32) Total length of block in bytes. + nameLength (UINT32) Length of name field including terminating 0 (up to + 1025). + commentLength (UINT32) Same as above, but for comment string. + name ... Name string (null-terminated, up to 1025 bytes). + comment ... Comment string (same as above). + data ... Raw data (blockLength - total header size). +******************************************************************************/ + +unsigned CBlockFile::Read(void *data, unsigned numBytes) +{ + if (mode == 'r') + return ReadBytes(data, numBytes); + return 0; +} + +void CBlockFile::Write(const void *data, unsigned numBytes) +{ + if (mode == 'w') + WriteBytes(data, numBytes); +} + +void CBlockFile::NewBlock(const char *name, const char *comment) +{ + if (mode == 'w') + WriteBlockHeader(name, comment); +} + +BOOL CBlockFile::FindBlock(const char *name) +{ + long int curPos = 0; + unsigned blockLen, nameLen, commentLen; + + if (mode != 'r') + return FAIL; + + fseek(fp, 0, SEEK_SET); + + while (curPos < fileSize) + { + blockStartPos = curPos; + + // Read header + curPos += ReadDWord(&blockLen); + curPos += ReadDWord(&nameLen); + curPos += ReadDWord(&commentLen); + ReadString(strBuf,nameLen,1025); + + // Is this the block we want? + if (!strcmp(strBuf,name)) + { + fseek(fp, blockStartPos+12+nameLen+commentLen, SEEK_SET); // move to beginning of data + dataStartPos = ftell(fp); + return OKAY; + } + + // Move to next block + fseek(fp, blockStartPos+blockLen, SEEK_SET); + curPos = blockStartPos+blockLen; + if (blockLen == 0) // this would never advance + break; + } + + return FAIL; +} + +BOOL CBlockFile::Create(const char *file, const char *headerName, const char *comment) +{ + fp = fopen(file, "wb"); + if (NULL == fp) + return FAIL; + mode = 'w'; + WriteBlockHeader(headerName, comment); + return OKAY; +} + +BOOL CBlockFile::Load(const char *file) +{ + fp = fopen(file, "rb"); + if (NULL == fp) + return FAIL; + mode = 'r'; + + // TODO: is this a valid block file? + + // Get the file size + fseek(fp, 0, SEEK_END); + fileSize = ftell(fp); + fseek(fp, 0, SEEK_SET); + + return OKAY; +} + +void CBlockFile::Close(void) +{ + if (fp != NULL) + fclose(fp); + fp = NULL; + mode = 0; +} + +CBlockFile::CBlockFile(void) +{ + fp = NULL; + mode = 0; // neither reading nor writing (do nothing) +} + +CBlockFile::~CBlockFile(void) +{ + if (fp != NULL) // in case user forgot + fclose(fp); + fp = NULL; + mode = 0; +} diff --git a/BlockFile.h b/BlockFile.h new file mode 100644 index 0000000..cb7e159 --- /dev/null +++ b/BlockFile.h @@ -0,0 +1,170 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * BlockFile.h + * + * Header file for block format container file management. + */ + +#ifndef INCLUDED_BLOCKFILE_H +#define INCLUDED_BLOCKFILE_H + + +/* + * CBlockFile: + * + * Block format container file. The file format is a series of consecutive, + * variable-length blocks referenced by unique name strings. + * + * All strings (comments and names) will be truncated to 1024 bytes, not + * including the null terminator. + * + * Members do not generate any output messages. + */ +class CBlockFile +{ +public: + /* + * Read(data, numBytes): + * + * Reads data from the current file position. + * + * Parameters: + * data Buffer to read to. + * numBytes Number of bytes to read. + * + * Returns: + * Number of bytes read. If not the same as numBytes, an error + * occurred. + */ + unsigned Read(void *data, unsigned numBytes); + + /* + * FindBlock(name): + * + * Scans the file for a block with the given name string. When it is found, + * the file pointer is set to the beginning of the data region. + * + * Parameters: + * name Name of block to locate. + * + * Returns: + * OKAY if found, FAIL if unable to locate. + */ + BOOL FindBlock(const char *name); + + /* + * Write(data, numBytes): + * + * Outputs data at the current file pointer position. Updates the block + * header appropriately. + * + * Parameters: + * data Data to write. + * numBytes Number of bytes to write. + */ + void Write(const void *data, unsigned numBytes); + + /* + * NewBlock(name, comment): + * + * Begins a new block. Writes the block header and sets the file pointer to + * the beginning of its data area. + * + * Parameters: + * name Block name. Must be unique and not NULL. + * comment Comment string to embed in the block header. + */ + void NewBlock(const char *title, const char *comment); + + /* + * Create(file, headerName, comment): + * + * Opens a block file for writing and creates the header block. This + * function must be called before attempting to write data. Otherwise, all + * write commands will be silently ignored. Read commands will be ignored + * and will always return 0's. + * + * Parameters: + * file File path. + * headerName Block name for header. Must be unique and not NULL. + * comment Comment string that will be embedded into file header. + * + * Returns: + * OKAY if successfully opened, otherwise FAIL. + */ + BOOL Create(const char *file, const char *headerName, const char *comment); + + /* + * Load(file): + * + * Open a block file file for reading. + * + * Parameters: + * file File path. + * + * Returns: + * OKAY if successfully opened and confirmed to be a valid Supermodel + * block file, otherwise FAIL. If the file could not be opened, all + * subsequent operations will be silently ignored (reads will return + * 0's). Write commands will be ignored. + */ + BOOL Load(const char *file); + + /* + * Close(void): + * + * Closes the file. + */ + void Close(void); + + /* + * CBlockFile(void): + * ~CBlockFile(void): + * + * Constructor and destructor. + */ + CBlockFile(void); + ~CBlockFile(void); + +private: + // Helper functions + void ReadString(char *str, unsigned strLen, unsigned maxLen); + unsigned ReadBytes(void *data, unsigned numBytes); + unsigned ReadDWord(UINT32 *data); + void UpdateBlockSize(void); + void WriteByte(UINT8 data); + void WriteDWord(UINT32 data); + void WriteBytes(const void *data, unsigned numBytes); + void WriteBlockHeader(const char *name, const char *comment); + + // File state data + char strBuf[1026]; // buffers up to a 1024-character string, its terminator, and an extra terminator (just in case) + FILE *fp; + int mode; // 'r' for read, 'w' for write + long int fileSize; // size of file in bytes + long int blockStartPos; // points to beginning of current block (or file) header + long int dataStartPos; // points to beginning of current block's data section +}; + + +#endif // INCLUDED_BLOCKFILE_H diff --git a/CPU/68K/Make68K.c b/CPU/68K/Make68K.c new file mode 100644 index 0000000..48ac8fe --- /dev/null +++ b/CPU/68K/Make68K.c @@ -0,0 +1,8938 @@ +/* + * Turbo68K: Motorola 680X0 emulator + * Copyright 2000-2002 Bart Trzynadlowski, see "README.TXT" for terms of use + */ + +/* + * Make68K: This program emits Turbo68K. Please see README.TXT for details. + * + * Note: If you get a link error involving pow(), remember to link in the math + * library. Try using "-lm". + * + * Note: I am not certain about dummy reads. The manual says they occur with + * some instructions on the MC68000 and MC68008 only. Does this include + * the MC68EC000? I'm assuming it does. Also, is a dummy read made for + * all Scc instructions, or just ST? I'm assuming all of them do it. + * + * Note: Do not use the profiling feature (#define PROFILE.) It will add + * useless junk to the emulator. + * + * Note: Future plans: I intend on removing as much of the Save/RestoreReg() + * junk from the API functions as possible. PUSH/POPs should work much + * better. + * + * Additional developers' notes pertaining to all aspects of Turbo68K can be + * found at the very end of this file. + */ + + +#include +#include +#include +#include +#include +#include "turbo68k.h" + +#define VERSION "0.6" + +#define SIZEOF_CONTEXT "(context_end - context_start)" +#define SIZEOF_FETCHREGION "12" +#define SIZEOF_DATAREGION "16" +#define OFFSET_DATA_BASE "0" +#define OFFSET_DATA_LIMIT "4" +#define OFFSET_DATA_PTR "8" +#define OFFSET_DATA_HANDLER "12" +#define OFFSET_FETCH_BASE "0" +#define OFFSET_FETCH_LIMIT "4" +#define OFFSET_FETCH_PTR "8" + +#define WRITEPCTOMEM(dest) { \ + e("mov dword ["dest"], esi\n");\ + e("sub dword ["dest"], ebp\n");\ + } +#define WRITEPCTOREG(dest) { \ + e("mov "dest", esi\n"); \ + e("sub "dest", ebp\n"); \ + } +#define EMULATING() e("or byte [status], 1\n"); +#define STOP_EMULATING() e("and byte [status], 0xfe\n"); +#define STOP_CPU() e("or byte [status], 2\n"); +#define UNSTOP_CPU() e("and byte [status], 0xfd\n"); +#define INTERRUPT_PROCESSING() e("or byte [status], 4\n"); +#define INTERRUPT_DONE() e("and byte [status], 0xfb\n"); +#define STOP_RUNNING() { \ + e("mov [remaining], ecx\n"); \ + WRITEPCTOMEM("pc"); \ + } +#define A7 "[a+7*4]" +#define SP "[__sp]" +#define SR "[sr]" + +#define UNKNOWN_SIZE 0 +#define BYTE_SIZE 1 +#define WORD_SIZE 2 +#define LONG_SIZE 3 + +unsigned short decoded[65536]; /* compressed jump table data */ +char id[17] = { '\0' }; /* prepended to identifiers */ +FILE *fp; /* output file */ +int mpu = 68000; /* 68000 by default */ +unsigned addr_bits = 24; /* 24-bit by default */ +unsigned addr_mask = 0xffffff; +int illegal = 1; /* illegal instruction traps */ +int dummyread = 1; /* dummy reads (68000 only) */ +int skip = 0; /* CPU (idle loop) skipping */ +int brafetch = 0; /* branch fetch ptr updating */ +int pcfetch = 0; /* special PC-relative fetching */ +int multiaddr = 1; /* supervisor and user spaces */ +int memmap_type = 0; /* memory map type */ +int call_convention = 0; /* calling convention */ +int mmx = 0; /* MMX support -- don't use! */ +unsigned num_handlers = 0; /* # of inst. handlers emitted */ + +#ifdef PROFILE +char *prof[512]; +int prof_i = 0; +#endif + + +/***************************************************************************** +* General Emitters */ + +void e(char *input, ...) +{ + va_list arg; + char text[256]; + va_start(arg, input); + vsprintf(text, input, arg); + va_end(arg); + fprintf(fp, text); +} + +void EmitLabel(char *label) +{ + e("%s:\n", label); +} + +void Align(int i) +{ + e("times ($$-$) & %d nop\n", i - 1); +} + +void CacheAlign() +{ + Align(32); +} + +void EmitGlobalLabel(char *label) +{ + e("global %s%s, _%s%s, %s%s_\n", id, label, id, label, id, label); + e("%s%s:\n_%s%s:\n%s%s_:\n", id, label, id, label, id, label); +} + + +/***************************************************************************** +* Utility Functions */ + +/* + * SizeOfContext(): Returns the size of the context if needed by the emitter. + * This should be used instead of C's sizeof(). + */ + +int SizeOfContext() +{ + switch (mpu) + { + case 68010: + return sizeof(struct TURBO68K_CONTEXT_68010); + } + return sizeof(struct TURBO68K_CONTEXT_68000); +} + +/* + * NameOfContext(): Returns the name of the context based on the MPU type, + * but NOT with the identifier in front of it. + */ + +static char *NameOfContext() +{ + static char name[16 + 6 + 1]; + + sprintf(name, "turbo68kcontext_%d", mpu); + return name; +} + +/* + * NOTE: Only pass 32-bit or 8-bit (XL, not XH regs) to the SaveReg/SaveRegTo, + * RestoreReg/RestoreRegTo functions. Don't ever pass 16-bit regs! + */ + +/* + * SaveReg/RestoreReg: Save/restore registers to/from a specific save slot + * area. + */ + +void SaveReg(char *area, char *reg) +{ + if (mmx) + { + if (!strcmp(area, "memhandler")) + { /* memhandler always saves full reg */ + if (!strcmp(reg, "eax")) { e("movd mm0, eax\n"); return; } + if (!strcmp(reg, "ebx")) { e("movd mm1, ebx\n"); return; } + if (!strcmp(reg, "ebp")) { e("movd mm2, ebp\n"); return; } + } + else if (!strcmp(area, "run")) + { /* we have to check if its a full or byte reg */ + if (!strcmp(reg, "edx") || !strcmp(reg, "dl")) + { + e("movd mm3, edx\n"); + return; + } + if (!strcmp(reg, "esi")) { e("movd mm4, esi\n"); return; } + if (!strcmp(reg, "edi")) { e("movd mm5, edi\n"); return; } + } + } + + e("mov [%s_", area); + if (reg[1] == 'l') /* ?l byte reg */ + { + switch (reg[0]) + { + case 'a': e("eax"); break; + case 'b': e("ebx"); break; + case 'c': e("ecx"); break; + case 'd': e("edx"); break; + } + } + else + e("%s", reg); + e("], %s\n", reg); +} + +void RestoreReg(char *area, char *reg) +{ + if (mmx) + { + if (!strcmp(area, "memhandler")) + { /* memhandler always restores full reg */ + if (!strcmp(reg, "eax")) { e("movd eax, mm0\n"); return; } + if (!strcmp(reg, "ebx")) { e("movd ebx, mm1\n"); return; } + if (!strcmp(reg, "ebp")) { e("movd ebp, mm2\n"); return; } + } + else if (!strcmp(area, "run")) + { /* we have to check if its a full or byte reg */ + if (!strcmp(reg, "edx") || !strcmp(reg, "dl")) + { + e("movd edx, mm3\n"); + return; + } + if (!strcmp(reg, "esi")) { e("movd esi, mm4\n"); return; } + if (!strcmp(reg, "edi")) { e("movd edi, mm5\n"); return; } + } + } + + e("mov %s, [%s_", reg, area); + if (reg[1] == 'l') /* ?l byte reg */ + { + switch (reg[0]) + { + case 'a': e("eax"); break; + case 'b': e("ebx"); break; + case 'c': e("ecx"); break; + case 'd': e("edx"); break; + } + } + else + e("%s", reg); + e("]\n"); +} + +/* + * SaveRegTo/RestoreRegTo: Saves/restore a register to a different register + * than indicated by the name of the save slot. + */ + +void SaveRegTo(char *area, char *d_reg, char *s_reg) +{ + if (mmx) + { + /* currently, memhandlers don't need this, only run_ does. */ + if (!strcmp(area, "run")) + { + /* test to make sure dest is MMX-able */ + if (!strcmp(d_reg, "edx") || !strcmp(d_reg, "esi") || !strcmp(d_reg, "edi")) + { + e("movd "); + if (!strcmp(d_reg, "edx")) e("mm3, "); + else if (!strcmp(d_reg, "esi")) e("mm4, "); + else if (!strcmp(d_reg, "edi")) e("mm5, "); + + if (s_reg[1] == 'l') /* ?l byte reg */ + { + switch (s_reg[0]) + { + case 'a': e("eax\n"); break; + case 'b': e("ebx\n"); break; + case 'c': e("ecx\n"); break; + case 'd': e("edx\n"); break; + } + } + else + e("%s\n", s_reg); + return; + } + } + } + e("mov [%s_%s], %s\n", area, d_reg, s_reg); +} + +void RestoreRegTo(char *area, char *s_reg, char *d_reg) +{ + if (mmx) + { + /* currently, memhandlers don't need this, only run_ does. */ + if (!strcmp(area, "run")) + { + /* test to make sure src is MMX-able */ + if (!strcmp(s_reg, "edx") || !strcmp(s_reg, "esi") || !strcmp(s_reg, "edi")) + { + e("movd "); + if (d_reg[1] == 'l') /* ?l byte reg */ + { + switch (d_reg[0]) + { + case 'a': e("eax, "); break; + case 'b': e("ebx, "); break; + case 'c': e("ecx, "); break; + case 'd': e("edx, "); break; + } + } + else + e("%s, ", d_reg); + + if (!strcmp(s_reg, "edx")) e("mm3\n"); + else if (!strcmp(s_reg, "esi")) e("mm4\n"); + else if (!strcmp(s_reg, "edi")) e("mm5\n"); + return; + } + } + } + e("mov %s, [%s_%s]\n", d_reg, area, s_reg); +} + +void AddrClip(char *reg) +{ /* if it's 32-bit we don't need this */ + if (addr_mask != 0xffffffff) e("and %s, 0x%08X\n", reg, addr_mask); +} + +void RideIntoTheDangerZone() /* where EBP is modified and must be saved */ +{ + e("push ebp\n"); +} + +void RideOutOfTheDangerZone() +{ + e("pop ebp\n"); +} + +void GetArg(char *dest_reg, int num_arg, int stack_offs) +{ + char *reg[2] = { "eax", "edx" }; /* currently, only 2 args supported */ + + if (num_arg > 1) /* error! */ + { + fprintf(stderr, "Make68K: Internal Error: GetArg() called with num_arg = %d. Please contact Bart Trzynadlowski!\n", num_arg); + if (call_convention) + return; + } + + if (!call_convention) + e("mov %s, [esp+%d]\n", dest_reg, stack_offs); + else + { + if ((!strcmp(dest_reg, "eax") && !num_arg) || (!strcmp(dest_reg, "edx") && num_arg == 1)) + ; /* EAX,EAX or EDX,EDX */ + else + e("mov %s, %s\n", dest_reg, reg[num_arg]); + } +} + +void GetArgFromTheDangerZone(char *dest_reg, int num) +{ + char *reg[2] = { "eax", "edx" }; /* no more than 2 args usually */ + + if (!call_convention) /* stack-based */ + e("mov %s, [esp+8+(%d*4)]\n", dest_reg, num); + else /* register-based */ + { + if ((!strcmp(dest_reg, "eax") && !num) || (!strcmp(dest_reg, "edx") && num == 1)) + ; /* EAX,EAX or EDX,EDX */ + else + e("mov %s, %s\n", dest_reg, reg[num]); + } +} + +void GetArgNoStringsAttached(char *dest_reg, int num) +{ + char *reg[2] = { "eax", "edx" }; /* no more than 2 args usually */ + + if (!call_convention) + e("mov %s, [esp+4+(%d*4)]\n", dest_reg, num); + else + { + if ((!strcmp(dest_reg, "eax") && !num) || (!strcmp(dest_reg, "edx") && num == 1)) + ; /* EAX,EAX or EDX,EDX */ + else + e("mov %s, %s\n", dest_reg, reg[num]); + } +} + +void ReadLong() +{ + if (memmap_type == 0 || memmap_type == 1) e("call ReadLong\n"); + else if (memmap_type == 2) e("call dword [read_long]\n"); +} + +void ReadByte() +{ + if (memmap_type == 0 || memmap_type == 1) e("call ReadByte\n"); + else if (memmap_type == 2) e("call dword [read_byte]\n"); +} + +void ReadWord() +{ + if (memmap_type == 0 || memmap_type == 1) e("call ReadWord\n"); + else if (memmap_type == 2) e("call dword [read_word]\n"); +} + +void WriteLong() +{ + if (memmap_type == 0 || memmap_type == 1) e("call WriteLong\n"); + else if (memmap_type == 2) e("call dword [write_long]\n"); +} + +void WriteByte() +{ + if (memmap_type == 0 || memmap_type == 1) e("call WriteByte\n"); + else if (memmap_type == 2) e("call dword [write_byte]\n"); +} + +void WriteWord() +{ + if (memmap_type == 0 || memmap_type == 1) e("call WriteWord\n"); + else if (memmap_type == 2) e("call dword [write_word]\n"); +} + +void ReadByteSX() +{ + fprintf(stderr, "Make68K: Internal Error: Sign-extended byte read handler required. Please contact Bart Trzynadlowski!\n"); + exit(1); +} + +void ReadWordSX() +{ + if (memmap_type == 0 || memmap_type == 1) e("call ReadWordSX\n"); + else if (memmap_type == 2) + { + e("call dword [read_word]\n"); + e("movsx edx, dx\n"); + } +} + +/* + * LoadFromEA() and MOVEM() use the ReadXXXPC() functions. + */ + +void ReadLongPC() +{ + e("call ReadLongPC\n"); +} + +void ReadBytePC() +{ + e("call ReadBytePC\n"); +} + +void ReadWordPC() +{ + e("call ReadWordPC\n"); +} + +void ReadByteSXPC() +{ + fprintf(stderr, "Make68K: Internal Error: Sign-extended byte read handler required. Please contact Bart Trzynadlowski!\n"); + exit(1); + + e("call ReadBytePC\n"); + e("movsx edx, dl\n"); +} + +void ReadWordSXPC() +{ + e("call ReadWordPC\n"); + e("movsx edx, dx\n"); +} + +void UpdateFetchPtr() /* scan the fetch area */ +{ + int inst = 0; + /* + * In: ESI = address + * Out: ESI = PC + ptr + * EBP = ptr (base) + * EDX = trashed + */ + + /* + * Note: If address bus is NOT 32-bits, the following applies. + * + * The unused bits of the PC MUST be preserved. Therefore, those unused + * bits are subtracted from the base pointer so that when we add a PC + * WITH unused bits, it won't go out of range, because it will be far + * below range to begin with. + * + * The reasoning here is that if we subtract the unused bits from the base + * pointer, the unused bits in the normalized PC pointer (ESI) will cancel + * out. + */ + if (addr_mask != 0xffffffff) + SaveReg("fetch", "esi"); + AddrClip("esi"); + e("mov edx, [fetch]\n"); + e(".find_fetch_loop%d:\n", inst); + e("add edx, byte "SIZEOF_FETCHREGION"\n"); + e("cmp dword [edx], byte -1\n"); /* limit=-1? end. */ + e("je near fetch_error\n"); + e("cmp esi, [edx]\n"); /* offset 0: base. above it? */ + e("jb .find_fetch_loop%d\n", inst); /* nope, not this region */ + e("cmp esi, [edx+"OFFSET_FETCH_LIMIT"]\n"); /* limit. below it? */ + e("ja .find_fetch_loop%d\n", inst); /* nope, not this region */ + e("mov ebp, [edx+"OFFSET_FETCH_PTR"]\n"); /* ebp=base ptr */ + if (addr_mask != 0xffffffff) /* to handle those nasty unused bits! */ + { + e("mov edx, [fetch_esi]\n"); + e("mov esi, edx\n"); /* this is the ACTUAL PC we saved earlier */ + e("and edx, 0x%08X\n", ~addr_mask);/* we only want the unused bits */ + e("sub ebp, edx\n"); + } + e("add esi, ebp\n"); /* +pc=pc ptr.. */ +} + +void LoadCCR() /* CCR->AX ... trashes AX and DX */ +{ + e("mov dh, [sr]\n"); /* DH:***XNZVC */ + e("mov ah, dh\n"); /* AH:***XNZVC */ + e("shl ah, byte 4\n"); /* AH:NZVC0000 */ + e("test dh, byte 2\n"); /* V flag? */ + e("setnz al\n"); /* AL:0000000V */ + e("test dh, 0x10\n"); /* X flag? */ + e("setnz byte [x]\n"); /* X:0000000000000000000000000000000X */ + e("and dh, byte 1\n"); /* DH:0000000C */ + e("or ah, dh\n"); /* AH:NZ**000C */ +} + +void SaveCCR() /* AX->CCR... trashes AX and DX */ +{ + e("and eax, 0xc101\n"); /* EAX:0000000000000000NZ00000C0000000V */ + e("mov dh, ah\n"); /* DH:NZ00000C */ + e("shr dh, byte 4\n"); /* DH:0000NZ00 */ + e("shl al, byte 1\n"); /* AL:000000V0 */ + e("or dh, al\n"); /* DH:0000NZV0 */ + e("shr ah, byte 1\n"); /* CF:C */ + e("adc dh, 0\n"); /* DH:0000NZVC */ + e("mov ah, [x]\n"); /* AH:0000000X */ + e("shl ah, byte 4\n"); /* AH:000X0000 */ + e("or dh, ah\n"); /* DH:000XNZVC */ + e("mov [sr], dh\n"); +} + +void InstBegin(unsigned short op, char *mnem, unsigned num) +{ +#ifdef PROFILE + int i; +#endif + + Align(4); + if (num == 1) + e("I%04X: ; %s\t\t0x%04X\n", op, mnem, op); + else + e("I%04X: ; %s\t\t0x%04X-0x%04X\n", op, mnem, op, op+(num-1)); + decoded[op] = num; + num_handlers++; + +#ifdef PROFILE + for (i = 0; i < strlen(mnem); i++) /* remove spaces */ + { + if (mnem[i] == ' ') + mnem[i] = '_'; + } + e("inc dword [prof%s]\n", mnem); + for (i = 0; prof[i] != NULL && i < 512; i++) + { + if (!strcmp(prof[i], mnem)) /* already have one of these... */ + return; + } + prof[prof_i] = calloc(strlen(mnem) + 1, 1); + strcpy(prof[prof_i], mnem); + prof_i++; +#endif +} + +void InstEnd() +{ + e("mov di, [esi]\n"); + e("add esi, byte 2\n"); /* point to word after next opcode */ + e("jmp dword [jmptab+edi*4]\n"); +} + + +/***************************************************************************** +* Address Space Management */ + +/* + * Input: Nothing + * Notes: Assumes that run_ecx, run_edi, and run_esi are available for use. + */ + +void SetSupervisorAddressSpace() +{ + if (!multiaddr) return; + e("push ecx\n"); + e("cld\n"); /* direction: forward */ + e("push esi\n"); + e("push edi\n"); + e("mov ecx, 8\n"); /* 8 dword-size pointers to copy */ + e("mov edi, fetch\n"); + e("mov esi, super_fetch\n"); + e("rep movsd\n"); + e("pop edi\n"); + e("pop esi\n"); + e("pop ecx\n"); +} + +void SetUserAddressSpace() +{ + if (!multiaddr) return; + e("push ecx\n"); + e("cld\n"); /* direction: forward */ + e("push esi\n"); + e("push edi\n"); + e("mov ecx, 8\n"); /* 8 dword-size pointers to copy */ + e("mov edi, fetch\n"); + e("mov esi, user_fetch\n"); + e("rep movsd\n"); + e("pop edi\n"); + e("pop esi\n"); + e("pop ecx\n"); +} + + +/***************************************************************************** +* Timing */ + +/* TimingEA: calculates amount of clocks taken by a given EA mode */ +unsigned TimingEA(unsigned ea, int size) +{ /* EA format = MMMRRR (mode/register) */ + switch ((ea >> 3) & 7) /* mode */ + { + case 0: case 1: return 0; break; + case 2: case 3: + switch (size) { case BYTE_SIZE: case WORD_SIZE: return 4; break; + case LONG_SIZE: return 8; break; } break; + case 4: + switch (size) { case BYTE_SIZE: case WORD_SIZE: return 6; break; + case LONG_SIZE: return 10; break; } break; + case 5: + switch (size) { case BYTE_SIZE: case WORD_SIZE: return 8; break; + case LONG_SIZE: return 12; break; } break; + case 6: + switch (size) { case BYTE_SIZE: case WORD_SIZE: return 10; break; + case LONG_SIZE: return 14; break; } break; + case 7: /* misc... */ + switch (ea & 0x7) { case 0: /* (xxx).W */ + switch (size) + { case BYTE_SIZE: case WORD_SIZE: return 8; break; + case LONG_SIZE: return 12; break; } break; + case 1: /* (xxx).L */ + switch (size) + { case BYTE_SIZE: case WORD_SIZE: return 12; break; + case LONG_SIZE: return 16; break; } break; + case 4: /* # */ + switch (size) + { case BYTE_SIZE: case WORD_SIZE: return 4; break; + case LONG_SIZE: return 8; break; } break; + case 2: /* (d16,pc) */ + switch (size) + { case BYTE_SIZE: case WORD_SIZE: return 8; break; + case LONG_SIZE: return 12; break; } break; + case 3: /* (d8,pc,Xn) */ + switch (size) + { case BYTE_SIZE: case WORD_SIZE: return 10; break; + case LONG_SIZE: return 14; break; } break; + } + } return 0; +} + +void EmitTiming(unsigned cycles) +{ + if (cycles) + { + if (cycles == 1) e("dec ecx\n"); + else if (!(cycles & 0x80)) e("sub ecx, byte %d\n", cycles); + else e("sub ecx, %d\n", cycles); + e("js near Turbo68KRun_done\n"); /* below 0, finished */ + } +} + + +/***************************************************************************** +* Effective Address Code */ + +int CheckEA(unsigned ea, char *valid) /* EA = MMMRRR (mode/reg) */ +{ + /* + * valid[] string is a mask for valid addressing modes as they appear + * in the 68K manual, in order, 1 = okay, 0 = not allowed + */ + + if (((ea >> 3) & 7) != 7) /* mode 7 is handled separately */ + { + if (valid[(ea >> 3) & 7] != '1') return 0; /* not allowed! */ + else return 1; + } + else /* handle mode 7 here */ + { + /* first check if the register is invalid */ + if ((ea & 7) >= 5) return 0; /* no such thing! */ + else + { + switch (ea & 7) + { + case 0: + case 1: + if (valid[7+(ea & 7)] != '1') return 0; + else return 1; break; + case 4: + if (valid[7+2] != '1') return 0; + else return 1; break; + case 2: + if (valid[7+3] != '1') return 0; + else return 1; break; + case 3: + if (valid[7+4] != '1') return 0; + else return 1; break; + } + } + } return 0; +} + +int NumDecodedEA(unsigned ea) /* how many handlers can this feed? */ +{ + /* + * Turbo68K does not generate an instruction handler for every possible + * opcode, instead, it generates one for every possible EA mode of a given + * instruction. This means if reg==0, it returns the # to pass to InstEnd + * (which indicates how many opcodes this will cover for) Otherwise, this + * function returns 0 and the instruction handler should not be emitted. + */ + + if (((ea >> 3) & 7) <= 6 && (ea & 7) != 0) return 0; + else if (((ea >> 3) & 7) <= 6 && (ea & 7) == 0) return 8; /* 8 regs */ + else if (((ea >> 3) & 7) == 7 && (ea & 7) <= 4) return 1; /* 1 reg */ + return 0; +} + +/* + * Effective Address calculations + * + * Note: When loading words, usually the whole dword is loaded. When storing, + * only the word part is stored + */ + +/* + * Returns: Data in EDX, address preserved in EBX + * Used: EBX, EDX, EDI (unless reading from register) + * Notes: ESI is assumed to point at word after opcode + * Assumes EDI contains opcode and that it has EA at the very end + * This function is only to be used when EA mode fields are located + * at bits 0-5. + */ + +void LoadFromEA(unsigned ea, int size, int sign_extend) +{ + switch ((ea >> 3) & 7) + { + case 0: /* Dn */ + case 1: /* An */ + { + char r = ((ea >> 3) & 7) ? 'a' : 'd'; + e("and edi, byte 7\n"); /* get reg number, EDI contains opcode */ + if (size == LONG_SIZE) + e("mov edx, [%c+edi*4]\n", r); + else + { + if (size == BYTE_SIZE) + { + if (!sign_extend) + e("mov dl, [%c+edi*4]\n", r); + else + e("movsx edx, byte [%c+edi*4]\n", r); + } + else /* word size */ + { + if (!sign_extend) + e("mov edx, [%c+edi*4]\n", r); + else + e("movsx edx, word [%c+edi*4]\n", r); + } + } + } + break; + case 2: /* (An) */ + case 3: /* (An)+ */ + case 4: /* -(An) */ + case 5: /* (d16,An) */ + e("and edi, byte 7\n"); /* reg */ + if (((ea >> 3) & 7) == 4) /* pre-dec */ + { + if (size == BYTE_SIZE) + { + e("cmp edi, byte 7\n"); /* A7 bytes */ + e("cmc\n"); /* switch carry */ + e("sbb dword [a+edi*4], byte 1\n"); + } + else if (size == WORD_SIZE) + e("sub dword [a+edi*4], byte 2\n"); + else if (size == LONG_SIZE) + e("sub dword [a+edi*4], byte 4\n"); + } + if (((ea >> 3) & 7) == 5) /* (d16,An) */ + { + e("movsx ebx, word [esi]\n"); + e("add ebx, [a+edi*4]\n"); + e("add esi, byte 2\n"); /* past d16, next instruction */ + } + else + e("mov ebx, [a+edi*4]\n"); + if (((ea >> 3) & 7) == 3) /* post-inc */ + { + if (size == BYTE_SIZE) + { + e("cmp edi, byte 7\n"); /* A7 bytes */ + e("cmc\n"); /* switch carry */ + e("adc dword [a+edi*4], byte 1\n"); + } + else if (size == WORD_SIZE) + e("add dword [a+edi*4], byte 2\n"); + else if (size == LONG_SIZE) + e("add dword [a+edi*4], byte 4\n"); + } + switch (size) + { + case BYTE_SIZE: + if (sign_extend) + ReadByteSX(); + else + ReadByte(); + break; + case WORD_SIZE: + if (sign_extend) + ReadWordSX(); + else + ReadWord(); + break; + case LONG_SIZE: + ReadLong(); + break; + } + break; + case 6: /* (d8,An,Xn) */ + e("and edi, byte 7\n"); /* An reg # */ + e("xor ebx, ebx\n"); /* so the high part is clear */ + e("mov bx, [esi]\n"); /* fetch extension word */ + e("movsx edx, bl\n"); /* sign-extended index */ + e("add esi, byte 2\n"); /* point at next word */ + e("shr ebx, byte 12\n"); /* regs must be: d, a for this to work */ + /* the shr sets CF if Long reg */ + e("mov ebx, [d+ebx*4]\n"); + e("jc short .ll\n"); /* CF=1? index reg is LONG */ + e("movsx ebx, bx\n"); /* otherwise: sign-extended WORD */ + EmitLabel(".ll"); + e("add ebx, edx\n"); /* disp+index_reg */ + e("add ebx, [a+edi*4]\n"); + switch (size) + { + case BYTE_SIZE: + if (sign_extend) + ReadByteSX(); + else + ReadByte(); + break; + case WORD_SIZE: + if (sign_extend) + ReadWordSX(); + else + ReadWord(); + break; + case LONG_SIZE: + ReadLong(); + break; + } + break; + case 0x7: + switch (ea & 7) + { + case 0: /* (xxx).W */ + case 1: /* (xxx).L */ + if ((ea & 7) == 0) /* word */ + { + e("movsx ebx, word [esi]\n"); + e("add esi, byte 2\n"); + } + else /* long */ + { + e("mov ebx, [esi]\n"); + e("ror ebx, byte 16\n"); /* word-swap */ + e("add esi, byte 4\n"); + } + switch (size) + { + case BYTE_SIZE: + if (sign_extend) + ReadByteSX(); + else + ReadByte(); + break; + case WORD_SIZE: + if (sign_extend) + ReadWordSX(); + else + ReadWord(); + break; + case LONG_SIZE: + ReadLong(); + break; + } + break; + case 4: /* # */ + switch (size) + { + case BYTE_SIZE: + if (!sign_extend) + e("mov dl, [esi]\n"); /* get low byte of ext. word */ + else + e("movsx edx, byte [esi]\n"); + e("add esi, byte 2\n"); + break; + case WORD_SIZE: + if (!sign_extend) + e("mov edx, [esi]\n"); /* bx = word, ebx=????:word */ + else + e("movsx edx, word [esi]\n"); + e("add esi, byte 2\n"); + break; + case LONG_SIZE: + e("mov edx, [esi]\n"); /* get long-word */ + e("add esi, byte 4\n"); + e("ror edx, byte 16\n"); /* word swap to work... */ + break; + } + break; + case 2: /* (d16,PC) */ + /* + * The PC is assumed to be pointing at the extension word, which + * is exactly how the emulator works + */ + e("movsx ebx, word [esi]\n"); + e("add ebx, esi\n"); + e("sub ebx, ebp\n"); + e("add esi, byte 2\n"); + switch (size) + { + case BYTE_SIZE: + if (sign_extend) + pcfetch ? ReadByteSXPC() : ReadByteSX(); + else + pcfetch ? ReadBytePC() : ReadByte(); + break; + case WORD_SIZE: + if (sign_extend) + pcfetch ? ReadWordSXPC() : ReadWordSX(); + else + pcfetch ? ReadWordPC() : ReadWord(); + break; + case LONG_SIZE: + pcfetch ? ReadLongPC() : ReadLong(); + break; + } + break; + case 3: /* (d8,PC,Xn) */ + e("xor ebx, ebx\n"); /* so the high part is clear */ + e("mov bx, [esi]\n"); /* fetch extension word */ + e("movsx edx, bl\n"); /* sign-extended index */ + e("shr ebx, byte 12\n"); /* regs must be: d, a for this to work */ + /* the shr sets CF if Long reg */ + e("mov ebx, [d+ebx*4]\n"); + e("jc short .ll\n"); /* CF=1? index reg is LONG */ + e("movsx ebx, bx\n"); /* otherwise: sign-extended WORD */ + EmitLabel(".ll"); + e("add ebx, edx\n"); /* disp+index_reg */ + e("add ebx, esi\n"); /* add the PC */ + e("sub ebx, ebp\n"); + e("add esi, byte 2\n"); /* point at next word */ + switch (size) + { + case BYTE_SIZE: + if (sign_extend) + pcfetch ? ReadByteSXPC() : ReadByteSX(); + else + pcfetch ? ReadBytePC() : ReadByte(); + break; + case WORD_SIZE: + if (sign_extend) + pcfetch ? ReadWordSXPC() : ReadWordSX(); + else + pcfetch ? ReadWordPC() : ReadWord(); + break; + case LONG_SIZE: + pcfetch ? ReadLongPC() : ReadLong(); + break; + } + break; + } + break; + default: + printf("Error!\a\n"); + break; + } +} + +/* + * Expects: Data in EDX, address in EBX + * Notes: Destroys EBX, make sure to preserve the address if you need it. + */ + +void StoreToEA(unsigned ea, int size, int same) +{ /* the "same" parameter is ignored. it no longer is needed */ + switch ((ea >> 3) & 7) + { + case 0: /* Dn */ + case 1: /* An */ + { + char r = ((ea >> 3) & 7) ? 'a' : 'd'; + if (size == LONG_SIZE) + e("mov [%c+%d*4], edx\n", r, ea & 7); + else if (size == BYTE_SIZE) + e("mov [%c+%d*4], dl\n", r, ea & 7); + else if (size == WORD_SIZE) + e("mov [%c+%d*4], dx\n", r, ea & 7); + } + break; + case 2: /* (An) */ + case 3: /* (An)+ */ + case 4: /* -(An) */ + case 5: /* (d16,An) */ + if (((ea >> 3) & 7) == 4) /* pre-dec */ + { + if (size == BYTE_SIZE) + { + if ((ea & 7) == 7) /* A7 kept word aligned */ + e("sub dword [a+%d*4], byte 2\n", ea & 7); + else + e("dec dword [a+%d*4]\n", ea & 7); + } + else if (size == WORD_SIZE) + e("sub dword [a+%d*4], byte 2\n", ea & 7); + else if (size == LONG_SIZE) + e("sub dword [a+%d*4], byte 4\n", ea & 7); + } + if (((ea >> 3) & 7) == 5) /* (d16,An) */ + { + e("movsx ebx, word [esi]\n"); + e("add ebx, [a+%d*4]\n", ea & 7); + e("add esi, byte 2\n"); /* past d16, next instruction */ + } + else + e("mov ebx, [a+%d*4]\n", ea & 7); + if (((ea >> 3) & 7) == 3) /* post-inc */ + { + if (size == BYTE_SIZE) + { + if ((ea & 7) == 7) /* A7 kept word aligned */ + e("add dword [a+%d*4], byte 2\n", ea & 7); + else + e("inc dword [a+%d*4]\n", ea & 7); + } + else if (size == WORD_SIZE) + e("add dword [a+%d*4], byte 2\n", ea & 7); + else if (size == LONG_SIZE) + e("add dword [a+%d*4], byte 4\n", ea & 7); + } + switch (size) + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; } + break; + case 6: /* (d8,An,Xn) */ + e("xor ebx, ebx\n"); /* so the high part is clear */ + e("mov bx, [esi]\n"); /* fetch extension word */ + e("movsx edi, bl\n"); /* sign-extended index */ + e("add esi, byte 2\n"); /* point at next word */ + e("shr ebx, byte 12\n"); /* regs must be: d, a for this to work */ + /* the shr sets CF if Long reg */ + e("mov ebx, [d+ebx*4]\n"); + e("jc short .ls\n"); /* CF=1? index reg is LONG */ + e("movsx ebx, bx\n"); /* otherwise: sign-extended WORD */ + EmitLabel(".ls"); + e("add ebx, edi\n"); /* disp+index_reg */ + e("add ebx, [a+%d*4]\n", ea & 7); + switch (size) /* WriteXXX() clears EDI */ + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; } + break; + case 0x7: + switch (ea & 7) + { + case 0: /* (xxx).W */ + case 1: /* (xxx).L */ + if ((ea & 7) == 0) /* word */ + { + e("movsx ebx, word [esi]\n"); + e("add esi, byte 2\n"); + } + else /* long */ + { + e("mov ebx, [esi]\n"); + e("ror ebx, byte 16\n"); /* word-swap */ + e("add esi, byte 4\n"); + } + switch (size) + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; } + break; + case 4: /* # */ + /* can't store to #data! */ + printf("Error!\a\n"); + break; + case 2: /* (d16,PC) */ + /* + * The PC is assumed to be pointing at the extension word, which + * is exactly how the emulator works + */ + e("movsx ebx, word [esi]\n"); + e("add ebx, esi\n"); + e("sub ebx, ebp\n"); + e("add esi, byte 2\n"); + switch (size) + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; } + break; + case 3: /* (d8,PC,Xn) */ + e("xor ebx, ebx\n"); /* so the high part is clear */ + e("mov bx, [esi]\n"); /* fetch extension word */ + e("movsx edi, bl\n"); /* sign-extended index */ + e("shr ebx, byte 12\n"); /* regs must be: d, a for this to work */ + /* the shr sets CF if Long reg */ + e("mov ebx, [d+ebx*4]\n"); + e("jc short .ls\n"); /* CF=1? index reg is LONG */ + e("movsx ebx, bx\n"); /* otherwise: sign-extended WORD */ + EmitLabel(".ls"); + e("add ebx, edi\n"); /* disp+index_reg */ + e("add ebx, esi\n"); /* add the PC */ + e("sub ebx, ebp\n"); + e("add esi, byte 2\n"); /* point at next word */ + switch (size) /* WriteXXX() clears EDI */ + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; } + break; + } + break; + default: + break; + } +} + +/* + * This is the same as StoreToEA() except that it uses EDI&7 to find the + * register. It is assumed that EA is bits 0-5 of the opcode. This only works + * in special situations like CLR and Scc. + */ + +void StoreToEAUsingEDI(unsigned ea, int size, int same) +{ /* the "same" parameter is ignored. it no longer is needed */ + switch ((ea >> 3) & 7) + { + case 0: /* Dn */ + case 1: /* An */ + { + char r = ((ea >> 3) & 7) ? 'a' : 'd'; + e("and edi, byte 7\n"); + if (size == LONG_SIZE) + e("mov [%c+edi*4], edx\n", r); + else if (size == BYTE_SIZE) + e("mov [%c+edi*4], dl\n", r); + else if (size == WORD_SIZE) + e("mov [%c+edi*4], dx\n", r); + } + break; + case 2: /* (An) */ + case 3: /* (An)+ */ + case 4: /* -(An) */ + case 5: /* (d16,An) */ + e("and edi, byte 7\n"); + if (((ea >> 3) & 7) == 4) /* pre-dec */ + { + if (size == BYTE_SIZE) + { + e("cmp edi, byte 7\n"); /* A7 bytes */ + e("cmc\n"); /* switch carry */ + e("sbb dword [a+edi*4], byte 1\n"); + } + else if (size == WORD_SIZE) + e("sub dword [a+edi*4], byte 2\n"); + else if (size == LONG_SIZE) + e("sub dword [a+edi*4], byte 4\n"); + } + if (((ea >> 3) & 7) == 5) /* (d16,An) */ + { + e("movsx ebx, word [esi]\n"); + e("add ebx, [a+edi*4]\n"); + e("add esi, byte 2\n"); /* past d16, next instruction */ + } + else + e("mov ebx, [a+edi*4]\n"); + if (((ea >> 3) & 7) == 3) /* post-inc */ + { + if (size == BYTE_SIZE) + { + e("cmp edi, byte 7\n"); /* A7 bytes */ + e("cmc\n"); /* switch carry */ + e("adc dword [a+edi*4], byte 1\n"); + } + else if (size == WORD_SIZE) + e("add dword [a+edi*4], byte 2\n"); + else if (size == LONG_SIZE) + e("add dword [a+edi*4], byte 4\n"); + } + switch (size) + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; } + break; + case 6: /* (d8,An,Xn) */ + e("and edi, byte 7\n"); /* An reg # */ + SaveReg("memhandler", "edi"); /* no memhandlers using this now... */ + e("xor ebx, ebx\n"); /* so the high part is clear */ + e("mov bx, [esi]\n"); /* fetch extension word */ + e("movsx edi, bl\n"); /* sign-extended index */ + e("add esi, byte 2\n"); /* point at next word */ + e("shr ebx, byte 12\n"); /* regs must be: d, a for this to work */ + /* the shr sets CF if Long reg */ + e("mov ebx, [d+ebx*4]\n"); + e("jc short .ll\n"); /* CF=1? index reg is LONG */ + e("movsx ebx, bx\n"); /* otherwise: sign-extended WORD */ + EmitLabel(".ll"); + e("add ebx, edi\n"); /* disp+index_reg */ + RestoreReg("memhandler", "edi"); + e("add ebx, [a+edi*4]\n"); + switch (size) /* WriteXXX() clears EDI */ + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; } + break; + case 0x7: + switch (ea & 7) + { + case 0: /* (xxx).W */ + case 1: /* (xxx).L */ + if ((ea & 7) == 0) /* word */ + { + e("movsx ebx, word [esi]\n"); + e("add esi, byte 2\n"); + } + else /* long */ + { + e("mov ebx, [esi]\n"); + e("ror ebx, byte 16\n"); /* word-swap */ + e("add esi, byte 4\n"); + } + switch (size) + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; } + break; + case 4: /* # */ + /* can't store to #data! */ + break; + case 2: /* (d16,PC) */ + /* + * The PC is assumed to be pointing at the extension word, which + * is exactly how the emulator works + */ + e("movsx ebx, word [esi]\n"); + e("add ebx, esi\n"); + e("sub ebx, ebp\n"); + e("add esi, byte 2\n"); + switch (size) + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; } + break; + case 3: /* (d8,PC,Xn) */ + e("xor ebx, ebx\n"); /* so the high part is clear */ + e("mov bx, [esi]\n"); /* fetch extension word */ + e("movsx edi, bl\n"); /* sign-extended index */ + e("shr ebx, byte 12\n"); /* regs must be: d, a for this to work */ + /* the shr sets CF if Long reg */ + e("mov ebx, [d+ebx*4]\n"); + e("jc short .ls\n"); /* CF=1? index reg is LONG */ + e("movsx ebx, bx\n"); /* otherwise: sign-extended WORD */ + EmitLabel(".ls"); + e("add ebx, edi\n"); /* disp+index_reg */ + e("add ebx, esi\n"); /* add the PC */ + e("sub ebx, ebp\n"); + e("add esi, byte 2\n"); /* point at next word */ + switch (size) /* WriteXXX() clears EDI */ + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; } + break; + } + break; + default: + printf("Error!\a\n"); + break; + } +} + + +/* + * Returns: Address in EBX + * Used: EBX, EDX + * Notes: ESI is assumed to point at word after opcode + * Assumes EDI contains opcode and that it has EA at the very end + * This function is only to be used when EA mode fields are located + * at bits 0-5. + */ + +void LoadControlEA(unsigned ea) +{ + switch ((ea >> 3) & 7) + { + case 2: /* (An) */ + case 3: /* (An)+ (just load what's in (An) -- MOVEM needs this) */ + case 4: /* -(An) (just load what's in (An) -- MOVEM needs this) */ + case 5: /* (d16,An) */ + e("and edi, byte 7\n"); /* reg */ + if (((ea >> 3) & 7) == 5) /* (d16,An) */ + { + e("movsx ebx, word [esi]\n"); + e("add ebx, [a+edi*4]\n"); + e("add esi, byte 2\n"); /* past d16, next instruction */ + } + else + e("mov ebx, [a+edi*4]\n"); + break; + case 6: /* (d8,An,Xn) */ + e("and edi, byte 7\n"); /* edi=An # */ + e("xor ebx, ebx\n"); /* so the high part is clear */ + e("mov bx, [esi]\n"); /* fetch extension word */ + e("movsx edx, bl\n"); /* sign-extended index */ + e("add esi, byte 2\n"); /* point at next word */ + e("shr ebx, byte 12\n"); /* regs must be: d, a for this to work */ + /* the shr sets CF if Long reg */ + e("mov ebx, [d+ebx*4]\n"); + e("jc short .ll\n"); /* CF=1? index reg is LONG */ + e("movsx ebx, bx\n"); /* otherwise: sign-extended WORD */ + EmitLabel(".ll"); + e("add ebx, edx\n"); /* disp+index_reg */ + e("add ebx, [a+edi*4]\n"); + break; + case 0x7: + switch (ea & 7) + { + case 0: /* (xxx).W */ + case 1: /* (xxx).L */ + if ((ea & 7) == 0) /* word */ + { + e("movsx ebx, word [esi]\n"); + e("add esi, byte 2\n"); + } + else /* long */ + { + e("mov ebx, [esi]\n"); + e("ror ebx, byte 16\n"); /* word-swap */ + e("add esi, byte 4\n"); + } + break; + case 2: /* (d16,PC) */ + /* + * The PC is assumed to be pointing at the extension word, which + * is exactly how the emulator works + */ + e("movsx ebx, word [esi]\n"); + e("add ebx, esi\n"); + e("sub ebx, ebp\n"); + e("add esi, byte 2\n"); + break; + case 3: /* (d8,PC,Xn) */ + e("xor ebx, ebx\n"); /* so the high part is clear */ + e("mov bx, [esi]\n"); /* fetch extension word */ + e("movsx edx, bl\n"); /* sign-extended index */ + e("shr ebx, byte 12\n"); /* regs must be: d, a for this to work */ + /* the shr sets CF if Long reg */ + e("mov ebx, [d+ebx*4]\n"); + e("jc short .ll\n"); /* CF=1? index reg is LONG */ + e("movsx ebx, bx\n"); /* otherwise: sign-extended WORD */ + EmitLabel(".ll"); + e("add ebx, edx\n"); /* disp+index_reg */ + e("add ebx, esi\n"); /* add the PC */ + e("sub ebx, ebp\n"); + e("add esi, byte 2\n"); /* point at next word */ + break; + } + break; + default: + printf("Warning: LoadControlEA() defaulted\n"); + break; + } +} + + +/***************************************************************************** +* Instruction Handlers */ + +int RTD(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + e("mov ebx, [a+7*4]\n"); + ReadLong(); + e("xor ebx, ebx\n"); + e("add dword [a+7*4], byte 4\n"); + e("mov bx, [esi]\n"); + e("add dword [a+7*4], ebx\n"); /* SP+4+disp */ + e("mov esi, edx\n"); + UpdateFetchPtr(); + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int MOVEC(unsigned short op, char *mnem, unsigned base_timing) +{ + /* + * Timing for an illegal control register is not handled, control is + * simply passed to the illegal instruction exception handler, which uses + * different timing. + */ + + InstBegin(op, mnem, 2); + e("test byte [sr+1], 0x20\n"); /* in supervisor? */ + e("jz near exception_privilege_violation\n"); + + e("xor ebx, ebx\n"); + e("xor edx, edx\n"); + e("mov dx, [esi]\n"); /* fetch data word */ + e("mov ebx, edx\n"); + e("shr ebx, byte 12\n"); /* EBX=general register */ + + e("shr edi, byte 1\n"); /* dr field */ + e("jc short .to_control\n"); + + /* + * Test for control register. The control register value is placed in + * EDX. At the end, EDX is moved to [d+ebx*4]. + */ + + e("and edx, 0xfff\n"); + e("jnz short .from_dfc\n"); + e("mov dl, [fc]\n"); /* SFC */ + e("jmp short .end_from\n"); + + EmitLabel(".from_dfc"); + e("cmp edx, byte 1\n"); + e("jne short .from_usp\n"); + e("mov dl, [fc+1]\n"); /* DFC */ + e("jmp short .end_from\n"); + + EmitLabel(".from_usp"); + e("cmp edx, 0x800\n"); + e("jne short .from_vbr\n"); + e("mov edx, [__sp]\n"); /* we're in supervisor, USP is in __sp */ + e("jmp short .end_from\n"); + + EmitLabel(".from_vbr"); + e("cmp edx, 0x801\n"); + e("jne near exception_illegal_instruction\n"); /* invalid control reg */ + e("mov edx, [vbr]\n"); /* VBR */ + + EmitLabel(".end_from"); + e("mov [d+ebx*4], edx\n"); /* move to general reg */ + e("add esi, byte 2\n"); /* remember, we fetched a word */ + EmitTiming(12); + e("jmp short .end\n"); + + /* + * Test for control register. General reg is written to control reg. + */ + + EmitLabel(".to_control"); + e("mov ebx, [d+ebx*4]\n"); /* general reg */ + + e("and edx, 0xfff\n"); + e("jnz short .to_dfc\n"); + e("and bl, 3\n"); + e("mov [fc], bl\n"); /* SFC */ + e("jmp short .end_to\n"); + + EmitLabel(".to_dfc"); + e("cmp edx, byte 1\n"); + e("jne short .to_usp\n"); + e("and bl, 3\n"); + e("mov [fc+1], bl\n"); /* DFC */ + e("jmp short .end_to\n"); + + EmitLabel(".to_usp"); + e("cmp edx, 0x800\n"); + e("jne short .to_vbr\n"); + e("mov [__sp], ebx\n"); /* we're in supervisor, USP is in __sp */ + e("jmp short .end_to\n"); + + EmitLabel(".to_vbr"); + e("cmp edx, 0x801\n"); + e("jne near exception_illegal_instruction\n"); /* invalid control reg */ + e("mov [vbr], ebx\n"); /* VBR */ + + EmitLabel(".end_to"); + e("add esi, byte 2\n"); /* remember, we fetched a word */ + EmitTiming(10); + + /* + * End + */ + + EmitLabel(".end"); + InstEnd(); + return 2; +} + +int BKPT(unsigned short op, char *mnem, unsigned base_timing) +{ + /* + * NOTE: Timing isn't done here, the exception processing code will do it. + * The exception code doesn't use the proper timing for a BKPT, but it's + * good enough ;) + */ + + InstBegin(op, mnem, 8); + e("and edi, byte 7\n"); /* vector # */ + e("mov ebx, [Bkpt]\n"); /* BKPT handler */ + e("test ebx, ebx\n"); /* if no handler, don't do anything */ + e("jz short .no_handler\n"); + + e("push eax\n"); + e("push edi\n"); + e("push ebp\n"); + WRITEPCTOMEM("pc"); /* saves esi */ + e("mov [remaining], ecx\n"); + e("push edi\n"); /* vector # */ + e("call ebx\n"); + e("add esp, byte 4\n"); + e("mov esi, [pc]\n"); + e("mov ecx, [remaining]\n"); /* this could have been changed */ + e("pop ebp\n"); + e("pop edi\n"); + e("pop eax\n"); + e("add esi, ebp\n"); /* base+pc=pc pointer */ + + EmitLabel(".no_handler"); + e("jmp near exception_illegal_instruction\n"); + return 8; +} + +int MOVEfromCCR(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned ea = op & 0x3f, t = 4; + + if (!CheckEA(ea, "101111111000")) return 0; + if (!NumDecodedEA(ea)) return 0; + + InstBegin(op, mnem, NumDecodedEA(ea)); + e("xor edx, edx\n"); /* CCR->(sign extend)->word */ + e("mov dl, [sr]\n"); + StoreToEA(ea, WORD_SIZE, 0); + if ((ea >> 3) != 0) t += 4; /* mem */ + EmitTiming(t + TimingEA(ea, WORD_SIZE)); /* technically, word sized */ + InstEnd(); + return 1; +} + +int TRAPV(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + + e("test al, al\n"); /* do only if V */ + e("jz near .no_trap\n"); + + e("mov edx, 0x2000\n"); /* what the SR will be */ + e("xor edx, [sr]\n"); /* see if S bit is different */ + e("test edx, 0x2000\n"); + e("jz .no_sp_magic\n"); /* nope, don't swap SPs */ + e("mov edx, [__sp]\n"); + e("xchg [a+7*4], edx\n"); + e("mov [__sp], edx\n"); + SetSupervisorAddressSpace(); + EmitLabel(".no_sp_magic"); + + e("mov ebx, [a+7*4]\n"); /* SP */ + + /* + * If 68010, push format info + */ + + if (mpu == 68010) + { + e("sub ebx, byte 2\n");/* SP-2 */ + e("mov edx, 7*4\n"); /* TRAPV vector | 0x00000000 */ + e("push ebx\n"); + WriteWord(); + e("pop ebx\n"); + } + + e("mov edx, esi\n"); + e("sub edx, ebp\n"); /* PC->EDX */ + e("sub ebx, byte 4\n"); /* SP-4 */ + e("push ebx\n"); + WriteLong(); + e("pop ebx\n"); + e("mov edx, [sr]\n"); /* get SR */ + e("sub ebx, byte 2\n"); /* SP-2 */ + e("push ebx\n"); + WriteWord(); /* save SR to stack */ + e("pop ebx\n"); + e("or dh, 0x20\n"); /* set supervisor for exception */ + e("and edx, 0xa71f\n"); /* clear unwanted bits */ + e("xchg [sr], edx\n"); /* set new SR, get old SR->EDX */ + e("mov [a+7*4], ebx\n"); /* write back SP */ + e("mov ebx, 7*4\n"); /* TRAPV vector */ + if (mpu == 68010) + e("add ebx, [vbr]\n"); + ReadLong(); /* get PC */ + e("mov esi, edx\n"); /* set new PC */ + UpdateFetchPtr(); + EmitTiming(34+4); /* TRAPV=4, exception=34 */ + InstEnd(); + EmitLabel(".no_trap"); + e("xor edi, edi\n"); + EmitTiming(4); + InstEnd(); + + return 1; +} + +int STOP(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + e("test byte [sr+1], 0x20\n"); /* in supervisor? */ + e("jz near exception_privilege_violation\n"); + e("mov edx, [esi]\n"); + e("add esi, byte 2\n"); + e("and edx, 0xa71f\n"); /* mask out unimplemented bits */ + e("mov [sr], dx\n"); + LoadCCR(); + STOP_CPU(); + EmitTiming(base_timing); + e("mov dword [remaining], 0\n"); /* stop executing */ + e("jmp near Turbo68KRun_done\n"); + return 1; +} + +int RESET(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + e("test byte [sr+1], 0x20\n"); /* in supervisor? */ + e("jz near exception_privilege_violation\n"); + + e("mov ebx, [Reset]\n"); /* Reset handler */ + e("test ebx, ebx\n"); /* if no handler, don't do anything */ + e("jz short .no_reset\n"); + + e("push eax\n"); + e("push ebp\n"); + WRITEPCTOMEM("pc"); /* saves esi */ + e("mov [remaining], ecx\n"); + e("call ebx\n"); + e("mov esi, [pc]\n"); + e("mov ecx, [remaining]\n"); /* this could have been changed */ + e("pop ebp\n"); + e("pop eax\n"); + e("add esi, ebp\n"); /* base+pc=pc pointer */ + e("xor edi, edi\n"); /* keep clear for fetch */ + + EmitLabel(".no_reset"); + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int TAS(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned ea = op & 0x3f; + + if (!CheckEA(ea, "101111111000")) return 0; + if (!NumDecodedEA(ea)) return 0; + + InstBegin(op, mnem, NumDecodedEA(ea)); + LoadFromEA(ea, BYTE_SIZE, 0); + e("test dl, dl\n"); /* test... */ + e("lahf\n"); + e("xor al, al\n"); + e("or dl, 0x80\n"); /* ...and set bit 7 */ + if ((ea >> 3) == 0) + { + e("mov [d+edi*4], dl\n"); + EmitTiming(4); + } + else + { + +/* + * NOTE: + * ----- + * + * You may wish to uncomment the WriteByte() below when emulating the Sega + * Genesis if you wish to get Gargoyles running. The TAS instruction is used + * to synchronize multiple 68Ks by grabbing the bus, but on the Genesis, the + * VDP will not release the bus resulting in data not being written. + */ + + WriteByte(); + EmitTiming(14 + TimingEA(ea, BYTE_SIZE)); + } + InstEnd(); + return 1; +} + +int NBCD(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned ea = op & 0x3f, t; + + /* + * Notes About Undefined Flags: + * ---------------------------- + * + * N flag = Set the same as the MSB of the result + * V flag = If MSB changes from 1 to 0 when result is adjusted for BCD, + * the V flag is set, otherwise it is cleared. + */ + + if (!CheckEA(ea, "101111111000")) return 0; + if (!NumDecodedEA(ea)) return 0; + + InstBegin(op, mnem, NumDecodedEA(ea)); + if ((ea >> 3) == 0) /* Dn */ + { + e("and edi, byte 7\n"); + + e("xor al, al\n"); /* we use AL so we can use DAS */ + + e("shr byte [x], 1\n"); /* X->CF */ + e("sbb al, [d+edi*4]\n"); + e("mov bh, al\n"); /* save unadjusted result in BH */ + e("das\n"); /* BCD! */ + e("mov bl, ah\n"); /* store old flags */ + e("lahf\n"); + e("setc byte [x]\n"); + e("jnz short .clr\n"); /* Z clear */ + e("and bl, byte 0x40\n"); /* isolate old Z */ + e("and ah, byte 0x3f\n"); /* kill new Z */ + e("or ah, bl\n"); /* in w/ old Z */ + EmitLabel(".clr"); + e("test al, al\n"); /* N flag */ + e("sets dh\n"); + e("ror dh, 1\n"); /* into MSB of DH */ + e("or ah, dh\n"); /* -> N flag */ + e("mov [d+edi*4], al\n"); + + /* + * V flag calculation: Put unadjusted result's MSB into bit 1, and the + * adjusted result's MSB into bit 0. If the result is 2, the V flag + * is set. + */ + + e("shr bh, byte 6\n"); + e("shr al, byte 7\n"); + e("and bh, 2\n"); + e("or bh, al\n"); + e("xor al, al\n"); + e("cmp bh, 2\n"); + e("jne short .no_v\n"); + e("mov al, 1\n"); /* move 1 into V flag */ + EmitLabel(".no_v"); + + t = 6; + } + else /* memory */ + { + LoadFromEA(ea, BYTE_SIZE, 0); + + e("xor al, al\n"); + e("shr byte [x], 1\n"); /* X->CF */ + e("sbb al, dl\n"); + e("mov dh, al\n"); /* DH now has unadjusted result */ + e("mov dl, ah\n"); + e("das\n"); /* BCD! */ + e("lahf\n"); + e("setc byte [x]\n"); + e("jnz short .clr\n"); + e("and dl, byte 0x40\n"); + e("and ah, byte 0x3f\n"); + e("or ah, dl\n"); + EmitLabel(".clr"); + + e("test al, al\n"); /* N flag */ + e("sets dl\n"); + e("ror dl, 1\n"); /* into MSB of DL */ + e("or ah, dl\n"); /* -> N flag */ + + e("mov dl, al\n"); /* move result into DL to write it */ + + /* + * V flag calculation: Put unadjusted result's MSB into bit 1, and the + * adjusted result's MSB into bit 0. If the result is 2, the V flag + * is set. + */ + + e("shr dh, byte 6\n"); + e("shr al, byte 7\n"); + e("and dh, 2\n"); + e("or dh, al\n"); + e("xor al, al\n"); + e("cmp dh, 2\n"); + e("jne short .no_v\n"); + e("mov al, 1\n"); /* move 1 into V flag */ + EmitLabel(".no_v"); + + /* WriteXXX will clear EDI for us */ + WriteByte(); + t = 8 + TimingEA(ea, BYTE_SIZE); + } + EmitTiming(t); + InstEnd(); + return 1; +} + +int CHK(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned reg = (op >> 9) & 7, size, ea = op & 0x3f; + + /* + * Notes About Undefined Flags: + * ---------------------------- + * + * Z flag = Set if register operand is 0 (second operand), cleared + * otherwise + * V flag = Always cleared (?) + * C flag = Always cleared (?) + */ + + if (!CheckEA(ea, "101111111111")) return 0; + if (!NumDecodedEA(ea)) return 0; + switch ((op >> 7) & 3) + { + case 3: size = WORD_SIZE; break; + default: return 0; + } + + InstBegin(op, mnem, NumDecodedEA(ea)); + /* + * We have to emit the EA timing first because it must be accounted for + * whether or not a trap occurs. DIVU and DIVS work like this too. + */ + if (TimingEA(ea, size)) + e("sub ecx, byte %d\n", TimingEA(ea, size)); + LoadFromEA(ea, size, 0); + e("xor al, al\n"); /* V should be cleared */ + e("test word [d+%d*4], 0xffff\n", reg); /* If Dn == 0 Then Z=1 */ + e("setz ah\n"); /* this also clears N and C */ + e("shl ah, 6\n"); /* put Z in proper position */ + e("test byte [d+%d*4+1], 0x80\n", reg); /* If Dn < 0 Then TRAP */ + e("jnz near .trap_dn\n"); + e("cmp [d+%d*4], dx\n", reg); /* If Dn > Source Then TRAP */ + e("jg near .trap_ea\n"); + EmitTiming(base_timing); + InstEnd(); + EmitLabel(".trap_dn"); /* set N to 1 because Dn<0 test failed */ + e("or ah, 0x80\n"); + e("jmp short .trap\n"); + EmitLabel(".trap_ea"); /* clear N because Dn>Source test failed */ + e("and ah, 0x7f\n"); + EmitLabel(".trap"); + e("jmp near exception_chk\n"); + + return 1; +} + +int MOVEP(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned dx = (op >> 9) & 7, opmode = (op >> 6) & 7, t; + + if (opmode != 4 && opmode != 5 && opmode != 6 && opmode != 7) return 0; + + InstBegin(op, mnem, 8); + e("and edi, byte 7\n"); + e("movsx ebx, word [esi]\n"); /* (d16,An) */ + e("add ebx, [a+edi*4]\n"); + e("add esi, byte 2\n"); + switch (opmode & 2) + { + case 2: /* reg->mem */ + if (opmode & 1) /* long */ + { + t = 24; + e("push eax\n"); /* we will be using EAX to save EBX */ + e("mov edx, [d+%d*4]\n", dx); + e("mov eax, ebx\n"); /* save EBX */ + e("rol edx, byte 8\n");/* write high order */ + WriteByte(); + e("add eax, byte 2\n"); + e("rol edx, byte 8\n");/* write mid-upper */ + e("mov ebx, eax\n"); + WriteByte(); + e("add eax, byte 2\n"); + e("rol edx, byte 8\n");/* write mid-lower */ + e("mov ebx, eax\n"); + WriteByte(); + e("add eax, byte 2\n"); + e("rol edx, byte 8\n");/* write lower order */ + e("mov ebx, eax\n"); + WriteByte(); + e("pop eax\n"); + } + else /* word */ + { + t = 16; + e("push eax\n"); /* we will be using EAX to save EBX */ + e("mov dx, [d+%d*4]\n", dx); + e("mov eax, ebx\n"); /* save EBX */ + e("ror edx, byte 8\n");/* write high order */ + WriteByte(); + e("add eax, byte 2\n"); + e("rol edx, byte 8\n");/* write low order */ + e("mov ebx, eax\n"); + WriteByte(); + e("pop eax\n"); + } + break; + case 0: /* mem->reg */ + if (opmode & 1) /* long */ + { + t = 24; + ReadByte(); /* read high order */ + e("mov [d+%d*4+3], dl\n", dx); /* store high order in Dn */ + e("add ebx, byte 2\n"); + ReadByte(); /* mid-upper order */ + e("mov [d+%d*4+2], dl\n", dx); /* store mid-upper order */ + e("add ebx, byte 2\n"); + ReadByte(); /* mid-lower order */ + e("mov [d+%d*4+1], dl\n", dx); /* store mid-lower order */ + e("add ebx, byte 2\n"); + ReadByte(); /* low order */ + e("mov [d+%d*4+0], dl\n", dx); /* store low order */ + } + else /* word */ + { + t = 16; + ReadByte(); /* read high order */ + e("mov [d+%d*4+1], dl\n", dx); /* store high order in Dn */ + e("add ebx, byte 2\n"); + ReadByte(); /* read low order */ + e("mov [d+%d*4+0], dl\n", dx); /* store low order */ + } + break; + } + EmitTiming(t); + InstEnd(); + return 1; +} + +int CMPM(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned size, ax = (op >> 9) & 7; + + switch ((op >> 6) & 3) + { + case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; + } + + InstBegin(op, mnem, 8); + e("and edi, byte 7\n"); + + e("mov ebx, [a+edi*4]\n"); /* get Ay */ + if (size == BYTE_SIZE) /* Ay */ + { + e("cmp edi, byte 7\n"); /* A7 bytes */ + e("cmc\n"); /* switch carry */ + e("adc dword [a+edi*4], byte 1\n"); + } + else if (size == WORD_SIZE) + e("add dword [a+edi*4], byte 2\n"); + else if (size == LONG_SIZE) + e("add dword [a+edi*4], byte 4\n"); + + switch (size) + { case BYTE_SIZE: ReadByte(); break; + case WORD_SIZE: ReadWord(); break; + case LONG_SIZE: ReadLong(); break; } + SaveReg("run", "edx"); /* save Ay */ + + e("mov ebx, [a+%d*4]\n", ax);/* get Ax */ + if (size == BYTE_SIZE) /* Ax */ + { + if (ax == 7) + e("add dword [a+7*4], byte 2\n"); + else + e("inc dword [a+%d*4]\n", ax); + } + else if (size == WORD_SIZE) + e("add dword [a+%d*4], byte 2\n", ax); + else /* LONG */ + e("add dword [a+%d*4], byte 4\n", ax); + + switch (size) + { case BYTE_SIZE: ReadByte(); break; + case WORD_SIZE: ReadWord(); break; + case LONG_SIZE: ReadLong(); break; } + switch (size) /* compare */ + { + case BYTE_SIZE: + RestoreRegTo("run", "edx", "bl"); /* [run_edx]->bl */ + e("cmp dl, bl\n"); + break; + case WORD_SIZE: + RestoreRegTo("run", "edx", "ebx"); /* [run_edx]->ebx */ + e("cmp dx, bx\n"); + break; + case LONG_SIZE: + RestoreRegTo("run", "edx", "ebx"); /* [run_edx]->ebx */ + e("cmp edx, ebx\n"); + break; + } + e("lahf\n"); + e("seto al\n"); + + if (size != LONG_SIZE) /* byte, word */ + EmitTiming(12); + else /* long */ + EmitTiming(20); + InstEnd(); + return 1; +} + +int TRAP(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 16); + + e("and edi, byte 0xf\n"); /* lower 4 bits=vector */ + SaveReg("run", "edi"); + + e("mov edx, 0x2000\n"); /* what the SR will be */ + e("xor edx, [sr]\n"); /* see if S bit is different */ + e("test edx, 0x2000\n"); + e("jz .no_sp_magic\n"); /* nope, don't swap SPs */ + e("mov edx, [__sp]\n"); + e("xchg [a+7*4], edx\n"); + e("mov [__sp], edx\n"); + SetSupervisorAddressSpace(); + EmitLabel(".no_sp_magic"); + + e("mov ebx, [a+7*4]\n"); /* SP */ + + /* + * If 68010, push format info + */ + + if (mpu == 68010) + { + e("sub ebx, byte 2\n");/* SP-2 */ + RestoreReg("run", "edi"); /* vector */ + e("mov edx, edi\n"); + SaveReg("run", "edi"); + e("add edx, byte 32\n"); + e("shl edx, byte 2\n"); /* TRAP vector | 0x00000000 */ + SaveReg("run", "ebx"); + WriteWord(); + RestoreReg("run", "ebx"); + } + + e("mov edx, esi\n"); + e("sub edx, ebp\n"); /* PC->EDX */ + e("sub ebx, byte 4\n"); /* SP-4 */ + e("push ebx\n"); + WriteLong(); + e("pop ebx\n"); + e("mov edx, [sr]\n"); /* get SR */ + e("sub ebx, byte 2\n"); /* SP-2 */ + e("push ebx\n"); + SaveReg("run", "ebx"); + WriteWord(); /* save SR to stack */ + e("pop ebx\n"); + e("or dh, 0x20\n"); /* set supervisor for exception */ + e("and edx, 0xa71f\n"); /* clear unwanted bits */ + e("xchg [sr], edx\n"); /* set new SR, get old SR->EDX */ + e("mov [a+7*4], ebx\n"); /* write back SP */ + RestoreReg("run", "edi"); + e("mov ebx, edi\n"); + e("add ebx, byte 32\n"); /* vector+32=trap vector */ + e("shl ebx, 2\n"); + if (mpu == 68010) + e("add ebx, [vbr]\n"); + + ReadLong(); /* get PC */ + e("mov esi, edx\n"); /* set new PC */ + UpdateFetchPtr(); + e("xor edi, edi\n"); + EmitTiming(base_timing); + InstEnd(); + + return 1; +} + +int EORItoSR(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + e("test byte [sr+1], 0x20\n"); /* in supervisor? */ + e("jz near exception_privilege_violation\n"); + SaveCCR(); /* save flags to SR */ + e("mov edx, [esi]\n"); + e("and edx, 0xa71f\n"); /* mask out unwanted bits */ + e("xor [sr], dx\n"); + e("add esi, byte 2\n"); + LoadCCR(); /* get flags back */ + e("test byte [sr+1], 0x20\n"); /* if we changed to User, swap SPs */ + e("jnz short .in_s\n"); + e("mov ebx, [a+7*4]\n"); + e("mov edx, [__sp]\n"); + e("mov [a+7*4], edx\n"); + e("mov [__sp], ebx\n"); + SetUserAddressSpace(); /* map in user address space */ + EmitLabel(".in_s"); + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int EORItoCCR(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + SaveCCR(); + e("mov dl, [esi]\n"); + e("and dl, 0x1f\n"); + e("xor [sr], dl\n"); + LoadCCR(); + e("add esi, byte 2\n"); + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int RTR(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + e("mov ebx, [a+7*4]\n"); /* (SP)->CCR */ + ReadWord(); + e("and dl, 0x1f\n"); + e("mov [sr], dl\n"); + e("add dword [a+7*4], byte 2\n"); /* SP+2->SP */ + LoadCCR(); + e("mov ebx, [a+7*4]\n"); /* (SP)->PC */ + ReadLong(); + e("add dword [a+7*4], byte 4\n"); /* SP+4->SP */ + e("mov esi, edx\n"); + UpdateFetchPtr(); + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int SUBX(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned rx = (op >> 9) & 7, rm = (op >> 3) & 1, size; + + switch ((op >> 6) & 3) + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + + InstBegin(op, mnem, 8); + + e("and edi, byte 7\n"); + if (!rm) /* Dy,Dx */ + { + if (size == BYTE_SIZE) /* EBX,BX,BL=destination */ + e("mov bl, [d+%d*4]\n", rx); + else + e("mov ebx, [d+%d*4]\n", rx); + if (size == BYTE_SIZE) /* EDX,DX,DL=source */ + e("mov dl, [d+edi*4]\n"); + else + e("mov edx, [d+edi*4]\n"); + e("shr byte [x], 1\n"); /* X->CF */ + switch (size) + { case BYTE_SIZE: e("sbb bl, dl\n"); break; + case WORD_SIZE: e("sbb bx, dx\n"); break; + case LONG_SIZE: e("sbb ebx, edx\n"); break; + } + e("mov dl, ah\n"); /* keep temporary copy of old flags in DL */ + e("lahf\n"); + e("setc byte [x]\n"); + e("seto al\n"); + e("jnz short .z\n"); /* if non-zero, cleared */ + e("and dl, 0x40\n"); /* otherwise, unchanged */ + e("and ah, 0xbf\n"); /* (get rid of new unwanted Z) */ + e("or ah, dl\n"); /* OR in the old, unchanged Z flag */ + EmitLabel(".z"); + + switch (size) /* store results */ + { case BYTE_SIZE: e("mov [d+%d*4], bl\n", rx); break; + case WORD_SIZE: e("mov [d+%d*4], bx\n", rx); break; + case LONG_SIZE: e("mov [d+%d*4], ebx\n", rx); break; + } + } + else /* -(Ay),-(Ax) */ + { + if (size == BYTE_SIZE) + { + e("cmp edi, byte 7\n"); /* decrement Ay register (-2 for A7) */ + e("cmc\n"); + e("sbb dword [a+edi*4], byte 1\n"); + if (rx != 7) + e("dec dword [a+%d*4]\n", rx); + else + e("sub dword [a+7*4], byte 2\n"); + } + else if (size == WORD_SIZE) + { + e("sub dword [a+edi*4], byte 2\n"); + e("sub dword [a+%d*4], byte 2\n", rx); + } + else if (size == LONG_SIZE) + { + e("sub dword [a+edi*4], byte 4\n"); + e("sub dword [a+%d*4], byte 4\n", rx); + } + + e("mov ebx, [a+edi*4]\n"); /* first, load up -(Ay) */ + switch (size) + { case BYTE_SIZE: ReadByte(); break; + case WORD_SIZE: ReadWord(); break; + case LONG_SIZE: ReadLong(); break; + } + SaveReg("run", "edx"); /* save data obtained */ + e("mov ebx, [a+%d*4]\n", rx);/* next, load up -(Ax) */ + switch (size) + { case BYTE_SIZE: ReadByte(); break; + case WORD_SIZE: ReadWord(); break; + case LONG_SIZE: ReadLong(); break; + } + SaveReg("run", "ebx"); + e("mov ebx, edx\n"); /* EBX,BX,BL=destination */ + RestoreReg("run", "edx"); /* EDX,DX,DL=source */ + + e("shr byte [x], 1\n"); /* X->CF */ + switch (size) + { case BYTE_SIZE: e("sbb bl, dl\n"); break; + case WORD_SIZE: e("sbb bx, dx\n"); break; + case LONG_SIZE: e("sbb ebx, edx\n"); break; + } + e("mov dl, ah\n"); /* keep temporary copy of old flags in DL */ + e("lahf\n"); + e("setc byte [x]\n"); + e("seto al\n"); + e("jnz short .z\n"); /* if non-zero, cleared */ + e("and dl, 0x40\n"); /* otherwise, unchanged */ + e("and ah, 0xbf\n"); /* (get rid of new unwanted Z) */ + e("or ah, dl\n"); /* OR in the old, unchanged Z flag */ + EmitLabel(".z"); + + e("mov edx, ebx\n"); /* store result */ + RestoreReg("run", "ebx"); + switch (size) + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; + } + } + + if (!rm) + { + if (size == LONG_SIZE) + EmitTiming(8); + else + EmitTiming(4); + } + else + { + if (size == LONG_SIZE) + EmitTiming(30); + else + EmitTiming(18); + } + + InstEnd(); + return 1; +} + +int ADDX(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned rx = (op >> 9) & 7, rm = (op >> 3) & 1, size; + + switch ((op >> 6) & 3) + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + + InstBegin(op, mnem, 8); + e("and edi, byte 7\n"); + if (!rm) /* Dy,Dx */ + { + if (size == BYTE_SIZE) /* EBX,BX,BL=destination */ + e("mov bl, [d+%d*4]\n", rx); + else + e("mov ebx, [d+%d*4]\n", rx); + if (size == BYTE_SIZE) /* EDX,DX,DL=source */ + e("mov dl, [d+edi*4]\n"); + else + e("mov edx, [d+edi*4]\n"); + e("shr byte [x], 1\n"); /* X->CF */ + switch (size) + { case BYTE_SIZE: e("adc bl, dl\n"); break; + case WORD_SIZE: e("adc bx, dx\n"); break; + case LONG_SIZE: e("adc ebx, edx\n"); break; + } + e("mov dl, ah\n"); /* keep temporary copy of old flags in DL */ + e("lahf\n"); + e("setc byte [x]\n"); + e("seto al\n"); + e("jnz short .z\n"); /* if non-zero, cleared */ + e("and dl, 0x40\n"); /* otherwise, unchanged */ + e("and ah, 0xbf\n"); /* (get rid of new unwanted Z) */ + e("or ah, dl\n"); /* OR in the old, unchanged Z flag */ + EmitLabel(".z"); + + switch (size) /* store results */ + { case BYTE_SIZE: e("mov [d+%d*4], bl\n", rx); break; + case WORD_SIZE: e("mov [d+%d*4], bx\n", rx); break; + case LONG_SIZE: e("mov [d+%d*4], ebx\n", rx); break; + } + } + else /* -(Ay),-(Ax) */ + { + if (size == BYTE_SIZE) + { + e("cmp edi, byte 7\n"); /* decrement Ay register (-2 for A7) */ + e("cmc\n"); + e("sbb dword [a+edi*4], byte 1\n"); + if (rx != 7) + e("dec dword [a+%d*4]\n", rx); + else + e("sub dword [a+7*4], byte 2\n"); + } + else if (size == WORD_SIZE) + { + e("sub dword [a+edi*4], byte 2\n"); + e("sub dword [a+%d*4], byte 2\n", rx); + } + else if (size == LONG_SIZE) + { + e("sub dword [a+edi*4], byte 4\n"); + e("sub dword [a+%d*4], byte 4\n", rx); + } + + e("mov ebx, [a+edi*4]\n"); /* first, load up -(Ay) */ + switch (size) + { case BYTE_SIZE: ReadByte(); break; + case WORD_SIZE: ReadWord(); break; + case LONG_SIZE: ReadLong(); break; + } + SaveReg("run", "edx"); /* save data obtained */ + e("mov ebx, [a+%d*4]\n", rx);/* next, load up -(Ax) */ + switch (size) + { case BYTE_SIZE: ReadByte(); break; + case WORD_SIZE: ReadWord(); break; + case LONG_SIZE: ReadLong(); break; + } + SaveReg("run", "ebx"); + e("mov ebx, edx\n"); /* EBX,BX,BL=destination */ + RestoreReg("run", "edx"); /* EDX,DX,DL=source */ + + e("shr byte [x], 1\n"); /* X->CF */ + switch (size) + { case BYTE_SIZE: e("adc bl, dl\n"); break; + case WORD_SIZE: e("adc bx, dx\n"); break; + case LONG_SIZE: e("adc ebx, edx\n"); break; + } + e("mov dl, ah\n"); /* keep temporary copy of old flags in DL */ + e("lahf\n"); + e("setc byte [x]\n"); + e("seto al\n"); + e("jnz short .z\n"); /* if non-zero, cleared */ + e("and dl, 0x40\n"); /* otherwise, unchanged */ + e("and ah, 0xbf\n"); /* (get rid of new unwanted Z) */ + e("or ah, dl\n"); /* OR in the old, unchanged Z flag */ + EmitLabel(".z"); + + e("mov edx, ebx\n"); /* store result */ + RestoreReg("run", "ebx"); + switch (size) + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; + } + } + + if (!rm) + { + if (size == LONG_SIZE) + EmitTiming(8); + else + EmitTiming(4); + } + else + { + if (size == LONG_SIZE) + EmitTiming(30); + else + EmitTiming(18); + } + + InstEnd(); + return 1; +} + +int SBCD(unsigned short op, char *mnem, unsigned base_timing) +{ + /* + * Notes About Undefined Flags: + * ---------------------------- + * + * N flag = Set the same as the MSB of the result + * V flag = If MSB changes from 1 to 0 when result is adjusted for BCD, + * the V flag is set, otherwise it is cleared. + */ + + unsigned rx = (op >> 9) & 7, rm = (op >> 3) & 1; + + InstBegin(op, mnem, 8); + + e("and edi, byte 7\n"); + if (!rm) /* Dy,Dx */ + { + e("mov al, [d+%d*4]\n", rx); /* AL=destination */ + e("mov bl, [d+edi*4]\n"); /* BL=source */ + e("shr byte [x], 1\n"); /* X->CF */ + e("sbb al, bl\n"); /* subtract */ + e("mov bh, al\n"); /* save the unadjusted result in BH */ + e("das\n"); /* adjust the packed BCD result */ + e("setc dl\n"); + e("setc byte [x]\n"); + e("jz short .unchanged_z\n"); + e("and ah, 0xbf\n"); /* cleared if nonzero, otherwise unchanged */ + EmitLabel(".unchanged_z"); + e("and ah, 0x7e\n"); + e("or ah, dl\n"); /* set C */ + e("test al, al\n"); /* N flag */ + e("sets dl\n"); + e("ror dl, 1\n"); /* N flag -> MSB of DL */ + e("or ah, dl\n"); /* into N flag */ + e("mov [d+%d*4], al\n", rx); /* store result */ + + /* + * V flag calculation: Put unadjusted result's MSB into bit 1, and the + * adjusted result's MSB into bit 0. If the result is 2, the V flag + * is set. + */ + + e("shr bh, byte 6\n"); + e("shr al, byte 7\n"); + e("and bh, 2\n"); + e("or bh, al\n"); + e("cmp bh, 2\n"); + e("sete al\n"); /* 1 -> V */ + } + else /* -(Ay),-(Ax) */ + { + e("cmp edi, byte 7\n"); /* decrement Ay register (-2 for A7) */ + e("cmc\n"); + e("sbb dword [a+edi*4], byte 1\n"); + if (rx != 7) + e("dec dword [a+%d*4]\n", rx); + else + e("sub dword [a+7*4], byte 2\n"); + + e("mov ebx, [a+edi*4]\n"); /* first, load up -(Ay) */ + ReadByte(); + SaveReg("run", "dl"); /* save byte obtained */ + e("mov ebx, [a+%d*4]\n", rx);/* next, load up -(Ax) */ + ReadByte(); + e("mov al, dl\n"); /* AL=destination */ + RestoreReg("run", "dl"); /* DL=source */ + + e("shr byte [x], 1\n"); /* X->CF */ + e("sbb al, dl\n"); /* subtract */ + e("mov dh, al\n"); /* save unadjusted result in DH */ + e("das\n"); /* adjust the packed BCD result */ + + e("setc dl\n"); + e("setc byte [x]\n"); + e("jz short .unchanged_z\n"); + e("and ah, 0xbf\n"); /* cleared if nonzero, otherwise unchanged */ + EmitLabel(".unchanged_z"); + e("and ah, 0x7e\n"); + e("or ah, dl\n"); /* set C */ + e("test al, al\n"); /* N flag */ + e("sets dl\n"); + e("ror dl, 1\n"); /* N flag -> MSB of DL */ + e("or ah, dl\n"); /* into N flag */ + + e("mov dl, al\n"); /* prepare to write result */ + + /* + * V flag calculation: Put unadjusted result's MSB into bit 1, and the + * adjusted result's MSB into bit 0. If the result is 2, the V flag + * is set. + */ + + e("shr dh, byte 6\n"); + e("shr al, byte 7\n"); + e("and dh, 2\n"); + e("or dh, al\n"); + e("cmp dh, 2\n"); + e("sete al\n"); /* 1->V */ + + WriteByte(); + } + + if (!rm) + EmitTiming(6); + else + EmitTiming(18); + + InstEnd(); + return 1; +} + +int ABCD(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned rx = (op >> 9) & 7, rm = (op >> 3) & 1; + + /* + * Notes About Undefined Flags: + * ---------------------------- + * + * N flag = Set the same as the MSB of the result + * V flag = If MSB changes from 0 to 1 when result is adjusted for BCD, + * the V flag is set, otherwise it is cleared. + */ + + InstBegin(op, mnem, 8); + e("and edi, byte 7\n"); + if (!rm) /* Dy,Dx */ + { + e("mov al, [d+%d*4]\n", rx); /* AL=destination */ + e("mov bl, [d+edi*4]\n"); /* BL=source */ + e("shr byte [x], 1\n"); /* X->CF */ + e("adc al, bl\n"); /* add with extend */ + e("mov bh, al\n"); /* save unadjusted result in BH */ + e("daa\n"); /* adjust the packed BCD result */ + e("setc dl\n"); + e("setc byte [x]\n"); + e("jz short .unchanged_z\n"); + e("and ah, 0xbf\n"); /* cleared if nonzero, otherwise unchanged */ + EmitLabel(".unchanged_z"); + e("and ah, 0x7e\n"); + e("or ah, dl\n"); /* set C */ + e("test al, al\n"); /* N flag */ + e("sets dl\n"); + e("ror dl, 1\n"); /* N flag -> MSB of DL */ + e("or ah, dl\n"); /* into N flag */ + + e("mov [d+%d*4], al\n", rx); /* store result */ + + /* + * V flag calculation: Put unadjusted result's MSB into bit 1, and the + * adjusted result's MSB into bit 0. If the result is 01, the V flag + * is set. + */ + + e("shr bh, byte 6\n"); + e("shr al, byte 7\n"); + e("and bh, 2\n"); + e("or bh, al\n"); + e("cmp bh, 1\n"); + e("sete al\n"); /* move 1 into V flag */ + + } + else /* -(Ay),-(Ax) */ + { + e("cmp edi, byte 7\n"); /* decrement Ay register (-2 for A7) */ + e("cmc\n"); + e("sbb dword [a+edi*4], byte 1\n"); + if (rx != 7) + e("dec dword [a+%d*4]\n", rx); + else + e("sub dword [a+7*4], byte 2\n"); + + e("mov ebx, [a+edi*4]\n"); /* first, load up -(Ay) */ + ReadByte(); + SaveReg("run", "dl"); /* save byte obtained */ + e("mov ebx, [a+%d*4]\n", rx);/* next, load up -(Ax) */ + ReadByte(); + e("mov al, dl\n"); /* AL=destination */ + RestoreReg("run", "dl"); /* DL=source */ + + e("shr byte [x], 1\n"); /* X->CF */ + e("adc al, dl\n"); /* add */ + e("mov dh, al\n"); /* save unadjusted result in DH */ + e("daa\n"); /* adjust the packed BCD result */ + + e("setc dl\n"); + e("setc byte [x]\n"); + e("jz short .unchanged_z\n"); + e("and ah, 0xbf\n"); /* cleared if nonzero, otherwise unchanged */ + EmitLabel(".unchanged_z"); + e("and ah, 0x7e\n"); + e("or ah, dl\n"); /* set C */ + e("test al, al\n"); /* N flag */ + e("sets dl\n"); + e("ror dl, 1\n"); /* N flag -> MSB of DL */ + e("or ah, dl\n"); /* into N flag */ + + e("mov dl, al\n"); /* store result */ + + /* + * V flag calculation: Put unadjusted result's MSB into bit 1, and the + * adjusted result's MSB into bit 0. If the result is 1, the V flag + * is set. + */ + + e("shr dh, byte 6\n"); + e("shr al, byte 7\n"); + e("and dh, 2\n"); + e("or dh, al\n"); + e("cmp dh, 1\n"); + e("sete al\n"); /* 1 -> V */ + + WriteByte(); + } + + if (!rm) + EmitTiming(6); + else + EmitTiming(18); + + InstEnd(); + return 1; +} + +int ORItoCCR(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + SaveCCR(); + e("mov dl, [esi]\n"); /* get data */ + e("and dl, 0x1f\n"); /* mask out unwanted bits */ + e("or [sr], dl\n"); + e("add esi, byte 2\n"); + LoadCCR(); + EmitTiming(base_timing); + InstEnd(); + e("db 66, 65, 82, 84, 33, 1\n"); + return 1; +} + +int Scc(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned ea = op & 0x3f, cond = (op >> 8) & 0xf; + char mnem[4]; + char *mnem_t[] = { "ST", "SF", "SHI", "SLS", + "SCC", "SCS", "SNE", "SEQ", + "SVC", "SVS", "SPL", "SMI", + "SGE", "SLT", "SGT", "SLE" }; + + if (!CheckEA(ea, "101111111000")) return 0; + if (!NumDecodedEA(ea)) return 0; + + strcpy(mnem, mnem_t[cond]); + + InstBegin(op, mnem, NumDecodedEA(ea)); + switch (cond) + { + /* EAX:0000000000000000 NZ00 000C 0000 000V */ + case 0: /* T: Always true */ + if ((ea >> 3) == 0) /* Dn */ + { + e("and edi, byte 7\n"); + e("mov byte [d+edi*4], 0xff\n"); + EmitTiming(6); /* reg: byte, true */ + } + else + { + if (mpu == 68000 && dummyread && (ea >> 3)) + { + /* + * If the processor type is 68000, and the EA mode is not + * register, we can emulate dummy reads! + */ + + LoadFromEA(ea, BYTE_SIZE, 0); + e("mov dl, 0xff\n"); + WriteByte(); + } + else + { + e("mov dl, 0xff\n"); + StoreToEAUsingEDI(ea, BYTE_SIZE, 0); + } + EmitTiming(8 + TimingEA(ea, BYTE_SIZE)); /* mem: byte, true */ + } + InstEnd(); + return 1; + break; + case 1: /* F: Always false */ + if ((ea >> 3) == 0) /* Dn */ + { + e("and edi, byte 7\n"); + e("mov byte [d+edi*4], 0\n"); + EmitTiming(4); /* reg: byte, false */ + } + else + { + if (mpu == 68000 && dummyread && (ea >> 3)) + { + /* + * If the processor type is 68000, and the EA mode is not + * register, we can emulate dummy reads! + */ + + LoadFromEA(ea, BYTE_SIZE, 0); + e("xor dl, dl\n"); + WriteByte(); + } + else + { + e("xor dl, dl\n"); + StoreToEAUsingEDI(ea, BYTE_SIZE, 0); + } + EmitTiming(8 + TimingEA(ea, BYTE_SIZE)); /* mem: byte, false */ + } + InstEnd(); + return 1; + break; + case 2: /* HI: !C & !Z */ + e("test ah, byte 0x41\n"); + e("jz short do%d\n", op); + break; + case 3: /* LS: C | Z */ + e("test ah, byte 0x41\n"); + e("jnz short do%d\n", op); + break; + case 4: /* CC: !C */ + e("test ah, byte 1\n"); + e("jz short do%d\n", op); + break; + case 5: /* CS: C */ + e("test ah, byte 1\n"); + e("jnz short do%d\n", op); + break; + case 6: /* NE: !Z */ + e("test ah, byte 0x40\n"); + e("jz short do%d\n", op); + break; + case 7: /* EQ: Z */ + e("test ah, byte 0x40\n"); + e("jnz short do%d\n", op); + break; + case 8: /* VC: !V */ + e("test al, byte 1\n"); + e("jz short do%d\n", op); + break; + case 9: /* VS: V */ + e("test al, byte 1\n"); + e("jnz short do%d\n", op); + break; + case 0xa: /* PL: !N */ + e("test ah, byte 0x80\n"); + e("jz short do%d\n", op); + break; + case 0xb: /* MI: N */ + e("test ah, byte 0x80\n"); + e("jnz short do%d\n", op); + break; + case 0xc: /* GE: N & V | !N & !V (N&V || !N&!V) */ + e("mov bl, al\n"); + e("mov bh, ah\n"); + e("and bh, 0xfe\n"); + e("or bl, bh\n"); + e("test bl, byte 0x81\n"); + e("jpe short do%d\n", op); + break; + case 0xd: /* LT: N & !V | !N & V */ + e("mov bl, al\n"); + e("mov bh, ah\n"); + e("and bh, 0xfe\n"); + e("or bl, bh\n"); + e("test bl, byte 0x81\n"); + e("jpo short do%d\n", op); + EmitLabel(".dont_do"); + break; + case 0xe: /* GT: N & V & !Z | !N & !V & !Z */ + /* if Z, then it is GE and we don't take this branch */ + e("test ah, byte 0x40\n"); + e("jnz short .dont_do\n"); + e("mov bl, al\n"); + e("mov bh, ah\n"); + e("and bh, 0xfe\n"); + e("or bl, bh\n"); + e("test bl, byte 0x81\n"); + e("jpe short do%d\n", op); + EmitLabel(".dont_do"); + break; + case 0xf: /* LE: Z | N & !V | !N & V */ + e("test ah, 0x40\n"); + e("jnz short do%d\n", op); + e("mov bl, al\n"); + e("mov bh, ah\n"); + e("and bh, 0xfe\n"); + e("or bl, bh\n"); + e("test bl, byte 0x81\n"); + e("jpo short do%d\n", op); + break; + } + if ((ea >> 3) == 0) /* Dn */ + { + e("and edi, byte 7\n"); + e("mov byte [d+edi*4], 0\n"); + EmitTiming(4); /* reg: byte, false */ + } + else + { + e("false%d:\n", op); /* this prevents redefinitions of labels in + the EA code */ + if (mpu == 68000 && dummyread && (ea >> 3)) + { + /* + * If the processor type is 68000, and the EA mode is not + * register, we can emulate dummy reads! + */ + + LoadFromEA(ea, BYTE_SIZE, 0); + e("xor dl, dl\n"); + WriteByte(); + } + else + { + e("xor dl, dl\n"); + StoreToEAUsingEDI(ea, BYTE_SIZE, 0); + } + EmitTiming(8 + TimingEA(ea, BYTE_SIZE)); /* mem: byte, false */ + } + InstEnd(); + Align(4); + e("do%d:\n", op); + if ((ea >> 3) == 0) /* Dn */ + { + e("and edi, byte 7\n"); + e("mov byte [d+edi*4], 0xff\n"); + EmitTiming(6); /* reg: byte, true */ + } + else + { + e("true%d:\n", op); /* this prevents redefinitions of labels in + the EA code */ + if (mpu == 68000 && dummyread && (ea >> 3)) + { + /* + * If the processor type is 68000, and the EA mode is not + * register, we can emulate dummy reads! + */ + + LoadFromEA(ea, BYTE_SIZE, 0); + e("mov dl, 0xff\n"); + WriteByte(); + } + else + { + e("mov dl, 0xff\n"); + StoreToEAUsingEDI(ea, BYTE_SIZE, 0); + } + EmitTiming(8 + TimingEA(ea, BYTE_SIZE)); /* mem: byte, true */ + } + InstEnd(); + return 1; +} + +int EXG(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned rx = (op >> 9) & 7, opmode = (op >> 3) & 0x1f; + + if (opmode != 0x8 && opmode != 0x9 && opmode != 0x11) return 0; + + InstBegin(op, mnem, 8); + e("and edi, byte 7\n"); + switch (opmode) + { + case 8: /* Dx,Dy */ + e("mov ebx, [d+%d*4]\n", rx); + e("mov edx, [d+edi*4]\n"); + e("mov [d+%d*4], edx\n", rx); + e("mov [d+edi*4], ebx\n"); + break; + case 9: /* Ax,Ay */ + e("mov ebx, [a+%d*4]\n", rx); + e("mov edx, [a+edi*4]\n"); + e("mov [a+%d*4], edx\n", rx); + e("mov [a+edi*4], ebx\n"); + break; + case 0x11: /* Dx,Ay */ + e("mov ebx, [d+%d*4]\n", rx); + e("mov edx, [a+edi*4]\n"); + e("mov [d+%d*4], edx\n", rx); + e("mov [a+edi*4], ebx\n"); + break; + } + EmitTiming(base_timing); + InstEnd(); + + return 1; +} + +int MULS(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned ea = op & 0x3f, dn = (op >> 9) & 7; + + if (!CheckEA(ea, "101111111111")) return 0; + if (!NumDecodedEA(ea)) return 0; + + InstBegin(op, mnem, NumDecodedEA(ea)); + LoadFromEA(ea, WORD_SIZE, 0); + e("mov ax, [d+%d*4]\n", dn); + e("imul dx\n"); /* ax*dx->dx:ax */ + e("shl edx, byte 16\n"); /* EDX=32-bit result */ + e("mov dx, ax\n"); + e("mov [d+%d*4], edx\n", dn); + e("test edx, edx\n"); /* C is always cleared */ + e("lahf\n"); + e("xor al, al\n"); /* V=1 only occurs on 32*32 (not on 68000) */ + EmitTiming(base_timing + TimingEA(ea, WORD_SIZE)); + InstEnd(); + + return 1; +} + +int MULU(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned ea = op & 0x3f, dn = (op >> 9) & 7; + + if (!CheckEA(ea, "101111111111")) return 0; + if (!NumDecodedEA(ea)) return 0; + + InstBegin(op, mnem, NumDecodedEA(ea)); + LoadFromEA(ea, WORD_SIZE, 0); + e("mov ax, [d+%d*4]\n", dn); + e("mul dx\n"); /* ax*dx->dx:ax */ + e("shl edx, byte 16\n"); /* EDX=32-bit result */ + e("mov dx, ax\n"); + e("mov [d+%d*4], edx\n", dn); + e("test edx, edx\n"); /* C is always cleared */ + e("lahf\n"); + e("xor al, al\n"); /* V=1 only occurs on 32*32 (not on 68000) */ + EmitTiming(base_timing + TimingEA(ea, WORD_SIZE)); + InstEnd(); + + return 1; +} + +int DIVS(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned ea = op & 0x3f, dn = (op >> 9) & 7; + + if (!CheckEA(ea, "101111111111")) return 0; + if (!NumDecodedEA(ea)) return 0; + + /* See the note in DIVU() for info on how overflow is detected */ + + InstBegin(op, mnem, NumDecodedEA(ea)); + + if (TimingEA(ea, WORD_SIZE)) + e("sub ecx, byte %d\n", TimingEA(ea, WORD_SIZE)); /* do 1st.. */ + LoadFromEA(ea, WORD_SIZE, 0); + + e("test dx, dx\n"); + e("jz .divide_by_zero\n"); + e("movsx ebx, dx\n"); /* divisor->EBX (sign extend to work) */ + SaveReg("run", "eax"); + e("mov eax, [d+%d*4]\n", dn); /* dividend */ + e("cdq\n"); /* EAX->sign extend->EDX:EAX */ + e("idiv ebx\n"); + e("cmp eax, -32768\n"); + e("jl .overflow\n"); + e("cmp eax, 32767\n"); + e("jg .overflow\n"); + e("test ax, ax\n"); /* test for flags */ + e("mov [d+(%d*4)+2], dx\n", dn); /* store back to Dn */ + e("mov [d+(%d*4)+0], ax\n", dn); + e("lahf\n"); /* the mov's did not affect the flags... */ + e("xor al, al\n"); /* C cleared by TEST */ + EmitTiming(base_timing); + InstEnd(); + + EmitLabel(".overflow"); + RestoreReg("run", "eax"); + e("mov eax, 1\n"); /* clear C and set overflow */ + EmitTiming(base_timing); + InstEnd(); + + EmitLabel(".divide_by_zero"); + e("xor eax, eax\n"); /* clear C */ + e("jmp near exception_divide_by_zero\n"); + + return 1; +} + +int DIVU(unsigned short op, char *mnem, unsigned base_timing) +{ + /* + * Overflow Detection: + * + * Overflow detection is actually pretty simple. The 68000 DIVU and DIVS + * instructions divide 32-bit operands by 16-bit operands. What I've done + * is zero extend the operands to 64-bit and 32-bit and then divide. If + * the result is larger than 0xFFFF (16 bits), the overflow condition is + * set. + * + * See the end of this function for an alternate method. + */ + + unsigned ea = op & 0x3f, dn = (op >> 9) & 7; + + if (!CheckEA(ea, "101111111111")) return 0; + if (!NumDecodedEA(ea)) return 0; + + InstBegin(op, mnem, NumDecodedEA(ea)); + LoadFromEA(ea, WORD_SIZE, 0); + + if (TimingEA(ea, WORD_SIZE)) + e("sub ecx, byte %d\n", TimingEA(ea, WORD_SIZE)); /* do 1st.. */ + + e("test dx, dx\n"); + e("jz .divide_by_zero\n"); + e("mov ebx, edx\n"); + e("and ebx, 0xffff\n"); /* divisor->EBX */ + SaveReg("run", "eax"); + e("mov eax, [d+%d*4]\n", dn); /* dividend */ + e("xor edx, edx\n"); /* EDX:EAX=dividend */ + e("div ebx\n"); + e("cmp eax, 0xffff\n"); + e("jg .overflow\n"); + e("test ax, ax\n"); /* test for flags */ + e("mov [d+(%d*4)+2], dx\n", dn); /* store back to Dn */ + e("mov [d+(%d*4)+0], ax\n", dn); + e("lahf\n"); /* the mov's did not affect the flags... */ + e("xor al, al\n"); /* C cleared by TEST */ + EmitTiming(base_timing); + InstEnd(); + + EmitLabel(".overflow"); + RestoreReg("run", "eax"); + e("mov eax, 1\n"); /* clear C and set overflow */ + EmitTiming(base_timing); + InstEnd(); + + EmitLabel(".divide_by_zero"); + e("xor eax, eax\n"); /* clear C */ + e("jmp near exception_divide_by_zero\n"); + + return 1; + + /* + * + * An alternate method to detecting overflows is shown below. It doesn't + * seem to be as acurrate as the method that is actually used, but perhaps + * I implemented it wrong or misunderstood it. It broke Comix Zone, Hard + * Drivin', and Race Drivin' (well, caused graphical glitches actually.) + * + * Kuwanger in #programmers (DALnet, of course) came up with a cool idea + * on how to detect overflow before actually dividing. He used an example + * of AH:AL/BL ... in the emulator, it is DX:AX/BX. The dividend, DX:AX + * is stored entirely in EDX, and it is shifted right by the bit number of + * the highest 1 bit in BX, the divisor. If the high 16-bits of EDX (which + * would be DX in DX:AX) are not clear, then an overflow would occur. + * + * Here's Kuwanger's classic lecture: + * + * Maybe I should use a smaller example. + * Lets use, ah:al/bl + * ... + * trzy: You could just convert one to a bit value. + * trzy: Ie, hb(bl).. + * And then shift the other one ah:al + * ... + * Though hb(bl) would have to return 0, that time. + * then ah:all>>hb(bl) + * err, ah:al, rather + * Ie, you shift by the most prominent bit. + * And if ah is non-zero.. + * Well, then the number won't fit. + * ... + * Lets try an extreme case. + * 65535/255 + * 65535>>7 + * ... + * That obviously doesn't fit. :) + * + * Hip-hip-HURRAY! + */ +} + +int NOT(unsigned short op, char *mnem, unsigned base_timing) +{ + int size; + unsigned ea = op & 0x3f, t; + + if (!CheckEA(ea, "101111111000")) return 0; + if (!NumDecodedEA(ea)) return 0; + switch ((op >> 6) & 3) + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + + InstBegin(op, mnem, NumDecodedEA(ea)); + if ((ea >> 3) == 0) /* Dn */ + { + e("and edi, byte 7\n"); + if (size == BYTE_SIZE) + e("mov dl, [d+edi*4]\n"); + else + e("mov edx, [d+edi*4]\n"); + switch (size) + { case BYTE_SIZE: e("not dl\n"); e("test dl, dl\n"); break; + case WORD_SIZE: e("not dx\n"); e("test dx, dx\n"); break; + case LONG_SIZE: e("not edx\n"); e("test edx, edx\n"); break; + } + e("lahf\n"); /* C cleared */ + e("xor al, al\n"); /* V cleared */ + switch (size) + { case BYTE_SIZE: e("mov [d+edi*4], dl\n"); break; + case WORD_SIZE: e("mov [d+edi*4], dx\n"); break; + case LONG_SIZE: e("mov [d+edi*4], edx\n"); break; + } + switch (size) + { case BYTE_SIZE: + case WORD_SIZE: + t = 4; break; + case LONG_SIZE: + t = 6; break; } + } + else /* mem */ + { + LoadFromEA(ea, size, 0); + switch (size) + { case BYTE_SIZE: e("not dl\n"); e("test dl, dl\n"); break; + case WORD_SIZE: e("not dx\n"); e("test dx, dx\n"); break; + case LONG_SIZE: e("not edx\n"); e("test edx, edx\n"); break; + } + e("lahf\n"); /* C cleared */ + e("xor al, al\n"); /* V cleared */ + switch (size) + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; + } + switch (size) + { case BYTE_SIZE: + case WORD_SIZE: + t = 8; break; + case LONG_SIZE: + t = 12; break; } + t += TimingEA(ea, size); + } + EmitTiming(t); + InstEnd(); + return 1; +} + +int RTE(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + e("test byte [sr+1], 0x20\n"); /* must be in supervisor mode */ + e("jz near exception_privilege_violation\n"); + e("mov ebx, [a+7*4]\n"); + SaveReg("run", "ebx"); + ReadWord(); /* get SR */ + RestoreReg("run", "ebx"); + e("and edx, 0xa71f\n"); + e("mov [sr], edx\n"); + LoadCCR(); + e("add ebx, byte 2\n"); + SaveReg("run", "ebx"); + ReadLong(); /* get PC */ + RestoreReg("run", "ebx"); + e("add ebx, byte 4\n"); + /* + * If 68010, we have to fetch the format word and check it. If invalid, + * we branch to stackframe_error. The PC points at the word AFTER the + * faulty RTE. + */ + if (mpu == 68010) + { + SaveReg("run", "edx"); /* EDX has the PC! */ + SaveReg("run", "ebx"); + ReadWord(); + RestoreReg("run", "ebx"); + e("add ebx, byte 2\n"); + e("test dh, 0xf0\n"); /* format should only be 0x0000 */ + e("jnz near stackframe_error\n"); + RestoreReg("run", "edx"); + } + + e("mov [a+7*4], ebx\n"); + e("mov esi, edx\n"); + UpdateFetchPtr(); + e("test byte [sr+1], 0x20\n"); /* if no longer in supervisor, + SP->SSP, USP->SP */ + e("jnz short .in_s\n"); + e("mov ebx, [a+7*4]\n"); + e("mov edx, [__sp]\n"); + e("mov [a+7*4], edx\n"); + e("mov [__sp], ebx\n"); + SetUserAddressSpace(); /* map in user address space */ + EmitLabel(".in_s"); + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int ANDItoCCR(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + SaveCCR(); + e("mov dl, [esi]\n"); /* get data */ + e("and dl, 0x1f\n"); /* mask out unwanted bits */ + e("and [sr], dl\n"); + e("add esi, byte 2\n"); + LoadCCR(); + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int CMPA(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned opmode = (op >> 6) & 7, t; + + if (!CheckEA(op & 0x3f, "111111111111")) return 0; + if (!NumDecodedEA(op & 0x3f)) return 0; + if (opmode != 3 && opmode != 7) return 0; + + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + if (opmode == 3) LoadFromEA(op & 0x3f, WORD_SIZE, 1); + else LoadFromEA(op & 0x3f, LONG_SIZE, 0); + e("cmp [a+%d*4], edx\n", (op >> 9) & 7); + e("lahf\n"); + e("seto al\n"); + if (opmode == 3) /* word size */ + t = 6 + TimingEA(op & 0x3f, WORD_SIZE); + else /* long */ + t = 6 + TimingEA(op & 0x3f, LONG_SIZE); + EmitTiming(t); + InstEnd(); + return 1; +} + +int PEA(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned t; + + if (!CheckEA(op & 0x3f, "001001111011")) return 0; + if (!NumDecodedEA(op & 0x3f)) return 0; + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + LoadControlEA(op & 0x3f); + e("sub dword [a+7*4], byte 4\n"); /* SP-4->SP */ + e("mov edx, ebx\n"); + e("mov ebx, [a+7*4]\n"); + WriteLong(); /* ->(SP) */ + switch ((op >> 3) & 7) /* timing based on control addressing mode */ + { case 2: t = 12; break; /* (An) */ + case 5: t = 16; break; /* (d16,An) */ + case 6: t = 20; break; /* (d8,An,Xn) */ + case 7: + switch (op & 7) + { case 0: t = 16; break; /* (xxx).W */ + case 1: t = 20; break; /* (xxx).L */ + case 2: t = 16; break; /* (d16,pc) */ + case 3: t = 20; break; /* (d8,pc,Xn) */ + } break; + } + EmitTiming(t); + InstEnd(); + return 1; +} + +int SWAP(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 8); + e("and edi, byte 7\n"); + e("mov edx, [d+edi*4]\n"); + e("rol edx, byte 16\n"); /* swap words */ + e("test edx, edx\n"); /* clears CF, will set N and Z */ + e("lahf\n"); + e("xor al, al\n"); /* clear V */ + e("mov [d+edi*4], edx\n"); + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int BSET(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned t; + + if (((op >> 6) & 7) != 7 && ((op >> 6) & 7) != 3) return 0; + if (op & 0x100) /* dynamic */ + { + if (!CheckEA(op & 0x3f, "101111111000")) return 0; + if (!NumDecodedEA(op & 0x3f)) return 0; + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + if (((op >> 3) & 7) == 0) /* Dn is long */ + { + t = 8; + e("and edi, byte 7\n"); + e("mov ebx, [d+%d*4]\n", (op >> 9) & 7); /* bit # */ + e("and ebx, byte 31\n"); /* same as modulo 32 */ + e("bts dword [d+edi*4], ebx\n"); /* bit->CF, set */ + e("setnc dh\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl dh, 6\n"); /* put C in Z position */ + e("or ah, dh\n"); /* set the new Z */ + } + else /* mem is byte */ + { + t = 8; + LoadFromEA(op & 0x3f, BYTE_SIZE, 0); + e("mov edi, [d+%d*4]\n", (op >> 9) & 7); /* bit # */ + e("and edi, byte 7\n"); /* same as modulo 8 */ + e("bts edx, edi\n"); /* bit->CF, set */ + e("setnc dh\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl dh, 6\n"); /* put C in Z position */ + e("or ah, dh\n"); /* set the new Z */ + WriteByte(); /* clears EDI for us */ + } + } + else if (!(op & 0x100)) /* static */ + { + if (!CheckEA(op & 0x3f, "101111111000")) return 0; + if (!NumDecodedEA(op & 0x3f)) return 0; + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + if (((op >> 3) & 7) == 0) /* Dn is long */ + { + t = 12; + e("and edi, byte 7\n"); /* isolate Dn reg # */ + e("mov ebx, [esi]\n"); /* get bit # */ + e("and ebx, byte 31\n"); /* same as modulo 32 */ + e("add esi, byte 2\n"); + e("bts dword [d+edi*4], ebx\n"); /* bit->CF, set */ + e("setnc dh\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl dh, 6\n"); /* put C in Z position */ + e("or ah, dh\n"); /* set the new Z */ + } + else /* mem is byte */ + { + t = 12; + SaveRegTo("run", "edi", "esi"); /* save to EDI spot */ + e("add esi, byte 2\n"); + LoadFromEA(op & 0x3f, BYTE_SIZE, 0); + RestoreReg("run", "edi"); + e("mov edi, [edi]\n"); + e("and edi, byte 7\n"); /* same as modulo 8 */ + e("bts edx, edi\n"); /* bit->CF, set */ + e("setnc dh\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl dh, 6\n"); /* put C in Z position */ + e("or ah, dh\n"); /* set the new Z */ + WriteByte(); /* write back, EDI is cleared */ + } + } + if (((op & 0x3f) & 7) == 0) /* Dn is long */ + EmitTiming(t); + else /* mem is byte */ + EmitTiming(t + TimingEA(op & 0x3f, BYTE_SIZE)); + InstEnd(); + return 1; +} + +int BCLR(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned t; + + if (((op >> 6) & 7) != 6 && ((op >> 6) & 7) != 2) return 0; + if (op & 0x100) /* dynamic */ + { + if (!CheckEA(op & 0x3f, "101111111000")) return 0; + if (!NumDecodedEA(op & 0x3f)) return 0; + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + if (((op >> 3) & 7) == 0) /* Dn is long */ + { + t = 10; + e("and edi, byte 7\n"); + e("mov ebx, [d+%d*4]\n", (op >> 9) & 7); /* bit # */ + e("and ebx, byte 31\n"); /* same as modulo 32 */ + e("btr dword [d+edi*4], ebx\n"); /* bit->CF, clear */ + e("setnc dh\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl dh, 6\n"); /* put C in Z position */ + e("or ah, dh\n"); /* set the new Z */ + } + else /* mem is byte */ + { + t = 8; + LoadFromEA(op & 0x3f, BYTE_SIZE, 0); + e("mov edi, [d+%d*4]\n", (op >> 9) & 7); /* bit # */ + e("and edi, byte 7\n"); /* same as modulo 8 */ + e("btr edx, edi\n"); /* bit->CF, clear */ + e("setnc dh\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl dh, 6\n"); /* put C in Z position */ + e("or ah, dh\n"); /* set the new Z */ + WriteByte(); /* clears EDI for us */ + } + } + else if (!(op & 0x100)) /* static */ + { + if (!CheckEA(op & 0x3f, "101111111000")) return 0; + if (!NumDecodedEA(op & 0x3f)) return 0; + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + if (((op >> 3) & 7) == 0) /* Dn is long */ + { + t = 14; + e("and edi, byte 7\n"); /* isolate Dn reg # */ + e("mov ebx, [esi]\n"); /* get bit # */ + e("and ebx, byte 31\n"); /* same as modulo 32 */ + e("add esi, byte 2\n"); + e("btr dword [d+edi*4], ebx\n"); /* bit->CF, clear */ + e("setnc dh\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl dh, 6\n"); /* put C in Z position */ + e("or ah, dh\n"); /* set the new Z */ + } + else /* mem is byte */ + { + t = 12; + SaveRegTo("run", "edi", "esi"); /* save to EDI spot */ + e("add esi, byte 2\n"); + LoadFromEA(op & 0x3f, BYTE_SIZE, 0); + RestoreReg("run", "edi"); + e("mov edi, [edi]\n"); + e("and edi, byte 7\n"); /* same as modulo 8 */ + e("btr edx, edi\n"); /* bit->CF, clear */ + e("setnc dh\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl dh, 6\n"); /* put C in Z position */ + e("or ah, dh\n"); /* set the new Z */ + WriteByte(); /* write back, EDI is cleared */ + } + } + if (((op & 0x3f) & 7) == 0) /* Dn is long */ + EmitTiming(t); + else /* mem is byte */ + EmitTiming(t + TimingEA(op & 0x3f, BYTE_SIZE)); + InstEnd(); + return 1; +} + +int BCHG(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned t; + + if (((op >> 6) & 7) != 5 && ((op >> 6) & 7) != 1) return 0; + if (op & 0x100) /* dynamic */ + { + if (!CheckEA(op & 0x3f, "101111111000")) return 0; + if (!NumDecodedEA(op & 0x3f)) return 0; + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + if (((op >> 3) & 7) == 0) /* Dn is long */ + { + t = 8; + e("and edi, byte 7\n"); + e("mov ebx, [d+%d*4]\n", (op >> 9) & 7); /* bit # */ + e("and ebx, byte 31\n"); /* same as modulo 32 */ + e("btc dword [d+edi*4], ebx\n"); /* bit->CF, change */ + e("setnc dh\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl dh, 6\n"); /* put C in Z position */ + e("or ah, dh\n"); /* set the new Z */ + } + else /* mem is byte */ + { + t = 8; + LoadFromEA(op & 0x3f, BYTE_SIZE, 0); + e("mov edi, [d+%d*4]\n", (op >> 9) & 7); /* bit # */ + e("and edi, byte 7\n"); /* same as modulo 8 */ + e("btc edx, edi\n"); /* bit->CF, change */ + e("setnc dh\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl dh, 6\n"); /* put C in Z position */ + e("or ah, dh\n"); /* set the new Z */ + WriteByte(); /* clears EDI for us */ + } + } + else if (!(op & 0x100)) /* static */ + { + if (!CheckEA(op & 0x3f, "101111111000")) return 0; + if (!NumDecodedEA(op & 0x3f)) return 0; + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + if (((op >> 3) & 7) == 0) /* Dn is long */ + { + t = 12; + e("and edi, byte 7\n"); /* isolate Dn reg # */ + e("mov ebx, [esi]\n"); /* get bit # */ + e("and ebx, byte 31\n"); /* same as modulo 32 */ + e("add esi, byte 2\n"); + e("btc dword [d+edi*4], ebx\n"); /* bit->CF, change */ + e("setnc dh\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl dh, 6\n"); /* put C in Z position */ + e("or ah, dh\n"); /* set the new Z */ + } + else /* mem is byte */ + { + t = 12; + SaveRegTo("run", "edi", "esi"); /* save to EDI spot */ + e("add esi, byte 2\n"); + LoadFromEA(op & 0x3f, BYTE_SIZE, 0); + RestoreReg("run", "edi"); + e("mov edi, [edi]\n"); + e("and edi, byte 7\n"); /* same as modulo 8 */ + e("btc edx, edi\n"); /* bit->CF, change */ + e("setnc dh\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl dh, 6\n"); /* put C in Z position */ + e("or ah, dh\n"); /* set the new Z */ + WriteByte(); /* write back, EDI is cleared */ + } + } + if (((op & 0x3f) & 7) == 0) /* Dn is long */ + EmitTiming(t); + else /* mem is byte */ + EmitTiming(t + TimingEA(op & 0x3f, BYTE_SIZE)); + InstEnd(); + return 1; +} + +int ANDItoSR(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + e("test byte [sr+1], 0x20\n"); /* in supervisor? */ + e("jz near exception_privilege_violation\n"); + SaveCCR(); /* save flags to SR */ + e("mov edx, [esi]\n"); + e("and edx, 0xa71f\n"); /* mask out unwanted bits */ + e("and [sr], dx\n"); + e("add esi, byte 2\n"); + LoadCCR(); /* get flags back */ + e("test byte [sr+1], 0x20\n"); /* if we changed to User, swap SPs */ + e("jnz short .in_s\n"); + e("mov ebx, [a+7*4]\n"); + e("mov edx, [__sp]\n"); + e("mov [a+7*4], edx\n"); + e("mov [__sp], ebx\n"); + SetUserAddressSpace(); /* map in user address space */ + EmitLabel(".in_s"); + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int UNLK(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 8); + e("and edi, byte 7\n"); + e("mov ebx, [a+edi*4]\n"); /* An->SP */ + SaveReg("run", "ebx"); /* to avoid addrclip() */ + SaveReg("run", "edi"); + ReadLong(); /* (SP)->An */ + RestoreReg("run", "edi"); + RestoreReg("run", "ebx"); + e("mov [a+edi*4], edx\n"); + e("add ebx, byte 4\n"); + e("mov [a+7*4], ebx\n"); /* SP+4->SP */ + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int LINK(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 8); + e("and edi, byte 7\n"); + e("mov ebx, [a+7*4]\n"); /* EBX=SP */ + e("sub ebx, byte 4\n"); + e("mov edx, [a+edi*4]\n"); + SaveReg("run", "ebx"); + SaveReg("run", "edi"); + WriteLong(); /* An->(SP) */ + RestoreReg("run", "edi"); + RestoreReg("run", "ebx"); + e("mov [a+edi*4], ebx\n"); /* SP->An */ + e("movsx edx, word [esi]\n"); + e("add ebx, edx\n"); /* dn + SP->SP */ + e("mov [a+7*4], ebx\n"); + e("add esi, byte 2\n"); + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int ROxMem(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned ea = op & 0x3f, dr = (op >> 8) & 1; + char mnem[4]; + char *mnem_t[] = { "ROR", "ROL" }; + + if (!CheckEA(ea, "001111111000")) return 0; + if (!NumDecodedEA(ea)) return 0; + + strcpy(mnem, mnem_t[(op >> 8) & 1]); + + InstBegin(op, mnem, NumDecodedEA(ea)); + LoadFromEA(ea, WORD_SIZE, 0); + if (dr) /* left */ + e("rol dx, byte 1\n"); + else + e("ror dx, byte 1\n"); + e("setc al\n"); /* AL=CF */ + e("test dx, dx\n"); /* CF is cleared */ + e("lahf\n"); + e("or ah, al\n"); /* put in CF */ + e("xor al, al\n"); /* V is always cleared */ + WriteWord(); /* write back to mem */ + EmitTiming(base_timing + TimingEA(ea, WORD_SIZE)); + InstEnd(); + return 1; +} + +int ROxReg(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned size, t, opr_i, count; + char *opr[] = { "ror", "rol" }; + char mnem[4]; + char *mnem_t[] = { "ROR", "ROL" }; + + switch ((op >> 6) & 3) + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + + opr_i = (op >> 8) & 1; + strcpy(mnem, mnem_t[opr_i]); + + count = (op >> 9) & 7; + if (!count) count = 8; + + InstBegin(op, mnem, 8); /* 8 regs */ + e("and edi, byte 7\n"); + if ((op >> 5) & 1) /* reg contains count */ + { + e("mov ebx, ecx\n"); /* save ECX */ + e("mov ecx, [d+%d*4]\n", (op >> 9) & 7); + e("and ecx, byte 0x3f\n"); /* modulo 64 */ + e("mov edx, [d+edi*4]\n"); + switch (size) + { case BYTE_SIZE: e("%s dl, cl\n", opr[opr_i]); e("setc al\n"); e("test dl, dl\n"); break; + case WORD_SIZE: e("%s dx, cl\n", opr[opr_i]); e("setc al\n"); e("test dx, dx\n"); break; + case LONG_SIZE: e("%s edx, cl\n", opr[opr_i]); e("setc al\n"); e("test edx, edx\n"); break; + } + e("lahf\n"); + e("test cl, cl\n"); /* if shift count of 0, X is unaffected */ + e("jnz short .not_zero\n"); + e("xor al, al\n"); /* clear CF, count was 0 */ + EmitLabel(".not_zero"); + e("or ah, al\n"); /* put CF in with rest of flags */ + e("xor al, al\n"); /* V always cleared */ + switch (size) /* write back results */ + { case BYTE_SIZE: e("mov [d+edi*4], dl\n", opr[opr_i]); break; + case WORD_SIZE: e("mov [d+edi*4], dx\n", opr[opr_i]); break; + case LONG_SIZE: e("mov [d+edi*4], edx\n", opr[opr_i]); break; + } + /* timing */ + switch (size) + { case BYTE_SIZE: + case WORD_SIZE: t = 6; break; + case LONG_SIZE: t = 8; break; } + e("shl cl, byte 1\n"); /* 2n */ + e("add cl, byte %d\n", t); + e("neg ecx\n"); + e("add ecx, ebx\n"); + e("js near Turbo68KRun_done\n"); + } + else /* immediate count */ + { + e("mov edx, [d+edi*4]\n"); + switch (size) + { case BYTE_SIZE: e("%s dl, byte %d\n", opr[opr_i], count); e("setc al\n"); e("test dl, dl\n"); break; + case WORD_SIZE: e("%s dx, byte %d\n", opr[opr_i], count); e("setc al\n"); e("test dx, dx\n"); break; + case LONG_SIZE: e("%s edx, byte %d\n", opr[opr_i], count); e("setc al\n"); e("test edx, edx\n"); break; + } + e("lahf\n"); + e("or ah, al\n"); /* set CF */ + e("xor al, al\n"); /* V always cleared */ + switch (size) /* write back results */ + { case BYTE_SIZE: e("mov [d+edi*4], dl\n"); break; + case WORD_SIZE: e("mov [d+edi*4], dx\n"); break; + case LONG_SIZE: e("mov [d+edi*4], edx\n"); break; + } + switch (size) + { case BYTE_SIZE: + case WORD_SIZE: t = 6; break; + case LONG_SIZE: t = 8; break; } + EmitTiming(t + count * 2); + } + InstEnd(); + return 1; +} + +int EXT(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned opmode = (op >> 6) & 7; + + if (opmode != 2 && opmode != 3) return 0; + + InstBegin(op, mnem, 8); + e("and edi, byte 7\n"); + e("mov edx, [d+edi*4]\n"); + if (opmode == 2) /* byte -> word */ + { + e("movsx dx, dl\n"); + e("mov [d+edi*4], dx\n"); + e("test dx, dx\n"); + } + else if (opmode == 3) /* word -> long */ + { + e("movsx edx, dx\n"); + e("mov [d+edi*4], edx\n"); + e("test edx, edx\n"); + } + else if (opmode == 7) /* byte -> long */ + { + /* + * Note: This code is never executed. EXTB is present on 68020 and + * higher processors. Turbo68K was only intended to emulate the + * 68000. This code was an accident, but it will be kept here in case + * in the future it is needed. + */ + + e("movsx edx, dl\n"); + e("mov [d+edi*4], edx\n"); + e("test edx, edx\n"); + } + e("lahf\n"); /* CF is already cleared by TEST */ + e("xor al, al\n"); /* V always cleared */ + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int ROXxMem(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned ea = op & 0x3f, dr = (op >> 8) & 1; + char mnem[5]; + char *mnem_t[] = { "ROXR", "ROXL" }; + + if (!CheckEA(ea, "001111111000")) return 0; + if (!NumDecodedEA(ea)) return 0; + + strcpy(mnem, mnem_t[(op >> 8) & 1]); + + InstBegin(op, mnem, NumDecodedEA(ea)); + LoadFromEA(ea, WORD_SIZE, 0); + e("shr byte [x], 1\n"); + if (dr) /* left */ + e("rcl dx, byte 1\n"); + else + e("rcr dx, byte 1\n"); + e("setc al\n"); /* AL=CF */ + e("setc byte [x]\n"); + e("test dx, dx\n"); /* CF is cleared */ + e("lahf\n"); + e("or ah, al\n"); /* put in CF */ + e("xor al, al\n"); + WriteWord(); /* write back to mem */ + EmitTiming(base_timing + TimingEA(ea, WORD_SIZE)); + InstEnd(); + return 1; +} + +int ROXxReg(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned size, t, opr_i, count; + char *opr[] = { "rcr", "rcl" }; + char mnem[5]; + char *mnem_t[] = { "ROXR", "ROXL" }; + + switch ((op >> 6) & 3) + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + + opr_i = (op >> 8) & 1; + strcpy(mnem, mnem_t[opr_i]); + + count = (op >> 9) & 7; + if (!count) count = 8; + + InstBegin(op, mnem, 8); /* 8 regs */ + e("and edi, byte 7\n"); + if ((op >> 5) & 1) /* reg contains count */ + { + e("mov ebx, ecx\n"); /* save ECX */ + e("mov ecx, [d+%d*4]\n", (op >> 9) & 7); + e("and ecx, byte 0x3f\n"); /* modulo 64 */ + e("mov dl, [x]\n"); + e("shr dl, byte 1\n"); /* X->CF so we can use RCL/RCR */ + e("mov edx, [d+edi*4]\n"); + switch (size) + { case BYTE_SIZE: e("%s dl, cl\n", opr[opr_i]); e("setc al\n"); e("test dl, dl\n"); break; + case WORD_SIZE: e("%s dx, cl\n", opr[opr_i]); e("setc al\n"); e("test dx, dx\n"); break; + case LONG_SIZE: e("%s edx, cl\n", opr[opr_i]); e("setc al\n"); e("test edx, edx\n"); break; + } + e("lahf\n"); + e("test cl, cl\n"); /* if shift count of 0, X is unaffected */ + e("jz short .zero_count\n"); + e("or ah, al\n"); /* set CF */ + e("test ah, 1\n"); /* CF */ + e("setnz byte [x]\n"); + e("jmp short .skip\n"); + EmitLabel(".zero_count"); + e("mov al, [x]\n"); /* X->C */ + e("and al, byte 1\n"); + e("and ah, 0xfe\n"); /* get rid of old C before putting new C in */ + e("or ah, al\n"); + EmitLabel(".skip"); + e("xor al, al\n"); /* V always cleared */ + switch (size) /* write back results */ + { case BYTE_SIZE: e("mov [d+edi*4], dl\n", opr[opr_i]); break; + case WORD_SIZE: e("mov [d+edi*4], dx\n", opr[opr_i]); break; + case LONG_SIZE: e("mov [d+edi*4], edx\n", opr[opr_i]); break; + } + + /* timing */ + switch (size) + { case BYTE_SIZE: + case WORD_SIZE: t = 6; break; + case LONG_SIZE: t = 8; break; } + e("shl cl, byte 1\n"); /* 2n */ + e("add cl, byte %d\n", t); + e("neg ecx\n"); + e("add ecx, ebx\n"); + e("js near Turbo68KRun_done\n"); + } + else /* immediate count */ + { + e("mov dl, [x]\n"); + e("shr dl, byte 1\n"); /* X->CF so we can use RCL/RCR */ + e("mov edx, [d+edi*4]\n"); + switch (size) + { case BYTE_SIZE: e("%s dl, byte %d\n", opr[opr_i], count); e("setc al\n"); e("test dl, dl\n"); break; + case WORD_SIZE: e("%s dx, byte %d\n", opr[opr_i], count); e("setc al\n"); e("test dx, dx\n"); break; + case LONG_SIZE: e("%s edx, byte %d\n", opr[opr_i], count); e("setc al\n"); e("test edx, edx\n"); break; + } + e("lahf\n"); + e("or ah, al\n"); /* set CF */ + e("test ah, 1\n"); /* CF */ + e("setnz byte [x]\n"); + e("xor al, al\n"); /* V always cleared */ + switch (size) /* write back results */ + { case BYTE_SIZE: e("mov [d+edi*4], dl\n", opr[opr_i]); break; + case WORD_SIZE: e("mov [d+edi*4], dx\n", opr[opr_i]); break; + case LONG_SIZE: e("mov [d+edi*4], edx\n", opr[opr_i]); break; + } + switch (size) + { case BYTE_SIZE: + case WORD_SIZE: t = 6; break; + case LONG_SIZE: t = 8; break; } + EmitTiming(t + count * 2); + } + InstEnd(); + return 1; +} + +int MOVEtoCCR(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned ea = op & 0x3f; + + if (!CheckEA(ea, "101111111111")) return 0; + if (!NumDecodedEA(ea)) return 0; + + InstBegin(op, mnem, NumDecodedEA(ea)); + LoadFromEA(ea, WORD_SIZE, 0); + e("mov [sr], dl\n"); + LoadCCR(); /* update flags */ + EmitTiming(base_timing + TimingEA(ea, WORD_SIZE)); /* technically, word + sized */ + InstEnd(); + return 1; +} + +int LSxMem(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned ea = op & 0x3f, dr = (op >> 8) & 1; + char mnem[4]; + char *mnem_t[] = { "LSR", "LSL" }; + + if (!CheckEA(ea, "001111111000")) return 0; + if (!NumDecodedEA(ea)) return 0; + + strcpy(mnem, mnem_t[(op >> 8) & 1]); + + InstBegin(op, mnem, NumDecodedEA(ea)); + LoadFromEA(ea, WORD_SIZE, 0); + if (dr) /* left */ + e("shl dx, byte 1\n"); + else + e("shr dx, byte 1\n"); + e("lahf\n"); + e("setc byte [x]\n"); + e("xor al, al\n"); + WriteWord(); /* write back to mem */ + EmitTiming(base_timing + TimingEA(ea, WORD_SIZE)); + InstEnd(); + return 1; +} + +int LSxReg(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned size, t, opr_i, count; + char *opr[] = { "shr", "shl" }; + char mnem[4]; + char *mnem_t[] = { "LSR", "LSL" }; + + switch ((op >> 6) & 3) + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + + opr_i = (op >> 8) & 1; + strcpy(mnem, mnem_t[opr_i]); + + count = (op >> 9) & 7; + if (!count) count = 8; + + InstBegin(op, mnem, 8); /* 8 regs */ + e("and edi, byte 7\n"); + if ((op >> 5) & 1) /* reg contains count */ + { + e("mov ebx, ecx\n"); /* save ECX */ + e("mov ecx, [d+%d*4]\n", (op >> 9) & 7); + e("and ecx, byte 0x3f\n"); /* modulo 64 */ + e("mov edx, [d+edi*4]\n"); /* get register... */ + switch (size) + { case BYTE_SIZE: e("%s dl, cl\n", opr[opr_i]); + e("setc al\n"); /* CF -> AL */ + e("test dl, dl\n"); + e("mov [d+edi*4], dl\n"); /* MOV does not + affect flags */ + break; + case WORD_SIZE: e("%s dx, cl\n", opr[opr_i]); + e("setc al\n"); + e("test dx, dx\n"); + e("mov [d+edi*4], dx\n"); + break; + case LONG_SIZE: e("%s edx, cl\n", opr[opr_i]); + e("setc al\n"); + e("test edx, edx\n"); + e("mov [d+edi*4], edx\n"); + break; + } + e("lahf\n"); + e("test cl, cl\n"); /* if zero count... */ + e("jz short .zero\n"); + e("or ah, al\n"); /* new CF... the first test cleared old C */ + e("test al, 1\n"); /* C->X */ + e("setnz byte [x]\n"); + EmitLabel(".zero"); + e("xor al, al\n"); /* V cleared */ + /* timing */ + switch (size) + { case BYTE_SIZE: + case WORD_SIZE: t = 6; break; + case LONG_SIZE: t = 8; break; } + e("shl cl, byte 1\n"); /* 2n */ + e("add cl, byte %d\n", t); + e("neg ecx\n"); + e("add ecx, ebx\n"); + e("js near Turbo68KRun_done\n"); + } + else /* immediate count */ + { + e("%s ", opr[opr_i]); + switch (size) + { case BYTE_SIZE: e("byte "); break; + case WORD_SIZE: e("word "); break; + case LONG_SIZE: e("dword "); break; } + e("[d+edi*4], %d\n", count); + e("lahf\n"); + e("setc byte [x]\n"); + e("xor al, al\n"); + switch (size) + { case BYTE_SIZE: + case WORD_SIZE: t = 6; break; + case LONG_SIZE: t = 8; break; } + EmitTiming(t + count * 2); + } + InstEnd(); + return 1; +} + +int NOP(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int CLR(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned ea = op & 0x3f, size, t; + + if (!CheckEA(ea, "101111111000")) return 0; + if (!NumDecodedEA(ea)) return 0; + + switch ((op >> 6) & 3) + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + + InstBegin(op, mnem, NumDecodedEA(ea)); + e("mov eax, 0x4000\n"); /* Z always set, everything else cleared */ + + if (mpu == 68000 && dummyread && (ea >> 3)) + { + /* + * Emulate the dummy read for memory addressing modes, if necessary. + * We only do it for memory modes, because it really can't make any + * difference if the destination is a register! + */ + + LoadFromEA(ea, size, 0); /* do the dummy read */ + e("xor edx, edx\n"); /* now, write a 0 */ + switch (size) /* write */ + { + case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; + } + } + else + { + /* + * This method is quicker, since dummy reads aren't needed + */ + + e("xor edx, edx\n"); + StoreToEAUsingEDI(ea, size, 0); + } + + switch (size) + { case BYTE_SIZE: + case WORD_SIZE: + if ((ea >> 3) == 0) t = 4; /* reg */ + else t = 8 + TimingEA(ea, size); /* mem */ + break; + case LONG_SIZE: + if ((ea >> 3) == 0) t = 6; /* reg */ + else t = 12 + TimingEA(ea, size); /* mem */ + break; + } + EmitTiming(t); + InstEnd(); + return 1; +} + +int ORItoSR(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + e("test byte [sr+1], 0x20\n"); /* in supervisor? */ + e("jz near exception_privilege_violation\n"); + SaveCCR(); /* save flags to SR */ + e("mov edx, [esi]\n"); + e("and edx, 0xa71f\n"); /* mask out unwanted bits */ + e("or [sr], dx\n"); + e("add esi, byte 2\n"); + LoadCCR(); /* get flags back */ + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int MOVEfromSR(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned ea = op & 0x3f; + + if (!CheckEA(ea, "101111111000")) return 0; + + InstBegin(op, mnem, 1); + /* + * This instruction is not privileged for 68000 and 68008 processors. + */ + if (mpu == 68010) + { + e("test byte [sr+1], 0x20\n"); /* in supervisor? */ + e("jz near exception_privilege_violation\n"); + } + SaveCCR(); /* save flags to SR */ + + if (mpu == 68000 && dummyread && (ea >> 3)) + { + /* + * When dummy reads are enabled, and the EA mode is not register, we + * perform a dummy read + */ + + LoadFromEA(ea, WORD_SIZE, 0); + e("mov edx, [sr]\n"); + WriteWord(); + } + else + { + e("mov edx, [sr]\n"); /* get SR */ + StoreToEAUsingEDI(ea, WORD_SIZE, 0); + } + + LoadCCR(); /* get back SR */ + if ((ea >> 3) == 0) + EmitTiming(6); + else + EmitTiming(8 + TimingEA(ea, WORD_SIZE)); + InstEnd(); + return 1; +} + +int ArithmeticA(unsigned short op, char *mnem, unsigned base_timing) +{ + int size = UNKNOWN_SIZE, t; + + if (!CheckEA(op & 0x3f, "111111111111")) /* check EA mode */ + return 0; + if (!NumDecodedEA(op & 0x3f)) /* check if decoded this EA */ + return 0; + switch ((op >> 6) & 7) /* set allowed sizes */ + { case 3: size = WORD_SIZE; break; + case 7: size = LONG_SIZE; break; + default: return 0; } + if (((op >> 12) & 0xf) != 0xd && ((op >> 12) & 0xf) != 9) return 0; + + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + LoadFromEA(op & 0x3f, size, 1); /* load */ + if (((op >> 12) & 0xf) == 0xd) /* ADDA */ + e("add [a+%d*4], edx\n", (op >> 9) & 7); /* store */ + else /* SUBA */ + e("sub [a+%d*4], edx\n", (op >> 9) & 7); + switch (size) + { case WORD_SIZE: t = 8; break; + case LONG_SIZE: t = 6; + if (((op & 0x3f) >> 3) == 0) t += 2; /* Dn */ + else if (((op & 0x3f) >> 3) == 1) t += 2; /* An */ + else if (((op & 0x3f) >> 3) == 7 && (op & 7) == 4) + t += 2; /* # */ + break; + } + EmitTiming(TimingEA(op & 0x3f, size) + t); + InstEnd(); + return 1; +} + +int ASxMem(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned ea = op & 0x3f, dr = (op >> 8) & 1; + char mnem[4]; + char *mnem_t[] = { "ASR", "ASL" }; + + if (!CheckEA(ea, "001111111000")) return 0; + if (!NumDecodedEA(ea)) return 0; + + strcpy(mnem, mnem_t[(op >> 8) & 1]); + + InstBegin(op, mnem, NumDecodedEA(ea)); + LoadFromEA(ea, WORD_SIZE, 0); + if (dr) /* left */ + e("shl dx, byte 1\n"); + else + e("sar dx, byte 1\n"); + e("lahf\n"); + e("setc byte [x]\n"); + if (dr) /* only for left shifts, right shifts don't change the MSB */ + { + e("sets al\n"); /* AL=current MSB */ + e("adc al, byte 0\n"); /* CF contains old MSB */ + e("and al, 1\n"); /* preserve only the flag bit */ + } + WriteWord(); /* write back to mem */ + EmitTiming(base_timing + TimingEA(ea, WORD_SIZE)); + InstEnd(); + return 1; +} + +int ASxReg(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned i, size, t = 0, opr_i, count; + char mnem[4]; + char *mnem_t[] = { "ASR", "ASL" }; + + switch ((op >> 6) & 3) + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + + opr_i = (op >> 8) & 1; + strcpy(mnem, mnem_t[opr_i]); + + count = (op >> 9) & 7; + if (!count) count = 8; + + InstBegin(op, mnem, 8); /* 8 regs */ + + e("and edi, byte 7\n"); + if ((op >> 5) & 1) /* reg contains count */ + { + if (opr_i) /* ASL */ + { + e("xor al, al\n"); + SaveReg("run", "edi"); /* save EDI */ + e("mov edx, [d+edi*4]\n"); /* get reg to shift */ + e("mov edi, [d+%d*4]\n", (op >> 9) & 7); + e("and edi, byte 0x3f\n"); /* modulo 64 */ + e("jz short .zero_shift\n"); + EmitLabel(".loop"); + e("shl "); + switch (size) + { case BYTE_SIZE: e("dl, "); break; + case WORD_SIZE: e("dx, "); break; + case LONG_SIZE: e("edx, "); break; } + e("1\n"); + e("setc bl\n"); /* old MSB */ + e("sets bh\n"); /* new MSB */ + e("xor bh, bl\n"); /* detect change */ + e("or al, bh\n"); /* reflect change in V */ + e("sub ecx, byte 2\n"); /* each rotation=2 cycles */ + e("dec edi\n"); + e("jnz short .loop\n"); + RestoreReg("run", "edi"); + switch (size) /* store reg, get flags */ + { case BYTE_SIZE: e("mov [d+edi*4], dl\n"); + e("test dl, dl\n"); break; + case WORD_SIZE: e("mov [d+edi*4], dx\n"); + e("test dx, dx\n"); break; + case LONG_SIZE: e("mov [d+edi*4], edx\n"); + e("test edx, edx\n"); break; + } + e("lahf\n"); + e("or ah, bl\n"); /* CF */ + e("test bl, bl\n"); + e("setnz byte [x]\n"); /* CF==X */ + e("jmp short .end\n"); + + EmitLabel(".zero_shift"); + switch (size) + { case BYTE_SIZE: e("test dl, dl\n"); break; + case WORD_SIZE: e("test dx, dx\n"); break; + case LONG_SIZE: e("test edx, edx\n"); break; + } + e("lahf\n"); + e("xor al, al\n"); + + EmitLabel(".end"); + switch (size) + { case BYTE_SIZE: + case WORD_SIZE: t = 6; break; + case LONG_SIZE: t = 8; break; } + EmitTiming(t); + } + else /* ASR */ + { + e("mov ebx, ecx\n"); /* save ECX */ + e("mov ecx, [d+%d*4]\n", (op >> 9) & 7); + e("and ecx, byte 0x3f\n"); /* modulo 64 */ + switch (size) + { case BYTE_SIZE: e("mov dl, [d+edi*4]\n"); + e("sar dl, cl\n"); + e("setc bl\n"); + e("test dl, dl\n"); + break; + case WORD_SIZE: e("mov edx, [d+edi*4]\n"); + e("sar dx, cl\n"); + e("setc bl\n"); + e("test dx, dx\n"); + break; + case LONG_SIZE: e("mov edx, [d+edi*4]\n"); + e("sar edx, cl\n"); + e("setc bl\n"); /* get CF from SHL/SHR */ + e("test edx, edx\n");/* this trashes the CF */ + break; + } + + e("lahf\n"); + e("test cl, cl\n"); /* if shift count of 0, X is unaffected, C=0 */ + e("jz short .no_x\n"); + e("or ah, bl\n"); /* CF! */ + e("test ah, 1\n"); /* CF */ + e("setnz byte [x]\n"); + EmitLabel(".no_x"); + switch (size) /* write back and detect MSB change */ + { case BYTE_SIZE: e("mov [d+edi*4], dl\n"); + break; + case WORD_SIZE: e("mov [d+edi*4], dx\n"); + break; + case LONG_SIZE: e("mov [d+edi*4], edx\n"); + break; + } + e("xor al, al\n"); /* V=0 because MSB never changes w/ ASR */ + /* timing */ + switch (size) + { case BYTE_SIZE: + case WORD_SIZE: t = 6; break; + case LONG_SIZE: t = 8; break; } + e("shl cl, byte 1\n"); /* 2n */ + e("add cl, byte %d\n", t); + e("neg ecx\n"); + e("add ecx, ebx\n"); + e("js near Turbo68KRun_done\n"); + } + } + else /* immediate count */ + { + if (!opr_i) /* ASR */ + { + e("sar "); + switch (size) + { case BYTE_SIZE: e("byte "); break; + case WORD_SIZE: e("word "); break; + case LONG_SIZE: e("dword "); break; } + e("[d+edi*4], %d\n", count); + e("lahf\n"); + e("setc byte [x]\n"); + e("xor al, al\n"); + t = count * 2; /* 2 cycles per shift */ + } + else /* ASL */ + { + e("xor al, al\n"); /* clear V */ + switch (size) + { case BYTE_SIZE: e("mov dl, [d+edi*4]\n"); break; + case WORD_SIZE: e("mov dx, [d+edi*4]\n"); break; + case LONG_SIZE: e("mov edx, [d+edi*4]\n"); break; } + for (i = 1; i <= count; i++) + { + e("shl "); + switch (size) + { case BYTE_SIZE: e("dl, "); break; + case WORD_SIZE: e("dx, "); break; + case LONG_SIZE: e("edx, "); break; } + e("1\n"); + if (i == count) + { + e("lahf\n"); + e("setc byte [x]\n"); + } + e("setc bl\n"); /* old MSB */ + e("sets bh\n"); /* new MSB */ + e("xor bh, bl\n"); /* detect change */ + e("or al, bh\n"); /* reflect change in V */ + e("sub ecx, byte 2\n"); /* each rotation=2 cycles */ + } + switch (size) /* write results back to Dn */ + { case BYTE_SIZE: e("mov [d+edi*4], dl\n"); break; + case WORD_SIZE: e("mov [d+edi*4], dx\n"); break; + case LONG_SIZE: e("mov [d+edi*4], edx\n"); break; } + } + switch (size) + { case BYTE_SIZE: + case WORD_SIZE: t += 6; break; + case LONG_SIZE: t += 8; break; } + EmitTiming(t); + } + InstEnd(); + return 1; +} + +int ArithmeticQ(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned ea = op & 0x3f, size, t, data, opr_i; + char mnem[5]; + char *mnem_t[] = { "ADDQ", "SUBQ" }; + char *opr[] = { "add", "sub" }; + + if (!CheckEA(ea, "111111111000")) return 0; + t = base_timing; + switch ((op >> 6) & 3) + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; t += 4; break; + default: return 0; } + if ((ea >> 3) != 0 && (ea >> 3) != 1) t += 4; /* mem */ + if (size == BYTE_SIZE && (ea >> 3) == 1) /* byte An not allowed */ + return 0; + if (!NumDecodedEA(ea)) return 0; + data = (op >> 9) & 7; + if (!data) data = 8; + + strcpy(mnem, mnem_t[(op >> 8) & 1]); + opr_i = (op >> 8) & 1; + + InstBegin(op, mnem, NumDecodedEA(ea)); + if ((ea >> 3) == 0) /* Dn */ + { + e("and edi, byte 7\n"); + switch (size) + { case BYTE_SIZE: + e("%s byte [d+edi*4], %d\n", opr[opr_i], data); + break; + case WORD_SIZE: + e("%s word [d+edi*4], %d\n", opr[opr_i], data); + break; + case LONG_SIZE: + e("%s dword [d+edi*4], byte %d\n", opr[opr_i], data); + break; + } + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + } + else if ((ea >> 3) == 1) /* An */ + { + /* + * Manual says the entire address register is used despite the size + * of the operation. + */ + e("and edi, byte 7\n"); + e("%s dword [a+edi*4], byte %d\n", opr[opr_i], data); + } + else /* memory */ + { + LoadFromEA(ea, size, 0); + switch (size) + { case BYTE_SIZE: e("%s dl, byte %d\n", opr[opr_i], data); break; + case WORD_SIZE: e("%s dx, %d\n", opr[opr_i], data); break; + case LONG_SIZE: e("%s edx, byte %d\n", opr[opr_i], data); break; } + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + switch (size) + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; } + } + EmitTiming(t + TimingEA(ea, size)); + InstEnd(); + return 1; +} + +int NEGx(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned ea = op & 0x3f, size, t; + char mnem[5]; + char *mnem_t[] = { "NEGX", "NEG" }; + + if (!CheckEA(ea, "101111111000")) return 0; + if (!NumDecodedEA(ea)) return 0; + switch ((op >> 6) & 3) + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + + strcpy(mnem, mnem_t[(op >> 10) & 1]); + + InstBegin(op, mnem, NumDecodedEA(ea)); + if ((ea >> 3) == 0) /* Dn */ + { + e("and edi, byte 7\n"); + if (!(op & 0x0400)) /* NEGX */ + { + switch (size) + { case BYTE_SIZE: e("xor dl, dl\n"); break; + case WORD_SIZE: case LONG_SIZE: + e("xor edx, edx\n"); break; + } + e("shr byte [x], 1\n"); /* X->CF */ + switch (size) + { case BYTE_SIZE: e("sbb dl, [d+edi*4]\n"); + e("mov bl, ah\n"); /* store old flags */ + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + e("jnz short .clr\n"); /* Z clear */ + e("and bl, byte 0x40\n"); /* isolate old Z */ + e("and ah, byte 0xbf\n"); /* kill new Z */ + e("or ah, bl\n"); /* in w/ old Z */ + EmitLabel(".clr"); + e("mov [d+edi*4], dl\n"); t = 4; break; + case WORD_SIZE: e("sbb dx, [d+edi*4]\n"); + e("mov bl, ah\n"); + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + e("jnz short .clr\n"); + e("and bl, byte 0x40\n"); + e("and ah, byte 0xbf\n"); + e("or ah, bl\n"); + EmitLabel(".clr"); + e("mov [d+edi*4], dx\n"); t = 4; break; + case LONG_SIZE: e("sbb edx, [d+edi*4]\n"); + e("mov bl, ah\n"); + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + e("jnz short .clr\n"); + e("and bl, byte 0x40\n"); + e("and ah, byte 0xbf\n"); + e("or ah, bl\n"); + EmitLabel(".clr"); + e("mov [d+edi*4], edx\n"); t = 6; break; } + } + else /* NEG */ + { + switch (size) + { case BYTE_SIZE: e("neg byte [d+edi*4]\n"); + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + t = 4; break; + case WORD_SIZE: e("neg word [d+edi*4]\n"); + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + t = 4; break; + case LONG_SIZE: e("neg dword [d+edi*4]\n"); + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + t = 6; break; + } + } + } + else /* memory */ + { + if (!(op & 0x0400)) /* NEGX */ + { + LoadFromEA(ea, size, 0); + e("mov edi, ebx\n"); /* save address where data came from */ + switch (size) + { case BYTE_SIZE: e("xor bl, bl\n"); break; + case WORD_SIZE: case LONG_SIZE: + e("xor ebx, ebx\n"); break; + } + e("shr byte [x], 1\n"); /* X->CF */ + switch (size) + { case BYTE_SIZE: e("sbb bl, dl\n"); + e("mov dl, ah\n"); + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + e("jnz short .clr\n"); + e("and dl, byte 0x40\n"); + e("and ah, byte 0xbf\n"); + e("or ah, dl\n"); + EmitLabel(".clr"); + break; + case WORD_SIZE: e("sbb bx, dx\n"); + e("mov dl, ah\n"); + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + e("jnz short .clr\n"); + e("and dl, byte 0x40\n"); + e("and ah, byte 0xbf\n"); + e("or ah, dl\n"); + EmitLabel(".clr"); + break; + case LONG_SIZE: e("sbb ebx, edx\n"); + e("mov dl, ah\n"); + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + e("jnz short .clr\n"); + e("and dl, byte 0x40\n"); + e("and ah, byte 0xbf\n"); + e("or ah, dl\n"); + EmitLabel(".clr"); + break; } + e("mov edx, ebx\n"); + e("mov ebx, edi\n"); + /* WriteXXX will clear EDI for us */ + switch (size) + { case BYTE_SIZE: WriteByte(); t = 8; break; + case WORD_SIZE: WriteWord(); t = 8; break; + case LONG_SIZE: WriteLong(); t = 12; break; } + t += TimingEA(ea, size); + } + else /* NEG */ + { + LoadFromEA(ea, size, 0); + switch (size) + { case BYTE_SIZE: e("neg dl\n"); + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + WriteByte(); t = 8; break; + case WORD_SIZE: e("neg dx\n"); + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + WriteWord(); t = 8; break; + case LONG_SIZE: e("neg edx\n"); + e("lahf\n"); + e("seto al\n"); + e("setc byte [x]\n"); + WriteLong(); t = 12; break; } + t += TimingEA(ea, size); + } + } + EmitTiming(t); + InstEnd(); + return 1; +} + +int RTS(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 1); + e("mov ebx, [a+7*4]\n"); + ReadLong(); + e("add dword [a+7*4], byte 4\n"); + e("mov esi, edx\n"); + UpdateFetchPtr(); + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int MOVEtoSR(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned ea = op & 0x3f; + + if (!CheckEA(ea, "101111111111")) return 0; + if (!NumDecodedEA(ea)) return 0; + + InstBegin(op, mnem, NumDecodedEA(ea)); + LoadFromEA(ea, WORD_SIZE, 0); + e("test byte [sr+1], 0x20\n"); /* in supervisor? */ + e("jz near exception_privilege_violation\n"); + e("test dh, 0x20\n"); /* if still in supervisor... */ + e("jnz .still_s\n"); /* ...no changes need to be made */ + e("mov ebx, [__sp]\n"); /* swap SSP and USP */ + e("xchg [a+7*4], ebx\n"); + e("mov [__sp], ebx\n"); + SetUserAddressSpace(); /* map in user address space */ + EmitLabel(".still_s"); + e("and edx, 0xa71f\n"); /* mask out unwanted bits */ + e("mov [sr], edx\n"); /* load new SR */ + LoadCCR(); /* reload flags we changed in CCR */ + EmitTiming(base_timing + TimingEA(ea, WORD_SIZE)); + InstEnd(); + return 1; +} + +int DBcc(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned cond = (op >> 8) & 0xf; + char mnem[5]; + char *mnem_t[] = { "DBT", "DBF", "DBHI", "DBLS", + "DBCC", "DBCS", "DBNE", "DBEQ", + "DBVC", "DBVS", "DBPL", "DBMI", + "DBGE", "DBLT", "DBGT", "DBLE" }; + + strcpy(mnem, mnem_t[cond]); /* set mnemonic */ + + InstBegin(op, mnem, 8); + switch (cond) + { + /* EAX:0000000000000000 NZ00 000C 0000 000V */ + case 0: /* always true */ + e("add esi, byte 2\n"); + EmitTiming(10); + InstEnd(); + return 1; + case 1: /* DBF/DBRA: no condition to test, just loop */ + break; + case 2: /* HI: !C & !Z */ + e("test ah, byte 0x41\n"); + e("jz short .do\n"); + break; + case 3: /* LS: C | Z */ + e("test ah, byte 0x41\n"); + e("jnz short .do\n"); + break; + case 4: /* CC: !C */ + e("test ah, byte 1\n"); + e("jz short .do\n"); + break; + case 5: /* CS: C */ + e("test ah, byte 1\n"); + e("jnz short .do\n"); + break; + case 6: /* NE: !Z */ + e("test ah, byte 0x40\n"); + e("jz short .do\n"); + break; + case 7: /* EQ: Z */ + e("test ah, byte 0x40\n"); + e("jnz short .do\n"); + break; + case 8: /* VC: !V */ + e("test al, byte 1\n"); + e("jz short .do\n"); + break; + case 9: /* VS: V */ + e("test al, byte 1\n"); + e("jnz short .do\n"); + break; + case 0xa: /* PL: !N */ + e("test ah, byte 0x80\n"); + e("jz short .do\n"); + break; + case 0xb: /* MI: N */ + e("test ah, byte 0x80\n"); + e("jnz short .do\n"); + break; + case 0xc: /* GE: N & V | !N & !V (N&V || !N&!V) */ + e("mov bl, al\n"); + e("mov bh, ah\n"); + e("and bh, 0xfe\n"); + e("or bl, bh\n"); + e("test bl, byte 0x81\n"); + e("jpe short .do\n"); + break; + case 0xd: /* LT: N & !V | !N & V */ + e("mov bl, al\n"); + e("mov bh, ah\n"); + e("and bh, 0xfe\n"); + e("or bl, bh\n"); + e("test bl, byte 0x81\n"); + e("jpo short .do\n"); + EmitLabel(".dont_do"); + break; + case 0xe: /* GT: N & V & !Z | !N & !V & !Z */ + /* if Z, then it is GE and we don't take this branch */ + e("test ah, byte 0x40\n"); + e("jnz short .dont_do\n"); + e("mov bl, al\n"); + e("mov bh, ah\n"); + e("and bh, 0xfe\n"); + e("or bl, bh\n"); + e("test bl, byte 0x81\n"); + e("jpe short .do\n"); + EmitLabel(".dont_do"); + break; + case 0xf: /* LE: Z | N & !V | !N & V */ + e("test ah, 0x40\n"); + e("jnz short .do\n"); + e("mov bl, al\n"); + e("mov bh, ah\n"); + e("and bh, 0xfe\n"); + e("or bl, bh\n"); + e("test bl, byte 0x81\n"); + e("jpo short .do\n"); + break; + } + e("and edi, byte 7\n");/* condition not met, decrement and branch */ + if (cond == 1 && skip) /* idle loop skipping w/ DBRA */ + e("mov edx, esi\n"); + e("sub word [d+edi*4], 1\n"); + e("jc short .do_loop_expired\n"); /* loop expired... */ + e("movsx ebx, word [esi]\n"); + e("add esi, ebx\n"); + if (brafetch) + { + if (skip) /* skip uses EDX, we must save it */ + SaveReg("run", "edx"); + e("sub esi, ebp\n"); /* ESI=denormalized PC */ + UpdateFetchPtr(); + if (skip) + RestoreReg("run", "edx"); + } + if (cond == 1 && skip) + { + e("sub edx, byte 2\n"); /* to get address of instruction */ + e("cmp edx, esi\n"); + e("je short .skip\n"); /* the same: this is an idle loop */ + } + EmitTiming(10); + InstEnd(); + Align(4); + EmitLabel(".do"); /* condition was met, go on to next instruction */ + e("add esi, byte 2\n"); + EmitTiming(12); + InstEnd(); + Align(4); + EmitLabel(".do_loop_expired"); /* condition false, but loop expired */ + e("add esi, byte 2\n"); + EmitTiming(14); + InstEnd(); + if (cond == 1 && skip) + { + /* + * This code makes it look as if the loop was executed and expired. + */ + EmitLabel(".skip"); + e("add edx, byte 4\n"); + e("mov esi, edx\n"); /* EDX contained PC for DBRA */ + e("mov edx, [d+edi*4]\n"); /* get counter loop */ + e("and edx, 0xffff\n"); + e("inc edx\n"); /* we subtracted 1 a little ways above */ + e("mov word [d+edi*4], 0xffff\n"); + e("mov ebx, edx\n"); + e("shl edx, byte 3\n"); /* (i << 3) + (i << 2) = i*10 */ + e("shl ebx, byte 2\n"); + e("sub ecx, edx\n"); + e("sub ecx, ebx\n"); + e("js near Turbo68KRun_done\n"); + InstEnd(); + } + return 1; +} + +int MOVEM(unsigned short op, char *mnem, unsigned base_timing) +{ + /* + * If a non-post/pre-inc/decrement mode is used, the registers are + * transferred to the address, and that address is inc/decremented but the + * change is NOT reflected in the address register. + * + * If the mode is pre-dec or post-inc, it IS reflected. First, load up the + * value of the register, and then write it back and the end, but don't + * modify it while performing the operation, use a temp. X86 register + * instead. + * + * NOTE: The reg->mem mode should be fine, I've tested it -- but there + * might be some bugs. + * + * NOTE (April 8, 2001): Pete Dabbs just emailed me to report a problem + * with MOVEM mem->reg. Basically, code like this wasn't working properly: + * + * MOVEM.L (A7)+,A7 + * + * What should happen there is the data from (A7) is read. Then, 4 is added + * to A7, and finally, the data is written to A7. What Turbo68K was doing + * wrong was it was writing the data from (A7) to A7 and THEN incrementing + * A7. Not sure if the fix is correct, but I hope it is... I didn't change + * anything in MOVEM reg->mem... + */ + + int dr = (op >> 10) & 1, size = UNKNOWN_SIZE; + unsigned ea = op & 0x3f; + + switch ((op >> 6) & 1) + { case 0: size = WORD_SIZE; break; + case 1: size = LONG_SIZE; break; + default: return 0; } + if (!NumDecodedEA(ea)) return 0; + if (!dr) /* reg->mem */ + { + if (!CheckEA(ea, "001011111000")) return 0; + } + else /* mem->reg */ + if (!CheckEA(ea, "001101111011")) return 0; + + InstBegin(op, mnem, NumDecodedEA(ea)); + + if (!dr) /* reg->mem */ + { + SaveReg("run", "eax"); /* save flags */ + e("mov eax, [esi]\n"); /* AX=register list mask */ + e("add esi, byte 2\n"); + LoadControlEA(ea); /* EBX=store address */ + SaveReg("run", "esi"); + if ((ea >> 3) == 4) /* write back if (An)+,-(An) */ + SaveReg("run", "edi"); /* EDI may contain reg # */ + if ((ea >> 3) == 4) /* -(An) has reg mask reversed */ + e("mov esi, d+15*4\n"); /* start from top and decrement */ + else + e("mov esi, d\n"); + EmitLabel(".loop"); + if (size == WORD_SIZE) + e("sub ecx, byte 4\n"); + else + e("sub ecx, byte 8\n"); + e("shr eax, byte 1\n"); /* mask bit->CF */ + e("jnc short .skip\n"); /* not 1? skip this reg */ + + if ((ea >> 3) == 4) /* -(An) */ + { + if (size == WORD_SIZE) e("sub ebx, byte 2\n"); /* predec */ + else e("sub ebx, byte 4\n"); + } + + e("mov edx, [esi]\n"); /* get reg to store... */ + SaveReg("run", "ebx"); + if (size == WORD_SIZE) WriteWord(); else WriteLong(); /* get mem */ + RestoreReg("run", "ebx"); + + if (!((ea >> 3) == 4)) /* not predec, increment */ + { + if (size == WORD_SIZE) e("add ebx, byte 2\n"); + else e("add ebx, byte 4\n"); + } + + EmitLabel(".skip"); + if ((ea >> 3) == 4) /* -(An) */ + { + e("sub esi, byte 4\n"); /* next reg down */ + e("cmp esi, d-4\n"); /* done? */ + e("jne short .loop\n"); /* not done, keep looping */ + } + else + { + e("add esi, byte 4\n"); /* next reg up */ + e("cmp esi, d+16*4\n"); /* done? */ + e("jne short .loop\n"); /* not done, keep looping */ + } + + if ((ea >> 3) == 4) /* write back if -(An) */ + { + RestoreReg("run", "edi"); + e("mov [a+edi*4], ebx\n"); + } + RestoreReg("run", "esi"); + RestoreReg("run", "eax"); + + switch (ea >> 3) /* timing for address mode */ + { case 2: base_timing = 8; break; /* (An) */ + case 4: base_timing = 8; break; /* -(An) */ + case 5: base_timing = 12; break; /* (d16,An) */ + case 6: base_timing = 14; break; /* (d8,An,Xn) */ + case 7: + switch (ea & 7) + { case 0: base_timing = 12; break; /* (xxx).W */ + case 1: base_timing = 16; break; /* (xxx).L */ + } break; + } + } + else /* mem->reg */ + { + SaveReg("run", "eax"); /* save flags */ + e("mov eax, [esi]\n"); /* AX=register list mask */ + e("add esi, byte 2\n"); + LoadControlEA(ea); /* EBX=load address */ + SaveReg("run", "esi"); + if ((ea >> 3) == 3) /* write back if (An)+,-(An) */ + SaveReg("run", "edi"); /* EDI may contain reg # */ + e("mov esi, d\n"); /* start from bottom and increment */ + EmitLabel(".loop"); + if (size == WORD_SIZE) + e("sub ecx, byte 4\n"); + else + e("sub ecx, byte 8\n"); + e("shr eax, byte 1\n"); /* mask bit->CF */ + e("jnc short .skip\n"); /* not 1? skip this reg */ + + /* if word, sign extend to long */ + if (size == WORD_SIZE) + { + if ((ea >> 3) == 7 && ((ea & 7) == 2 || (ea & 7) == 3)) + pcfetch ? ReadWordSXPC() : ReadWordSX(); /* PC-relative is special */ + else + ReadWordSX(); + } + else + { + if ((ea >> 3) == 7 && ((ea & 7) == 2 || (ea & 7) == 3)) + pcfetch ? ReadLongPC() : ReadLong(); + else + ReadLong(); + } + + if (size == WORD_SIZE) e("add ebx, byte 2\n"); + else e("add ebx, byte 4\n"); + if ((ea >> 3) == 3) + { + RestoreReg("run", "edi"); + e("mov [a+edi*4], ebx\n"); + SaveReg("run", "edi"); + } + + e("mov [esi], edx\n"); /* store to reg */ + + EmitLabel(".skip"); + e("add esi, byte 4\n"); /* next reg up */ + e("cmp esi, d+16*4\n"); /* done? */ + e("jne short .loop\n"); /* not done, keep looping */ + + if ((ea >> 3) == 3) /* just in case SaveReg()/RestoreReg() use stack */ + RestoreReg("run", "edi"); + + RestoreReg("run", "esi"); + RestoreReg("run", "eax"); + + switch (ea >> 3) /* timing for address mode */ + { case 2: base_timing = 12; break; /* (An) */ + case 3: base_timing = 12; break; /* (An)+ */ + case 5: base_timing = 16; break; /* (d16,An) */ + case 6: base_timing = 18; break; /* (d8,An,Xn) */ + case 7: + switch (ea & 7) + { case 0: base_timing = 16; break; /* (xxx).W */ + case 1: base_timing = 20; break; /* (xxx).L */ + case 2: base_timing = 16; break; /* (d16,PC) */ + case 3: base_timing = 18; break; /* (d16,PC,Xn */ + } break; + } + } + + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +/* In case I screwed up MOVEM(), I have a back-up right here ;) */ + +int OldMOVEM(unsigned short op, char *mnem, unsigned base_timing) +{ + /* + * If a non-post/pre-inc/decrement mode is used, the registers are + * transferred to the address, and that address is inc/decremented but the + * change is NOT reflected in the address register. + * + * If the mode is pre-dec or post-inc, it IS reflected. First, load up the + * value of the register, and then write it back and the end, but don't + * modify it while performing the operation, use a temp. X86 register + * instead. + * + * NOTE: The reg->mem mode should be fine, I've tested it -- but there + * might be some bugs. + */ + + int dr = (op >> 10) & 1, size = UNKNOWN_SIZE; + unsigned ea = op & 0x3f; + + switch ((op >> 6) & 1) + { case 0: size = WORD_SIZE; break; + case 1: size = LONG_SIZE; break; + default: return 0; } + if (!NumDecodedEA(ea)) return 0; + if (!dr) /* reg->mem */ + { + if (!CheckEA(ea, "001011111000")) return 0; + } + else /* mem->reg */ + if (!CheckEA(ea, "001101111011")) return 0; + + InstBegin(op, mnem, NumDecodedEA(ea)); + + if (!dr) /* reg->mem */ + { + SaveReg("run", "eax"); /* save flags */ + e("mov eax, [esi]\n"); /* AX=register list mask */ + e("add esi, byte 2\n"); + LoadControlEA(ea); /* EBX=store address */ + SaveReg("run", "esi"); + if ((ea >> 3) == 4) /* write back if (An)+,-(An) */ + SaveReg("run", "edi"); /* EDI may contain reg # */ + if ((ea >> 3) == 4) /* -(An) has reg mask reversed */ + e("mov esi, d+15*4\n"); /* start from top and decrement */ + else + e("mov esi, d\n"); + EmitLabel(".loop"); + if (size == WORD_SIZE) + e("sub ecx, byte 4\n"); + else + e("sub ecx, byte 8\n"); + e("shr eax, byte 1\n"); /* mask bit->CF */ + e("jnc short .skip\n"); /* not 1? skip this reg */ + + if ((ea >> 3) == 4) /* -(An) */ + { + if (size == WORD_SIZE) e("sub ebx, byte 2\n"); /* predec */ + else e("sub ebx, byte 4\n"); + } + + e("mov edx, [esi]\n"); /* get reg to store... */ + SaveReg("run", "ebx"); + if (size == WORD_SIZE) WriteWord(); else WriteLong(); /* get mem */ + RestoreReg("run", "ebx"); + + if (!((ea >> 3) == 4)) /* not predec, increment */ + { + if (size == WORD_SIZE) e("add ebx, byte 2\n"); + else e("add ebx, byte 4\n"); + } + + EmitLabel(".skip"); + if ((ea >> 3) == 4) /* -(An) */ + { + e("sub esi, byte 4\n"); /* next reg down */ + e("cmp esi, d-4\n"); /* done? */ + e("jne short .loop\n"); /* not done, keep looping */ + } + else + { + e("add esi, byte 4\n"); /* next reg up */ + e("cmp esi, d+16*4\n"); /* done? */ + e("jne short .loop\n"); /* not done, keep looping */ + } + + if ((ea >> 3) == 4) /* write back if -(An) */ + { + RestoreReg("run", "edi"); + e("mov [a+edi*4], ebx\n"); + } + RestoreReg("run", "esi"); + RestoreReg("run", "eax"); + + switch (ea >> 3) /* timing for address mode */ + { case 2: base_timing = 8; break; /* (An) */ + case 4: base_timing = 8; break; /* -(An) */ + case 5: base_timing = 12; break; /* (d16,An) */ + case 6: base_timing = 14; break; /* (d8,An,Xn) */ + case 7: + switch (ea & 7) + { case 0: base_timing = 12; break; /* (xxx).W */ + case 1: base_timing = 16; break; /* (xxx).L */ + } break; + } + } + else /* mem->reg */ + { + SaveReg("run", "eax"); /* save flags */ + e("mov eax, [esi]\n"); /* AX=register list mask */ + e("add esi, byte 2\n"); + LoadControlEA(ea); /* EBX=load address */ + SaveReg("run", "esi"); + if ((ea >> 3) == 3) /* write back if (An)+,-(An) */ + SaveReg("run", "edi"); /* EDI may contain reg # */ + e("mov esi, d\n"); /* start from bottom and increment */ + EmitLabel(".loop"); + if (size == WORD_SIZE) + e("sub ecx, byte 4\n"); + else + e("sub ecx, byte 8\n"); + e("shr eax, byte 1\n"); /* mask bit->CF */ + e("jnc short .skip\n"); /* not 1? skip this reg */ + + /* if word, sign extend to long */ + if (size == WORD_SIZE) + { + if ((ea >> 3) == 7 && ((ea & 7) == 2 || (ea & 7) == 3)) + pcfetch ? ReadWordSXPC() : ReadWordSX(); /* PC-relative is special */ + else + ReadWordSX(); + } + else + { + if ((ea >> 3) == 7 && ((ea & 7) == 2 || (ea & 7) == 3)) + pcfetch ? ReadLongPC() : ReadLong(); + else + ReadLong(); + } + + e("mov [esi], edx\n"); /* store to reg */ + + if (size == WORD_SIZE) e("add ebx, byte 2\n"); + else e("add ebx, byte 4\n"); + + EmitLabel(".skip"); + e("add esi, byte 4\n"); /* next reg up */ + e("cmp esi, d+16*4\n"); /* done? */ + e("jne short .loop\n"); /* not done, keep looping */ + + if ((ea >> 3) == 3) /* write back if (An)+ */ + { + RestoreReg("run", "edi"); + e("mov [a+edi*4], ebx\n"); + } + RestoreReg("run", "esi"); + RestoreReg("run", "eax"); + + switch (ea >> 3) /* timing for address mode */ + { case 2: base_timing = 12; break; /* (An) */ + case 3: base_timing = 12; break; /* (An)+ */ + case 5: base_timing = 16; break; /* (d16,An) */ + case 6: base_timing = 18; break; /* (d8,An,Xn) */ + case 7: + switch (ea & 7) + { case 0: base_timing = 16; break; /* (xxx).W */ + case 1: base_timing = 20; break; /* (xxx).L */ + case 2: base_timing = 16; break; /* (d16,PC) */ + case 3: base_timing = 18; break; /* (d16,PC,Xn */ + } break; + } + } + + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int MOVEUSP(unsigned short op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 8); /* handles all 8 possible An regs */ + e("and edi, byte 7\n"); + e("test byte [sr+1], 0x20\n"); + e("jz near exception_privilege_violation\n"); + if (op & 8) /* USP->An */ + { + e("mov edx, [__sp]\n"); + e("mov [a+edi*4], edx\n"); + } + else /* An->USP */ + { + e("mov edx, [a+edi*4]\n"); + e("mov [__sp], edx\n"); + } + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int Jxx(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned t; + if (!CheckEA(op & 0x3f, "001001111011")) return 0; + if (!NumDecodedEA(op & 0x3f)) return 0; + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + LoadControlEA(op & 0x3f); + + if ((op & 0xffc0) == 0x4e80) /* JSR */ + { + e("mov edx, esi\n"); /* EDX=PC to save to stack */ + e("sub edx, ebp\n"); + SaveReg("run", "edx"); + } + + e("mov esi, ebx\n"); + UpdateFetchPtr(); + if ((op & 0xffc0) == 0x4e80) /* JSR stuff again... */ + { + RestoreReg("run", "edx"); /* remember? EDX contains PC to save */ + e("sub dword [a+7*4], byte 4\n"); /* SP - 4 -> SP */ + e("mov ebx, [a+7*4]\n"); + WriteLong(); /* PC -> (SP) */ + } + + switch ((op >> 3) & 7) /* timing based on control addressing mode */ + { case 2: t = 8; break; /* (An) */ + case 5: t = 10; break; /* (d16,An) */ + case 6: t = 14; break; /* (d8,An,Xn) */ + case 7: + switch (op & 7) + { case 0: t = 10; break; /* (xxx).W */ + case 1: t = 12; break; /* (xxx).L */ + case 2: t = 10; break; /* (d16,pc) */ + case 3: t = 14; break; /* (d8,pc,Xn) */ + } break; + } + if ((op & 0xffc0) == 0x4e80) t += 8; /* JSR */ + EmitTiming(t); + InstEnd(); + return 1; +} + +int LEA(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned t; + if (!CheckEA(op & 0x3f, "001001111011")) return 0; + if (!NumDecodedEA(op & 0x3f)) return 0; + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + LoadControlEA(op & 0x3f); + e("mov [a+%d*4], ebx\n", (op >> 9) & 7); + switch ((op >> 3) & 7) /* timing based on control addressing mode */ + { case 2: t = 4; break; /* (An) */ + case 5: t = 8; break; /* (d16,An) */ + case 6: t = 12; break; /* (d8,An,Xn) */ + case 7: + switch (op & 7) + { case 0: t = 8; break; /* (xxx).W */ + case 1: t = 12; break; /* (xxx).L */ + case 2: t = 8; break; /* (d16,pc) */ + case 3: t = 12; break; /* (d8,pc,Xn) */ + } break; + } + EmitTiming(t); + InstEnd(); + return 1; +} + +int BTST(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned t; + + if (((op >> 6) & 7) != 4 && ((op >> 6) & 7) != 0) return 0; + if (op & 0x100) /* dynamic */ + { + if (!CheckEA(op & 0x3f, "101111111111")) return 0; + if (!NumDecodedEA(op & 0x3f)) return 0; + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + if (((op >> 3) & 7) == 0) /* Dn is long */ + { + t = 6; + e("and edi, byte 7\n"); + e("mov ebx, [d+%d*4]\n", (op >> 9) & 7); /* bit # */ + e("and ebx, byte 31\n"); /* same as modulo 32 */ + e("bt dword [d+edi*4], ebx\n"); /* bit->CF */ + } + else /* mem is byte */ + { + t = 4; + LoadFromEA(op & 0x3f, BYTE_SIZE, 0); + e("mov ebx, [d+%d*4]\n", (op >> 9) & 7); /* bit # */ + e("and ebx, byte 7\n"); /* same as modulo 8 */ + e("bt edx, ebx\n"); /* bit->CF */ + } + } + else if (!(op & 0x100)) /* static */ + { + if (!CheckEA(op & 0x3f, "101111111011")) return 0; + if (!NumDecodedEA(op & 0x3f)) return 0; + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + if (((op >> 3) & 7) == 0) /* Dn is long */ + { + t = 10; + e("and edi, byte 7\n"); /* isolate Dn reg # */ + e("mov ebx, [esi]\n"); /* get bit # */ + e("and ebx, byte 31\n"); /* same as modulo 32 */ + e("add esi, byte 2\n"); + e("bt dword [d+edi*4], ebx\n"); /* bit->CF */ + } + else /* mem is byte */ + { + t = 8; + e("mov ebx, [esi]\n"); /* get bit # */ + e("and ebx, byte 7\n"); /* same as modulo 8 */ + e("add esi, byte 2\n"); + SaveReg("run", "ebx"); + LoadFromEA(op & 0x3f, BYTE_SIZE, 0); + RestoreReg("run", "ebx"); + e("bt edx, ebx\n"); /* bit->CF */ + } + } + e("setnc bl\n"); /* zero status of C->DH */ + e("and ah, 0xbf\n"); /* get rid of old Z */ + e("shl bl, 6\n"); /* put C in Z position */ + e("or ah, bl\n"); /* set the new Z */ + + if (((op & 0x3f) & 7) == 0) /* Dn is long */ + EmitTiming(t); + else /* mem is byte */ + EmitTiming(t + TimingEA(op & 0x3f, BYTE_SIZE)); + InstEnd(); + return 1; +} + +int TST(unsigned short op, char *mnem, unsigned base_timing) +{ + int size; + + switch ((op >> 6) & 3) /* set valid sizes */ + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + if (!NumDecodedEA(op & 0x3f)) /* check if decoded this EA */ + return 0; + if (!CheckEA(op & 0x3f, "101111111000")) + return 0; /* no An,#dat,(d16,pc),(d8,pc,Xn) for 68000 */ + + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + if (((op & 0x3f) >> 3) == 0) /* Dn shortcut */ + { + e("and edi, byte 7\n"); + e("mov edx, [d+edi*4]\n"); + if (size == BYTE_SIZE) + e("test dl, dl\n"); + else if (size == WORD_SIZE) + e("test dx, dx\n"); + else if (size == LONG_SIZE) + e("test edx, edx\n"); + } + else + { + LoadFromEA(op & 0x3f, size, 0); + if (size == BYTE_SIZE) + e("test dl, dl\n"); + else if (size == WORD_SIZE) + e("test dx, dx\n"); + else if (size == LONG_SIZE) + e("test edx, edx\n"); + } + e("lahf\n"); + e("xor al, al\n"); + EmitTiming(base_timing + TimingEA(op & 0x3f, size)); + InstEnd(); + return 1; +} + +int Bxx(unsigned short op, char *mnem, unsigned base_timing) +{ + if ((op & 0xff) != 0 && (op & 0xff) != 1) + return 0; + switch (op & 0xff) + { case 0: InstBegin(op, mnem, 1); break; + case 1: InstBegin(op, mnem, 255); break; + break; } + switch (op & 0xff) + { + case 0: /* 16-bit displacement */ + if ((op & 0xff00) == 0x6100) + { + e("mov edx, 2\n"); + e("add edx, esi\n"); + } + e("movsx ebx, word [esi]\n"); + e("add esi, ebx\n"); + break; + case 1: /* 8-bit displacement -- XX01-XXFF */ + if ((op & 0xff00) == 0x6100) + e("mov edx, esi\n"); + e("and edi, 0xff\n"); + e("mov ebx, edi\n"); + e("movsx ebx, bl\n"); + e("add esi, ebx\n"); + break; + } + if (brafetch) + { + e("sub esi, ebp\n"); /* ESI=denormalized PC */ + if ((op & 0xff00) == 0x6100) /* if BSR, save EDX */ + SaveReg("run", "edx"); + UpdateFetchPtr(); + if ((op & 0xff00) == 0x6100) + RestoreReg("run", "edx"); + } + if ((op & 0xff00) == 0x6100) /* BSR */ + { + e("sub dword [a+7*4], byte 4\n"); /* SP - 4 -> SP */ + e("sub edx, ebp\n"); /* EDX=PC of next instruction */ + e("mov ebx, [a+7*4]\n"); + WriteLong(); /* PC -> (SP) */ + } + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int Bcc(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned cond = (op >> 8) & 0xf; + char mnem[4]; + char *mnem_t[] = { NULL, NULL, "BHI", "BLS", + "BCC", "BCS", "BNE", "BEQ", + "BVC", "BVS", "BPL", "BMI", + "BGE", "BLT", "BGT", "BLE" }; + + if (!cond || cond == 1) return 0; /* these not available for Bcc */ + strcpy(mnem, mnem_t[cond]); /* set mnemonic */ + + switch (op & 0xff) + { + case 0: /* 16-bit displacement */ + InstBegin(op, mnem, 1); break; + case 1: /* 8-bit displacement -- XX01-XXFE */ + InstBegin(op, mnem, 255); break; + default: + return 0; + } + + switch (cond) + { + /* EAX:0000000000000000 NZ00 000C 0000 000V */ + case 2: /* HI: !C & !Z */ + e("test ah, byte 0x41\n"); + e("jz short .do\n"); + break; + case 3: /* LS: C | Z */ + e("test ah, byte 0x41\n"); + e("jnz short .do\n"); + break; + case 4: /* CC: !C */ + e("test ah, byte 1\n"); + e("jz short .do\n"); + break; + case 5: /* CS: C */ + e("test ah, byte 1\n"); + e("jnz short .do\n"); + break; + case 6: /* NE: !Z */ + e("test ah, byte 0x40\n"); + e("jz short .do\n"); + break; + case 7: /* EQ: Z */ + e("test ah, byte 0x40\n"); + e("jnz short .do\n"); + break; + case 8: /* VC: !V */ + e("test al, byte 1\n"); + e("jz short .do\n"); + break; + case 9: /* VS: V */ + e("test al, byte 1\n"); + e("jnz short .do\n"); + break; + case 0xa: /* PL: !N */ + e("test ah, byte 0x80\n"); + e("jz short .do\n"); + break; + case 0xb: /* MI: N */ + e("test ah, byte 0x80\n"); + e("jnz short .do\n"); + break; + case 0xc: /* GE: N & V | !N & !V (N&V || !N&!V) */ + e("mov bl, al\n"); + e("mov bh, ah\n"); + e("and bh, 0xfe\n"); + e("or bl, bh\n"); + e("test bl, byte 0x81\n"); + e("jpe short .do\n"); + break; + case 0xd: /* LT: N & !V | !N & V */ + e("mov bl, al\n"); + e("mov bh, ah\n"); + e("and bh, 0xfe\n"); + e("or bl, bh\n"); + e("test bl, byte 0x81\n"); + e("jpo short .do\n"); + EmitLabel(".dont_do"); + break; + case 0xe: /* GT: N & V & !Z | !N & !V & !Z */ + /* if Z, then it is GE and we don't take this branch */ + e("test ah, byte 0x40\n"); + e("jnz short .dont_do\n"); + e("mov bl, al\n"); + e("mov bh, ah\n"); + e("and bh, 0xfe\n"); + e("or bl, bh\n"); + e("test bl, byte 0x81\n"); + e("jpe short .do\n"); + EmitLabel(".dont_do"); + break; + case 0xf: /* LE: Z | N & !V | !N & V */ + e("test ah, 0x40\n"); + e("jnz short .do\n"); + e("mov bl, al\n"); + e("mov bh, ah\n"); + e("and bh, 0xfe\n"); + e("or bl, bh\n"); + e("test bl, byte 0x81\n"); + e("jpo short .do\n"); + break; + } + + /* branch not taken */ + switch (op & 0xff) /* look at this to figure out timing and increment */ + { + case 0: /* 16-bit */ + e("add esi, byte 2\n"); EmitTiming(12); break; + case 1: /* 8-bit */ + EmitTiming(8); break; + } + InstEnd(); + Align(4); + EmitLabel(".do"); + switch (op & 0xff) + { + case 0: /* 16-bit */ + e("movsx ebx, word [esi]\n"); + e("add esi, ebx\n"); + break; + case 1: /* 8-bit */ + e("and edi, 0xff\n"); + e("mov ebx, edi\n"); + e("movsx ebx, bl\n"); + e("add esi, ebx\n"); + break; + } + if (brafetch) + { + e("sub esi, ebp\n"); /* ESI=denormalized PC */ + UpdateFetchPtr(); + } + EmitTiming(10); + InstEnd(); + return 1; +} + +int Arithmetic(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned t, ea = op & 0x3f, opr_code = (op >> 12), + opmode = (op >> 6) & 7; + int size = UNKNOWN_SIZE; + char mnem[4]; + char opr[4], *size_s[] = { "byte", "word", "dword" }, + *edx[] = { "dl", "dx", "edx" }; + + if (opmode & 4) /* EA == destination */ + { + switch (opr_code) + { + case 8: /* OR */ + case 9: /* SUB */ + case 0xc: /* AND */ + case 0xd: if (!CheckEA(ea, "001111111000")) return 0; /* ADD */ + break; + case 0xb: if (!CheckEA(ea, "101111111000")) return 0; /* EOR */ + break; + default: return 0; } + } + else /* EA == source */ + { + switch (opr_code) + { + case 0xd: /* ADD */ + case 0xb: /* CMP */ + case 9: if (!CheckEA(ea, "111111111111")) return 0; /* SUB */ + if ((ea >> 3) == 1 && (opmode & 3) == 0) + return 0; /* byte access to An not allowed! */ + break; + case 8: /* OR */ + case 0xc: if (!CheckEA(ea, "101111111111")) return 0; /* AND */ + break; + default: return 0; } + } + if (!NumDecodedEA(ea)) /* check if decoded this EA */ + return 0; + switch (opmode & 3) /* set allowed sizes */ + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + switch (opr_code) /* timing */ + { + case 0xd: /* ADD */ + case 9: /* SUB */ + if (size == BYTE_SIZE || size == WORD_SIZE) + { + if ((ea >> 3) == 1) t = 8; + else if ((ea >> 3) == 0) t = 4; + else t = 8; + } + else + { + if ((ea >> 3) == 1) t = 6; + else if ((ea >> 3) == 0) t = 6; + else t = 12; + if ((ea >> 3) == 0 || (ea >> 3) == 1 || ea == 0x3c) + t += 2; /* if reg direct or immediate, timing of 6 is + increased to 8 */ + } break; + case 0xb: + if (!(opmode & 4)) /* CMP */ + { + if (size == BYTE_SIZE || size == WORD_SIZE) + { + if ((ea >> 3) == 1) t = 6; + else if ((ea >> 3) == 0) t = 4; + } + else + { + if ((ea >> 3) == 1) t = 6; + else if ((ea >> 3) == 0) t = 6; + } + } + else /* EOR */ + { + if (size == BYTE_SIZE || size == WORD_SIZE) + { + if ((ea >> 3) == 0) t = 4; + else t = 8; + } + else + { + if ((ea >> 3) == 0) t = 8; + else t = 12; + } break; + } + case 0xc: /* AND */ + if (size == BYTE_SIZE || size == WORD_SIZE) + { + if ((ea >> 3) == 0) t = 4; + else t = 8; + } + else + { + if ((ea >> 3) == 0) t = 6; + else t = 12; + if ((ea >> 3) == 0 || (ea >> 3) == 1 || ea == 0x3c) + t += 2; /* if reg direct or immediate, timing of 6 is + increased to 8 */ + } break; + case 0x8: /* OR */ + if (size == BYTE_SIZE || size == WORD_SIZE) + { + if ((ea >> 3) == 0) t = 4; + else t = 8; + } + else + { + if ((ea >> 3) == 0) t = 6; + else t = 12; + if ((ea >> 3) == 0 || (ea >> 3) == 1 || ea == 0x3c) + t += 2; /* if reg direct or immediate, timing of 6 is + increased to 8 */ + } break; + } + /* set mnem and opr */ + switch (opr_code) + { case 0xd: strcpy(mnem, "ADD"); strcpy(opr, "add"); break; + case 0xc: strcpy(mnem, "AND"); strcpy(opr, "and"); break; + case 0xb: + if (opmode & 4) { strcpy(mnem, "EOR"); strcpy(opr, "xor"); } + else { strcpy(mnem, "CMP"); strcpy(opr, "cmp"); } + break; + case 8: strcpy(mnem, "OR"); strcpy(opr, "or"); break; + case 9: strcpy(mnem, "SUB"); strcpy(opr, "sub"); break; + default: return 0; + } + + + InstBegin(op, mnem, NumDecodedEA(ea)); + if (opmode & 4) /* op Dn,ea */ + { + if ((ea >> 3) == 0 || (ea >> 3) == 1) /* Dn, An shortcut */ + { + char r[2] = { 'd', 'a' }; + int i = ea >> 3; + + e("and edi, byte 7\n"); + e("mov edx, [d+(%d*4)]\n", (op >> 9) & 7); + e("%s %s [%c+(edi*4)], %s\n", opr, size_s[opmode & 3], r[i], + edx[opmode & 3]); + e("lahf\n"); + switch ((op >> 12) & 0xf) /* flags calculations */ + { case 0xc: e("xor al, al\n"); break; /* AND */ + case 0xd: e("setc byte [x]\n"); + e("seto al\n"); break; /* ADD */ + case 0xb: + if (opmode & 4) e("xor al, al\n"); /* EOR */ + else e("seto al\n"); /* CMP */ + break; + case 8: e("xor al, al\n"); break; /* OR */ + case 9: e("setc byte [x]\n"); + e("seto al\n"); break; /* SUB */ } + } + else + { + LoadFromEA(ea, size, 0); + e("%s %s, [d+(%d*4)]\n", opr, edx[opmode & 3], (op >> 9) & 7); + e("lahf\n"); + switch ((op >> 12) & 0xf) /* flags calculations */ + { case 0xc: e("xor al, al\n"); break; /* AND */ + case 0xd: e("setc byte [x]\n"); + e("seto al\n"); break; /* ADD */ + case 0xb: + if (opmode & 4) e("xor al, al\n"); /* EOR */ + else e("seto al\n"); /* CMP */ + break; + case 8: e("xor al, al\n"); break; /* OR */ + case 9: e("setc byte [x]\n"); + e("seto al\n"); break; /* SUB */ } + + if(!(((op >> 12) & 0xf) == 0xb && !(opmode & 4))) // don't write if CMP + { + switch (size) + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; + } + } + else + { + e("xor edi, edi\n"); // the write functions normally handle this + } + } + } + else /* op ea,Dn */ + { + LoadFromEA(ea, size, 0); + e("%s [d+(%d*4)], %s\n", opr, (op >> 9) & 7, edx[opmode & 3]); + e("lahf\n"); + switch ((op >> 12) & 0xf) /* flags calculations */ + { case 0xc: e("xor al, al\n"); break; /* AND */ + case 0xd: e("setc byte [x]\n"); + e("seto al\n"); break; /* ADD */ + case 0xb: + if (opmode & 4) e("xor al, al\n"); /* EOR */ + else e("seto al\n"); /* CMP */ + break; + case 8: e("xor al, al\n"); break; /* OR */ + case 9: e("setc byte [x]\n"); + e("seto al\n"); break; /* SUB */ } + } + + EmitTiming(t); + InstEnd(); + return 1; +} + +int ArithmeticI(unsigned short op, char *mnem_unused, unsigned base_timing) +{ + unsigned t = base_timing, ea = op & 0x3f; /* base_timing = 8 */ + int size = UNKNOWN_SIZE; + char mnem[5]; + char opr[5], *size_s[] = { "byte", "word", "dword" }, + *edx[] = { "dl", "dx", "edx" }; + + if (!CheckEA(ea, "101111111000")) + return 0; + if (!NumDecodedEA(ea)) /* check if decoded this EA */ + return 0; + switch ((op >> 6) & 3) /* set allowed sizes */ + { case 0: size = BYTE_SIZE; break; + case 1: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + switch ((op >> 8) & 0xf) /* set operation, mnem */ + { case 2: strcpy(mnem, "ANDI"); strcpy(opr, "and"); break; + case 6: strcpy(mnem, "ADDI"); strcpy(opr, "add"); break; + case 0xc: strcpy(mnem, "CMPI"); strcpy(opr, "cmp"); break; + case 0xa: strcpy(mnem, "EORI"); strcpy(opr, "xor"); break; + case 0: strcpy(mnem, "ORI"); strcpy(opr, "or"); break; + case 4: strcpy(mnem, "SUBI"); strcpy(opr, "sub"); break; + default: return 0; } + /* all but CMPI,ANDI take 8+8 cycles for long sizes */ + if (((op >> 8) & 0xf) != 0xc && ((op >> 8) & 0xf) != 2 && size == LONG_SIZE) + t += 8; + else if (((op >> 8) & 0xf) == 0xc) t += 6; + + InstBegin(op, mnem, NumDecodedEA(ea)); + if (((ea >> 3) & 7) == 0) /* Dn is treated differently */ + { + e("and edi, byte 7\n");/* get reg # */ + e("mov edx, [esi]\n"); /* get imm data */ + if (size == LONG_SIZE) + e("ror edx, byte 16\n"); /* prep. the long-word */ + e("%s %s [d+edi*4], %s\n", opr, size_s[(op >> 6) & 3], edx[(op >> 6) & 3]); + e("lahf\n"); + switch ((op >> 8) & 0xf) /* flags calculations */ + { case 2: e("xor al, al\n"); break; /* ANDI */ + case 6: e("setc byte [x]\n"); + e("seto al\n"); break; /* ADDI */ + case 0xc: e("seto al\n"); break; /* CMPI */ + case 0xa: e("xor al, al\n"); break; /* EORI */ + case 0: e("xor al, al\n"); break; /* ORI */ + case 4: e("setc byte [x]\n"); + e("seto al\n"); break; /* SUBI */ } + if (size != LONG_SIZE) + e("add esi, byte 2\n"); + else + e("add esi, byte 4\n"); + } + else + { + SaveReg("run", "esi"); /* address of immediate data */ + switch (size) /* make ESI point to EA data */ + { case BYTE_SIZE: + case WORD_SIZE: e("add esi, byte 2\n"); break; + case LONG_SIZE: e("add esi, byte 4\n"); break; + } + LoadFromEA(ea, size, 0); + RestoreRegTo("run", "esi", "edi"); /* EDI=address of immediate data */ + /* if byte or word, perform operation directly from memory */ + if (size == BYTE_SIZE || size == WORD_SIZE) + { + e("%s %s, [edi]\n", opr, edx[(op >> 6) & 3]); + e("lahf\n"); + switch ((op >> 8) & 0xf) /* flags calculations */ + { case 2: e("xor al, al\n"); break; /* ANDI */ + case 6: e("setc byte [x]\n"); + e("seto al\n"); break; /* ADDI */ + case 0xc: e("seto al\n"); break; /* CMPI */ + case 0xa: e("xor al, al\n"); break; /* EORI */ + case 0: e("xor al, al\n"); break; /* ORI */ + case 4: e("setc byte [x]\n"); + e("seto al\n"); break; /* SUBI */ } + } + else /* long */ + { + e("mov edi, [edi]\n"); + e("ror edi, byte 16\n"); /* word-swap long-words... */ + e("%s %s, edi\n", opr, edx[(op >> 6) & 3]); + e("lahf\n"); + switch ((op >> 8) & 0xf) /* flags calculations */ + { case 2: e("xor al, al\n"); break; /* ANDI */ + case 6: e("setc byte [x]\n"); + e("seto al\n"); break; /* ADDI */ + case 0xc: e("seto al\n"); break; /* CMPI */ + case 0xa: e("xor al, al\n"); break; /* EORI */ + case 0: e("xor al, al\n"); break; /* ORI */ + case 4: e("setc byte [x]\n"); + e("seto al\n"); break; /* SUBI */ } + } + + if(((op >> 8) & 0x0F) != 0x0C) + { + switch (size) /* write back to mem */ + { case BYTE_SIZE: WriteByte(); break; + case WORD_SIZE: WriteWord(); break; + case LONG_SIZE: WriteLong(); break; + } + } + else + { + e("xor edi, edi\n"); + } + + } + EmitTiming(t + TimingEA(ea, size)); + InstEnd(); + return 1; +} + + +int MOVE(unsigned short op, char *mnem, unsigned base_timing) +{ + unsigned src = op & 0x3f, dest = (op >> 6) & 0x3f; + int size = UNKNOWN_SIZE; + + dest = ((dest & 0x7) << 3) | ((dest >> 3) & 0x7); + if (!CheckEA(src, "111111111111") || !CheckEA(dest, "101111111000")) + return 0; + if (!NumDecodedEA(src)) /* check if decoded this source EA */ + return 0; + switch ((op >> 12) & 3) /* set allowed sizes */ + { case 1: size = BYTE_SIZE; break; + case 3: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + if (size == BYTE_SIZE && ((src >> 3) & 7) == 1) + return 0; /* no An byte accesses allowed */ + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + LoadFromEA(src, size, 0); + switch (size) + { case BYTE_SIZE: e("test dl, dl\n"); break; + case WORD_SIZE: e("test dx, dx\n"); break; + case LONG_SIZE: e("test edx, edx\n"); break; } + e("lahf\n"); + e("xor al, al\n"); /* V=always cleared */ + if (src == dest) + StoreToEA(dest, size, 1); + else + StoreToEA(dest, size, 0); + EmitTiming(base_timing + TimingEA(src, size) + TimingEA(dest, size)); + InstEnd(); + return 1; +} + +int MOVEQ(unsigned op, char *mnem, unsigned base_timing) +{ + InstBegin(op, mnem, 256); /* 256 possible immediate data combinations */ + e("mov ebx, edi\n"); /* opcode is in edi */ + e("movsx ebx, bl\n"); /* sign extend */ + e("mov [d+%d*4], ebx\n", (op >> 9) & 7); + e("test bl, bl\n"); /* set N,Z,C appropriately */ + e("lahf\n"); /* get changes */ + e("xor al, al\n"); /* V is cleared */ + EmitTiming(base_timing); + InstEnd(); + return 1; +} + +int MOVEA(unsigned short op, char *mnem, unsigned base_timing) +{ + int size = UNKNOWN_SIZE; + + if (!CheckEA(op & 0x3f, "111111111111")) /* check EA mode */ + return 0; + if (!NumDecodedEA(op & 0x3f)) /* check if decoded this EA */ + return 0; + switch ((op >> 12) & 3) /* set allowed sizes */ + { case 3: size = WORD_SIZE; break; + case 2: size = LONG_SIZE; break; + default: return 0; } + + InstBegin(op, mnem, NumDecodedEA(op & 0x3f)); + LoadFromEA(op & 0x3f, size, 1); /* load */ + e("mov [a+%d*4], edx\n", (op >> 9) & 7); /* store */ + EmitTiming(TimingEA(op & 0x3f, size) + base_timing); + InstEnd(); + return 1; +} + + +/***************************************************************************** +* Instruction Emission */ + +void EmitInstructions() +{ + unsigned i, j, k, l, n; + + /* TST */ + n = 0; + for (i = 0; i <= 2; i++) + for (j = 0; j <= 0x3f; j++) + n += TST((i << 6) + j + 0x4a00, "TST", 4); + printf("TST:\t\t%d\n", n); + + /* Bcc */ + n = 0; + for (i = 0; i <= 0xf; i++) + for (j = 0; j < 0xff; j++) + n += Bcc((i << 8) + j + 0x6000, "B??", 0); + printf("Bcc:\t\t%d\n", n); + + /* MOVE */ + n = 0; + for (i = 1; i <= 3; i++) /* size */ + for (j = 0; j <= 0x3f; j++) /* dest. EA */ + for (k = 0; k <= 0x3f; k++) /* source EA */ + n += MOVE((i << 12) + (j << 6) + k + 0x0000, "MOVE", 4); + printf("MOVE:\t\t%d\n", n); + + /* ADD, AND, CMP, EOR, OR, SUB -- "Arithmetic" */ + n = 0; + for (i = 8; i <= 0xd; i++) /* operation */ + for (j = 0; j <= 7; j++) /* Dn */ + for (k = 0; k <= 6; k++) /* opmode */ + for (l = 0; l <= 0x3f; l++) /* EA */ + n += Arithmetic((i << 12) + (j << 9) + (k << 6) + l, "????", 0); + printf("ADD, AND, CMP, EOR, OR, SUB: %d\n", n); + + /* ADDI, ANDI, CMPI, EORI, ORI, SUBI -- "ArithmeticI" */ + n = 0; + for (i = 0; i <= 0xc; i++) /* operation */ + for (j = 0; j <= 2; j++) /* size */ + for (k = 0; k <= 0x3f; k++) /* EA */ + n += ArithmeticI((i << 8) + (j << 6) + k + 0x0000, "????I", 8); + printf("ADDI, ANDI, CMPI, EORI, ORI, SUBI: %d\n", n); + + /* DBcc */ + n = 0; + for (i = 0; i <= 0xf; i++) /* condition */ + n += DBcc((i << 8) + 0x50c8, "DB??", 0); + printf("DBcc:\t\t%d\n", n); + + /* BTST */ + n = 0; + for (i = 0; i <= 7; i++) /* register */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += BTST((i << 9) + j + 0x0100, "BTST", 0); + for (i = 0; i <= 0x3f; i++) /* EA */ + n += BTST(i + 0x0800, "BTST", 0); + printf("BTST:\t\t%d\n", n); + + /* ADDQ, SUBQ -- "ArithmeticQ" */ + n = 0; + for (i = 0; i <= 7; i++) /* data */ + for (j = 0; j <= 1; j++) /* ADDQ/SUBQ */ + for (k = 0; k <= 2; k++) /* size */ + for (l = 0; l <= 0x3f; l++) /* EA */ + n += ArithmeticQ((i << 9) + (j << 8) + (k << 6) + l + 0x5000, "???Q", 4); + printf("ADDQ, SUBQ:\t%d\n", n); + + /* BRA */ + n = 0; + for (i = 0; i <= 0xff; i++) + n += Bxx(i + 0x6000, "BRA", 10); + printf("BRA:\t\t%d\n", n); + + /* LEA */ + n = 0; + for (i = 0; i <= 7; i++) /* register */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += LEA((i << 9) + 0x41c0 + j, "LEA", 0); + printf("LEA:\t\t%d\n", n); + + /* RTS */ + RTS(0x4e75, "RTS", 16); + printf("RTS:\t\t1\n"); + + /* MOVEA */ + n = 0; + for (i = 2; i <= 3; i++) /* size */ + for (j = 0; j <= 7; j++) /* dest. reg */ + for (k = 0; k <= 0x3f; k++) /* source EA */ + n += MOVEA((i << 12) + (j << 9) + k + 0x0040, "MOVEA", 4); + printf("MOVEA:\t\t%d\n", n); + + /* ADDA */ + n = 0; + for (i = 3; i <= 7; i++) /* size */ + for (j = 0; j <= 7; j++) /* dest. reg */ + for (k = 0; k <= 0x3f; k++) /* source EA */ + n += ArithmeticA((i << 6) + (j << 9) + k + 0xd000, "ADDA", 4); + printf("ADDA:\t\t%d\n", n); + + /* MOVEQ */ + n = 0; + for (i = 0; i < 8; i++) + n += MOVEQ((i << 9) + 0x7000, "MOVEQ", 4); + printf("MOVEQ:\t\t%d\n", n); + + /* JSR */ + n = 0; + for (i = 0; i <= 0x3f; i++) /* register */ + n += Jxx(i + 0x4e80, "JSR", 0); + printf("JSR:\t\t%d\n", n); + + /* LSL, LSR */ + n = 0; + for (i = 0; i <= 7; i++) /* count/register */ + for (j = 0; j <= 1; j++) /* direction */ + for (k = 0; k <= 2; k++) /* size */ + for (l = 0; l <= 1; l++) /* immediate/reg */ + n += LSxReg((i << 9) + (j << 8) + (k << 6) + (l << 5) + 0xe008, "LS?", 0); + for (i = 0; i <= 1; i++) /* direction */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += LSxMem((i << 8) + j + 0xe2c0, "LS?", 8); + printf("LSL, LSR:\t%d\n", n); + + /* SWAP */ + SWAP(0x4840, "SWAP", 4); + printf("SWAP:\t\t1\n"); + + /* BSR */ + n = 0; + for (i = 0; i <= 0xff; i++) + n += Bxx(i + 0x6100, "BSR", 18); + printf("BSR:\t\t%d\n", n); + + /* EXT */ + n = 0; + for (i = 2; i <= 7; i++) + n += EXT((i << 6) + 0x4800, "EXT", 4); + printf("EXT:\t\t%d\n", n); + + /* CLR */ + n = 0; + for (i = 0; i <= 2; i++) /* size */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += CLR((i << 6) + j + 0x4200, "CLR", 0); + printf("CLR:\t\t%d\n", n); + + /* MOVEM */ + n = 0; + for (i = 0; i <= 1; i++) /* direction */ + for (j = 0; j <= 1; j++) /* size */ + for (k = 0; k <= 0x3f; k++) /* EA */ + n += MOVEM((i << 10) + (j << 6) + k + 0x4880, "MOVEM", 0); + printf("MOVEM:\t\t%d\n", n); + + /* MOVE to SR */ + n = 0; + for (i = 0; i <= 0x3f; i++) + n += MOVEtoSR(i + 0x46c0, "MOVE to SR", 12); + printf("MOVE to SR:\t%d\n", n); + + /* NOP */ + NOP(0x4e71, "NOP", 4); + printf("NOP:\t\t1\n"); + + /* JMP */ + n = 0; + for (i = 0; i <= 0x3f; i++) /* register */ + n += Jxx(i + 0x4ec0, "JMP", 0); + printf("JMP:\t\t%d\n", n); + + /* CMPA */ + n = 0; + for (i = 0; i <= 7; i++) /* register */ + for (j = 3; j <= 7; j++) /* opmode */ + for (k = 0; k <= 0x3f; k++) /* EA */ + n += CMPA((i << 9) + (j << 6) + k + 0xb000, "CMPA", 0); + printf("CMPA:\t\t%d\n", n); + + /* ASL, ASR */ + n = 0; + for (i = 0; i <= 7; i++) /* count/reg */ + for (j = 0; j <= 1; j++) /* direction */ + for (k = 0; k <= 2; k++) /* size */ + for (l = 0; l <= 1; l++) /* immediate/reg */ + n += ASxReg((i << 9) + (j << 8) + (k << 6) + (l << 5) + 0xe000, "AS?", 0); + for (i = 0; i <= 1; i++) /* direction */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += ASxMem((i << 8) + j + 0xe0c0, "AS?", 8); + printf("ASL, ASR:\t%d\n", n); + + /* MULS */ + n = 0; + for (i = 0; i <= 7; i++) /* register */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += MULS((i << 9) + j + 0xc1c0, "MULS", 70); + printf("MULS:\t\t%d\n", n); + + /* RTE */ + RTE(0x4e73, "RTE", 20); + printf("RTE:\t\t1\n"); + + /* NEG, NEGX */ + n = 0; + for (i = 0; i <= 1; i++) /* NEG/NEGX */ + for (j = 0; j <= 2; j++) /* size */ + for (k = 0; k <= 0x3f; k++) /* EA */ + n += NEGx((i << 10) + (j << 6) + k + 0x4000, "NEG?", 0); + printf("NEG, NEGX:\t%d\n", n); + + /* ROL, ROR */ + n = 0; + for (i = 0; i <= 7; i++) /* count/register */ + for (j = 0; j <= 1; j++) /* direction */ + for (k = 0; k <= 2; k++) /* size */ + for (l = 0; l <= 1; l++) /* immediate/reg */ + n += ROxReg((i << 9) + (j << 8) + (k << 6) + (l << 5) + 0xe018, "RO?", 0); + for (i = 0; i <= 1; i++) /* direction */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += ROxMem((i << 8) + j + 0xe6c0, "RO?", 8); + printf("ROL, ROR:\t%d\n", n); + + /* BCLR */ + n = 0; + for (i = 0; i <= 7; i++) /* register */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += BCLR((i << 9) + j + 0x0180, "BCLR", 0); + for (i = 0; i <= 0x3f; i++) /* EA */ + n += BCLR(i + 0x0880, "BCLR", 0); + printf("BCLR:\t\t%d\n", n); + + /* NOT */ + n = 0; + for (i = 0; i <= 2; i++) + for (j = 0; j <= 0x3f; j++) + n += NOT((i << 6) + j + 0x4600, "NOT", 0); + printf("NOT:\t\t%d\n", n); + + /* MOVE USP */ + n = 0; + for (i = 0; i <= 1; i++) + n += MOVEUSP((i << 3) + 0x4e60, "MOVE USP", 4); + printf("MOVE USP:\t%d\n", n); + + /* ROXL, ROXR */ + n = 0; + for (i = 0; i <= 7; i++) /* count/register */ + for (j = 0; j <= 1; j++) /* direction */ + for (k = 0; k <= 2; k++) /* size */ + for (l = 0; l <= 1; l++) /* immediate/reg */ + n += ROXxReg((i << 9) + (j << 8) + (k << 6) + (l << 5) + 0xe010, "ROX?", 0); + for (i = 0; i <= 1; i++) /* direction */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += ROXxMem((i << 8) + j + 0xe4c0, "ROX?", 8); + printf("ROXL, ROXR:\t%d\n", n); + + /* BSET */ + n = 0; + for (i = 0; i <= 7; i++) /* register */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += BSET((i << 9) + j + 0x01c0, "BSET", 0); + for (i = 0; i <= 0x3f; i++) /* EA */ + n += BSET(i + 0x08c0, "BSET", 0); + printf("BSET:\t\t%d\n", n); + + /* MOVE from SR */ + + /* + * The 68000 and 68008 "MOVE from SR" is not privileged. But for the 68010 + * and higher, it is. + */ + + n = 0; + for (i = 0; i <= 0x3f; i++) + n += MOVEfromSR(i + 0x40c0, "MOVE from SR", 0); + printf("MOVE from SR:\t%d\n", n); + + /* SUBA */ + n = 0; + for (i = 3; i <= 7; i++) /* size */ + for (j = 0; j <= 7; j++) /* dest. reg */ + for (k = 0; k <= 0x3f; k++) /* source EA */ + n += ArithmeticA((i << 6) + (j << 9) + k + 0x9000, "SUBA", 4); + printf("SUBA:\t\t%d\n", n); + + /* DIVS */ + n = 0; + for (i = 0; i <= 7; i++) /* register */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += DIVS((i << 9) + j + 0x81c0, "DIVS", 158); + printf("DIVS:\t\t%d\n", n); + + /* MULU */ + n = 0; + for (i = 0; i <= 7; i++) /* register */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += MULU((i << 9) + j + 0xc0c0, "MULU", 70); + printf("MULU:\t\t%d\n", n); + + /* ADDX */ + n = 0; + for (i = 0; i <= 7; i++) /* Rx */ + for (j = 0; j <= 2; j++) /* size */ + for (k = 0; k <= 1; k++) /* R/M */ + n += ADDX((i << 9) + (j << 6) + (k << 3) + 0xd100, "ADDX", 0); + printf("ADDX:\t\t%d\n", n); + + /* Scc */ + n = 0; + for (i = 0; i <= 0xf; i++) /* condition */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += Scc((i << 8) + j + 0x50c0, "S??", 0); + printf("Scc:\t\t%d\n", n); + + /* ORI to SR */ + ORItoSR(0x007c, "ORI to SR", 20); + printf("ORI to SR:\t1\n"); + + /* MOVE to CCR */ + n = 0; + for (i = 0; i <= 0x3f; i++) + n += MOVEtoCCR(i + 0x44c0, "MOVE to CCR", 12); + printf("MOVE to CCR:\t%d\n", n); + + /* EXG */ + n = 0; + for (i = 0; i <= 7; i++) /* Rx */ + for (j = 0; j <= 0x11; j++) /* opmode */ + n += EXG((i << 9) + (j << 3) + 0xc100, "EXG", 6); + printf("EXG:\t\t%d\n", n); + + /* UNLK */ + UNLK(0x4e58, "UNLK", 12); + printf("UNLK:\t\t1\n"); + + /* LINK */ + LINK(0x4e50, "LINK", 16); /* word */ + printf("LINK:\t\t1\n"); + + /* DIVU */ + n = 0; + for (i = 0; i <= 7; i++) /* register */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += DIVU((i << 9) + j + 0x80c0, "DIVU", 144); + printf("DIVU:\t\t%d\n", n); + + /* ANDI to CCR */ + ANDItoCCR(0x023c, "ANDI to CCR", 20); + printf("ANDI to CCR:\t1\n"); + + /* PEA */ + n = 0; + for (i = 0; i <= 0x3f; i++) + n += PEA(i + 0x4840, "PEA", 0); + printf("PEA:\t\t%d\n", n); + + /* ANDI to SR */ + ANDItoSR(0x027c, "ANDI to SR", 20); + printf("ANDI to SR:\t%d\n", n); + + /* BCHG */ + n = 0; + for (i = 0; i <= 7; i++) /* register */ + for (j = 0; j <= 0x3f; j++) /* EA */ + n += BCHG((i << 9) + j + 0x0140, "BCHG", 0); + for (i = 0; i <= 0x3f; i++) /* EA */ + n += BCHG(i + 0x0840, "BCHG", 0); + printf("BCHG:\t\t%d\n", n); + + /* ORI to CCR */ + ORItoCCR(0x003c, "ORI to CCR", 20); + printf("ORI to CCR:\t1\n"); + + /* RTR */ + RTR(0x4e77, "RTR", 20); + printf("RTR:\t\t1\n"); + + /* TRAP */ + TRAP(0x4e40, "TRAP", 34); + printf("TRAP:\t\t1\n"); + + /* SBCD */ + n = 0; + for (i = 0; i <= 7; i++) /* Rx */ + for (j = 0; j <= 1; j++) /* R/M */ + n += SBCD((i << 9) + (j << 3) + 0x8100, "SBCD", 0); + printf("SBCD:\t\t%d\n", n); + + /* SUBX */ + n = 0; + for (i = 0; i <= 7; i++) /* Rx */ + for (j = 0; j <= 2; j++) /* size */ + for (k = 0; k <= 1; k++) /* R/M */ + n += SUBX((i << 9) + (j << 6) + (k << 3) + 0x9100, "SUBX", 0); + printf("SUBX:\t\t%d\n", n); + + /* ABCD */ + n = 0; + for (i = 0; i <= 7; i++) /* Rx */ + for (j = 0; j <= 1; j++) /* R/M */ + n += ABCD((i << 9) + (j << 3) + 0xc100, "ABCD", 0); + printf("ABCD:\t\t%d\n", n); + + /* CMPM */ + n = 0; + for (i = 0; i <= 7; i++) /* Ax */ + for (j = 0; j <= 2; j++) /* size */ + n += CMPM((i << 9) + (j << 6) + 0xb108, "CMPM", 0); + printf("CMPM:\t\t%d\n", n); + + /* MOVEP */ + n = 0; + for (i = 0; i <= 7; i++) /* Dx */ + for (j = 0; j <= 7; j++) /* opmode */ + n += MOVEP((i << 9) + (j << 6) + 0x0008, "MOVEP", 0); + printf("MOVEP:\t\t%d\n", n); + + /* + * The following have no profile data associated with them, as far as my + * tests have shown. + */ + + /* BKPT */ + if (mpu == 68010) + { + n = BKPT(0x4848, "BKPT", 45); + printf("BKPT:\t\t%d\n", n); + } + + /* CHK */ + n = 0; + for (i = 0; i <= 7; i++) /* register */ + for (j = 0; j <= 3; j++) /* size */ + for (k = 0; k <= 0x3f; k++) /* EA */ + n += CHK((i << 9) + (j << 7) + k + 0x4000, "CHK", 10); + printf("CHK:\t\t%d\n", n); + + /* EORI to CCR */ + EORItoCCR(0x0a3c, "EORI to CCR", 20); + printf("EORI to CCR:\t1\n"); + + /* EORI to SR */ + EORItoSR(0x0a7c, "EORI to SR", 20); + printf("EORI to SR:\t1\n"); + + /* ILLEGAL */ + InstBegin(0x4afc, "ILLEGAL", 1); + e("jmp near exception_illegal_instruction\n"); + printf("ILLEGAL:\t1\n"); + + /* MOVEC */ + if (mpu == 68010) + { + n = MOVEC(0x4e7a, "MOVEC", 0); + printf("MOVEC:\t\t%d\n", n); + } + + /* MOVE from CCR -- 68010, 68020, 68030, 68040, CPU32 */ + if (mpu == 68010) + { + n = 0; + for (i = 0; i <= 0x3f; i++) + n += MOVEfromCCR(i + 0x42c0, "MOVE from CCR", 0); + printf("MOVE from CCR:\t%d\n", n); + } + + /* NBCD */ + n = 0; + for (i = 0; i <= 0x3f; i++) /* EA */ + n += NBCD(i + 0x4800, "NBCD", 0); + printf("NBCD:\t\t%d\n", n); + + /* RESET */ + RESET(0x4e70, "RESET", 132); + printf("RESET:\t\t1\n"); + + /* RTD */ + if (mpu == 68010) + { + RTD(0x4e74, "RTD", 16); + printf("RTD:\t\t1\n"); + } + + /* STOP */ + STOP(0x4e72, "STOP", 4); + printf("STOP:\t\t1\n"); + + /* TAS */ + n = 0; + for (i = 0; i <= 0x3f; i++) + n += TAS(i + 0x4ac0, "TAS", 0); + printf("TAS:\t\t%d\n", n); + + /* TRAPV */ + TRAPV(0x4e76, "TRAPV", 0); + printf("TRAPV:\t\t1\n"); + + if (illegal) /* emulate Line 1010 and Line 1111 exceptions */ + { + /* Line 1010 */ + InstBegin(0xa000, "Line 1010 Emulator", 4096); + e("jmp near exception_line_1010_emulator\n"); + + /* Line 1111 */ + InstBegin(0xf000, "Line 1111 Emulator", 4096); + e("jmp near exception_line_1111_emulator\n"); + + num_handlers -= 2; /* don't count these as instruction handlers */ + } + + /* I_Invalid: Invalid instruction */ + EmitLabel("I_Invalid"); + if (illegal) /* emulate illegal instruction exceptions */ + e("jmp near exception_illegal_instruction\n"); + else + { + e("sub esi, byte 2\n"); /* back up to the bad instruction */ + e("jmp invalid_error\n"); /* invalid instruction error */ + } +} + +void EmitExceptions() +{ + + /* + * exception_chk: + * exception_divide_by_zero: + * Assume the PC points to the instruction AFTER the instruction which + * caused the trap. + */ + Align(4); + EmitLabel("exception_chk"); + e("push dword 6*4\n"); /* CHK exception vector */ + e("jmp short do_exception\n"); + Align(4); + EmitLabel("exception_divide_by_zero"); + e("push dword 5*4\n"); /* division by zero exception vector */ + e("jmp short do_exception\n"); + + /* + * exception_privilege_violation: + * exception_illegal_instruction: + * exception_line_1010_emulator: + * exception_line_1111_emulator: + * Assume the PC points to the word AFTER the instruction which caused the + * trap. The value 2 will be subtracted from the PC in order to make them + * point AT the instruction which caused the trap, as this is how the + * exceptions work. + */ + Align(4); + EmitLabel("exception_privilege_violation"); + e("push dword 8*4\n"); /* privilege violation exception vector */ + e("jmp short do_exception_fix_pc\n"); + Align(4); + EmitLabel("exception_illegal_instruction"); + e("push dword 4*4\n"); /* illegal instruction exception vector */ + e("jmp short do_exception_fix_pc\n"); + Align(4); + EmitLabel("exception_line_1010_emulator"); + e("push dword 10*4\n"); /* Line 1010 emulator exception vector */ + e("jmp short do_exception_fix_pc\n"); + Align(4); + EmitLabel("exception_line_1111_emulator"); + e("push dword 11*4\n"); /* Line 1111 emulator exception vector */ + e("jmp short do_exception_fix_pc\n"); + + EmitLabel("do_exception_fix_pc"); /* points PC at trap instruction */ + e("sub esi, byte 2\n"); + EmitLabel("do_exception"); + e("mov edx, 0x2000\n"); /* what the SR will be */ + e("xor edx, [sr]\n"); /* see if S bit is different */ + e("test edx, 0x2000\n"); + e("jz .no_sp_magic\n"); /* nope, don't swap SPs */ + e("mov edx, [__sp]\n"); + e("xchg [a+7*4], edx\n"); + e("mov [__sp], edx\n"); + SetSupervisorAddressSpace(); /* map in supervisor address space */ + EmitLabel(".no_sp_magic"); + + e("mov ebx, [a+7*4]\n"); /* SP */ + /* + * If 68010, we have to push the format word on the stack first. + */ + if (mpu == 68010) + { + e("sub ebx, byte 2\n");/* SP-2 */ + e("mov edx, [esp]\n"); /* vector offset | 0x00000000 */ + SaveReg("run", "ebx"); + WriteWord(); + RestoreReg("run", "ebx"); + } + e("mov edx, esi\n"); + e("sub edx, ebp\n"); /* PC->EDX */ + e("sub ebx, byte 4\n"); /* SP-4 */ + SaveReg("run", "ebx"); + WriteLong(); + RestoreReg("run", "ebx"); + e("mov edx, [sr]\n"); /* get SR */ + e("sub ebx, byte 2\n"); /* SP-2 */ + SaveReg("run", "ebx"); + WriteWord(); /* save SR to stack */ + RestoreReg("run", "ebx"); + e("or dh, 0x20\n"); /* set supervisor for exception */ + e("and edx, 0xa71f\n"); /* clear unwanted bits */ + e("mov [sr], edx\n"); /* set new SR, get old SR->EDX */ + e("mov [a+7*4], ebx\n"); /* write back SP */ + + e("pop ebx\n"); /* get exception vector address */ + if (mpu == 68010) + e("add ebx, [vbr]\n"); + + ReadLong(); /* get PC */ + e("mov esi, edx\n"); /* set new PC */ + UpdateFetchPtr(); + e("xor edi, edi\n"); + e("sub ecx, byte 40\n"); /* timing... */ + e("mov di, [esi]\n"); + e("add esi, byte 2\n"); + e("jmp [jmptab+edi*4]\n"); /* continue execution */ +} + +/***************************************************************************** +* Data */ + +void EmitData() +{ + int i; + + CacheAlign(); + EmitGlobalLabel(NameOfContext()); + e("context_start:\n"); + e("fetch dd 0\n"); /* pointer to fetch array */ + e("pcfetch dd 0\n"); /* PC-relative fetch */ + e("read_byte dd 0\n"); /* pointer to read_byte array */ + e("read_word dd 0\n"); /* pointer to read_word array */ + e("read_long dd 0\n"); /* pointer to read_long array */ + e("write_byte dd 0\n"); /* pointer to write_byte array */ + e("write_word dd 0\n"); /* pointer to write_word array */ + e("write_long dd 0\n"); /* pointer to write_long array */ + e("super_fetch dd 0\n"); /* supervisor memory map... */ + e("super_pcfetch dd 0\n"); + e("super_read_byte dd 0\n"); + e("super_read_word dd 0\n"); + e("super_read_long dd 0\n"); + e("super_write_byte dd 0\n"); + e("super_write_word dd 0\n"); + e("super_write_long dd 0\n"); + e("user_fetch dd 0\n"); /* user memory map... */ + e("user_pcfetch dd 0\n"); + e("user_read_byte dd 0\n"); + e("user_read_word dd 0\n"); + e("user_read_long dd 0\n"); + e("user_write_byte dd 0\n"); + e("user_write_word dd 0\n"); + e("user_write_long dd 0\n"); + + e("intr times 8 dd 0\n"); /* intr[0-6]=vectors for interrupt + levels 1-7 (0=not pending.) + intr[7]=# of interrupts pending */ + e("cycles dd 0\n"); /* cycles total to emulate */ + e("remaining dd 0\n"); /* cycles remaining */ + e("d times 8 dd 0\n"); /* D0-D7 */ + e("a times 8 dd 0\n"); /* A0-A7 */ + e("__sp dd 0\n"); /* User mode: SSP, Supervisor: USP */ + e("sr dd 0\n"); /* SR */ + e("pc dd 0\n"); /* PC */ + if (mpu == 68010) + { + e("fc dd 0\n"); /* FC (DFC, SFC) */ + e("vbr dd 0\n"); /* VBR */ + } + e("status dd 0\n"); /* bit 0:1=emulating, 0=not + bit 1:1=stopped, 0=not + bit 2:1=processing ints, 0=not */ + e("InterruptAcknowledge dd 0\n"); /* interrupt acknowledge callback */ + e("Reset dd 0\n"); /* pointer to RESET handler */ + if (mpu == 68010) + e("Bkpt dd 0\n"); /* pointer to BKPT handler */ + e("context_end:\n"); + e("x dd 0\n"); /* X flag (maintained internally) */ + for (i = 0; i < 7; i++) + { + char *reg[] = { "eax", "ebx", "ecx", "edx", "esi", "edi", "ebp" }; + e("memhandler_%s dd 0\n", reg[i]); + } + for (i = 0; i < 7; i++) + { + char *reg[] = { "eax", "ebx", "ecx", "edx", "esi", "edi", "ebp" }; + e("run_%s dd 0\n", reg[i]); + } + e("fetch_esi dd 0\n"); /* for UpdateFetchPtr() */ +} + +/***************************************************************************** +* Code */ + +void EmitCode() +{ + int i; + + /* Turbo68KInit() */ + + /* + * Decompresses the jump table. See main() for the compression format + */ + + EmitGlobalLabel("Turbo68KInit"); + e("push ecx\n"); + e("push edx\n"); + e("push esi\n"); + e("push edi\n"); + e("mov esi, compressed_jmptab\n"); + e("mov edi, jmptab\n"); + e("xor ecx, ecx\n"); /* we only need lower half (CX) */ + EmitLabel(".l"); + e("mov cx, [esi]\n"); /* get repeat information */ + e("add esi, byte 2\n"); /* point at data */ + e("mov edx, ecx\n"); + e("and edx, 0xc000\n"); + e("cmp dx, 0xc000\n"); /* #handlers * 1 each? */ + e("je .r1\n"); + e("cmp dx, 0x8000\n"); /* #handlers * 8 each? */ + e("je .r8\n"); + e("mov eax, [esi]\n"); /* get data and repeat */ + e("add esi, byte 4\n"); + e("cld\n"); + e("rep stosd\n"); + + EmitLabel(".c"); + e("cmp dword [esi], byte -1\n"); /* end of compressed data? */ + e("jne .l\n"); + e("pop edi\n"); + e("pop esi\n"); + e("pop edx\n"); + e("pop ecx\n"); + e("xor eax, eax\n"); + e("ret\n"); + + EmitLabel(".r1"); + e("and ecx, 0x3ff\n"); /* get rid of 0xc000 marker */ + e("cld\n"); + e("rep movsd\n"); /* move address to decomp'd jmptab */ + e("jmp .c\n"); /* continue decompression */ + + EmitLabel(".r8"); + e("and ecx, 0x7ff\n"); /* get rid of 0x8000 marker */ + EmitLabel(".r8_l"); + e("mov edx, ecx\n"); /* save counter temporarily */ + e("mov ecx, 8\n"); /* repeat handler 8 times */ + e("mov eax, [esi]\n"); /* get handler to repeat */ + e("add esi, byte 4\n"); /* point to next */ + e("cld\n"); + e("rep stosd\n"); /* store! */ + e("mov ecx, edx\n"); /* restore loop counter and loop */ + e("dec ecx\n"); + e("jnz .r8_l\n"); + e("jmp .c\n"); + + /* Turbo68KReset() */ + + Align(4); + EmitGlobalLabel("Turbo68KReset"); + e("push ebx\n"); + e("push ecx\n"); + e("push edx\n"); + e("push esi\n"); + e("push edi\n"); + e("push ebp\n"); + SetSupervisorAddressSpace(); + EMULATING(); + UNSTOP_CPU(); /* in case we're STOPped, unstop */ + if (mpu == 68010) /* clear 68010 VBR */ + e("mov dword [vbr], 0\n"); + + e("xor ecx, ecx\n"); /* no cycles executed in case error */ + + /* + * Read the PC vector from the fetch memory map + */ + if (!call_convention) /* stack calling convention */ + e("push dword 4\n"); + else /* register calling convention */ + e("mov eax, 4\n"); + e("call %sTurbo68KFetchPtr\n", id); + if (!call_convention) + e("add esp, byte 4\n"); + e("test eax, eax\n"); + e("jz near fetch_error\n"); + e("mov eax, [eax]\n"); + e("rol eax, byte 16\n"); /* memory is byte swapped */ + + e("mov dword "SR", 0x2700\n"); /* in supervisor mode at start */ + e("mov dword [cycles], 0\n"); /* no cycles executed */ + e("mov dword [remaining], 0\n"); /* ..ditto.. */ + e("mov esi, eax\n"); /* from Turbo68KFetchPtr() */ + e("xor eax, eax\n"); /* clear registers */ + e("mov edi, d\n"); + e("mov ecx, 16\n"); + e("cld\n"); + e("rep stosd\n"); + e("mov edi, intr\n"); /* clear interrupt queue */ + e("mov ecx, 8\n"); + e("rep stosd\n"); + e("xor ecx, ecx\n"); /* no cycles executed in case error */ + UpdateFetchPtr(); /* this also makes sure it can be fetched */ + WRITEPCTOMEM("pc"); + + /* + * Read the SP vector from the fetch memory map + */ + if (!call_convention) /* stack calling convention */ + e("push dword 0\n"); + else /* register calling convention */ + e("xor eax, eax\n"); + e("call %sTurbo68KFetchPtr\n", id); + if (!call_convention) + e("add esp, byte 4\n"); + e("test eax, eax\n"); + e("jz near fetch_error\n"); + e("mov eax, [eax]\n"); + e("rol eax, byte 16\n"); /* memory is byte swapped */ + + e("mov "A7", eax\n"); /* supervisor */ + e("mov "SP", eax\n"); /* user */ + STOP_EMULATING(); /* no longer running */ + e("pop ebp\n"); + e("pop edi\n"); + e("pop esi\n"); + e("pop edx\n"); + e("pop ecx\n"); + e("pop ebx\n"); + e("xor eax, eax\n"); + if (mmx) e("emms\n"); + e("ret\n"); + + EmitLabel("invalid_error"); /* invalid instruction */ + SaveCCR(); + STOP_EMULATING(); + STOP_RUNNING(); /* save PC and cycles remaining */ + e("pop ebp\n"); + e("pop edi\n"); + e("pop esi\n"); + e("pop edx\n"); + e("pop ecx\n"); + e("pop ebx\n"); + e("mov eax, %d\n", TURBO68K_ERROR_INVINST); + e("ret\n"); + + /* + * NOTE: Only UpdateFetchPtr() and Turbo68KReset() can call this + */ + + EmitLabel("fetch_error"); /* could not fetch instruction */ + e("mov [remaining], ecx\n"); /* save cycles remaining */ + STOP_EMULATING(); + e("mov [pc], esi\n"); /* UpdateFetchPtr() didn't yet change this */ + e("pop ebp\n"); + e("pop edi\n"); + e("pop esi\n"); + e("pop edx\n"); + e("pop ecx\n"); + e("pop ebx\n"); + e("mov eax, %d\n", TURBO68K_ERROR_FETCH); + e("ret\n"); + + /* Turbo68KReadPC() */ + + /* + * Can be used anywhere, but usage while Turbo68K is emulating may + * result in the value being offset a few bytes into the current + * instruction, but it shouldn't + */ + + Align(4); + EmitGlobalLabel("Turbo68KReadPC"); + e("mov eax, [pc]\n"); + e("ret\n"); + + /* Turbo68KSetFetch() */ + + Align(4); + EmitGlobalLabel("Turbo68KSetFetch"); + e("push eax\n"); + e("push edx\n"); + GetArg("eax", 0, 12); + + e("sub eax, "SIZEOF_FETCHREGION"\n"); + if (multiaddr) + { + GetArg("edx", 1, 16); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov [super_fetch], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if supervisor, update fetch */ + e("jz near .not_super\n"); + e("mov [fetch], eax\n"); + EmitLabel(".not_super"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + + EmitLabel(".user"); + e("mov [user_fetch], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if user, update fetch */ + e("jnz near .not_user\n"); + e("mov [fetch], eax\n"); + EmitLabel(".not_user"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + else + { + e("mov [fetch], eax\n"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + + /* Turbo68KGetFetch() */ + + Align(4); + EmitGlobalLabel("Turbo68KGetFetch"); + e("push edx\n"); + if (multiaddr) + { + GetArg("edx", 0, 8); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov eax, [super_fetch]\n"); + e("jmp near .finish\n"); + EmitLabel(".user"); + e("mov eax, [user_fetch]\n"); + EmitLabel(".finish"); + } + else + e("mov eax, [fetch]\n"); + e("pop edx\n"); + e("add eax, "SIZEOF_FETCHREGION"\n"); + e("ret\n"); + + /* Turbo68KSetPCFetch() */ + + if (pcfetch) + { + Align(4); + EmitGlobalLabel("Turbo68KSetPCFetch"); + e("push eax\n"); + e("push edx\n"); + GetArg("eax", 0, 12); + e("sub eax, "SIZEOF_FETCHREGION"\n"); + if (multiaddr) + { + GetArg("edx", 1, 16); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov [super_pcfetch], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if supervisor, update fetch */ + e("jz near .not_super\n"); + e("mov [pcfetch], eax\n"); + EmitLabel(".not_super"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + + EmitLabel(".user"); + e("mov [user_pcfetch], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if user, update fetch */ + e("jnz near .not_user\n"); + e("mov [pcfetch], eax\n"); + EmitLabel(".not_user"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + else + { + e("mov [pcfetch], eax\n"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + + /* Turbo68KGetPCFetch() */ + + Align(4); + EmitGlobalLabel("Turbo68KGetPCFetch"); + e("push edx\n"); + if (multiaddr) + { + GetArg("edx", 0, 8); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov eax, [super_pcfetch]\n"); + e("jmp near .finish\n"); + EmitLabel(".user"); + e("mov eax, [user_pcfetch]\n"); + EmitLabel(".finish"); + } + else + e("mov eax, [pcfetch]\n"); + e("pop edx\n"); + e("add eax, "SIZEOF_FETCHREGION"\n"); + e("ret\n"); + } + + /* + * If the memory map mode is NOT 0 (defmap), we do not add or subtract + * from the pointers because they aren't arrays, but function pointers. + */ + + /* Turbo68KSetReadByte() */ + + Align(4); + EmitGlobalLabel("Turbo68KSetReadByte"); + e("push eax\n"); + e("push ebx\n"); + GetArg("eax", 0, 12); + if (memmap_type == 0) + e("sub eax, "SIZEOF_DATAREGION"\n"); + if (multiaddr) + { + GetArg("edx", 1, 16); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov [super_read_byte], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if supervisor, update fetch */ + e("jz near .not_super\n"); + e("mov [read_byte], eax\n"); + EmitLabel(".not_super"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + + EmitLabel(".user"); + e("mov [user_read_byte], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if user, update fetch */ + e("jnz near .not_user\n"); + e("mov [read_byte], eax\n"); + EmitLabel(".not_user"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + else + { + e("mov [read_byte], eax\n"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + + /* Turbo68KGetReadByte() */ + + Align(4); + EmitGlobalLabel("Turbo68KGetReadByte"); + e("push edx\n"); + if (multiaddr) + { + GetArg("edx", 0, 8); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov eax, [super_read_byte]\n"); + e("jmp near .finish\n"); + EmitLabel(".user"); + e("mov eax, [user_read_byte]\n"); + EmitLabel(".finish"); + } + else + e("mov eax, [read_byte]\n"); + if (memmap_type == 0) + e("add eax, "SIZEOF_DATAREGION"\n"); + e("pop edx\n"); + e("ret\n"); + + /* Turbo68KSetReadWord() */ + + Align(4); + EmitGlobalLabel("Turbo68KSetReadWord"); + e("push eax\n"); + e("push ebx\n"); + GetArg("eax", 0, 12); + if (memmap_type == 0) + e("sub eax, "SIZEOF_DATAREGION"\n"); + if (multiaddr) + { + GetArg("edx", 1, 16); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov [super_read_word], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if supervisor, update fetch */ + e("jz near .not_super\n"); + e("mov [read_word], eax\n"); + EmitLabel(".not_super"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + + EmitLabel(".user"); + e("mov [user_read_word], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if user, update fetch */ + e("jnz near .not_user\n"); + e("mov [read_word], eax\n"); + EmitLabel(".not_user"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + else + { + e("mov [read_word], eax\n"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + + /* Turbo68KGetReadWord() */ + + Align(4); + EmitGlobalLabel("Turbo68KGetReadWord"); + e("push edx\n"); + if (multiaddr) + { + GetArg("edx", 0, 8); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov eax, [super_read_word]\n"); + e("jmp near .finish\n"); + EmitLabel(".user"); + e("mov eax, [user_read_word]\n"); + EmitLabel(".finish"); + } + else + e("mov eax, [read_word]\n"); + if (memmap_type == 0) + e("add eax, "SIZEOF_DATAREGION"\n"); + e("pop edx\n"); + e("ret\n"); + + /* Turbo68KSetReadLong() */ + + Align(4); + EmitGlobalLabel("Turbo68KSetReadLong"); + e("push eax\n"); + e("push ebx\n"); + GetArg("eax", 0, 12); + if (memmap_type == 0) + e("sub eax, "SIZEOF_DATAREGION"\n"); + if (multiaddr) + { + GetArg("edx", 1, 16); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov [super_read_long], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if supervisor, update fetch */ + e("jz near .not_super\n"); + e("mov [read_long], eax\n"); + EmitLabel(".not_super"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + + EmitLabel(".user"); + e("mov [user_read_long], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if user, update fetch */ + e("jnz near .not_user\n"); + e("mov [read_long], eax\n"); + EmitLabel(".not_user"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + else + { + e("mov [read_long], eax\n"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + + /* Turbo68KGetReadLong() */ + + Align(4); + EmitGlobalLabel("Turbo68KGetReadLong"); + e("push edx\n"); + if (multiaddr) + { + GetArg("edx", 0, 8); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov eax, [super_read_long]\n"); + e("jmp near .finish\n"); + EmitLabel(".user"); + e("mov eax, [user_read_long]\n"); + EmitLabel(".finish"); + } + else + e("mov eax, [read_long]\n"); + if (memmap_type == 0) + e("add eax, "SIZEOF_DATAREGION"\n"); + e("pop edx\n"); + e("ret\n"); + + /* Turbo68KSetWriteByte() */ + + Align(4); + EmitGlobalLabel("Turbo68KSetWriteByte"); + e("push eax\n"); + e("push edx\n"); + GetArg("eax", 0, 12); + if (memmap_type == 0) + e("sub eax, "SIZEOF_DATAREGION"\n"); + if (multiaddr) + { + GetArg("edx", 1, 16); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov [super_write_byte], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if supervisor, update fetch */ + e("jz near .not_super\n"); + e("mov [write_byte], eax\n"); + EmitLabel(".not_super"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + + EmitLabel(".user"); + e("mov [user_write_byte], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if user, update fetch */ + e("jnz near .not_user\n"); + e("mov [write_byte], eax\n"); + EmitLabel(".not_user"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + else + { + e("mov [write_byte], eax\n"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + + /* Turbo68KGetWriteByte() */ + + Align(4); + EmitGlobalLabel("Turbo68KGetWriteByte"); + e("push edx\n"); + if (multiaddr) + { + GetArg("edx", 0, 8); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov eax, [super_write_byte]\n"); + e("jmp near .finish\n"); + EmitLabel(".user"); + e("mov eax, [user_write_byte]\n"); + EmitLabel(".finish"); + } + else + e("mov eax, [write_byte]\n"); + if (memmap_type == 0) + e("add eax, "SIZEOF_DATAREGION"\n"); + e("pop edx\n"); + e("ret\n"); + + /* Turbo68KSetWriteWord() */ + + Align(4); + EmitGlobalLabel("Turbo68KSetWriteWord"); + e("push eax\n"); + e("push edx\n"); + GetArg("eax", 0, 12); + if (memmap_type == 0) + e("sub eax, "SIZEOF_DATAREGION"\n"); + if (multiaddr) + { + GetArg("edx", 1, 16); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov [super_write_word], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if supervisor, update fetch */ + e("jz near .not_super\n"); + e("mov [write_word], eax\n"); + EmitLabel(".not_super"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + + EmitLabel(".user"); + e("mov [user_write_word], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if user, update fetch */ + e("jnz near .not_user\n"); + e("mov [write_word], eax\n"); + EmitLabel(".not_user"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + else + { + e("mov [write_word], eax\n"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + + /* Turbo68KGetWriteWord() */ + + Align(4); + EmitGlobalLabel("Turbo68KGetWriteWord"); + e("push edx\n"); + if (multiaddr) + { + GetArg("edx", 0, 8); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov eax, [super_write_word]\n"); + e("jmp near .finish\n"); + EmitLabel(".user"); + e("mov eax, [user_write_word]\n"); + EmitLabel(".finish"); + } + else + e("mov eax, [write_word]\n"); + if (memmap_type == 0) + e("add eax, "SIZEOF_DATAREGION"\n"); + e("pop edx\n"); + e("ret\n"); + + /* Turbo68KSetWriteLong() */ + + Align(4); + EmitGlobalLabel("Turbo68KSetWriteLong"); + e("push eax\n"); + e("push edx\n"); + GetArg("eax", 0, 12); + if (memmap_type == 0) + e("sub eax, "SIZEOF_DATAREGION"\n"); + if (multiaddr) + { + GetArg("edx", 1, 16); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov [super_write_long], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if supervisor, update fetch */ + e("jz near .not_super\n"); + e("mov [write_long], eax\n"); + EmitLabel(".not_super"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + + EmitLabel(".user"); + e("mov [user_write_long], eax\n"); + e("test byte [sr+1], 0x20\n"); /* if user, update fetch */ + e("jnz near .not_user\n"); + e("mov [write_long], eax\n"); + EmitLabel(".not_user"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + else + { + e("mov [write_long], eax\n"); + e("pop edx\n"); + e("pop eax\n"); + e("ret\n"); + } + + /* Turbo68KGetWriteLong() */ + + Align(4); + EmitGlobalLabel("Turbo68KGetWriteLong"); + e("push edx\n"); + if (multiaddr) + { + GetArg("edx", 0, 8); + e("cmp edx, byte %d\n", TURBO68K_SUPERVISOR); + e("jne short .user\n"); + e("mov eax, [super_write_long]\n"); + e("jmp near .finish\n"); + EmitLabel(".user"); + e("mov eax, [user_write_long]\n"); + EmitLabel(".finish"); + } + else + e("mov eax, [write_long]\n"); + if (memmap_type == 0) + e("add eax, "SIZEOF_DATAREGION"\n"); + e("pop edx\n"); + e("ret\n"); + + /* Turbo68KFetchPtr() */ + + Align(4); + EmitGlobalLabel("Turbo68KFetchPtr"); + + e("push ebx\n"); + e("push edx\n"); + e("push esi\n"); + e("push ebp\n"); + + GetArg("esi", 0, 20); /* address */ + if (multiaddr) + { + e("test byte [sr+1], 0x20\n"); /* set proper address space */ + e("jz short .user\n"); + SetSupervisorAddressSpace(); + e("jmp short .continue\n"); + EmitLabel(".user"); + SetUserAddressSpace(); + EmitLabel(".continue"); + } + AddrClip("esi"); + e("mov edx, [fetch]\n"); + e(".find_fetch_loop:\n"); + e("add edx, byte "SIZEOF_FETCHREGION"\n"); + e("cmp dword [edx], byte -1\n"); /* limit=-1? end. */ + e("je short .not_found\n"); + e("cmp esi, [edx]\n"); /* offset 0: base. above it? */ + e("jb short .find_fetch_loop\n"); /* nope, not this region */ + e("cmp esi, [edx+"OFFSET_FETCH_LIMIT"]\n"); /* limit. below it? */ + e("ja short .find_fetch_loop\n"); /* nope, not this region */ + e("mov ebp, [edx+"OFFSET_FETCH_PTR"]\n"); /* ebp=base ptr */ + e("add esi, ebp\n"); /* +pc=pc ptr.. */ + e("mov eax, esi\n"); + + e("pop ebp\n"); + e("pop esi\n"); + e("pop edx\n"); + e("pop ebx\n"); + + e("ret\n"); + EmitLabel(".not_found"); + + e("pop ebp\n"); + e("pop esi\n"); + e("pop edx\n"); + e("pop ebx\n"); + + e("xor eax, eax\n"); + e("ret\n"); + + /* Turbo68KReadByte() */ + + Align(4); + EmitGlobalLabel("Turbo68KReadByte"); + e("push ebx\n"); + e("push ecx\n"); + e("push edx\n"); + e("push esi\n"); + e("push edi\n"); + e("push ebp\n"); + e("xor ebp, ebp\n"); /* so PC doesn't get trashed */ + e("mov esi, [pc]\n"); + if (multiaddr) + { + e("test byte [sr+1], 0x20\n"); /* set proper address space */ + e("jz short .user\n"); + SetSupervisorAddressSpace(); + e("jmp short .continue\n"); + EmitLabel(".user"); + SetUserAddressSpace(); + EmitLabel(".continue"); + } + GetArg("ebx", 0, 28); + ReadByte(); + e("mov eax, edx\n"); + if (mmx) e("emms\n"); + e("pop ebp\n"); + e("pop edi\n"); + e("pop esi\n"); + e("pop edx\n"); + e("pop ecx\n"); + e("pop ebx\n"); + e("ret\n"); + + /* Turbo68KReadWord() */ + + Align(4); + EmitGlobalLabel("Turbo68KReadWord"); + e("push ebx\n"); + e("push ecx\n"); + e("push edx\n"); + e("push esi\n"); + e("push edi\n"); + e("push ebp\n"); + e("xor ebp, ebp\n"); /* so PC doesn't get trashed */ + e("mov esi, [pc]\n"); + if (multiaddr) + { + e("test byte [sr+1], 0x20\n"); /* set proper address space */ + e("jz short .user\n"); + SetSupervisorAddressSpace(); + e("jmp short .continue\n"); + EmitLabel(".user"); + SetUserAddressSpace(); + EmitLabel(".continue"); + } + GetArg("ebx", 0, 28); + ReadWord(); + e("mov eax, edx\n"); + if (mmx) e("emms\n"); + e("pop ebp\n"); + e("pop edi\n"); + e("pop esi\n"); + e("pop edx\n"); + e("pop ecx\n"); + e("pop ebx\n"); + e("ret\n"); + + /* Turbo68KReadLong() */ + + Align(4); + EmitGlobalLabel("Turbo68KReadLong"); + e("push ebx\n"); + e("push ecx\n"); + e("push edx\n"); + e("push esi\n"); + e("push edi\n"); + e("push ebp\n"); + e("xor ebp, ebp\n"); /* so PC doesn't get trashed */ + e("mov esi, [pc]\n"); + if (multiaddr) + { + e("test byte [sr+1], 0x20\n"); /* set proper address space */ + e("jz short .user\n"); + SetSupervisorAddressSpace(); + e("jmp short .continue\n"); + EmitLabel(".user"); + SetUserAddressSpace(); + EmitLabel(".continue"); + } + GetArg("ebx", 0, 28); + ReadLong(); + e("mov eax, edx\n"); + if (mmx) e("emms\n"); + e("pop ebp\n"); + e("pop edi\n"); + e("pop esi\n"); + e("pop edx\n"); + e("pop ecx\n"); + e("pop ebx\n"); + e("ret\n"); + + /* Turbo68KWriteByte() */ + + Align(4); + EmitGlobalLabel("Turbo68KWriteByte"); + e("pusha\n"); + e("xor ebp, ebp\n"); /* so PC doesn't get trashed */ + e("mov esi, [pc]\n"); + if (multiaddr) + { + e("test byte [sr+1], 0x20\n"); /* set proper address space */ + e("jz short .user\n"); + SetSupervisorAddressSpace(); + e("jmp short .continue\n"); + EmitLabel(".user"); + SetUserAddressSpace(); + EmitLabel(".continue"); + } + GetArg("ebx", 0, 36); + GetArg("edx", 1, 40); + WriteByte(); + if (mmx) e("emms\n"); + e("popa\n"); + e("ret\n"); + + /* Turbo68KWriteWord() */ + + Align(4); + EmitGlobalLabel("Turbo68KWriteWord"); + e("pusha\n"); + e("xor ebp, ebp\n"); /* so PC doesn't get trashed */ + e("mov esi, [pc]\n"); + if (multiaddr) + { + e("test byte [sr+1], 0x20\n"); /* set proper address space */ + e("jz short .user\n"); + SetSupervisorAddressSpace(); + e("jmp short .continue\n"); + EmitLabel(".user"); + SetUserAddressSpace(); + EmitLabel(".continue"); + } + GetArg("ebx", 0, 36); + GetArg("edx", 1, 40); + WriteWord(); + if (mmx) e("emms\n"); + e("popa\n"); + e("ret\n"); + + /* Turbo68KWriteLong() */ + + Align(4); + EmitGlobalLabel("Turbo68KWriteLong"); + e("pusha\n"); + e("xor ebp, ebp\n"); /* so PC doesn't get trashed */ + e("mov esi, [pc]\n"); + if (multiaddr) + { + e("test byte [sr+1], 0x20\n"); /* set proper address space */ + e("jz short .user\n"); + SetSupervisorAddressSpace(); + e("jmp short .continue\n"); + EmitLabel(".user"); + SetUserAddressSpace(); + EmitLabel(".continue"); + } + GetArg("ebx", 0, 36); + GetArg("edx", 1, 40); + WriteLong(); + if (mmx) e("emms\n"); + e("popa\n"); + e("ret\n"); + + /* Turbo68KSet/GetContext() */ + + /* + * Notice the trick here, all of the memory map pointers have 16 + * subtracted from them, this helps optimize the read/write handlers + * since an "add edi, 16" is possible straight off. This was NB's + * idea. The fetch area is also handled this way + */ + + Align(4); + EmitGlobalLabel("Turbo68KSetContext"); + e("push ecx\n"); + e("push esi\n"); + e("push edi\n"); + GetArg("esi", 0, 16); + e("mov edi, %s%s\n", id, NameOfContext()); + if (mmx && !(SizeOfContext() & 7)) + { + e("mov ecx, " SIZEOF_CONTEXT " / 8\n"); + EmitLabel(".l"); + e("movq mm6, [esi]\n"); + e("movq [edi], mm6\n"); + e("add esi, byte 8\n"); + e("add edi, byte 8\n"); + e("dec ecx\n"); + e("jnz short .l\n"); + e("emms\n"); + } + else + { + e("mov ecx, " SIZEOF_CONTEXT " / 4\n"); + e("cld\n"); + e("rep movsd\n"); + } + + e("sub dword [fetch], "SIZEOF_FETCHREGION"\n"); + e("sub dword [pcfetch], "SIZEOF_FETCHREGION"\n"); + e("sub dword [super_fetch], "SIZEOF_FETCHREGION"\n"); + e("sub dword [super_pcfetch], "SIZEOF_FETCHREGION"\n"); + e("sub dword [user_fetch], "SIZEOF_FETCHREGION"\n"); + e("sub dword [user_pcfetch], "SIZEOF_FETCHREGION"\n"); + if (memmap_type == 0) + { + e("sub dword [read_byte], "SIZEOF_DATAREGION"\n"); + e("sub dword [read_word], "SIZEOF_DATAREGION"\n"); + e("sub dword [read_long], "SIZEOF_DATAREGION"\n"); + e("sub dword [write_byte], "SIZEOF_DATAREGION"\n"); + e("sub dword [write_word], "SIZEOF_DATAREGION"\n"); + e("sub dword [write_long], "SIZEOF_DATAREGION"\n"); + + e("sub dword [super_read_byte], "SIZEOF_DATAREGION"\n"); + e("sub dword [super_read_word], "SIZEOF_DATAREGION"\n"); + e("sub dword [super_read_long], "SIZEOF_DATAREGION"\n"); + e("sub dword [super_write_byte], "SIZEOF_DATAREGION"\n"); + e("sub dword [super_write_word], "SIZEOF_DATAREGION"\n"); + e("sub dword [super_write_long], "SIZEOF_DATAREGION"\n"); + + e("sub dword [user_read_byte], "SIZEOF_DATAREGION"\n"); + e("sub dword [user_read_word], "SIZEOF_DATAREGION"\n"); + e("sub dword [user_read_long], "SIZEOF_DATAREGION"\n"); + e("sub dword [user_write_byte], "SIZEOF_DATAREGION"\n"); + e("sub dword [user_write_word], "SIZEOF_DATAREGION"\n"); + e("sub dword [user_write_long], "SIZEOF_DATAREGION"\n"); + } + e("pop edi\n"); + e("pop esi\n"); + e("pop ecx\n"); + e("ret\n"); + + Align(4); + EmitGlobalLabel("Turbo68KGetContext"); + e("push ecx\n"); + e("push esi\n"); + e("push edi\n"); + + e("add dword [fetch], "SIZEOF_FETCHREGION"\n"); + e("add dword [pcfetch], "SIZEOF_FETCHREGION"\n"); + e("add dword [super_fetch], "SIZEOF_FETCHREGION"\n"); + e("add dword [super_pcfetch], "SIZEOF_FETCHREGION"\n"); + e("add dword [user_fetch], "SIZEOF_FETCHREGION"\n"); + e("add dword [user_pcfetch], "SIZEOF_FETCHREGION"\n"); + if (memmap_type == 0) + { + e("add dword [read_byte], "SIZEOF_DATAREGION"\n"); + e("add dword [read_word], "SIZEOF_DATAREGION"\n"); + e("add dword [read_long], "SIZEOF_DATAREGION"\n"); + e("add dword [write_byte], "SIZEOF_DATAREGION"\n"); + e("add dword [write_word], "SIZEOF_DATAREGION"\n"); + e("add dword [write_long], "SIZEOF_DATAREGION"\n"); + + e("add dword [super_read_byte], "SIZEOF_DATAREGION"\n"); + e("add dword [super_read_word], "SIZEOF_DATAREGION"\n"); + e("add dword [super_read_long], "SIZEOF_DATAREGION"\n"); + e("add dword [super_write_byte], "SIZEOF_DATAREGION"\n"); + e("add dword [super_write_word], "SIZEOF_DATAREGION"\n"); + e("add dword [super_write_long], "SIZEOF_DATAREGION"\n"); + + e("add dword [user_read_byte], "SIZEOF_DATAREGION"\n"); + e("add dword [user_read_word], "SIZEOF_DATAREGION"\n"); + e("add dword [user_read_long], "SIZEOF_DATAREGION"\n"); + e("add dword [user_write_byte], "SIZEOF_DATAREGION"\n"); + e("add dword [user_write_word], "SIZEOF_DATAREGION"\n"); + e("add dword [user_write_long], "SIZEOF_DATAREGION"\n"); + } + GetArg("edi", 0, 16); + e("mov esi, %s%s\n", id, NameOfContext()); + if (mmx && !(SizeOfContext() & 7)) + { + e("mov ecx, " SIZEOF_CONTEXT " / 8\n"); + EmitLabel(".l"); + e("movq mm6, [esi]\n"); + e("movq [edi], mm6\n"); + e("add esi, byte 8\n"); + e("add edi, byte 8\n"); + e("dec ecx\n"); + e("jnz short .l\n"); + e("emms\n"); + } + else + { + e("mov ecx, " SIZEOF_CONTEXT " / 4\n"); + e("cld\n"); + e("rep movsd\n"); + } + + e("sub dword [fetch], "SIZEOF_FETCHREGION"\n"); + e("sub dword [pcfetch], "SIZEOF_FETCHREGION"\n"); + e("sub dword [super_fetch], "SIZEOF_FETCHREGION"\n"); + e("sub dword [super_pcfetch], "SIZEOF_FETCHREGION"\n"); + e("sub dword [user_fetch], "SIZEOF_FETCHREGION"\n"); + e("sub dword [user_pcfetch], "SIZEOF_FETCHREGION"\n"); + if (memmap_type == 0) + { + e("sub dword [read_byte], "SIZEOF_DATAREGION"\n"); + e("sub dword [read_word], "SIZEOF_DATAREGION"\n"); + e("sub dword [read_long], "SIZEOF_DATAREGION"\n"); + e("sub dword [write_byte], "SIZEOF_DATAREGION"\n"); + e("sub dword [write_word], "SIZEOF_DATAREGION"\n"); + e("sub dword [write_long], "SIZEOF_DATAREGION"\n"); + + e("sub dword [super_read_byte], "SIZEOF_DATAREGION"\n"); + e("sub dword [super_read_word], "SIZEOF_DATAREGION"\n"); + e("sub dword [super_read_long], "SIZEOF_DATAREGION"\n"); + e("sub dword [super_write_byte], "SIZEOF_DATAREGION"\n"); + e("sub dword [super_write_word], "SIZEOF_DATAREGION"\n"); + e("sub dword [super_write_long], "SIZEOF_DATAREGION"\n"); + + e("sub dword [user_read_byte], "SIZEOF_DATAREGION"\n"); + e("sub dword [user_read_word], "SIZEOF_DATAREGION"\n"); + e("sub dword [user_read_long], "SIZEOF_DATAREGION"\n"); + e("sub dword [user_write_byte], "SIZEOF_DATAREGION"\n"); + e("sub dword [user_write_word], "SIZEOF_DATAREGION"\n"); + e("sub dword [user_write_long], "SIZEOF_DATAREGION"\n"); + } + e("pop edi\n"); + e("pop esi\n"); + e("pop ecx\n"); + e("ret\n"); + + /* Turbo68KGetContextSize() */ + EmitGlobalLabel("Turbo68KGetContextSize"); + e("mov eax, "SIZEOF_CONTEXT"\n"); + e("ret\n"); + + /* Turbo68KClearCycles */ + EmitGlobalLabel("Turbo68KClearCycles"); + e("mov dword [cycles], 0\n"); + e("mov dword [remaining], 0\n"); + e("ret\n"); + + /* Turbo68KFreeTimeSlice */ + EmitGlobalLabel("Turbo68KFreeTimeSlice"); + e("push eax\n"); + e("mov eax, [cycles]\n"); + e("sub eax, [remaining]\n"); + e("mov [cycles], eax\n"); + e("mov dword [remaining], 0\n"); + e("pop eax\n"); + e("ret\n"); + + /* Turbo68KGetElapsedCycles */ + Align(4); + EmitGlobalLabel("Turbo68KGetElapsedCycles"); + e("mov eax, [cycles]\n"); + e("sub eax, [remaining]\n"); + e("ret\n"); + + /* Turbo68KProcessInterrupts() */ + + Align(4); + EmitGlobalLabel("Turbo68KProcessInterrupts"); + e("pusha\n"); + e("test byte [status], 1\n"); + e("jnz near .end\n"); /* does not work while running */ + e("mov ecx, [remaining]\n"); + EMULATING(); /* running=1 */ + e("mov esi, [pc]\n"); /* fetch PC */ + UpdateFetchPtr(); + e("call ProcessInterrupts\n"); + STOP_RUNNING(); /* save PC and cycles remaining */ + STOP_EMULATING(); + EmitLabel(".end"); + if (mmx) e("emms\n"); + e("popa\n"); + e("xor eax, eax\n"); + e("ret\n"); + + /* Turbo68KInterrupt() */ + + /* + * Note: This function assumes that TURBO68K_AUTOVECTOR == 256, make + * sure the definition in TURBO68K.H reflects this + * + * If 68K is halted (STOP instruction), if an interrupt with a priority + * equal to or lower than the SR priority is requested, is the interrupt + * made pending or discarded? (ask) Are there any situations when invalid- + * priority interrupts are discarded completely? + */ + + Align(4); + EmitGlobalLabel("Turbo68KInterrupt"); + e("push\tebx\n"); + e("push\tecx\n"); + e("push\tedx\n"); + e("push\tesi\n"); + e("push\tedi\n"); + + GetArg("eax", 0, 24); + + e("test eax, eax\n"); /* 0 is not a valid level */ + e("jz short .inv_level\n"); + e("cmp eax, byte 7\n"); /* if greater than 7, invalid level */ + e("ja short .inv_level\n"); + + GetArg("ebx", 1, 28); /* get vector */ + e("cmp ebx, byte 2\n"); + e("jb short .inv_vector\n"); + e("cmp ebx, 256\n"); + e("ja short .inv_vector\n"); + e("jne short .not_auto\n"); + e("mov ebx, eax\n"); + e("add ebx, byte 24\n"); + EmitLabel(".not_auto"); + e("dec eax\n"); /* (level-1)*4=offset into intr[] */ + e("shl eax, byte 2\n"); + e("cmp [intr+eax], byte 0\n"); + e("jne short .pending\n"); /* already pending */ + e("mov [intr+eax], ebx\n"); /* store vector into intr[] */ + e("inc dword [intr+7*4]\n"); /* one interrupt added */ + e("pop\tedi\n"); + e("pop\tesi\n"); + e("pop\tedx\n"); + e("pop\tecx\n"); + e("pop\tebx\n"); + e("xor eax, eax\n"); + e("ret\n"); + + EmitLabel(".inv_level"); + e("mov eax, %d\n", TURBO68K_ERROR_INTLEVEL); + e("pop\tedi\n"); + e("pop\tesi\n"); + e("pop\tedx\n"); + e("pop\tecx\n"); + e("pop\tebx\n"); + e("ret\n"); + EmitLabel(".inv_vector"); + e("mov eax, %d\n", TURBO68K_ERROR_INTVECTOR); + e("pop\tedi\n"); + e("pop\tesi\n"); + e("pop\tedx\n"); + e("pop\tecx\n"); + e("pop\tebx\n"); + e("ret\n"); + EmitLabel(".pending"); + e("mov eax, %d\n", TURBO68K_ERROR_INTPENDING); + e("pop\tedi\n"); + e("pop\tesi\n"); + e("pop\tedx\n"); + e("pop\tecx\n"); + e("pop\tebx\n"); + e("ret\n"); + + /* Turbo68KCancelInterrupt */ + + EmitGlobalLabel("Turbo68KCancelInterrupt"); + e("push\tebx\n"); + e("push\tecx\n"); + e("push\tedx\n"); + e("push\tesi\n"); + e("push\tedi\n"); + GetArg("eax", 0, 24); + e("test eax, eax\n"); /* 0 is not a valid level */ + e("jz short .inv_level\n"); + e("cmp eax, byte 7\n"); /* if greater than 7, invalid level */ + e("ja short .inv_level\n"); + e("test byte [status], 0x04\n"); /* processing interrupts? */ + e("jnz short .busy\n"); /* yep... can't do this */ + e("dec eax\n"); /* make index into intr[] */ + e("cmp dword [intr+eax*4], byte 0\n"); + e("je .nothing_to_cancel\n"); + e("mov dword [intr+eax*4], 0\n"); + e("dec dword [intr+7*4]\n"); /* removed 1 interrupt */ + EmitLabel(".busy"); + EmitLabel(".nothing_to_cancel"); + + e("pop\tedi\n"); + e("pop\tesi\n"); + e("pop\tedx\n"); + e("pop\tecx\n"); + e("pop\tebx\n"); + e("xor eax, eax\n"); + e("ret\n"); + EmitLabel(".inv_level"); + e("pop\tedi\n"); + e("pop\tesi\n"); + e("pop\tedx\n"); + e("pop\tecx\n"); + e("pop\tebx\n"); + e("mov eax, %d\n", TURBO68K_ERROR_INTLEVEL); + e("ret\n"); + + /* + * ProcessInterrupts: Processes any pending interrupts if allowed. + * Assumes all registers have been set up as per Turbo68KRun + */ + + Align(4); + EmitLabel("ProcessInterrupts"); + INTERRUPT_PROCESSING(); + e("cmp dword [intr+7*4], byte 0\n"); + e("je near .no_int_end\n"); /* no interrupts pending */ + e("push eax\n"); /* EAX=flags, save it! */ + e("mov al, [sr+1]\n"); + e("and eax, byte 7\n"); /* EAX=interrupt priority */ + e("cmp al, 7\n"); + e("jne short .no_int7\n"); + e("mov edi, intr+6*4\n"); + e("jmp short .l\n"); + EmitLabel(".no_int7"); + e("mov edi, eax\n"); + e("shl edi, byte 2\n"); /* *4, index into intr[] */ + e("add edi, intr\n"); /* EDI=interrupt queue */ + e("inc al\n"); /* new SR priority mask */ + EmitLabel(".l"); + e("cmp dword [edi], byte 0\n"); + e("je near .skip\n"); /* no interrupt at this level */ + + e("test byte [sr+1], 0x20\n"); /* see if in User mode */ + e("jnz short .no_sp_magic\n"); /* nope, don't need to swap SPs */ + e("mov edx, [__sp]\n"); + e("xchg [a+7*4], edx\n"); + e("mov [__sp], edx\n"); + SetSupervisorAddressSpace(); + EmitLabel(".no_sp_magic"); + + e("mov ebx, [a+7*4]\n"); /* SP */ + /* + * If 68010, we have to push the format word on the stack. + */ + if (mpu == 68010) + { + e("mov edx, [edi]\n"); /* vector number */ + e("sub ebx, byte 2\n");/* SP-2 */ + e("shl edx, byte 2\n");/* vector*4 for offset */ + e("push ebx\n"); + e("push edi\n"); + WriteWord(); + e("pop edi\n"); + e("pop ebx\n"); + } + e("mov edx, [pc]\n"); /* get old PC */ + e("sub ebx, byte 4\n"); /* SP-4 */ + e("push ebx\n"); + e("push edi\n"); + WriteLong(); + e("pop edi\n"); + e("pop ebx\n"); + e("mov edx, [sr]\n"); /* get SR */ + e("sub ebx, byte 2\n"); /* SP-2 */ + e("push edi\n"); + e("push ebx\n"); + WriteWord(); /* save SR to stack */ + e("pop ebx\n"); + e("pop edi\n"); + e("mov dh, al\n"); /* new interrupt priority bits */ + e("or dh, 0x20\n"); /* set supervisor for exception */ + e("and edx, 0xa71f\n"); /* clear unwanted bits */ + e("mov [sr], edx\n"); /* set new SR */ + e("mov [a+7*4], ebx\n"); /* write back SP */ + e("mov ebx, [edi]\n"); /* vector of interrupt */ + + e("test dword [InterruptAcknowledge], -1\n"); /* interrupt call-back */ + e("jz short .no_interrupt_ack_handler\n"); + e("pushad\n"); + e("push ebx\n"); + e("call dword [InterruptAcknowledge]\n"); + e("add esp, byte 4\n"); + e("popad\n"); + e(".no_interrupt_ack_handler:\n"); + + e("shl ebx, byte 2\n"); /* vector *= 4 */ + if (mpu == 68010) + e("add ebx, [vbr]\n"); + e("push edi\n"); + ReadLong(); /* get PC */ + e("pop edi\n"); + e("mov [pc], edx\n"); /* set new PC */ + e("mov dword [edi], 0\n"); /* done w/ this interrupt */ + e("dec dword [intr+7*4]\n"); /* processed 1 interrupt... */ + e("sub ecx, byte 44\n"); /* interrupts take 44 clocks */ + UNSTOP_CPU(); + EmitLabel(".skip"); + e("add edi, byte 4\n"); + e("inc al\n"); /* next entry */ + e("cmp edi, intr+7*4\n"); + e("jne near .l\n"); + e("mov esi, [pc]\n"); + e("pop eax\n"); /* get flags back */ + UpdateFetchPtr(); + EmitLabel(".no_int_end"); + INTERRUPT_DONE(); + e("ret\n"); + + + /* Turbo68KRun() */ + + Align(4); + EmitGlobalLabel("Turbo68KRun"); + e("pusha\n"); + GetArg("ecx", 0, 36); /* ECX = cycles */ + e("mov [cycles], ecx\n"); + e("mov [remaining], ecx\n"); + e("test byte [sr+1], 0x20\n"); + e("jz near .set_user_space\n"); + SetSupervisorAddressSpace(); + e("jmp near .continue\n"); + EmitLabel(".set_user_space"); + SetUserAddressSpace(); + EmitLabel(".continue"); + EMULATING(); /* running=1 */ + e("mov esi, [pc]\n"); /* fetch PC */ + UpdateFetchPtr(); + LoadCCR(); /* get flags */ + e("call ProcessInterrupts\n"); + e("test byte [status], 2\n"); /* stopped? */ + e("jnz short .stopped\n"); + e("xor edi, edi\n"); + e("mov di, [esi]\n"); /* next instruction */ + e("add esi, byte 2\n"); + e("jmp dword [jmptab+edi*4]\n"); /* jump... */ + EmitLabel(".stopped"); + e("xor ecx, ecx\n"); + e("jmp Turbo68KRun_done\n"); + + Align(4); + EmitLabel("Turbo68KRun_done"); + SaveCCR(); /* save flags */ + STOP_RUNNING(); /* save PC and cycles */ + STOP_EMULATING(); + if (mmx) e("emms\n"); + e("popa\n"); + e("xor eax, eax\n"); /* everything okay... */ + e("ret\n"); + + /* + * NOTE: Only the 68010 RTE handler can call this. PC is assumed to point + * one word after the faulty RTE. + */ + + if (mpu == 68010) + { + EmitLabel("stackframe_error"); + e("sub esi, byte 2\n"); /* point at faulty RTE */ + SaveCCR(); + STOP_EMULATING(); + STOP_RUNNING(); /* save PC and cycles remaining */ + e("popa\n"); + e("mov eax, %d\n", TURBO68K_ERROR_STACKFRAME); + e("ret\n"); + } + + + if (memmap_type == 2) /* low level handling? don't generate the rest */ + return; + + /* + * ReadXXXXPC: EBX = address + * Out: EDX = data; DL=byte, EDX=upper 32-bits trashed, DX=word, + * EDX=long-word + * EBX=address + * Notes: EDI is trashed in the process, but cleared at the end. + * These functions read from the *pcfetch areas. There are no + * SX functions, this is handled by the emitter. I did this to + * save space. + */ + + if (pcfetch) + { + for (i = 0; i < 3; i++) /* 0=byte, 1=word, 2=dword */ + { + CacheAlign(); + switch (i) + { + case 0: + EmitLabel("ReadBytePC"); + break; + case 1: + EmitLabel("ReadWordPC"); + break; + case 2: + EmitLabel("ReadLongPC"); + break; + } + e("mov edi, [pcfetch]\n"); + SaveReg("memhandler", "ebx"); /* save address */ + AddrClip("ebx"); + EmitLabel(".loop"); + e("add edi, byte "SIZEOF_FETCHREGION"\n"); + e("cmp dword [edi], byte -1\n"); /* base=-1? end. */ + e("je short .not_found\n"); + e("cmp ebx, [edi]\n"); /* offset 0: base. above it? */ + e("jb short .loop\n"); /* nope, not this region */ + e("cmp ebx, [edi+"OFFSET_FETCH_LIMIT"]\n"); /* limit. below it? */ + e("ja short .loop\n"); /* nope, not this region */ + e("mov edx, ebx\n"); + if (!i) /* byte accesses need this because buffer is swapped */ + e("xor dl, 1\n"); + e("add edx, [edi+"OFFSET_FETCH_PTR"]\n"); /* into ptr.. */ + if (!i) /* byte */ + e("mov dl, [edx]\n"); /* fetch */ + else if (i == 1) /* word */ + e("mov edx, [edx]\n"); + else /* long */ + { + e("mov edx, [edx]\n"); + e("rol edx, byte 16\n"); /* swap words */ + } + e("xor edi, edi\n"); + RestoreReg("memhandler", "ebx"); + e("ret\n"); + Align(4); + EmitLabel(".not_found"); + e("xor edi, edi\n"); + e("xor edx, edx\n"); + e("dec edx\n"); /* not found, return all 1s */ + RestoreReg("memhandler", "ebx"); + e("ret\n"); + } + } + + /* + * ReadXXXX: EBX = address + * Out: EDX = data; DL=byte, EDX=upper 32-bits trashed, DX=word, + * EDX=long-word + * EBX=address + * Notes: EDI is trashed in the process, but cleared at the end. + * This applies to all ReadXXX and WriteXXX handlers, some + * instructions (NEGX) rely on this behavior. + */ + + if (memmap_type == 0) /* default memory mapping system */ + { + for (i = 0; i < 3; i++) /* 0=byte, 1=word, 2=dword */ + { + CacheAlign(); + switch (i) + { + case 0: + EmitLabel("ReadByte"); + e("mov edi, [read_byte]\n"); + break; + case 1: + EmitLabel("ReadWord"); + e("mov edi, [read_word]\n"); + break; + case 2: + EmitLabel("ReadLong"); + e("mov edi, [read_long]\n"); + break; + } + SaveReg("memhandler", "ebx"); /* save address */ + AddrClip("ebx"); + EmitLabel(".loop"); + e("add edi, byte "SIZEOF_DATAREGION"\n"); + e("cmp dword [edi], byte -1\n"); /* base=-1? end. */ + e("je short .not_found\n"); + e("cmp ebx, [edi]\n"); /* offset 0: base. above it? */ + e("jb short .loop\n"); /* nope, not this region */ + e("cmp ebx, [edi+"OFFSET_DATA_LIMIT"]\n"); /* limit. below it? */ + e("ja short .loop\n"); /* nope, not this region */ + e("cmp dword [edi+"OFFSET_DATA_PTR"], byte 0\n"); + e("je short .read_from_handler\n"); + e("mov edx, ebx\n"); + if (!i) /* byte accesses need this because buffer is swapped */ + e("xor dl, 1\n"); + e("add edx, [edi+"OFFSET_DATA_PTR"]\n"); /* into ptr.. */ + if (!i) /* byte */ + e("mov dl, [edx]\n"); /* fetch */ + else if (i == 1) /* word */ + e("mov edx, [edx]\n"); + else /* long */ + { + e("mov edx, [edx]\n"); + e("rol edx, byte 16\n"); /* swap words */ + } + e("xor edi, edi\n"); + RestoreReg("memhandler", "ebx"); + e("ret\n"); + Align(4); + EmitLabel(".not_found"); + e("xor edi, edi\n"); + e("xor edx, edx\n"); + e("dec edx\n"); /* not found, return all 1s */ + RestoreReg("memhandler", "ebx"); + e("ret\n"); + Align(4); + EmitLabel(".read_from_handler"); + SaveReg("memhandler", "eax"); + SaveReg("memhandler", "ebp"); + WRITEPCTOMEM("pc"); /* saves esi */ + e("mov [remaining], ecx\n"); + + /* address */ + if (!call_convention) /* stack-based */ + e("push ebx\n"); + else /* register-based */ + e("mov eax, ebx\n"); + + e("call dword [edi+"OFFSET_DATA_HANDLER"]\n"); + + if (!call_convention) + e("add esp, byte 4\n"); + + e("mov edx, eax\n"); /* get the data */ + e("mov esi, [pc]\n"); /* handler could have changed PC */ + e("mov ecx, [remaining]\n");/* this could have been changed */ + RestoreReg("memhandler", "eax"); + RestoreReg("memhandler", "ebp"); + e("add esi, ebp\n"); /* base+pc=pc pointer */ + e("xor edi, edi\n"); /* keep clear for fetch */ + RestoreReg("memhandler", "ebx"); + e("ret\n"); + } + } + else if (memmap_type == 1) /* high level handler */ + { + for (i = 0; i < 3; i++) + { + CacheAlign(); + switch (i) + { + case 0: EmitLabel("ReadByte"); break; + case 1: EmitLabel("ReadWord"); break; + case 2: EmitLabel("ReadLong"); break; + } + SaveReg("memhandler", "ebx"); /* save address */ + AddrClip("ebx"); + SaveReg("memhandler", "eax"); + SaveReg("memhandler", "ebp"); + WRITEPCTOMEM("pc"); /* saves esi */ + e("mov [remaining], ecx\n"); + + /* address */ + if (!call_convention) /* stack-based */ + e("push ebx\n"); + else /* register-based */ + e("mov eax, ebx\n"); + + switch (i) + { + case 0: e("call dword [read_byte]\n"); break; + case 1: e("call dword [read_word]\n"); break; + case 2: e("call dword [read_long]\n"); break; + } + + if (!call_convention) + e("add esp, byte 4\n"); + + e("mov edx, eax\n"); /* get the data */ + e("mov esi, [pc]\n"); /* handler could have changed PC */ + e("mov ecx, [remaining]\n");/* this could have been changed */ + RestoreReg("memhandler", "eax"); + RestoreReg("memhandler", "ebp"); + e("add esi, ebp\n"); /* base+pc=pc pointer */ + e("xor edi, edi\n"); /* keep clear for fetch */ + RestoreReg("memhandler", "ebx"); + e("ret\n"); + } + } + + if (memmap_type == 0) + { + /* + * ReadWordSX is the same as ReadWord except that it sign extends the + * word to 32 bits. + */ + + CacheAlign(); + EmitLabel("ReadWordSX"); + e("mov edi, [read_word]\n"); + SaveReg("memhandler", "ebx"); /* save address */ + AddrClip("ebx"); + EmitLabel(".loop"); + e("add edi, byte "SIZEOF_DATAREGION"\n"); + e("cmp dword [edi], byte -1\n"); + e("je short .not_found\n"); + e("cmp ebx, [edi]\n"); + e("jb short .loop\n"); + e("cmp ebx, [edi+"OFFSET_DATA_LIMIT"]\n"); + e("ja short .loop\n"); + e("cmp dword [edi+"OFFSET_DATA_PTR"], byte 0\n"); + e("je short .read_from_handler\n"); + e("mov edx, ebx\n"); + e("add edx, [edi+"OFFSET_DATA_PTR"]\n"); + e("movsx edx, word [edx]\n"); /* sign extend! */ + e("xor edi, edi\n"); + RestoreReg("memhandler", "ebx"); + e("ret\n"); + Align(4); + EmitLabel(".not_found"); + e("xor edi, edi\n"); + e("xor edx, edx\n"); + e("dec edx\n"); /* not found, return all 1s */ + RestoreReg("memhandler", "ebx"); + e("ret\n"); + Align(4); + EmitLabel(".read_from_handler"); + SaveReg("memhandler", "eax"); + SaveReg("memhandler", "ebp"); + WRITEPCTOMEM("pc"); + e("mov [remaining], ecx\n"); + + /* address */ + if (!call_convention) /* stack-based */ + e("push ebx\n"); + else /* register-based */ + e("mov eax, ebx\n"); + + e("call dword [edi+"OFFSET_DATA_HANDLER"]\n"); + + if (!call_convention) + e("add esp, byte 4\n"); + + e("movsx edx, ax\n"); /* sign extend! */ + e("mov esi, [pc]\n"); + e("mov ecx, [remaining]\n"); + RestoreReg("memhandler", "eax"); + RestoreReg("memhandler", "ebp"); + e("add esi, ebp\n"); + e("xor edi, edi\n"); + RestoreReg("memhandler", "ebx"); + e("ret\n"); + } + else if (memmap_type == 1) + { + CacheAlign(); + EmitLabel("ReadWordSX"); + SaveReg("memhandler", "ebx"); /* save address */ + AddrClip("ebx"); + SaveReg("memhandler", "eax"); + SaveReg("memhandler", "ebp"); + WRITEPCTOMEM("pc"); /* saves esi */ + e("mov [remaining], ecx\n"); + + /* address */ + if (!call_convention) /* stack-based */ + e("push ebx\n"); + else /* register-based */ + e("mov eax, ebx\n"); + + e("call dword [read_word]\n"); + + if (!call_convention) + e("add esp, byte 4\n"); + + e("movsx edx, ax\n"); /* sign extend */ + + e("mov esi, [pc]\n"); /* handler could have changed PC */ + e("mov ecx, [remaining]\n");/* this could have been changed */ + RestoreReg("memhandler", "eax"); + RestoreReg("memhandler", "ebp"); + e("add esi, ebp\n"); /* base+pc=pc pointer */ + e("xor edi, edi\n"); /* keep clear for fetch */ + RestoreReg("memhandler", "ebx"); + e("ret\n"); + } + + /* + * WriteXXXX: EBX = address + * In: EDX = data; DL=byte, EDX{DX}=word, + * EDX=long-word + * Out: EBX=trashed, EDX=preserved + * Notes: EDI is trashed in the process, but cleared at the end + */ + + if (memmap_type == 0) + { + for (i = 0; i < 3; i++) /* 0=byte, 1=word, 2=dword */ + { + CacheAlign(); + switch (i) + { + case 0: + EmitLabel("WriteByte"); + e("mov edi, [write_byte]\n"); + break; + case 1: + EmitLabel("WriteWord"); + e("mov edi, [write_word]\n"); + break; + case 2: + EmitLabel("WriteLong"); + e("mov edi, [write_long]\n"); + break; + } + AddrClip("ebx"); + EmitLabel(".loop"); + e("add edi, byte "SIZEOF_DATAREGION"\n"); + e("cmp dword [edi], byte -1\n"); /* base=-1? end. */ + e("je short .not_found\n"); + e("cmp ebx, [edi]\n"); /* offset 0: base. above it? */ + e("jb short .loop\n"); /* nope, not this region */ + e("cmp ebx, [edi+"OFFSET_DATA_LIMIT"]\n"); /* limit. below it? */ + e("ja short .loop\n"); /* nope, not this region */ + e("cmp dword [edi+"OFFSET_DATA_PTR"], byte 0\n"); + e("je short .write_with_handler\n"); + if (!i) /* byte accesses need this because buffer is swapped */ + e("xor bl, 1\n"); + e("add ebx, [edi+"OFFSET_DATA_PTR"]\n"); /* into ptr.. */ + if (!i) /* byte */ + e("mov [ebx], dl\n"); /* write */ + else if (i == 1) /* word */ + e("mov [ebx], dx\n"); + else /* long */ + { + e("ror edx, byte 16\n"); /* swap words */ + e("mov [ebx], edx\n"); + e("ror edx, byte 16\n"); /* reswap back */ + } + EmitLabel(".not_found"); + e("xor edi, edi\n"); + RestoreReg("memhandler", "ebx"); + e("ret\n"); + Align(4); + EmitLabel(".write_with_handler"); + SaveReg("memhandler", "eax"); + SaveReg("memhandler", "ebp"); + WRITEPCTOMEM("pc"); /* saves esi */ + e("mov [remaining], ecx\n"); + SaveReg("memhandler", "edx"); /* save params */ + + /* data, address */ + if (!call_convention) /* stack-based */ + { + e("push edx\n"); + e("push ebx\n"); + } + else /* register-based */ + { + e("mov eax, ebx\n"); + /* don't need: e("mov edx, edx\n"); */ + } + + e("call dword [edi+"OFFSET_DATA_HANDLER"]\n"); + + if (!call_convention) + e("add esp, byte 8\n"); + + RestoreReg("memhandler", "edx"); /* restore params */ + e("mov esi, [pc]\n"); + e("mov ecx, [remaining]\n"); /* this could have been changed */ + RestoreReg("memhandler", "eax"); + RestoreReg("memhandler", "ebp"); + e("add esi, ebp\n"); /* base+pc=pc pointer */ + e("xor edi, edi\n"); /* keep clear for fetch */ + e("ret\n"); + } + } + else if (memmap_type == 1) + { + for (i = 0; i < 3; i++) + { + CacheAlign(); + switch (i) + { + case 0: EmitLabel("WriteByte"); break; + case 1: EmitLabel("WriteWord"); break; + case 2: EmitLabel("WriteLong"); break; + } + AddrClip("ebx"); + SaveReg("memhandler", "eax"); + SaveReg("memhandler", "ebp"); + WRITEPCTOMEM("pc"); /* saves esi */ + e("mov [remaining], ecx\n"); + SaveReg("memhandler", "edx"); /* save params */ + + /* data, address */ + if (!call_convention) /* stack-based */ + { + e("push edx\n"); + e("push ebx\n"); + } + else /* register-based */ + { + e("mov eax, ebx\n"); + /* don't need: e("mov edx, edx\n"); */ + } + + switch (i) + { + case 0: e("call dword [write_byte]\n"); break; + case 1: e("call dword [write_word]\n"); break; + case 2: e("call dword [write_long]\n"); break; + } + + if (!call_convention) + e("add esp, byte 8\n"); + + RestoreReg("memhandler", "edx"); /* restore params */ + e("mov esi, [pc]\n"); + e("mov ecx, [remaining]\n"); /* this could have been changed */ + RestoreReg("memhandler", "eax"); + RestoreReg("memhandler", "ebp"); + e("add esi, ebp\n"); /* base+pc=pc pointer */ + e("xor edi, edi\n"); /* keep clear for fetch */ + e("ret\n"); + } + } +} + + +/***************************************************************************** +* main() and Friends */ + +int FindV(char *option, int p, int h, int u, int argc, char **argv, int m) +{ + static int t[128] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 + }; + int i; + char *c; + + if (m) /* mark as touched */ + { + if (m < 128) + t[m] = 1; + return 0; + } + if (argc > 128) + argc = 128; /* maximum this function can handle is 128 */ + + if (u) /* find first untouched element */ + { + for (i = 1; i < argc; i++) + { + if (!t[i]) /* 0 indicates untouched */ + return i; + } + return 0; + } + + if (p) /* find option and return integer value following it */ + { + for (i = 1; i < argc; i++) + { + if (strcmp(argv[i], option) == 0) /* found */ + { + if (i >= (argc - 1)) /* bounds! */ + return 0; + t[i + 1] = t[i] = 1; /* touched */ + if (!h) + return atoi(argv[i + 1]); + else + return strtoul(argv[i + 1], &c, 16); + } + } + return 0; /* no match */ + } + else /* find option and return position */ + { + for (i = 1; i < argc; i++) + { + if (strcmp(argv[i], option) == 0) + { + t[i] = 1; + return i; /* found! return position */ + } + } + return 0; + } + return 0; +} + +void ShowHelp() +{ + printf("Make68K Version "VERSION" by Bart Trzynadlowski: Turbo68K Source Emitter\n"); + printf("Usage: make68k [options]\n"); + printf("Options: -?,-h Show this help text\n"); + printf(" -mpu Processor to emulate [Default=68000]\n"); + printf(" -addr Address bus width [Default=24]\n"); + printf(" -illegal Emulate illegal instruction exceptions [Default]\n"); + printf(" -noillegal Treat illegal instructions as errors\n"); + printf(" -dummyread Emulate 68000 dummy reads [Default]\n"); + printf(" -nodummyread Do not emulate dummy reads\n"); + printf(" -skip Skip over idle loops\n"); + printf(" -noskip Do not skip over idle loops [Default]\n"); + printf(" -brafetch Update fetch pointer on Bcc, BRA, BSR, DBcc\n"); + printf(" -nobrafetch Do not update fetch pointer for branches [Default]\n"); + printf(" -pcfetch Special PC-relative read mode\n"); + printf(" -nopcfetch Use data regions for PC-relative reading [Default]\n"); + printf(" -multiaddr Address spaces for supervisor and user [Default]\n"); + printf(" -singleaddr Single address space for supervisor and user\n"); + printf(" -defmap Definable memory map arrays [Default]\n"); + printf(" -handler Single handlers for memory access\n"); + printf(" -stackcall Stack calling conventions [Default]\n"); + printf(" -regcall Register calling conventions\n"); + printf(" -id Add string to beginning of identifiers\n"); + exit(0); +} + +void SetAddrMask(int num_bits) +{ + addr_bits = num_bits; + if (!num_bits) + { + addr_mask = 0xffffff; /* 24-bit is default address bus width */ + addr_bits = 24; + } + else + addr_mask = (unsigned) pow(2, num_bits) - 1; +} + +int main(int argc, char **argv) +{ + int i, j, k, l, f; + +#ifdef PROFILE + for (i = 0; i < 512; i++) prof[i] = NULL; +#endif + + if (argc <= 1 || FindV("-?", 0, 0, 0, argc, argv, 0) || FindV("-h", 0, 0, 0, argc, argv, 0)) + ShowHelp(); + + mpu = FindV("-mpu", 1, 0, 0, argc, argv, 0); + switch (mpu) /* make sure a valid MPU type was specified */ + { + case 0: + mpu = 68000; + break; + case 68000: + case 68010: + break; + default: + fprintf(stderr, "Make68K: Unknown or unsupported processor type: %d\n", mpu); + exit(1); + } + SetAddrMask(FindV("-addr", 1, 0, 0, argc, argv, 0)); + if (FindV("-illegal", 0, 0, 0, argc, argv, 0)) illegal = 1; + if (FindV("-noillegal", 0, 0, 0, argc, argv, 0)) illegal = 0; + if (FindV("-dummyread", 0, 0, 0, argc, argv, 0)) dummyread = 1; + if (FindV("-nodummyread", 0, 0, 0, argc, argv, 0)) dummyread = 0; + if (FindV("-skip", 0, 0, 0, argc, argv, 0)) skip = 1; + if (FindV("-noskip", 0, 0, 0, argc, argv, 0)) skip = 0; + if (FindV("-brafetch", 0, 0, 0, argc, argv, 0)) brafetch = 1; + if (FindV("-nobrafetch", 0, 0, 0, argc, argv, 0)) brafetch = 0; + if (FindV("-pcfetch", 0, 0, 0, argc, argv, 0)) pcfetch = 1; + if (FindV("-nopcfetch", 0, 0, 0, argc, argv, 0)) pcfetch = 0; + if (FindV("-multiaddr", 0, 0, 0, argc, argv, 0)) multiaddr = 1; + if (FindV("-singleaddr", 0, 0, 0, argc, argv, 0)) multiaddr = 0; + if (FindV("-defmap", 0, 0, 0, argc, argv, 0)) memmap_type = 0; + if (FindV("-handler", 0, 0, 0, argc, argv, 0)) memmap_type = 1; + if (FindV("-stackcall", 0, 0, 0, argc, argv, 0)) call_convention = 0; + if (FindV("-regcall", 0, 0, 0, argc, argv, 0)) call_convention = 1; + + if ((i = FindV("-id", 0, 0, 0, argc, argv, 0))) + { + if ((i + 1) < argc) /* make sure we're within argv[] bounds */ + { + if (strlen(argv[i + 1]) > 16) + { + fprintf(stderr, "Make68K: Identifier string is too long (maximum is 16 characters)\n"); + exit(1); + } + strncpy(id, argv[i + 1], 16); + FindV(NULL, 0, 0, 0, argc, argv, i + 1); + } + } + + if (!(f = FindV(NULL, 0, 0, 1, argc, argv, 0))) + { + fprintf(stderr, "Make68K: No output file specified\n"); + exit(1); + } + if ((fp = fopen(argv[f], "w")) == NULL) + { + fprintf(stderr, "Make68K: Failed to open file for writing: %s\n", argv[f]); + exit(1); + } + + for (i = 0; i < 65536; i++) decoded[i] = 0; + + printf("Make68K Version "VERSION" by Bart Trzynadlowski: Turbo68K Source Emitter\n"); + printf("\n"); + printf("Emitting file: %s\n", argv[f]); + printf("Configuration:\n"); + + e(";\n"); + e("; Turbo68K Version "VERSION": Motorola 680X0 emulator\n"); + e("; Copyright 2000-2002 Bart Trzynadlowski, see \"README.TXT\" for terms of use\n"); + e("; Assemble with NASM (http://www.web-sites.co.uk/nasm) only\n"); + e(";\n"); + e("; Configuration:\n"); + printf("- %d processor\n", mpu); + e("; - %d processor\n", mpu); + printf("- %d-bit addresses\n", addr_bits); + e("; - %d-bit addresses\n", addr_bits); + printf("- %s\n", illegal ? "Illegal instruction, Line 1010, and Line 1111 exceptions" : "Illegal instructions reported as errors"); + e("; - %s\n", illegal ? "Illegal instruction, Line 1010, and Line 1111 exceptions" : "Illegal instructions reported as errors"); + if (mpu == 68000) + { + printf("- Dummy reads %s\n", dummyread ? "emulated" : "not emulated"); + e("; - Dummy reads %s\n", dummyread ? "emulated" : "not emulated"); + } + printf("- Idle loop skipping %s\n", skip ? "enabled" : "disabled"); + e("; - Idle loop skipping %s\n", skip ? "enabled" : "disabled"); + printf("- Fetch pointer%supdated for Bcc, BRA, BSR, and DBcc\n", brafetch ? " " : " not "); + e("; - Fetch pointer%supdated for Bcc, BRA, BSR, and DBcc\n", brafetch ? " " : " not "); + printf("- %s regions used for PC-relative reading\n", pcfetch ? "Special PC fetch" : "Data"); + e("; - %s regions used for PC-relative reading\n", pcfetch ? "Special PC fetch" : "Data"); + printf("- %s for supervisor and user\n", multiaddr ? "Separate address spaces" : "Single address space"); + e("; - %s for supervisor and user\n", multiaddr ? "Separate address spaces" : "Single address space"); + switch (memmap_type) + { + case 0: printf("- Definable memory map arrays\n"); + e("; - Definable memory map arrays\n"); + break; + case 1: printf("- Single memory handlers\n"); + e("; - Single memory handlers\n"); + break; + case 2: printf("- Low-level memory handlers\n"); + e("; - Low-level memory handlers\n"); + break; + } + printf("- %s calling conventions\n", call_convention ? "Register" : "Stack"); + e("; - %s calling conventions\n", call_convention ? "Register" : "Stack"); + if (id[0] != '\0') + { + printf("- Identifers start with: %s\n", id); + e("; - Identifiers start with: %s\n", id); + } + e(";\n"); + printf("\n"); + e("bits 32\n"); + e("section .data\n"); + EmitData(); + e("section .text\n"); + EmitCode(); + printf("Generating instruction handlers:\n"); + EmitInstructions(); + EmitExceptions(); + e("section .bss\n"); + CacheAlign(); + e("jmptab resd 65536\n"); + + + /* + * Emit the compressed jump table + * + * Format: + * dw 0x8000 + # ; # of handler addresses follow, each repeated 8 times + * ... dd # ... ; handler addresses... + * dw 0xc000 + # ; # of handler addresses follow, each repeated 1 time + * ... dd # ... ; handler addresses... + * dw 0x0000 + # ; repeat following address handler # times + * dd # ; handler address to repeat + * dd -1 ; terminator + */ + + e("section .data\n"); + Align(4); + e("compressed_jmptab:\n"); + + i = 0; + j = 0; + while (i < 65536) + { + if (!decoded[i]) /* invalid */ + { + for (i = i; decoded[i] == 0 && i < 65536; i++) j++; + e("dw 0x0000 + %d\n", j); + e("dd I_Invalid\n"); + j = 0; + } + else + { + if (decoded[i] == 8) /* if more handlers*8, make a big block */ + { + k = 0; + l = i; /* save opcode # */ + while (decoded[i] == 8) + { + i += decoded[i]; + k++; + } + e("dw 0x8000 + %d\n", k); /* # of handlers w/ 8 reps */ + while (k != 0) /* list handlers */ + { + e("dd I%04X\n", l); + l += decoded[l]; + k--; + } + } + if (decoded[i] == 1) /* if more handlers*1, make a big block */ + { + k = 0; + l = i; /* save opcode # */ + while (decoded[i] == 1) + { + i += decoded[i]; + k++; + } + e("dw 0xc000 + %d\n", k); /* # of handlers w/ 1 reps */ + while (k != 0) /* list handlers */ + { + e("dd I%04X\n", l); + l += decoded[l]; + k--; + } + } + else if (decoded[i] == 0) /* invalid instruction */ + { + e("dw 1\n"); + e("dd I_Invalid\n"); + i++; + } + else /* misc. */ + { + e("dw %d\n", decoded[i]); /* # of valids */ + e("dd I%04X\n", i); /* opcode */ + i += decoded[i]; + } + } + } + e("dd -1\n"); + + /* + * Emit profile data + * + * Step 1: Output the names of the instructions. + * Step 2: Output the usage count variables and pointers to the strings. + */ + +#ifdef PROFILE + for (i = 0; prof[i] != NULL && i < 512; i++) + e("str%s db \"%s\",0\n", prof[i], prof[i]); + e("global _t68k_prof\n"); + e("_t68k_prof: dd begin_t68k_prof\n"); + e("begin_t68k_prof:\n"); + for (i = 0; prof[i] != NULL && i < 512; i++) + { + e("prof%s dd 0, str%s\n", prof[i], prof[i]); + free(prof[i]); + } + e("dd -1, -1\n"); +#endif + + fclose(fp); + + printf("Total:\t%d\n", num_handlers); + printf("\nSee \"README.TXT\" for terms of use and documentation!\n"); + return 0; +} + +/* + * + * Developers' Notes: A Guide to the Guts of Turbo68K ;) + * ----------------------------------------------------- + * + * Register Usage: + * + * EAX: ****************NZ*****C*******V + * AH: NZ*****C AL: *******V + * EBX: Address + * ECX: Cycle counter + * EDX: Data + * ESI: Current fetch (PC) pointer + * EDI: Instruction fetch/decoding (keep upper 16 bits clear!). At the + * beginning of any instruction handler, contains opcode in lower 16 bits + * EBP: Pointer to base of PC region. May be below the base if the unused PC + * bits are non-zero + * --- + * MMX optimizations are unsupported -- DO NOT USE THEM! They happen to slow + * things down + * + * MMX Register Usage: + * + * MM0: Saved EAX (memhandler_eax) + * MM1: Saved EBX (memhandler_ebx) + * MM2: Saved EBP (memhandler_ebp) + * MM3: Saved EDX (run_edx) + * MM4: Saved ESI (run_esi) + * MM5: Saved EDI (run_edi) + * MM6,MM7: Misc. usage + * --- + * Format of context.intr[]: + * + * intr[0-6] = Interrupt levels 1-7, elements contain the vector #, if 0 then + * no interrupt is pending at this level + * intr[7] = Number of interrupts pending (set to 0 at reset) + * --- + * Format of context.status: + * + * 0000 0000 0000 0000 0000 0000 0000 0ISR + * + * I=Interrupt; 1=interrupts being processed, 0=not + * S=Stop; 1=68K is stopped (STOP instruction), 0=not + * R=Running; 1=68K is running, 0=not + * --- + * Format of decoded[]: + * + * [0] = 1: 2 opcode 0 handlers + * [1] = 0: see above.. this is unused + * [2] = next handler... (0 + 2) + * --- + * SR values obtained from instructions are ANDed with 0xa71f to mask out + * unused bits. CCR values are ANDed with 0x1f to mask out the unused bits. + * This is how a real 68K behaves. + * --- + * Memory mapping types: The low-level handler mode code is present, but not + * accessible. I decided to forbid using it because of performance problems. + * --- + * The unused address bits of the PC are preserved. They are only lost if the + * PC goes out of bounds. + */ diff --git a/CPU/68K/README.TXT b/CPU/68K/README.TXT new file mode 100644 index 0000000..c9d9a41 --- /dev/null +++ b/CPU/68K/README.TXT @@ -0,0 +1,1299 @@ + + + ###### ## ## ###### ###### ##### #### ##### ### ## + # ## # ## ## ## ## ## ### ## ## ## ## ## ## ## + ## ## ## ## ## ## ## ## ## ## ## ## ## ## + ## ## ## ##### ##### ## ## ###### ##### #### + ## ## ## #### ## ## ## ## ## ## ## ## #### + ## ## ## ## ## ## ### ## ## ## ## ## ## ## ## + #### #### ### ## ###### ##### ##### ##### ### ## + + [ Turbo68K Readme ] + Copyright 2000-2002 Bart Trzynadlowski + + +This is the documentation for Turbo68K Version 0.6, please read it. Terms of +use are explained a little further below, it is required that you read and +abide by them in order to use this software. + +Turbo68K is a Motorola 680X0 emulator. It currently emulates the 68000 and +68010 microprocessors. It was written for Intel X86-based (Pentium or better) +systems. Originally designed for Genital it is now available for public use. + +Contact Bart Trzynadlowski: + Email: trzy@mailandnews.com + WWW: http://trzy.overclocked.org + http://trzy.overclocked.org/turbo68k + + +------------------- + 0. Terms of Use +------------------- + +Turbo68K is Copyright 2000, 2001, 2002 Bart Trzynadlowski. + +"Turbo68K" refers to: MAKE68K.C, TURBO68K.H, README.TXT, any binaries compiled +from those files, any source code emitted from MAKE68K.C, and any object file +created from such code. + +To use Turbo68K, you must agree to the following: + + - Turbo68K shall be distributed freely, unmodified, and intact. + - Charging money, goods, or services for Turbo68K is forbidden. + - Claiming ownership or authorship of Turbo68K is forbidden. + - Turbo68K may not be distributed in any medium for which money, goods, or + services are solicited. + - The author, Bart Trzynadlowski, will not be held liable for damages. + - Credit must be given to the author either in the program itself (where + the user can see it) or in its documentation. + +You are encouraged to contact Bart Trzynadlowski if you wish to use Turbo68K +in a commercial product (to negotiate licensing.) + +Bart Trzynadlowski reserves the right to use Turbo68K in any way he sees fit. +If you do not agree with all of these terms, please remove Turbo68K from your +possession. + + +------------------------ + 1. Table of Contents +------------------------ + + 0. Terms of Use + 1. Table of Contents + 2. Making Turbo68K + 3. Command Line Options + 4. Using Turbo68K + 4.1 Basic Data Types + 4.2 Definitions + 4.3 Context + 4.4 Instruction Fetching + 4.5 Data Access + 4.6 PC-Relative Reads + 4.7 Interrupts + 4.8 Byte Swapped Memory + 4.9 The RESET and BKPT Instructions + 4.10 Initializing and Resetting Turbo68K + 4.11 Running the Emulator + 5. Function Reference + 6. Hints and Tips + 6.1 Alternative Identifiers + 6.2 Multiple Processors + 6.3 Maximizing Speed and Minimizing Size + 6.4 Sega Genesis TAS Bug + 7. Additional Notes + 7.1 Change History + 7.2 Un-emulated Features + 7.3 Errata + 7.4 Bibliography + 8. Special Thanks + + +---------------------- + 2. Making Turbo68K +---------------------- + +The Turbo68K 680X0 emulator is usually distributed in a compressed archive, +simply extract it and you should have MAKE68K.C, TURBO68K.H, and this +README.TXT file. + +The first step is to get the source code emitter, Make68K, up and running. It +should compile with any 32-bit C compiler (compilers other than gcc will often +produce warnings, these can be ignored.) The following have been confirmed: + + - DJGPP (gcc v2.8.1) [ MS-DOS ] + - gcc v2.7.2.1 [ FreeBSD ] + - Microsoft VisualC++ 6.0 Professional Edition [ Windows 95 ] + - WATCOM C/C++32 Version 10.6 [ MS-DOS ] + +If you get link errors concerning pow(), make sure to include the appropriate +math library. Try "-lm" if you are using GNU tools. + +Once Make68K has been built, run it with the name of the file you wish to emit +on the command line. For example: + + make68k turbo68k.asm + +Make68K can take a number of options. Try "make68k -h" to see a list. Section +3 of this text describes them in more detail. + +Assemble the emitted file with NASM. Version 0.97 or better should work, 0.98 +is known to work. + +Turbo68K contains identifiers with leading and trailing underscores as +well as without any, so all the object formats supported by NASM should work. + +Remember to include TURBO68K.H to use Turbo68K. + + +--------------------------- + 3. Command Line Options +--------------------------- + +Turbo68K can be tailored in a variety of ways to suit your needs through the +use of the following command line options: + + -mpu Processor type. Valid types are 68000 and 68010. + [Default=68000] + -addr Address bus width. This simulates the specified number of + address lines by cutting off any unsupported address bits + when accessing memory or updating the PC. The 68000 and + 68010 have a 24-bit address bus. [Default=24] + -illegal Emulates illegal instruction traps. Line 1010 and Line + 1111 emulator exceptions are processed as is the normal + illegal instruction exception. [Default] + -noillegal Does not emulate illegal instruction traps but instead + returns an error from Turbo68KRun(). The ILLEGAL opcode + still generates an illegal instruction trap regardless of + whether -illegal or -noillegal has been specified. + -dummyread Emulates dummy reads for the CLR, Scc, and unprivileged + "MOVE from SR" instructions. These instructions perform a + read (and do not make use of the data) before writing. + Some systems may require this for accurate emulation (for + example: some systems will lock up when write-only + locations are read.) This is only available if the + processor type is 68000. [Default] + -nodummyread Does not emulate dummy reads and instead performs a write + immediately. + -skip Skips over idle DBRA loops by setting the counter register + to 0xFFFF, adjusting the timer appropriately, and moving + to the next instruction. + -noskip Does not skip over idle loops. This eliminates problems + with compatibility and is recommended. [Default] + -brafetch Uses the fetch memory map array to update the PC on Bcc, + BRA, BSR, and DBcc instructions. + -nobrafetch Bcc, BRA, BSR, and DBcc branches are handled by adding the + displacement to the internal normalized PC. This is less + safe, in theory, but you should not normally have any + problems. It is also faster and generates less code than + -brafetch. [Default] + -pcfetch PC-relative reads are handled through a special fetch map. + Please read section 4.6 for more information. + -nopcfetch PC-relative reads are treated as normal data reads. + [Default] + -multiaddr Separate address spaces for supervisor and user. This has + not been extensively tested, so let me know how it works. + [Default] + -singleaddr Single address space for supervisor and user. + -defmap Definable memory map arrays are used to handle reading and + writing to the address space. [Default] + -handler Uses handlers for reading/writing bytes, words, and long- + words. The fetch memory map array must still be set up. + -stackcall Use stack-based calling conventions. [Default] + -regcall Use register-based calling conventions. EAX contains the + first argument, the second is in EDX. + -id Adds the specified string to the beginning of all + identifiers. Up to 16 characters are allowed. See section + 6.1 for more information on this. + +Please read further to learn more about the details of some of these options. + + +--------------------- + 4. Using Turbo68K +--------------------- + +A general overview of Turbo68K is provided here. More information on certain +topics is provided throughout the document. + + +4.1 Basic Data Types + +The following data types are provided by Turbo68K: + + TURBO68K_UINT32 Unsigned 32-bit + TURBO68K_INT32 Signed 32-bit + TURBO68K_UINT16 Unsigned 16-bit + TURBO68K_INT16 Signed 16-bit + TURBO68K_UINT8 Unsigned 8-bit + TURBO68K_INT8 Signed 8-bit + + +4.2 Definitions + +Turbo68K functions return and accept defined arguments. Use these instead of +hard-coded values. Different functions return and accept different values, so +make sure to check with the function reference first. + + TURBO68K_NULL 0 + TURBO68K_OKAY Success + TURBO68K_SUPERVISOR Supervisor address space + TURBO68K_USER User address space + TURBO68K_ERROR_FETCH Fetch error (PC out of bounds) + TURBO68K_ERROR_INVINST Invalid instruction + TURBO68K_ERROR_INTLEVEL Invalid interrupt level was specified + TURBO68K_ERROR_INTVECTOR Invalid interrupt vector was specified + TURBO68K_ERROR_INTPENDING Specified interrupt level already pending + TURBO68K_UNINITIALIZED Uninitialized interrupt vector + TURBO68K_SPURIOUS Spurious interrupt vector + TURBO68K_AUTOVECTOR Autovectored interrupt + + +4.3 Context + +Processor contexts are special structures which contain all the data necessary +to manage the emulated 680X0. The procedure for emulating a 680X0 processor +with Turbo68K involves setting up a context, mapping it in, emulating some +code, and perhaps mapping the context out. + + Context Definitions: + -------------------- + + struct TURBO68K_CONTEXT_68000 + { + void *fetch; + void *read_byte, *read_word, *read_long; + void *write_byte, *write_word, *write_long; + void *super_fetch; + void *super_read_byte, *super_read_word, *super_read_long; + void *super_write_byte, *super_write_word, + *super_write_long; + void *user_fetch; + void *user_read_byte, *user_read_word, *user_read_long; + void *user_write_byte, *user_write_word, *user_write_long; + TURBO68K_UINT32 intr[8], cycles, remaining; + TURBO68K_UINT32 d[8], a[8], sp, sr, pc, status; + void *InterruptAcknowledge; + void *Reset; + }; + + struct TURBO68K_CONTEXT_68010 + { + void *fetch, *pcfetch; + void *read_byte, *read_word, *read_long; + void *write_byte, *write_word, *write_long; + void *super_fetch, *super_pcfetch; + void *super_read_byte, *super_read_word, *super_read_long; + void *super_write_byte, *super_write_word, + *super_write_long; + void *user_fetch, *user_pcfetch; + void *user_read_byte, *user_read_word, *user_read_long; + void *user_write_byte, *user_write_word, *user_write_long; + TURBO68K_UINT32 intr[8], cycles, remaining; + TURBO68K_UINT32 d[8], a[8], sp, sr, pc, fc, vbr, status; + void *InterruptAcknowledge; + void *Reset, *Bkpt; + }; + +If you are emulating different address spaces for supervisor and user modes, +the super_ and user_ pointers must be set to point at the respective memory +maps. The other memory map pointers (fetch, read_byte, write_byte, etc.) will +be managed internally by Turbo68K. + +If you are only emulating a single address space for both privilege modes, +you do not have to set up the super_ and user_ pointers but must set up the +others. + +The "intr" array holds pending interrupt information. Entries 0-6 are for +interrupt levels 1-7, they contain the vector of the pending interrupt, or 0 +if no interrupt at the given level is pending. Entry 7 contains the number of +pending interrupts. You should not modify this yourself, use the interrupt +functions. + +The "cycles" and "remaining" members are used to control execution time. +The total amount of request cycles is held in "cycles" and the number left is +held in "remaining." + +Data and address registers are kept in the "d" and "a" array, the PC is kept +in "pc", and the SR is kept in "sr" (the low word is used, the upper word +should be kept 0.) + +Whichever stack pointer is not in A7 is stored in "sp." Thus, if the processor +is in Supervisor mode, A7 is the SSP and "sp" contains the USP. Turbo68K will +only swap these when it has to switch privilege modes internally, such as with +a MOVE SR instruction, exception processing, etc. + +NOTE: If you absolutely must modify the SR outside of Turbo68K (for example, +if you are writing a debugger), you have to swap A7 and "sp" manually if the +privilege mode changed. + +For the 68010, "fc" is both SFC (first 3 bits of byte 0) and DFC (first 3 bits +of byte 1.) The 68010's VBR is kept in "vbr." + +Additional information on the processor status is reflected in the "status" +member. Its format is: + + Bit 0: R (Running) flag -- 0 = not running, 1 = running + Bit 1: S (Stopped) flag -- 0 = not stopped, 1 = stopped via the STOP + instruction + Bit 2: I (Interrupt) flag -- 0 = not processing interrupts, 1 = process- + ing interrupts (Turbo68KProcessInterrupts()) + +The "InterruptAcknowledge" pointer points to an interrupt acknowledge handler +which is called when interrupts are being processed. If the pointer is set to +TURBO68K_NULL, it will not be called. See section 4.7. + +Finally, the "Reset" pointer points to a Reset handler. If the RESET +instruction is executed, this handler will be called. If the pointer is set to +TURBO68K_NULL, it will not be called. The "Bkpt" pointer is for the 68010's +BKPT instruction. + +Contexts can be mapped in and out of Turbo68K's internal data space by using +Turbo68KSetContext() and Turbo68KGetContext(). Once they are mapped in, no +changes will be reflected in your context structures until you map them out. + +NOTE: You CANNOT access context members while the context is mapped in unless +there are functions provided for that purpose (such as Turbo68KSetFetch(), +Turbo68KFreeTimeSlice(), Turbo68KReadPC(), etc.) + +If there is no function for the operation you want to perform on the context, +you simply cannot do it until the context is mapped out. You may NOT map +contexts in and out from memory handlers while Turbo68K is running. Please +consult the function reference for more information. + +Turbo68K provides an internal context called "turbo68kcontext_68000" if +emulating a 68000, or "turbo68kcontext_68010" if emulating a 68010. These are +where you copy your context when you use Turbo68KSetContext(). They should +only be used if you are emulating one processor. + +When setting up memory maps, you can modify context pointers only if the +context was defined by you. If you wish to use the internal context, you will +have to use special functions to perform the same tasks. This is because +Turbo68K expects pointers in the internal context to be mangled (for +performance reasons.) Turbo68KSetContext()/Turbo68KGetContext() handle +this task automatically. + +Here is an example of defining a context and mapping it in and out: + + struct TURBO68K_CONTEXT_68000 mycontext; + + /* ... Set up everything ... */ + + Turbo68KSetContext(&mycontext); + /* ... Run some code ... */ + Turbo68KGetContext(&mycontext); + + +4.4 Instruction Fetching + +Turbo68K needs to know how to fetch instruction from 680X0 memory space. An +array of fetch regions must be set up describing where valid program areas are +located. + + Fetch Region Definition: + ------------------------ + + struct TURBO68K_FETCHREGION + { + TURBO68K_UINT32 base; + TURBO68K_UINT32 limit; + TURBO68K_UINT32 ptr; + }; + +The "base" is the start address of the fetch region. The "limit" is the end +address. The "ptr" must be set to a host machine pointer value with the base +subtracted from it. + +NOTE: Memory must be byte swapped. See section 4.8 for more information. + +Here is an example of how a hypothetical system's fetch map might look: + + struct TURBO68K_FETCHREGION my_fetch[] = + { + { 0x000000, 0x3fffff, rom - 0x000000 }, + { 0xff0000, 0xffffff, ram - 0xff0000 }, + { -1, -1, TURBO68K_NULL } + } + +The last element is required to let Turbo68K know where the array ends. + +To hook the fetch map up to your context, you would code: + + mycontext.super_fetch = my_fetch; + mycontext.user_fetch = my_fetch; + +If you are only using one unified address space for both supervisor and user +modes, all you have to do is: + + mycontext.fetch = my_fetch; + +For the internal context, you must use the appropriate functions: + + Turbo68KSetFetch(my_fetch, TURBO68K_SUPERVISOR); + Turbo68KSetFetch(my_fetch, TURBO68K_USER); + +Or, if one address space is being used: + + Turbo68KSetFetch(my_fetch, TURBO68K_NULL); /* second arg. ignored */ + + +4.5 Data Access + +Data accessing (byte, word, and long word read/writes) can be handled in a +number of ways. The first method is handled through definable memory map +arrays, somewhat similar to instruction fetching. This is the default method +(-defmap.) + + Data Region Definition: + ----------------------- + + struct TURBO68K_DATAREGION + { + TURBO68K_UINT32 base; + TURBO68K_UINT32 limit; + TURBO68K_UINT32 ptr; + void *handler; + }; + +You may either set up a pointer, exactly the same as with instruction fetch +regions. But, if the pointer is not set up (TURBO68K_NULL), Turbo68K will +assume you want to use a handler. Simply set "handler" to the address of the +function you want to use, nothing has to be mangled. + +Handler functions vary for different sizes of data: + + /* + * Read byte + */ + + TURBO68K_UINT8 ReadByte(TURBO68K_UINT32 addr) + { + /* ... */ + } + + /* + * Read word + */ + + TURBO68K_UINT16 ReadWord(TURBO68K_UINT32 addr) + { + /* ... */ + } + + /* + * Read long word + */ + + TURBO68K_UINT32 ReadLong(TURBO68K_UINT32 addr) + { + /* ... */ + } + + /* + * Write byte + */ + + void WriteByte(TURBO68K_UINT32 addr, TURBO68K_UINT8 data) + { + /* ... */ + } + + /* + * Write word + */ + + void WriteWord(TURBO68K_UINT32 addr, TURBO68K_UINT16 data) + { + /* ... */ + } + + /* + * Write long word + */ + + void WriteLong(TURBO68K_UINT32 addr, TURBO68K_UINT32 data) + { + /* ... */ + } + +All handlers are passed addresses that are clipped to whichever value you +chose when emitting the emulator. By default, the address space is 24-bit. + +NOTE: It is not a good idea to try to read the CCR from within a handler. Some +flag calculations are not completed until after data has been read/written. +In fact, do not read any registers besides PC (with the Turbo68KReadPC() +function.) + +The 68000 and 68010 break down long word accesses into 2 consecutive word +word accesses, yet Turbo68K still uses long word handlers to provide +opportunities for optimization. + +NOTE: Memory must be byte swapped. See section 4.8 for more information. + +To hook up the memory maps, you would code: + + mycontext.super_read_byte = my_read_byte; + mycontext.super_read_word = my_read_word; + mycontext.super_read_long = my_read_long; + mycontext.super_write_byte = my_write_byte; + mycontext.super_write_word = my_write_word; + mycontext.super_write_long = my_write_long; + + mycontext.user_read_byte = my_read_byte; + mycontext.user_read_word = my_read_word; + mycontext.user_read_long = my_read_long; + mycontext.user_write_byte = my_write_byte; + mycontext.user_write_word = my_write_word; + mycontext.user_write_long = my_write_long; + +If only one address space is being emulated, try: + + mycontext.read_byte = my_read_byte; + mycontext.read_word = my_read_word; + /* ... */ + +When using an internal context, use the appropriate functions: + + Turbo68KSetReadByte(my_read_byte, TURBO68K_SUPERVISOR); + Turbo68KSetReadWord(my_read_word, TURBO68K_SUPERVISOR); + /* ... */ + + +The second method of handling data is to use functions exclusively. Use the +-handler option when emitting Turbo68K. Six functions (as shown above) must +be provided and directly hooked up to the context just as with memory maps. +Now, whenever the address space is read or written, your function will be +called and it is up to you to handle everything. + + +4.6 PC-Relative Reads + +In some rare situations, PC-relative address reading cannot function properly +through the normal data access regions/handlers. An example of when this can +occur is when the emulated system uses partially encrypted ROMs (CPS-2.) + +Turbo68K must be emitted with the -pcfetch option and a special fetch region +for PC-relative reads must be set up. Writes are still handled using the data +regions/handlers. The region is a TURBO68K_FETCHREGION and thus no handlers +can be used. Memory pointers must be provided in the exact same way as you +would for a normal fetch region. + +The array of fetch regions must be attached to the "pcfetch" pointers of +the context: + + mycontext.pcfetch = pcfetch; + mycontext.super_pcfetch = pcfetch; + mycontext.user_pcfetch = pcfetch; + +When using an internal context, use Turbo68KSetPCFetch() and +Turbo68KGetPCFetch(). + +This is a pretty poor hack, but it should do the job in most cases. This +should not be needed for most systems. + + +4.7 Interrupts + +Interrupts may be triggered with the Turbo68KInterrupt() function and when +they are being processed, an option call-back function may be called. + +Turbo68KInterrupt() takes 2 arguments, the first is the level number, and the +second is the vector. For the vector, you may use TURBO68K_AUTOVECTOR for an +auto-vectored interrupt, TURBO68K_SPURIOUS for a spurious interrupt, and +TURBO68K_UNINITIALIZED for an uninitialized interrupt. + +Interrupts will be checked for and processed at the start of Turbo68KRun() or +when Turbo68KProcessInterrupts() is called. + +If the "InterruptAcknowledge" member of the context is null, the function it +points to will not be called, otherwise, the call-back can be used to make +certain that interrupts have been processed, if the hardware being emulated +requires this (for example, on the Sega Genesis, the call-back can be used to +update IRQ-related bit settings in the VDP status register.) + +The call-back takes a single argument: The interrupt vector number passed to +Turbo68KInterrupt() (a TURBO68K_UINT32), and returns nothing. If +TURBO68K_AUTOVECTOR was passed to Turbo68KInterrupt(), the call-back will get +the proper vector for the level being processed. If non-autovectored +interrupts are triggered, there is no way to determine which level is being +processed at the time the call-back is invoked. + +The InterruptAcknowledge pointer can be directly accessed regardless of +whether you use your own context, or Turbo68K's internal context: + + turbo68kcontext_68000.InterruptAcknowledge = &MyIRQAckHandler; + +Make sure to set it to TURBO68K_NULL if you do not wish to make use of the +call-back feature. It is possible to access this member at any time. + + +4.8 Byte Swapped Memory + +Host memory which Turbo68K can access directly must be byte swapped! The +MSB (most significant byte) and LSB (least significant byte) of each 16-bit +aligned word must be reversed. + + Sample Byte Swapping Function: + ------------------------------ + + /* + * void SwapMemory(TURBO68K_UINT8 *mem, TURBO68K_INT32 size); + * + * Byte swaps a given region of memory to work with Turbo68K's native + * access capabilities. + */ + + void SwapMemory(TURBO68K_UINT8 *mem, TURBO68K_INT32 size) + { + TURBO68K_UINT32 i, j; + + /* + * Swap bytes in each word + */ + + for (i = 0; i < length; i += 2) + { + j = buffer[i]; + buffer[i] = buffer[i + 1]; + buffer[i + 1] = j; + } + } + +Byte swapping is an optimization which greatly benefits Turbo68K in terms of +speed. It relies on the fact that the 68000 and 68010 use a 16-bit data bus. +To access individual bytes in byte swapped memory, XOR the address with 1. +Words can be read or written normally. Long words are best accessed as 2 +consecutive words. + + +4.9 The RESET and BKPT Instructions + +When the RESET or BKPT instruction is executed, the respective handler is +called. If the handler is found to be TURBO68K_NULL, no action is taken. +This is useful for emulating the functionality of the RESET (some systems need +to reset hardware when it is executed) and BKPT (some systems might need to +react to the Breakpoint Acknowledge Cycle) instructions. The BKPT handler is +called before the 68010 processes the breakpoint exception. + +You can also perform high level emulation (HLE) by strategically inserting +RESET (or BKPT, if dealing with a 68010) instructions into the emulated code. +Use Turbo68KReadPC() to make sure you know which RESET/BKPT was executed. +Turbo68KReadPC() will point to the next instruction. + +When setting up the handlers, no special functions are needed, even if the +internal context is being manipulated. + + mycontext.Reset = &MyRESETHandler; + + turbo68kcontext_68000.Reset = &MyRESETHandler; + +The RESET handler takes no arguments and returns nothing. The BKPT handler is +passed the breakpoint vector number (0-7.) + + /* + * Sample RESET handler + */ + + void MyRESETHandler() + { + /* ... Reset some hardware ... */ + } + + /* + * Sample BKPT handler + */ + + void MyBKPTHandler(TURBO68K_INT32 num) + { + /* ... */ + } + + +4.10 Initializing and Resetting Turbo68K + +Prior to doing anything, call Turbo68KInit() to initialize Turbo68K. This +only needs to be done once per program session. + +Next, set up your memory maps. Then, reset the 680X0 processor by calling the +Turbo68KReset() function. Turbo68K fetches the initial PC and SP from the +supervisor fetch memory map, not through the long word read map. Turbo68K +will return an error if it could not reset. This means you have set up your +memory map incorrectly. + + /* + * Initialize Turbo68K (VERY important) + */ + + Turbo68KInit(); + + /* ... set up memory maps and interrupt call-back (optional) ... */ + + /* + * Reset the processor + */ + + if (Turbo68KReset() != TURBO68K_OKAY) + Error(); + + /* ... begin emulating ... */ + + +4.11 Running the Emulator + +To execute code, use Turbo68KRun(). Pass it the number of cycles you wish +to run for. Turbo68K will execute at least as many cycles as you wanted, but +often executes a bit more. You can use Turbo68KGetElapsedCycles() to find +out exactly how many were emulated. See the function reference for more +information. + +Turbo68KInterrupt() can be used to trigger an interrupt. Please see section +4.7 for more information on interrupts. + + /* + * Run Turbo68K for 1000 cycles + */ + + Turbo68KRun(1000); + + /* + * Level 6 auto-vectored interrupt + */ + + Turbo68KInterrupt(6, TURBO68K_AUTOVECTOR); + +Both Turbo68KRun() and Turbo68KInterrupt() can return error information. +See the function reference for more information. + + +------------------------- + 5. Function Reference +------------------------- + +All of Turbo68K's functions are described here. Functions which are said not +to work under given circumstances will have undefined results if used under +those conditions. Usually, this means the context will be trashed, so be very +careful! + +When Turbo68K is running, any handlers you may have set up are considered +part of Turbo68K. Thus, when it is said a function cannot be called while +Turbo68K is running, this means it cannot be called from a handler. + + TURBO68K_INT32 Turbo68KInit(); + Initializes the emulator. This must be called before anything else. + Input: + Nothing. + Returns: + TURBO68K_OKAY + Restrictions: + For future compatibility, call this only once per program session. + + TURBO68K_INT32 Turbo68KReset(); + Resets the 680X0. It uses the supervisor instruction fetch region to + obtain the start-up vectors. Make sure everything is set up. A fetch + error indicates either that the reset vectors could not be fetched or + the PC reset vector points to an unhandled region of memory. + Input: + Nothing. + Returns: + TURBO68K_OKAY + TURBO68K_ERROR_FETCH (PC is out of bounds) + Restrictions: + Do not use while Turbo68K is running. + + TURBO68K_INT32 Turbo68KRun(TURBO68K_INT32 cycles); + Executes at least the specified number of cycles. To get the actual + number of cycles that were emulated, use Turbo68KGetElapsedCycles(). + Input: + Number of cycles. + Returns: + TURBO68K_OKAY + TURBO68K_ERROR_FETCH (PC is out of bounds) + TURBO68K_ERROR_INVINST (invalid instruction, if -noillegal was + specified) + TURBO68K_ERROR_STACKFRAME (68010 only, unsupported/invalid stack + frame, see section 7.2) + Restrictions: + Do not use while Turbo68K is running. + + TURBO68K_INT32 Turbo68KProcessInterrupts(); + Processes any pending interrupts (unless the priority level does not + agree with the SR priority bits.) + Input: + Nothing. + Returns: + TURBO68K_OKAY + TURBO68K_ERROR_FETCH + Restrictions: + None. (If called while Turbo68K is running, it has no effect.) + + + TURBO68K_INT32 Turbo68KInterrupt(TURBO68K_INT32 level, + TURBO68K_UINT32 vector); + Generates an interrupt with the specified level and vector. The level + must be 1-7 and the vector cannot be less than 2. For the vector, you + may specify the vector itself, TURBO68K_AUTOVECTOR for an autovectored + interrupt, TURBO68K_SPURIOUS for a spurious interrupt, or + TURBO68K_UNINITIALIZED for an uninitialized interrupt. If the + "InterruptAcknowledge" member of the context is not null, the function + it points to will be called as each interrupt is being taken. + Input: + Level. + Vector. + Returns: + TURBO68K_OKAY + TURBO68K_INTLEVEL (invalid level) + TURBO68K_INTVECTOR (invalid vector) + TURBO68K_INTPENDING (interrupt already pending at this level; this + is not an error and will frequently occur, it is best not to check + for this) + Restrictions: + None. + + TURBO68K_INT32 Turbo68KCancelInterrupt(TURBO68K_INT32 level); + Cancels the pending interrupt at the specified level. + Input: + Level. + Returns: + TURBO68K_OKAY + TURBO68K_INTLEVEL (invalid level) + Restrictions: + None. + + TURBO68K_UINT32 Turbo68KReadPC(); + Returns the current PC. If this is called from within a handler, the + PC may point at the next instruction or to one of the operand words. + Input: + Nothing. + Returns: + PC + Restrictions: + None. + + void Turbo68KSetFetch(void *fetch, TURBO68K_INT32 type); + void Turbo68KSetPCFetch(void *pcfetch, TURBO68K_INT32 type); + void Turbo68KSetReadByte(void *read_byte, TURBO68K_INT32 type); + void Turbo68KSetReadWord(void *read_word, TURBO68K_INT32 type); + void Turbo68KSetReadLong(void *read_long, TURBO68K_INT32 type); + void Turbo68KSetWriteByte(void *write_byte, TURBO68K_INT32 type); + void Turbo68KSetWriteWord(void *write_word, TURBO68K_INT32 type); + void Turbo68KSetWriteLong(void *write_long, TURBO68K_INT32 type); + These functions will attach memory maps to the internal context. If + you want to attach memory maps to a context you have created (which is + not mapped in), you must assign them manually. + Input: + Memory map array or function pointer (depending on whether + Turbo68K was configured for memory map arrays or handlers) + Type: TURBO68K_SUPERVISOR or TURBO68K_USER. If you are not + emulating the distinction, this argument can be set to anything + and will be ignored. + Returns: + Nothing. + Restrictions: + If different address spaces for supervisor and user modes are + being emulated and the "type" argument is unrecognized, the + behavior is undefined. + + void *Turbo68KGetFetch(TURBO68K_INT32 type); + void *Turbo68KGetPCFetch(TURBO68K_INT32 type); + void *Turbo68KGetReadByte(TURBO68K_INT32 type); + void *Turbo68KGetReadWord(TURBO68K_INT32 type); + void *Turbo68KGetReadLong(TURBO68K_INT32 type); + void *Turbo68KGetWriteByte(TURBO68K_INT32 type); + void *Turbo68KGetWriteWord(TURBO68K_INT32 type); + void *Turbo68KGetWriteLong(TURBO68K_INT32 type); + Will return the memory map or function pointers that are associated + with each type of access. + Input: + Type: TURBO68K_SUPERVISOR or TURBO68K_USER. If you are not + emulating the distinction, this argument can be set to anything + and will be ignored. + Returns: + Memory map array or function pointer. + Restrictions: + If different address spaces for supervisor and user modes are + being emulated and the "type" argument is unrecognized, the + behavior is undefined. + + TURBO68K_UINT8 *Turbo68KFetchPtr(TURBO68K_UINT32 addr); + Return a host pointer to the specified address in the current address + space. Turbo68K scans the fetch region and if the address is not + found, it will return 0. This is useful for disassemblers. + Input: + Address. + Returns: + Host address. + Restrictions: + Only the address space currently being used will be scanned. In + order to select the supervisor or user address space, you will + have to modify the privilege mode bit in SR and restore it to its + original value when finished. + + TURBO68K_UINT8 Turbo68KReadByte(TURBO68K_UINT32 addr); + TURBO68K_UINT16 Turbo68KReadWord(TURBO68K_UINT32 addr); + TURBO68K_UINT32 Turbo68KReadLong(TURBO68K_UINT32 addr); + void Turbo68KWriteByte(TURBO68K_UINT32 addr, TURBO68K_UINT8 data); + void Turbo68KWriteWord(TURBO68K_UINT32 addr, TURBO68K_UINT16 data); + void Turbo68KWriteLong(TURBO68K_UINT32 addr, TURBO68K_UINT32 data); + These functions read/write data from the current Turbo68K address + space. Thus, they can call handlers you have set up. These are + particularly useful for debuggers. Be careful, the PC (and possibly + other context data) will be invalid. + Input: + Address (and data if writing.) + Returns: + Data (or nothing if writing.) + Restrictions: + Do not use while Turbo68K is running. + + void Turbo68KSetContext(struct TURBO68K_CONTEXT *context); + void Turbo68KGetContext(struct TURBO68K_CONTEXT *context); + Map contexts in and out of the internal context using this pair of + functions. Turbo68K operates only on its internal context, so it is + necessary to copy externally-defined contexts into turbo68kcontext_* + when you want to emulate the processor they define. These functions + also make adjustments to the addresses contained in fetch, read_byte, + etc. in order to speed things up -- therefore you cannot access these + members, or any other context member, while it is mapped in. + Input: + Address of context to map in/out. + Returns: + Nothing. + Restrictions: + Do not use while Turbo68K is running. + + TURBO68K_UINT32 Turbo68KGetContextSize(); + Returns the size, in bytes, of a Turbo68K context. This is useful for + asserting that your compiler is packing the contexts correctly. + Input: + Nothing. + Returns: + Size of context in bytes. + Restrictions: + None. + + void Turbo68KClearCycles(); + Clears both "cycles" and "remaining" causing Turbo68K to exit early. + Be careful: a call to Turbo68KGetElapsedCycles() after this will + return 0 or a small number which does not reflect the total amount of + cycles used since Turbo68K was last called to run. + Input: + Nothing. + Returns: + Nothing. + Restrictions: + None. + + void Turbo68KFreeTimeSlice(); + Causes Turbo68K to stop running early by working some magic on both + "cycles" and "remaining." Unlike Turbo68KClearCycles(), you can get + the number of cycles executed with Turbo68KGetElapsedCycles(). + Input: + Nothing. + Returns: + Nothing. + Restrictions: + If called from a handler, Turbo68K does not actually stop running + until the current instruction finishes. + + TURBO68K_INT32 Turbo68KGetElapsedCycles(); + Returns the amount of cycles run. + Input: + Nothing. + Returns: + Cycles run. + Restrictions: + None. + + +--------------------- + 6. Hints and Tips +--------------------- + +For those of you who want to get the most out of Turbo68K, this section aims +to provide you with some neat little tricks to try. + + +6.1 Alternative Identifiers + +The default identifier names have nothing preceding them (Turbo68KInit(), +turbo68kcontext_68000, Turbo68KReset(), etc.) However, if the need arises, you +can change the identifier names by adding a string (up to 16 characters) to +the beginning of them. + +Use the -id option to emit Turbo68K with different identifier names. The data +types and macros will not be changed, TURBO68K_CONTEXT_68000 will remain as it +is, so will TURBO68K_OKAY, etc. + +You must also use the TURBO68K_ID() macro defined in TURBO68K.H to set the new +identifier names immediately after the header file has been included. For +example, if you want identifiers that start with "foo" you would write: + + #include "turbo68k.h" + TURBO68K_ID(foo); + +You can do this multiple times. If you have linked in 2 copies of Turbo68K, +one with identifiers that start with "foo", and another with identifiers +starting with "bar", you would write: + + #include "turbo68k.h" + TURBO68K_ID(foo); + TURBO68K_ID(bar); + +With the above example, you would have functions like: fooTurbo68KInit(), +barTurbo68KInit(), and (if you linked in another copy of Turbo68K without +modified identifiers) Turbo68KInit(). + + +6.2 Multiple Processors + +Emulating multiple processors is fairly simple (unless extremely accurate +timing is required.) You have to set up a context for each processor. You may +not use the internal context as one of them, since it will be overwritten if +you map in the other processor. + + Simplistic Example of Running 2 68000s: + --------------------------------------- + + struct TURBO68K_CONTEXT_68000 context[2]; + + /* ... */ + + for (int i = 0; i < 2; i++) + { + Turbo68KSetContext(&context[i]); + Turbo68KRun(500); + Turbo68KGetContext(&context[i]); + } + +Since Turbo68K is non-reentrant, you cannot multi-thread 2 processors unless +you link in 2 separate builds of Turbo68K (with different identifier names, +you can use the -id option for this.) + + +6.3 Maximizing Speed and Minimizing Size + +What better reasons to write a CPU emulator in assembly language than for +speed and size? To get the most speed and least size (the 2 don't always co- +exist) out of Turbo68K, here are a few things you can try: + + 1. If you are using memory map arrays, set them up wisely. If you have + memory regions bordering each other, try turning them into a single + large region. This not only cuts down the time it takes to scan through + the map, but lets code flow between the regions. Put the most commonly + accessed regions at the beginning of the array, and the least commonly + accessed at the end. + 2. Consider using handlers and not memory map arrays (-handler option.) If + you can write a fast and clean set of handlers, you can speed things up + by taking a load of work off of Turbo68K's back. Optimize your long- + word handlers as well. It is perfectly okay to have a long-word handler + call your word handlers twice and return the combined data, but it is + faster to write the handlers specifically for long-word accesses. + 3. Execute code in large time slices. The overhead of Turbo68KRun() is + significant but it can be compensated by spending more time emulating. + Throw Turbo68KSetContext()/Turbo68KGetContext() in the mix and the + gains are even greater. + 4. Try using -nodummyread if you can get away with it. For most systems, + it is unnecessary to emulate this tiny detail. + 5. If possible, use -nobrafetch (the default) instead of -brafetch. The + branch instructions are used a lot. If -skip does not impact compatib- + ility, consider using it, too. + 6. If you can get away with sneaking in a 32-bit address bus, do it. The + 68000 and 68010 actuall use a 24-bit address bus, which means that + Turbo68K has to mask off the unused bits when fetching data. The + overhead of doing this is negligible, but if you can get away with + using the full 32-bits, go for it. + 7. Don't allow separate address spaces for supervisor and user if you can + get away with it (with most systems, it isn't needed.) This reduces + some overhead in some of the instruction handlers and functions. + 8. Link the Turbo68K object file close to the object files which call it + most frequently. The theory behind this is that the processor will be + able to easily cache in code areas that use each other often. It might + not always yield any speed increase, but I have observed slightly + quicker performance when optimizing the link order in Genital. + 9. Strip the program you compile, this will reduce the executable tremend- + ously. Turbo68K leaves behind a lot of symbols and junk. + +There is a lot to do on my part. Turbo68K features some really poor code, but +usually in uncommon instructions. When/if I have time, I will optimize what I +can, but not all at once. + + +6.4 Sega Genesis TAS Bug + +The TAS instruction is usually used in multi-processor systems to synchronize +execution between multiple 68Ks because it takes the bus. But on the Sega +Genesis, the VDP will not release the bus and TAS instructions consequently +do not write to memory. + +In order to emulate this, comment out the call to WriteByte() in the TAS() +function in make68k.c. This will fix Gargoyles and possible some other games +which use the TAS instruction. The Genesis 3 apparently fixes this little bug +and games like Gargoyles no longer work. + + +----------------------- + 7. Additional Notes +----------------------- + +This is a collection of miscellaneous notes, points of interest, and errata. + + +7.1 Change History + +January 19, 2002: Version 0.6 + - CMPI and CMP no longer write back to memory + - Turbo68KCancelInterrut() fixed (uses EAX*4 as an index into the + interrupt array, so it now actually cancels interrupts) + - Optmized Turbo68KCancelInterrupt() slightly + - Added the "InterruptAcknowledge" call-back to facilitate more accurate + interrupt handling on some systems (such as the Sega Genesis) + - API functions now use the stack to save registers. Turbo68KInterrupt() + can now be called from within a memory handler + - Turbo68KGetXXX() functions now properly retrieve arguments passed to + them + - Some instruction handlers now use the stack to save registers + + ( Thanks to Charles MacDonald for submitting most of these fixes and + additions! ) + +June 29, 2001: Version 0.5 + - Changed the name to "Turbo68K" + - Undocumented flags emulated (verified against real 68000 processors) + - N flag calculation for ABCD, SBCD, and NBCD instructions is now truly + accurate + - Dummy read emulation added for CLR, Scc, and the unprivileged version of + "MOVE from SR." It is on by default and works only when the processor + type is 68000 + - CHK comparisons are now signed as they should be + - Fixed internal calls to API functions to work with register calling + conventions + +June 15, 2001: Version 0.4 + - Now uses proper identifier names when internally calling + Genital68KUpdateFetchPtr() + - N flag is now calculated for SBCD (thanks to ElSemi for this!) + - Optimized C flag calculation for SBCD -(Ax),-(Ay) and ABCD -(Ax),-(Ay) + - N flag for ABCD is calculated the same way as for SBCD (not sure if this + is correct, I'll verify it once my Saturn 68K debugger is complete) + +May 7, 2001: Version 0.35 + - Output file is now properly closed on exit + - RTD is no longer emitted as a 68000 instruction (68010 only) + - Initial PC and SP are now read from the instruction fetch memory maps + - Instructions are emitted in a more optimal order, cache performance + might be better + +April 29, 2001: Version 0.3 + - Fixed a MOVEM bug (example: MOVEM.L (A7)+,A7) + - Added rudimentary 68010 support + - "MOVE from SR" is no longer privileged for 68000 processors + - Rewrote documentation + - Possibly other minor changes I forgot to list + +February 11, 2001: Version 0.22 + - Added a PC-relative read mode (useful in very special circumstances) + - Removed some unused data + - Removed sign-extended byte read functions (they were not being used) + +January 13, 2001: Version 0.21 + - Fixed Genital68KReadXXX() and Genital68KWriteXXX() functions, they no + longer trash the PC + +January 7, 2001: Version 0.2 + - Slightly modified Genital68KReadXXX() and Genital68KWriteXXX() functions + - Registers are now saved when Genital68K functions are called + - Minor optimizations here and there + +December 8, 2000: Version 0.12 + - Fixed a bug with register calling conventions and read/write handlers + +December 4, 2000: Version 0.11 + - Fixed a bug in Genital68KGetContext() and Genital68KSetContext() which + corrupted user and supervisor address spaces + - Corrected a misleading comment in MAKE68K.C and updated the macro refer- + ence in this document + +December 3, 2000: Version 0.1 + - Added user/supervisor address space distinction (optional) + - Changed address space functions + - Added a GENITAL68K_NULL macro + - Fixed some mistakes in this document + +November 23, 2000: Version 0.0 + - Initial release + + +7.2 Un-emulated Features + +The following are not emulated: + + Tracing Turbo68K does not emulate trace exceptions. + Address Errors Turbo68K does not emulate address error exceptions. The + X86 allows for misaligned accesses (unless alignment + checking is on), and consequently, so does Turbo68K. + Bus Errors Bus errors are not emulated. + Undefined Bits Undefined bits in the SR are usually kept 0. + FC Output Lines The real 68000 and 68010 classify address space accesses + as either "User Data", "User Program", "Supervisor Data", + "Supervisor Program", or "CPU Space." Turbo68K + simplifies this by supporting a user address space and a + supervisor address space. There is also an option to + disable this distinction and use one address space. + MOVES The effects of the alternate function code registers (SFC + and DFC) are not emulated. This includes the 68010 MOVES + instruction. + Loop Mode Loop mode (68010) is not emulated. Perhaps if someone + supplies me with very detailed information on how it + works, I might consider adding it. + Stack Frames Only stack frame 0 is supported. Stack frame 8 (associated + with group 0 exceptions: bus and address errors) is never + used and if encountered, Turbo68KRun() returns a stack + frame error. When such an error occurs, the processor + state will look as if the problematic RTE instruction had + never been executed. + 68010 Timing For instructions common to both the 68000 and 68010 (most + of them), 68000 timing is used. + + +7.3 Errata + +Although I have attempted to fix every bug I came across, there is bound to be +something obscure, or possibly major, left undiscovered. There are a few +unimportant inaccuracies I do know about, but have not bothered to fix yet: + + DIVS, DIVU Timing is off by up to 10% in worst-case scenarios. + MULS, MULU Timing is off by an unknown amount. The multiplication + algorithm used by the 68000 and 68010 affects timing in + pretty odd ways. + Timing Some of the instructions have slightly inacurrate timing, + usually because of human error. Timing for exceptions and + interrupts is often wrong (but not TOO far off.) + Exceptions Priority between interrupts and other exceptions (such as + privilege violation, division by 0, TRAP, TRAPV, etc.) is + not fully emulated. Priority among interrupts themselves + seems to be properly handled, and that is most important. + I have not seen any situations where interrupts and other + exceptions affect each other. + +More information on the priority of spurious and uninitialized interrupts as +well as level 7 would be appreciated. I am going off what little the Motorola +manuals say. + + +7.4 Bibliography + +Most of what I know about 680X0 processors comes from the 2 free manuals I +ordered from Motorola. The rest comes from individuals who kindly helped me +and are mentioned in section 8. + + Documents Used: + --------------- + + - "Programmer's Reference Manual" by Motorola (M68000PM/AD REV 1) + - "M68000 8-/16-/32-Bit Microprocessor User's Manual Ninth Edition" by + Motorola (M68000UM/AD REV 8) + + +--------------------- + 8. Special Thanks +--------------------- + +Many thanks go out to those who helped me out with Turbo68K and contributed +to the project in any form. + + - Neil Bradley + - Victor Moya + - Dynarec Mailing List: M.I.K.e, Neil Griffiths, Gwenole, etc. + - Quintesson + - Steve Snake + - Tim Meekins + - Kuwanger + - Charles MacDonald + - Stephane Dallongeville + - Eli Dayan + - Neill Corlett + - Pete Dabbs + - ElSemi + +And, of course, thank YOU! Remember, comments, suggestions, and contributions +are more than welcome, so get in touch with me. See you next time! diff --git a/CPU/68K/Turbo68K.h b/CPU/68K/Turbo68K.h new file mode 100644 index 0000000..a0b3db7 --- /dev/null +++ b/CPU/68K/Turbo68K.h @@ -0,0 +1,158 @@ +/* + * Turbo68K: Motorola 680X0 emulator + * Copyright 2000-2002 Bart Trzynadlowski, see "README.TXT" for terms of use + */ + +#ifndef _TURBO68K_H_ +#define _TURBO68K_H_ + +#ifdef __cplusplus +extern "C" { +#endif + + +/***************************************************************************** +* Generic Macros */ + +#define TURBO68K_OKAY 0 /* no error */ +#define TURBO68K_NULL 0 /* null */ +#define TURBO68K_SUPERVISOR 0 /* affects supervisor space */ +#define TURBO68K_USER 1 /* function affects user space */ +#define TURBO68K_UNINITIALIZED 15 /* uninitialized interrupt */ +#define TURBO68K_SPURIOUS 24 /* spurious interrupt */ +#define TURBO68K_AUTOVECTOR 256 /* autovectored interrupt */ + + +/***************************************************************************** +* Error Codes */ + +#define TURBO68K_ERROR_FETCH 1 /* fetch error (PC bounds) */ +#define TURBO68K_ERROR_INVINST 2 /* invalid instruction */ +#define TURBO68K_ERROR_INTLEVEL 3 /* invalid interrupt level */ +#define TURBO68K_ERROR_INTVECTOR 4 /* invalid interrupt vector */ +#define TURBO68K_ERROR_INTPENDING 5 /* level already pending */ +#define TURBO68K_ERROR_STACKFRAME 6 /* unhandled stack frame */ + + +/***************************************************************************** +* Data Types */ + +typedef unsigned int TURBO68K_UINT32; /* unsigned 32-bit */ +typedef signed int TURBO68K_INT32; /* signed 32-bit */ +typedef unsigned short TURBO68K_UINT16; /* unsigned 16-bit */ +typedef signed short TURBO68K_INT16; /* signed 16-bit */ +typedef unsigned char TURBO68K_UINT8; /* unsigned 8-bit */ +typedef signed char TURBO68K_INT8; /* signed 8-bit */ + + +/***************************************************************************** +* Data Structures */ + +struct TURBO68K_FETCHREGION +{ + TURBO68K_UINT32 base; + TURBO68K_UINT32 limit; + TURBO68K_UINT32 ptr; +}; + +struct TURBO68K_DATAREGION +{ + TURBO68K_UINT32 base; + TURBO68K_UINT32 limit; + TURBO68K_UINT32 ptr; + void *handler; +}; + +struct TURBO68K_CONTEXT_68000 +{ + void *fetch, *pcfetch; + void *read_byte, *read_word, *read_long; + void *write_byte, *write_word, *write_long; + void *super_fetch, *super_pcfetch; + void *super_read_byte, *super_read_word, *super_read_long; + void *super_write_byte, *super_write_word, *super_write_long; + void *user_fetch, *user_pcfetch; + void *user_read_byte, *user_read_word, *user_read_long; + void *user_write_byte, *user_write_word, *user_write_long; + TURBO68K_UINT32 intr[8], cycles, remaining; + TURBO68K_UINT32 d[8], a[8], sp, sr, pc, status; + void *InterruptAcknowledge; + void *Reset; +}; + +struct TURBO68K_CONTEXT_68010 +{ + void *fetch, *pcfetch; + void *read_byte, *read_word, *read_long; + void *write_byte, *write_word, *write_long; + void *super_fetch, *super_pcfetch; + void *super_read_byte, *super_read_word, *super_read_long; + void *super_write_byte, *super_write_word, *super_write_long; + void *user_fetch, *user_pcfetch; + void *user_read_byte, *user_read_word, *user_read_long; + void *user_write_byte, *user_write_word, *user_write_long; + TURBO68K_UINT32 intr[8], cycles, remaining; + TURBO68K_UINT32 d[8], a[8], sp, sr, pc, fc, vbr, status; + void *InterruptAcknowledge; + void *Reset, *Bkpt; +}; + + +/***************************************************************************** +* Functions and External Data */ + +#define TURBO68K_ID(ID) \ + \ +extern struct TURBO68K_CONTEXT_68000 ID##turbo68kcontext_68000; \ +extern struct TURBO68K_CONTEXT_68010 ID##turbo68kcontext_68010; \ + \ +TURBO68K_INT32 ID##Turbo68KInit(); \ +TURBO68K_INT32 ID##Turbo68KReset(); \ +TURBO68K_INT32 ID##Turbo68KRun(TURBO68K_INT32); \ +TURBO68K_INT32 ID##Turbo68KProcessInterrupts(); \ +TURBO68K_INT32 ID##Turbo68KInterrupt(TURBO68K_INT32, TURBO68K_UINT32); \ +TURBO68K_INT32 ID##Turbo68KCancelInterrupt(TURBO68K_INT32); \ + \ +TURBO68K_UINT32 ID##Turbo68KReadPC(); \ + \ +void ID##Turbo68KSetFetch(void *, TURBO68K_INT32); \ +void ID##Turbo68KSetPCFetch(void *, TURBO68K_INT32); \ +void ID##Turbo68KSetReadByte(void *, TURBO68K_INT32); \ +void ID##Turbo68KSetReadWord(void *, TURBO68K_INT32); \ +void ID##Turbo68KSetReadLong(void *, TURBO68K_INT32); \ +void ID##Turbo68KSetWriteByte(void *, TURBO68K_INT32); \ +void ID##Turbo68KSetWriteWord(void *, TURBO68K_INT32); \ +void ID##Turbo68KSetWriteLong(void *, TURBO68K_INT32); \ +void *ID##Turbo68KGetFetch(TURBO68K_INT32); \ +void *ID##Turbo68KGetPCFetch(TURBO68K_INT32); \ +void *ID##Turbo68KGetReadByte(TURBO68K_INT32); \ +void *ID##Turbo68KGetReadWord(TURBO68K_INT32); \ +void *ID##Turbo68KGetReadLong(TURBO68K_INT32); \ +void *ID##Turbo68KGetWriteByte(TURBO68K_INT32); \ +void *ID##Turbo68KGetWriteWord(TURBO68K_INT32); \ +void *ID##Turbo68KGetWriteLong(TURBO68K_INT32); \ + \ +TURBO68K_UINT8 *ID##Turbo68KFetchPtr(TURBO68K_UINT32); \ +TURBO68K_UINT8 ID##Turbo68KReadByte(TURBO68K_UINT32); \ +TURBO68K_UINT16 ID##Turbo68KReadWord(TURBO68K_UINT32); \ +TURBO68K_UINT32 ID##Turbo68KReadLong(TURBO68K_UINT32); \ +void ID##Turbo68KWriteByte(TURBO68K_UINT32, TURBO68K_UINT8); \ +void ID##Turbo68KWriteWord(TURBO68K_UINT32, TURBO68K_UINT16);\ +void ID##Turbo68KWriteLong(TURBO68K_UINT32, TURBO68K_UINT32);\ + \ +void ID##Turbo68KSetContext(void *); \ +void ID##Turbo68KGetContext(void *); \ +TURBO68K_UINT32 ID##Turbo68KGetContextSize(); \ + \ +void ID##Turbo68KClearCycles(); \ +void ID##Turbo68KFreeTimeSlice(); \ +TURBO68K_INT32 ID##Turbo68KGetElapsedCycles(); \ + +TURBO68K_ID( ); /* default identifiers begin with nothing */ + + +#ifdef __cplusplus +} +#endif + +#endif /* _TURBO68K_H_ */ diff --git a/CPU/PowerPC/PPCDisasm.cpp b/CPU/PowerPC/PPCDisasm.cpp new file mode 100644 index 0000000..756553a --- /dev/null +++ b/CPU/PowerPC/PPCDisasm.cpp @@ -0,0 +1,1260 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * PPCDisasm.cpp + * + * PowerPC 603e disassembler. + * + * When possible, invalid forms of instructions are checked for. To the best + * of my knowledge, all appropriate load/store instructions are checked. I'm + * not sure whether any other kinds of instructions need checking. + */ + +#include +#include +#ifdef STANDALONE +#include +#endif +#include "Supermodel.h" + +#define DISASM_VERSION "1.0" + + +/****************************************************************************** + Instruction Descriptions + + The disassembler is primarily table-driven making it easily modifiable. +******************************************************************************/ + +/* + * Masks + * + * These masks isolate fields in an instruction word. + */ +#define M_LI 0x03fffffc +#define M_AA 0x00000002 +#define M_LK 0x00000001 +#define M_BO 0x03e00000 +#define M_BI 0x001f0000 +#define M_BD 0x0000fffc +#define M_RT 0x03e00000 +#define M_RA 0x001f0000 +#define M_RB 0x0000f800 +#define M_CRFD 0x03800000 +#define M_L 0x00200000 +#define M_TO 0x03e00000 +#define M_D 0x0000ffff +#define M_SIMM 0x0000ffff +#define M_UIMM 0x0000ffff +#define M_NB 0x0000f800 +#define M_SR 0x000f0000 +#define M_SH 0x0000f800 +#define M_CRFS 0x001c0000 +#define M_IMM 0x0000f000 +#define M_CRBD 0x03e00000 +#define M_RC 0x00000001 +#define M_CRBA 0x001f0000 +#define M_CRBB 0x0000f800 +#define M_SPR 0x001FF800 +#define M_TBR 0x001FF800 +#define M_CRM 0x000FF000 +#define M_FM 0x01FE0000 +#define M_OE 0x00000400 +#define M_REGC 0x000007c0 +#define M_MB 0x000007c0 +#define M_ME 0x0000003e +#define M_XO 0x000007fe + +/* + * Field Defining Macros + * + * These macros generate instruction words with their associated fields filled + * in with the passed value. + */ +#define D_OP(op) ((op & 0x3f) << 26) +#define D_XO(xo) ((xo & 0x3ff) << 1) +#define D_RT(r) ((r & 0x1f) << (31 - 10)) +#define D_RA(r) ((r & 0x1f) << (31 - 15)) +#define D_UIMM(u) (u & 0xffff) + +/* + * Macros to Get Field Values + * + * These macros return the values of fields in an opcode. They all return + * unsigned values and do not perform any sign extensions. + */ +#define G_RT(op) ((op & M_RT) >> (31 - 10)) +#define G_RA(op) ((op & M_RA) >> (31 - 15)) +#define G_RB(op) ((op & M_RB) >> (31 - 20)) +#define G_SIMM(op) (op & M_SIMM) +#define G_UIMM(op) (op & M_UIMM) +#define G_LI(op) ((op & M_LI) >> 2) +#define G_BO(op) ((op & M_BO) >> (31 - 10)) +#define G_BI(op) ((op & M_BI) >> (31 - 15)) +#define G_BD(op) ((op & M_BD) >> 2) +#define G_CRFD(op) ((op & M_CRFD) >> (31 - 8)) +#define G_L(op) ((op & M_L) >> (31 - 10)) +#define G_CRBD(op) ((op & M_CRBD) >> (31 - 10)) +#define G_CRBA(op) ((op & M_CRBA) >> (31 - 15)) +#define G_CRBB(op) ((op & M_CRBB) >> (31 - 20)) +#define G_REGC(op) ((op & M_REGC) >> (31 - 25)) +#define G_D(op) (op & M_D) +#define G_NB(op) ((op & M_NB) >> (31 - 20)) +#define G_CRFS(op) ((op & M_CRFS) >> (31 - 13)) +#define G_SPR(op) ((op & M_SPR) >> (31 - 20)) +#define G_SR(op) ((op & M_SR) >> (31 - 15)) +#define G_CRM(op) ((op & M_CRM) >> (31 - 19)) +#define G_FM(op) ((op & M_FM) >> (31 - 14)) +#define G_IMM(op) ((op & M_IMM) >> (31 - 19)) +#define G_SH(op) ((op & M_SH) >> (31 - 20)) +#define G_MB(op) ((op & M_MB) >> (31 - 25)) +#define G_ME(op) ((op & M_ME) >> 1) +#define G_TO(op) ((op & M_TO) >> (31 - 10)) + +/* + * Operand Formats + * + * These convey information on what operand fields are present and how they + * ought to be printed. + * + * I'm fairly certain all of these are used, but that is not guaranteed. + */ +enum +{ + F_NONE, // + F_LI, // LI*4+PC if AA=0 else LI*4 + F_BCx, // BO, BI, target_addr used only by BCx + F_RT_RA_0_SIMM, // rT, rA|0, SIMM rA|0 means if rA == 0, print 0 + F_ADDIS, // rT, rA, SIMM (printed as unsigned) only used by ADDIS + F_RT_RA_SIMM, // rT, rA, SIMM + F_RA_RT_UIMM, // rA, rT, UIMM + F_CMP_SIMM, // crfD, L, A, SIMM + F_CMP_UIMM, // crfD, L, A, UIMM + F_RT_RA_0_RB, // rT, rA|0, rB + F_RT_RA_RB, // rT, rA, rB + F_RT_D_RA_0, // rT, d(rA|0) + F_RT_D_RA, // rT, d(rA) + F_RA_RT_RB, // rA, rT, rB + F_FRT_D_RA_0, // frT, d(RA|0) + F_FRT_D_RA, // frT, d(RA) + F_FRT_RA_0_RB, // frT, rA|0, rB + F_FRT_RA_RB, // frT, rA, rB + F_TWI, // TO, rA, SIMM only used by TWI instruction + F_CMP, // crfD, L, rA, rB + F_RA_RT, // rA, rT + F_RA_0_RB, // rA|0, rB + F_FRT_FRB, // frT, frB + F_FCMP, // crfD, frA, frB + F_CRFD_CRFS, // crfD, crfS + F_MCRXR, // crfD only used by MCRXR + F_RT, // rT + F_MFSR, // rT, SR only used by MFSR + F_MTSR, // SR, rT only used by MTSR + F_MFFSx, // frT only used by MFFSx + F_FCRBD, // crbD FPSCR[crbD] + F_MTFSFIx, // crfD, IMM only used by MTFSFIx + F_RB, // rB + F_TW, // TO, rA, rB only used by TW + F_RT_RA_0_NB, // rT, rA|0, NB print 32 if NB == 0 + F_SRAWIx, // rA, rT, SH only used by SRAWIx + F_BO_BI, // BO, BI + F_CRBD_CRBA_CRBB, // crbD, crbA, crbB + F_RT_SPR, // rT, SPR and TBR + F_MTSPR, // SPR, rT only used by MTSPR + F_MTCRF, // CRM, rT only used by MTCRF + F_MTFSFx, // FM, frB only used by MTFSFx + F_RT_RA, // rT, rA + F_FRT_FRA_FRC_FRB, // frT, frA, frC, frB + F_FRT_FRA_FRB, // frT, frA, frB + F_FRT_FRA_FRC, // frT, frA, frC + F_RA_RT_SH_MB_ME, // rA, rT, SH, MB, ME + F_RLWNMx, // rT, rA, rB, MB, ME only used by RLWNMx + F_RT_RB, // rT, rB +}; + +/* + * Flags + */ +#define FL_OE (1 << 0) // if there is an OE field +#define FL_RC (1 << 1) // if there is an RC field +#define FL_LK (1 << 2) // if there is an LK field +#define FL_AA (1 << 3) // if there is an AA field +#define FL_CHECK_RA_RT (1 << 4) // assert rA!=0 and rA!=rT +#define FL_CHECK_RA (1 << 5) // assert rA!=0 +#define FL_CHECK_LSWI (1 << 6) // specific check for LSWI validity +#define FL_CHECK_LSWX (1 << 7) // specific check for LSWX validity + + +/* + * Instruction Descriptor + * + * Describes the layout of an instruction. + */ +typedef struct +{ + char *mnem; // mnemonic + UINT32 match; // bit pattern of instruction after it has been masked + UINT32 mask; // mask of variable fields (AND with ~mask to compare w/ + // bit pattern to determine a match) + int format; // operand format + unsigned flags; // flags +} IDESCR; + +/* + * Instruction Table + * + * Table of instruction descriptors which allows the disassembler to decode + * and print instructions. + */ +static const IDESCR itab[] = +{ + { "add", D_OP(31)|D_XO(266), M_RT|M_RA|M_RB|M_OE|M_RC, F_RT_RA_RB, FL_OE|FL_RC }, + { "addc", D_OP(31)|D_XO(10), M_RT|M_RA|M_RB|M_OE|M_RC, F_RT_RA_RB, FL_OE|FL_RC }, + { "adde", D_OP(31)|D_XO(138), M_RT|M_RA|M_RB|M_OE|M_RC, F_RT_RA_RB, FL_OE|FL_RC }, + { "addi", D_OP(14), M_RT|M_RA|M_SIMM, F_RT_RA_0_SIMM, 0 }, + { "addic", D_OP(12), M_RT|M_RA|M_SIMM, F_RT_RA_SIMM, 0 }, + { "addic.", D_OP(13), M_RT|M_RA|M_SIMM, F_RT_RA_SIMM, 0 }, + { "addis", D_OP(15), M_RT|M_RA|M_SIMM, F_ADDIS, 0 }, + { "addme", D_OP(31)|D_XO(234), M_RT|M_RA|M_OE|M_RC, F_RT_RA, FL_OE|FL_RC }, + { "addze", D_OP(31)|D_XO(202), M_RT|M_RA|M_OE|M_RC, F_RT_RA, FL_OE|FL_RC }, + { "and", D_OP(31)|D_XO(28), M_RT|M_RA|M_RB|M_RC, F_RA_RT_RB, FL_RC }, + { "andc", D_OP(31)|D_XO(60), M_RT|M_RA|M_RB|M_RC, F_RA_RT_RB, FL_RC }, + { "andi.", D_OP(28), M_RT|M_RA|M_UIMM, F_RA_RT_UIMM, 0 }, + { "andis.", D_OP(29), M_RT|M_RA|M_UIMM, F_RA_RT_UIMM, 0 }, + { "b", D_OP(18), M_LI|M_AA|M_LK, F_LI, FL_AA|FL_LK }, + { "bc", D_OP(16), M_BO|M_BI|M_BD|M_AA|M_LK, F_BCx, FL_AA|FL_LK }, + { "bcctr", D_OP(19)|D_XO(528), M_BO|M_BI|M_LK, F_BO_BI, FL_LK }, + { "bclr", D_OP(19)|D_XO(16), M_BO|M_BI|M_LK, F_BO_BI, FL_LK }, + { "cmp", D_OP(31)|D_XO(0), M_CRFD|M_L|M_RA|M_RB, F_CMP, 0 }, + { "cmpi", D_OP(11), M_CRFD|M_L|M_RA|M_SIMM, F_CMP_SIMM, 0 }, + { "cmpl", D_OP(31)|D_XO(32), M_CRFD|M_L|M_RA|M_RB, F_CMP, 0 }, + { "cmpli", D_OP(10), M_CRFD|M_L|M_RA|M_UIMM, F_CMP_UIMM, 0 }, + { "cntlzw", D_OP(31)|D_XO(26), M_RT|M_RA|M_RC, F_RA_RT, FL_RC }, + { "crand", D_OP(19)|D_XO(257), M_CRBD|M_CRBA|M_CRBB, F_CRBD_CRBA_CRBB, 0 }, + { "crandc", D_OP(19)|D_XO(129), M_CRBD|M_CRBA|M_CRBB, F_CRBD_CRBA_CRBB, 0 }, + { "creqv", D_OP(19)|D_XO(289), M_CRBD|M_CRBA|M_CRBB, F_CRBD_CRBA_CRBB, 0 }, + { "crnand", D_OP(19)|D_XO(225), M_CRBD|M_CRBA|M_CRBB, F_CRBD_CRBA_CRBB, 0 }, + { "crnor", D_OP(19)|D_XO(33), M_CRBD|M_CRBA|M_CRBB, F_CRBD_CRBA_CRBB, 0 }, + { "cror", D_OP(19)|D_XO(449), M_CRBD|M_CRBA|M_CRBB, F_CRBD_CRBA_CRBB, 0 }, + { "crorc", D_OP(19)|D_XO(417), M_CRBD|M_CRBA|M_CRBB, F_CRBD_CRBA_CRBB, 0 }, + { "crxor", D_OP(19)|D_XO(193), M_CRBD|M_CRBA|M_CRBB, F_CRBD_CRBA_CRBB, 0 }, + { "dcba", D_OP(31)|D_XO(758), M_RA|M_RB, F_RA_0_RB, 0 }, + { "dcbf", D_OP(31)|D_XO(86), M_RA|M_RB, F_RA_0_RB, 0 }, + { "dcbi", D_OP(31)|D_XO(470), M_RA|M_RB, F_RA_0_RB, 0 }, + { "dcbst", D_OP(31)|D_XO(54), M_RA|M_RB, F_RA_0_RB, 0 }, + { "dcbt", D_OP(31)|D_XO(278), M_RA|M_RB, F_RA_0_RB, 0 }, + { "dcbtst", D_OP(31)|D_XO(246), M_RA|M_RB, F_RA_0_RB, 0 }, + { "dcbz", D_OP(31)|D_XO(1014),M_RA|M_RB, F_RA_0_RB, 0 }, + { "divw", D_OP(31)|D_XO(491), M_RT|M_RA|M_RB|M_OE|M_RC, F_RT_RA_RB, FL_OE|FL_RC }, + { "divwu", D_OP(31)|D_XO(459), M_RT|M_RA|M_RB|M_OE|M_RC, F_RT_RA_RB, FL_OE|FL_RC }, + { "eciwx", D_OP(31)|D_XO(310), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "ecowx", D_OP(31)|D_XO(438), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "eieio", D_OP(31)|D_XO(854), 0, F_NONE, 0 }, + { "eqv", D_OP(31)|D_XO(284), M_RT|M_RA|M_RB|M_RC, F_RA_RT_RB, FL_RC }, + { "extsb", D_OP(31)|D_XO(954), M_RT|M_RA|M_RC, F_RA_RT, FL_RC }, + { "extsh", D_OP(31)|D_XO(922), M_RT|M_RA|M_RC, F_RA_RT, FL_RC }, + { "fabs", D_OP(63)|D_XO(264), M_RT|M_RB|M_RC, F_FRT_FRB, FL_RC }, + { "fadd", D_OP(63)|D_XO(21), M_RT|M_RA|M_RB|M_RC, F_FRT_FRA_FRB, FL_RC }, + { "fadds", D_OP(59)|D_XO(21), M_RT|M_RA|M_RB|M_RC, F_FRT_FRA_FRB, FL_RC }, + { "fcmpo", D_OP(63)|D_XO(32), M_CRFD|M_RA|M_RB, F_FCMP, 0 }, + { "fcmpu", D_OP(63)|D_XO(0), M_CRFD|M_RA|M_RB, F_FCMP, 0 }, + { "fctiw", D_OP(63)|D_XO(14), M_RT|M_RB|M_RC, F_FRT_FRB, FL_RC }, + { "fctiwz", D_OP(63)|D_XO(15), M_RT|M_RB|M_RC, F_FRT_FRB, FL_RC }, + { "fdiv", D_OP(63)|D_XO(18), M_RT|M_RA|M_RB|M_RC, F_FRT_FRA_FRB, FL_RC }, + { "fdivs", D_OP(59)|D_XO(18), M_RT|M_RA|M_RB|M_RC, F_FRT_FRA_FRB, FL_RC }, + { "fmadd", D_OP(63)|D_XO(29), M_RT|M_RA|M_RB|M_REGC|M_RC, F_FRT_FRA_FRC_FRB, FL_RC }, + { "fmadds", D_OP(59)|D_XO(29), M_RT|M_RA|M_RB|M_REGC|M_RC, F_FRT_FRA_FRC_FRB, FL_RC }, + { "fmr", D_OP(63)|D_XO(72), M_RT|M_RB|M_RC, F_FRT_FRB, FL_RC }, + { "fmsub", D_OP(63)|D_XO(28), M_RT|M_RA|M_RB|M_REGC|M_RC, F_FRT_FRA_FRC_FRB, FL_RC }, + { "fmsubs", D_OP(59)|D_XO(28), M_RT|M_RA|M_RB|M_REGC|M_RC, F_FRT_FRA_FRC_FRB, FL_RC }, + { "fmul", D_OP(63)|D_XO(25), M_RT|M_RA|M_REGC|M_RC, F_FRT_FRA_FRC, FL_RC }, + { "fmuls", D_OP(59)|D_XO(25), M_RT|M_RA|M_REGC|M_RC, F_FRT_FRA_FRC, FL_RC }, + { "fnabs", D_OP(63)|D_XO(136), M_RT|M_RB|M_RC, F_FRT_FRB, FL_RC }, + { "fneg", D_OP(63)|D_XO(40), M_RT|M_RB|M_RC, F_FRT_FRB, FL_RC }, + { "fnmadd", D_OP(63)|D_XO(31), M_RT|M_RA|M_RB|M_REGC|M_RC, F_FRT_FRA_FRC_FRB, FL_RC }, + { "fnmadds",D_OP(59)|D_XO(31), M_RT|M_RA|M_RB|M_REGC|M_RC, F_FRT_FRA_FRC_FRB, FL_RC }, + { "fnmsub", D_OP(63)|D_XO(30), M_RT|M_RA|M_RB|M_REGC|M_RC, F_FRT_FRA_FRC_FRB, FL_RC }, + { "fnmsubs",D_OP(59)|D_XO(30), M_RT|M_RA|M_RB|M_REGC|M_RC, F_FRT_FRA_FRC_FRB, FL_RC }, + { "fres", D_OP(59)|D_XO(24), M_RT|M_RB|M_RC, F_FRT_FRB, FL_RC }, + { "frsp", D_OP(63)|D_XO(12), M_RT|M_RB|M_RC, F_FRT_FRB, FL_RC }, + { "frsqrte",D_OP(63)|D_XO(26), M_RT|M_RB|M_RC, F_FRT_FRB, FL_RC }, + { "fsel", D_OP(63)|D_XO(23), M_RT|M_RA|M_RB|M_REGC|M_RC, F_FRT_FRA_FRC_FRB, FL_RC }, + { "fsqrt", D_OP(63)|D_XO(22), M_RT|M_RB|M_RC, F_FRT_FRB, FL_RC }, + { "fsqrts", D_OP(59)|D_XO(22), M_RT|M_RB|M_RC, F_FRT_FRB, FL_RC }, + { "fsub", D_OP(63)|D_XO(20), M_RT|M_RA|M_RB|M_RC, F_FRT_FRA_FRB, FL_RC }, + { "fsubs", D_OP(59)|D_XO(20), M_RT|M_RA|M_RB|M_RC, F_FRT_FRA_FRB, FL_RC }, + { "icbi", D_OP(31)|D_XO(982), M_RA|M_RB, F_RA_0_RB, 0 }, + { "isync", D_OP(19)|D_XO(150), 0, F_NONE, 0 }, + { "lbz", D_OP(34), M_RT|M_RA|M_D, F_RT_D_RA_0, 0 }, + { "lbzu", D_OP(35), M_RT|M_RA|M_D, F_RT_D_RA, FL_CHECK_RA_RT }, + { "lbzux", D_OP(31)|D_XO(119), M_RT|M_RA|M_RB, F_RT_RA_RB, FL_CHECK_RA_RT }, + { "lbzx", D_OP(31)|D_XO(87), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "lfd", D_OP(50), M_RT|M_RA|M_D, F_FRT_D_RA_0, 0 }, + { "lfdu", D_OP(51), M_RT|M_RA|M_D, F_FRT_D_RA, FL_CHECK_RA }, + { "lfdux", D_OP(31)|D_XO(631), M_RT|M_RA|M_RB, F_FRT_RA_RB, FL_CHECK_RA }, + { "lfdx", D_OP(31)|D_XO(599), M_RT|M_RA|M_RB, F_FRT_RA_0_RB, 0 }, + { "lfs", D_OP(48), M_RT|M_RA|M_D, F_FRT_D_RA_0, 0 }, + { "lfsu", D_OP(49), M_RT|M_RA|M_D, F_FRT_D_RA, FL_CHECK_RA }, + { "lfsux", D_OP(31)|D_XO(567), M_RT|M_RA|M_RB, F_FRT_RA_RB, FL_CHECK_RA }, + { "lfsx", D_OP(31)|D_XO(535), M_RT|M_RA|M_RB, F_FRT_RA_0_RB, 0 }, + { "lha", D_OP(42), M_RT|M_RA|M_D, F_RT_D_RA_0, 0 }, + { "lhau", D_OP(43), M_RT|M_RA|M_D, F_RT_D_RA, FL_CHECK_RA_RT }, + { "lhaux", D_OP(31)|D_XO(375), M_RT|M_RA|M_RB, F_RT_RA_RB, FL_CHECK_RA_RT }, + { "lhax", D_OP(31)|D_XO(343), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "lhbrx", D_OP(31)|D_XO(790), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "lhz", D_OP(40), M_RT|M_RA|M_D, F_RT_D_RA_0, 0 }, + { "lhzu", D_OP(41), M_RT|M_RA|M_D, F_RT_D_RA, FL_CHECK_RA_RT }, + { "lhzux", D_OP(31)|D_XO(311), M_RT|M_RA|M_RB, F_RT_RA_RB, FL_CHECK_RA_RT }, + { "lhzx", D_OP(31)|D_XO(279), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "lmw", D_OP(46), M_RT|M_RA|M_D, F_RT_D_RA_0, 0 }, + { "lswi", D_OP(31)|D_XO(597), M_RT|M_RA|M_NB, F_RT_RA_0_NB, FL_CHECK_LSWI }, + { "lswx", D_OP(31)|D_XO(533), M_RT|M_RA|M_RB, F_RT_RA_0_RB, FL_CHECK_LSWX }, + { "lwarx", D_OP(31)|D_XO(20), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "lwbrx", D_OP(31)|D_XO(534), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "lwz", D_OP(32), M_RT|M_RA|M_D, F_RT_D_RA_0, 0 }, + { "lwzu", D_OP(33), M_RT|M_RA|M_D, F_RT_D_RA, FL_CHECK_RA_RT }, + { "lwzux", D_OP(31)|D_XO(55), M_RT|M_RA|M_RB, F_RT_RA_RB, FL_CHECK_RA_RT }, + { "lwzx", D_OP(31)|D_XO(23), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "mcrf", D_OP(19)|D_XO(0), M_CRFD|M_CRFS, F_CRFD_CRFS, 0 }, + { "mcrfs", D_OP(63)|D_XO(64), M_CRFD|M_CRFS, F_CRFD_CRFS, 0 }, + { "mcrxr", D_OP(31)|D_XO(512), M_CRFD, F_MCRXR, 0 }, + { "mfcr", D_OP(31)|D_XO(19), M_RT, F_RT, 0 }, + { "mffs", D_OP(63)|D_XO(583), M_RT|M_RC, F_MFFSx, FL_RC }, + { "mfmsr", D_OP(31)|D_XO(83), M_RT, F_RT, 0 }, + { "mfspr", D_OP(31)|D_XO(339), M_RT|M_SPR, F_RT_SPR, 0 }, + { "mfsr", D_OP(31)|D_XO(595), M_RT|M_SR, F_MFSR, 0 }, + { "mfsrin", D_OP(31)|D_XO(659), M_RT|M_RB, F_RT_RB, 0 }, + { "mftb", D_OP(31)|D_XO(371), M_RT|M_TBR, F_RT_SPR, 0 }, + { "mtcrf", D_OP(31)|D_XO(144), M_RT|M_CRM, F_MTCRF, 0 }, + { "mtfsb0", D_OP(63)|D_XO(70), M_CRBD|M_RC, F_FCRBD, FL_RC }, + { "mtfsb1", D_OP(63)|D_XO(38), M_CRBD|M_RC, F_FCRBD, FL_RC }, + { "mtfsf", D_OP(63)|D_XO(711), M_FM|M_RB|M_RC, F_MTFSFx, FL_RC }, + { "mtfsfi", D_OP(63)|D_XO(134), M_CRFD|M_IMM|M_RC, F_MTFSFIx, FL_RC }, + { "mtmsr", D_OP(31)|D_XO(146), M_RT, F_RT, 0 }, + { "mtspr", D_OP(31)|D_XO(467), M_RT|M_SPR, F_MTSPR, 0 }, + { "mtsr", D_OP(31)|D_XO(210), M_RT|M_SR, F_MTSR, 0 }, + { "mtsrin", D_OP(31)|D_XO(242), M_RT|M_RB, F_RT_RB, 0 }, + { "mulhw", D_OP(31)|D_XO(75), M_RT|M_RA|M_RB|M_RC, F_RT_RA_RB, FL_RC }, + { "mulhwu", D_OP(31)|D_XO(11), M_RT|M_RA|M_RB|M_RC, F_RT_RA_RB, FL_RC }, + { "mulli", D_OP(7), M_RT|M_RA|M_SIMM, F_RT_RA_SIMM, 0 }, + { "mullw", D_OP(31)|D_XO(235), M_RT|M_RA|M_RB|M_OE|M_RC, F_RT_RA_RB, FL_OE|FL_RC }, + { "nand", D_OP(31)|D_XO(476), M_RA|M_RT|M_RB|M_RC, F_RA_RT_RB, FL_RC }, + { "neg", D_OP(31)|D_XO(104), M_RT|M_RA|M_OE|M_RC, F_RT_RA, FL_OE|FL_RC }, + { "nor", D_OP(31)|D_XO(124), M_RT|M_RA|M_RB|M_RC, F_RA_RT_RB, FL_RC }, + { "or", D_OP(31)|D_XO(444), M_RT|M_RA|M_RB|M_RC, F_RA_RT_RB, FL_RC }, + { "orc", D_OP(31)|D_XO(412), M_RT|M_RA|M_RB|M_RC, F_RA_RT_RB, FL_RC }, + { "ori", D_OP(24), M_RT|M_RA|M_UIMM, F_RA_RT_UIMM, 0 }, + { "oris", D_OP(25), M_RT|M_RA|M_UIMM, F_RA_RT_UIMM, 0 }, + { "rfi", D_OP(19)|D_XO(50), 0, F_NONE, 0 }, + { "rlwimi", D_OP(20), M_RT|M_RA|M_SH|M_MB|M_ME|M_RC, F_RA_RT_SH_MB_ME, FL_RC }, + { "rlwinm", D_OP(21), M_RT|M_RA|M_SH|M_MB|M_ME|M_RC, F_RA_RT_SH_MB_ME, FL_RC }, + { "rlwnm", D_OP(23), M_RT|M_RA|M_RB|M_MB|M_ME|M_RC, F_RLWNMx, FL_RC }, + { "sc", D_OP(17)|2, 0, F_NONE, 0 }, + { "slw", D_OP(31)|D_XO(24), M_RT|M_RA|M_RB|M_RC, F_RA_RT_RB, FL_RC }, + { "sraw", D_OP(31)|D_XO(792), M_RT|M_RA|M_RB|M_RC, F_RA_RT_RB, FL_RC }, + { "srawi", D_OP(31)|D_XO(824), M_RT|M_RA|M_SH|M_RC, F_SRAWIx, FL_RC }, + { "srw", D_OP(31)|D_XO(536), M_RT|M_RA|M_RB|M_RC, F_RA_RT_RB, FL_RC }, + { "stb", D_OP(38), M_RT|M_RA|M_D, F_RT_D_RA_0, 0 }, + { "stbu", D_OP(39), M_RT|M_RA|M_D, F_RT_D_RA, FL_CHECK_RA }, + { "stbux", D_OP(31)|D_XO(247), M_RT|M_RA|M_RB, F_RT_RA_RB, FL_CHECK_RA }, + { "stbx", D_OP(31)|D_XO(215), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "stfd", D_OP(54), M_RT|M_RA|M_D, F_FRT_D_RA_0, 0 }, + { "stfdu", D_OP(55), M_RT|M_RA|M_D, F_FRT_D_RA, FL_CHECK_RA }, + { "stfdux", D_OP(31)|D_XO(759), M_RT|M_RA|M_RB, F_FRT_RA_RB, FL_CHECK_RA }, + { "stfdx", D_OP(31)|D_XO(727), M_RT|M_RA|M_RB, F_FRT_RA_0_RB, 0 }, + { "stfiwx", D_OP(31)|D_XO(983), M_RT|M_RA|M_RB, F_FRT_RA_0_RB, 0 }, + { "stfs", D_OP(52), M_RT|M_RA|M_D, F_FRT_D_RA_0, 0 }, + { "stfsu", D_OP(53), M_RT|M_RA|M_D, F_FRT_D_RA, FL_CHECK_RA }, + { "stfsux", D_OP(31)|D_XO(695), M_RT|M_RA|M_RB, F_FRT_RA_RB, FL_CHECK_RA }, + { "stfsx", D_OP(31)|D_XO(663), M_RT|M_RA|M_RB, F_FRT_RA_0_RB, 0 }, + { "sth", D_OP(44), M_RT|M_RA|M_D, F_RT_D_RA_0, 0 }, + { "sthbrx", D_OP(31)|D_XO(918), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "sthu", D_OP(45), M_RT|M_RA|M_D, F_RT_D_RA, FL_CHECK_RA }, + { "sthux", D_OP(31)|D_XO(439), M_RT|M_RA|M_RB, F_RT_RA_RB, FL_CHECK_RA }, + { "sthx", D_OP(31)|D_XO(407), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "stmw", D_OP(47), M_RT|M_RA|M_D, F_RT_D_RA_0, 0 }, + { "stswi", D_OP(31)|D_XO(725), M_RT|M_RA|M_NB, F_RT_RA_0_NB, 0 }, + { "stswx", D_OP(31)|D_XO(661), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "stw", D_OP(36), M_RT|M_RA|M_D, F_RT_D_RA_0, 0 }, + { "stwbrx", D_OP(31)|D_XO(662), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "stwcx.", D_OP(31)|D_XO(150)|1, M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "stwu", D_OP(37), M_RT|M_RA|M_D, F_RT_D_RA, FL_CHECK_RA }, + { "stwux", D_OP(31)|D_XO(183), M_RT|M_RA|M_RB, F_RT_RA_RB, FL_CHECK_RA }, + { "stwx", D_OP(31)|D_XO(151), M_RT|M_RA|M_RB, F_RT_RA_0_RB, 0 }, + { "subf", D_OP(31)|D_XO(40), M_RT|M_RA|M_RB|M_OE|M_RC, F_RT_RA_RB, FL_OE|FL_RC }, + { "subfc", D_OP(31)|D_XO(8), M_RT|M_RA|M_RB|M_OE|M_RC, F_RT_RA_RB, FL_OE|FL_RC }, + { "subfe", D_OP(31)|D_XO(136), M_RT|M_RA|M_RB|M_OE|M_RC, F_RT_RA_RB, FL_OE|FL_RC }, + { "subfic", D_OP(8), M_RT|M_RA|M_SIMM, F_RT_RA_SIMM, 0 }, + { "subfme", D_OP(31)|D_XO(232), M_RT|M_RA|M_OE|M_RC, F_RT_RA, FL_OE|FL_RC }, + { "subfze", D_OP(31)|D_XO(200), M_RT|M_RA|M_OE|M_RC, F_RT_RA, FL_OE|FL_RC }, + { "sync", D_OP(31)|D_XO(598), 0, F_NONE, 0 }, + { "tlbia", D_OP(31)|D_XO(370), 0, F_NONE, 0 }, + { "tlbie", D_OP(31)|D_XO(306), M_RB, F_RB, 0 }, + { "tlbsync",D_OP(31)|D_XO(566), 0, F_NONE, 0 }, + { "tw", D_OP(31)|D_XO(4), M_TO|M_RA|M_RB, F_TW, 0 }, + { "twi", D_OP(3), M_TO|M_RA|M_SIMM, F_TWI, 0 }, + { "xor", D_OP(31)|D_XO(316), M_RT|M_RA|M_RB|M_RC, F_RA_RT_RB, FL_RC }, + { "xori", D_OP(26), M_RT|M_RA|M_UIMM, F_RA_RT_UIMM, 0 }, + { "xoris", D_OP(27), M_RT|M_RA|M_UIMM, F_RA_RT_UIMM, 0 }, + + /* + * PowerPC 603e/EC603e-specific instructions + */ + + { "tlbld", D_OP(31)|D_XO(978), M_RB, F_RB, 0 }, + { "tlbli", D_OP(31)|D_XO(1010),M_RB, F_RB, 0 } +}; + + +/****************************************************************************** + Instruction Decoding and Disassembly Functions +******************************************************************************/ + +/* + * CR Bits + * + * Use an index of BI&3 into this table to obtain the CR field bit name. + */ +static char *crbit[] = { "lt", "gt", "eq", "so" }; + +/* + * SPR(): + * + * Decode the SPR (or TBR) field and append the register name to dest. If + * no name is associated with the field value, the value itself is printed. + */ +static void SPR(char *dest, unsigned spr_field) +{ + unsigned spr; + + /* + * Construct the SPR number -- SPR field is 2 5-bit fields + */ + + spr = (spr_field >> 5) & 0x1f; + spr |= (spr_field & 0x1f) << 5; + + /* + * Append the SPR name to the destination string using strcat() + */ + + switch (spr) + { + case 1: strcat(dest, "xer"); break; + case 8: strcat(dest, "lr"); break; + case 9: strcat(dest, "ctr"); break; + case 18: strcat(dest, "dsisr"); break; + case 19: strcat(dest, "dar"); break; + case 22: strcat(dest, "dec"); break; + case 25: strcat(dest, "sdr1"); break; + case 26: strcat(dest, "srr0"); break; + case 27: strcat(dest, "srr1"); break; + case 272: strcat(dest, "sprg0"); break; + case 273: strcat(dest, "sprg1"); break; + case 274: strcat(dest, "sprg2"); break; + case 275: strcat(dest, "sprg3"); break; + case 282: strcat(dest, "ear"); break; + case 287: strcat(dest, "pvr"); break; + case 528: strcat(dest, "ibat0u"); break; + case 529: strcat(dest, "ibat0l"); break; + case 530: strcat(dest, "ibat1u"); break; + case 531: strcat(dest, "ibat1l"); break; + case 532: strcat(dest, "ibat2u"); break; + case 533: strcat(dest, "ibat2l"); break; + case 534: strcat(dest, "ibat3u"); break; + case 535: strcat(dest, "ibat3l"); break; + case 536: strcat(dest, "dbat0u"); break; + case 537: strcat(dest, "dbat0l"); break; + case 538: strcat(dest, "dbat1u"); break; + case 539: strcat(dest, "dbat1l"); break; + case 540: strcat(dest, "dbat2u"); break; + case 541: strcat(dest, "dbat2l"); break; + case 542: strcat(dest, "dbat3u"); break; + case 543: strcat(dest, "dbat3l"); break; + case 1013: strcat(dest, "dabr"); break; // unsupported on 603e/EC603e + + /* + * Some PowerPC implementations may implement MFTB and MFSPR identically, + * therefore TBR registers are also decoded here + */ + + case 268: strcat(dest, "tbl"); break; + case 269: strcat(dest, "tbu"); break; + + /* + * PowerPC 603e/EC603e-specific registers + */ + + case 1008: strcat(dest, "hid0"); break; + case 1009: strcat(dest, "hid1"); break; + case 976: strcat(dest, "dmiss"); break; + case 977: strcat(dest, "dcmp"); break; + case 978: strcat(dest, "hash2"); break; + case 979: strcat(dest, "hash2"); break; + case 980: strcat(dest, "imiss"); break; + case 981: strcat(dest, "icmp"); break; + case 982: strcat(dest, "rpa"); break; + case 1010: strcat(dest, "iabr"); break; + + default: sprintf(dest, "%s%d", dest, spr); + break; + } +} + +/* + * DecodeSigned16(): + * + * Predecodes the SIMM field for us. If do_unsigned, it is printed as an + * unsigned 16-bit integer. + */ +static void DecodeSigned16(char *outbuf, UINT32 op, BOOL do_unsigned) +{ + INT16 s; + + s = G_SIMM(op); + if (do_unsigned) // sign extend to unsigned 32-bits + sprintf(outbuf, "0x%04X", (UINT32) s); + else // print as signed 16 bits + { + if (s < 0) + { + s *= -1; + sprintf(outbuf, "-0x%04X", s); + } + else + sprintf(outbuf, "0x%04X",s); + } +} + +/* + * Mask(): + * + * Generate a mask from bit MB through ME (PPC-style backwards bit numbering.) + */ +static UINT32 Mask(unsigned mb, unsigned me) +{ + UINT32 i, mask; + + mb &= 31; + me &= 31; + + i = mb; + mask = 0; + while (1) + { + mask |= (1 << (31 - i)); + if (i == me) + break; + i = (i + 1) & 31; + } + + return mask; +} + +/* + * Check(): + * + * Perform checks on the instruction as required by the flags. Returns 1 if + * the instruction failed. + */ +static BOOL Check(UINT32 op, unsigned flags) +{ + unsigned nb, rt, ra; + + if (!flags) return OKAY; // nothing to check for! + + rt = G_RT(op); + ra = G_RA(op); + + if (flags & FL_CHECK_RA_RT) // invalid if rA==0 or rA==rT + { + if ((G_RA(op) == 0) || (G_RA(op) == G_RT(op))) + return FAIL; + } + + if (flags & FL_CHECK_RA) // invalid if rA==0 + { + if (G_RA(op) == 0) + return FAIL; + } + + if (flags & FL_CHECK_LSWI) + { + /* + * Check that rA is not in the range of registers to be loaded (even + * if rA == 0) + */ + + nb = G_NB(op); + + if (ra >= rt && ra <= (rt + nb - 1)) return FAIL; + if ((rt + nb - 1) > 31) // register wrap-around! + { + if (ra < ((rt + nb - 1) - 31)) + return FAIL; + } + } + + if (flags & FL_CHECK_LSWX) + { + /* + * Check that rT != rA, rT != rB, and rD and rA both do not specify + * R0. + * + * We cannot check fully whether rA or rB are in the range of + * registers specified to be loaded because that depends on XER. + */ + + if (rt == ra || rt == G_RB(op) || ((rt == 0) && (ra == 0))) + return FAIL; + } + + return OKAY; // passed checks +} + +/* + * Simplified(): + * + * Handles all simplified instruction forms. Returns 1 if one was decoded, + * otherwise 0 to indicate disassembly should carry on as normal. + */ +static BOOL Simplified(UINT32 op, UINT32 vpc, char *signed16, char *mnem, char *oprs) +{ + UINT32 value, disp; + + value = G_SIMM(op); // value is fully sign-extended SIMM field + if (value & 0x8000) + value |= 0xffff0000; + + if (op == (D_OP(24)|D_RT(0)|D_RA(0)|D_UIMM(0))) + strcat(mnem, "nop"); // ori r0,r0,0 -> nop + else if ((op & ~(M_RT|M_RA|M_RB|M_RC)) == (D_OP(31)|D_XO(444))) + { + if (G_RT(op) == G_RB(op)) + { + strcat(mnem, "mr"); // orx rA,rT,rT -> mrx rA,rT + if (op & M_RC) strcat(mnem, "."); + sprintf(oprs, "r%d,r%d", G_RA(op), G_RT(op)); + } + else + return 0; + } + else if ((op & ~(M_RT|M_RA|M_RB|M_RC)) == (D_OP(31)|D_XO(124))) + { + if (G_RT(op) == G_RB(op)) + { + strcat(mnem, "not"); // nor rA,rT,rT -> not rA,rT + if (op & M_RC) strcat(mnem, "."); + sprintf(oprs, "r%d,r%d", G_RA(op), G_RT(op)); + } + else + return 0; + } + else if ((op & ~(M_RT|M_RA|M_SIMM)) == D_OP(14)) + { + if (G_RA(op) == 0) + { + strcat(mnem, "li"); // addi rT,0,value -> li rT,value + sprintf(oprs, "r%d,0x%08X", G_RT(op), value); + } + else + return 0; + } + else if ((op & ~(M_RT|M_RA|M_SIMM)) == D_OP(15)) + { + if (G_RA(op) == 0) + { + strcat(mnem, "li"); // addis rT,0,value -> li rT,(value<<16) + sprintf(oprs, "r%d,0x%08X", G_RT(op), value << 16); + } + else + { + strcat(mnem, "addi"); // addis rT,rA,SIMM -> addi rT,rA,SIMM<<16 + sprintf(oprs, "r%d,r%d,0x%08X", G_RT(op), G_RA(op), value << 16); + } + } + else if ((op & ~(M_RT|M_RA|M_UIMM)) == D_OP(29)) + { + strcat(mnem, "andi."); // andis. rA,rT,UIMM -> andi. rA,rT,UIMM<<16 + sprintf(oprs, "r%d,r%d,0x%08X", G_RA(op), G_RT(op), G_UIMM(op) << 16); + } + else if ((op & ~(M_RT|M_RA|M_UIMM)) == D_OP(25)) + { + strcat(mnem, "ori"); // oris rA,rT,UIMM -> ori rA,rT,UIMM<<16 + sprintf(oprs, "r%d,r%d,0x%08X", G_RA(op), G_RT(op), G_UIMM(op) << 16); + } + else if ((op & ~(M_RT|M_RA|M_UIMM)) == D_OP(27)) + { + strcat(mnem, "xori"); // xoris rA,rT,UIMM -> xori rA,rT,UIMM<<16 + sprintf(oprs, "r%d,r%d,0x%08X", G_RA(op), G_RT(op), G_UIMM(op) << 16); + } + else if ((op & ~(M_RT|M_RA|M_SH|M_MB|M_ME|M_RC)) == D_OP(20)) + { + value = Mask(G_MB(op), G_ME(op)); + strcat(mnem, "rlwimi"); // rlwimi[.] rA,rT,SH,MB,ME -> rlwimi[.] rA,rT,SH,MASK + if (op & M_RC) strcat(mnem, "."); + sprintf(oprs, "r%d,r%d,%d,0x%08X", G_RA(op), G_RT(op), G_SH(op), value); + } + else if ((op & ~(M_RT|M_RA|M_SH|M_MB|M_ME|M_RC)) == D_OP(21)) + { + value = Mask(G_MB(op), G_ME(op)); + if (G_SH(op) == 0) // rlwinm[.] rA,rT,0,MB,ME -> and[.] rA,rT,MASK + { + strcat(mnem, "and"); + if (op & M_RC) strcat(mnem, "."); + sprintf(oprs, "r%d,r%d,0x%08X", G_RA(op), G_RT(op), value); + } + else // rlwinm[.] rA,rT,SH,MASK + { + strcat(mnem, "rlwinm"); + if (op & M_RC) strcat(mnem, "."); + sprintf(oprs, "r%d,r%d,%d,0x%08X", G_RA(op), G_RT(op), G_SH(op), value); + } + } + else if ((op & ~(M_RT|M_RA|M_RB|M_MB|M_ME|M_RC)) == D_OP(23)) + { + value = Mask(G_MB(op), G_ME(op)); + strcat(mnem, "rlwnm"); // rlwnm[.] rA,rT,SH,MB,ME -> rlwnm[.] rA,rT,SH,MASK + if (op & M_RC) strcat(mnem, "."); + sprintf(oprs, "r%d,r%d,r%d,0x%08X", G_RA(op), G_RT(op), G_RB(op), value); + } + else if ((op & ~(M_BO|M_BI|M_BD|M_AA|M_LK)) == D_OP(16)) + { + disp = G_BD(op) * 4; + if (disp & 0x00008000) + disp |= 0xffff0000; + + switch (G_BO(op)) + { + case 0x04: // branch if condition is false + case 0x05: + case 0x06: + case 0x07: + strcat(mnem, "bf"); + break; + case 0x0c: + case 0x0d: + case 0x0e: + case 0x0f: + strcat(mnem, "bt"); + break; + default: + return 0; + } + + if (op & M_LK) strcat(mnem, "l"); + if (op & M_AA) strcat(mnem, "a"); + + sprintf(oprs, "cr%d[%s],0x%08X", G_BI(op) / 4, crbit[G_BI(op) & 3], disp + ((op & M_AA) ? 0 : vpc)); + } + else if ((op & ~(M_RT|M_RA|M_RB|M_OE|M_RC)) == (D_OP(31)|D_XO(40))) + { + strcat(mnem, "sub"); + if (op & M_OE) strcat(mnem, "o"); + if (op & M_RC) strcat(mnem, "."); + sprintf(oprs, "r%d,r%d,r%d", G_RT(op), G_RB(op), G_RA(op)); + } + else if ((op & ~(M_RT|M_RA|M_RB|M_OE|M_RC)) == (D_OP(31)|D_XO(8))) + { + strcat(mnem, "subc"); + if (op & M_OE) strcat(mnem, "o"); + if (op & M_RC) strcat(mnem, "."); + sprintf(oprs, "r%d,r%d,r%d", G_RT(op), G_RB(op), G_RA(op)); + } + else + return 0; // no match + return 1; +} + +/* + * DisassemblePowerPC(op, vpc, mnem, oprs, simplify): + * + * Disassembles one PowerPC 603e instruction. + * + * A non-zero return code indicates that the instruction could not be + * recognized or that the operands to an instruction were invalid. To + * determine which case occured, check if mnem[0] == '\0'. If it does not, + * then the latter case happened. + * + * Arguments: + * op Instruction word to disassemble. + * vpc Current instruction address. + * mnem Buffer to write instruction mnemonic to. If no + * instruction was decoded, mnem[0] and oprs[0] will be set + * to '\0'. + * oprs Buffer to write any operands to. + * simplify If non-zero, simplified forms of instructions will be + * printed in certain cases. + * + * Returns: + * Zero if successful, non-zero if the instruction was unrecognized or + * had an invalid form (see note above in function description.) + */ +BOOL DisassemblePowerPC(UINT32 op, UINT32 vpc, char *mnem, char *oprs, + BOOL simplify) +{ + char signed16[12]; + UINT32 disp; + int i; + + mnem[0] = '\0'; // so we can use strcat() + oprs[0] = '\0'; + + /* + * Decode signed 16-bit fields (SIMM and d) to spare us the work later + */ + + DecodeSigned16(signed16, op, 0); + + /* + * Try simplified forms first, then real instructions + */ + + if (simplify) + { + if (Simplified(op, vpc, signed16, mnem, oprs)) + return OKAY; + } + + /* + * Search for the instruction in the list and print it if there's a match + */ + + for (i = 0; i < sizeof(itab) / sizeof(IDESCR); i++) + { + if ((op & ~itab[i].mask) == itab[i].match) // check for match + { + /* + * Base mnemonic followed be O, ., L, A + */ + + strcat(mnem, itab[i].mnem); + if (itab[i].flags & FL_OE) if (op & M_OE) strcat(mnem, "o"); + if (itab[i].flags & FL_RC) if (op & M_RC) strcat(mnem, "."); + if (itab[i].flags & FL_LK) if (op & M_LK) strcat(mnem, "l"); + if (itab[i].flags & FL_AA) if (op & M_AA) strcat(mnem, "a"); + + /* + * Print operands + */ + + switch (itab[i].format) + { + case F_RT_RA_RB: + sprintf(oprs, "r%d,r%d,r%d", G_RT(op), G_RA(op), G_RB(op)); + break; + + case F_RT_RA_0_SIMM: + if (G_RA(op)) + sprintf(oprs, "r%d,r%d,%s", G_RT(op), G_RA(op), signed16); + else + sprintf(oprs, "r%d,0,%s", G_RT(op), signed16); + break; + + case F_ADDIS: + if (G_RA(op)) + sprintf(oprs, "r%d,r%d,0x%04X", G_RT(op), G_RA(op), G_SIMM(op)); + else + sprintf(oprs, "r%d,0,0x%04X", G_RT(op), G_SIMM(op)); + break; + + case F_RT_RA_SIMM: + sprintf(oprs, "r%d,r%d,%s", G_RT(op), G_RA(op), signed16); + break; + + case F_RT_RA: + sprintf(oprs, "r%d,r%d", G_RT(op), G_RA(op)); + break; + + case F_RA_RT_RB: + sprintf(oprs, "r%d,r%d,r%d", G_RA(op), G_RT(op), G_RB(op)); + break; + + case F_RA_RT_UIMM: + sprintf(oprs, "r%d,r%d,0x%04X", G_RA(op), G_RT(op), G_UIMM(op)); + break; + + case F_LI: + disp = G_LI(op) * 4; + if (disp & 0x02000000) // sign extend + disp |= 0xfc000000; + sprintf(oprs, "0x%08X", disp + ((op & M_AA) ? 0 : vpc)); + break; + + case F_BCx: + disp = G_BD(op) * 4; + if (disp & 0x00008000) + disp |= 0xffff0000; + + if (G_BO(op) & 0x10) // BI is ignored (don't print CR bit) + sprintf(oprs, "0x%02X,%d,0x%08X", G_BO(op), G_BI(op), disp + ((op & M_AA) ? 0 : vpc)); + else // BI gives us the condition bit + sprintf(oprs, "0x%02X,cr%d[%s],0x%08X", G_BO(op), G_BI(op) / 4, crbit[G_BI(op) & 3], disp + ((op & M_AA) ? 0 : vpc)); + break; + + case F_BO_BI: + if (G_BO(op) & 0x10) // BI is ignored (don't print CR bit) + sprintf(oprs, "0x%02X,%d", G_BO(op), G_BI(op)); + else + sprintf(oprs, "0x%02X,cr%d[%s]", G_BO(op), G_BI(op) / 4, crbit[G_BI(op) & 3]); + break; + + case F_CMP: + sprintf(oprs, "cr%d,%d,r%d,r%d", G_CRFD(op), G_L(op), G_RA(op), G_RB(op)); + break; + + case F_CMP_SIMM: + sprintf(oprs, "cr%d,%d,r%d,%s", G_CRFD(op), G_L(op), G_RA(op), signed16); + break; + + case F_CMP_UIMM: + sprintf(oprs, "cr%d,%d,r%d,0x%04X", G_CRFD(op), G_L(op), G_RA(op), G_UIMM(op)); + break; + + case F_RA_RT: + sprintf(oprs, "r%d,r%d", G_RA(op), G_RT(op)); + break; + + case F_CRBD_CRBA_CRBB: + sprintf(oprs, "cr%d[%s],cr%d[%s],cr%d[%s]", G_CRBD(op) / 4, crbit[G_CRBD(op) & 3], G_CRBA(op) / 4, crbit[G_CRBA(op) & 3], G_CRBB(op) / 4, crbit[G_CRBB(op) & 3]); + break; + + case F_RA_0_RB: + if (G_RA(op)) + sprintf(oprs, "r%d,r%d", G_RA(op), G_RB(op)); + else + sprintf(oprs, "0,r%d", G_RB(op)); + break; + + case F_RT_RA_0_RB: + if (G_RA(op)) + sprintf(oprs, "r%d,r%d,r%d", G_RT(op), G_RA(op), G_RB(op)); + else + sprintf(oprs, "r%d,0,r%d", G_RT(op), G_RB(op)); + break; + + case F_FRT_FRB: + sprintf(oprs, "f%d,f%d", G_RT(op), G_RB(op)); + break; + + case F_FRT_FRA_FRB: + sprintf(oprs, "f%d,f%d,f%d", G_RT(op), G_RA(op), G_RB(op)); + break; + + case F_FCMP: + sprintf(oprs, "cr%d,f%d,f%d", G_CRFD(op), G_RA(op), G_RB(op)); + break; + + case F_FRT_FRA_FRC_FRB: + sprintf(oprs, "f%d,f%d,f%d,f%d", G_RT(op), G_RA(op), G_REGC(op), G_RB(op)); + break; + + case F_FRT_FRA_FRC: + sprintf(oprs, "f%d,f%d,f%d", G_RT(op), G_RA(op), G_REGC(op)); + break; + + case F_RT_D_RA_0: + if (G_RA(op)) + sprintf(oprs, "r%d,%s(r%d)", G_RT(op), signed16, G_RA(op)); + else + sprintf(oprs, "r%d,0x%08X", G_RT(op), (UINT32) ((INT16) G_D(op))); + break; + + case F_RT_D_RA: + sprintf(oprs, "r%d,%s(r%d)", G_RT(op), signed16, G_RA(op)); + break; + + case F_FRT_D_RA_0: + if (G_RA(op)) + sprintf(oprs, "f%d,%s(r%d)", G_RT(op), signed16, G_RA(op)); + else + sprintf(oprs, "f%d,0x%08X", G_RT(op), (UINT32) ((INT16) G_D(op))); + break; + + case F_FRT_D_RA: + sprintf(oprs, "f%d,%s(r%d)", G_RT(op), signed16, G_RA(op)); + break; + + case F_FRT_RA_RB: + sprintf(oprs, "f%d,r%d,r%d", G_RT(op), G_RA(op), G_RB(op)); + break; + + case F_FRT_RA_0_RB: + if (G_RA(op)) + sprintf(oprs, "f%d,r%d,r%d", G_RT(op), G_RA(op), G_RB(op)); + else + sprintf(oprs, "f%d,0,r%d", G_RT(op), G_RB(op)); + break; + + case F_RT_RA_0_NB: + if (G_RA(op)) + sprintf(oprs, "r%d,r%d,%d", G_RT(op), G_RA(op), G_NB(op) ? G_NB(op) : 32); + else + sprintf(oprs, "r%d,0,%d", G_RT(op), G_NB(op) ? G_NB(op) : 32); + break; + + case F_CRFD_CRFS: + sprintf(oprs, "cr%d,cr%d", G_CRFD(op), G_CRFS(op)); + break; + + case F_MCRXR: + sprintf(oprs, "cr%d", G_CRFD(op)); + break; + + case F_RT: + sprintf(oprs, "r%d", G_RT(op)); + break; + + case F_MFFSx: + sprintf(oprs, "f%d", G_RT(op)); + break; + + case F_FCRBD: + sprintf(oprs, "fpscr[%d]", G_CRBD(op)); + break; + + case F_RT_SPR: + sprintf(oprs, "r%d,", G_RT(op)); + SPR(oprs, G_SPR(op)); + break; + + case F_MFSR: + sprintf(oprs, "r%d,sr%d", G_RT(op), G_SR(op)); + break; + + case F_MTCRF: + sprintf(oprs, "0x%02X,r%d", G_CRM(op), G_RT(op)); + break; + + case F_MTFSFx: + sprintf(oprs, "0x%02X,f%d", G_FM(op), G_RB(op)); + break; + + case F_MTFSFIx: + sprintf(oprs, "cr%d,0x%X", G_CRFD(op), G_IMM(op)); + break; + + case F_MTSPR: + SPR(oprs, G_SPR(op)); + sprintf(oprs, "%s,r%d", oprs, G_RT(op)); + break; + + case F_MTSR: + sprintf(oprs, "sr%d,r%d", G_SR(op), G_RT(op)); + break; + + case F_RT_RB: + sprintf(oprs, "r%d,r%d", G_RT(op), G_RB(op)); + break; + + case F_RA_RT_SH_MB_ME: + sprintf(oprs, "r%d,r%d,%d,%d,%d", G_RA(op), G_RT(op), G_SH(op), G_MB(op), G_ME(op)); + break; + + case F_RLWNMx: + sprintf(oprs, "r%d,r%d,r%d,%d,%d", G_RA(op), G_RT(op), G_RB(op), G_MB(op), G_ME(op)); + break; + + case F_SRAWIx: + sprintf(oprs, "r%d,r%d,%d", G_RA(op), G_RT(op), G_SH(op)); + break; + + case F_RB: + sprintf(oprs, "r%d", G_RB(op)); + break; + + case F_TW: + sprintf(oprs, "%d,r%d,r%d", G_TO(op), G_RA(op), G_RB(op)); + break; + + case F_TWI: + sprintf(oprs, "%d,r%d,%s", G_TO(op), G_RA(op), signed16); + break; + + case F_NONE: + default: + break; + } + + return Check(op, itab[i].flags); + } + } + + return FAIL; // no match found +} + + +/****************************************************************************** + Standalone Disassembler + + Define STANDALONE to build a command line-driven PowerPC disassembler. +******************************************************************************/ + +#ifdef STANDALONE + +static void PrintUsage(void) +{ + puts("ppcd Version "DISASM_VERSION" by Bart Trzynadlowski: PowerPC 603e Disassembler"); + puts("Usage: ppcd [options]"); + puts("Options: -?,-h Show this help text"); + puts(" -s Start offset (hexadecimal)"); + puts(" -l Number of instructions"); + puts(" -o Set origin (hexadecimal)"); + puts(" -big Big endian [Default]"); + puts(" -little Little endian"); + puts(" -simple Use simplified instruction forms [Default]"); + puts(" -nosimple Do not use simplified forms"); + exit(0); +} + +/* + * main(argc, argv): + * + * Standalone PowerPC disassembler. + */ +int main(int argc, char **argv) +{ + char mnem[16], oprs[48]; + FILE *fp; + UINT8 *buffer; + unsigned i, fsize, start = 0, len, org, file = 0; + UINT32 op; + BOOL len_specified = 0, org_specified = 0, little = 0, simple = 1; + char *c; + + + if (argc <= 1) + PrintUsage(); + + for (i = 1; i < argc; i++) + { + if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "-?")) + PrintUsage(); + else if (!strcmp(argv[i], "-s")) + { + ++i; + if (i >= argc) + fprintf(stderr, "ppcd: warning: no argument to %s\n", "-s"); + else + start = strtoul(argv[i], &c, 16); + } + else if (!strcmp(argv[i], "-l")) + { + ++i; + if (i >= argc) + fprintf(stderr, "ppcd: warning: no argument to %s\n", "-l"); + else + { + len = atoi(argv[i]); + len_specified = 1; + } + } + else if (!strcmp(argv[i], "-o")) + { + ++i; + if (i >= argc) + fprintf(stderr, "ppcd: warning: no argument to %s\n", "-o"); + else + { + org = strtoul(argv[i], &c, 16); + org_specified = 1; + } + } + else if (!strcmp(argv[i], "-big")) + little = 0; + else if (!strcmp(argv[i], "-little")) + little = 1; + else if (!strcmp(argv[i], "-simple")) + simple = 1; + else if (!strcmp(argv[i], "-nosimple")) + simple = 0; + else + file = i; + } + + if (!file) + { + fprintf(stderr, "ppcd: no input file specified\n"); + exit(1); + } + + /* + * Load file + */ + + if ((fp = fopen(argv[file], "rb")) == NULL) + { + fprintf(stderr, "ppcd: failed to open file: %s\n", argv[file]); + exit(1); + } + fseek(fp, 0, SEEK_END); + fsize = ftell(fp); + rewind(fp); + + if ((buffer = (UINT8 *) calloc(fsize, sizeof(UINT8))) == NULL) + { + fprintf(stderr, "ppcd: not enough memory to load input file: %s, %lu bytes\n", argv[file], (unsigned long) fsize); + fclose(fp); + exit(1); + } + fread(buffer, sizeof(UINT8), fsize, fp); + fclose(fp); + + if (!len_specified) + len = fsize - start; + else + len *= 4; // each instruction == 4 bytes + + if (!org_specified) + org = start; + + /* + * Disassemble! + */ + + for (i = start; i < fsize && i < (start + len); i += 4, org += 4) + { + if (!little) + op = (buffer[i] << 24) | (buffer[i + 1] << 16) | + (buffer[i + 2] << 8) | buffer[i + 3]; + else + op = (buffer[i + 3] << 24) | (buffer[i + 2] << 16) | + (buffer[i + 1] << 8) | buffer[i + 0]; + + if (DisassemblePowerPC(op, org, mnem, oprs, simple)) + { + if (mnem[0] != '\0') // invalid form + printf("0x%08X: 0x%08X\t%s*\t%s\n", org, op, mnem, oprs); + else + printf("0x%08X: 0x%08X\t?\n", org, op); + } + else + printf("0x%08X: 0x%08X\t%s\t%s\n", org, op, mnem, oprs); + } + + free(buffer); + + return 0; +} + +#endif + diff --git a/CPU/PowerPC/PPCDisasm.h b/CPU/PowerPC/PPCDisasm.h new file mode 100644 index 0000000..79806b7 --- /dev/null +++ b/CPU/PowerPC/PPCDisasm.h @@ -0,0 +1,58 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * PPCDisasm.h + * + * Header file for PowerPC disassembler. + */ + +#ifndef INCLUDED_PPCDISASM_H +#define INCLUDED_PPCDISASM_H + +/* + * DisassemblePowerPC(op, vpc, mnem, oprs, simplify): + * + * Disassembles one PowerPC 603e instruction. + * + * A non-zero return code indicates that the instruction could not be + * recognized or that the operands to an instruction were invalid. To + * determine which case occured, check if mnem[0] == '\0'. If it does not, + * then the latter case happened. + * + * Arguments: + * op Instruction word to disassemble. + * vpc Current instruction address. + * mnem Buffer to write instruction mnemonic to. If no + * instruction was decoded, mnem[0] and oprs[0] will be set + * to '\0'. + * oprs Buffer to write any operands to. + * simplify If non-zero, simplified forms of instructions will be + * printed in certain cases. + * + * Returns: + * OKAY if successful, FAIL if the instruction was unrecognized or had an + * invalid form (see note above in function description.) + */ +extern BOOL DisassemblePowerPC(UINT32 op, UINT32 vpc, char *mnem, char *oprs, + BOOL simplify); + +#endif // INCLUDED_PPCDISASM_H diff --git a/CPU/PowerPC/ppc.cpp b/CPU/PowerPC/ppc.cpp new file mode 100644 index 0000000..652ffc3 --- /dev/null +++ b/CPU/PowerPC/ppc.cpp @@ -0,0 +1,1046 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * ppc.cpp + * + * PowerPC emulator main module. Written by Ville Linde for the original + * Supermodel project. + */ + +/* IBM/Motorola PowerPC 4xx/6xx Emulator */ + +#include // memset() +#include "Supermodel.h" +#include "ppc.h" + +// Typedefs that Supermodel no longer provides +typedef unsigned int UINT; + +// C++ should allow this... +#define INLINE inline + +// Model 3 context provides read/write handlers +static class CBus *Bus = NULL; // pointer to Model 3 bus object (for access handlers) + + +void ppc603_exception(int exception); +static void ppc603_check_interrupts(void); + +#define RD ((op >> 21) & 0x1F) +#define RT ((op >> 21) & 0x1f) +#define RS ((op >> 21) & 0x1f) +#define RA ((op >> 16) & 0x1f) +#define RB ((op >> 11) & 0x1f) +#define RC ((op >> 6) & 0x1f) + +#define MB ((op >> 6) & 0x1f) +#define ME ((op >> 1) & 0x1f) +#define SH ((op >> 11) & 0x1f) +#define BO ((op >> 21) & 0x1f) +#define BI ((op >> 16) & 0x1f) +#define CRFD ((op >> 23) & 0x7) +#define CRFA ((op >> 18) & 0x7) +#define FXM ((op >> 12) & 0xff) +#define SPR (((op >> 16) & 0x1f) | ((op >> 6) & 0x3e0)) + +#define SIMM16 (INT32)(INT16)(op & 0xffff) +#define UIMM16 (UINT32)(op & 0xffff) + +#define RCBIT (op & 0x1) +#define OEBIT (op & 0x400) +#define AABIT (op & 0x2) +#define LKBIT (op & 0x1) + +#define REG(x) (ppc.r[x]) +#define LR (ppc.lr) +#define CTR (ppc.ctr) +#define XER (ppc.xer) +#define CR(x) (ppc.cr[x]) +#define MSR (ppc.msr) +#define SRR0 (ppc.srr0) +#define SRR1 (ppc.srr1) +#define SRR2 (ppc.srr2) +#define SRR3 (ppc.srr3) +#define EVPR (ppc.evpr) +#define EXIER (ppc.exier) +#define EXISR (ppc.exisr) +#define DEC (ppc.dec) + + +// Stuff added for the 6xx +#define FPR(x) (ppc.fpr[x]) +#define FM ((op >> 17) & 0xFF) +#define SPRF (((op >> 6) & 0x3E0) | ((op >> 16) & 0x1F)) + + +#define CHECK_SUPERVISOR() \ + if((ppc.msr & 0x4000) != 0){ \ + } + +#define CHECK_FPU_AVAILABLE() \ + if((ppc.msr & 0x2000) == 0){ \ + } + +static UINT32 ppc_field_xlat[256]; + + + +#define FPSCR_FX 0x80000000 +#define FPSCR_FEX 0x40000000 +#define FPSCR_VX 0x20000000 +#define FPSCR_OX 0x10000000 +#define FPSCR_UX 0x08000000 +#define FPSCR_ZX 0x04000000 +#define FPSCR_XX 0x02000000 + + + +#define BITMASK_0(n) (UINT32)(((UINT64)1 << n) - 1) +#define CRBIT(x) ((ppc.cr[x / 4] & (1 << (3 - (x % 4)))) ? 1 : 0) +#define _BIT(n) (1 << (n)) +#define GET_ROTATE_MASK(mb,me) (ppc_rotate_mask[mb][me]) +#define ADD_CA(r,a,b) ((UINT32)r < (UINT32)a) +#define SUB_CA(r,a,b) (!((UINT32)a < (UINT32)b)) +#define ADD_OV(r,a,b) ((~((a) ^ (b)) & ((a) ^ (r))) & 0x80000000) +#define SUB_OV(r,a,b) (( ((a) ^ (b)) & ((a) ^ (r))) & 0x80000000) + +#define XER_SO 0x80000000 +#define XER_OV 0x40000000 +#define XER_CA 0x20000000 + +#define MSR_POW 0x00040000 /* Power Management Enable */ +#define MSR_WE 0x00040000 +#define MSR_CE 0x00020000 +#define MSR_ILE 0x00010000 /* Interrupt Little Endian Mode */ +#define MSR_EE 0x00008000 /* External Interrupt Enable */ +#define MSR_PR 0x00004000 /* Problem State */ +#define MSR_FP 0x00002000 /* Floating Point Available */ +#define MSR_ME 0x00001000 /* Machine Check Enable */ +#define MSR_FE0 0x00000800 +#define MSR_SE 0x00000400 /* Single Step Trace Enable */ +#define MSR_BE 0x00000200 /* Branch Trace Enable */ +#define MSR_DE 0x00000200 +#define MSR_FE1 0x00000100 +#define MSR_IP 0x00000040 /* Interrupt Prefix */ +#define MSR_IR 0x00000020 /* Instruction Relocate */ +#define MSR_DR 0x00000010 /* Data Relocate */ +#define MSR_PE 0x00000008 +#define MSR_PX 0x00000004 +#define MSR_RI 0x00000002 /* Recoverable Interrupt Enable */ +#define MSR_LE 0x00000001 + +#define TSR_ENW 0x80000000 +#define TSR_WIS 0x40000000 + +#define BYTE_REVERSE16(x) ((((x) >> 8) & 0xff) | (((x) << 8) & 0xff00)) +#define BYTE_REVERSE32(x) ((((x) >> 24) & 0xff) | (((x) >> 8) & 0xff00) | (((x) << 8) & 0xff0000) | (((x) << 24) & 0xff000000)) + +typedef union { + UINT64 id; + double fd; +} FPR; + +typedef union { + UINT32 i; + float f; +} FPR32; + +typedef struct { + UINT32 u; + UINT32 l; +} BATENT; + + +typedef struct { + BOOL fatalError; // if true, halt PowerPC until hard reset + + UINT32 r[32]; + UINT32 pc; + UINT32 npc; + + UINT32 *op; + + UINT32 lr; + UINT32 ctr; + UINT32 xer; + UINT32 msr; + UINT8 cr[8]; + UINT32 pvr; + UINT32 srr0; + UINT32 srr1; + UINT32 srr2; + UINT32 srr3; + UINT32 hid0; + UINT32 hid1; + UINT32 hid2; + UINT32 sdr1; + UINT32 sprg[4]; + + UINT32 dsisr; + UINT32 dar; + UINT32 ear; + UINT32 dmiss; + UINT32 dcmp; + UINT32 hash1; + UINT32 hash2; + UINT32 imiss; + UINT32 icmp; + UINT32 rpa; + + + BATENT ibat[4]; + BATENT dbat[4]; + + UINT32 evpr; + UINT32 exier; + UINT32 exisr; + UINT32 bear; + UINT32 besr; + UINT32 iocr; + UINT32 br[8]; + UINT32 iabr; + UINT32 esr; + UINT32 iccr; + UINT32 dccr; + UINT32 pit; + UINT32 pit_counter; + UINT32 pit_int_enable; + UINT32 tsr; + UINT32 dbsr; + UINT32 sgr; + UINT32 pid; + + int reserved; + UINT32 reserved_address; + + int interrupt_pending; + int external_int; + + UINT64 tb; /* 56-bit timebase register */ + + int (*irq_callback)(int irqline); + + PPC_FETCH_REGION cur_fetch; + PPC_FETCH_REGION * fetch; + + // STUFF added for the 6xx series + UINT32 dec, dec_frac; + UINT32 fpscr; + + FPR fpr[32]; + UINT32 sr[16]; + +#if HAS_PPC603 + int is603; +#endif +#if HAS_PPC602 + int is602; +#endif +} PPC_REGS; + + + +typedef struct { + int code; + int subcode; + void (* handler)(UINT32); +} PPC_OPCODE; + + + +static int ppc_icount; +static int ppc_tb_base_icount; +static int ppc_dec_base_icount; +static int ppc_dec_trigger_cycle; +static int bus_freq_multiplier = 1; +static PPC_REGS ppc; +static UINT32 ppc_rotate_mask[32][32]; + + + +static void ppc_change_pc(UINT32 newpc) +{ + UINT i; + + if (ppc.cur_fetch.start <= newpc && newpc <= ppc.cur_fetch.end) + { + ppc.op = &ppc.cur_fetch.ptr[(newpc-ppc.cur_fetch.start)/4]; +// ppc.op = (UINT32 *)((void *)ppc.cur_fetch.ptr + (UINT32)(newpc - ppc.cur_fetch.start)); + return; + } + + for(i = 0; ppc.fetch[i].ptr != NULL; i++) + { + if (ppc.fetch[i].start <= newpc && newpc <= ppc.fetch[i].end) + { + ppc.cur_fetch.start = ppc.fetch[i].start; + ppc.cur_fetch.end = ppc.fetch[i].end; + ppc.cur_fetch.ptr = ppc.fetch[i].ptr; + +// ppc.op = (UINT32 *)((UINT32)ppc.cur_fetch.ptr + (UINT32)(newpc - ppc.cur_fetch.start)); + ppc.op = &ppc.cur_fetch.ptr[(newpc-ppc.cur_fetch.start)/4]; + + return; + } + } + + DebugLog("Invalid PC %08X, previous PC %08X\n", newpc, ppc.pc); + ErrorLog("PowerPC is out of bounds. Halting emulation until reset."); + ppc.fatalError = TRUE; +} + +INLINE UINT8 READ8(UINT32 address) +{ + return Bus->Read8(address); +} + +INLINE UINT16 READ16(UINT32 address) +{ + return Bus->Read16(address); +} + +INLINE UINT32 READ32(UINT32 address) +{ + return Bus->Read32(address); +} + +INLINE UINT64 READ64(UINT32 address) +{ + return Bus->Read64(address); +} + +INLINE void WRITE8(UINT32 address, UINT8 data) +{ + Bus->Write8(address,data); +} + +INLINE void WRITE16(UINT32 address, UINT16 data) +{ + Bus->Write16(address,data); +} + +INLINE void WRITE32(UINT32 address, UINT32 data) +{ + Bus->Write32(address,data); +} + +INLINE void WRITE64(UINT32 address, UINT64 data) +{ + Bus->Write64(address,data); +} + + +/*********************************************************************/ + + +INLINE void SET_CR0(INT32 rd) +{ + if( rd < 0 ) { + CR(0) = 0x8; + } else if( rd > 0 ) { + CR(0) = 0x4; + } else { + CR(0) = 0x2; + } + + if( XER & XER_SO ) + CR(0) |= 0x1; +} + +INLINE void SET_CR1(void) +{ + CR(1) = (ppc.fpscr >> 28) & 0xf; +} + +INLINE void SET_ADD_OV(UINT32 rd, UINT32 ra, UINT32 rb) +{ + if( ADD_OV(rd, ra, rb) ) + XER |= XER_SO | XER_OV; + else + XER &= ~XER_OV; +} + +INLINE void SET_SUB_OV(UINT32 rd, UINT32 ra, UINT32 rb) +{ + if( SUB_OV(rd, ra, rb) ) + XER |= XER_SO | XER_OV; + else + XER &= ~XER_OV; +} + +INLINE void SET_ADD_CA(UINT32 rd, UINT32 ra, UINT32 rb) +{ + if( ADD_CA(rd, ra, rb) ) + XER |= XER_CA; + else + XER &= ~XER_CA; +} + +INLINE void SET_SUB_CA(UINT32 rd, UINT32 ra, UINT32 rb) +{ + if( SUB_CA(rd, ra, rb) ) + XER |= XER_CA; + else + XER &= ~XER_CA; +} + +INLINE UINT32 check_condition_code(UINT32 bo, UINT32 bi) +{ + UINT32 ctr_ok; + UINT32 condition_ok; + UINT32 bo0 = (bo & 0x10) ? 1 : 0; + UINT32 bo1 = (bo & 0x08) ? 1 : 0; + UINT32 bo2 = (bo & 0x04) ? 1 : 0; + UINT32 bo3 = (bo & 0x02) ? 1 : 0; + + if( bo2 == 0 ) + --CTR; + + ctr_ok = bo2 | ((CTR != 0) ^ bo3); + condition_ok = bo0 | (CRBIT(bi) ^ (~bo1 & 0x1)); + + return ctr_ok && condition_ok; +} + +INLINE UINT64 ppc_read_timebase(void) +{ + int cycles = ppc_tb_base_icount - ppc_icount; + + // timebase is incremented once every four core clock cycles, so adjust the cycles accordingly + return ppc.tb + (cycles / 4); +} + +INLINE void ppc_write_timebase_l(UINT32 tbl) +{ + ppc_tb_base_icount = ppc_icount; + + ppc.tb &= ~0xffffffff; + ppc.tb |= tbl; +} + +INLINE void ppc_write_timebase_h(UINT32 tbh) +{ + ppc_tb_base_icount = ppc_icount; + + ppc.tb &= 0xffffffff; + ppc.tb |= (UINT64)(tbh) << 32; +} + +INLINE UINT32 read_decrementer(void) +{ + int cycles = ppc_dec_base_icount - ppc_icount; + + // decrementer is decremented once every four bus clock cycles, so adjust the cycles accordingly + return DEC - (cycles / (bus_freq_multiplier * 2)); +} + +INLINE void write_decrementer(UINT32 value) +{ + ppc_dec_base_icount = ppc_icount + (ppc_dec_base_icount - ppc_icount) % (bus_freq_multiplier * 2); + + DEC = value; + + // check if decrementer exception occurs during execution + if ((UINT32)(DEC - (ppc_icount / (bus_freq_multiplier * 2))) > (UINT32)(DEC)) + { + ppc_dec_trigger_cycle = ((ppc_icount / (bus_freq_multiplier * 2)) - DEC) * 4; + } + else + { + ppc_dec_trigger_cycle = 0x7fffffff; + } + +// printf("DEC = %08X at %08X\n", value, ppc.pc); +} + +/*********************************************************************/ + +INLINE void ppc_set_spr(int spr, UINT32 value) +{ + switch (spr) + { + case SPR_LR: LR = value; return; + case SPR_CTR: CTR = value; return; + case SPR_XER: XER = value; return; + case SPR_SRR0: ppc.srr0 = value; return; + case SPR_SRR1: ppc.srr1 = value; return; + case SPR_SPRG0: ppc.sprg[0] = value; return; + case SPR_SPRG1: ppc.sprg[1] = value; return; + case SPR_SPRG2: ppc.sprg[2] = value; return; + case SPR_SPRG3: ppc.sprg[3] = value; return; + case SPR_PVR: return; + + case SPR603E_DEC: + if(((value & 0x80000000) && !(DEC & 0x80000000)) || value == 0) + { + /* trigger interrupt */ + ppc.interrupt_pending |= 0x2; + ppc603_check_interrupts(); + } + write_decrementer(value); + return; + + case SPR603E_TBL_W: + case SPR603E_TBL_R: // special 603e case + ppc_write_timebase_l(value); + return; + + case SPR603E_TBU_R: + case SPR603E_TBU_W: // special 603e case + ppc_write_timebase_h(value); + return; + + case SPR603E_HID0: ppc.hid0 = value; return; + case SPR603E_HID1: ppc.hid1 = value; return; + case SPR603E_HID2: ppc.hid2 = value; return; + + case SPR603E_DSISR: ppc.dsisr = value; return; + case SPR603E_DAR: ppc.dar = value; return; + case SPR603E_EAR: ppc.ear = value; return; + case SPR603E_DMISS: ppc.dmiss = value; return; + case SPR603E_DCMP: ppc.dcmp = value; return; + case SPR603E_HASH1: ppc.hash1 = value; return; + case SPR603E_HASH2: ppc.hash2 = value; return; + case SPR603E_IMISS: ppc.imiss = value; return; + case SPR603E_ICMP: ppc.icmp = value; return; + case SPR603E_RPA: ppc.rpa = value; return; + + case SPR603E_IBAT0L: ppc.ibat[0].l = value; return; + case SPR603E_IBAT0U: ppc.ibat[0].u = value; return; + case SPR603E_IBAT1L: ppc.ibat[1].l = value; return; + case SPR603E_IBAT1U: ppc.ibat[1].u = value; return; + case SPR603E_IBAT2L: ppc.ibat[2].l = value; return; + case SPR603E_IBAT2U: ppc.ibat[2].u = value; return; + case SPR603E_IBAT3L: ppc.ibat[3].l = value; return; + case SPR603E_IBAT3U: ppc.ibat[3].u = value; return; + case SPR603E_DBAT0L: ppc.dbat[0].l = value; return; + case SPR603E_DBAT0U: ppc.dbat[0].u = value; return; + case SPR603E_DBAT1L: ppc.dbat[1].l = value; return; + case SPR603E_DBAT1U: ppc.dbat[1].u = value; return; + case SPR603E_DBAT2L: ppc.dbat[2].l = value; return; + case SPR603E_DBAT2U: ppc.dbat[2].u = value; return; + case SPR603E_DBAT3L: ppc.dbat[3].l = value; return; + case SPR603E_DBAT3U: ppc.dbat[3].u = value; return; + + case SPR603E_SDR1: + ppc.sdr1 = value; + return; + + case SPR603E_IABR: ppc.iabr = value; return; + } + + ErrorLog("PowerPC wrote to an invalid register. Halting emulation until reset."); + DebugLog("ppc: set_spr: unknown spr %d (%03X) !\n", spr, spr); + ppc.fatalError = TRUE; +} + +INLINE UINT32 ppc_get_spr(int spr) +{ + switch(spr) + { + case SPR_LR: return LR; + case SPR_CTR: return CTR; + case SPR_XER: return XER; + case SPR_SRR0: return ppc.srr0; + case SPR_SRR1: return ppc.srr1; + case SPR_SPRG0: return ppc.sprg[0]; + case SPR_SPRG1: return ppc.sprg[1]; + case SPR_SPRG2: return ppc.sprg[2]; + case SPR_SPRG3: return ppc.sprg[3]; + case SPR_PVR: return ppc.pvr; + case SPR603E_TBL_R: + DebugLog("ppc: get_spr: TBL_R\n"); + break; + + case SPR603E_TBU_R: + DebugLog("ppc: get_spr: TBU_R\n"); + break; + + case SPR603E_TBL_W: return (UINT32)(ppc_read_timebase()); + case SPR603E_TBU_W: return (UINT32)(ppc_read_timebase() >> 32); + case SPR603E_HID0: return ppc.hid0; + case SPR603E_HID1: return ppc.hid1; + case SPR603E_HID2: return ppc.hid2; + case SPR603E_DEC: return read_decrementer(); + case SPR603E_SDR1: return ppc.sdr1; + case SPR603E_DSISR: return ppc.dsisr; + case SPR603E_DAR: return ppc.dar; + case SPR603E_EAR: return ppc.ear; + case SPR603E_DMISS: return ppc.dmiss; + case SPR603E_DCMP: return ppc.dcmp; + case SPR603E_HASH1: return ppc.hash1; + case SPR603E_HASH2: return ppc.hash2; + case SPR603E_IMISS: return ppc.imiss; + case SPR603E_ICMP: return ppc.icmp; + case SPR603E_RPA: return ppc.rpa; + case SPR603E_IBAT0L: return ppc.ibat[0].l; + case SPR603E_IBAT0U: return ppc.ibat[0].u; + case SPR603E_IBAT1L: return ppc.ibat[1].l; + case SPR603E_IBAT1U: return ppc.ibat[1].u; + case SPR603E_IBAT2L: return ppc.ibat[2].l; + case SPR603E_IBAT2U: return ppc.ibat[2].u; + case SPR603E_IBAT3L: return ppc.ibat[3].l; + case SPR603E_IBAT3U: return ppc.ibat[3].u; + case SPR603E_DBAT0L: return ppc.dbat[0].l; + case SPR603E_DBAT0U: return ppc.dbat[0].u; + case SPR603E_DBAT1L: return ppc.dbat[1].l; + case SPR603E_DBAT1U: return ppc.dbat[1].u; + case SPR603E_DBAT2L: return ppc.dbat[2].l; + case SPR603E_DBAT2U: return ppc.dbat[2].u; + case SPR603E_DBAT3L: return ppc.dbat[3].l; + case SPR603E_DBAT3U: return ppc.dbat[3].u; + } + + ErrorLog("PowerPC read from an invalid register. Halting emulation until reset."); + DebugLog("ppc: get_spr: unknown spr %d (%03X) !\n", spr, spr); + ppc.fatalError = TRUE; + return 0; +} + +INLINE void ppc_set_msr(UINT32 value) +{ + if( value & (MSR_ILE | MSR_LE) ) + { + ErrorLog("PowerPC entered an unemulated mode. Halting emulation until reset."); + DebugLog("ppc: set_msr: little_endian mode not supported !\n"); + ppc.fatalError = TRUE; + } + + MSR = value; + + ppc603_check_interrupts(); +} + +INLINE UINT32 ppc_get_msr(void) +{ + return MSR; +} + +INLINE void ppc_set_cr(UINT32 value) +{ + CR(0) = (value >> 28) & 0xf; + CR(1) = (value >> 24) & 0xf; + CR(2) = (value >> 20) & 0xf; + CR(3) = (value >> 16) & 0xf; + CR(4) = (value >> 12) & 0xf; + CR(5) = (value >> 8) & 0xf; + CR(6) = (value >> 4) & 0xf; + CR(7) = (value >> 0) & 0xf; +} + +INLINE UINT32 ppc_get_cr(void) +{ + return CR(0) << 28 | CR(1) << 24 | CR(2) << 20 | CR(3) << 16 | CR(4) << 12 | CR(5) << 8 | CR(6) << 4 | CR(7); +} + +/***********************************************************************/ + +static void (* optable19[1024])(UINT32); +static void (* optable31[1024])(UINT32); +static void (* optable59[1024])(UINT32); +static void (* optable63[1024])(UINT32); +static void (* optable[64])(UINT32); + +#include "ppc603.c" + +/********************************************************************/ + +#include "ppc_ops.c" +#include "ppc_ops.h" + +/* Initialization and shutdown */ + +void ppc_base_init(void) +{ + int i,j; + + memset(&ppc, 0, sizeof(ppc)); + + for( i=0; i < 64; i++ ) { + optable[i] = ppc_invalid; + } + for( i=0; i < 1024; i++ ) { + optable19[i] = ppc_invalid; + optable31[i] = ppc_invalid; + optable59[i] = ppc_invalid; + optable63[i] = ppc_invalid; + } + + /* Fill the opcode tables */ + for( i=0; i < (sizeof(ppc_opcode_common) / sizeof(PPC_OPCODE)); i++ ) { + + switch(ppc_opcode_common[i].code) + { + case 19: + optable19[ppc_opcode_common[i].subcode] = ppc_opcode_common[i].handler; + break; + + case 31: + optable31[ppc_opcode_common[i].subcode] = ppc_opcode_common[i].handler; + break; + + case 59: + case 63: + break; + + default: + optable[ppc_opcode_common[i].code] = ppc_opcode_common[i].handler; + } + + } + + /* Calculate rotate mask table */ + for( i=0; i < 32; i++ ) { + for( j=0; j < 32; j++ ) { + UINT32 mask; + int mb = i; + int me = j; + mask = ((UINT32)0xFFFFFFFF >> mb) ^ ((me >= 31) ? 0 : ((UINT32)0xFFFFFFFF >> (me + 1))); + if( mb > me ) + mask = ~mask; + + ppc_rotate_mask[i][j] = mask; + } + } +} + +void ppc_init(const PPC_CONFIG *config) +{ + int pll_config = 0; + float multiplier; + int i ; + + ppc_base_init() ; + + optable[48] = ppc_lfs; + optable[49] = ppc_lfsu; + optable[50] = ppc_lfd; + optable[51] = ppc_lfdu; + optable[52] = ppc_stfs; + optable[53] = ppc_stfsu; + optable[54] = ppc_stfd; + optable[55] = ppc_stfdu; + optable31[631] = ppc_lfdux; + optable31[599] = ppc_lfdx; + optable31[567] = ppc_lfsux; + optable31[535] = ppc_lfsx; + optable31[595] = ppc_mfsr; + optable31[659] = ppc_mfsrin; + optable31[371] = ppc_mftb; + optable31[210] = ppc_mtsr; + optable31[242] = ppc_mtsrin; + optable31[758] = ppc_dcba; + optable31[759] = ppc_stfdux; + optable31[727] = ppc_stfdx; + optable31[983] = ppc_stfiwx; + optable31[695] = ppc_stfsux; + optable31[663] = ppc_stfsx; + optable31[370] = ppc_tlbia; + optable31[306] = ppc_tlbie; + optable31[566] = ppc_tlbsync; + optable31[310] = ppc_eciwx; + optable31[438] = ppc_ecowx; + + optable63[264] = ppc_fabsx; + optable63[21] = ppc_faddx; + optable63[32] = ppc_fcmpo; + optable63[0] = ppc_fcmpu; + optable63[14] = ppc_fctiwx; + optable63[15] = ppc_fctiwzx; + optable63[18] = ppc_fdivx; + optable63[72] = ppc_fmrx; + optable63[136] = ppc_fnabsx; + optable63[40] = ppc_fnegx; + optable63[12] = ppc_frspx; + optable63[26] = ppc_frsqrtex; + optable63[22] = ppc_fsqrtx; + optable63[20] = ppc_fsubx; + optable63[583] = ppc_mffsx; + optable63[70] = ppc_mtfsb0x; + optable63[38] = ppc_mtfsb1x; + optable63[711] = ppc_mtfsfx; + optable63[134] = ppc_mtfsfix; + optable63[64] = ppc_mcrfs; + + optable59[21] = ppc_faddsx; + optable59[18] = ppc_fdivsx; + optable59[24] = ppc_fresx; + optable59[22] = ppc_fsqrtsx; + optable59[20] = ppc_fsubsx; + + for(i = 0; i < 32; i++) + { + optable63[i * 32 | 29] = ppc_fmaddx; + optable63[i * 32 | 28] = ppc_fmsubx; + optable63[i * 32 | 25] = ppc_fmulx; + optable63[i * 32 | 31] = ppc_fnmaddx; + optable63[i * 32 | 30] = ppc_fnmsubx; + optable63[i * 32 | 23] = ppc_fselx; + + optable59[i * 32 | 29] = ppc_fmaddsx; + optable59[i * 32 | 28] = ppc_fmsubsx; + optable59[i * 32 | 25] = ppc_fmulsx; + optable59[i * 32 | 31] = ppc_fnmaddsx; + optable59[i * 32 | 30] = ppc_fnmsubsx; + } + + for(i = 0; i < 256; i++) + { + ppc_field_xlat[i] = + ((i & 0x80) ? 0xF0000000 : 0) | + ((i & 0x40) ? 0x0F000000 : 0) | + ((i & 0x20) ? 0x00F00000 : 0) | + ((i & 0x10) ? 0x000F0000 : 0) | + ((i & 0x08) ? 0x0000F000 : 0) | + ((i & 0x04) ? 0x00000F00 : 0) | + ((i & 0x02) ? 0x000000F0 : 0) | + ((i & 0x01) ? 0x0000000F : 0); + } + + ppc.pvr = config->pvr; + + multiplier = (float)((config->bus_frequency_multiplier >> 4) & 0xf) + + (float)(config->bus_frequency_multiplier & 0xf) / 10.0f; + bus_freq_multiplier = (int)(multiplier * 2); + + switch(config->pvr) + { + case PPC_MODEL_603E: pll_config = mpc603e_pll_config[bus_freq_multiplier-1][config->bus_frequency]; break; + case PPC_MODEL_603EV: pll_config = mpc603ev_pll_config[bus_freq_multiplier-1][config->bus_frequency]; break; + case PPC_MODEL_603R: pll_config = mpc603r_pll_config[bus_freq_multiplier-1][config->bus_frequency]; break; + default: break; + } + + if (pll_config == -1) + { + //ErrorLog("PPC: Invalid bus/multiplier combination (bus frequency = %d, multiplier = %1.1f)", config->bus_frequency, multiplier); + } + + ppc.hid1 = pll_config << 28; +} + +void ppc_shutdown(void) +{ + +} + +void ppc_set_irq_line(int irqline) +{ + ppc.interrupt_pending |= 0x1; + + ppc603_check_interrupts(); +} + +UINT32 ppc_get_pc(void) +{ + return ppc.pc; +} + +void ppc_set_fetch(PPC_FETCH_REGION * fetch) +{ + ppc.fetch = fetch; +} + +/****************************************************************************** + Supermodel Interface +******************************************************************************/ + +void ppc_attach_bus(CBus *BusPtr) +{ + Bus = BusPtr; +} + +void ppc_save_state(CBlockFile *SaveState) +{ + SaveState->NewBlock("PowerPC", __FILE__); + + // Timer and decrementer + SaveState->Write(&ppc_icount, sizeof(ppc_icount)); + SaveState->Write(&ppc_tb_base_icount, sizeof(ppc_tb_base_icount)); + SaveState->Write(&ppc_dec_base_icount, sizeof(ppc_dec_base_icount)); + SaveState->Write(&ppc_dec_trigger_cycle, sizeof(ppc_dec_trigger_cycle)); + + // Registers + SaveState->Write(ppc.r, sizeof(ppc.r)); + SaveState->Write(&ppc.pc, sizeof(ppc.pc)); + SaveState->Write(&ppc.npc, sizeof(ppc.npc)); + SaveState->Write(&ppc.lr, sizeof(ppc.lr)); + SaveState->Write(&ppc.ctr, sizeof(ppc.ctr)); + SaveState->Write(&ppc.xer, sizeof(ppc.xer)); + SaveState->Write(&ppc.msr, sizeof(ppc.msr)); + SaveState->Write(ppc.cr, sizeof(ppc.cr)); + SaveState->Write(&ppc.pvr, sizeof(ppc.pvr)); + SaveState->Write(&ppc.srr0, sizeof(ppc.srr0)); + SaveState->Write(&ppc.srr1, sizeof(ppc.srr1)); + SaveState->Write(&ppc.srr2, sizeof(ppc.srr2)); + SaveState->Write(&ppc.srr3, sizeof(ppc.srr3)); + SaveState->Write(&ppc.hid0, sizeof(ppc.hid0)); + SaveState->Write(&ppc.hid1, sizeof(ppc.hid1)); + SaveState->Write(&ppc.hid2, sizeof(ppc.hid2)); + SaveState->Write(&ppc.sdr1, sizeof(ppc.sdr1)); + SaveState->Write(ppc.sprg, sizeof(ppc.sprg)); + SaveState->Write(&ppc.dsisr, sizeof(ppc.dsisr)); + SaveState->Write(&ppc.dar, sizeof(ppc.dar)); + SaveState->Write(&ppc.ear, sizeof(ppc.ear)); + SaveState->Write(&ppc.dmiss, sizeof(ppc.dmiss)); + SaveState->Write(&ppc.dcmp, sizeof(ppc.dcmp)); + SaveState->Write(&ppc.hash1, sizeof(ppc.hash1)); + SaveState->Write(&ppc.hash2, sizeof(ppc.hash2)); + SaveState->Write(&ppc.imiss, sizeof(ppc.imiss)); + SaveState->Write(&ppc.icmp, sizeof(ppc.icmp)); + SaveState->Write(&ppc.rpa, sizeof(ppc.rpa)); + SaveState->Write(ppc.ibat, sizeof(ppc.ibat)); + SaveState->Write(ppc.dbat, sizeof(ppc.dbat)); + + // These are probably PPC 4xx registers, but who cares, save 'em anyway! + SaveState->Write(&ppc.evpr, sizeof(ppc.evpr)); + SaveState->Write(&ppc.exier, sizeof(ppc.exier)); + SaveState->Write(&ppc.exisr, sizeof(ppc.exisr)); + SaveState->Write(&ppc.bear, sizeof(ppc.bear)); + SaveState->Write(&ppc.besr, sizeof(ppc.besr)); + SaveState->Write(&ppc.iocr, sizeof(ppc.iocr)); + SaveState->Write(ppc.br, sizeof(ppc.br)); + SaveState->Write(&ppc.iabr, sizeof(ppc.iabr)); + SaveState->Write(&ppc.esr, sizeof(ppc.esr)); + SaveState->Write(&ppc.iccr, sizeof(ppc.iccr)); + SaveState->Write(&ppc.dccr, sizeof(ppc.dccr)); + SaveState->Write(&ppc.pit, sizeof(ppc.pit)); + SaveState->Write(&ppc.pit_counter, sizeof(ppc.pit_counter)); + SaveState->Write(&ppc.pit_int_enable, sizeof(ppc.pit_int_enable)); + SaveState->Write(&ppc.tsr, sizeof(ppc.tsr)); + SaveState->Write(&ppc.dbsr, sizeof(ppc.dbsr)); + SaveState->Write(&ppc.sgr, sizeof(ppc.sgr)); + SaveState->Write(&ppc.pid, sizeof(ppc.pid)); + + SaveState->Write(&ppc.reserved, sizeof(ppc.reserved)); + SaveState->Write(&ppc.reserved_address, sizeof(ppc.reserved_address)); + SaveState->Write(&ppc.external_int, sizeof(ppc.external_int)); + + SaveState->Write(&ppc.tb, sizeof(ppc.tb)); + + SaveState->Write(&ppc.dec, sizeof(ppc.dec)); + SaveState->Write(&ppc.dec_frac, sizeof(ppc.dec_frac)); + SaveState->Write(&ppc.fpscr, sizeof(ppc.fpscr)); + + SaveState->Write(ppc.fpr, sizeof(ppc.fpr)); + SaveState->Write(ppc.sr, sizeof(ppc.sr)); +} + +void ppc_load_state(CBlockFile *SaveState) +{ + if (OKAY != SaveState->FindBlock("PowerPC")) + { + ErrorLog("Unable to load PowerPC state. Save state file is corrupted."); + return; + } + + // Timer and decrementer + SaveState->Read(&ppc_icount, sizeof(ppc_icount)); + SaveState->Read(&ppc_tb_base_icount, sizeof(ppc_tb_base_icount)); + SaveState->Read(&ppc_dec_base_icount, sizeof(ppc_dec_base_icount)); + SaveState->Read(&ppc_dec_trigger_cycle, sizeof(ppc_dec_trigger_cycle)); + + // Registers + SaveState->Read(ppc.r, sizeof(ppc.r)); + SaveState->Read(&ppc.pc, sizeof(ppc.pc)); + SaveState->Read(&ppc.npc, sizeof(ppc.npc)); + ppc_change_pc(ppc.npc); + SaveState->Read(&ppc.lr, sizeof(ppc.lr)); + SaveState->Read(&ppc.ctr, sizeof(ppc.ctr)); + SaveState->Read(&ppc.xer, sizeof(ppc.xer)); + SaveState->Read(&ppc.msr, sizeof(ppc.msr)); + SaveState->Read(ppc.cr, sizeof(ppc.cr)); + SaveState->Read(&ppc.pvr, sizeof(ppc.pvr)); + SaveState->Read(&ppc.srr0, sizeof(ppc.srr0)); + SaveState->Read(&ppc.srr1, sizeof(ppc.srr1)); + SaveState->Read(&ppc.srr2, sizeof(ppc.srr2)); + SaveState->Read(&ppc.srr3, sizeof(ppc.srr3)); + SaveState->Read(&ppc.hid0, sizeof(ppc.hid0)); + SaveState->Read(&ppc.hid1, sizeof(ppc.hid1)); + SaveState->Read(&ppc.hid2, sizeof(ppc.hid2)); + SaveState->Read(&ppc.sdr1, sizeof(ppc.sdr1)); + SaveState->Read(ppc.sprg, sizeof(ppc.sprg)); + SaveState->Read(&ppc.dsisr, sizeof(ppc.dsisr)); + SaveState->Read(&ppc.dar, sizeof(ppc.dar)); + SaveState->Read(&ppc.ear, sizeof(ppc.ear)); + SaveState->Read(&ppc.dmiss, sizeof(ppc.dmiss)); + SaveState->Read(&ppc.dcmp, sizeof(ppc.dcmp)); + SaveState->Read(&ppc.hash1, sizeof(ppc.hash1)); + SaveState->Read(&ppc.hash2, sizeof(ppc.hash2)); + SaveState->Read(&ppc.imiss, sizeof(ppc.imiss)); + SaveState->Read(&ppc.icmp, sizeof(ppc.icmp)); + SaveState->Read(&ppc.rpa, sizeof(ppc.rpa)); + SaveState->Read(ppc.ibat, sizeof(ppc.ibat)); + SaveState->Read(ppc.dbat, sizeof(ppc.dbat)); + + SaveState->Read(&ppc.evpr, sizeof(ppc.evpr)); + SaveState->Read(&ppc.exier, sizeof(ppc.exier)); + SaveState->Read(&ppc.exisr, sizeof(ppc.exisr)); + SaveState->Read(&ppc.bear, sizeof(ppc.bear)); + SaveState->Read(&ppc.besr, sizeof(ppc.besr)); + SaveState->Read(&ppc.iocr, sizeof(ppc.iocr)); + SaveState->Read(ppc.br, sizeof(ppc.br)); + SaveState->Read(&ppc.iabr, sizeof(ppc.iabr)); + SaveState->Read(&ppc.esr, sizeof(ppc.esr)); + SaveState->Read(&ppc.iccr, sizeof(ppc.iccr)); + SaveState->Read(&ppc.dccr, sizeof(ppc.dccr)); + SaveState->Read(&ppc.pit, sizeof(ppc.pit)); + SaveState->Read(&ppc.pit_counter, sizeof(ppc.pit_counter)); + SaveState->Read(&ppc.pit_int_enable, sizeof(ppc.pit_int_enable)); + SaveState->Read(&ppc.tsr, sizeof(ppc.tsr)); + SaveState->Read(&ppc.dbsr, sizeof(ppc.dbsr)); + SaveState->Read(&ppc.sgr, sizeof(ppc.sgr)); + SaveState->Read(&ppc.pid, sizeof(ppc.pid)); + + SaveState->Read(&ppc.reserved, sizeof(ppc.reserved)); + SaveState->Read(&ppc.reserved_address, sizeof(ppc.reserved_address)); + SaveState->Read(&ppc.external_int, sizeof(ppc.external_int)); + + SaveState->Read(&ppc.tb, sizeof(ppc.tb)); + + SaveState->Read(&ppc.dec, sizeof(ppc.dec)); + SaveState->Read(&ppc.dec_frac, sizeof(ppc.dec_frac)); + SaveState->Read(&ppc.fpscr, sizeof(ppc.fpscr)); + + SaveState->Read(ppc.fpr, sizeof(ppc.fpr)); + SaveState->Read(ppc.sr, sizeof(ppc.sr)); +} + +UINT32 ppc_get_gpr(unsigned num) +{ + return ppc.r[num&31]; +} + +UINT32 ppc_get_lr(void) +{ + return ppc.lr; +} + +UINT32 ppc_read_spr(unsigned spr) +{ + return ppc_get_spr(spr); +} + +UINT32 ppc_read_sr(unsigned num) +{ + return ppc.sr[num&15]; +} \ No newline at end of file diff --git a/CPU/PowerPC/ppc.h b/CPU/PowerPC/ppc.h new file mode 100644 index 0000000..e09957e --- /dev/null +++ b/CPU/PowerPC/ppc.h @@ -0,0 +1,366 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * ppc.h + * + * Header file for PowerPC emulator. + */ + +#ifndef INCLUDED_PPC_H +#define INCLUDED_PPC_H + + +/****************************************************************************** + Definitions +******************************************************************************/ + +#define SPR_XER 1 /* Fixed Point Exception Register Read / Write */ +#define SPR_LR 8 /* Link Register Read / Write */ +#define SPR_CTR 9 /* Count Register Read / Write */ +#define SPR_SRR0 26 /* Save/Restore Register 0 Read / Write */ +#define SPR_SRR1 27 /* Save/Restore Register 1 Read / Write */ +#define SPR_SPRG0 272 /* SPR General 0 Read / Write */ +#define SPR_SPRG1 273 /* SPR General 1 Read / Write */ +#define SPR_SPRG2 274 /* SPR General 2 Read / Write */ +#define SPR_SPRG3 275 /* SPR General 3 Read / Write */ +#define SPR_PVR 287 /* Processor Version Number Read Only */ + +#define SPR403_ICDBDR 0x3D3 /* 406GA Instruction Cache Debug Data Register Rad Only */ +#define SPR403_ESR 0x3D4 /* 406GA Exception Syndrome Register Read / Write */ +#define SPR403_DEAR 0x3D5 /* 406GA Data Exception Address Register Read Only */ +#define SPR403_EVPR 0x3D6 /* 406GA Exception Vector Prefix Register Read / Write */ +#define SPR403_CDBCR 0x3D7 /* 406GA Cache Debug Control Register Read/Write */ +#define SPR403_TSR 0x3D8 /* 406GA Timer Status Register Read / Clear */ +#define SPR403_TCR 0x3DA /* 406GA Timer Control Register Read / Write */ +#define SPR403_PIT 0x3DB /* 406GA Programmable Interval Timer Read / Write */ +#define SPR403_TBHI 988 /* 406GA Time Base High Read / Write */ +#define SPR403_TBLO 989 /* 406GA Time Base Low Read / Write */ +#define SPR403_SRR2 0x3DE /* 406GA Save/Restore Register 2 Read / Write */ +#define SPR403_SRR3 0x3DF /* 406GA Save/Restore Register 3 Read / Write */ +#define SPR403_DBSR 0x3F0 /* 406GA Debug Status Register Read / Clear */ +#define SPR403_DBCR 0x3F2 /* 406GA Debug Control Register Read / Write */ +#define SPR403_IAC1 0x3F4 /* 406GA Instruction Address Compare 1 Read / Write */ +#define SPR403_IAC2 0x3F5 /* 406GA Instruction Address Compare 2 Read / Write */ +#define SPR403_DAC1 0x3F6 /* 406GA Data Address Compare 1 Read / Write */ +#define SPR403_DAC2 0x3F7 /* 406GA Data Address Compare 2 Read / Write */ +#define SPR403_DCCR 0x3FA /* 406GA Data Cache Cacheability Register Read / Write */ +#define SPR403_ICCR 0x3FB /* 406GA I Cache Cacheability Registe Read / Write */ +#define SPR403_PBL1 0x3FC /* 406GA Protection Bound Lower 1 Read / Write */ +#define SPR403_PBU1 0x3FD /* 406GA Protection Bound Upper 1 Read / Write */ +#define SPR403_PBL2 0x3FE /* 406GA Protection Bound Lower 2 Read / Write */ +#define SPR403_PBU2 0x3FF /* 406GA Protection Bound Upper 2 Read / Write */ + +#define SPR403_SGR 0x3b9 /* 403GCX Storage Guarded Register */ +#define SPR403_DCWR 0x3ba /* 403GCX Data Cache Write Through */ +#define SPR403_PID 0x3b1 /* 403GCX Process ID */ +#define SPR403_TBHU 0x3cc /* 403GCX Time Base High User-mode */ +#define SPR403_TBLU 0x3cd /* 403GCX Time Base Low User-mode */ + +#define SPR603E_DSISR 18 /* 603E */ +#define SPR603E_DAR 19 /* 603E */ +#define SPR603E_DEC 22 /* 603E */ +#define SPR603E_SDR1 25 /* 603E */ +#define SPR603E_TBL_R 268 /* 603E Time Base Low (Read-only) */ +#define SPR603E_TBU_R 269 /* 603E Time Base High (Read-only) */ +#define SPR603E_TBL_W 284 /* 603E Time Base Low (Write-only) */ +#define SPR603E_TBU_W 285 /* 603E Time Base Hight (Write-only) */ +#define SPR603E_EAR 282 /* 603E */ +#define SPR603E_IBAT0U 528 /* 603E */ +#define SPR603E_IBAT0L 529 /* 603E */ +#define SPR603E_IBAT1U 530 /* 603E */ +#define SPR603E_IBAT1L 531 /* 603E */ +#define SPR603E_IBAT2U 532 /* 603E */ +#define SPR603E_IBAT2L 533 /* 603E */ +#define SPR603E_IBAT3U 534 /* 603E */ +#define SPR603E_IBAT3L 535 /* 603E */ +#define SPR603E_DBAT0U 536 /* 603E */ +#define SPR603E_DBAT0L 537 /* 603E */ +#define SPR603E_DBAT1U 538 /* 603E */ +#define SPR603E_DBAT1L 539 /* 603E */ +#define SPR603E_DBAT2U 540 /* 603E */ +#define SPR603E_DBAT2L 541 /* 603E */ +#define SPR603E_DBAT3U 542 /* 603E */ +#define SPR603E_DBAT3L 543 /* 603E */ +#define SPR603E_DABR 1013 /* 603E */ +#define SPR603E_DMISS 0x3d0 /* 603E */ +#define SPR603E_DCMP 0x3d1 /* 603E */ +#define SPR603E_HASH1 0x3d2 /* 603E */ +#define SPR603E_HASH2 0x3d3 /* 603E */ +#define SPR603E_IMISS 0x3d4 /* 603E */ +#define SPR603E_ICMP 0x3d5 /* 603E */ +#define SPR603E_RPA 0x3d6 /* 603E */ +#define SPR603E_HID0 1008 /* 603E */ +#define SPR603E_HID1 1009 /* 603E */ +#define SPR603E_IABR 1010 /* 603E */ +#define SPR603E_HID2 1011 /* 603E */ + +#define SPR602_TCR 984 /* 602 */ +#define SPR602_IBR 986 /* 602 */ +#define SPR602_SP 1021 /* 602 */ +#define SPR602_LT 1022 /* 602 */ + + +#define DCR_BEAR 0x90 /* bus error address */ +#define DCR_BESR 0x91 /* bus error syndrome */ +#define DCR_BR0 0x80 /* bank */ +#define DCR_BR1 0x81 /* bank */ +#define DCR_BR2 0x82 /* bank */ +#define DCR_BR3 0x83 /* bank */ +#define DCR_BR4 0x84 /* bank */ +#define DCR_BR5 0x85 /* bank */ +#define DCR_BR6 0x86 /* bank */ +#define DCR_BR7 0x87 /* bank */ +#define DCR_DMACC0 0xc4 /* dma chained count */ +#define DCR_DMACC1 0xcc /* dma chained count */ +#define DCR_DMACC2 0xd4 /* dma chained count */ +#define DCR_DMACC3 0xdc /* dma chained count */ +#define DCR_DMACR0 0xc0 /* dma channel control */ +#define DCR_DMACR1 0xc8 /* dma channel control */ +#define DCR_DMACR2 0xd0 /* dma channel control */ +#define DCR_DMACR3 0xd8 /* dma channel control */ +#define DCR_DMACT0 0xc1 /* dma destination address */ +#define DCR_DMACT1 0xc9 /* dma destination address */ +#define DCR_DMACT2 0xd1 /* dma destination address */ +#define DCR_DMACT3 0xd9 /* dma destination address */ +#define DCR_DMADA0 0xc2 /* dma destination address */ +#define DCR_DMADA1 0xca /* dma destination address */ +#define DCR_DMADA2 0xd2 /* dma source address */ +#define DCR_DMADA3 0xda /* dma source address */ +#define DCR_DMASA0 0xc3 /* dma source address */ +#define DCR_DMASA1 0xcb /* dma source address */ +#define DCR_DMASA2 0xd3 /* dma source address */ +#define DCR_DMASA3 0xdb /* dma source address */ +#define DCR_DMASR 0xe0 /* dma status */ +#define DCR_EXIER 0x42 /* external interrupt enable */ +#define DCR_EXISR 0x40 /* external interrupt status */ +#define DCR_IOCR 0xa0 /* io configuration */ + +enum { + EXCEPTION_IRQ = 1, + EXCEPTION_DECREMENTER = 2, + EXCEPTION_TRAP = 3, + EXCEPTION_SYSTEM_CALL = 4, + EXCEPTION_SMI = 5, + EXCEPTION_DSI = 6, + EXCEPTION_ISI = 7, + EXCEPTION_PROGRAMMABLE_INTERVAL_TIMER = 20, + EXCEPTION_FIXED_INTERVAL_TIMER = 21, + EXCEPTION_WATCHDOG_TIMER = 22, + EXCEPTION_CRITICAL_INTERRUPT = 23, +}; + +enum { + PPC_INPUT_LINE_SMI = 10, + PPC_INPUT_LINE_TLBISYNC +}; + +enum { + PPC_PC=1, + PPC_MSR, + PPC_CR, + PPC_LR, + PPC_CTR, + PPC_XER, + PPC_DEC, + PPC_SRR0, + PPC_SRR1, + PPC_R0, + PPC_R1, + PPC_R2, + PPC_R3, + PPC_R4, + PPC_R5, + PPC_R6, + PPC_R7, + PPC_R8, + PPC_R9, + PPC_R10, + PPC_R11, + PPC_R12, + PPC_R13, + PPC_R14, + PPC_R15, + PPC_R16, + PPC_R17, + PPC_R18, + PPC_R19, + PPC_R20, + PPC_R21, + PPC_R22, + PPC_R23, + PPC_R24, + PPC_R25, + PPC_R26, + PPC_R27, + PPC_R28, + PPC_R29, + PPC_R30, + PPC_R31 +}; + +typedef enum { + PPC_MODEL_403GA = 0x00200000, + PPC_MODEL_403GB = 0x00200100, + PPC_MODEL_403GC = 0x00200200, + PPC_MODEL_403GCX = 0x00201400, + PPC_MODEL_405GP = 0x40110000, + PPC_MODEL_601 = 0x00010000, + PPC_MODEL_603 = 0x00030000, /* "Wart" */ + PPC_MODEL_604 = 0x00040000, /* "Zephyr" */ + PPC_MODEL_602 = 0x00050000, /* "Galahad" */ + PPC_MODEL_603E = 0x00060103, /* "Stretch", version 1.3 */ + PPC_MODEL_603EV = 0x00070000, /* "Valiant" */ + PPC_MODEL_603R = 0x00071202, /* "Goldeneye", version 2.1 */ + PPC_MODEL_740 = 0x00080301, /* "Arthur", version 3.1 */ + PPC_MODEL_750 = PPC_MODEL_740, + PPC_MODEL_740P = 0x00080202, /* "Conan Doyle", version 1.2 */ + PPC_MODEL_750P = PPC_MODEL_740P, + PPC_MODEL_755 = 0x00083203 /* "Goldfinger", version 2.3 */ +} PPC_MODEL; + +typedef enum { + BUS_FREQUENCY_16MHZ = 0, + BUS_FREQUENCY_20MHZ, + BUS_FREQUENCY_25MHZ, + BUS_FREQUENCY_33MHZ, + BUS_FREQUENCY_40MHZ, + BUS_FREQUENCY_50MHZ, + BUS_FREQUENCY_60MHZ, + BUS_FREQUENCY_66MHZ, + BUS_FREQUENCY_75MHZ, +} PPC_BUS_FREQUENCY; + +// PLL Configuration based on the table in MPC603EUM page 7-31 +static const int mpc603e_pll_config[12][9] = +{ + // 16, 20, 25, 33, 40, 50, 60, 66, 75 + { -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { 0x2, 0x2, 0x2, 0x1, 0x1, 0x1, -1, 0x0, -1 }, + { -1, -1, -1, -1, -1, 0xc, -1, 0xc, -1 }, + { 0x5, 0x5, 0x5, 0x4, 0x4, 0x4, -1, -1, -1 }, + { -1, -1, -1, 0x6, 0x6, -1, -1, -1, -1 }, + { -1, -1, 0x8, 0x8, -1, -1, -1, -1, -1 }, + { -1, 0xe, 0xe, -1, -1, -1, -1, -1, -1 }, + { 0xa, 0xa, 0xa, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1 }, +}; + +// PLL Configuration based on the table in MPC603E7VEC page 29 +static const int mpc603ev_pll_config[12][9] = +{ + // 16, 20, 25, 33, 40, 50, 60, 66, 75 + { -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + // 2:1 + { -1, -1, -1, -1, -1, -1, -1, 0x4, 0x4 }, + // 2.5:1 + { -1, -1, -1, -1, -1, 0x6, 0x6, 0x6, 0x6 }, + // 3:1 + { -1, -1, -1, -1, 0x8, 0x8, 0x8, 0x8, 0x8 }, + // 3.5:1 + { -1, -1, -1, -1, 0xe, 0xe, 0xe, 0xe, -1 }, + // 4:1 + { -1, -1, -1, 0xa, 0xa, 0xa, 0xa, -1, -1 }, + // 4.5:1 + { -1, -1, -1, 0x7, 0x7, 0x7, -1, -1, -1 }, + // 5:1 + { -1, -1, 0xb, 0xb, 0xb, -1, -1, -1, -1 }, + // 5.5:1 + { -1, -1, 0x9, 0x9, 0x9, -1, -1, -1, -1 }, + // 6:1 + { -1, -1, 0xd, 0xd, 0xd, -1, -1, -1, -1 } +}; + +// PLL Configuration based on the table in MPC603E7TEC page 23 +static const int mpc603r_pll_config[12][9] = +{ + // 16, 20, 25, 33, 40, 50, 60, 66, 75 + { -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + { -1, -1, -1, -1, -1, -1, -1, -1, -1 }, + // 2:1 + { -1, -1, -1, -1, 0x5, 0x5, 0x5, 0x5, 0x5 }, + // 2.5:1 + { -1, -1, -1, -1, -1, -1, 0x6, 0x6, 0x6 }, + // 3:1 + { -1, -1, -1, -1, -1, 0x8, 0x8, 0x8, 0x8 }, + // 3.5:1 + { -1, -1, -1, -1, -1, 0xe, 0xe, 0xe, 0xe }, + // 4:1 + { -1, -1, -1, -1, 0xa, 0xa, 0xa, 0xa, 0xa }, + // 4.5:1 + { -1, -1, -1, 0x7, 0x7, 0x7, 0x7, 0x7, -1 }, + // 5:1 + { -1, -1, -1, 0xb, 0xb, 0xb, 0xb, -1, -1 }, + // 5.5:1 + { -1, -1, -1, 0x9, 0x9, 0x9, -1, -1, -1 }, + // 6:1 + { -1, -1, 0xd, 0xd, 0xd, 0xd, -1, -1, -1 }, +}; + + +/****************************************************************************** + Configuration Data Structures +******************************************************************************/ + +typedef struct { + PPC_MODEL pvr; + int bus_frequency_multiplier; + PPC_BUS_FREQUENCY bus_frequency; +} PPC_CONFIG; + +typedef struct +{ + UINT32 start; + UINT32 end; + UINT32 * ptr; + +} PPC_FETCH_REGION; + + +/****************************************************************************** + Functions +******************************************************************************/ + +extern UINT32 ppc_get_pc(void); +extern void ppc_set_irq_line(int irqline); +extern int ppc_execute(int cycles); +extern void ppc_reset(void); +extern void ppc_shutdown(void); +extern void ppc_init(const PPC_CONFIG *config); // must be called second! +extern void ppc_set_fetch(PPC_FETCH_REGION * fetch); + +// These have been added to support the new Supermodel +extern void ppc_attach_bus(class CBus *BusPtr); // must be called first! +extern void ppc_save_state(class CBlockFile *SaveState); +extern void ppc_load_state(class CBlockFile *SaveState); +extern UINT32 ppc_get_gpr(unsigned num); +extern UINT32 ppc_get_lr(void); +extern UINT32 ppc_read_spr(unsigned spr); +extern UINT32 ppc_read_sr(unsigned num); + + +#endif // INCLUDED_PPC_H diff --git a/CPU/PowerPC/ppc603.c b/CPU/PowerPC/ppc603.c new file mode 100644 index 0000000..2764b30 --- /dev/null +++ b/CPU/PowerPC/ppc603.c @@ -0,0 +1,329 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * ppc603.c + * + * PowerPC 603e functions. Included from ppc.cpp; do not compile separately. + */ + +void ppc603_exception(int exception) +{ + switch( exception ) + { + case EXCEPTION_IRQ: /* External Interrupt */ + if( ppc_get_msr() & MSR_EE ) { + UINT32 msr = ppc_get_msr(); + + SRR0 = ppc.npc; + SRR1 = msr & 0xff73; + + msr &= ~(MSR_POW | MSR_EE | MSR_PR | MSR_FP | MSR_FE0 | MSR_SE | MSR_BE | MSR_FE1 | MSR_IR | MSR_DR | MSR_RI); + if( msr & MSR_ILE ) + msr |= MSR_LE; + else + msr &= ~MSR_LE; + ppc_set_msr(msr); + + if( msr & MSR_IP ) + ppc.npc = 0xfff00000 | 0x0500; + else + ppc.npc = 0x00000000 | 0x0500; + + ppc.interrupt_pending &= ~0x1; + ppc_change_pc(ppc.npc); + } + break; + + case EXCEPTION_DECREMENTER: /* Decrementer overflow exception */ + if( ppc_get_msr() & MSR_EE ) { + UINT32 msr = ppc_get_msr(); + + SRR0 = ppc.npc; + SRR1 = msr & 0xff73; + + msr &= ~(MSR_POW | MSR_EE | MSR_PR | MSR_FP | MSR_FE0 | MSR_SE | MSR_BE | MSR_FE1 | MSR_IR | MSR_DR | MSR_RI); + if( msr & MSR_ILE ) + msr |= MSR_LE; + else + msr &= ~MSR_LE; + ppc_set_msr(msr); + + if( msr & MSR_IP ) + ppc.npc = 0xfff00000 | 0x0900; + else + ppc.npc = 0x00000000 | 0x0900; + + ppc.interrupt_pending &= ~0x2; + ppc_change_pc(ppc.npc); + } + break; + + case EXCEPTION_TRAP: /* Program exception / Trap */ + { + UINT32 msr = ppc_get_msr(); + + SRR0 = ppc.pc; + SRR1 = (msr & 0xff73) | 0x20000; /* 0x20000 = TRAP bit */ + + msr &= ~(MSR_POW | MSR_EE | MSR_PR | MSR_FP | MSR_FE0 | MSR_SE | MSR_BE | MSR_FE1 | MSR_IR | MSR_DR | MSR_RI); + if( msr & MSR_ILE ) + msr |= MSR_LE; + else + msr &= ~MSR_LE; + ppc_set_msr(msr); + + if( msr & MSR_IP ) + ppc.npc = 0xfff00000 | 0x0700; + else + ppc.npc = 0x00000000 | 0x0700; + ppc_change_pc(ppc.npc); + } + break; + + case EXCEPTION_SYSTEM_CALL: /* System call */ + { + UINT32 msr = ppc_get_msr(); + + SRR0 = ppc.npc; + SRR1 = (msr & 0xff73); + + msr &= ~(MSR_POW | MSR_EE | MSR_PR | MSR_FP | MSR_FE0 | MSR_SE | MSR_BE | MSR_FE1 | MSR_IR | MSR_DR | MSR_RI); + if( msr & MSR_ILE ) + msr |= MSR_LE; + else + msr &= ~MSR_LE; + ppc_set_msr(msr); + + if( msr & MSR_IP ) + ppc.npc = 0xfff00000 | 0x0c00; + else + ppc.npc = 0x00000000 | 0x0c00; + ppc_change_pc(ppc.npc); + } + break; + + case EXCEPTION_SMI: + if( ppc_get_msr() & MSR_EE ) { + UINT32 msr = ppc_get_msr(); + + SRR0 = ppc.npc; + SRR1 = msr & 0xff73; + + msr &= ~(MSR_POW | MSR_EE | MSR_PR | MSR_FP | MSR_FE0 | MSR_SE | MSR_BE | MSR_FE1 | MSR_IR | MSR_DR | MSR_RI); + if( msr & MSR_ILE ) + msr |= MSR_LE; + else + msr &= ~MSR_LE; + ppc_set_msr(msr); + + if( msr & MSR_IP ) + ppc.npc = 0xfff00000 | 0x1400; + else + ppc.npc = 0x00000000 | 0x1400; + + ppc.interrupt_pending &= ~0x4; + ppc_change_pc(ppc.npc); + } + break; + + case EXCEPTION_DSI: + { + UINT32 msr = ppc_get_msr(); + + SRR0 = ppc.npc; + SRR1 = msr & 0xff73; + + msr &= ~(MSR_POW | MSR_EE | MSR_PR | MSR_FP | MSR_FE0 | MSR_SE | MSR_BE | MSR_FE1 | MSR_IR | MSR_DR | MSR_RI); + if( msr & MSR_ILE ) + msr |= MSR_LE; + else + msr &= ~MSR_LE; + ppc_set_msr(msr); + + if( msr & MSR_IP ) + ppc.npc = 0xfff00000 | 0x0300; + else + ppc.npc = 0x00000000 | 0x0300; + + ppc.interrupt_pending &= ~0x4; + ppc_change_pc(ppc.npc); + } + break; + + case EXCEPTION_ISI: + { + UINT32 msr = ppc_get_msr(); + + SRR0 = ppc.npc; + SRR1 = msr & 0xff73; + + msr &= ~(MSR_POW | MSR_EE | MSR_PR | MSR_FP | MSR_FE0 | MSR_SE | MSR_BE | MSR_FE1 | MSR_IR | MSR_DR | MSR_RI); + if( msr & MSR_ILE ) + msr |= MSR_LE; + else + msr &= ~MSR_LE; + ppc_set_msr(msr); + + if( msr & MSR_IP ) + ppc.npc = 0xfff00000 | 0x0400; + else + ppc.npc = 0x00000000 | 0x0400; + + ppc.interrupt_pending &= ~0x4; + ppc_change_pc(ppc.npc); + } + break; + + default: + ErrorLog("PowerPC triggered an unknown exception. Emulation halted until reset."); + DebugLog("PowerPC triggered an unknown exception (%d).\n", exception); + ppc.fatalError = TRUE; + break; + } +} + +static void ppc603_set_smi_line(int state) +{ + if( state ) { + ppc.interrupt_pending |= 0x4; + } +} + +static void ppc603_check_interrupts(void) +{ + if (MSR & MSR_EE) + { + if (ppc.interrupt_pending != 0) + { + if (ppc.interrupt_pending & 0x1) + { + ppc603_exception(EXCEPTION_IRQ); + } + else if (ppc.interrupt_pending & 0x2) + { + ppc603_exception(EXCEPTION_DECREMENTER); + } + else if (ppc.interrupt_pending & 0x4) + { + ppc603_exception(EXCEPTION_SMI); + } + } + } +} + +void ppc_reset(void) +{ + ppc.fatalError = FALSE; // reset the fatal error flag + + ppc.pc = ppc.npc = 0xfff00100; + + ppc_set_msr(0x40); + ppc_change_pc(ppc.pc); + + ppc.hid0 = 1; + + ppc.interrupt_pending = 0; +} + +int ppc_execute(int cycles) +{ + UINT32 opcode; + ppc_icount = cycles; + ppc_tb_base_icount = cycles; + ppc_dec_base_icount = cycles + ppc.dec_frac; + + // check if decrementer exception occurs during execution + if ((UINT32)(DEC - (cycles / (bus_freq_multiplier * 2))) > (UINT32)(DEC)) + { + ppc_dec_trigger_cycle = ((cycles / (bus_freq_multiplier * 2)) - DEC) * 4; + } + else + { + ppc_dec_trigger_cycle = 0x7fffffff; + } + + ppc_change_pc(ppc.npc); + + /*{ + char string1[200]; + char string2[200]; + opcode = BSWAP32(*ppc.op); + DisassemblePowerPC(opcode, ppc.npc, string1, string2, TRUE); + printf("%08X: %s %s\n", ppc.npc, string1, string2); + }*/ +// printf("trigger cycle %d (%08X)\n", ppc_dec_trigger_cycle, ppc_dec_trigger_cycle); +// printf("tb = %08X %08X\n", (UINT32)(ppc.tb >> 32), (UINT32)(ppc.tb)); + + ppc603_check_interrupts(); + + while( ppc_icount > 0 && !ppc.fatalError) + { + ppc.pc = ppc.npc; + + //if (ppc.pc == 0x279C) + // printf("R3=%08X\n", REG(3)); + + opcode = *ppc.op++; // Supermodel byte reverses each aligned word (converting them to little endian) so they can be fetched directly + //opcode = BSWAP32(*ppc.op++); + + ppc.npc = ppc.pc + 4; + switch(opcode >> 26) + { + case 19: optable19[(opcode >> 1) & 0x3ff](opcode); break; + case 31: optable31[(opcode >> 1) & 0x3ff](opcode); break; + case 59: optable59[(opcode >> 1) & 0x3ff](opcode); break; + case 63: optable63[(opcode >> 1) & 0x3ff](opcode); break; + default: optable[opcode >> 26](opcode); break; + } + + ppc_icount--; + + if(ppc_icount == ppc_dec_trigger_cycle) + { +// printf("dec int at %d\n", ppc_icount); + ppc.interrupt_pending |= 0x2; + ppc603_check_interrupts(); + } + + //ppc603_check_interrupts(); + } + + // update timebase + // timebase is incremented once every four core clock cycles, so adjust the cycles accordingly + ppc.tb += ((ppc_tb_base_icount - ppc_icount) / 4); + + // update decrementer + ppc.dec_frac = ((ppc_dec_base_icount - ppc_icount) % (bus_freq_multiplier * 2)); + DEC -= ((ppc_dec_base_icount - ppc_icount) / (bus_freq_multiplier * 2)); + + /* + { + char string1[200]; + char string2[200]; + opcode = BSWAP32(*ppc.op); + DisassemblePowerPC(opcode, ppc.npc, string1, string2, TRUE); + printf("%08X: %s %s\n", ppc.npc, string1, string2); + } + */ + + return cycles - ppc_icount; +} diff --git a/CPU/PowerPC/ppc_ops.c b/CPU/PowerPC/ppc_ops.c new file mode 100644 index 0000000..26a6fff --- /dev/null +++ b/CPU/PowerPC/ppc_ops.c @@ -0,0 +1,2832 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * ppc_ops.c + * + * PowerPC common opcodes. Included from ppc.cpp; do not compile compile + * separately. + * + * Changes to opcode handlers since inclusion in new Supermodel: + * - Feb. 13 2011: Changed stwcx. to always set the EQ flag. + */ + +/* PowerPC common opcodes */ + +// it really seems like this should be elsewhere - like maybe the floating point checks can hang out someplace else +#include + +static void ppc_unimplemented(UINT32 op) +{ + ErrorLog("PowerPC hit an unimplemented instruction. Halting emulation until reset."); + DebugLog("PowerPC encountered an unimplemented opcode %08X at %08X\n", op, ppc.pc); + ppc.fatalError = TRUE; +} + +static void ppc_addx(UINT32 op) +{ + UINT32 ra = REG(RA); + UINT32 rb = REG(RB); + + REG(RT) = ra + rb; + + if( OEBIT ) { + SET_ADD_OV(REG(RT), ra, rb); + } + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_addcx(UINT32 op) +{ + UINT32 ra = REG(RA); + UINT32 rb = REG(RB); + + REG(RT) = ra + rb; + + SET_ADD_CA(REG(RT), ra, rb); + + if( OEBIT ) { + SET_ADD_OV(REG(RT), ra, rb); + } + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_addex(UINT32 op) +{ + UINT32 ra = REG(RA); + UINT32 rb = REG(RB); + UINT32 carry = (XER >> 29) & 0x1; + UINT32 tmp; + + tmp = rb + carry; + REG(RT) = ra + tmp; + + if( ADD_CA(tmp, rb, carry) || ADD_CA(REG(RT), ra, tmp) ) + XER |= XER_CA; + else + XER &= ~XER_CA; + + if( OEBIT ) { + SET_ADD_OV(REG(RT), ra, rb); + } + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_addi(UINT32 op) +{ + UINT32 i = SIMM16; + UINT32 a = RA; + + if( a ) + i += REG(a); + + REG(RT) = i; +} + +static void ppc_addic(UINT32 op) +{ + UINT32 i = SIMM16; + UINT32 ra = REG(RA); + + REG(RT) = ra + i; + + if( ADD_CA(REG(RT), ra, i) ) + XER |= XER_CA; + else + XER &= ~XER_CA; +} + +static void ppc_addic_rc(UINT32 op) +{ + UINT32 i = SIMM16; + UINT32 ra = REG(RA); + + REG(RT) = ra + i; + + if( ADD_CA(REG(RT), ra, i) ) + XER |= XER_CA; + else + XER &= ~XER_CA; + + SET_CR0(REG(RT)); +} + +static void ppc_addis(UINT32 op) +{ + UINT32 i = UIMM16 << 16; + UINT32 a = RA; + + if( a ) + i += REG(a); + + REG(RT) = i; +} + +static void ppc_addmex(UINT32 op) +{ + UINT32 ra = REG(RA); + UINT32 carry = (XER >> 29) & 0x1; + UINT32 tmp; + + tmp = ra + carry; + REG(RT) = tmp + -1; + + if( ADD_CA(tmp, ra, carry) || ADD_CA(REG(RT), tmp, -1) ) + XER |= XER_CA; + else + XER &= ~XER_CA; + + if( OEBIT ) { + SET_ADD_OV(REG(RT), ra, carry - 1); + } + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_addzex(UINT32 op) +{ + UINT32 ra = REG(RA); + UINT32 carry = (XER >> 29) & 0x1; + + REG(RT) = ra + carry; + + if( ADD_CA(REG(RT), ra, carry) ) + XER |= XER_CA; + else + XER &= ~XER_CA; + + if( OEBIT ) { + SET_ADD_OV(REG(RT), ra, carry); + } + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_andx(UINT32 op) +{ + REG(RA) = REG(RS) & REG(RB); + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_andcx(UINT32 op) +{ + REG(RA) = REG(RS) & ~REG(RB); + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_andi_rc(UINT32 op) +{ + UINT32 i = UIMM16; + + REG(RA) = REG(RS) & i; + + SET_CR0(REG(RA)); +} + +static void ppc_andis_rc(UINT32 op) +{ + UINT32 i = UIMM16 << 16; + + REG(RA) = REG(RS) & i; + + SET_CR0(REG(RA)); +} + +static void ppc_bx(UINT32 op) +{ + INT32 li = op & 0x3fffffc; + if( li & 0x2000000 ) + li |= 0xfc000000; + + if( AABIT ) { + ppc.npc = li; + } else { + ppc.npc = ppc.pc + li; + } + + if( LKBIT ) { + LR = ppc.pc + 4; + } + + ppc_change_pc(ppc.npc); +} + +static void ppc_bcx(UINT32 op) +{ + int condition = check_condition_code(BO, BI); + + if( condition ) { + if( AABIT ) { + ppc.npc = SIMM16 & ~0x3; + } else { + ppc.npc = ppc.pc + (SIMM16 & ~0x3); + } + + ppc_change_pc(ppc.npc); + } + + if( LKBIT ) { + LR = ppc.pc + 4; + } +} + +static void ppc_bcctrx(UINT32 op) +{ + int condition = check_condition_code(BO, BI); + + if( condition ) { + ppc.npc = CTR & ~0x3; + ppc_change_pc(ppc.npc); + } + + if( LKBIT ) { + LR = ppc.pc + 4; + } +} + +static void ppc_bclrx(UINT32 op) +{ + int condition = check_condition_code(BO, BI); + + if( condition ) { + ppc.npc = LR & ~0x3; + ppc_change_pc(ppc.npc); + } + + if( LKBIT ) { + LR = ppc.pc + 4; + } +} + +static void ppc_cmp(UINT32 op) +{ + INT32 ra = REG(RA); + INT32 rb = REG(RB); + int d = CRFD; + + if( ra < rb ) + CR(d) = 0x8; + else if( ra > rb ) + CR(d) = 0x4; + else + CR(d) = 0x2; + + if( XER & XER_SO ) + CR(d) |= 0x1; +} + +static void ppc_cmpi(UINT32 op) +{ + INT32 ra = REG(RA); + INT32 i = SIMM16; + int d = CRFD; + + if( ra < i ) + CR(d) = 0x8; + else if( ra > i ) + CR(d) = 0x4; + else + CR(d) = 0x2; + + if( XER & XER_SO ) + CR(d) |= 0x1; +} + +static void ppc_cmpl(UINT32 op) +{ + UINT32 ra = REG(RA); + UINT32 rb = REG(RB); + int d = CRFD; + + if( ra < rb ) + CR(d) = 0x8; + else if( ra > rb ) + CR(d) = 0x4; + else + CR(d) = 0x2; + + if( XER & XER_SO ) + CR(d) |= 0x1; +} + +static void ppc_cmpli(UINT32 op) +{ + UINT32 ra = REG(RA); + UINT32 i = UIMM16; + int d = CRFD; + + if( ra < i ) + CR(d) = 0x8; + else if( ra > i ) + CR(d) = 0x4; + else + CR(d) = 0x2; + + if( XER & XER_SO ) + CR(d) |= 0x1; +} + +static void ppc_cntlzw(UINT32 op) +{ + int n = 0; + int t = RT; + UINT32 m = 0x80000000; + + while(n < 32) + { + if( REG(t) & m ) + break; + m >>= 1; + n++; + } + + REG(RA) = n; + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_crand(UINT32 op) +{ + int bit = RT; + int b = CRBIT(RA) & CRBIT(RB); + if( b & 0x1 ) + CR(bit / 4) |= _BIT(3-(bit % 4)); + else + CR(bit / 4) &= ~_BIT(3-(bit % 4)); +} + +static void ppc_crandc(UINT32 op) +{ + int bit = RT; + int b = CRBIT(RA) & ~CRBIT(RB); + if( b & 0x1 ) + CR(bit / 4) |= _BIT(3-(bit % 4)); + else + CR(bit / 4) &= ~_BIT(3-(bit % 4)); +} + +static void ppc_creqv(UINT32 op) +{ + int bit = RT; + int b = ~(CRBIT(RA) ^ CRBIT(RB)); + if( b & 0x1 ) + CR(bit / 4) |= _BIT(3-(bit % 4)); + else + CR(bit / 4) &= ~_BIT(3-(bit % 4)); +} + +static void ppc_crnand(UINT32 op) +{ + int bit = RT; + int b = ~(CRBIT(RA) & CRBIT(RB)); + if( b & 0x1 ) + CR(bit / 4) |= _BIT(3-(bit % 4)); + else + CR(bit / 4) &= ~_BIT(3-(bit % 4)); +} + +static void ppc_crnor(UINT32 op) +{ + int bit = RT; + int b = ~(CRBIT(RA) | CRBIT(RB)); + if( b & 0x1 ) + CR(bit / 4) |= _BIT(3-(bit % 4)); + else + CR(bit / 4) &= ~_BIT(3-(bit % 4)); +} + +static void ppc_cror(UINT32 op) +{ + int bit = RT; + int b = CRBIT(RA) | CRBIT(RB); + if( b & 0x1 ) + CR(bit / 4) |= _BIT(3-(bit % 4)); + else + CR(bit / 4) &= ~_BIT(3-(bit % 4)); +} + +static void ppc_crorc(UINT32 op) +{ + int bit = RT; + int b = CRBIT(RA) | ~CRBIT(RB); + if( b & 0x1 ) + CR(bit / 4) |= _BIT(3-(bit % 4)); + else + CR(bit / 4) &= ~_BIT(3-(bit % 4)); +} + +static void ppc_crxor(UINT32 op) +{ + int bit = RT; + int b = CRBIT(RA) ^ CRBIT(RB); + if( b & 0x1 ) + CR(bit / 4) |= _BIT(3-(bit % 4)); + else + CR(bit / 4) &= ~_BIT(3-(bit % 4)); +} + +static void ppc_dcbf(UINT32 op) +{ + +} + +static void ppc_dcbi(UINT32 op) +{ + +} + +static void ppc_dcbst(UINT32 op) +{ + +} + +static void ppc_dcbt(UINT32 op) +{ + +} + +static void ppc_dcbtst(UINT32 op) +{ + +} + +static void ppc_dcbz(UINT32 op) +{ + +} + +static void ppc_divwx(UINT32 op) +{ + if( REG(RB) == 0 && REG(RA) < 0x80000000 ) + { + REG(RT) = 0; + if( OEBIT ) { + XER |= XER_SO | XER_OV; + } + } + else if( REG(RB) == 0 || (REG(RB) == 0xffffffff && REG(RA) == 0x80000000) ) + { + REG(RT) = 0xffffffff; + if( OEBIT ) { + XER |= XER_SO | XER_OV; + } + } + else + { + REG(RT) = (INT32)REG(RA) / (INT32)REG(RB); + if( OEBIT ) { + XER &= ~XER_OV; + } + } + + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_divwux(UINT32 op) +{ + if( REG(RB) == 0 ) + { + REG(RT) = 0; + if( OEBIT ) { + XER |= XER_SO | XER_OV; + } + } + else + { + REG(RT) = (UINT32)REG(RA) / (UINT32)REG(RB); + if( OEBIT ) { + XER &= ~XER_OV; + } + } + + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_eieio(UINT32 op) +{ + +} + +static void ppc_eqvx(UINT32 op) +{ + REG(RA) = ~(REG(RS) ^ REG(RB)); + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_extsbx(UINT32 op) +{ + REG(RA) = (INT32)(INT8)REG(RS); + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_extshx(UINT32 op) +{ + REG(RA) = (INT32)(INT16)REG(RS); + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_icbi(UINT32 op) +{ + +} + +static void ppc_isync(UINT32 op) +{ + +} + +static void ppc_lbz(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = SIMM16; + else + ea = REG(RA) + SIMM16; + + REG(RT) = (UINT32)READ8(ea); +} + +static void ppc_lbzu(UINT32 op) +{ + UINT32 ea = REG(RA) + SIMM16; + + REG(RT) = (UINT32)READ8(ea); + REG(RA) = ea; +} + +static void ppc_lbzux(UINT32 op) +{ + UINT32 ea = REG(RA) + REG(RB); + + REG(RT) = (UINT32)READ8(ea); + REG(RA) = ea; +} + +static void ppc_lbzx(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + REG(RT) = (UINT32)READ8(ea); +} + +static void ppc_lha(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = SIMM16; + else + ea = REG(RA) + SIMM16; + + REG(RT) = (INT32)(INT16)READ16(ea); +} + +static void ppc_lhau(UINT32 op) +{ + UINT32 ea = REG(RA) + SIMM16; + + REG(RT) = (INT32)(INT16)READ16(ea); + REG(RA) = ea; +} + +static void ppc_lhaux(UINT32 op) +{ + UINT32 ea = REG(RA) + REG(RB); + + REG(RT) = (INT32)(INT16)READ16(ea); + REG(RA) = ea; +} + +static void ppc_lhax(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + REG(RT) = (INT32)(INT16)READ16(ea); +} + +static void ppc_lhbrx(UINT32 op) +{ + UINT32 ea; + UINT16 w; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + w = READ16(ea); + REG(RT) = (UINT32)BYTE_REVERSE16(w); +} + +static void ppc_lhz(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = SIMM16; + else + ea = REG(RA) + SIMM16; + + REG(RT) = (UINT32)READ16(ea); +} + +static void ppc_lhzu(UINT32 op) +{ + UINT32 ea = REG(RA) + SIMM16; + + REG(RT) = (UINT32)READ16(ea); + REG(RA) = ea; +} + +static void ppc_lhzux(UINT32 op) +{ + UINT32 ea = REG(RA) + REG(RB); + + REG(RT) = (UINT32)READ16(ea); + REG(RA) = ea; +} + +static void ppc_lhzx(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + REG(RT) = (UINT32)READ16(ea); +} + +static void ppc_lmw(UINT32 op) +{ + int r = RT; + UINT32 ea; + + if( RA == 0 ) + ea = SIMM16; + else + ea = REG(RA) + SIMM16; + + while( r <= 31 ) + { + REG(r) = READ32(ea); + ea += 4; + r++; + } +} + +static void ppc_lswi(UINT32 op) +{ + int n, r, i; + UINT32 ea = 0; + if( RA != 0 ) + ea = REG(RA); + + if( RB == 0 ) + n = 32; + else + n = RB; + + r = RT - 1; + i = 0; + + while(n > 0) + { + if (i == 0) { + r = (r + 1) % 32; + REG(r) = 0; + } + REG(r) |= ((READ8(ea) & 0xff) << (24 - i)); + i += 8; + if (i == 32) { + i = 0; + } + ea++; + n--; + } +} + +static void ppc_lswx(UINT32 op) +{ + ErrorLog("PowerPC hit an unimplemented instruction. Halting emulation until reset."); + DebugLog("ppc: lswx unimplemented at %08X\n", ppc.pc); + ppc.fatalError = TRUE; +} + +static void ppc_lwarx(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + ppc.reserved_address = ea; + ppc.reserved = 1; + + REG(RT) = READ32(ea); +} + +static void ppc_lwbrx(UINT32 op) +{ + UINT32 ea; + UINT32 w; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + w = READ32(ea); + REG(RT) = BYTE_REVERSE32(w); +} + +static void ppc_lwz(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = SIMM16; + else + ea = REG(RA) + SIMM16; + + REG(RT) = READ32(ea); +} + +static void ppc_lwzu(UINT32 op) +{ + UINT32 ea = REG(RA) + SIMM16; + + REG(RT) = READ32(ea); + REG(RA) = ea; +} + +static void ppc_lwzux(UINT32 op) +{ + UINT32 ea = REG(RA) + REG(RB); + + REG(RT) = READ32(ea); + REG(RA) = ea; +} + +static void ppc_lwzx(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + REG(RT) = READ32(ea); +} + +static void ppc_mcrf(UINT32 op) +{ + CR(RT >> 2) = CR(RA >> 2); +} + +static void ppc_mcrxr(UINT32 op) +{ + CR(RT >> 2) = (XER >> 28) & 0x0F; + XER &= ~0xf0000000; +} + +static void ppc_mfcr(UINT32 op) +{ + REG(RT) = ppc_get_cr(); +} + +static void ppc_mfmsr(UINT32 op) +{ + REG(RT) = ppc_get_msr(); +} + +static void ppc_mfspr(UINT32 op) +{ + REG(RT) = ppc_get_spr(SPR); +} + +static void ppc_mtcrf(UINT32 op) +{ + int fxm = FXM; + int t = RT; + + if( fxm & 0x80 ) CR(0) = (REG(t) >> 28) & 0xf; + if( fxm & 0x40 ) CR(1) = (REG(t) >> 24) & 0xf; + if( fxm & 0x20 ) CR(2) = (REG(t) >> 20) & 0xf; + if( fxm & 0x10 ) CR(3) = (REG(t) >> 16) & 0xf; + if( fxm & 0x08 ) CR(4) = (REG(t) >> 12) & 0xf; + if( fxm & 0x04 ) CR(5) = (REG(t) >> 8) & 0xf; + if( fxm & 0x02 ) CR(6) = (REG(t) >> 4) & 0xf; + if( fxm & 0x01 ) CR(7) = (REG(t) >> 0) & 0xf; +} + +static void ppc_mtmsr(UINT32 op) +{ + ppc_set_msr(REG(RS)); +} + +static void ppc_mtspr(UINT32 op) +{ + ppc_set_spr(SPR, REG(RS)); +} + +static void ppc_mulhwx(UINT32 op) +{ + INT64 ra = (INT64)(INT32)REG(RA); + INT64 rb = (INT64)(INT32)REG(RB); + + REG(RT) = (UINT32)((ra * rb) >> 32); + + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_mulhwux(UINT32 op) +{ + UINT64 ra = (UINT64)REG(RA); + UINT64 rb = (UINT64)REG(RB); + + REG(RT) = (UINT32)((ra * rb) >> 32); + + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_mulli(UINT32 op) +{ + INT32 ra = (INT32)REG(RA); + INT32 i = SIMM16; + + REG(RT) = ra * i; +} + +static void ppc_mullwx(UINT32 op) +{ + INT64 ra = (INT64)(INT32)REG(RA); + INT64 rb = (INT64)(INT32)REG(RB); + INT64 r; + + r = ra * rb; + REG(RT) = (UINT32)r; + + if( OEBIT ) { + XER &= ~XER_OV; + + if( r != (INT64)(INT32)r ) + XER |= XER_OV | XER_SO; + } + + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_nandx(UINT32 op) +{ + REG(RA) = ~(REG(RS) & REG(RB)); + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_negx(UINT32 op) +{ + REG(RT) = -(INT32)(REG(RA)); + + if( OEBIT ) { + if( REG(RT) == 0x80000000 ) + XER |= XER_OV | XER_SO; + else + XER &= ~XER_OV; + } + + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_norx(UINT32 op) +{ + REG(RA) = ~(REG(RS) | REG(RB)); + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_orx(UINT32 op) +{ + REG(RA) = REG(RS) | REG(RB); + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_orcx(UINT32 op) +{ + REG(RA) = REG(RS) | ~REG(RB); + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_ori(UINT32 op) +{ + REG(RA) = REG(RS) | UIMM16; +} + +static void ppc_oris(UINT32 op) +{ + REG(RA) = REG(RS) | (UIMM16 << 16); +} + +static void ppc_rfi(UINT32 op) +{ + UINT32 msr; + ppc.npc = ppc_get_spr(SPR_SRR0); + msr = ppc_get_spr(SPR_SRR1); + ppc_set_msr( msr ); + + ppc_change_pc(ppc.npc); +} + +static void ppc_rlwimix(UINT32 op) +{ + UINT32 r; + UINT32 mask = GET_ROTATE_MASK(MB, ME); + UINT32 rs = REG(RS); + int sh = SH; + + r = (rs << sh) | (rs >> (32-sh)); + REG(RA) = (REG(RA) & ~mask) | (r & mask); + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_rlwinmx(UINT32 op) +{ + UINT32 r; + UINT32 mask = GET_ROTATE_MASK(MB, ME); + UINT32 rs = REG(RS); + int sh = SH; + + r = (rs << sh) | (rs >> (32-sh)); + REG(RA) = r & mask; + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_rlwnmx(UINT32 op) +{ + UINT32 r; + UINT32 mask = GET_ROTATE_MASK(MB, ME); + UINT32 rs = REG(RS); + int sh = REG(RB) & 0x1f; + + r = (rs << sh) | (rs >> (32-sh)); + REG(RA) = r & mask; + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_sc(UINT32 op) +{ + ppc603_exception(EXCEPTION_SYSTEM_CALL); +} + +static void ppc_slwx(UINT32 op) +{ + int sh = REG(RB) & 0x3f; + + if( sh > 31 ) { + REG(RA) = 0; + } + else { + REG(RA) = REG(RS) << sh; + } + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_srawx(UINT32 op) +{ + int sh = REG(RB) & 0x3f; + + XER &= ~XER_CA; + + if( sh > 31 ) { + if (REG(RS) & 0x80000000) + REG(RA) = 0xffffffff; + else + REG(RA) = 0; + if( REG(RA) ) + XER |= XER_CA; + } + else { + REG(RA) = (INT32)(REG(RS)) >> sh; + if( ((INT32)(REG(RS)) < 0) && (REG(RS) & BITMASK_0(sh)) ) + XER |= XER_CA; + } + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_srawix(UINT32 op) +{ + int sh = SH; + + XER &= ~XER_CA; + if( ((INT32)(REG(RS)) < 0) && (REG(RS) & BITMASK_0(sh)) ) + XER |= XER_CA; + + REG(RA) = (INT32)(REG(RS)) >> sh; + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_srwx(UINT32 op) +{ + int sh = REG(RB) & 0x3f; + + if( sh > 31 ) { + REG(RA) = 0; + } + else { + REG(RA) = REG(RS) >> sh; + } + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_stb(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = SIMM16; + else + ea = REG(RA) + SIMM16; + + WRITE8(ea, (UINT8)REG(RS)); +} + +static void ppc_stbu(UINT32 op) +{ + UINT32 ea = REG(RA) + SIMM16; + + WRITE8(ea, (UINT8)REG(RS)); + REG(RA) = ea; +} + +static void ppc_stbux(UINT32 op) +{ + UINT32 ea = REG(RA) + REG(RB); + + WRITE8(ea, (UINT8)REG(RS)); + REG(RA) = ea; +} + +static void ppc_stbx(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + WRITE8(ea, (UINT8)REG(RS)); +} + +static void ppc_sth(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = SIMM16; + else + ea = REG(RA) + SIMM16; + + WRITE16(ea, (UINT16)REG(RS)); +} + +static void ppc_sthbrx(UINT32 op) +{ + UINT32 ea; + UINT16 w; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + w = REG(RS); + WRITE16(ea, (UINT16)BYTE_REVERSE16(w)); +} + +static void ppc_sthu(UINT32 op) +{ + UINT32 ea = REG(RA) + SIMM16; + + WRITE16(ea, (UINT16)REG(RS)); + REG(RA) = ea; +} + +static void ppc_sthux(UINT32 op) +{ + UINT32 ea = REG(RA) + REG(RB); + + WRITE16(ea, (UINT16)REG(RS)); + REG(RA) = ea; +} + +static void ppc_sthx(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + WRITE16(ea, (UINT16)REG(RS)); +} + +static void ppc_stmw(UINT32 op) +{ + UINT32 ea; + int r = RS; + + if( RA == 0 ) + ea = SIMM16; + else + ea = REG(RA) + SIMM16; + + while( r <= 31 ) + { + WRITE32(ea, REG(r)); + ea += 4; + r++; + } +} + +static void ppc_stswi(UINT32 op) +{ + int n, r, i; + UINT32 ea = 0; + if( RA != 0 ) + ea = REG(RA); + + if( RB == 0 ) + n = 32; + else + n = RB; + + r = RT - 1; + i = 0; + + while(n > 0) + { + if (i == 0) { + r = (r + 1) % 32; + } + WRITE8(ea, (REG(r) >> (24-i)) & 0xff); + i += 8; + if (i == 32) { + i = 0; + } + ea++; + n--; + } +} + +static void ppc_stswx(UINT32 op) +{ + ErrorLog("PowerPC hit an unimplemented instruction. Halting emulation until reset."); + DebugLog("ppc: stswx unimplemented\n"); + ppc.fatalError = TRUE; +} + +static void ppc_stw(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = SIMM16; + else + ea = REG(RA) + SIMM16; + + WRITE32(ea, REG(RS)); +} + +static void ppc_stwbrx(UINT32 op) +{ + UINT32 ea; + UINT32 w; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + w = REG(RS); + WRITE32(ea, BYTE_REVERSE32(w)); +} + +static void ppc_stwcx_rc(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + /*if( ppc.reserved ) { + WRITE32(ea, REG(RS)); + + ppc.reserved = 0; + ppc.reserved_address = 0; + + CR(0) = 0x2; + if( XER & XER_SO ) + CR(0) |= 0x1; + } else*/ { + //CR(0) = 0; + CR(0) = 2; // set EQ to indicate success + if( XER & XER_SO ) + CR(0) |= 0x1; + } +} + +static void ppc_stwu(UINT32 op) +{ + UINT32 ea = REG(RA) + SIMM16; + + WRITE32(ea, REG(RS)); + REG(RA) = ea; +} + +static void ppc_stwux(UINT32 op) +{ + UINT32 ea = REG(RA) + REG(RB); + + WRITE32(ea, REG(RS)); + REG(RA) = ea; +} + +static void ppc_stwx(UINT32 op) +{ + UINT32 ea; + + if( RA == 0 ) + ea = REG(RB); + else + ea = REG(RA) + REG(RB); + + WRITE32(ea, REG(RS)); +} + +static void ppc_subfx(UINT32 op) +{ + UINT32 ra = REG(RA); + UINT32 rb = REG(RB); + REG(RT) = rb - ra; + + if( OEBIT ) { + SET_SUB_OV(REG(RT), rb, ra); + } + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_subfcx(UINT32 op) +{ + UINT32 ra = REG(RA); + UINT32 rb = REG(RB); + REG(RT) = rb - ra; + + SET_SUB_CA(REG(RT), rb, ra); + + if( OEBIT ) { + SET_SUB_OV(REG(RT), rb, ra); + } + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_subfex(UINT32 op) +{ + UINT32 ra = REG(RA); + UINT32 rb = REG(RB); + UINT32 carry = (XER >> 29) & 0x1; + UINT32 r; + + r = ~ra + carry; + REG(RT) = rb + r; + + SET_ADD_CA(r, ~ra, carry); /* step 1 carry */ + if( REG(RT) < r ) /* step 2 carry */ + XER |= XER_CA; + + if( OEBIT ) { + SET_SUB_OV(REG(RT), rb, ra); + } + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_subfic(UINT32 op) +{ + UINT32 i = SIMM16; + UINT32 ra = REG(RA); + + REG(RT) = i - ra; + + SET_SUB_CA(REG(RT), i, ra); +} + +static void ppc_subfmex(UINT32 op) +{ + UINT32 ra = REG(RA); + UINT32 carry = (XER >> 29) & 0x1; + UINT32 r; + + r = ~ra + carry; + REG(RT) = r - 1; + + SET_SUB_CA(r, ~ra, carry); /* step 1 carry */ + if( REG(RT) < r ) + XER |= XER_CA; /* step 2 carry */ + + if( OEBIT ) { + SET_SUB_OV(REG(RT), -1, ra); + } + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_subfzex(UINT32 op) +{ + UINT32 ra = REG(RA); + UINT32 carry = (XER >> 29) & 0x1; + + REG(RT) = ~ra + carry; + + SET_ADD_CA(REG(RT), ~ra, carry); + + if( OEBIT ) { + SET_SUB_OV(REG(RT), 0, REG(RA)); + } + if( RCBIT ) { + SET_CR0(REG(RT)); + } +} + +static void ppc_sync(UINT32 op) +{ + +} + +static void ppc_tw(UINT32 op) +{ + int exception = 0; + INT32 a = REG(RA); + INT32 b = REG(RB); + int to = RT; + + if( (a < b) && (to & 0x10) ) { + exception = 1; + } + if( (a > b) && (to & 0x08) ) { + exception = 1; + } + if( (a == b) && (to & 0x04) ) { + exception = 1; + } + if( ((UINT32)a < (UINT32)b) && (to & 0x02) ) { + exception = 1; + } + if( ((UINT32)a > (UINT32)b) && (to & 0x01) ) { + exception = 1; + } + + if (exception) { + ppc603_exception(EXCEPTION_TRAP); + } +} + +static void ppc_twi(UINT32 op) +{ + int exception = 0; + INT32 a = REG(RA); + INT32 i = SIMM16; + int to = RT; + + if( (a < i) && (to & 0x10) ) { + exception = 1; + } + if( (a > i) && (to & 0x08) ) { + exception = 1; + } + if( (a == i) && (to & 0x04) ) { + exception = 1; + } + if( ((UINT32)a < (UINT32)i) && (to & 0x02) ) { + exception = 1; + } + if( ((UINT32)a > (UINT32)i) && (to & 0x01) ) { + exception = 1; + } + + if (exception) { + ppc603_exception(EXCEPTION_TRAP); + } +} + +static void ppc_xorx(UINT32 op) +{ + REG(RA) = REG(RS) ^ REG(RB); + + if( RCBIT ) { + SET_CR0(REG(RA)); + } +} + +static void ppc_xori(UINT32 op) +{ + REG(RA) = REG(RS) ^ UIMM16; +} + +static void ppc_xoris(UINT32 op) +{ + REG(RA) = REG(RS) ^ (UIMM16 << 16); +} + + + +static void ppc_invalid(UINT32 op) +{ + ErrorLog("PowerPC hit an invalid instruction. Halting emulation until reset."); + DebugLog("ppc: Invalid opcode %08X PC : %X, %08X\n", op, ppc.pc, ppc.npc); + ppc.fatalError = TRUE; +} + + + +#define DOUBLE_SIGN (0x8000000000000000ULL) +#define DOUBLE_EXP (0x7ff0000000000000ULL) +#define DOUBLE_FRAC (0x000fffffffffffffULL) +#define DOUBLE_ZERO (0ULL) + +/* + Floating point operations. +*/ + +/*************************OLD +INLINE int is_nan_double(FPR x) +{ + return( ((x.id & DOUBLE_EXP) == DOUBLE_EXP) && + ((x.id & DOUBLE_FRAC) != DOUBLE_ZERO) ); +} + +INLINE int is_qnan_double(FPR x) +{ + return( ((x.id & DOUBLE_EXP) == DOUBLE_EXP) && + ((x.id & 0x0007fffffffffff) == 0x000000000000000) && + ((x.id & 0x000800000000000) == 0x000800000000000) ); +} + +INLINE int is_snan_double(FPR x) +{ + return( ((x.id & DOUBLE_EXP) == DOUBLE_EXP) && + ((x.id & DOUBLE_FRAC) != DOUBLE_ZERO) && + ((x.id & 0x0008000000000000) == DOUBLE_ZERO) ); +} + +INLINE int is_infinity_double(FPR x) +{ + return( ((x.id & DOUBLE_EXP) == DOUBLE_EXP) && + ((x.id & DOUBLE_FRAC) == DOUBLE_ZERO) ); +} + +INLINE int is_normalized_double(FPR x) +{ + UINT64 exp; + + exp = (x.id & DOUBLE_EXP) >> 52; + + return (exp >= 1) && (exp <= 2046); +} + +INLINE int is_denormalized_double(FPR x) +{ + return( ((x.id & DOUBLE_EXP) == 0) && + ((x.id & DOUBLE_FRAC) != DOUBLE_ZERO) ); +} + +INLINE int sign_double(FPR x) +{ + return ((x.id & DOUBLE_SIGN) != 0); +} + +INLINE INT64 round_to_nearest(FPR f) +{ + //return (INT64)(f.fd + 0.5); + if (f.fd >= 0) + { + return (INT64)(f.fd + 0.5); + } + else + { + return -(INT64)(-f.fd + 0.5); + } +} + +INLINE INT64 round_toward_zero(FPR f) +{ + return (INT64)(f.fd); +} + +INLINE INT64 round_toward_positive_infinity(FPR f) +{ + double r = ceil(f.fd); + return (INT64)(r); +} + +INLINE INT64 round_toward_negative_infinity(FPR f) +{ + double r = floor(f.fd); + return (INT64)(r); +} +*/ + + +// New below, based on changes in MAME +INLINE int is_nan_double(FPR x) +{ + return( ((x.id & DOUBLE_EXP) == DOUBLE_EXP) && + ((x.id & DOUBLE_FRAC) != DOUBLE_ZERO) ); +} + +INLINE int is_qnan_double(FPR x) +{ + return( ((x.id & DOUBLE_EXP) == DOUBLE_EXP) && + ((x.id & 0x0007fffffffffffULL) == 0x000000000000000ULL) && + ((x.id & 0x000800000000000ULL) == 0x000800000000000ULL) ); +} + +INLINE int is_snan_double(FPR x) +{ + return( ((x.id & DOUBLE_EXP) == DOUBLE_EXP) && + ((x.id & DOUBLE_FRAC) != DOUBLE_ZERO) && + ((x.id & (0x0008000000000000ULL)) == DOUBLE_ZERO) ); +} + +INLINE int is_infinity_double(FPR x) +{ + return( ((x.id & DOUBLE_EXP) == DOUBLE_EXP) && + ((x.id & DOUBLE_FRAC) == DOUBLE_ZERO) ); +} + +INLINE int is_normalized_double(FPR x) +{ + UINT64 exp; + + exp = (x.id & DOUBLE_EXP) >> 52; + + return (exp >= 1) && (exp <= 2046); +} + +INLINE int is_denormalized_double(FPR x) +{ + return( ((x.id & DOUBLE_EXP) == 0) && + ((x.id & DOUBLE_FRAC) != DOUBLE_ZERO) ); +} + +INLINE int sign_double(FPR x) +{ + return ((x.id & DOUBLE_SIGN) != 0); +} + +INLINE INT64 smround_to_nearest(FPR f) +{ + if (f.fd >= 0) + { + return (INT64)(f.fd + 0.5); + } + else + { + return -(INT64)(-f.fd + 0.5); + } +} + +INLINE INT64 smround_toward_zero(FPR f) +{ + return (INT64)(f.fd); +} + +INLINE INT64 round_toward_positive_infinity(FPR f) +{ + double r = ceil(f.fd); + return (INT64)(r); +} + +INLINE INT64 round_toward_negative_infinity(FPR f) +{ + double r = floor(f.fd); + return (INT64)(r); +} + +#define SET_VXSNAN(a, b) if (is_snan_double(a) || is_snan_double(b)) ppc.fpscr |= 0x80000000 +#define SET_VXSNAN_1(c) if (is_snan_double(c)) ppc.fpscr |= 0x80000000 + +INLINE void set_fprf(FPR f) +{ + UINT32 fprf; + + // see page 3-30, 3-31 + + if (is_qnan_double(f)) + { + fprf = 0x11; + } + else if (is_infinity_double(f)) + { + if (sign_double(f)) // -INF + fprf = 0x09; + else // +INF + fprf = 0x05; + } + else if (is_normalized_double(f)) + { + if (sign_double(f)) // -Normalized + fprf = 0x08; + else // +Normalized + fprf = 0x04; + } + else if (is_denormalized_double(f)) + { + if (sign_double(f)) // -Denormalized + fprf = 0x18; + else // +Denormalized + fprf = 0x14; + } + else // Zero + { + if (sign_double(f)) // -Zero + fprf = 0x12; + else // +Zero + fprf = 0x02; + } + + ppc.fpscr &= ~0x0001f000; + ppc.fpscr |= (fprf << 12); +} + + + + +static void ppc_lfs(UINT32 op) +{ + UINT32 ea = SIMM16; + UINT32 a = RA; + UINT32 t = RT; + FPR32 f; + + if(a) + ea += REG(a); + + f.i = READ32(ea); + FPR(t).fd = (double)(f.f); +} + +static void ppc_lfsu(UINT32 op) +{ + UINT32 ea = SIMM16; + UINT32 a = RA; + UINT32 t = RT; + FPR32 f; + + ea += REG(a); + + f.i = READ32(ea); + FPR(t).fd = (double)(f.f); + + REG(a) = ea; +} + +static void ppc_lfd(UINT32 op) +{ + UINT32 ea = SIMM16; + UINT32 a = RA; + UINT32 t = RT; + + if(a) + ea += REG(a); + + FPR(t).id = READ64(ea); +} + +static void ppc_lfdu(UINT32 op) +{ + UINT32 ea = SIMM16; + UINT32 a = RA; + UINT32 d = RD; + + ea += REG(a); + + FPR(d).id = READ64(ea); + + REG(a) = ea; +} + +static void ppc_stfs(UINT32 op) +{ + UINT32 ea = SIMM16; + UINT32 a = RA; + UINT32 t = RT; + FPR32 f; + + if(a) + ea += REG(a); + + f.f = (float)(FPR(t).fd); + WRITE32(ea, f.i); +} + +static void ppc_stfsu(UINT32 op) +{ + UINT32 ea = SIMM16; + UINT32 a = RA; + UINT32 t = RT; + FPR32 f; + + ea += REG(a); + + f.f = (float)(FPR(t).fd); + WRITE32(ea, f.i); + + REG(a) = ea; +} + +static void ppc_stfd(UINT32 op) +{ + UINT32 ea = SIMM16; + UINT32 a = RA; + UINT32 t = RT; + + if(a) + ea += REG(a); + + WRITE64(ea, FPR(t).id); +} + +static void ppc_stfdu(UINT32 op) +{ + UINT32 ea = SIMM16; + UINT32 a = RA; + UINT32 t = RT; + + ea += REG(a); + + WRITE64(ea, FPR(t).id); + + REG(a) = ea; +} + +static void ppc_lfdux(UINT32 op) +{ + UINT32 ea = REG(RB); + UINT32 a = RA; + UINT32 d = RD; + + ea += REG(a); + + FPR(d).id = READ64(ea); + + REG(a) = ea; +} + +static void ppc_lfdx(UINT32 op) +{ + UINT32 ea = REG(RB); + UINT32 a = RA; + UINT32 d = RD; + + if(a) + ea += REG(a); + + FPR(d).id = READ64(ea); +} + +static void ppc_lfsux(UINT32 op) +{ + UINT32 ea = REG(RB); + UINT32 a = RA; + UINT32 t = RT; + FPR32 f; + + ea += REG(a); + + f.i = READ32(ea); + FPR(t).fd = (double)(f.f); + + REG(a) = ea; +} + +static void ppc_lfsx(UINT32 op) +{ + UINT32 ea = REG(RB); + UINT32 a = RA; + UINT32 t = RT; + FPR32 f; + + if(a) + ea += REG(a); + + f.i = READ32(ea); + FPR(t).fd = (double)(f.f); +} + +static void ppc_mfsr(UINT32 op) +{ + UINT32 sr = (op >> 16) & 15; + UINT32 t = RT; + + CHECK_SUPERVISOR(); + + REG(t) = ppc.sr[sr]; +} + +static void ppc_mfsrin(UINT32 op) +{ + UINT32 b = RB; + UINT32 t = RT; + + CHECK_SUPERVISOR(); + + REG(t) = ppc.sr[REG(b) >> 28]; +} + +static void ppc_mftb(UINT32 op) +{ + UINT32 x = SPRF; + + switch(x) + { + case 268: REG(RT) = (UINT32)(ppc_read_timebase()); break; + case 269: REG(RT) = (UINT32)(ppc_read_timebase() >> 32); break; + default: + ErrorLog("PowerPC read from an invalid register. Halting emulation until reset."); + DebugLog("ppc: Invalid timebase register %d at %08X\n", x, ppc.pc); + ppc.fatalError = TRUE; + break; + } +} + +static void ppc_mtsr(UINT32 op) +{ + UINT32 sr = (op >> 16) & 15; + UINT32 t = RT; + + CHECK_SUPERVISOR(); + + ppc.sr[sr] = REG(t); +} + +static void ppc_mtsrin(UINT32 op) +{ + UINT32 b = RB; + UINT32 t = RT; + + CHECK_SUPERVISOR(); + + ppc.sr[REG(b) >> 28] = REG(t); +} + +static void ppc_dcba(UINT32 op) +{ + /* TODO: Cache not emulated so this opcode doesn't need to be implemented */ +} + +static void ppc_stfdux(UINT32 op) +{ + UINT32 ea = REG(RB); + UINT32 a = RA; + UINT32 t = RT; + + ea += REG(a); + + WRITE64(ea, FPR(t).id); + + REG(a) = ea; +} + +static void ppc_stfdx(UINT32 op) +{ + UINT32 ea = REG(RB); + UINT32 a = RA; + UINT32 t = RT; + + if(a) + ea += REG(a); + + WRITE64(ea, FPR(t).id); +} + +static void ppc_stfiwx(UINT32 op) +{ + UINT32 ea = REG(RB); + UINT32 a = RA; + UINT32 t = RT; + + if(a) + ea += REG(a); + + WRITE32(ea, (UINT32)FPR(t).id); +} + +static void ppc_stfsux(UINT32 op) +{ + UINT32 ea = REG(RB); + UINT32 a = RA; + UINT32 t = RT; + FPR32 f; + + ea += REG(a); + + f.f = (float)(FPR(t).fd); + WRITE32(ea, f.i); + + REG(a) = ea; +} + +static void ppc_stfsx(UINT32 op) +{ + UINT32 ea = REG(RB); + UINT32 a = RA; + UINT32 t = RT; + FPR32 f; + + if(a) + ea += REG(a); + + f.f = (float)(FPR(t).fd); + + WRITE32(ea, f.i); +} + +static void ppc_tlbia(UINT32 op) +{ + /* TODO: TLB not emulated so this opcode doesn't need to implemented */ +} + +static void ppc_tlbie(UINT32 op) +{ + /* TODO: TLB not emulated so this opcode doesn't need to implemented */ +} + +static void ppc_tlbsync(UINT32 op) +{ + /* TODO: TLB not emulated so this opcode doesn't need to implemented */ +} + +static void ppc_eciwx(UINT32 op) +{ + ppc_unimplemented(op); +} + +static void ppc_ecowx(UINT32 op) +{ + ppc_unimplemented(op); +} + +static void ppc_fabsx(UINT32 op) +{ + UINT32 b = RB; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + FPR(t).id = FPR(b).id & ~DOUBLE_SIGN; + + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_faddx(UINT32 op) +{ + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + + FPR(t).fd = FPR(a).fd + FPR(b).fd; + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fcmpo(UINT32 op) +{ + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = (RT >> 2); + UINT32 c; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + + if(is_nan_double(FPR(a)) || is_nan_double(FPR(b))) + { + c = 1; /* OX */ + if(is_snan_double(FPR(a)) || is_snan_double(FPR(b))) { + ppc.fpscr |= 0x01000000; /* VXSNAN */ + + if(!(ppc.fpscr & 0x40000000) || is_qnan_double(FPR(a)) || is_qnan_double(FPR(b))) + ppc.fpscr |= 0x00080000; /* VXVC */ + } + } + else if(FPR(a).fd < FPR(b).fd){ + c = 8; /* FX */ + } + else if(FPR(a).fd > FPR(b).fd){ + c = 4; /* FEX */ + } + else { + c = 2; /* VX */ + } + + CR(t) = c; + + // TODO + // Enabled by Bart + ppc.fpscr &= ~0x0001F000; + ppc.fpscr |= (c << 12); +} + +static void ppc_fcmpu(UINT32 op) +{ + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = (RT >> 2); + UINT32 c; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + + if(is_nan_double(FPR(a)) || is_nan_double(FPR(b))) + { + c = 1; /* OX */ + if(is_snan_double(FPR(a)) || is_snan_double(FPR(b))) { + ppc.fpscr |= 0x01000000; /* VXSNAN */ + } + } + else if(FPR(a).fd < FPR(b).fd){ + c = 8; /* FX */ + } + else if(FPR(a).fd > FPR(b).fd){ + c = 4; /* FEX */ + } + else { + c = 2; /* VX */ + } + + CR(t) = c; + + // TODO + ppc.fpscr &= ~0x0001F000; + ppc.fpscr |= (c << 12); +} + +static void ppc_fctiwx(UINT32 op) +{ + UINT32 b = RB; + UINT32 t = RT; + INT64 r = 0; + + // TODO: fix FPSCR flags FX,VXSNAN,VXCVI + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN_1(FPR(b)); + + switch(ppc.fpscr & 3) + { + case 0: r = (INT64)smround_to_nearest(FPR(b)); break; + case 1: r = (INT64)smround_toward_zero(FPR(b)); break; + case 2: r = (INT64)round_toward_positive_infinity(FPR(b)); break; + case 3: r = (INT64)round_toward_negative_infinity(FPR(b)); break; + } + + if(r > (INT64)((INT32)0x7FFFFFFF)) + { + FPR(t).id = 0x7FFFFFFF; + // FPSCR[FR] = 0 + // FPSCR[FI] = 1 + // FPSCR[XX] = 1 + } + else if(FPR(b).fd < (INT64)((INT32)0x80000000)) + { + FPR(t).id = 0x80000000; + // FPSCR[FR] = 1 + // FPSCR[FI] = 1 + // FPSCR[XX] = 1 + } + else + { + FPR(t).id = (UINT32)(r); + // FPSCR[FR] = t.iw > t.fd + // FPSCR[FI] = t.iw == t.fd + // FPSCR[XX] = ? + } + + // FPSCR[FPRF] = undefined (leave it as is) + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fctiwzx(UINT32 op) +{ + UINT32 b = RB; + UINT32 t = RT; + INT64 r; + + // TODO: fix FPSCR flags FX,VXSNAN,VXCVI + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN_1(FPR(b)); + r = smround_toward_zero(FPR(b)); + + if(r > (INT64)((INT32)0x7fffffff)) + { + FPR(t).id = 0x7fffffff; + // FPSCR[FR] = 0 + // FPSCR[FI] = 1 + // FPSCR[XX] = 1 + + } + else if(r < (INT64)((INT32)0x80000000)) + { + FPR(t).id = 0x80000000; + // FPSCR[FR] = 1 + // FPSCR[FI] = 1 + // FPSCR[XX] = 1 + } + else + { + FPR(t).id = (UINT32)r; + // FPSCR[FR] = t.iw > t.fd + // FPSCR[FI] = t.iw == t.fd + // FPSCR[XX] = ? + } + + // FPSCR[FPRF] = undefined (leave it as is) + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fdivx(UINT32 op) +{ + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + + FPR(t).fd = FPR(a).fd / FPR(b).fd; + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fmrx(UINT32 op) +{ + UINT32 b = RB; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + FPR(t).fd = FPR(b).fd; + + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fnabsx(UINT32 op) +{ + UINT32 b = RB; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + FPR(t).id = FPR(b).id | DOUBLE_SIGN; + + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fnegx(UINT32 op) +{ + UINT32 b = RB; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + FPR(t).id = FPR(b).id ^ DOUBLE_SIGN; + + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_frspx(UINT32 op) +{ + UINT32 b = RB; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN_1(FPR(b)); + + FPR(t).fd = (float)FPR(b).fd; + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_frsqrtex(UINT32 op) +{ + UINT32 b = RB; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN_1(FPR(b)); + + FPR(t).fd = 1.0 / sqrt(FPR(b).fd); /* verify this */ + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fsqrtx(UINT32 op) +{ + /* NOTE: PPC603e doesn't support this opcode */ + UINT32 b = RB; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN_1(FPR(b)); + + FPR(t).fd = (double)(sqrt(FPR(b).fd)); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fsubx(UINT32 op) +{ + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + + FPR(t).fd = FPR(a).fd - FPR(b).fd; + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_mffsx(UINT32 op) +{ + FPR(RT).id = (UINT32)ppc.fpscr; + + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_mtfsb0x(UINT32 op) +{ + UINT32 crbD; + + crbD = (op >> 21) & 0x1F; + + if (crbD != 1 && crbD != 2) // these bits cannot be explicitly cleared + ppc.fpscr &= ~(1 << (31 - crbD)); + + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_mtfsb1x(UINT32 op) +{ + UINT32 crbD; + + crbD = (op >> 21) & 0x1F; + + if (crbD != 1 && crbD != 2) // these bits cannot be explicitly cleared + ppc.fpscr |= (1 << (31 - crbD)); + + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_mtfsfx(UINT32 op) +{ + UINT32 b = RB; + UINT32 f = FM; + + f = ppc_field_xlat[FM]; + + ppc.fpscr &= (~f) | ~(FPSCR_FEX | FPSCR_VX); + ppc.fpscr |= (UINT32)(FPR(b).id) & ~(FPSCR_FEX | FPSCR_VX); + + // FEX, VX + + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_mtfsfix(UINT32 op) +{ + UINT32 crfd = CRFD; + UINT32 imm = (op >> 12) & 0xF; + + /* + * According to the manual: + * + * If bits 0 and 3 of FPSCR are to be modified, they take the immediate + * value specified. Bits 1 and 2 (FEX and VX) are set according to the + * "usual rule" and not from IMM[1-2]. + * + * The "usual rule" is not emulated, so these bits simply aren't modified + * at all here. + */ + + crfd = (7 - crfd) * 4; // calculate LSB position of field + + if (crfd == 28) // field containing FEX and VX is special... + { // bits 1 and 2 of FPSCR must not be altered + ppc.fpscr &= 0x9fffffff; + ppc.fpscr |= (imm & 0x9fffffff); + } + + ppc.fpscr &= ~(0xf << crfd); // clear field + ppc.fpscr |= (imm << crfd); // insert new data + + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_mcrfs(UINT32 op) +{ + UINT32 crfs, f; + crfs = CRFA; + + f = ppc.fpscr >> ((7 - crfs) * 4); // get crfS field from FPSCR + f &= 0xf; + + switch(crfs) // determine which exception bits to clear in FPSCR + { + case 0: // FX, OX + ppc.fpscr &= ~0x90000000; + break; + case 1: // UX, ZX, XX, VXSNAN + ppc.fpscr &= ~0x0f000000; + break; + case 2: // VXISI, VXIDI, VXZDZ, VXIMZ + ppc.fpscr &= ~0x00F00000; + break; + case 3: // VXVC + ppc.fpscr &= ~0x00080000; + break; + case 5: // VXSOFT, VXSQRT, VXCVI + ppc.fpscr &= ~0x00000e00; + break; + default: + break; + } + + CR(CRFD) = f; +} + +static void ppc_faddsx(UINT32 op) +{ + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + + FPR(t).fd = (float)(FPR(a).fd + FPR(b).fd); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fdivsx(UINT32 op) +{ + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + + FPR(t).fd = (float)(FPR(a).fd / FPR(b).fd); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fresx(UINT32 op) +{ + UINT32 b = RB; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN_1(FPR(b)); + + FPR(t).fd = 1.0 / FPR(b).fd; /* ??? */ + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fsqrtsx(UINT32 op) +{ + /* NOTE: This opcode is not supported in PPC603e */ + UINT32 b = RB; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN_1(FPR(b)); + + FPR(t).fd = (float)(sqrt(FPR(b).fd)); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fsubsx(UINT32 op) +{ + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + + FPR(t).fd = (float)(FPR(a).fd - FPR(b).fd); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fmaddx(UINT32 op) +{ + UINT32 c = RC; + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + SET_VXSNAN_1(FPR(c)); + + FPR(t).fd = ((FPR(a).fd * FPR(c).fd) + FPR(b).fd); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fmsubx(UINT32 op) +{ + UINT32 c = RC; + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + SET_VXSNAN_1(FPR(c)); + + FPR(t).fd = ((FPR(a).fd * FPR(c).fd) - FPR(b).fd); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fmulx(UINT32 op) +{ + UINT32 c = RC; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(c)); + + FPR(t).fd = (FPR(a).fd * FPR(c).fd); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fnmaddx(UINT32 op) +{ + UINT32 c = RC; + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + SET_VXSNAN_1(FPR(c)); + + FPR(t).fd = (-((FPR(a).fd * FPR(c).fd) + FPR(b).fd)); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fnmsubx(UINT32 op) +{ + UINT32 c = RC; + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + SET_VXSNAN_1(FPR(c)); + + FPR(t).fd = (-((FPR(a).fd * FPR(c).fd) - FPR(b).fd)); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fselx(UINT32 op) +{ + UINT32 c = RC; + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + FPR(t).fd = (FPR(a).fd >= 0.0) ? FPR(c).fd : FPR(b).fd; + + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fmaddsx(UINT32 op) +{ + UINT32 c = RC; + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + SET_VXSNAN_1(FPR(c)); + + FPR(t).fd = (float)((FPR(a).fd * FPR(c).fd) + FPR(b).fd); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fmsubsx(UINT32 op) +{ + UINT32 c = RC; + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + SET_VXSNAN_1(FPR(c)); + + FPR(t).fd = (float)((FPR(a).fd * FPR(c).fd) - FPR(b).fd); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fmulsx(UINT32 op) +{ + UINT32 c = RC; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + SET_VXSNAN(FPR(a), FPR(c)); + + FPR(t).fd = (float)(FPR(a).fd * FPR(c).fd); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fnmaddsx(UINT32 op) +{ + UINT32 c = RC; + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + SET_VXSNAN_1(FPR(c)); + + FPR(t).fd = (float)(-((FPR(a).fd * FPR(c).fd) + FPR(b).fd)); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} + +static void ppc_fnmsubsx(UINT32 op) +{ + UINT32 c = RC; + UINT32 b = RB; + UINT32 a = RA; + UINT32 t = RT; + + CHECK_FPU_AVAILABLE(); + + SET_VXSNAN(FPR(a), FPR(b)); + SET_VXSNAN_1(FPR(c)); + + FPR(t).fd = (float)(-((FPR(a).fd * FPR(c).fd) - FPR(b).fd)); + + set_fprf(FPR(t)); + if( RCBIT ) { + SET_CR1(); + } +} diff --git a/CPU/PowerPC/ppc_ops.h b/CPU/PowerPC/ppc_ops.h new file mode 100644 index 0000000..6a9681e --- /dev/null +++ b/CPU/PowerPC/ppc_ops.h @@ -0,0 +1,170 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * ppc_ops.h + * + * Header file defining PowerPC opcode handlers. + */ + +static PPC_OPCODE ppc_opcode_common[] = +{ + /*code subcode handler */ + { 31, 266, ppc_addx }, + { 31, 266 | 512, ppc_addx }, + { 31, 10, ppc_addcx }, + { 31, 10 | 512, ppc_addcx }, + { 31, 138, ppc_addex }, + { 31, 138 | 512, ppc_addex }, + { 14, -1, ppc_addi }, + { 12, -1, ppc_addic }, + { 13, -1, ppc_addic_rc }, + { 15, -1, ppc_addis }, + { 31, 234, ppc_addmex }, + { 31, 234 | 512, ppc_addmex }, + { 31, 202, ppc_addzex }, + { 31, 202 | 512, ppc_addzex }, + { 31, 28, ppc_andx }, + { 31, 28 | 512, ppc_andx }, + { 31, 60, ppc_andcx }, + { 28, -1, ppc_andi_rc }, + { 29, -1, ppc_andis_rc }, + { 18, -1, ppc_bx }, + { 16, -1, ppc_bcx }, + { 19, 528, ppc_bcctrx }, + { 19, 16, ppc_bclrx }, + { 31, 0, ppc_cmp }, + { 11, -1, ppc_cmpi }, + { 31, 32, ppc_cmpl }, + { 10, -1, ppc_cmpli }, + { 31, 26, ppc_cntlzw }, + { 19, 257, ppc_crand }, + { 19, 129, ppc_crandc }, + { 19, 289, ppc_creqv }, + { 19, 225, ppc_crnand }, + { 19, 33, ppc_crnor }, + { 19, 449, ppc_cror }, + { 19, 417, ppc_crorc }, + { 19, 193, ppc_crxor }, + { 31, 86, ppc_dcbf }, + { 31, 470, ppc_dcbi }, + { 31, 54, ppc_dcbst }, + { 31, 278, ppc_dcbt }, + { 31, 246, ppc_dcbtst }, + { 31, 1014, ppc_dcbz }, + { 31, 491, ppc_divwx }, + { 31, 491 | 512, ppc_divwx }, + { 31, 459, ppc_divwux }, + { 31, 459 | 512, ppc_divwux }, + { 31, 854, ppc_eieio }, + { 31, 284, ppc_eqvx }, + { 31, 954, ppc_extsbx }, + { 31, 922, ppc_extshx }, + { 31, 982, ppc_icbi }, + { 19, 150, ppc_isync }, + { 34, -1, ppc_lbz }, + { 35, -1, ppc_lbzu }, + { 31, 119, ppc_lbzux }, + { 31, 87, ppc_lbzx }, + { 42, -1, ppc_lha }, + { 43, -1, ppc_lhau }, + { 31, 375, ppc_lhaux }, + { 31, 343, ppc_lhax }, + { 31, 790, ppc_lhbrx }, + { 40, -1, ppc_lhz }, + { 41, -1, ppc_lhzu }, + { 31, 311, ppc_lhzux }, + { 31, 279, ppc_lhzx }, + { 46, -1, ppc_lmw }, + { 31, 597, ppc_lswi }, + { 31, 533, ppc_lswx }, + { 31, 20, ppc_lwarx }, + { 31, 534, ppc_lwbrx }, + { 32, -1, ppc_lwz }, + { 33, -1, ppc_lwzu }, + { 31, 55, ppc_lwzux }, + { 31, 23, ppc_lwzx }, + { 19, 0, ppc_mcrf }, + { 31, 512, ppc_mcrxr }, + { 31, 19, ppc_mfcr }, + { 31, 83, ppc_mfmsr }, + { 31, 339, ppc_mfspr }, + { 31, 144, ppc_mtcrf }, + { 31, 146, ppc_mtmsr }, + { 31, 467, ppc_mtspr }, + { 31, 75, ppc_mulhwx }, + { 31, 11, ppc_mulhwux }, + { 7, -1, ppc_mulli }, + { 31, 235, ppc_mullwx }, + { 31, 235 | 512, ppc_mullwx }, + { 31, 476, ppc_nandx }, + { 31, 104, ppc_negx }, + { 31, 104 | 512, ppc_negx }, + { 31, 124, ppc_norx }, + { 31, 444, ppc_orx }, + { 31, 412, ppc_orcx }, + { 24, -1, ppc_ori }, + { 25, -1, ppc_oris }, + { 19, 50, ppc_rfi }, + { 20, -1, ppc_rlwimix }, + { 21, -1, ppc_rlwinmx }, + { 23, -1, ppc_rlwnmx }, + { 17, -1, ppc_sc }, + { 31, 24, ppc_slwx }, + { 31, 792, ppc_srawx }, + { 31, 824, ppc_srawix }, + { 31, 536, ppc_srwx }, + { 38, -1, ppc_stb }, + { 39, -1, ppc_stbu }, + { 31, 247, ppc_stbux }, + { 31, 215, ppc_stbx }, + { 44, -1, ppc_sth }, + { 31, 918, ppc_sthbrx }, + { 45, -1, ppc_sthu }, + { 31, 439, ppc_sthux }, + { 31, 407, ppc_sthx }, + { 47, -1, ppc_stmw }, + { 31, 725, ppc_stswi }, + { 31, 661, ppc_stswx }, + { 36, -1, ppc_stw }, + { 31, 662, ppc_stwbrx }, + { 31, 150, ppc_stwcx_rc }, + { 37, -1, ppc_stwu }, + { 31, 183, ppc_stwux }, + { 31, 151, ppc_stwx }, + { 31, 40, ppc_subfx }, + { 31, 40 | 512, ppc_subfx }, + { 31, 8, ppc_subfcx }, + { 31, 8 | 512, ppc_subfcx }, + { 31, 136, ppc_subfex }, + { 31, 136 | 512, ppc_subfex }, + { 8, -1, ppc_subfic }, + { 31, 232, ppc_subfmex }, + { 31, 232 | 512, ppc_subfmex }, + { 31, 200, ppc_subfzex }, + { 31, 200 | 512, ppc_subfzex }, + { 31, 598, ppc_sync }, + { 31, 4, ppc_tw }, + { 3, -1, ppc_twi }, + { 31, 316, ppc_xorx }, + { 26, -1, ppc_xori }, + { 27, -1, ppc_xoris } +}; diff --git a/Games.cpp b/Games.cpp new file mode 100644 index 0000000..ac5f419 --- /dev/null +++ b/Games.cpp @@ -0,0 +1,1051 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Games.cpp + * + * Model 3 game and ROM information. + */ + +#include "Supermodel.h" + + +const struct GameInfo Model3GameList[] = +{ + // Virtua Fighter 3 + { + "vf3", + "Virtua Fighter 3", + "Sega", + 1996, + 0x10, + 0x200000, // 2 MB of fixed CROM + TRUE, // 64 MB of banked CROM (needs to be mirrored) + 0x2000000, // 32 MB of VROM (will need to be mirrored) + GAME_INPUT_COMMON|GAME_INPUT_JOYSTICK1|GAME_INPUT_JOYSTICK2|GAME_INPUT_FIGHTING, + + { + // Fixed CROM + { "CROM", "epr-19230c.20", 0x736a9431, 0x80000, 2, 0x0600000, 8, TRUE }, + { "CROM", "epr-19229c.19", 0x731b6b78, 0x80000, 2, 0x0600002, 8, TRUE }, + { "CROM", "epr-19228c.18", 0x9c5727e2, 0x80000, 2, 0x0600004, 8, TRUE }, + { "CROM", "epr-19227c.17", 0xa7df4d75, 0x80000, 2, 0x0600006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-19196.4", 0xf386b850, 0x400000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr-19195.3", 0xbd5e27a3, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-19194.2", 0x66254702, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-19193.1", 0x7bab33d2, 0x400000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-19200.8", 0x74941091, 0x400000, 2, 0x1000000, 8, TRUE }, + { "CROMxx", "mpr-19199.7", 0x9f80d6fe, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr-19198.6", 0xd8ee5032, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr-19197.5", 0xa22d76c9, 0x400000, 2, 0x1000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr-19204.12", 0x2f93310a, 0x400000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr-19203.11", 0x0afa6334, 0x400000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr-19202.10", 0xaaa086c6, 0x400000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr-19201.9", 0x7c4a8c31, 0x400000, 2, 0x2000006, 8, TRUE }, + + // Banked CROM3 + { "CROMxx", "mpr-19208.16", 0x08f30f71, 0x400000, 2, 0x3000000, 8, TRUE }, + { "CROMxx", "mpr-19207.15", 0x2ce1612d, 0x400000, 2, 0x3000002, 8, TRUE }, + { "CROMxx", "mpr-19206.14", 0x71a98d73, 0x400000, 2, 0x3000004, 8, TRUE }, + { "CROMxx", "mpr-19205.13", 0x199c328e, 0x400000, 2, 0x3000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-19211.26", 0x9c8f5df1, 0x200000, 2, 0, 32, FALSE }, + { "VROM", "mpr-19212.27", 0x75036234, 0x200000, 2, 2, 32, FALSE }, + { "VROM", "mpr-19213.28", 0x67b123cf, 0x200000, 2, 4, 32, FALSE }, + { "VROM", "mpr-19214.29", 0xa6f5576b, 0x200000, 2, 6, 32, FALSE }, + { "VROM", "mpr-19215.30", 0xc6fd9f0d, 0x200000, 2, 8, 32, FALSE }, + { "VROM", "mpr-19216.31", 0x201bb1ed, 0x200000, 2, 10, 32, FALSE }, + { "VROM", "mpr-19217.32", 0x4dadd41a, 0x200000, 2, 12, 32, FALSE }, + { "VROM", "mpr-19218.33", 0xcff91953, 0x200000, 2, 14, 32, FALSE }, + { "VROM", "mpr-19219.34", 0xc610d521, 0x200000, 2, 16, 32, FALSE }, + { "VROM", "mpr-19220.35", 0xe62924d0, 0x200000, 2, 18, 32, FALSE }, + { "VROM", "mpr-19221.36", 0x24f83e3c, 0x200000, 2, 20, 32, FALSE }, + { "VROM", "mpr-19222.37", 0x61a6aa7d, 0x200000, 2, 22, 32, FALSE }, + { "VROM", "mpr-19223.38", 0x1a8c1980, 0x200000, 2, 24, 32, FALSE }, + { "VROM", "mpr-19224.39", 0x0a79a1bd, 0x200000, 2, 26, 32, FALSE }, + { "VROM", "mpr-19225.40", 0x91a985eb, 0x200000, 2, 28, 32, FALSE }, + { "VROM", "mpr-19226.41", 0x00091722, 0x200000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // Le Mans 24 + { + "lemans24", + "Le Mans 24", + "Sega", + 1998, + 0x15, + 0x200000, // 2 MB of fixed CROM + TRUE, // 64 MB of banked CROM (needs to be mirrored) + 0x2000000, // 32 MB of VROM (will need to be mirrored) + GAME_INPUT_COMMON|GAME_INPUT_VEHICLE|GAME_INPUT_VR|GAME_INPUT_SHIFT4, // for now, Shift Up/Down mapped to Shift 3/4 + + { + // Fixed CROM + { "CROM", "epr-19890.20", 0x9C16C3CC, 0x80000, 2, 0x0600000, 8, TRUE }, + { "CROM", "epr-19889.19", 0xD1F7E44C, 0x80000, 2, 0x0600002, 8, TRUE }, + { "CROM", "epr-19888.18", 0x800D763D, 0x80000, 2, 0x0600004, 8, TRUE }, + { "CROM", "epr-19887.17", 0x2842BB87, 0x80000, 2, 0x0600006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-19860.04", 0x19A1DDC7, 0x400000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr-19859.03", 0x15906869, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-19858.02", 0x993FA656, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-19857.01", 0x82C9FCFC, 0x400000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-19864.08", 0xC7BAAB2B, 0x400000, 2, 0x1000000, 8, TRUE }, + { "CROMxx", "mpr-19863.07", 0x2B2619D0, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr-19862.06", 0xB0F69AE4, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr-19861.05", 0x6DDF21B3, 0x400000, 2, 0x1000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr-19868.12", 0x3C43D64F, 0x400000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr-19867.11", 0xAE610FC5, 0x400000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr-19866.10", 0xEDE5FC78, 0x400000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr-19865.09", 0xB2749D2B, 0x400000, 2, 0x2000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-19871.26", 0x5168E02B, 0x200000, 2, 0, 32, FALSE }, + { "VROM", "mpr-19872.27", 0x9E65FC06, 0x200000, 2, 2, 32, FALSE }, + { "VROM", "mpr-19873.28", 0x0B15D7AB, 0x200000, 2, 4, 32, FALSE }, + { "VROM", "mpr-19874.29", 0x6A28EC89, 0x200000, 2, 6, 32, FALSE }, + { "VROM", "mpr-19875.30", 0xA03E1173, 0x200000, 2, 8, 32, FALSE }, + { "VROM", "mpr-19876.31", 0xC93BB036, 0x200000, 2, 10, 32, FALSE }, + { "VROM", "mpr-19877.32", 0xB1E3DF56, 0x200000, 2, 12, 32, FALSE }, + { "VROM", "mpr-19878.33", 0xA2ACC111, 0x200000, 2, 14, 32, FALSE }, + { "VROM", "mpr-19879.34", 0x90C1553F, 0x200000, 2, 16, 32, FALSE }, + { "VROM", "mpr-19880.35", 0x42504e63, 0x200000, 2, 18, 32, FALSE }, + { "VROM", "mpr-19881.36", 0xD06985CF, 0x200000, 2, 20, 32, FALSE }, + { "VROM", "mpr-19882.37", 0xA86F2E2F, 0x200000, 2, 22, 32, FALSE }, + { "VROM", "mpr-19883.38", 0x12895D6E, 0x200000, 2, 24, 32, FALSE }, + { "VROM", "mpr-19884.39", 0x711EEBFB, 0x200000, 2, 26, 32, FALSE }, + { "VROM", "mpr-19885.40", 0xD1AE5473, 0x200000, 2, 28, 32, FALSE }, + { "VROM", "mpr-19886.41", 0x278AAE0B, 0x200000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // Scud Race + { + "scud", + "Scud Race", + "Sega", + 1996, + 0x15, + 0x200000, // 2 MB of fixed CROM + TRUE, // 64 MB of banked CROM (needs to be mirrored) + 0x2000000, // 32 MB of VROM (will need to be mirrored) + GAME_INPUT_COMMON|GAME_INPUT_VEHICLE|GAME_INPUT_VR|GAME_INPUT_SHIFT4, + + { + // Fixed CROM (mirroring behavior here is special and handled manually by CModel3) + { "CROM", "epr-19734.20", 0xBE897336, 0x80000, 2, 0x0600000, 8, TRUE }, + { "CROM", "epr-19733.19", 0x6565E29A, 0x80000, 2, 0x0600002, 8, TRUE }, + { "CROM", "epr-19732.18", 0x23E864BB, 0x80000, 2, 0x0600004, 8, TRUE }, + { "CROM", "epr-19731.17", 0x3EE6447E, 0x80000, 2, 0x0600006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-19661.04", 0x8E3FD241, 0x400000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr-19660.03", 0xD999C935, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-19659.02", 0xC47E7002, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-19658.01", 0xD523235C, 0x400000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-19665.08", 0xF97C78F9, 0x400000, 2, 0x1000000, 8, TRUE }, + { "CROMxx", "mpr-19664.07", 0xB9D11294, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr-19663.06", 0xF6AF1CA4, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr-19662.05", 0x3C700EFF, 0x400000, 2, 0x1000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr-19669.12", 0xCDC43C61, 0x400000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr-19668.11", 0x0B4DD8D5, 0x400000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr-19667.10", 0xA8676799, 0x400000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr-19666.09", 0xB53DC97F, 0x400000, 2, 0x2000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-19672.26", 0x588C29FD, 0x200000, 2, 0, 32, FALSE }, + { "VROM", "mpr-19673.27", 0x156ABAA9, 0x200000, 2, 2, 32, FALSE }, + { "VROM", "mpr-19674.28", 0xC7B0F98C, 0x200000, 2, 4, 32, FALSE }, + { "VROM", "mpr-19675.29", 0xFF113396, 0x200000, 2, 6, 32, FALSE }, + { "VROM", "mpr-19676.30", 0xFD852EAD, 0x200000, 2, 8, 32, FALSE }, + { "VROM", "mpr-19677.31", 0xC6AC0347, 0x200000, 2, 10, 32, FALSE }, + { "VROM", "mpr-19678.32", 0xB8819CFE, 0x200000, 2, 12, 32, FALSE }, + { "VROM", "mpr-19679.33", 0xE126C3E3, 0x200000, 2, 14, 32, FALSE }, + { "VROM", "mpr-19680.34", 0x00EA5CEF, 0x200000, 2, 16, 32, FALSE }, + { "VROM", "mpr-19681.35", 0xC949325F, 0x200000, 2, 18, 32, FALSE }, + { "VROM", "mpr-19682.36", 0xCE5CA065, 0x200000, 2, 20, 32, FALSE }, + { "VROM", "mpr-19683.37", 0xE5856419, 0x200000, 2, 22, 32, FALSE }, + { "VROM", "mpr-19684.38", 0x56F6EC97, 0x200000, 2, 24, 32, FALSE }, + { "VROM", "mpr-19685.39", 0x42B49304, 0x200000, 2, 26, 32, FALSE }, + { "VROM", "mpr-19686.40", 0x84EED592, 0x200000, 2, 28, 32, FALSE }, + { "VROM", "mpr-19687.41", 0x776CE694, 0x200000, 2, 30, 32, FALSE }, + + // Sound ROMs + { "SndProg","epr-19692.21", 0xA94F5521, 0x80000, 2, 0, 2, TRUE }, + { "Samples","mpr-19670.22", 0xBD31CC06, 0x400000, 2, 0x000000, 2, FALSE }, + { "Samples","mpr-19671.24", 0x8E8526AB, 0x400000, 2, 0x400000, 2, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // Scud Race Plus + { + "scudp", + "Scud Race Plus", + "Sega", + 1996, + 0x15, + 0x200000, // 2 MB of fixed CROM + TRUE, // 64 MB of banked CROM (needs to be mirrored) + 0x2000000, // 32 MB of VROM (will need to be mirrored) + GAME_INPUT_COMMON|GAME_INPUT_VEHICLE|GAME_INPUT_VR|GAME_INPUT_SHIFT4, + + { + // Fixed CROM (mirroring behavior here is special and handled manually by CModel3) + { "CROM", "epr-20095a.20", 0x58C7E393, 0x80000, 2, 0x0600000, 8, TRUE }, + { "CROM", "epr-20094a.19", 0xDBF17A43, 0x80000, 2, 0x0600002, 8, TRUE }, + { "CROM", "epr-20093a.18", 0x4ED2E35D, 0x80000, 2, 0x0600004, 8, TRUE }, + { "CROM", "epr-20092a.17", 0xA94EC57E, 0x80000, 2, 0x0600006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-19661.04", 0x8E3FD241, 0x400000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr-19660.03", 0xD999C935, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-19659.02", 0xC47E7002, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-19658.01", 0xD523235C, 0x400000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-19665.08", 0xF97C78F9, 0x400000, 2, 0x1000000, 8, TRUE }, + { "CROMxx", "mpr-19664.07", 0xB9D11294, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr-19663.06", 0xF6AF1CA4, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr-19662.05", 0x3C700EFF, 0x400000, 2, 0x1000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr-19669.12", 0xCDC43C61, 0x400000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr-19668.11", 0x0B4DD8D5, 0x400000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr-19667.10", 0xA8676799, 0x400000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr-19666.09", 0xB53DC97F, 0x400000, 2, 0x2000006, 8, TRUE }, + + // Banked CROM3 + { "CROMxx", "mpr-20100.16", 0xC99E2C01, 0x400000, 2, 0x3000000, 8, TRUE }, + { "CROMxx", "mpr-20099.15", 0xFC9BD7D9, 0x400000, 2, 0x3000002, 8, TRUE }, + { "CROMxx", "mpr-20098.14", 0x8355FA41, 0x400000, 2, 0x3000004, 8, TRUE }, + { "CROMxx", "mpr-20097.13", 0x269A9DBE, 0x400000, 2, 0x3000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-19672.26", 0x588C29FD, 0x200000, 2, 0, 32, FALSE }, + { "VROM", "mpr-19673.27", 0x156ABAA9, 0x200000, 2, 2, 32, FALSE }, + { "VROM", "mpr-19674.28", 0xC7B0F98C, 0x200000, 2, 4, 32, FALSE }, + { "VROM", "mpr-19675.29", 0xFF113396, 0x200000, 2, 6, 32, FALSE }, + { "VROM", "mpr-19676.30", 0xFD852EAD, 0x200000, 2, 8, 32, FALSE }, + { "VROM", "mpr-19677.31", 0xC6AC0347, 0x200000, 2, 10, 32, FALSE }, + { "VROM", "mpr-19678.32", 0xB8819CFE, 0x200000, 2, 12, 32, FALSE }, + { "VROM", "mpr-19679.33", 0xE126C3E3, 0x200000, 2, 14, 32, FALSE }, + { "VROM", "mpr-19680.34", 0x00EA5CEF, 0x200000, 2, 16, 32, FALSE }, + { "VROM", "mpr-19681.35", 0xC949325F, 0x200000, 2, 18, 32, FALSE }, + { "VROM", "mpr-19682.36", 0xCE5CA065, 0x200000, 2, 20, 32, FALSE }, + { "VROM", "mpr-19683.37", 0xE5856419, 0x200000, 2, 22, 32, FALSE }, + { "VROM", "mpr-19684.38", 0x56F6EC97, 0x200000, 2, 24, 32, FALSE }, + { "VROM", "mpr-19685.39", 0x42B49304, 0x200000, 2, 26, 32, FALSE }, + { "VROM", "mpr-19686.40", 0x84EED592, 0x200000, 2, 28, 32, FALSE }, + { "VROM", "mpr-19687.41", 0x776CE694, 0x200000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // The Lost World + { + "lostwsga", + "The Lost World", + "Sega", + 1997, + 0x15, + 0x200000, // 2 MB of fixed CROM + TRUE, // 64 MB of banked CROM (needs to be mirrored) + 0x2000000, // 32 MB of VROM + GAME_INPUT_COMMON|GAME_INPUT_GUN1|GAME_INPUT_GUN2, + + { + // Fixed CROM + { "CROM", "epr-19936.20", 0x2F1CA664, 0x80000, 2, 0x0600000, 8, TRUE }, + { "CROM", "epr-19937.19", 0x9DBF5712, 0x80000, 2, 0x0600002, 8, TRUE }, + { "CROM", "epr-19938.18", 0x38AFE27A, 0x80000, 2, 0x0600004, 8, TRUE }, + { "CROM", "epr-19939.17", 0x8788B939, 0x80000, 2, 0x0600006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-19921.4", 0x9AF3227F, 0x400000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr-19920.3", 0x8DF33574, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-19919.2", 0xFF119949, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-19918.1", 0x95B690E9, 0x400000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-19925.8", 0xCFA4BB49, 0x400000, 2, 0x1000000, 8, TRUE }, + { "CROMxx", "mpr-19924.7", 0x4EE3DDC5, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr-19923.6", 0xED515CB2, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr-19922.5", 0x4DFD7FC6, 0x400000, 2, 0x1000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr-19929.12", 0x16491F63, 0x400000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr-19928.11", 0x9AFD5D4A, 0x400000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr-19927.10", 0x0C96EF11, 0x400000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr-19926.9", 0x05A232E0, 0x400000, 2, 0x2000006, 8, TRUE }, + + // Banked CROM3 + { "CROMxx", "mpr-19933.16", 0x8E2ACD3B, 0x400000, 2, 0x3000000, 8, TRUE }, + { "CROMxx", "mpr-19932.15", 0x04389385, 0x400000, 2, 0x3000002, 8, TRUE }, + { "CROMxx", "mpr-19931.14", 0x448A5007, 0x400000, 2, 0x3000004, 8, TRUE }, + { "CROMxx", "mpr-19930.13", 0xB598C2F2, 0x400000, 2, 0x3000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-19902.26", 0x178BD471, 0x200000, 2, 0, 32, FALSE }, + { "VROM", "mpr-19903.27", 0xFE575871, 0x200000, 2, 2, 32, FALSE }, + { "VROM", "mpr-19904.28", 0x57971D7D, 0x200000, 2, 4, 32, FALSE }, + { "VROM", "mpr-19905.29", 0x6FA122EE, 0x200000, 2, 6, 32, FALSE }, + { "VROM", "mpr-19906.30", 0xA5B16DD9, 0x200000, 2, 8, 32, FALSE }, + { "VROM", "mpr-19907.31", 0x84A425CD, 0x200000, 2, 10, 32, FALSE }, + { "VROM", "mpr-19908.32", 0x7702AA7C, 0x200000, 2, 12, 32, FALSE }, + { "VROM", "mpr-19909.33", 0x8FCA65F9, 0x200000, 2, 14, 32, FALSE }, + { "VROM", "mpr-19910.34", 0x1EF585E2, 0x200000, 2, 16, 32, FALSE }, + { "VROM", "mpr-19911.35", 0xCA26A48D, 0x200000, 2, 18, 32, FALSE }, + { "VROM", "mpr-19912.36", 0xFFE000E0, 0x200000, 2, 20, 32, FALSE }, + { "VROM", "mpr-19913.37", 0xC003049E, 0x200000, 2, 22, 32, FALSE }, + { "VROM", "mpr-19914.38", 0x3C21A953, 0x200000, 2, 24, 32, FALSE }, + { "VROM", "mpr-19915.39", 0xFD0F2A2B, 0x200000, 2, 26, 32, FALSE }, + { "VROM", "mpr-19916.40", 0x10B0C52E, 0x200000, 2, 28, 32, FALSE }, + { "VROM", "mpr-19917.41", 0x3035833B, 0x200000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // Virtual On Oratorio Tangram + { + "von2", + "Virtual On Oratorio Tangram", + "Sega", + 1998, + 0x20, + 0x800000, // 8 MB of fixed CROM + TRUE, // 64 MB of banked CROM (needs to be mirrored) + 0x4000000, // 64 MB of VROM + GAME_INPUT_COMMON|GAME_INPUT_TWIN_JOYSTICKS, + + { + // Fixed CROM + { "CROM", "epr-20686b.20", 0x3EA4DE9F, 0x200000, 2, 0x0000000, 8, TRUE }, + { "CROM", "epr-20685b.19", 0xAE82CB35, 0x200000, 2, 0x0000002, 8, TRUE }, + { "CROM", "epr-20684b.18", 0x1FC15431, 0x200000, 2, 0x0000004, 8, TRUE }, + { "CROM", "epr-20683b.17", 0x59D9C974, 0x200000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-20650.4", 0x81F96649, 0x400000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr-20649.3", 0xb8FD56BA, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-20648.2", 0x107309E0, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-20647.1", 0xe8586380, 0x400000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-20654.8", 0x763EF905, 0x400000, 2, 0x1000000, 8, TRUE }, + { "CROMxx", "mpr-20653.7", 0x858E6BBA, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr-20652.6", 0x64C6FBB6, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr-20651.5", 0x8373CAB3, 0x400000, 2, 0x1000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr-20658.12", 0xB80175B9, 0x400000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr-20657.11", 0x14BF8964, 0x400000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr-20656.10", 0x466BEE13, 0x400000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr-20655.9", 0xF0A471E9, 0x400000, 2, 0x2000006, 8, TRUE }, + + // Banked CROM3 + { "CROMxx", "mpr-20662.16", 0x7130CB61, 0x400000, 2, 0x3000000, 8, TRUE }, + { "CROMxx", "mpr-20661.15", 0x50E6189E, 0x400000, 2, 0x3000002, 8, TRUE }, + { "CROMxx", "mpr-20660.14", 0xD961D385, 0x400000, 2, 0x3000004, 8, TRUE }, + { "CROMxx", "mpr-20659.13", 0xEDB63E7B, 0x400000, 2, 0x3000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-20667.26", 0x321E006F, 0x400000, 2, 0, 32, FALSE }, + { "VROM", "mpr-20668.27", 0xC2DD8053, 0x400000, 2, 2, 32, FALSE }, + { "VROM", "mpr-20669.28", 0x63432497, 0x400000, 2, 4, 32, FALSE }, + { "VROM", "mpr-20670.29", 0xF7B554FD, 0x400000, 2, 6, 32, FALSE }, + { "VROM", "mpr-20671.30", 0xFEE1A49B, 0x400000, 2, 8, 32, FALSE }, + { "VROM", "mpr-20672.31", 0xE4B8C6E6, 0x400000, 2, 10, 32, FALSE }, + { "VROM", "mpr-20673.32", 0xE7B6403B, 0x400000, 2, 12, 32, FALSE }, + { "VROM", "mpr-20674.33", 0x9BE22E13, 0x400000, 2, 14, 32, FALSE }, + { "VROM", "mpr-20675.34", 0x6A7C3862, 0x400000, 2, 16, 32, FALSE }, + { "VROM", "mpr-20676.35", 0xDD299648, 0x400000, 2, 18, 32, FALSE }, + { "VROM", "mpr-20677.36", 0x3FC5F330, 0x400000, 2, 20, 32, FALSE }, + { "VROM", "mpr-20678.37", 0x62F794A1, 0x400000, 2, 22, 32, FALSE }, + { "VROM", "mpr-20679.38", 0x35A37C53, 0x400000, 2, 24, 32, FALSE }, + { "VROM", "mpr-20680.39", 0x81FEC46E, 0x400000, 2, 26, 32, FALSE }, + { "VROM", "mpr-20681.40", 0xD517873B, 0x400000, 2, 28, 32, FALSE }, + { "VROM", "mpr-20682.41", 0x5B43250C, 0x400000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // Virtua Striker 2 '98 + { + "vs298", + "Virtua Striker 2 '98", + "Sega", + 1998, + 0x20, + 0x400000, // 2 MB of fixed CROM + TRUE, // 64 MB of banked CROM (needs to be mirrored) + 0x2000000, // 32 MB of VROM + GAME_INPUT_COMMON|GAME_INPUT_JOYSTICK1|GAME_INPUT_JOYSTICK2|GAME_INPUT_SOCCER, + + { + // Fixed CROM + { "CROM", "epr-20920.20", 0x428D05FC, 0x100000, 2, 0x0400000, 8, TRUE }, + { "CROM", "epr-20919.19", 0x7A0713D2, 0x100000, 2, 0x0400002, 8, TRUE }, + { "CROM", "epr-20918.18", 0x0E9CDC5B, 0x100000, 2, 0x0400004, 8, TRUE }, + { "CROM", "epr-20917.17", 0xC3BBB270, 0x100000, 2, 0x0400006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-19894.4", 0x09C065CC, 0x400000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr-19893.3", 0x5C83DCAA, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-19892.2", 0x8E5D3FE7, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-19891.1", 0x9ECB0B39, 0x400000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-19776.8", 0x5B31C7C1, 0x400000, 2, 0x1000000, 8, TRUE }, + { "CROMxx", "mpr-19775.7", 0xA6B32BD9, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr-19774.6", 0x1D61D287, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr-19773.5", 0x4E381AE7, 0x400000, 2, 0x1000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr-20898.12", 0x94040D37, 0x400000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr-20897.11", 0xC5CF067A, 0x400000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr-20896.10", 0xBF1CBD5E, 0x400000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr-20895.9", 0x9B51CBF5, 0x400000, 2, 0x2000006, 8, TRUE }, + + // Banked CROM3 + { "CROMxx", "mpr-20902.16", 0xF4D3FF3A, 0x400000, 2, 0x3000000, 8, TRUE }, + { "CROMxx", "mpr-20901.15", 0x3492DDC8, 0x400000, 2, 0x3000002, 8, TRUE }, + { "CROMxx", "mpr-20900.14", 0x7A38B571, 0x400000, 2, 0x3000004, 8, TRUE }, + { "CROMxx", "mpr-20899.13", 0x65422425, 0x400000, 2, 0x3000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-19787.26", 0x856CC4AD, 0x200000, 2, 0, 32, FALSE }, + { "VROM", "mpr-19788.27", 0x72EF970A, 0x200000, 2, 2, 32, FALSE }, + { "VROM", "mpr-19789.28", 0x076ADD9A, 0x200000, 2, 4, 32, FALSE }, + { "VROM", "mpr-19790.29", 0x74CE238C, 0x200000, 2, 6, 32, FALSE }, + { "VROM", "mpr-19791.30", 0x75A98F96, 0x200000, 2, 8, 32, FALSE }, + { "VROM", "mpr-19792.31", 0x85C81633, 0x200000, 2, 10, 32, FALSE }, + { "VROM", "mpr-19793.32", 0x7F288CC4, 0x200000, 2, 12, 32, FALSE }, + { "VROM", "mpr-19794.33", 0xE0C1C370, 0x200000, 2, 14, 32, FALSE }, + { "VROM", "mpr-19795.34", 0x90989B20, 0x200000, 2, 16, 32, FALSE }, + { "VROM", "mpr-19796.35", 0x5D1AAB8D, 0x200000, 2, 18, 32, FALSE }, + { "VROM", "mpr-19797.36", 0xF5EDC891, 0x200000, 2, 20, 32, FALSE }, + { "VROM", "mpr-19798.37", 0xAE2DA90F, 0x200000, 2, 22, 32, FALSE }, + { "VROM", "mpr-19799.38", 0x92B18AD7, 0x200000, 2, 24, 32, FALSE }, + { "VROM", "mpr-19800.39", 0x4A57B16C, 0x200000, 2, 26, 32, FALSE }, + { "VROM", "mpr-19801.40", 0xBEB79A00, 0x200000, 2, 28, 32, FALSE }, + { "VROM", "mpr-19802.41", 0xF2C3A7B7, 0x200000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // Sega Rally 2 + { + "srally2", + "Sega Rally 2", + "Sega", + 1998, + 0x20, + 0x800000, // 8 MB of fixed CROM + TRUE, // 64 MB of banked CROM (needs to be mirrored) + 0x4000000, // 64 MB of VROM + GAME_INPUT_COMMON|GAME_INPUT_VEHICLE|GAME_INPUT_RALLY|GAME_INPUT_SHIFT4, + + { + // Fixed CROM + { "CROM", "epr-20635.20", 0x7937473F, 0x200000, 2, 0x0000000, 8, TRUE }, + { "CROM", "epr-20634.19", 0x45A09245, 0x200000, 2, 0x0000002, 8, TRUE }, + { "CROM", "epr-20633.18", 0xF5A24F24, 0x200000, 2, 0x0000004, 8, TRUE }, + { "CROM", "epr-20632.17", 0x6829A801, 0x200000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-20605.4", 0x00513401, 0x400000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr-20605.3", 0x99C5F396, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-20603.2", 0xAD0D8EB8, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-20602.1", 0x60CFA72A, 0x400000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-20609.8", 0xC03CC0E5, 0x400000, 2, 0x1000000, 8, TRUE }, + { "CROMxx", "mpr-20608.7", 0x0C9B0571, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr-20607.6", 0x6DA85AA3, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr-20606.5", 0x072498FD, 0x400000, 2, 0x1000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr-20613.12", 0x2938C0D9, 0x400000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr-20612.11", 0x721A44B6, 0x400000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr-20611.10", 0x5D9F8BA2, 0x400000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr-20610.9", 0xB6E0FF4E, 0x400000, 2, 0x2000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-20616.26", 0xE11DCF8B, 0x400000, 2, 0, 32, FALSE }, + { "VROM", "mpr-20617.27", 0x96ACEF3F, 0x400000, 2, 2, 32, FALSE }, + { "VROM", "mpr-20618.28", 0x6C281281, 0x400000, 2, 4, 32, FALSE }, + { "VROM", "mpr-20619.29", 0x0FA65819, 0x400000, 2, 6, 32, FALSE }, + { "VROM", "mpr-20620.30", 0xEE79585F, 0x400000, 2, 8, 32, FALSE }, + { "VROM", "mpr-20621.31", 0x3A99148F, 0x400000, 2, 10, 32, FALSE }, + { "VROM", "mpr-20622.32", 0x0618F056, 0x400000, 2, 12, 32, FALSE }, + { "VROM", "mpr-20623.33", 0xCCF31B85, 0x400000, 2, 14, 32, FALSE }, + { "VROM", "mpr-20624.34", 0x90F30936, 0x400000, 2, 16, 32, FALSE }, + { "VROM", "mpr-20625.35", 0x04F804FA, 0x400000, 2, 18, 32, FALSE }, + { "VROM", "mpr-20626.36", 0x2D6C97D6, 0x400000, 2, 20, 32, FALSE }, + { "VROM", "mpr-20627.37", 0xA14EE871, 0x400000, 2, 22, 32, FALSE }, + { "VROM", "mpr-20628.38", 0xBBA829A3, 0x400000, 2, 24, 32, FALSE }, + { "VROM", "mpr-20629.39", 0xEAD2EB31, 0x400000, 2, 26, 32, FALSE }, + { "VROM", "mpr-20630.40", 0xCC5881B8, 0x400000, 2, 28, 32, FALSE }, + { "VROM", "mpr-20631.41", 0x5CB69FFD, 0x400000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // Daytona USA 2 + { + "daytona2", + "Daytona USA 2", + "Sega", + 1998, + 0x21, + 0x800000, // 8 MB of fixed CROM + FALSE, // 96 MB of banked CROM (do not mirror) + 0x4000000, // 64 MB of VROM + GAME_INPUT_COMMON|GAME_INPUT_VEHICLE|GAME_INPUT_VR|GAME_INPUT_SHIFT4, + + { + // Fixed CROM + { "CROM", "epr-20864a.20", 0x5250F3A8, 0x200000, 2, 0x0000000, 8, TRUE }, + { "CROM", "epr-20863a.19", 0x1DEB4686, 0x200000, 2, 0x0000002, 8, TRUE }, + { "CROM", "epr-20862a.18", 0xE1B2CA61, 0x200000, 2, 0x0000004, 8, TRUE }, + { "CROM", "epr-20861a.17", 0x89BA8E78, 0x200000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-20848.ic4", 0x5B6C8B7D, 0x800000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr-20847.ic3", 0xEDA966EE, 0x800000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-20846.ic2", 0xF44C5C7A, 0x800000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-20845.ic1", 0x6037712C, 0x800000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-20852.ic8", 0xD606AD38, 0x800000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr-20851.ic7", 0x6E7A64B7, 0x800000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr-20850.ic6", 0xCB73758A, 0x800000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr-20849.ic5", 0x50DEE4AF, 0x800000, 2, 0x2000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr-20856.12", 0x0367A242, 0x400000, 2, 0x4000000, 8, TRUE }, + { "CROMxx", "mpr-20855.11", 0xF1FF0794, 0x400000, 2, 0x4000002, 8, TRUE }, + { "CROMxx", "mpr-20854.10", 0x68D94CDF, 0x400000, 2, 0x4000004, 8, TRUE }, + { "CROMxx", "mpr-20853.9", 0x3245EE68, 0x400000, 2, 0x4000006, 8, TRUE }, + + // Banked CROM3 (note: appears at offset 0x6000000 rather than 0x5000000 as expected) + { "CROMxx", "mpr-20860.16", 0xE5CE2939, 0x400000, 2, 0x6000000, 8, TRUE }, + { "CROMxx", "mpr-20859.15", 0xE14F5C46, 0x400000, 2, 0x6000002, 8, TRUE }, + { "CROMxx", "mpr-20858.14", 0x407FBAD5, 0x400000, 2, 0x6000004, 8, TRUE }, + { "CROMxx", "mpr-20857.13", 0x1EAB9C62, 0x400000, 2, 0x6000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-20870.26", 0x7C9E573D, 0x400000, 2, 0, 32, FALSE }, + { "VROM", "mpr-20871.27", 0x47A1B789, 0x400000, 2, 2, 32, FALSE }, + { "VROM", "mpr-20872.28", 0x2F55B423, 0x400000, 2, 4, 32, FALSE }, + { "VROM", "mpr-20873.29", 0xC9000E48, 0x400000, 2, 6, 32, FALSE }, + { "VROM", "mpr-20874.30", 0x26A9CCA2, 0x400000, 2, 8, 32, FALSE }, + { "VROM", "mpr-20875.31", 0xBFEFD21E, 0x400000, 2, 10, 32, FALSE }, + { "VROM", "mpr-20876.32", 0xFA701B87, 0x400000, 2, 12, 32, FALSE }, + { "VROM", "mpr-20877.33", 0x2CD072F1, 0x400000, 2, 14, 32, FALSE }, + { "VROM", "mpr-20878.34", 0xE6D5BC01, 0x400000, 2, 16, 32, FALSE }, + { "VROM", "mpr-20879.35", 0xF1D727EC, 0x400000, 2, 18, 32, FALSE }, + { "VROM", "mpr-20880.36", 0x8B370602, 0x400000, 2, 20, 32, FALSE }, + { "VROM", "mpr-20881.37", 0x397322E7, 0x400000, 2, 22, 32, FALSE }, + { "VROM", "mpr-20882.38", 0x9185BE51, 0x400000, 2, 24, 32, FALSE }, + { "VROM", "mpr-20883.39", 0xD1E39E83, 0x400000, 2, 26, 32, FALSE }, + { "VROM", "mpr-20884.40", 0x63C4639A, 0x400000, 2, 28, 32, FALSE }, + { "VROM", "mpr-20885.41", 0x61C292CA, 0x400000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // Daytona USA 2 Power Edition + { + "dayto2pe", + "Daytona USA 2 Power Edition", + "Sega", + 1998, + 0x21, + 0x800000, // 8 MB of fixed CROM + FALSE, // do not mirror banked CROM + 0x4000000, // 64 MB of VROM + GAME_INPUT_COMMON|GAME_INPUT_VEHICLE|GAME_INPUT_VR|GAME_INPUT_SHIFT4, + + { + // Fixed CROM + { "CROM", "epr-21181.20", 0xBF0007ED, 0x200000, 2, 0x0000000, 8, TRUE }, + { "CROM", "epr-21180.19", 0x6E7B98ED, 0x200000, 2, 0x0000002, 8, TRUE }, + { "CROM", "epr-21179.18", 0xD5FFB4D6, 0x200000, 2, 0x0000004, 8, TRUE }, + { "CROM", "epr-21178.17", 0x230BF8AC, 0x200000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-21185.4", 0xB6D5D2A1, 0x400000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr-21184.3", 0x25616403, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-21183.2", 0xB4B44805, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-21182.1", 0xBA8E667F, 0x400000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-21189.8", 0xCB439C45, 0x400000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr-21188.7", 0x753FC2A5, 0x400000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr-21187.6", 0x3BD14EE6, 0x400000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr-21186.5", 0xA6128662, 0x400000, 2, 0x2000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr-21193.12", 0x4638FEF4, 0x400000, 2, 0x4000000, 8, TRUE }, + { "CROMxx", "mpr-21192.11", 0x60CBB1FA, 0x400000, 2, 0x4000002, 8, TRUE }, + { "CROMxx", "mpr-21191.10", 0xA2BDCFE0, 0x400000, 2, 0x4000004, 8, TRUE }, + { "CROMxx", "mpr-21190.9", 0x984D56EB, 0x400000, 2, 0x4000006, 8, TRUE }, + + // Banked CROM3 + { "CROMxx", "mpr-21197.16", 0x04015247, 0x400000, 2, 0x6000000, 8, TRUE }, + { "CROMxx", "mpr-21196.15", 0x0AB46DB5, 0x400000, 2, 0x6000002, 8, TRUE }, + { "CROMxx", "mpr-21195.14", 0x7F39761C, 0x400000, 2, 0x6000004, 8, TRUE }, + { "CROMxx", "mpr-21194.13", 0x12C7A414, 0x400000, 2, 0x6000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-21198.26", 0x42EC9ED4, 0x400000, 2, 0, 32, FALSE }, + { "VROM", "mpr-21199.27", 0xFA28088C, 0x400000, 2, 2, 32, FALSE }, + { "VROM", "mpr-21200.28", 0xFBB5AA1D, 0x400000, 2, 4, 32, FALSE }, + { "VROM", "mpr-21201.29", 0xE6B13469, 0x400000, 2, 6, 32, FALSE }, + { "VROM", "mpr-21202.30", 0xE6B4C2BE, 0x400000, 2, 8, 32, FALSE }, + { "VROM", "mpr-21203.31", 0x32D08D33, 0x400000, 2, 10, 32, FALSE }, + { "VROM", "mpr-21204.32", 0xEF18FE0A, 0x400000, 2, 12, 32, FALSE }, + { "VROM", "mpr-21205.33", 0x4687BEA6, 0x400000, 2, 14, 32, FALSE }, + { "VROM", "mpr-21206.34", 0xEC2D6884, 0x400000, 2, 16, 32, FALSE }, + { "VROM", "mpr-21207.35", 0xEEAA510B, 0x400000, 2, 18, 32, FALSE }, + { "VROM", "mpr-21208.36", 0xB222FEF0, 0x400000, 2, 20, 32, FALSE }, + { "VROM", "mpr-21209.37", 0x170A28CE, 0x400000, 2, 22, 32, FALSE }, + { "VROM", "mpr-21210.38", 0x460CEFE0, 0x400000, 2, 24, 32, FALSE }, + { "VROM", "mpr-21211.39", 0xC84759CE, 0x400000, 2, 26, 32, FALSE }, + { "VROM", "mpr-21212.40", 0x6F8A75E0, 0x400000, 2, 28, 32, FALSE }, + { "VROM", "mpr-21213.41", 0xDE75BEC6, 0x400000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // Fighting Vipers 2 + { + "fvipers2", + "Fighting Vipers 2", + "Sega", + 1998, + 0x20, + 0x800000, // 8 MB of fixed CROM + TRUE, + //0x6000000, // 64 MB of banked CROM + 0x4000000, // 64 MB of VROM + GAME_INPUT_COMMON|GAME_INPUT_JOYSTICK1|GAME_INPUT_JOYSTICK2|GAME_INPUT_FIGHTING, + + { + // Fixed CROM + { "CROM", "epr-20599a.20", 0x9DF02AB9, 0x200000, 2, 0x0000000, 8, TRUE }, + { "CROM", "epr-20598a.19", 0x87BD070F, 0x200000, 2, 0x0000002, 8, TRUE }, + { "CROM", "epr-20597a.18", 0x6FCEE322, 0x200000, 2, 0x0000004, 8, TRUE }, + { "CROM", "epr-20596a.17", 0x969AB801, 0x200000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-20563.4", 0x999848AC, 0x400000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr-20562.3", 0x96E4942E, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-20561.2", 0x38A0F112, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-20560.1", 0xB0F6584D, 0x400000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-20567.8", 0x80F4EBA7, 0x400000, 2, 0x1000000, 8, TRUE }, + { "CROMxx", "mpr-20566.7", 0x2901883B, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr-20565.6", 0xD6BBE638, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr-20564.5", 0xBE69FCA0, 0x400000, 2, 0x1000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr-20571.12", 0x40B459AF, 0x400000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr-20570.11", 0x2C0D91FC, 0x400000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr-20569.10", 0x136C014F, 0x400000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr-20568.9", 0xFF23CF1C, 0x400000, 2, 0x2000006, 8, TRUE }, + + // Banked CROM3 + { "CROMxx", "mpr-20575.16", 0xEBC99D8A, 0x400000, 2, 0x3000000, 8, TRUE }, + { "CROMxx", "mpr-20574.15", 0x68567771, 0x400000, 2, 0x3000002, 8, TRUE }, + { "CROMxx", "mpr-20573.14", 0xE0DEE793, 0x400000, 2, 0x3000004, 8, TRUE }, + { "CROMxx", "mpr-20572.13", 0xD4A41A0B, 0x400000, 2, 0x3000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-20580.26", 0x6D42775E, 0x400000, 2, 0, 32, FALSE }, + { "VROM", "mpr-20581.27", 0xAC9EEC04, 0x400000, 2, 2, 32, FALSE }, + { "VROM", "mpr-20582.28", 0xB202F7BD, 0x400000, 2, 4, 32, FALSE }, + { "VROM", "mpr-20583.29", 0x0D6D508A, 0x400000, 2, 6, 32, FALSE }, + { "VROM", "mpr-20584.30", 0xECCF4DE6, 0x400000, 2, 8, 32, FALSE }, + { "VROM", "mpr-20585.31", 0xB383F4E5, 0x400000, 2, 10, 32, FALSE }, + { "VROM", "mpr-20586.32", 0xE7CD5DFB, 0x400000, 2, 12, 32, FALSE }, + { "VROM", "mpr-20587.33", 0xE2B2ABE1, 0x400000, 2, 14, 32, FALSE }, + { "VROM", "mpr-20588.34", 0x84F4162D, 0x400000, 2, 16, 32, FALSE }, + { "VROM", "mpr-20589.35", 0x4E653D02, 0x400000, 2, 18, 32, FALSE }, + { "VROM", "mpr-20590.36", 0x527049BE, 0x400000, 2, 20, 32, FALSE }, + { "VROM", "mpr-20591.37", 0x3BE20243, 0x400000, 2, 22, 32, FALSE }, + { "VROM", "mpr-20592.38", 0xD7985B28, 0x400000, 2, 24, 32, FALSE }, + { "VROM", "mpr-20593.39", 0xE670C4D3, 0x400000, 2, 26, 32, FALSE }, + { "VROM", "mpr-20594.40", 0x35578240, 0x400000, 2, 28, 32, FALSE }, + { "VROM", "mpr-20595.41", 0x1D4A2CAD, 0x400000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // Harley Davidson & L.A. Riders + { + "harley", + "Harley Davidson & L.A. Riders", + "Sega", + 1998, + 0x20, + 0x800000, // 8 MB of fixed CROM + TRUE, // 40 MB of banked CROM + 0x4000000, // 64 MB of VROM + GAME_INPUT_COMMON|GAME_INPUT_VEHICLE, + + { + // Fixed CROM + { "CROM", "epr-20393a.17", 0xB5646556, 0x200000, 2, 0x0000006, 8, TRUE }, + { "CROM", "epr-20394a.18", 0xCE29E2B6, 0x200000, 2, 0x0000004, 8, TRUE }, + { "CROM", "epr-20395a.19", 0x761F4976, 0x200000, 2, 0x0000002, 8, TRUE }, + { "CROM", "epr-20396a.20", 0x16B0106B, 0x200000, 2, 0x0000000, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-20361.1", 0xDDB66C2F, 0x400000, 2, 0x0000006, 8, TRUE }, + { "CROMxx", "mpr-20362.2", 0xF7E60DFD, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-20363.3", 0x3E3CC6FF, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-20364.4", 0xA2A68EF2, 0x400000, 2, 0x0000000, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-20365.5", 0x7DD50361, 0x400000, 2, 0x1000006, 8, TRUE }, + { "CROMxx", "mpr-20366.6", 0x45E3850E, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr-20367.7", 0x6C3F9748, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr-20368.8", 0x100C9846, 0x400000, 2, 0x1000000, 8, TRUE }, + + // Banked CROM3 + { "CROMxx", "epr-20409.13", 0x58CAAA75, 0x200000, 2, 0x3800006, 8, TRUE }, + { "CROMxx", "epr-20410.14", 0x98B126F2, 0x200000, 2, 0x3800004, 8, TRUE }, + { "CROMxx", "epr-20411.15", 0x848DAAF7, 0x200000, 2, 0x3800002, 8, TRUE }, + { "CROMxx", "epr-20412.16", 0x0D51BB34, 0x200000, 2, 0x3800000, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-20377.26", 0x4D2887E5, 0x400000, 2, 0, 32, FALSE }, + { "VROM", "mpr-20378.27", 0x5AD7C0EC, 0x400000, 2, 2, 32, FALSE }, + { "VROM", "mpr-20379.28", 0x1E51C9F0, 0x400000, 2, 4, 32, FALSE }, + { "VROM", "mpr-20380.29", 0xE10D35AE, 0x400000, 2, 6, 32, FALSE }, + { "VROM", "mpr-20381.30", 0x76CD36A2, 0x400000, 2, 8, 32, FALSE }, + { "VROM", "mpr-20382.31", 0xF089AE37, 0x400000, 2, 10, 32, FALSE }, + { "VROM", "mpr-20383.32", 0x9E96D3BE, 0x400000, 2, 12, 32, FALSE }, + { "VROM", "mpr-20384.33", 0x5BDFBB52, 0x400000, 2, 14, 32, FALSE }, + { "VROM", "mpr-20385.34", 0x12DB1729, 0x400000, 2, 16, 32, FALSE }, + { "VROM", "mpr-20386.35", 0xDB2CCAF8, 0x400000, 2, 18, 32, FALSE }, + { "VROM", "mpr-20387.36", 0xC5DDE91B, 0x400000, 2, 20, 32, FALSE }, + { "VROM", "mpr-20388.37", 0xAEAA862E, 0x400000, 2, 22, 32, FALSE }, + { "VROM", "mpr-20389.38", 0x49BB6593, 0x400000, 2, 24, 32, FALSE }, + { "VROM", "mpr-20390.39", 0x1D4A8EFE, 0x400000, 2, 26, 32, FALSE }, + { "VROM", "mpr-20391.40", 0x5DC452DC, 0x400000, 2, 28, 32, FALSE }, + { "VROM", "mpr-20392.41", 0x892208CB, 0x400000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // L.A. Machineguns + { + "lamachin", + "L.A. Machineguns", + "Sega", + 1998, + 0x21, + 0x800000, // 8 MB of fixed CROM + TRUE, // 48 MB of banked CROM (mirror) + 0x4000000, // 64 MB of VROM + GAME_INPUT_COMMON|GAME_INPUT_ANALOG_JOYSTICK, + + { + // Fixed CROM + { "CROM", "epr21486.20", 0x940637C2, 0x200000, 2, 0x0000006, 8, TRUE }, + { "CROM", "epr21485.19", 0x58102168, 0x200000, 2, 0x0000004, 8, TRUE }, + { "CROM", "epr21484.18", 0xF68F7703, 0x200000, 2, 0x0000002, 8, TRUE }, + { "CROM", "epr21483.17", 0x64DE433F, 0x200000, 2, 0x0000000, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr21454.4", 0x42BDC56C, 0x400000, 2, 0x0000006, 8, TRUE }, + { "CROMxx", "mpr21453.3", 0x01AC050C, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr21452.2", 0x082D98AB, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr21451.1", 0x97FF94A7, 0x400000, 2, 0x0000000, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr21458.8", 0xB748F5A1, 0x400000, 2, 0x1000000, 8, TRUE }, + { "CROMxx", "mpr21457.7", 0x2034DBD4, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr21456.6", 0x73A50547, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr21455.5", 0x0B4A3CC5, 0x400000, 2, 0x1000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr21462.12", 0x03D22EE8, 0x400000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr21462.11", 0x33D8F0DA, 0x400000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr21461.10", 0x02268361, 0x400000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr21460.9", 0x71A7B6B3, 0x400000, 2, 0x2000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr21467.26", 0x73635100, 0x400000, 2, 0, 32, FALSE }, + { "VROM", "mpr21468.27", 0x462E5C81, 0x400000, 2, 2, 32, FALSE }, + { "VROM", "mpr21469.28", 0x4BA3F192, 0x400000, 2, 4, 32, FALSE }, + { "VROM", "mpr21470.29", 0x670F0DF5, 0x400000, 2, 6, 32, FALSE }, + { "VROM", "mpr21471.30", 0x1F07E6E3, 0x400000, 2, 8, 32, FALSE }, + { "VROM", "mpr21472.31", 0xE6DC64A3, 0x400000, 2, 10, 32, FALSE }, + { "VROM", "mpr21473.32", 0xD1C9B54A, 0x400000, 2, 12, 32, FALSE }, + { "VROM", "mpr21474.33", 0xAA2F19AE, 0x400000, 2, 14, 32, FALSE }, + { "VROM", "mpr21475.34", 0xBAE9B381, 0x400000, 2, 16, 32, FALSE }, + { "VROM", "mpr21476.35", 0x3833DF51, 0x400000, 2, 18, 32, FALSE }, + { "VROM", "mpr21477.36", 0x46032C35, 0x400000, 2, 20, 32, FALSE }, + { "VROM", "mpr21478.37", 0x35EF75B8, 0x400000, 2, 22, 32, FALSE }, + { "VROM", "mpr21479.38", 0x783E8ECE, 0x400000, 2, 24, 32, FALSE }, + { "VROM", "mpr21480.39", 0xC947BCB8, 0x400000, 2, 26, 32, FALSE }, + { "VROM", "mpr21481.40", 0x6CE566AC, 0x400000, 2, 28, 32, FALSE }, + { "VROM", "mpr21482.41", 0xE995F554, 0x400000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // The Ocean Hunter + { + "oceanhun", + "The Ocean Hunter", + "Sega", + 1998, + 0x21, + 0x800000, // 8 MB of fixed CROM + FALSE, // 96 MB of banked CROM (do not mirror) + 0x4000000, // 64 MB of VROM (will need to be mirrored) + GAME_INPUT_COMMON|GAME_INPUT_ANALOG_JOYSTICK, + + { + // Fixed CROM + { "CROM", "epr21117.20", 0x3adfcb9d, 0x200000, 2, 0x0000006, 8, TRUE }, + { "CROM", "epr21116.19", 0x0bb9c107, 0x200000, 2, 0x0000004, 8, TRUE }, + { "CROM", "epr21115.18", 0x69e31e85, 0x200000, 2, 0x0000002, 8, TRUE }, + { "CROM", "epr21114.17", 0x58d985f1, 0x200000, 2, 0x0000000, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr21085.8", 0x5056ad33, 0x800000, 2, 0x2000006, 8, TRUE }, + { "CROMxx", "mpr21084.7", 0xfdec6a23, 0x800000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr21083.6", 0xc1c6b554, 0x800000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr21082.5", 0x2b7224d3, 0x800000, 2, 0x2000000, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr21089.12", 0x2e8f88bd, 0x800000, 2, 0x4000000, 8, TRUE }, + { "CROMxx", "mpr21088.11", 0x7ed71c8c, 0x800000, 2, 0x4000002, 8, TRUE }, + { "CROMxx", "mpr21087.10", 0xcff28641, 0x800000, 2, 0x4000004, 8, TRUE }, + { "CROMxx", "mpr21086.9", 0x3f12e1d0, 0x800000, 2, 0x4000006, 8, TRUE }, + + // Banked CROM3 + { "CROMxx", "mpr21093.16", 0xbdfbf357, 0x800000, 2, 0x6000000, 8, TRUE }, + { "CROMxx", "mpr21092.15", 0x5b1ced40, 0x800000, 2, 0x6000002, 8, TRUE }, + { "CROMxx", "mpr21091.14", 0x10671951, 0x800000, 2, 0x6000004, 8, TRUE }, + { "CROMxx", "mpr21090.13", 0x749d7979, 0x800000, 2, 0x6000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr21098.26", 0x91e71855, 0x400000, 2, 0, 32, FALSE }, + { "VROM", "mpr21099.27", 0x308a2768, 0x400000, 2, 2, 32, FALSE }, + { "VROM", "mpr21100.28", 0x5149b286, 0x400000, 2, 4, 32, FALSE }, + { "VROM", "mpr21101.29", 0xe9ed4250, 0x400000, 2, 6, 32, FALSE }, + { "VROM", "mpr21102.30", 0x06c6d4fc, 0x400000, 2, 8, 32, FALSE }, + { "VROM", "mpr21103.31", 0x17c4b27a, 0x400000, 2, 10, 32, FALSE }, + { "VROM", "mpr21104.32", 0xf6f80ffb, 0x400000, 2, 12, 32, FALSE }, + { "VROM", "mpr21105.33", 0x99bdb52b, 0x400000, 2, 14, 32, FALSE }, + { "VROM", "mpr21106.34", 0xad2b7981, 0x400000, 2, 16, 32, FALSE }, + { "VROM", "mpr21107.35", 0xe108ff62, 0x400000, 2, 18, 32, FALSE }, + { "VROM", "mpr21108.36", 0xcddc7a6e, 0x400000, 2, 20, 32, FALSE }, + { "VROM", "mpr21109.37", 0x92d6141d, 0x400000, 2, 22, 32, FALSE }, + { "VROM", "mpr21110.38", 0x4d6e3148, 0x400000, 2, 24, 32, FALSE }, + { "VROM", "mpr21111.39", 0x0a046d7a, 0x400000, 2, 26, 32, FALSE }, + { "VROM", "mpr21112.40", 0x9afd9feb, 0x400000, 2, 28, 32, FALSE }, + { "VROM", "mpr21113.41", 0x864bf325, 0x400000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // Star Wars Trilogy + { + "swtrilgy", + "Star Wars Trilogy", + "Sega, LucasArts", + 1998, + 0x21, + 0x800000, // 8 MB of fixed CROM + TRUE, // 48 MB of banked CROM (mirror) + 0x4000000, // 64 MB of VROM + GAME_INPUT_COMMON|GAME_INPUT_ANALOG_JOYSTICK, + + { + // Fixed CROM + { "CROM", "epr-21382a.20", 0x69BAF117, 0x200000, 2, 0x0000000, 8, TRUE }, + { "CROM", "epr-21381a.19", 0x2DD34E28, 0x200000, 2, 0x0000002, 8, TRUE }, + { "CROM", "epr-21380a.18", 0x780FB4E7, 0x200000, 2, 0x0000004, 8, TRUE }, + { "CROM", "epr-21379a.17", 0x24DC1555, 0x200000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr-21342.04", 0x339525CE, 0x400000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr-21341.03", 0xB2A269E4, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr-21340.02", 0xAD36040E, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr-21339.01", 0xC0CE5037, 0x400000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr-21346.08", 0xC8733594, 0x400000, 2, 0x1000000, 8, TRUE }, + { "CROMxx", "mpr-21345.07", 0x6C183A21, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr-21344.06", 0x87453D76, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr-21343.05", 0x12552D07, 0x400000, 2, 0x1000006, 8, TRUE }, + + // Banked CROM2 + { "CROMxx", "mpr-21350.12", 0x486195E7, 0x400000, 2, 0x2000000, 8, TRUE }, + { "CROMxx", "mpr-21349.11", 0x3D39454B, 0x400000, 2, 0x2000002, 8, TRUE }, + { "CROMxx", "mpr-21348.10", 0x1F7CC5F5, 0x400000, 2, 0x2000004, 8, TRUE }, + { "CROMxx", "mpr-21347.09", 0xECB6B934, 0x400000, 2, 0x2000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr-21359.26", 0x34EF4122, 0x400000, 2, 0, 32, FALSE }, + { "VROM", "mpr-21360.27", 0x2882B95E, 0x400000, 2, 2, 32, FALSE }, + { "VROM", "mpr-21361.28", 0x9B61C3C1, 0x400000, 2, 4, 32, FALSE }, + { "VROM", "mpr-21362.29", 0x01A92169, 0x400000, 2, 6, 32, FALSE }, + { "VROM", "mpr-21363.30", 0xE7D18FED, 0x400000, 2, 8, 32, FALSE }, + { "VROM", "mpr-21364.31", 0xCB6A5468, 0x400000, 2, 10, 32, FALSE }, + { "VROM", "mpr-21365.32", 0xAD5449D8, 0x400000, 2, 12, 32, FALSE }, + { "VROM", "mpr-21366.33", 0xDEFB6B95, 0x400000, 2, 14, 32, FALSE }, + { "VROM", "mpr-21367.34", 0xDFD51029, 0x400000, 2, 16, 32, FALSE }, + { "VROM", "mpr-21368.35", 0xAE90FD21, 0x400000, 2, 18, 32, FALSE }, + { "VROM", "mpr-21369.36", 0xBF17EEB4, 0x400000, 2, 20, 32, FALSE }, + { "VROM", "mpr-21370.37", 0x2321592A, 0x400000, 2, 22, 32, FALSE }, + { "VROM", "mpr-21371.38", 0xA68782FD, 0x400000, 2, 24, 32, FALSE }, + { "VROM", "mpr-21372.39", 0xFC3F4E8B, 0x400000, 2, 26, 32, FALSE }, + { "VROM", "mpr-21373.40", 0xB76AD261, 0x400000, 2, 28, 32, FALSE }, + { "VROM", "mpr-21374.41", 0xAE6C4D28, 0x400000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + // Emergency Car Ambulance + { + "eca", + "Emergency Car Ambulance", + "Sega", + 1998, + 0x21, + 0x800000, // 8 MB of fixed CROM + TRUE, // 48 MB of banked CROM (mirror) + 0x4000000, // 64 MB of VROM + GAME_INPUT_COMMON|GAME_INPUT_VEHICLE, + + { + // Fixed CROM + { "CROM", "epr22898.20", 0xEFB96701, 0x200000, 2, 0x0000000, 8, TRUE }, + { "CROM", "epr22897.19", 0x9755DD8C, 0x200000, 2, 0x0000002, 8, TRUE }, + { "CROM", "epr22896.18", 0x0FF828A8, 0x200000, 2, 0x0000004, 8, TRUE }, + { "CROM", "epr22895.17", 0x07DF16A0, 0x200000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM0 + { "CROMxx", "mpr22873.4", 0xDD406330, 0x400000, 2, 0x0000000, 8, TRUE }, + { "CROMxx", "mpr22872.3", 0x4FDE63A1, 0x400000, 2, 0x0000002, 8, TRUE }, + { "CROMxx", "mpr22871.2", 0xCF5BB5B5, 0x400000, 2, 0x0000004, 8, TRUE }, + { "CROMxx", "mpr22870.1", 0x52054043, 0x400000, 2, 0x0000006, 8, TRUE }, + + // Banked CROM1 + { "CROMxx", "mpr22877.8", 0xE53B8764, 0x400000, 2, 0x1000000, 8, TRUE }, + { "CROMxx", "mpr22876.7", 0xA7561249, 0x400000, 2, 0x1000002, 8, TRUE }, + { "CROMxx", "mpr22875.6", 0x1BB5C018, 0x400000, 2, 0x1000004, 8, TRUE }, + { "CROMxx", "mpr22874.5", 0x5E990497, 0x400000, 2, 0x1000006, 8, TRUE }, + + // Banked CROM3 + { "CROMxx", "mpr22885.16", 0x3525B46D, 0x400000, 2, 0x3000000, 8, TRUE }, + { "CROMxx", "mpr22884.15", 0x254C3B63, 0x400000, 2, 0x3000002, 8, TRUE }, + { "CROMxx", "mpr22883.14", 0x86D90148, 0x400000, 2, 0x3000004, 8, TRUE }, + { "CROMxx", "mpr22882.13", 0xB161416F, 0x400000, 2, 0x3000006, 8, TRUE }, + + // Video ROM + { "VROM", "mpr22854.26", 0x97A23D16, 0x400000, 2, 0, 32, FALSE }, + { "VROM", "mpr22855.27", 0x7249CDC9, 0x400000, 2, 2, 32, FALSE }, + { "VROM", "mpr22856.28", 0x9C0D1D1B, 0x400000, 2, 4, 32, FALSE }, + { "VROM", "mpr22857.29", 0x44E6CE2B, 0x400000, 2, 6, 32, FALSE }, + { "VROM", "mpr22858.30", 0x0AF40AAE, 0x400000, 2, 8, 32, FALSE }, + { "VROM", "mpr22859.31", 0xC64F0158, 0x400000, 2, 10, 32, FALSE }, + { "VROM", "mpr22860.32", 0x053AF14B, 0x400000, 2, 12, 32, FALSE }, + { "VROM", "mpr22861.33", 0xD26343DA, 0x400000, 2, 14, 32, FALSE }, + { "VROM", "mpr22862.34", 0x38347C14, 0x400000, 2, 16, 32, FALSE }, + { "VROM", "mpr22863.35", 0x28B558E6, 0x400000, 2, 18, 32, FALSE }, + { "VROM", "mpr22864.36", 0x31ED02F6, 0x400000, 2, 20, 32, FALSE }, + { "VROM", "mpr22865.37", 0x3E3A211A, 0x400000, 2, 22, 32, FALSE }, + { "VROM", "mpr22866.38", 0xA863A3C8, 0x400000, 2, 24, 32, FALSE }, + { "VROM", "mpr22867.39", 0x1CE6C7B2, 0x400000, 2, 26, 32, FALSE }, + { "VROM", "mpr22868.40", 0x2DB40CF8, 0x400000, 2, 28, 32, FALSE }, + { "VROM", "mpr22869.41", 0xC6D62634, 0x400000, 2, 30, 32, FALSE }, + + { NULL, NULL, 0, 0, 0, 0, 0, FALSE } + } + }, + + + // Terminate list + { + "", + NULL, + NULL, + 0, + 0, + 0, + 0, + 0, + 0, + + { + { NULL, NULL, 0, 0, 0, 0, FALSE }, + { NULL, NULL, 0, 0, 0, 0, FALSE }, + { NULL, NULL, 0, 0, 0, 0, FALSE }, + { NULL, NULL, 0, 0, 0, 0, FALSE } + } + } +}; diff --git a/Games.h b/Games.h new file mode 100644 index 0000000..d492301 --- /dev/null +++ b/Games.h @@ -0,0 +1,94 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Games.h + * + * Header file containing Model 3 game and ROM file information. + */ + +#ifndef INCLUDED_GAMES_H +#define INCLUDED_GAMES_H + + +#include "ROMLoad.h" // ROMInfo structure + + +/****************************************************************************** + Definitions +******************************************************************************/ + +// Input flags +#define GAME_INPUT_COMMON 0x0001 // game has common controls +#define GAME_INPUT_VEHICLE 0x0002 // game has vehicle controls +#define GAME_INPUT_JOYSTICK1 0x0004 // game has joystick 1 +#define GAME_INPUT_JOYSTICK2 0x0008 // game has joystick 2 +#define GAME_INPUT_FIGHTING 0x0010 // game has fighting game controls +#define GAME_INPUT_VR 0x0020 // game has VR view buttons +#define GAME_INPUT_RALLY 0x0040 // game has rally car controls +#define GAME_INPUT_GUN1 0x0080 // game has gun 1 +#define GAME_INPUT_GUN2 0x0100 // game has gun 2 +#define GAME_INPUT_SHIFT4 0x0200 // game has 4-speed shifter +#define GAME_INPUT_ANALOG_JOYSTICK 0x0400 // game has analog joystick +#define GAME_INPUT_TWIN_JOYSTICKS 0x0800 // game has twin joysticks +#define GAME_INPUT_SOCCER 0x1000 // game has soccer controls +#define GAME_INPUT_ALL 0x1FFF + +/****************************************************************************** + Data Structures +******************************************************************************/ + +/* + * GameInfo: + * + * Describes a Model 3 game. List is terminated when title == NULL. + */ +struct GameInfo +{ + // Game information + const char id[9]; // 8-character game identifier (also serves as zip archive file name) + const char *title; // complete game title + const char *mfgName; // name of manufacturer + unsigned year; // year released (in decimal) + int step; // Model 3 hardware stepping: 0x10 = 1.0, 0x15 = 1.5, 0x20 = 2.0, 0x21 = 2.1 + unsigned cromSize; // size of fixed CROM (up to 8 MB) + BOOL mirrorLow64MB; // mirror low 64 MB of banked CROM space to upper 64 MB + unsigned vromSize; // size of video ROMs (32 or 64 MB; if the latter, will have to be mirrored) + unsigned inputFlags; // game input types + + // ROM files + struct ROMInfo ROM[40]; +}; + + +/****************************************************************************** + Model 3 Game List + + All games supported by Supermodel. All ROMs are loaded according to their + native endianness. That is, the PowerPC ROMs are loaded just as a real + PowerPC would see them. The emulator may reorder the bytes on its own for + performance reasons (but the ROMs are not specified that way here). +******************************************************************************/ + +extern const struct GameInfo Model3GameList[]; + + +#endif // INCLUDED_GAMES_H diff --git a/Graphics/Error.cpp b/Graphics/Error.cpp new file mode 100644 index 0000000..c4cd6b3 --- /dev/null +++ b/Graphics/Error.cpp @@ -0,0 +1,64 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Error.cpp + * + * Error reporting for 3D renderer. There are some situations in which it is + * appropriate to inform the user of an error during rendering. However, these + * will frequently lead to an avalanche of error messages. Therefore, error + * messages are managed by this interface, ensuring that they are displayed not + * more than once per frame. + * + * Error functions can always be counted on to return FAIL, like ErrorLog(). + */ + +#include "Supermodel.h" + + +// Error bit flags (must not conflict) +#define ERROR_LOCAL_VERTEX_OVERFLOW 0x1 +#define ERROR_UNABLE_TO_CACHE_MODEL 0x2 + + +// Overflow in the local vertex buffer, which holds one model +BOOL CRender3D::ErrorLocalVertexOverflow(void) +{ + if ((errorMsgFlags&ERROR_LOCAL_VERTEX_OVERFLOW)) + return FAIL; + errorMsgFlags |= ERROR_LOCAL_VERTEX_OVERFLOW; + return ErrorLog("Overflow in local vertex buffer!"); +} + +// Model could not be cached, even after dumping display list and re-caching +BOOL CRender3D::ErrorUnableToCacheModel(UINT32 modelAddr) +{ + if ((errorMsgFlags&ERROR_UNABLE_TO_CACHE_MODEL)) + return FAIL; + errorMsgFlags |= ERROR_UNABLE_TO_CACHE_MODEL; + return ErrorLog("Encountered a model that was too large to cache (at %08X)!", modelAddr); +} + +// Call this every frame to clear the error flag, allowing errors to be printed +void CRender3D::ClearErrors(void) +{ + errorMsgFlags = 0; +} \ No newline at end of file diff --git a/Graphics/Models.cpp b/Graphics/Models.cpp new file mode 100644 index 0000000..8239eaa --- /dev/null +++ b/Graphics/Models.cpp @@ -0,0 +1,809 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Models.cpp + * + * Model parsing, caching, and drawing. + */ + +#include +#include +#include "Supermodel.h" + + +/****************************************************************************** + Definitions and Constants +******************************************************************************/ + +/* + * VBO Vertex Layout + * + * All vertex information is stored in an array of GLfloats. Offset and size + * information is defined here for now. + */ +#define VBO_VERTEX_OFFSET_X 0 // vertex X * +#define VBO_VERTEX_OFFSET_Y 1 // vertex Y * +#define VBO_VERTEX_OFFSET_Z 2 // vertex Z * +#define VBO_VERTEX_OFFSET_NX 3 // normal X * +#define VBO_VERTEX_OFFSET_NY 4 // normal Y * +#define VBO_VERTEX_OFFSET_NZ 5 // normal Z * +#define VBO_VERTEX_OFFSET_R 6 // color (untextured polys) and material (textured polys) R c (w/ texenable?) +#define VBO_VERTEX_OFFSET_G 7 // color and material G +#define VBO_VERTEX_OFFSET_B 8 // color and material B +#define VBO_VERTEX_OFFSET_TRANSLUCENCE 9 // translucence level (0.0 fully transparent, 1.0 opaque) * +#define VBO_VERTEX_OFFSET_LIGHTENABLE 10 // lighting enabled (0.0 luminous, 1.0 light enabled) * +#define VBO_VERTEX_OFFSET_FOGINTENSITY 11 // fog intensity (0.0 no fog applied, 1.0 all fog applied) * (combine w/ lightenable, making one negative) +#define VBO_VERTEX_OFFSET_U 12 // texture U coordinate (in texels, relative to sub-texture) * +#define VBO_VERTEX_OFFSET_V 13 // texture V coordinate * +#define VBO_VERTEX_OFFSET_TEXTURE_X 14 // sub-texture parameters, X (position in overall texture map, in texels) * +#define VBO_VERTEX_OFFSET_TEXTURE_Y 15 // "" Y "" * +#define VBO_VERTEX_OFFSET_TEXTURE_W 16 // sub-texture parameters, width of texture in texels * +#define VBO_VERTEX_OFFSET_TEXTURE_H 17 // "" height of texture in texels * +#define VBO_VERTEX_OFFSET_TEXPARAMS_EN 18 // texture parameter: ==1 texturing enabled, ==0 disabled (per-polygon) c (w/ R?) +#define VBO_VERTEX_OFFSET_TEXPARAMS_TRANS 19 // texture parameter: >=0 use transparency bit, <0 no transparency (per-polygon) c (w/ contour?) +#define VBO_VERTEX_OFFSET_TEXPARAMS_UWRAP 20 // texture parameters: U wrap mode: ==1 mirrored repeat, ==0 normal repeat +#define VBO_VERTEX_OFFSET_TEXPARAMS_VWRAP 21 // "" V wrap mode "" +#define VBO_VERTEX_OFFSET_TEXFORMAT_CONTOUR 22 // contour texture: >0 indicates contour texture (see also texParams.trans) c (w/ trans?) +#define VBO_VERTEX_SIZE 23 // total size (may include padding for alignment) + + +/****************************************************************************** + Display Lists + + Every instance of a model encountered in the scene database during rendering + is stored in the display list along with its current transformation matrices + and other state information. Display lists are bound to model caches for + performance: only one VBO has to be bound for an entire display list. + + Binding display lists to model caches may cause priority problems among + alpha polygons. Therefore, it may be necessary in the future to decouple them. +******************************************************************************/ + +// Draws the display list +void CRender3D::DrawDisplayList(ModelCache *Cache, POLY_STATE state) +{ + DisplayList *D; + + // Bind and activate VBO (pointers activate currently bound VBO) + glBindBuffer(GL_ARRAY_BUFFER, Cache->vboID); + glVertexPointer(3, GL_FLOAT, VBO_VERTEX_SIZE*sizeof(GLfloat), (GLvoid *) (VBO_VERTEX_OFFSET_X*sizeof(GLfloat))); + glNormalPointer(GL_FLOAT, VBO_VERTEX_SIZE*sizeof(GLfloat), (GLvoid *) (VBO_VERTEX_OFFSET_NX*sizeof(GLfloat))); + glTexCoordPointer(2, GL_FLOAT, VBO_VERTEX_SIZE*sizeof(GLfloat), (GLvoid *) (VBO_VERTEX_OFFSET_U*sizeof(GLfloat))); + glColorPointer(3, GL_FLOAT, VBO_VERTEX_SIZE*sizeof(GLfloat), (GLvoid *) (VBO_VERTEX_OFFSET_R*sizeof(GLfloat))); + glVertexAttribPointer(subTextureLoc, 4, GL_FLOAT, GL_FALSE, VBO_VERTEX_SIZE*sizeof(GLfloat), (GLvoid *) (VBO_VERTEX_OFFSET_TEXTURE_X*sizeof(GLfloat))); + glVertexAttribPointer(texParamsLoc, 4, GL_FLOAT, GL_FALSE, VBO_VERTEX_SIZE*sizeof(GLfloat), (GLvoid *) (VBO_VERTEX_OFFSET_TEXPARAMS_EN*sizeof(GLfloat))); + glVertexAttribPointer(texFormatLoc, 1, GL_FLOAT, GL_FALSE, VBO_VERTEX_SIZE*sizeof(GLfloat), (GLvoid *) (VBO_VERTEX_OFFSET_TEXFORMAT_CONTOUR*sizeof(GLfloat))); + glVertexAttribPointer(transLevelLoc, 1, GL_FLOAT, GL_FALSE, VBO_VERTEX_SIZE*sizeof(GLfloat), (GLvoid *) (VBO_VERTEX_OFFSET_TRANSLUCENCE*sizeof(GLfloat))); + glVertexAttribPointer(lightEnableLoc, 1, GL_FLOAT, GL_FALSE, VBO_VERTEX_SIZE*sizeof(GLfloat), (GLvoid *) (VBO_VERTEX_OFFSET_LIGHTENABLE*sizeof(GLfloat))); + glVertexAttribPointer(fogIntensityLoc, 1, GL_FLOAT, GL_FALSE, VBO_VERTEX_SIZE*sizeof(GLfloat), (GLvoid *) (VBO_VERTEX_OFFSET_FOGINTENSITY*sizeof(GLfloat))); + + // Set up state + if (state == POLY_STATE_ALPHA) + { + glEnable(GL_BLEND); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + } + else + { + glDisable(GL_BLEND); + } + + // Draw if there are items in the list + D = Cache->ListHead[state]; + while (D != NULL) + { + if (D->isViewport) + { + if (D->next != NULL) // if nothing follows, no point in doing this + { + if (!D->next->isViewport) + { + glUniform3fv(lightingLoc, 2, D->Data.Viewport.lightingParams); + glUniformMatrix4fv(projectionMatrixLoc, 1, GL_FALSE, D->Data.Viewport.projectionMatrix); + glFogf(GL_FOG_DENSITY, D->Data.Viewport.fogParams[3]); + glFogf(GL_FOG_START, D->Data.Viewport.fogParams[4]); + glFogfv(GL_FOG_COLOR, &(D->Data.Viewport.fogParams[0])); + glUniform4fv(spotEllipseLoc, 1, D->Data.Viewport.spotEllipse); + glUniform2fv(spotRangeLoc, 1, D->Data.Viewport.spotRange); + glUniform3fv(spotColorLoc, 1, D->Data.Viewport.spotColor); + glViewport(D->Data.Viewport.x, D->Data.Viewport.y, D->Data.Viewport.width, D->Data.Viewport.height); + } + } + } + else + { + glUniformMatrix4fv(modelViewMatrixLoc, 1, GL_FALSE, D->Data.Model.modelViewMatrix); + glDrawArrays(GL_TRIANGLES, D->Data.Model.index, D->Data.Model.numVerts); + } + + D = D->next; + } +} + +// Appends an instance of a model or viewport to the display list, copying over the required state information +BOOL CRender3D::AppendDisplayList(ModelCache *Cache, BOOL isViewport, int modelNum) +{ + int lm, i; + + if ((Cache->listSize+2) > Cache->maxListSize) // a model may have 2 states (viewports are added to both display lists) + return FAIL; + //return ErrorLog("Display list is full."); + + // Insert states into the display list + for (i = 0; i < 2; i++) + { + if (isViewport) + { + // Get index for new display list item and advance to next one + lm = Cache->listSize++; + + // Viewport parameters + Cache->List[lm].Data.Viewport.x = viewportX; + Cache->List[lm].Data.Viewport.y = viewportY; + Cache->List[lm].Data.Viewport.width = viewportWidth; + Cache->List[lm].Data.Viewport.height = viewportHeight; + + // Copy over lighting and fog state + memcpy(Cache->List[lm].Data.Viewport.lightingParams, lightingParams, sizeof(lightingParams)); + memcpy(Cache->List[lm].Data.Viewport.fogParams, fogParams, sizeof(fogParams)); + memcpy(Cache->List[lm].Data.Viewport.spotEllipse, spotEllipse, sizeof(spotEllipse)); + memcpy(Cache->List[lm].Data.Viewport.spotRange, spotRange, sizeof(spotRange)); + memcpy(Cache->List[lm].Data.Viewport.spotColor, spotColor, sizeof(spotColor)); + + // Copy projection matrix + glGetFloatv(GL_PROJECTION_MATRIX, Cache->List[lm].Data.Viewport.projectionMatrix); + } + else if (Cache->Models[modelNum].numVerts[i] > 0) // vertices exist for this state + { + // Get index for new display list item and advance to next one + lm = Cache->listSize++; + + // Point to VBO for current model and state + Cache->List[lm].Data.Model.index = Cache->Models[modelNum].index[i]; + Cache->List[lm].Data.Model.numVerts = Cache->Models[modelNum].numVerts[i]; + + // Copy modelview matrix + glGetFloatv(GL_MODELVIEW_MATRIX, Cache->List[lm].Data.Model.modelViewMatrix); + } + else // nothing to do, continue loop + continue; + + // Update list pointers and set list node type + Cache->List[lm].isViewport = isViewport; + Cache->List[lm].next = NULL; // current end of list + if (Cache->ListHead[i] == NULL) + { + Cache->ListHead[i] = &(Cache->List[lm]); + Cache->ListTail[i] = Cache->ListHead[i]; + } + else + { + Cache->ListTail[i]->next = &(Cache->List[lm]); + Cache->ListTail[i] = &(Cache->List[lm]); + } + } + + return OKAY; +} + +// Clears the display list in preparation for a new frame +void CRender3D::ClearDisplayList(ModelCache *Cache) +{ + Cache->listSize = 0; + for (int i = 0; i < 2; i++) + { + Cache->ListHead[i] = NULL; + Cache->ListTail[i] = NULL; + } +} + + +/****************************************************************************** + Model Caching + + Note that as vertices are inserted into the appropriate local vertex buffer + (sorted by polygon state -- alpha and normal), the VBO index is advanced to + reserve space and does not correspond to the actual position of each vertex. + Vertices are copied in batches sorted by state when the model is complete. +******************************************************************************/ + +static void CrossProd(GLfloat out[3], GLfloat a[3], GLfloat b[3]) +{ + out[0] = a[1]*b[2]-a[2]*b[1]; + out[1] = a[2]*b[0]-a[0]*b[2]; + out[2] = a[0]*b[1]-a[1]*b[0]; +} + +// Inserts a vertex into the local vertex buffer, incrementing both the local and VBO pointers. The normal is scaled by normFlip. +void CRender3D::InsertVertex(ModelCache *Cache, const Vertex *V, const Poly *P, float normFlip) +{ + GLfloat r, g, b; + GLfloat translucence, fogIntensity, texWidth, texHeight, texBaseX, texBaseY, contourProcessing; + unsigned baseIdx, texFormat, texEnable, lightEnable, modulate, colorIdx; + int s, texPage; + + // Texture selection + texEnable = P->header[6]&0x04000000; + texFormat = (P->header[6]>>7)&7; + texWidth = (GLfloat) (32<<((P->header[3]>>3)&7)); + texHeight = (GLfloat) (32<<((P->header[3]>>0)&7)); + texPage = (P->header[4]&0x40) ? 1024 : 0; // treat texture page as Y coordinate + texBaseX = (GLfloat) (32*(((P->header[4]&0x1F)<<1)|((P->header[5]>>7)&1))); + texBaseY = (GLfloat) (32*(P->header[5]&0x1F)+texPage); + + /* + * Lighting and Color Modulation: + * + * It appears that there is a modulate bit which causes the polygon color + * to be multiplied by texel colors. However, if polygons are luminous, + * this appears to be disabled (not quite correct yet, though). + */ + + lightEnable = !(P->header[6]&0x00010000); + modulate = !(P->header[4]&0x80); + modulate = P->header[3]&0x80; // seems to work better + + + // Material color + if ((P->header[1]&2) == 0) + { + colorIdx = (P->header[4]>>20)&0x7FF; + b = (GLfloat) (polyRAM[0x400+colorIdx]&0xFF) * (1.0f/255.0f); + g = (GLfloat) ((polyRAM[0x400+colorIdx]>>8)&0xFF) * (1.0f/255.0f); + r = (GLfloat) ((polyRAM[0x400+colorIdx]>>16)&0xFF) * (1.0f/255.0f); + } + else + { + // Colors are 8-bit (almost certainly true, see Star Wars) + r = (GLfloat) (P->header[4]>>24) * (1.0f/255.0f); + g = (GLfloat) ((P->header[4]>>16)&0xFF) * (1.0f/255.0f); + b = (GLfloat) ((P->header[4]>>8)&0xFF) * (1.0f/255.0f); + } + + // Determine modulation settings + if (texEnable) + { + //if (!lightEnable|| !modulate) + if (!modulate) + r = g = b = 1.0f; + } + +#if 0 + if (texFormat==5)//texFormat==6||texFormat==2) + { + //printf("%03X\n", P->header[4]>>8); + //texEnable=0; + g=b=1.0; + r=1.0f; + } +#endif +#if 0 + if ((P->header[testWord]&(1<header[6]>>18)&0x1F) * (1.0f/31.0f); + if ((P->header[6]&0x00800000)) // if set, polygon is opaque + translucence = 1.0f; + + // Fog intensity (for luminous polygons) + fogIntensity = (GLfloat) ((P->header[6]>>11)&0x1F) * (1.0f/31.0f); + if (!(P->header[6]&0x00010000)) // if not luminous, always use full fog intensity + fogIntensity = 1.0f; + + // Contour processing + if ((P->header[6]&0x80000000) || (texFormat==7)) // contour processing enabled or alpha texture + contourProcessing = 1.0f; + else + contourProcessing = -1.0f; + + // Store to local vertex buffer + s = P->state; + baseIdx = Cache->curVertIdx[s]*VBO_VERTEX_SIZE; + + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_X] = V->x; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_Y] = V->y; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_Z] = V->z; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_R] = r; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_G] = g; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_B] = b; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_TRANSLUCENCE] = translucence; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_LIGHTENABLE] = lightEnable ? 1.0f : 0.0f; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_FOGINTENSITY] = fogIntensity; + + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_NX] = V->n[0]*normFlip; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_NY] = V->n[1]*normFlip; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_NZ] = V->n[2]*normFlip; + + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_U] = V->u; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_V] = V->v; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_TEXTURE_X] = texBaseX; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_TEXTURE_Y] = texBaseY; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_TEXTURE_W] = texWidth; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_TEXTURE_H] = texHeight; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_TEXPARAMS_EN] = texEnable ? 1.0f : 0.0f; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_TEXPARAMS_TRANS] = contourProcessing; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_TEXPARAMS_UWRAP] = (P->header[2]&2) ? 1.0f : 0.0f; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_TEXPARAMS_VWRAP] = (P->header[2]&1) ? 1.0f : 0.0f; + Cache->verts[s][baseIdx + VBO_VERTEX_OFFSET_TEXFORMAT_CONTOUR] = (texFormat==0) ? 1.0f : 0.0f; + + Cache->curVertIdx[s]++; + Cache->vboCurOffset += VBO_VERTEX_SIZE*sizeof(GLfloat); +} + +BOOL CRender3D::InsertPolygon(ModelCache *Cache, const Poly *P) +{ + GLfloat n[3], v1[3], v2[3], normZFlip; + int i; + BOOL doubleSided; + + // Bounds testing: up to 12 triangles will be inserted (worst case: double sided quad is 6 triangles) + if ((Cache->curVertIdx[P->state]+6*2) >= Cache->maxVertIdx) + return ErrorLocalVertexOverflow(); // local buffers are not expected to overflow + if ((Cache->vboCurOffset+6*2*VBO_VERTEX_SIZE*sizeof(GLfloat)) >= Cache->vboMaxOffset) + return FAIL; // this just indicates we may need to re-cache + + // Is the polygon double sided? + doubleSided = (P->header[1]&0x10) ? TRUE : FALSE; + + /* + * Determine polygon winding by taking cross product of vectors formed from + * 3 polygon vertices (the middle one being the origin). In reality, back- + * face culling is determined by the polygon normal and two-sided polygons + * exist. This is just a temporary hack. + * + * If the cross product points the same way as the normal, the winding is + * clockwise and can be kept, otherwise it must be reversed. + * + * NOTE: This assumes that the Model 3 base coordinate system's Z axis + * (into the screen) -1, like OpenGL's. For some games (eg., Lost World), + * this is not the case. Assuming games consistently use the same type of + * coordinate system matrix, it seems that inverting the whole dot product + * when Z is positive helps. I don't understand why... + */ + v1[0] = P->Vert[0].x-P->Vert[1].x; + v1[1] = P->Vert[0].y-P->Vert[1].y; + v1[2] = P->Vert[0].z-P->Vert[1].z; + v2[0] = P->Vert[2].x-P->Vert[1].x; + v2[1] = P->Vert[2].y-P->Vert[1].y; + v2[2] = P->Vert[2].z-P->Vert[1].z; + CrossProd(n,v1,v2); + + normZFlip = -1.0f*matrixBasePtr[0x5]; // coordinate system m13 component + + if (normZFlip*(n[0]*P->n[0]+n[1]*P->n[1]+n[2]*P->n[2]) >= 0.0) // clockwise winding confirmed + { + // Store the first triangle + for (i = 0; i < 3; i++) + { + InsertVertex(Cache, &(P->Vert[i]), P, 1.0f); + } + + if (doubleSided) // store backside as counter-clockwise + { + for (i = 2; i >=0; i--) + { + InsertVertex(Cache, &(P->Vert[i]), P, -1.0f); + } + } + + // If quad, second triangle will just be vertices 1, 3, 4 + if (P->numVerts == 4) + { + InsertVertex(Cache, &(P->Vert[0]), P, 1.0f); + InsertVertex(Cache, &(P->Vert[2]), P, 1.0f); + InsertVertex(Cache, &(P->Vert[3]), P, 1.0f); + + if (doubleSided) + { + InsertVertex(Cache, &(P->Vert[0]), P, -1.0f); + InsertVertex(Cache, &(P->Vert[3]), P, -1.0f); + InsertVertex(Cache, &(P->Vert[2]), P, -1.0f); + } + } + } + else // counterclockwise winding, reverse it + { + for (i = 2; i >=0; i--) + { + InsertVertex(Cache, &(P->Vert[i]), P, 1.0f); + } + + if (doubleSided) // store backside as clockwise + { + for (i = 0; i < 3; i++) + { + InsertVertex(Cache, &(P->Vert[i]), P, -1.0f); + } + } + + if (P->numVerts == 4) + { + InsertVertex(Cache, &(P->Vert[0]), P, 1.0f); + InsertVertex(Cache, &(P->Vert[3]), P, 1.0f); + InsertVertex(Cache, &(P->Vert[2]), P, 1.0f); + + if (doubleSided) + { + InsertVertex(Cache, &(P->Vert[0]), P, -1.0f); + InsertVertex(Cache, &(P->Vert[2]), P, -1.0f); + InsertVertex(Cache, &(P->Vert[3]), P, -1.0f); + } + } + } + + return OKAY; +} + +// Begins caching a new model by resetting to the start of the local vertex buffer +BOOL CRender3D::BeginModel(ModelCache *Cache) +{ + int m; + + // Determine whether we've exceeded the model cache limits (caller will have to recache) + if (Cache->numModels >= Cache->maxModels) + return FAIL; // too many models + //return ErrorLog("Too many %s models.", Cache->dynamic?"dynamic":"static"); + + m = Cache->numModels; + + // Reset to the beginning of the local vertex buffer + for (int i = 0; i < 2; i++) + Cache->curVertIdx[i] = 0; + + // Clear the VBO reference to 0 + memset(&(Cache->Models[m]), 0, sizeof(VBORef)); + + // Record starting index of first opaque polygon in VBO (alpha poly index will be re-set in EndModel()) + Cache->Models[m].index[POLY_STATE_NORMAL] = Cache->vboCurOffset/(VBO_VERTEX_SIZE*sizeof(GLfloat)); + Cache->Models[m].index[POLY_STATE_ALPHA] = Cache->Models[m].index[POLY_STATE_NORMAL]; + + return OKAY; +} + +// Uploads all vertices from the local vertex buffer to the VBO, sets up the VBO reference, updates the LUT +void CRender3D::EndModel(ModelCache *Cache, int lutIdx) +{ + int m; + + m = Cache->numModels++; + + // Record the number of vertices, completing the VBORef + for (int i = 0; i < 2; i++) + Cache->Models[m].numVerts[i] = Cache->curVertIdx[i]; + + // First alpha polygon immediately follows the normal polygons + Cache->Models[m].index[POLY_STATE_ALPHA] = Cache->Models[m].index[POLY_STATE_NORMAL]+Cache->Models[m].numVerts[POLY_STATE_NORMAL]; + + // Upload from local vertex buffer to real VBO + glBindBuffer(GL_ARRAY_BUFFER, Cache->vboID); + if (Cache->Models[m].numVerts[POLY_STATE_NORMAL] > 0) + glBufferSubData(GL_ARRAY_BUFFER, Cache->Models[m].index[POLY_STATE_NORMAL]*VBO_VERTEX_SIZE*sizeof(GLfloat), Cache->curVertIdx[POLY_STATE_NORMAL]*VBO_VERTEX_SIZE*sizeof(GLfloat), Cache->verts[POLY_STATE_NORMAL]); + if (Cache->Models[m].numVerts[POLY_STATE_ALPHA] > 0) + glBufferSubData(GL_ARRAY_BUFFER, Cache->Models[m].index[POLY_STATE_ALPHA]*VBO_VERTEX_SIZE*sizeof(GLfloat), Cache->curVertIdx[POLY_STATE_ALPHA]*VBO_VERTEX_SIZE*sizeof(GLfloat), Cache->verts[POLY_STATE_ALPHA]); + + // Update the LUT + Cache->lut[lutIdx] = m; + + // Record LUT index in the model VBORef + Cache->Models[m].lutIdx = lutIdx; +} + +/* + * CacheModel(): + * + * Decodes and caches a complete model. Returns FAIL if any sort of overflow in + * the cache occurred. In this case, the model cache should be cleared before + * being used again because an incomplete model will be stored, wasting vertex + * buffer space. + */ + +BOOL CRender3D::CacheModel(ModelCache *Cache, int lutIdx, const UINT32 *data) +{ + Vertex Prev[4]; // previous vertices + int numPolys = 0; + BOOL done = FALSE; + + // Sega Rally 2 bad models + //if (lutIdx == 0x27a1 || lutIdx == 0x21e0) + // return FAIL; + + if (data == NULL) + return FAIL; + + // Start constructing a new model + if (FAIL == BeginModel(Cache)) + return FAIL; // too many models! + + // Cache all polygons + while (!done) + { + Poly P; // current polygon + GLfloat mag; + GLfloat uvScale; + int texFormat, texWidth, texHeight, texPage, texBaseX, texBaseY; + unsigned i, j, vmask; + UINT32 ix, iy, iz, it; + + // Set current header pointer (header is 7 words) + P.header = data; + data += 7; // data will now point to first vertex + if (P.header[6]==0)// || P.header[0]==0) + break; + + // Obtain basic polygon parameters + done = P.header[1]&4; // last polygon? + P.numVerts = (P.header[0]&0x40)?4:3; + + // Texture data + texFormat = (P.header[6]>>7)&7; + texWidth = (32<<((P.header[3]>>3)&7)); + texHeight = (32<<((P.header[3]>>0)&7)); + texPage = (P.header[4]&0x40) ? 1024 : 0; // treat texture page as Y coordinate + texBaseX = (32*(((P.header[4]&0x1F)<<1)|((P.header[5]>>7)&1))); + texBaseY = (32*(P.header[5]&0x1F)+texPage); + uvScale = (P.header[1]&0x40)?1.0f:(1.0f/8.0f); + + // Determine whether this is an alpha polygon + if (((P.header[6]&0x00800000)==0) || // translucent polygon + (texFormat==7) || // RGBA4 texture + (texFormat==4)) // A4L4 texture + P.state = POLY_STATE_ALPHA; + else + P.state = POLY_STATE_NORMAL; + if (texFormat==1) // A4L4 interleaved + { + if ((P.header[6]&2)) + P.state = POLY_STATE_ALPHA; + else + P.state = POLY_STATE_NORMAL; + } + if (texFormat==3) // A4L4 interleaved + { + if ((P.header[6]&4)) + P.state = POLY_STATE_ALPHA; + else + P.state = POLY_STATE_NORMAL; + } + + // Decode the texture + DecodeTexture(texFormat, texBaseX, texBaseY, texWidth, texHeight); + + // Polygon normal is in upper 24 bits: sign + 1.22 fixed point + P.n[0] = (GLfloat) (((INT32)P.header[1])>>8) * (1.0f/4194304.0f); + P.n[1] = (GLfloat) (((INT32)P.header[2])>>8) * (1.0f/4194304.0f); + P.n[2] = (GLfloat) (((INT32)P.header[3])>>8) * (1.0f/4194304.0f); + + // Fetch reused vertices according to bitfield, then new verts + i = 0; + j = 0; + vmask = 1; + for (i = 0; i < 4; i++) // up to 4 reused vertices + { + if ((P.header[0x00]&vmask)) + { + P.Vert[j] = Prev[i]; + ++j; + } + vmask <<= 1; + } + + for (; j < P.numVerts; j++) // remaining vertices are new and defined here + { + // Fetch vertices + ix = data[0]; + iy = data[1]; + iz = data[2]; + it = data[3]; + + /* + // Check for bad vertices (Sega Rally 2) + if (((ix>>28)==7) || ((iy>>28)==7) || ((iz>>28)==7)) + { + //printf("%X ix=%08X, iy=%08X, iz=%08X\n", lutIdx, ix, iy, iz); + goto StopDecoding; + } + */ + + // Decode vertices + P.Vert[j].x = (GLfloat) (((INT32)ix)>>8) * vertexFactor; + P.Vert[j].y = (GLfloat) (((INT32)iy)>>8) * vertexFactor; + P.Vert[j].z = (GLfloat) (((INT32)iz)>>8) * vertexFactor; + P.Vert[j].n[0] = P.n[0]+(GLfloat)(INT8)(ix&0xFF); // vertex normals are offset from polygon normal + P.Vert[j].n[1] = P.n[1]+(GLfloat)(INT8)(iy&0xFF); + P.Vert[j].n[2] = P.n[2]+(GLfloat)(INT8)(iz&0xFF); + P.Vert[j].u = (GLfloat) ((UINT16)(it>>16)) * uvScale; // TO-DO: might these be signed? + P.Vert[j].v = (GLfloat) ((UINT16)(it&0xFFFF)) * uvScale; + data += 4; + + // Normalize the vertex normal + mag = sqrt(P.Vert[j].n[0]*P.Vert[j].n[0]+P.Vert[j].n[1]*P.Vert[j].n[1]+P.Vert[j].n[2]*P.Vert[j].n[2]); + P.Vert[j].n[0] /= mag; + P.Vert[j].n[1] /= mag; + P.Vert[j].n[2] /= mag; + } + + // Copy current vertices into previous vertex array + for (i = 0; i < 4; i++) + Prev[i] = P.Vert[i]; + + // Copy this polygon into the model buffer + if (OKAY != InsertPolygon(Cache,&P)) + return FAIL; + + ++numPolys; + } +StopDecoding: + + // Finish model and enter it into the LUT + EndModel(Cache,lutIdx); + + return OKAY; +} + + +/****************************************************************************** + Cache Management +******************************************************************************/ + +// Use this to determine if a model needs to be cached (returns TRUE if so) +BOOL CRender3D::NeedToCache(ModelCache *Cache, int lutIdx) +{ + //if (Cache->dynamic) // never permanently store models in dynamic caches + // return TRUE; + return (Cache->lut[lutIdx]<0) ? TRUE : FALSE; +} + +// Discard all models in the cache and the display list +void CRender3D::ClearModelCache(ModelCache *Cache) +{ + Cache->vboCurOffset = 0; + for (int i = 0; i < 2; i++) + Cache->curVertIdx[i] = 0; + if (!Cache->dynamic) + memset(Cache->lut, 0xFF, sizeof(INT16)*Cache->lutSize); // set all to -1 + else + { + for (int i = 0; i < Cache->numModels; i++) + Cache->lut[Cache->Models[i].lutIdx] = -1; + } + + Cache->numModels = 0; + ClearDisplayList(Cache); +} + +BOOL CRender3D::CreateModelCache(ModelCache *Cache, unsigned vboMaxVerts, + unsigned localMaxVerts, unsigned maxNumModels, unsigned numLUTEntries, + unsigned displayListSize, BOOL isDynamic) +{ + unsigned i; + int vboBytes, localBytes; + BOOL success; + + Cache->dynamic = isDynamic; + + /* + * VBO allocation: + * + * Progressively smaller VBOs, in steps of localMaxVerts are allocated + * until successful. If the size dips below localMaxVerts, localMaxVerts is + * attempted as the final try. + */ + + glGetError(); // clear error flag + glGenBuffers(1, &(Cache->vboID)); + glBindBuffer(GL_ARRAY_BUFFER, Cache->vboID); + + vboBytes = vboMaxVerts*VBO_VERTEX_SIZE*sizeof(GLfloat); + localBytes = localMaxVerts*VBO_VERTEX_SIZE*sizeof(GLfloat); + + // Try allocating until size is + success = FALSE; + while (vboBytes >= localBytes) + { + glBufferData(GL_ARRAY_BUFFER, vboBytes, 0, isDynamic?GL_STREAM_DRAW:GL_STATIC_DRAW); + if (glGetError() == GL_NO_ERROR) + { + success = TRUE; + break; + } + + vboBytes -= localBytes; + } + + if (!success) + { + // Last ditch attempt: try the local buffer size + vboBytes = localBytes; + glBufferData(GL_ARRAY_BUFFER, vboBytes, 0, isDynamic?GL_STREAM_DRAW:GL_STATIC_DRAW); + if (glGetError() != GL_NO_ERROR) + return ErrorLog("OpenGL was unable to provide a %s vertex buffer.", isDynamic?"dynamic":"static"); + } + + DebugLog("%s vertex buffer size: %1.2f MB", isDynamic?"Dynamic":"Static", (float)vboBytes/(float)0x100000); + InfoLog("%s vertex buffer size: %1.2f MB", isDynamic?"Dynamic":"Static", (float)vboBytes/(float)0x100000); + + // Set the VBO to the size we obtained + Cache->vboMaxOffset = vboBytes; + Cache->vboCurOffset = 0; + + // Attempt to allocate space for local VBO + for (i = 0; i < 2; i++) + { + Cache->verts[i] = new(std::nothrow) GLfloat[localMaxVerts*VBO_VERTEX_SIZE]; + Cache->curVertIdx[i] = 0; + } + Cache->maxVertIdx = localMaxVerts; + + // ... model array + Cache->Models = new(std::nothrow) VBORef[maxNumModels]; + Cache->maxModels = maxNumModels; + Cache->numModels = 0; + + // ... LUT + Cache->lut = new(std::nothrow) INT16[numLUTEntries]; + Cache->lutSize = numLUTEntries; + + // ... display list + Cache->List = new(std::nothrow) DisplayList[displayListSize]; + ClearDisplayList(Cache); + Cache->maxListSize = displayListSize; + + // Check if memory allocation succeeded + if ((Cache->verts[0]==NULL) || (Cache->verts[1]==NULL) || (Cache->Models==NULL) || (Cache->lut==NULL) || (Cache->List==NULL)) + { + DestroyModelCache(Cache); + return ErrorLog("Insufficient memory for model cache."); + } + + // Clear LUT (MUST be done here because ClearModelCache() won't do it for dynamic models) + for (i = 0; i < numLUTEntries; i++) + Cache->lut[i] = -1; + + // All good! + return OKAY; +} + +void CRender3D::DestroyModelCache(ModelCache *Cache) +{ + for (int i = 0; i < 2; i++) + { + if (Cache->verts[i] != NULL) + delete [] Cache->verts[i]; + } + if (Cache->Models != NULL) + delete [] Cache->Models; + if (Cache->lut != NULL) + delete [] Cache->lut; + if (Cache->List != NULL) + delete [] Cache->List; + + memset(Cache, 0, sizeof(ModelCache)); +} diff --git a/Graphics/Render.h b/Graphics/Render.h new file mode 100644 index 0000000..cea99d3 --- /dev/null +++ b/Graphics/Render.h @@ -0,0 +1,170 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Render.h + * + * Header file defining the CRender class: container for both the 2D and 3D + * renderers. + */ + +#ifndef INCLUDED_RENDER_H +#define INCLUDED_RENDER_H + +/* + * CRender: + * + * Tile generator graphics engine. This must be constructed and initialized + * before being attached to any objects that want to make use of it. Apart from + * the constructor, all members assume that a global GL device + * context is available and that GL functions may be called. + */ +class CRender2D +{ +public: + /* + * BeginFrame(layerFormats): + * + * Prepare to render a new frame. Must be called once per frame prior to + * drawing anything. + * + * Parameters: + * layerFormats A bit field indicating how to interpret each of the + * four layers: 0=8-bit pixels, 1=4-bit pixels. Bits + * 3-0 correspond to layers 3-0. + */ + void BeginFrame(unsigned layerFormats); + + /* + * EndFrame(void): + * + * Signals the end of rendering for this frame. Must be called last during + * the frame. + */ + void EndFrame(void); + + /* + * WriteVRAM(addr, data): + * + * Indicates what will be written next to the tile generator's RAM. The + * VRAM address must not have yet been updated, to allow the renderer to + * check for changes. Data is accepted in the same form as the tile + * generator: the MSB is what was written to addr+3. This function is + * intended to facilitate on-the-fly decoding of tiles and palette data. + * + * Parameters: + * addr Address in tile generator RAM. Caller must ensure it is + * clamped to the range 0x000000 to 0x11FFFF because this + * function does not. + * data The data to write. + */ + void WriteVRAM(unsigned addr, UINT32 data); + + /* + * AttachRegisters(regPtr): + * + * Attaches tile generator registers. This must be done prior to any + * rendering otherwise the program may crash with an access violation. + * + * Parameters: + * regPtr Pointer to the base of the tile generator registers. + * There are assumed to be 64 in all. + */ + void AttachRegisters(const UINT32 *regPtr); + + /* + * AttachVRAM(vramPtr): + * + * Attaches tile generator RAM. This must be done prior to any rendering + * otherwise the program may crash with an access violation. + * + * Parameters: + * vramPtr Pointer to the base of the tile generator RAM (0x120000 + * bytes). VRAM is assumed to be in little endian format. + */ + void AttachVRAM(const UINT8 *vramPtr); + + /* + * Init(xOffset, yOffset, xRes, yRes): + * + * One-time initialization of the context. Must be called before any other + * members (meaning it should be called even before being attached to any + * other objects that want to use it). + * + * Parameters: + * xOffset X offset within OpenGL display surface in pixels. + * yOffset Y offset. + * xRes Horizontal resolution of display surface in pixels. + * yRes Vertical resolution. + * + * Returns: + * OKAY is successful, otherwise FAILED if a non-recoverable error + * occurred. Prints own error messages. + */ + BOOL Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes); + + /* + * CRender2D(void): + * ~CRender2D(void): + * + * Constructor and destructor. + */ + CRender2D(void); + ~CRender2D(void); + +private: + // Private member functions + void DrawTile4Bit(unsigned tile, UINT32 *buf, unsigned pitch); + void DrawTile8Bit(unsigned tile, UINT32 *buf, unsigned pitch); + void DrawRect(int layerNum, UINT32 *layerSurf, const UINT32 *nameTable, unsigned x, unsigned y, unsigned w, unsigned h); + void UpdateLayer(int layerNum); + void DisplayLayer(int layerNum, GLfloat z, GLfloat scroll); + void Setup2D(void); + + // Data received from tile generator device object + const UINT32 *vram; + const UINT32 *regs; + + // OpenGL data + GLuint texID[4]; // IDs for the 4 layer textures + unsigned xPixels, yPixels; // display surface resolution + unsigned xOffs, yOffs; // offset + + // Shader programs and input data locations + GLuint shaderProgram; // shader program object + GLuint vertexShader; // vertex shader handle + GLuint fragmentShader; // fragment shader + GLuint textureMapLoc; // location of "textureMap" uniform + GLuint bottomLayerLoc; // uniform + + + // Dirty rectangles (non-zero indicates region is dirty) + UINT8 dirty[4][64/DIRTY_RECT_HEIGHT][64/DIRTY_RECT_WIDTH]; + BOOL allDirty; // global dirty flag (forces everything to be updated) + + // Buffers + UINT8 *memoryPool; // all memory is allocated here + UINT32 *surf; // 4 512x512x32bpp pixel surfaces + UINT32 *pal; // 0x20000 byte (32K colors) palette +}; + + +#endif // INCLUDED_RENDER2D_H diff --git a/Graphics/Render2D.cpp b/Graphics/Render2D.cpp new file mode 100644 index 0000000..c644b1e --- /dev/null +++ b/Graphics/Render2D.cpp @@ -0,0 +1,871 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Render2D.cpp + * + * Implementation of the CRender2D class: OpenGL tile generator graphics. + * + * To-Do List + * ---------- + * - Add dirty rectangles? There is already some inactive code in here for + * this purpose and it needs to be updated or deleted once and for all. + * - Are v-scroll values 9 or 10 bits? + * - Add fast paths for no scrolling (including unclipped tile rendering). + * - Inline the loops in the tile renderers. + * - Update description of tile generator before you forget :) + * - A proper shut-down function is needed! OpenGL might not be available when + * the destructor for this class is called. + */ + +#include +#include "Pkgs/glew.h" +#include "Supermodel.h" +#include "Graphics/Shaders2D.h" // fragment and vertex shaders + + +/****************************************************************************** + Definitions and Constants +******************************************************************************/ + +// Shader program files (for use in development builds only) +#define VERTEX_2D_SHADER_FILE "Src/Graphics/Vertex2D.glsl" +#define FRAGMENT_2D_SHADER_FILE "Src/Graphics/Fragment2D.glsl" + + +/****************************************************************************** + Tile Drawing Functions +******************************************************************************/ + +// Draw 4-bit tile line, no clipping performed +void CRender2D::DrawTileLine4BitNoClip(UINT32 *buf, UINT16 tile, int tileLine) +{ + unsigned tileOffset; // offset of tile pattern within VRAM + unsigned palette; // color palette bits obtained from tile + UINT32 pattern; // 8 pattern pixels fetched at once + + // Tile pattern offset: each tile occupies 32 bytes when using 4-bit pixels + tileOffset = ((tile&0x3FFF)<<1) | ((tile>>15)&1); + tileOffset *= 32; + tileOffset /= 4; // VRAM is a UINT32 array + + // Upper color bits; the lower 4 bits come from the tile pattern + palette = tile&0x7FF0; + + // Draw 8 pixels + pattern = vram[tileOffset+tileLine]; + *buf++ = pal[((pattern>>28)&0xF) | palette]; + *buf++ = pal[((pattern>>24)&0xF) | palette]; + *buf++ = pal[((pattern>>20)&0xF) | palette]; + *buf++ = pal[((pattern>>16)&0xF) | palette]; + *buf++ = pal[((pattern>>12)&0xF) | palette]; + *buf++ = pal[((pattern>>8)&0xF) | palette]; + *buf++ = pal[((pattern>>4)&0xF) | palette]; + *buf++ = pal[((pattern>>0)&0xF) | palette]; +} + +// Draw 8-bit tile line, clipped at left edge +void CRender2D::DrawTileLine8BitNoClip(UINT32 *buf, UINT16 tile, int tileLine) +{ + unsigned tileOffset; // offset of tile pattern within VRAM + unsigned palette; // color palette bits obtained from tile + UINT32 pattern; // 4 pattern pixels fetched at once + + tileLine *= 2; // 8-bit pixels, each line is two words + + // Tile pattern offset: each tile occupies 64 bytes when using 8-bit pixels + tileOffset = tile&0x3FFF; + tileOffset *= 64; + tileOffset /= 4; + + // Upper color bits + palette = tile&0x7F00; + + // Draw 4 pixels at a time + pattern = vram[tileOffset+tileLine]; + *buf++ = pal[((pattern>>24)&0xFF) | palette]; + *buf++ = pal[((pattern>>16)&0xFF) | palette]; + *buf++ = pal[((pattern>>8)&0xFF) | palette]; + *buf++ = pal[((pattern>>0)&0xFF) | palette]; + pattern = vram[tileOffset+tileLine+1]; + *buf++ = pal[((pattern>>24)&0xFF) | palette]; + *buf++ = pal[((pattern>>16)&0xFF) | palette]; + *buf++ = pal[((pattern>>8)&0xFF) | palette]; + *buf++ = pal[((pattern>>0)&0xFF) | palette]; +} + + +// Draw 4-bit tile line, clipped at left edge +void CRender2D::DrawTileLine4Bit(UINT32 *buf, int offset, UINT16 tile, int tileLine) +{ + unsigned tileOffset; // offset of tile pattern within VRAM + unsigned palette; // color palette bits obtained from tile + UINT32 pattern; // 8 pattern pixels fetched at once + + // Tile pattern offset: each tile occupies 32 bytes when using 4-bit pixels + tileOffset = ((tile&0x3FFF)<<1) | ((tile>>15)&1); + tileOffset *= 32; + tileOffset /= 4; // VRAM is a UINT32 array + + // Upper color bits; the lower 4 bits come from the tile pattern + palette = tile&0x7FF0; + + // Draw 8 pixels + pattern = vram[tileOffset+tileLine]; + for (int bitPos = 28; bitPos >= 0; bitPos -= 4) + { + if (offset >= 0) + buf[offset] = pal[((pattern>>bitPos)&0xF) | palette]; + ++offset; + } +} + +// Draw 4-bit tile line, clipped at right edge +void CRender2D::DrawTileLine4BitRightClip(UINT32 *buf, int offset, UINT16 tile, int tileLine, int numPixels) +{ + unsigned tileOffset; // offset of tile pattern within VRAM + unsigned palette; // color palette bits obtained from tile + UINT32 pattern; // 8 pattern pixels fetched at once + int bitPos; + + // Tile pattern offset: each tile occupies 32 bytes when using 4-bit pixels + tileOffset = ((tile&0x3FFF)<<1) | ((tile>>15)&1); + tileOffset *= 32; + tileOffset /= 4; // VRAM is a UINT32 array + + // Upper color bits; the lower 4 bits come from the tile pattern + palette = tile&0x7FF0; + + // Draw 8 pixels + pattern = vram[tileOffset+tileLine]; + bitPos = 28; + for (int i = 0; i < numPixels; i++) + { + buf[offset] = pal[((pattern>>bitPos)&0xF) | palette]; + ++offset; + bitPos -= 4; + } +} + +// Draw 8-bit tile line, clipped at left edge +void CRender2D::DrawTileLine8Bit(UINT32 *buf, int offset, UINT16 tile, int tileLine) +{ + unsigned tileOffset; // offset of tile pattern within VRAM + unsigned palette; // color palette bits obtained from tile + UINT32 pattern; // 4 pattern pixels fetched at once + + tileLine *= 2; // 8-bit pixels, each line is two words + + // Tile pattern offset: each tile occupies 64 bytes when using 8-bit pixels + tileOffset = tile&0x3FFF; + tileOffset *= 64; + tileOffset /= 4; + + // Upper color bits + palette = tile&0x7F00; + + // Draw 4 pixels at a time + pattern = vram[tileOffset+tileLine]; + for (int bitPos = 24; bitPos >= 0; bitPos -= 8) + { + if (offset >= 0) + buf[offset] = pal[((pattern>>bitPos)&0xFF) | palette]; + ++offset; + } + + pattern = vram[tileOffset+tileLine+1]; + for (int bitPos = 24; bitPos >= 0; bitPos -= 8) + { + if (offset >= 0) + buf[offset] = pal[((pattern>>bitPos)&0xFF) | palette]; + ++offset; + } +} + +// Draw 8-bit tile line, clipped at right edge +void CRender2D::DrawTileLine8BitRightClip(UINT32 *buf, int offset, UINT16 tile, int tileLine, int numPixels) +{ + unsigned tileOffset; // offset of tile pattern within VRAM + unsigned palette; // color palette bits obtained from tile + UINT32 pattern; // 4 pattern pixels fetched at once + int bitPos; + + tileLine *= 2; // 8-bit pixels, each line is two words + + // Tile pattern offset: each tile occupies 64 bytes when using 8-bit pixels + tileOffset = tile&0x3FFF; + tileOffset *= 64; + tileOffset /= 4; + + // Upper color bits + palette = tile&0x7F00; + + // Draw 4 pixels at a time + pattern = vram[tileOffset+tileLine]; + bitPos = 24; + for (int i = 0; (i < 4) && (i < numPixels); i++) + { + buf[offset] = pal[((pattern>>bitPos)&0xFF) | palette]; + ++offset; + bitPos -= 8; + } + + pattern = vram[tileOffset+tileLine+1]; + bitPos = 24; + for (int i = 0; (i < 4) && (i < numPixels); i++) + { + buf[offset] = pal[((pattern>>bitPos)&0xFF) | palette]; + ++offset; + bitPos -= 8; + } +} + + +/****************************************************************************** + Layer Rendering +******************************************************************************/ + +/* + * DrawCompleteLayer(): + * + * Updates the complete layer. + */ +void CRender2D::DrawCompleteLayer(int layerNum, const UINT16 *nameTableBase) +{ + UINT32 *dest = surf; // destination surface to write to + UINT32 *lineBufferPri = &surf[512*496]; // line buffer for primary and alternate layer + UINT32 *lineBufferAlt = &surf[512*497]; + UINT32 *buf; + const UINT16 *maskTable; // pointer to start of mask table + const UINT16 *hScrollTablePri, *hScrollTableAlt; // pointers to line scroll tables + const UINT16 *nameTablePri = nameTableBase; // primary (this layer) name table + const UINT16 *nameTableAlt = &nameTableBase[64*64]; // alternate layer's name table + const UINT16 *nameTable; + int colorDepthPri, colorDepthAlt; // primary and alternate layer color depths + int hScrollPri, hScrollAlt; // primary and alternate layer scroll offsets + int vScrollPri, vScrollAlt; + int hFullScrollPri, hFullScrollAlt; // full-screen horizontal scroll values (from registers) + int vOffset; // vertical pixel offset within tile + int tx, i, j; + BOOL lineScrollPri, lineScrollAlt; // line scrolling enable/disable + UINT16 mask; + + // Determine layer color depths (1 if 4-bit, 0 if 8-bit) + colorDepthPri = regs[0x20/4] & (1<<(12+layerNum*2)); + colorDepthAlt = regs[0x20/4] & (1<<(12+layerNum*2+1)); + + // Line scroll tables + hScrollTablePri = (UINT16 *) &vram[(0xF6000+layerNum*2*0x400)/4]; + hScrollTableAlt = (UINT16 *) &vram[(0xF6000+layerNum*2*0x400+0x400)/4]; + + // Get correct offset into mask table + maskTable = (UINT16 *) &vram[0xF7000/4]; + if (layerNum == 0) + ++maskTable; // little endian, layer 0 is second word in each pair + + // Load horizontal full-screen scroll values and scroll mode + hFullScrollPri = regs[0x60/4+layerNum*2]&0x3FF; + hFullScrollAlt = regs[0x60/4+layerNum*2+1]&0x3FF; + lineScrollPri = regs[0x60/4+layerNum*2]&0x8000; + lineScrollAlt = regs[0x60/4+layerNum*2+1]&0x8000; + + // Load vertical scroll values + vScrollPri = (regs[0x60/4+layerNum*2]>>16)&0x1FF; + vScrollAlt = (regs[0x60/4+layerNum*2+1]>>16)&0x1FF; + + // Iterate over all displayed lines + for (int y = 0; y < 384; y++) + { + /* + * Draw all tiles from primary layer first. Horizontal scrolling is not + * applied yet, but vertical scrolling is taken into account. An entire + * 512-pixel line is rendered so that it can be scrolled during mixing. + */ + nameTable = &nameTablePri[(64*((y+vScrollPri)/8)) & 0xFFF]; // clamp to 64x64=0x1000 + vOffset = (y+vScrollPri)&7; + buf = lineBufferPri; // output to primary line buffer + for (tx = 0; tx < 64; tx += 4) // 4 tiles at a time (for masking) + { + if (colorDepthPri) //TODO: move this test outside of loop + { + DrawTileLine4BitNoClip(buf, nameTable[1], vOffset); + buf += 8; + DrawTileLine4BitNoClip(buf, nameTable[0], vOffset); + buf += 8; + DrawTileLine4BitNoClip(buf, nameTable[3], vOffset); + buf += 8; + DrawTileLine4BitNoClip(buf, nameTable[2], vOffset); + buf += 8; + } + else + { + DrawTileLine8BitNoClip(buf, nameTable[1], vOffset); + buf += 8; + DrawTileLine8BitNoClip(buf, nameTable[0], vOffset); + buf += 8; + DrawTileLine8BitNoClip(buf, nameTable[3], vOffset); + buf += 8; + DrawTileLine8BitNoClip(buf, nameTable[2], vOffset); + buf += 8; + } + + // Next set of 4 tiles + nameTable += 4; + } + + /* + * Draw the alternate layer wherever the primary layer was masked + */ + nameTable = &nameTableAlt[(64*((y+vScrollAlt)/8))&0xFFF]; + vOffset = (y+vScrollAlt)&7; + buf = lineBufferAlt; // output to alternate line buffer + for (tx = 0; tx < 64; tx += 4) // 4 tiles at a time (for masking) + { + if (colorDepthAlt) //TODO: move this test outside of loop + { + DrawTileLine4BitNoClip(buf, nameTable[1], vOffset); + buf += 8; + DrawTileLine4BitNoClip(buf, nameTable[0], vOffset); + buf += 8; + DrawTileLine4BitNoClip(buf, nameTable[3], vOffset); + buf += 8; + DrawTileLine4BitNoClip(buf, nameTable[2], vOffset); + buf += 8; + } + else + { + DrawTileLine8BitNoClip(buf, nameTable[1], vOffset); + buf += 8; + DrawTileLine8BitNoClip(buf, nameTable[0], vOffset); + buf += 8; + DrawTileLine8BitNoClip(buf, nameTable[3], vOffset); + buf += 8; + DrawTileLine8BitNoClip(buf, nameTable[2], vOffset); + buf += 8; + } + + // Next set of 4 tiles + nameTable += 4; + } + + /* + * Mix the two layers into the current line under control of the + * stencil mask, applying scrolling in the process. + */ + + // Load horizontal scroll values + if (lineScrollPri) + hScrollPri = hScrollTablePri[y]; + else + hScrollPri = hFullScrollPri; + if (lineScrollAlt) + hScrollAlt = hScrollTableAlt[y]; + else + hScrollAlt = hFullScrollAlt; + + // Mix first 60 tiles (4 at a time) + mask = *maskTable; + i = hScrollPri&511; // primary line index + j = hScrollAlt&511; // alternate line index + for (tx = 0; tx < 60; tx += 4) + { + if ((mask&0x8000)) // copy tiles from primary layer + { + if (i <= (512-32)) // safe to use memcpy for fast blit? + { + memcpy(dest, &lineBufferPri[i], 32*sizeof(UINT32)); + i += 32; + dest += 32; + } + else // slow copy, wrap line boundary + { + for (int k = 0; k < 32; k++) + { + i &= 511; + *dest++ = lineBufferPri[i++]; + } + } + j += 32; // update alternate pointer as well + } + else // copy tiles from alternate layer + { + if (j <= (512-32)) + { + memcpy(dest, &lineBufferAlt[j], 32*sizeof(UINT32)); + j += 32; + dest += 32; + } + else + { + for (int k = 0; k < 32; k++) + { + j &= 511; + *dest++ = lineBufferAlt[j++]; + } + } + + i += 32; // update primary + } + + mask <<= 1; + } + + // Mix last two tiles + if ((mask&0x8000)) // copy tiles from primary layer + { + for (int k = 0; k < 16; k++) + { + i &= 511; + *dest++ = lineBufferPri[i++]; + } + } + else // copy from alternate + { + for (int k = 0; k < 16; k++) + { + j &= 511; + *dest++ = lineBufferAlt[j++]; + } + } + + // Next line + maskTable += 2; // next mask line + } + + // Upload + glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 496, 384, GL_RGBA, GL_UNSIGNED_BYTE, surf); +} + + +/* + * DrawRect(): + * + * Draws a rectangular portion of the given layer and uploads it. Scrolling is + * applied but the result must be clipped against the rectangular window + * defined here by tileX, tileY, tileW, and tileH. + * + * Clipping for the right side is not checked, which will always work as long + * as the X and Y tile positions never exceed 61 and 47, respectively (the + * dimensions of the physical display; there is border space because the + * layers are 64x64). + * + * Parameters: + * layerNum Layer number (0 or 1). + * nameTableBase Pointer to the layer's name table. + * tileX Position of upper-left corner of rectangle on the + * screen, in units of 8-pixel tiles (0-61). + * tileY "" (0-47) + * tileW Width of rectangular region in tiles. + * tileH "" (height) + */ + void CRender2D::DrawRect(int layerNum, const UINT16 *nameTableBase, int tileX, int tileY, int tileW, int tileH) +{ + UINT32 *dest = surf; // destination surface to write to + const UINT16 *maskTable; // pointer to start of mask table + const UINT16 *hScrollTablePri, *hScrollTableAlt; // pointers to line scroll tables + const UINT16 *nameTablePri = nameTableBase; // primary (this layer) name table + const UINT16 *nameTableAlt = &nameTableBase[64*64]; // alternate layer's name table + const UINT16 *nameTable; + int colorDepthPri, colorDepthAlt; // primary and alternate layer color depths + int hScrollPri, hScrollAlt; // primary and alternate layer scroll offsets + int vScrollPri, vScrollAlt; + int hFullScrollPri, hFullScrollAlt; // full-screen horizontal scroll values (from registers) + int hOffset, vOffset; // pixel offsets + int ntOffset; // offset in name table + int tx; + BOOL lineScrollPri, lineScrollAlt; // line scrolling enable/disable + UINT16 mask; + + // Determine layer color depths (1 if 4-bit, 0 if 8-bit) + colorDepthPri = regs[0x20/4] & (1<<(12+layerNum*2)); + colorDepthAlt = regs[0x20/4] & (1<<(12+layerNum*2+1)); + + // Line scroll tables + hScrollTablePri = (UINT16 *) &vram[(0xF6000+layerNum*2*0x400)/4]; + hScrollTableAlt = (UINT16 *) &vram[(0xF6000+layerNum*2*0x400+0x400)/4]; + + // Get correct offset into mask table + maskTable = (UINT16 *) &vram[0xF7000/4]; + if (layerNum == 0) + ++maskTable; // little endian, layer 0 is second word in each pair + + // Load horizontal full-screen scroll values and scroll mode + hFullScrollPri = regs[0x60/4+layerNum*2]&0x3FF; + hFullScrollAlt = regs[0x60/4+layerNum*2+1]&0x3FF; + lineScrollPri = regs[0x60/4+layerNum*2]&0x8000; + lineScrollAlt = regs[0x60/4+layerNum*2+1]&0x8000; + + // Load vertical scroll values + vScrollPri = (regs[0x60/4+layerNum*2]>>16)&0x3FF; + vScrollAlt = (regs[0x60/4+layerNum*2+1]>>16)&0x3FF; + + // Iterate over actual line on screen + for (int y = tileY*8; y < (tileY+tileH)*8; y++) + { + + // Load horizontal scroll values + if (lineScrollPri) + hScrollPri = hScrollTablePri[y]; + else + hScrollPri = hFullScrollPri; + if (lineScrollAlt) + hScrollAlt = hScrollTableAlt[y]; + else + hScrollAlt = hFullScrollAlt; + + /* + * Draw all tiles from primary layer first + */ + + // Compute scroll offsets into name table and destination + hOffset = -(hScrollPri&7); + vOffset = (y+vScrollPri)&7; + ntOffset = tileX+hScrollPri/8; + + // Advance name table to our line (prior to h-scrolling) + nameTable = &nameTablePri[64*((y+vScrollPri)/8) & 0xFFF]; // clamp to 64x64=0x1000 + + // Each bit in the mask table corresponds to 4 tiles + mask = maskTable[y*2]; + + // Render a line! + //TODO: add one if scrolling + for (tx = 0; tx < tileW; tx++) + { + if ( ((mask<<((tileX+tx)/4)) & 0x8000) ) + { + if (colorDepthPri) + DrawTileLine4Bit(dest, hOffset, nameTable[(ntOffset^1)&63], vOffset); // make sure ^1 belongs inside parenthesis... + else + DrawTileLine8Bit(dest, hOffset, nameTable[(ntOffset^1)&63], vOffset); + } + hOffset += 8; + ntOffset++; + } + + // When scrolling, extra tile must be rendered at right edge of region + if ( ((mask<<((tileX+tx)/4)) & 0x8000) ) // re-use the last mask bit (mask doesn't scroll) + { + if (colorDepthPri) + DrawTileLine4BitRightClip(dest, hOffset, nameTable[(ntOffset^1)&63], vOffset, hScrollPri&7); + else + DrawTileLine8BitRightClip(dest, hOffset, nameTable[(ntOffset^1)&63], vOffset, hScrollPri&7); + } + + /* + * Draw the alternate layer wherever the primary layer was masked + */ + + hOffset = -(hScrollAlt&7); + vOffset = (y+vScrollAlt)&7; + ntOffset = tileX+hScrollAlt/8; + nameTable = &nameTableAlt[64*((y+vScrollAlt)/8)]; + mask = maskTable[y*2]; + for (tx = 0; tx < tileW; tx++) + { + if (0 == ((mask<<((tileX+tx)/4)) & 0x8000)) + { + if (colorDepthAlt) + DrawTileLine4Bit(dest, hOffset, nameTable[(ntOffset^1)&63], vOffset); + else + DrawTileLine8Bit(dest, hOffset, nameTable[(ntOffset^1)&63], vOffset); + } + hOffset += 8; + ntOffset++; + } + + // When scrolling, extra tile must be rendered at right edge of region + if (0 == ((mask<<((tileX+tx)/4)) & 0x8000)) // re-use the last mask bit (mask doesn't scroll) + { + if (colorDepthAlt) + DrawTileLine4BitRightClip(dest, hOffset, nameTable[(ntOffset^1)&63], vOffset, hScrollAlt&7); + else + DrawTileLine8BitRightClip(dest, hOffset, nameTable[(ntOffset^1)&63], vOffset, hScrollAlt&7); + } + + // Next line + dest += tileW*8; // image surface is only as wide as the rectangle we're updating + } + + // Upload + glTexSubImage2D(GL_TEXTURE_2D, 0, tileX*8, tileY*8, tileW*8, tileH*8, GL_RGBA, GL_UNSIGNED_BYTE, surf); +} + +// Updates any changed portions of a layer +void CRender2D::UpdateLayer(int layerNum) +{ + glBindTexture(GL_TEXTURE_2D, texID[layerNum]); + + allDirty = TRUE; + if (allDirty) + { + // If everything is dirty, update the whole thing at once + DrawCompleteLayer(layerNum, (UINT16 *) &vram[(0xF8000+layerNum*2*0x2000)/4]); + //DrawRect(layerNum, (UINT16 *) &vram[(0xF8000+layerNum*2*0x2000)/4], 0, 0, 62, 48); + memset(dirty, 0, sizeof(dirty)); + } + else + { + // Otherwise, for now, use a dumb approach that updates each rectangle individually + for (int y = 0; y < 64/DIRTY_RECT_HEIGHT; y++) + { + for (int x = 0; x < 48/DIRTY_RECT_WIDTH; x++) + { + if (dirty[layerNum][y][x]) + { + DrawRect(layerNum, (UINT16 *) &vram[(0xF8000+layerNum*2*0x2000)/4], x*DIRTY_RECT_WIDTH, y*DIRTY_RECT_HEIGHT, DIRTY_RECT_WIDTH, DIRTY_RECT_HEIGHT); + dirty[layerNum][y][x] = 0; // not dirty anymore + } + } + } + } +} + + +/****************************************************************************** + Frame Display Functions +******************************************************************************/ + +// Draws a layer to the screen +void CRender2D::DisplayLayer(int layerNum, GLfloat z) +{ + glBindTexture(GL_TEXTURE_2D, texID[layerNum]); + glBegin(GL_QUADS); + glTexCoord2f(0.0f/512.0f, 0.0f); glVertex3f(0.0f, 0.0f, z); + glTexCoord2f(496.0f/512.0f, 0.0f); glVertex3f(1.0f, 0.0f, z); + glTexCoord2f(496.0f/512.0f, 384.0f/512.0f); glVertex3f(1.0f, 1.0f, z); + glTexCoord2f(0.0f/512.0f, 384.0f/512.0f); glVertex3f(0.0f, 1.0f, z); + glEnd(); +} + +// Set up viewport and OpenGL state for 2D rendering (sets up blending function but disables blending) +void CRender2D::Setup2D(void) +{ + // Set up the viewport and orthogonal projection + glViewport(xOffs, yOffs, xPixels, yPixels); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluOrtho2D(0.0, 1.0, 1.0, 0.0); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + // Enable texture mapping and blending + glEnable(GL_TEXTURE_2D); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_REPLACE); + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); // alpha of 1.0 is opaque, 0 is transparent + glDisable(GL_BLEND); + + // Disable Z-buffering + glDisable(GL_DEPTH_TEST); + + // Shader program + glUseProgram(shaderProgram); +} + +// Convert color offset register data to RGB +void CRender2D::ColorOffset(GLfloat colorOffset[3], UINT32 reg) +{ + INT8 ir, ig, ib; + + ib = (reg>>16)&0xFF; + ig = (reg>>8)&0xFF; + ir = (reg>>0)&0xFF; + + /* + * Uncertain how these should be interpreted. It appears to be signed, + * which means the values range from -128 to +127. The division by 128 + * normalizes this to roughly -1,+1. + */ + colorOffset[0] = (GLfloat) ir * (1.0f/128.0f); + colorOffset[1] = (GLfloat) ig * (1.0f/128.0f); + colorOffset[2] = (GLfloat) ib * (1.0f/128.0f); + //printf("%08X -> %g,%g,%g\n", reg, colorOffset[2], colorOffset[1], colorOffset[0]); +} + +// Bottom layers +void CRender2D::BeginFrame(void) +{ + GLfloat colorOffset[3]; + + // Update all layers + for (int i = 0; i < 2; i++) + { + UpdateLayer(i); + } + allDirty = FALSE; + + // Draw bottom layer + Setup2D(); + ColorOffset(colorOffset, regs[0x44/4]); + glUniform3fv(colorOffsetLoc, 1, colorOffset); + DisplayLayer(1, 0.0); +} + +// Top layers +void CRender2D::EndFrame(void) +{ + GLfloat colorOffset[3]; + + // Draw top layer + Setup2D(); + glEnable(GL_BLEND); + ColorOffset(colorOffset, regs[0x40/4]); + glUniform3fv(colorOffsetLoc, 1, colorOffset); + DisplayLayer(0, -0.5); +} + + +/****************************************************************************** + Emulation Callbacks +******************************************************************************/ + +void CRender2D::WriteVRAM(unsigned addr, UINT32 data) +{ + unsigned color; + UINT8 r, g, b, a; + + if (vram[addr/4] == data) // do nothing if no changes + return; + + // For now, mark everything as dirty + allDirty = TRUE; + + // Palette + if (addr >= 0x100000) + { + color = (addr-0x100000)/4; // color index + a = 0xFF * ((data>>15)&1); // decode the RGBA (make alpha 0xFF or 0x00) + a = ~a; // invert it (set on Model 3 means clear pixel) + if ((data&0x8000)) + r = g = b = 0; + else + { + b = (data>>7)&0xF8; + g = (data>>2)&0xF8; + r = (data<<3)&0xF8; + } + pal[color] = (a<<24)|(b<<16)|(g<<8)|r; + } +} + + +/****************************************************************************** + Configuration, Initialization, and Shutdown +******************************************************************************/ + +void CRender2D::AttachRegisters(const UINT32 *regPtr) +{ + regs = regPtr; + DebugLog("Render2D attached registers\n"); +} + +void CRender2D::AttachVRAM(const UINT8 *vramPtr) +{ + vram = (UINT32 *) vramPtr; + DebugLog("Render2D attached VRAM\n"); +} + +#define MEMORY_POOL_SIZE (512*512*4+0x20000) + +BOOL CRender2D::Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes) +{ + float memSizeMB = (float)MEMORY_POOL_SIZE/(float)0x100000; + + // Load shaders + if (OKAY != LoadShaderProgram(&shaderProgram,&vertexShader,&fragmentShader,NULL,NULL,vertexShaderSource,fragmentShaderSource)) + return FAIL; + + // Get locations of the uniforms + glUseProgram(shaderProgram); // bind program + textureMapLoc = glGetUniformLocation(shaderProgram, "textureMap"); + glUniform1i(textureMapLoc,0); // attach it to texture unit 0 + colorOffsetLoc = glGetUniformLocation(shaderProgram, "colorOffset"); + + // Allocate memory for layer surfaces and palette + memoryPool = new(std::nothrow) UINT8[MEMORY_POOL_SIZE]; + if (NULL == memoryPool) + return ErrorLog("Insufficient memory for tile layer surfaces (need %1.1f MB).", memSizeMB); + memset(memoryPool,0,MEMORY_POOL_SIZE); + + // Set up pointers to memory regions + surf = (UINT32 *) memoryPool; + pal = (UINT32 *) &memoryPool[512*512*4]; + + // Resolution + xPixels = xRes; + yPixels = yRes; + xOffs = xOffset; + yOffs = yOffset; + + // Clear textures and dirty rectangles (all memory) + memset(memoryPool, 0, MEMORY_POOL_SIZE); + memset(dirty, 0, sizeof(dirty)); + allDirty = TRUE; + + // Create textures + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glGenTextures(2, texID); + for (int i = 0; i < 2; i++) + { + glBindTexture(GL_TEXTURE_2D, texID[i]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 512, 512, 0, GL_RGBA, GL_UNSIGNED_BYTE, surf); + if (glGetError() != GL_NO_ERROR) + return ErrorLog("OpenGL was unable to provide 512x512-texel texture maps for tile map layers."); + } + + DebugLog("Render2D initialized (allocated %1.1f MB)\n", memSizeMB); + return OKAY; +} + +CRender2D::CRender2D(void) +{ + xPixels = 496; + yPixels = 384; + xOffs = 0; + yOffs = 0; + + memoryPool = NULL; + vram = NULL; + surf = NULL; + + DebugLog("Built Render2D\n"); +} + +CRender2D::~CRender2D(void) +{ + DestroyShaderProgram(shaderProgram,vertexShader,fragmentShader); + glDeleteTextures(2, texID); + + if (memoryPool != NULL) + { + delete [] memoryPool; + memoryPool = NULL; + } + + surf = NULL; + vram = NULL; + + DebugLog("Destroyed Render2D\n"); +} diff --git a/Graphics/Render2D.h b/Graphics/Render2D.h new file mode 100644 index 0000000..9a36d4e --- /dev/null +++ b/Graphics/Render2D.h @@ -0,0 +1,177 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Render2D.h + * + * Header file defining the CRender2D class: OpenGL tile generator graphics. + */ + +#ifndef INCLUDED_RENDER2D_H +#define INCLUDED_RENDER2D_H + +#include "Pkgs/glew.h" + + +// Dirty rectangle size, must be multiples of 4 because masking code relies on this +#define DIRTY_RECT_WIDTH 8 // width of a dirty rectangle in 8-pixel tiles (multiples of 4, divisible into 64) +#define DIRTY_RECT_HEIGHT 8 // height (multiples of 4, divisible into 48) + +/* + * CRender2D: + * + * Tile generator graphics engine. This must be constructed and initialized + * before being attached to any objects that want to make use of it. Apart from + * the constructor, all members assume that a global GL device + * context is available and that GL functions may be called. + */ +class CRender2D +{ +public: + /* + * BeginFrame(void): + * + * Prepare to render a new frame. Must be called once per frame prior to + * drawing anything. + */ + void BeginFrame(void); + + /* + * EndFrame(void): + * + * Signals the end of rendering for this frame. Must be called last during + * the frame. + */ + void EndFrame(void); + + /* + * WriteVRAM(addr, data): + * + * Indicates what will be written next to the tile generator's RAM. The + * VRAM address must not have yet been updated, to allow the renderer to + * check for changes. Data is accepted in the same form as the tile + * generator: the MSB is what was written to addr+3. This function is + * intended to facilitate on-the-fly decoding of tiles and palette data. + * + * Parameters: + * addr Address in tile generator RAM. Caller must ensure it is + * clamped to the range 0x000000 to 0x11FFFF because this + * function does not. + * data The data to write. + */ + void WriteVRAM(unsigned addr, UINT32 data); + + /* + * AttachRegisters(regPtr): + * + * Attaches tile generator registers. This must be done prior to any + * rendering otherwise the program may crash with an access violation. + * + * Parameters: + * regPtr Pointer to the base of the tile generator registers. + * There are assumed to be 64 in all. + */ + void AttachRegisters(const UINT32 *regPtr); + + /* + * AttachVRAM(vramPtr): + * + * Attaches tile generator RAM. This must be done prior to any rendering + * otherwise the program may crash with an access violation. + * + * Parameters: + * vramPtr Pointer to the base of the tile generator RAM (0x120000 + * bytes). VRAM is assumed to be in little endian format. + */ + void AttachVRAM(const UINT8 *vramPtr); + + /* + * Init(xOffset, yOffset, xRes, yRes); + * + * One-time initialization of the context. Must be called before any other + * members (meaning it should be called even before being attached to any + * other objects that want to use it). + * + * Parameters: + * xOffset X offset within OpenGL display surface in pixels. + * yOffset Y offset. + * xRes Horizontal resolution of display surface in pixels. + * yRes Vertical resolution. + * + * Returns: + * OKAY is successful, otherwise FAILED if a non-recoverable error + * occurred. Prints own error messages. + */ + BOOL Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes); + + /* + * CRender2D(void): + * ~CRender2D(void): + * + * Constructor and destructor. + */ + CRender2D(void); + ~CRender2D(void); + +private: + // Private member functions + void DrawTileLine8BitNoClip(UINT32 *buf, UINT16 tile, int tileLine); + void DrawTileLine4BitNoClip(UINT32 *buf, UINT16 tile, int tileLine); + void DrawTileLine4Bit(UINT32 *buf, int offset, UINT16 tile, int tileLine); + void DrawTileLine4BitRightClip(UINT32 *buf, int offset, UINT16 tile, int tileLine, int numPixels); + void DrawTileLine8Bit(UINT32 *buf, int offset, UINT16 tile, int tileLine); + void DrawTileLine8BitRightClip(UINT32 *buf, int offset, UINT16 tile, int tileLine, int numPixels); + void DrawCompleteLayer(int layerNum, const UINT16 *nameTableBase); + void DrawRect(int layerNum, const UINT16 *nameTableBase, int tileX, int tileY, int tileW, int tileH); + void UpdateLayer(int layerNum); + void DisplayLayer(int layerNum, GLfloat z); + void Setup2D(void); + void ColorOffset(GLfloat colorOffset[3], UINT32 reg); + + // Data received from tile generator device object + const UINT32 *vram; + const UINT32 *regs; + + // OpenGL data + GLuint texID[2]; // IDs for the 2 layer textures + unsigned xPixels, yPixels; // display surface resolution + unsigned xOffs, yOffs; // offset + + // Shader programs and input data locations + GLuint shaderProgram; // shader program object + GLuint vertexShader; // vertex shader handle + GLuint fragmentShader; // fragment shader + GLuint textureMapLoc; // location of "textureMap" uniform + GLuint colorOffsetLoc; // uniform + + + // Dirty rectangles (non-zero indicates region is dirty) + UINT8 dirty[2][64/DIRTY_RECT_HEIGHT][48/DIRTY_RECT_WIDTH]; + BOOL allDirty; // global dirty flag (forces everything to be updated) + + // Buffers + UINT8 *memoryPool; // all memory is allocated here + UINT32 *surf; // 512x512x32bpp pixel surface + UINT32 *pal; // 0x20000 byte (32K colors) palette +}; + + +#endif // INCLUDED_RENDER2D_H diff --git a/Graphics/Render3D.cpp b/Graphics/Render3D.cpp new file mode 100644 index 0000000..ab3d284 --- /dev/null +++ b/Graphics/Render3D.cpp @@ -0,0 +1,1388 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Render3D.cpp + * + * Core module for OpenGL-based Real3D graphics engine. + * + * + * Optimization To-Do List + * ----------------------- + * + * 1. Do not store matrices in a uniform, use glLoadMatrix() in MODELVIEW mode. + * It will no longer be necessary to compute normal matrix! + * 2. Move stuff into vertex shader (vision by 2048? Subtract of 0.5,0.5 for bilinear filtering?) + * 3. Just one call to BufferSubData rather than 2 + * + * Spotlight + * --------- + * + * Spotlight illumination occurs between two Z ranges within an ellipse + * specified in coordinates that ought to be relative to the viewport. They + * actually appear to be defined in terms of physical display coordinates + * regardless of the size of the viewport, although this has not been 100% + * confirmed. + * + * The parameters that describe the ellipse in display coordinates are: + * + * cx,cy Center point. + * a,b Width (or rather, half-width) and height of spotlight. + * + * These correspond to the standard form of the ellipse equation: + * + * ((x-cx)/a)^2 + ((y-cy)/b)^2 = 1 + * + * It is trivial to test whether a point lies inside an ellipse by plugging + * it into the equation and checking to see if it is less than or equal to + * 1. The a and b parameters appear to be stored as values w and h, which + * range from 0 to 255 (according to the Scud Race debug menu) but which + * may be up to 16 bits (this has not been observed). They are already + * inverted, scaled by the screen size, and squared. + * + * w = (496/a)^2 -> a = 496/sqrt(w) + * h = (384/b)^2 -> b = 384/sqrt(h) + * + * This is mostly a guess. It is almost certain, however, based on + * observations of the Scud Race backfire effect that w and h are related + * to spotlight size in an inverse-square-root fashion. The spotlight in + * view 3 should be smaller than in view 4, but the values are actually + * larger. Here is some data: + * + * View 3: + * X,Y=247,342 + * W,H=24,16 + * N,F=1e-9,200 + * Car translation length: 4.93 + * View 4: + * X,Y=247,317 + * W,H=48,32 + * N,F=1e-9,200 + * Car translation length: 7.5 + * + * The translation length is the total translation vector for the car model + * extracted by applying the scene matrices. Note that sqrt(48/24) = 1.4 + * and 7.5/4.93 = 1.52, a fairly close match. + * + * It remains unknown whether the spotlight parameters are relative to the + * physical display resolution (496x384), as computed here, or the viewport + * size. What is needed is an example of a spotlight in a viewport whose + * dimensions are not 496x384. + * + * The spotlight near and far ranges are in viewspace (eye) coordinates. + * The inverse of the near range is specified and the far range is stored + * as a displacement (I think) from the near range. Color is RGB111. + * + * The spotlight should be smooth at the edges. Using the magnitude of the + * ellipse test works well -- when it is 1.0, the spotlight should be fully + * attenuated (0 intensity) and when it is 0.0, render at full intensity. + * + * Alpha Processing + * ---------------- + * When processing "alpha" (translucent) polygons, alpha values range from 0.0, + * completely transparent, to 1.0, completely opaque. This appears to be the + * same convention as for Model 3 and corresponds to a blend mode setting of: + * glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA). + * + * For all texels and colors which do not include an alpha channel, for + * translucency to work properly, the alpha channel must be set to opaque. + * Contour textures use T=1 to indicate transparency, therefore their alpha + * value must be inverted. + * + * Translucent Polygons + * -------------------- + * The 32-level polygon translucency appears to be applied as follows + * + * 1. If polygon is untextured, fragment color is the polygon color and + * the translucency level becomes the alpha channel. + * 2. If contour textures are used, the translucency level becomes the + * alpha channel regardless of the contour bit. I assume that contour + * bit processing is still carried out, if enabled, however. + * 3. If the texture format is RGBA4, translucency is multiplied by texel + * alpha. + * 4. Other texture formats: ??? + * + * A simple way to handle this is to force alpha to 1.0 for polygon colors, + * discard fragments if required by the contour setting (forcing alpha to 1.0 + * otherwise), and then in the end, multiplying whatever alpha value remains by + * the translucency level. + * + * List of Safeguards + * ------------------ + * During boot-up, many games load up scene data that cannot feasibly be + * processed (way too many models). This occurs in Scud Race and Virtual On 2, + * for example. This is currently being handled by attempting to detect the + * defective scenes. + * + * 1. Scud Race: the coordinate system matrix is checked for vectors whose + * magnitudes are not 1.0. + * 2. Virtual On 2: model 0x200000 is not rendered. + * + * There are probably better ways of doing it. + * + * To-Do List + * ---------- + * - Can some of the floating point flag attribs be replaced with ints? + */ + +#include +#include "Supermodel.h" +#include "Graphics/Shaders3D.h" // fragment and vertex shaders + +// Microsoft doesn't provide isnan() and isinf() +#ifdef _MSC_VER + #include + #define ISNAN(x) (_isnan(x)) + #define ISINF(x) (!_finite(x)) +#else + #define ISNAN(x) (std::isnan(x)) + #define ISINF(x) (std::isinf(x)) +#endif + + +/****************************************************************************** + Definitions and Constants +******************************************************************************/ + +// Shader program files +#define VERTEX_SHADER_FILE "Src/Graphics/Vertex.glsl" +#define FRAGMENT_SHADER_FILE "Src/Graphics/Fragment.glsl" + +// Model cache settings +#define NUM_STATIC_VERTS 700000 // suggested maximum number of static vertices +#define NUM_DYNAMIC_VERTS 64000 // "" dynamic vertices +#define NUM_LOCAL_VERTS 32768 // size of local vertex buffer +#define NUM_STATIC_MODELS 10000 // maximum number of unique static models to cache +#define NUM_DYNAMIC_MODELS 1024 // maximum number of unique dynamic models to cache +#define NUM_DISPLAY_LIST_ITEMS 10000 // maximum number of model instances displayed per frame + +// Scene traversal stack +#define STACK_SIZE 1024 + + +/****************************************************************************** + Texture Management +******************************************************************************/ + +void CRender3D::DecodeTexture(int format, int x, int y, int width, int height) +{ + int xi, yi, i; + UINT16 texel; + GLfloat c, a; + + if ((x+width)>2048 || (y+height)>2048) + return; + if (width > 512 || height > 512) + { + //ErrorLog("Encountered a texture that is too large (%d,%d,%d,%d)", x, y, width, height); + return; + } + + // Check to see if ALL texture tiles have been properly decoded + if ((textureFormat[y/32][x/32]==format) && (textureWidth[y/32][x/32]>=width) && (textureHeight[y/32][x/32]>=height)) + return; + + // Copy and decode + i = 0; + switch (format) + { + default: + case 0: // T1RGB5 + for (yi = y; yi < (y+height); yi++) + { + for (xi = x; xi < (x+width); xi++) + { + textureBuffer[i++] = (GLfloat) ((textureRAM[yi*2048+xi]>>10)&0x1F) * (1.0f/31.0f); // R + textureBuffer[i++] = (GLfloat) ((textureRAM[yi*2048+xi]>>5)&0x1F) * (1.0f/31.0f); // G + textureBuffer[i++] = (GLfloat) ((textureRAM[yi*2048+xi]>>0)&0x1F) * (1.0f/31.0f); // B + textureBuffer[i++] = ((textureRAM[yi*2048+xi]&0x8000)?0.0f:1.0f); // T + } + } + break; + + case 7: // RGBA4 + for (yi = y; yi < (y+height); yi++) + { + for (xi = x; xi < (x+width); xi++) + { + textureBuffer[i++] = (GLfloat) ((textureRAM[yi*2048+xi]>>12)&0xF) * (1.0f/15.0f); // R + textureBuffer[i++] = (GLfloat) ((textureRAM[yi*2048+xi]>>8)&0xF) * (1.0f/15.0f); // G + textureBuffer[i++] = (GLfloat) ((textureRAM[yi*2048+xi]>>4)&0xF) * (1.0f/15.0f); // B + textureBuffer[i++] = (GLfloat) ((textureRAM[yi*2048+xi]>>0)&0xF) * (1.0f/15.0f); // A + } + } + break; + + case 5: // 8-bit grayscale + for (yi = y; yi < (y+height); yi++) + { + for (xi = x; xi < (x+width); xi++) + { + /* + texel = textureRAM[yi*2048+xi]; + c = (GLfloat) (texel&0xFF) * (1.0f/255.0f); + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = 1.0; + */ + // Interpret as 8-bit grayscale + texel = textureRAM[yi*2048+xi]; + c = (GLfloat) texel * (1.0f/255.0f); + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = 1.0f; + } + } + + break; + + + case 4: // 8-bit, L4A4 + + for (yi = y; yi < (y+height); yi++) + { + for (xi = x; xi < (x+width); xi++) + { + texel = textureRAM[yi*2048+xi]; + //c = (GLfloat) (~texel&0x0F) * (1.0f/15.0f); + //a = (GLfloat) ((texel>>4)&0xF) * (1.0f/15.0f); + c = (GLfloat) ((texel>>4)&0xF) * (1.0f/15.0f); // seems to work better in Lost World (raptor shadows) + a = (GLfloat) (texel&0xF) * (1.0f/15.0f); + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = a; + } + } + + break; + + case 6: // 8-bit grayscale? (How does this differ from format 5? Alpha values?) + for (yi = y; yi < (y+height); yi++) + { + for (xi = x; xi < (x+width); xi++) + { + /* + texel = textureRAM[yi*2048+xi]; + c = (GLfloat) ((texel>>4)&0xF) * (1.0f/15.0f); + a = (GLfloat) (texel&0xF) * (1.0f/15.0f); + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = a; + */ + texel = textureRAM[yi*2048+xi]&0xFF; + c = (GLfloat) texel * (1.0f/255.0f); + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = 1.0f; + + } + } + break; + + case 2: // Unknown (all 16 bits appear present in Daytona 2, but only lower 8 bits in Le Mans 24) + for (yi = y; yi < (y+height); yi++) + { + for (xi = x; xi < (x+width); xi++) + { + texel = textureRAM[yi*2048+xi]; + a = (GLfloat) ((texel>>4)&0xF) * (1.0f/15.0f); + c = (GLfloat) (texel&0xF) * (1.0f/15.0f); + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = a; + + //printf("%04X\n", textureRAM[yi*2048+xi]); + /* + texel = textureRAM[yi*2048+xi]&0xFF; + c = (GLfloat) texel * (1.0f/255.0f); + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = 1.0f; + */ + } + } + break; + + case 3: // Interleaved A4L4 (high byte) + for (yi = y; yi < (y+height); yi++) + { + for (xi = x; xi < (x+width); xi++) + { + texel = textureRAM[yi*2048+xi]>>8; + c = (GLfloat) (texel&0xF) * (1.0f/15.0f); + a = (GLfloat) (texel>>4) * (1.0f/15.0f); + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = a; + } + } + break; + + case 1: // Interleaved A4L4 (low byte) + for (yi = y; yi < (y+height); yi++) + { + for (xi = x; xi < (x+width); xi++) + { + // Interpret as A4L4 + texel = textureRAM[yi*2048+xi]&0xFF; + c = (GLfloat) (texel&0xF) * (1.0f/15.0f); + a = (GLfloat) (texel>>4) * (1.0f/15.0f); + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = c; + textureBuffer[i++] = a; + } + } + break; + } + + // Upload the texture + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glBindTexture(GL_TEXTURE_2D, texID); + glTexSubImage2D(GL_TEXTURE_2D, 0, x, y, width, height, GL_RGBA, GL_FLOAT, textureBuffer); + + // Mark as decoded + textureFormat[y/32][x/32] = format; + textureWidth[y/32][x/32] = width; + textureHeight[y/32][x/32] = height; +} + +// Signals that new textures have been uploaded. Flushes model caches. Be careful not to exceed bounds! +void CRender3D::UploadTextures(unsigned x, unsigned y, unsigned width, unsigned height) +{ + unsigned xi, yi; + + // debug: make everything red + for (int i = 0; i < 512*512; ) + { + textureBuffer[i++] = 1.0f; + textureBuffer[i++] = 0.0f; + textureBuffer[i++] = 0.0f; + textureBuffer[i++] = 1.0f; + } + + for (xi = x/32; xi < (x+width)/32; xi++) + for (yi = y/32; yi < (y+height)/32; yi++) + { + textureFormat[yi][xi] = -1; + textureWidth[yi][xi] = -1; + textureHeight[yi][xi] = -1; + } + + ClearModelCache(&VROMCache); + ClearModelCache(&PolyCache); +} + + +/****************************************************************************** + Real3D Address Translation + + Functions that interpret word-granular Real3D addresses and return pointers. +******************************************************************************/ + +// Translates 24-bit culling RAM addresses +const UINT32 *CRender3D::TranslateCullingAddress(UINT32 addr) +{ + addr &= 0x00FFFFFF; // caller should have done this already + + if ((addr>=0x800000) && (addr<0x840000)) + return &cullingRAMHi[addr&0x3FFFF]; + else if (addr < 0x100000) + return &cullingRAMLo[addr]; + +#ifdef DEBUG + ErrorLog("TranslateCullingAddress(): invalid address: %06X", addr); +#endif + return NULL; +} + +// Translates model references +const UINT32 *CRender3D::TranslateModelAddress(UINT32 modelAddr) +{ + modelAddr &= 0x00FFFFFF; // caller should have done this already + + if (modelAddr < 0x100000) + return &polyRAM[modelAddr]; + else + return &vrom[modelAddr]; +} + + +/****************************************************************************** + Stack Management + + Matrix and processing stack (for the experimental stack-based scene parser). +******************************************************************************/ + +// Macro to generate column-major (OpenGL) index from y,x subscripts +#define CMINDEX(y,x) (x*4+y) + +/* + * MultMatrix(): + * + * Multiplies the matrix stack by the specified Real3D matrix. The matrix + * index is a 12-bit number specifying a matrix number relative to the base. + * The base matrix MUST be set up before calling this function. + */ +void CRender3D::MultMatrix(UINT32 matrixOffset) +{ + GLfloat m[4*4]; + const float *src = &matrixBasePtr[matrixOffset*12]; + + if (matrixBasePtr==NULL) // LA Machineguns + return; + m[CMINDEX(0, 0)] = src[3]; + m[CMINDEX(0, 1)] = src[4]; + m[CMINDEX(0, 2)] = src[5]; + m[CMINDEX(0, 3)] = src[0]; + m[CMINDEX(1, 0)] = src[6]; + m[CMINDEX(1, 1)] = src[7]; + m[CMINDEX(1, 2)] = src[8]; + m[CMINDEX(1, 3)] = src[1]; + m[CMINDEX(2, 0)] = src[9]; + m[CMINDEX(2, 1)] = src[10]; + m[CMINDEX(2, 2)] = src[11]; + m[CMINDEX(2, 3)] = src[2]; + m[CMINDEX(3, 0)] = 0.0; + m[CMINDEX(3, 1)] = 0.0; + m[CMINDEX(3, 2)] = 0.0; + m[CMINDEX(3, 3)] = 1.0; + + glMultMatrixf(m); +} + +/* + * InitMatrixStack(): + * + * Initializes the modelview (model space -> view space) matrix stack and + * Real3D coordinate system. These are the last transforms to be applied (and + * the first to be defined on the stack) before projection. + * + * Model 3 games tend to define the following unusual base matrix: + * + * 0 0 -1 0 + * 1 0 0 0 + * 0 -1 0 0 + * 0 0 0 1 + * + * When this is multiplied by a column vector, the output is: + * + * -Z + * X + * -Y + * 1 + * + * My theory is that the Real3D GPU accepts vectors in Z,X,Y order. The games + * store everything as X,Y,Z and perform the translation at the end. The Real3D + * also has Y and Z coordinates opposite of the OpenGL convention. This + * function inserts a compensating matrix to undo these things. + * + * NOTE: This function assumes we are in GL_MODELVIEW matrix mode. + */ + +void CRender3D::InitMatrixStack(UINT32 matrixBaseAddr) +{ + GLfloat m[4*4]; + + // This matrix converts vectors back from the weird Model 3 Z,X,Y ordering + // and also into OpenGL viewspace (-Y,-Z) + m[CMINDEX(0,0)]=0.0; m[CMINDEX(0,1)]=1.0; m[CMINDEX(0,2)]=0.0; m[CMINDEX(0,3)]=0.0; + m[CMINDEX(1,0)]=0.0; m[CMINDEX(1,1)]=0.0; m[CMINDEX(1,2)]=-1.0; m[CMINDEX(1,3)]=0.0; + m[CMINDEX(2,0)]=-1.0; m[CMINDEX(2,1)]=0.0; m[CMINDEX(2,2)]=0.0; m[CMINDEX(2,3)]=0.0; + m[CMINDEX(3,0)]=0.0; m[CMINDEX(3,1)]=0.0; m[CMINDEX(3,2)]=0.0; m[CMINDEX(3,3)]=1.0; + + if (step > 0x10) + glLoadMatrixf(m); + else + { + // Scaling seems to help w/ Step 1.0's extremely large coordinates + GLfloat s = 1.0f/2048.0f; + glLoadIdentity(); + glScalef(s,s,s); + glMultMatrixf(m); + } + + // Set matrix base address and apply matrix #0 (coordinate system matrix) + matrixBasePtr = (float *) TranslateCullingAddress(matrixBaseAddr); + MultMatrix(0); +} + +/* + * Push(): + * + * Pushes a pointer onto the processing stack and, optionally, pushes the + * current matrix onto the matrix stack. Note that the high nibble is used by + * Supermodel to encode commands (such as pushing the matrix stack, and other + * operations within the stack machine). We must be careful to ensure that no + * games ever write data to this high nibble. + */ +void CRender3D::Push(UINT32 ptr, BOOL pushMatrix) +{ +#ifdef DEBUG + if ((ptr&0xF0000000)) // high nibble already being used for something! + printf("Push(): MSB already in use!\n"); +#endif + + // MSB of address is used to encode whether or not matrix has been pushed + if (pushMatrix) + ptr |= 0x80000000; + + if (stackTop < stackSize) + { + stack[stackTop++] = ptr; + if (pushMatrix) + { + glPushMatrix(); +#ifdef DEBUG + if (glGetError() == GL_STACK_OVERFLOW) + printf("GL stack overflow\n"); +#endif + } + } + else + { + stackOverflow = TRUE; // signal that a stack overflow occurred +#ifdef DEBUG + printf("stack overflow\n"); +#endif + } +} + +// Pop the stack +UINT32 CRender3D::Pop(void) +{ + UINT32 ptr; + + if (stackTop > 0) + { + ptr = stack[--stackTop]; + if ((ptr&0x80000000)) + { + glPopMatrix(); + ptr &= 0x7FFFFFFF; + } + return ptr; + } + return 0; +} + +// Clear the stack +void CRender3D::ClearStack(void) +{ + stackTop = 0; + stackOverflow = FALSE; +} + + +/****************************************************************************** + Scene Database + + Complete scene database traversal and rendering. +******************************************************************************/ + +/* + * DrawModel(): + * + * Draw the specified model (adds it to the display list). This is where vertex + * buffer overflows and display list overflows will be detected. An attempt is + * made to salvage the situation if this occurs, so if DrawModel() returns + * FAIL, it is a serious matter and rendering should be aborted for the frame. + */ +BOOL CRender3D::DrawModel(UINT32 modelAddr) +{ + ModelCache *Cache; + const UINT32 *model; + int lutIdx; + + //if (modelAddr==0x7FFF00) // Fighting Vipers (this is not polygon data!) + // return; + if (modelAddr == 0x200000) // Virtual On 2 (during boot-up, causes slow-down) + return OKAY; + model = TranslateModelAddress(modelAddr); + + // Determine whether model is in polygon RAM or VROM + if (modelAddr < 0x100000) + Cache = &PolyCache; + else + Cache = &VROMCache; + + // Look up the model in the LUT and cache it if necessary + lutIdx = modelAddr&0xFFFFFF; + if (NeedToCache(Cache, lutIdx)) + { + // Attempt to cache the model + if (CacheModel(Cache, lutIdx, model) != OKAY) + { + // Model could not be cached. Render what we have so far and try again. + DrawDisplayList(&VROMCache, POLY_STATE_NORMAL); + DrawDisplayList(&PolyCache, POLY_STATE_NORMAL); + DrawDisplayList(&VROMCache, POLY_STATE_ALPHA); + DrawDisplayList(&PolyCache, POLY_STATE_ALPHA); + ClearModelCache(&VROMCache); + ClearModelCache(&PolyCache); + + // Try caching again... + if (CacheModel(Cache, lutIdx, model) != OKAY) + return ErrorUnableToCacheModel(modelAddr); // nothing we can do :( + } + } + + // Add to display list + return AppendDisplayList(Cache, FALSE, Cache->lut[lutIdx]); +} + +// Descends into a 10-word culling node +void CRender3D::DescendCullingNode(UINT32 addr) +{ + const UINT32 *node, *lodTable; + UINT32 matrixOffset, node1Ptr, node2Ptr; + float x, y, z; + + ++stackDepth; + // Stack depth of 64 is too small for Star Wars Trilogy (Hoth) + if (stackDepth>=(512+64)) // safety (prevent overflows -- OpenGL matrix stack will still overflow by this point) + { + --stackDepth; + return; + } + + node = TranslateCullingAddress(addr); + if (NULL == node) + { + --stackDepth; + return; + } + + // Debug: texture offset? (NOTE: offsets 1 and 2 don't exist on step 1.0) + //if (node[0x02]&0xFFFF) + // printf("%X -> %02X %04X\n", addr, node[0x00]&0xFF, node[0x02]&0xFFFF); + + // Extract known fields + node1Ptr = node[0x07-offset]; + node2Ptr = node[0x08-offset]; + matrixOffset = node[0x03-offset]&0xFFF; + x = *(float *) &node[0x04-offset]; + y = *(float *) &node[0x05-offset]; + z = *(float *) &node[0x06-offset]; + + // Apply matrix and translation + glPushMatrix(); + if ((node[0x00]&0x10)) // apply translation vector + glTranslatef(x,y,z); + else if (matrixOffset) // multiply matrix, if specified + MultMatrix(matrixOffset); + + // Descend down first link + if ((node[0x00]&0x08)) // 4-element LOD table + { + lodTable = TranslateCullingAddress(node1Ptr); + if (NULL != lodTable) + { + if ((node[0x03-offset]&0x20000000)) + DescendCullingNode(lodTable[0]&0xFFFFFF); + else + DrawModel(lodTable[0]&0xFFFFFF); + } + } + else + DescendNodePtr(node1Ptr); + + // Proceed to second link + glPopMatrix(); + DescendNodePtr(node2Ptr); + --stackDepth; +} + +// A list of pointers. MAME assumes that these may only point to culling nodes. +void CRender3D::DescendPointerList(UINT32 addr) +{ + const UINT32 *list; + UINT32 nodeAddr; + int listEnd; + + if (listDepth > 2) // several Step 2.1 games require this safeguard + return; + + list = TranslateCullingAddress(addr); + if (NULL == list) + return; + + ++listDepth; + + // Traverse the list forward and print it out + listEnd = 0; + while (1) + { + if ((list[listEnd] & 0x02000000)) // end of list (?) + break; + + if ((list[listEnd] == 0) || (((list[listEnd])>>24) != 0)) + { + //printf("ATTENTION: Unknown list termination: %08X.\n", list[listEnd]); + listEnd--; // back up to last valid list element + break; + } + + ++listEnd; + } + + // Traverse the list backward and descend into each pointer + while (listEnd >= 0) + { + nodeAddr = list[listEnd]&0x00FFFFFF; // clear upper 8 bits to ensure this is processed as a culling node + if (!(list[listEnd]&0x01000000))//Fighting Vipers + { + if ((nodeAddr != 0) && (nodeAddr != 0x800800)) + { + DescendCullingNode(nodeAddr); + } + //else + // printf("Strange pointers encountered\n"); + } + --listEnd; + } + + --listDepth; +} + +/* + * DescendNodePtr(): + * + * The old scene traversal engine. Recursively descends into a node pointer. + */ +void CRender3D::DescendNodePtr(UINT32 nodeAddr) +{ + // Ignore null links + if ((nodeAddr&0x00FFFFFF) == 0) + return; + + switch ((nodeAddr>>24)&0xFF) // pointer type encoded in upper 8 bits + { + case 0x00: // culling node + DescendCullingNode(nodeAddr&0xFFFFFF); + break; + case 0x01: // model (perhaps bit 1 is a flag in this case?) + case 0x03: + DrawModel(nodeAddr&0xFFFFFF); + break; + case 0x04: // pointer list + DescendPointerList(nodeAddr&0xFFFFFF); + break; + default: + //printf("ATTENTION: Unknown pointer format: %08X\n\n", nodeAddr); + break; + } +} + +/* + * StackMachine(): + * + * The new scene traversal engine. Uses a "processing stack" to avoid + * recursion when traversing the scene graph. The real hardware almost + * certainly does something similar, although it probably does not use a stack + * for everything (for instance, display lists). + * + * If the OpenGL stack is pushed/popped as frequently as the node pointers, it + * will rapidly overflow. Therefore, it is only saved when necessary (while + * processing the first link in a culling node). + * + * Some games have been observed to create circular references in their display + * lists (a culling node at some point will call the same display list from + * which it was called). To handle this unusual situation, the stack machine + * function maintains a small "stack" of list pointers. To pop this stack, + * specially encoded pointers are pushed on the processing stack. It is assumed + * that no games use the upper nibble of the node pointers for anything. + * + * Problems + * -------- + * For some reason, terminating early can corrupt the OpenGL stack, so I've + * added code to pop everything. It's still slower than the recursive method. + */ +void CRender3D::StackMachine(UINT32 nodeAddr) +{ + unsigned listStackDepth = 0; + + // Push this address on to the stack to begin the process + Push(nodeAddr,FALSE); + + // Process the stack (keep popping until all finished) + while (stackTop > 0) + { + unsigned nodeType; + + // Pop + nodeAddr = Pop(); + + // Check for our special "list stack" indicator + if ((nodeAddr&0x40000000)) + { + listStackDepth--; + continue; + } + + // Determine how to process this node + nodeType = (nodeAddr>>24)&0xFF; // extract type + nodeAddr &= 0x00FFFFFF; // extract the address itself + if (nodeAddr == 0) // ignore null links + continue; + switch (nodeType) + { + /* + * Unknown + */ + default: + //printf("ATTENTION: Unknown pointer format: %08X\n\n", nodeAddr); + break; + + /* + * Model + */ + case 0x01: + case 0x03: // perhaps bit 1 is a flag? + if (DrawModel(nodeAddr&0x00FFFFFF)) + goto PopAll; + break; + + /* + * Display List + * + * Circular references in display lists are handled with a nasty hack + * here which abuses the processing stack by encoding a bit into the + * highest nibble of a pointer. Note that we may have to maintain an + * actual list stack in case more than a few nested lists are used + * without circular references (in that case, we would have to scan the + * list stack each time for duplicates). For now, we use the simple + * approach. + */ + case 0x04: + const UINT32 *list; + + list = TranslateCullingAddress(nodeAddr); + if (NULL == list) + break; + + // Push our special "list stack" indicator onto the stack, if there is room + if (listStackDepth > 4) // probably indicates a recursive list + break; + else + { + Push(0x40000000,NULL); + listStackDepth++; + } + + // Push all list elements onto stack (they will be processed backwards) + for (int i = 0; ; i++) + { + nodeAddr = list[i]&0x00FFFFFF; // clear upper 8 bits to ensure this is processed as a culling node + if (nodeAddr==0) // we went too far, the display list has ended + break; + //if (((list[i]>>24)&0xFC) != 0) + // ErrorLog("Unrecognized pointer format in display list: %08X\n", list[i]); + if (!(list[i]&0x01000000)) // Fighting Vipers (this bit seems to indicate "do not process" + { + if ((nodeAddr != 0) && (nodeAddr != 0x800800)) + Push(nodeAddr,FALSE); // don't need to save matrix (each culling node saves/restores matrix) + } + + if ((list[i]&0x02000000)) // list terminator + break; + } + + break; + + /* + * Culling Node + * + * The current matrix stack must be saved when processing a culling + * node and restored after the first link is finished. Therefore, + * the only point at which the matrix needs to be saved is when pushing + * the second link onto the processing stack. In other words, the + * second link is more of a "JUMP" than a nested "CALL." + */ + case 0x00: + const UINT32 *node, *lodTable; + UINT32 matrixOffset, node1Ptr, node2Ptr; + float x, y, z; + + // Get pointer + node = TranslateCullingAddress(nodeAddr); + if (NULL == node) // invalid address, ignore + break; + + // Extract known fields + node1Ptr = node[0x07-offset]; + node2Ptr = node[0x08-offset]; + matrixOffset = node[0x03-offset]&0xFFF; + x = *(float *) &node[0x04-offset]; + y = *(float *) &node[0x05-offset]; + z = *(float *) &node[0x06-offset]; + + // Push second link on stack (this also saves current matrix and will ensure it is restored) + Push(node2Ptr,TRUE); + + // Apply matrix and translation, then process first link + if ((node[0x00]&0x10)) // apply translation vector + glTranslatef(x,y,z); + else if (matrixOffset) // multiply matrix, if specified + MultMatrix(matrixOffset); + + if ((node[0x00]&0x08)) // 4-element LOD table + { + lodTable = TranslateCullingAddress(node1Ptr); + if (NULL != lodTable) + { + if ((node[0x03-offset]&0x20000000)) + Push(lodTable[0]&0x00FFFFFF,FALSE); // process as culling node + else + { + if (DrawModel(lodTable[0]&0x00FFFFFF)) + goto PopAll; + } + } + } + else + Push(node1Ptr,FALSE); + + break; + + } + + // Check for overflows and abort + if (stackOverflow) + { + ErrorLog("Stack overflow in scene database!"); + return; + } + } + + // Pop everything off the stack (ensures OpenGL matrix stack will be cleared) +PopAll: + while (stackTop > 0) + Pop(); +} + +// Draws viewports of the given priority +void CRender3D::RenderViewport(UINT32 addr, int pri) +{ + GLfloat color[8][3] = // RGB1 translation + { + { 0.0, 0.0, 0.0 }, // off + { 0.0, 0.0, 1.0 }, // blue + { 0.0, 1.0, 0.0 }, // green + { 0.0, 1.0, 1.0 }, // cyan + { 1.0, 0.0, 0.0 }, // red + { 1.0, 0.0, 1.0 }, // purple + { 1.0, 1.0, 0.0 }, // yellow + { 1.0, 1.0, 1.0 } // white + }; + const UINT32 *vpnode; + UINT32 nextAddr, nodeAddr, matrixBase; + int curPri; + int vpX, vpY, vpWidth, vpHeight; + int spotColorIdx; + GLfloat vpTopAngle, vpBotAngle, fovYDegrees; + GLfloat scrollFog, scrollAtt; + + // Translate address and obtain pointer + vpnode = TranslateCullingAddress(addr); + if (NULL == vpnode) + return; + + curPri = (vpnode[0x00] >> 3) & 3; // viewport priority + nextAddr = vpnode[0x01] & 0xFFFFFF; // next viewport + nodeAddr = vpnode[0x02]; // scene database node pointer + + // Recursively process next viewport + if (vpnode[0x01] == 0) // memory probably hasn't been set up yet, abort + return; + if (vpnode[0x01] != 0x01000000) + RenderViewport(vpnode[0x01],pri); + + // If the priority doesn't match, do not process + if (curPri != pri) + return; + + // Fetch viewport parameters (TO-DO: would rounding make a difference?) + vpX = (vpnode[0x1A]&0xFFFF)>>4; // viewport X (12.4 fixed point) + vpY = (vpnode[0x1A]>>20)&0xFFF; // viewport Y (12.4) + vpWidth = (vpnode[0x14]&0xFFFF)>>2; // width (14.2) + vpHeight = (vpnode[0x14]>>18)&0x3FFF; // height (14.2) + matrixBase = vpnode[0x16]&0xFFFFFF; // matrix base address + + // Field of view and clipping + vpTopAngle = (float) asin(*(float *)&vpnode[0x0E]); // FOV Y upper half-angle (radians) + vpBotAngle = (float) asin(*(float *)&vpnode[0x12]); // FOV Y lower half-angle + fovYDegrees = (vpTopAngle+vpBotAngle)*(float)(180.0/3.14159265358979323846); + // TO-DO: investigate clipping planes + + // Set up viewport and projection (TO-DO: near and far clipping) + viewportX = xOffs + (GLint) ((float)vpX*xRatio); + viewportY = yOffs + (GLint) ((float)(384-(vpY+vpHeight))*yRatio); + viewportWidth = (GLint) ((float)vpWidth*xRatio); + viewportHeight = (GLint) ((float)vpHeight*yRatio); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(fovYDegrees,(GLfloat)vpWidth/(GLfloat)vpHeight,0.1f,1e5); + + // Lighting (note that sun vector points toward sun -- away from vertex) + lightingParams[0] = *(float *) &vpnode[0x05]; // sun X + lightingParams[1] = *(float *) &vpnode[0x06]; // sun Y + lightingParams[2] = *(float *) &vpnode[0x04]; // sun Z + lightingParams[3] = *(float *) &vpnode[0x07]; // sun intensity + lightingParams[4] = (float) ((vpnode[0x24]>>8)&0xFF) * (1.0f/255.0f); // ambient intensity + lightingParams[5] = 0.0; // reserved + + // Spotlight + spotColorIdx = (vpnode[0x20]>>11)&7; // spotlight color index + spotEllipse[0] = (float) ((vpnode[0x1E]>>3)&0x1FFF); // spotlight X position (fractional component?) + spotEllipse[1] = (float) ((vpnode[0x1D]>>3)&0x1FFF); // spotlight Y + spotEllipse[2] = (float) ((vpnode[0x1E]>>16)&0xFFFF); // spotlight X size (16-bit? May have fractional component below bit 16) + spotEllipse[3] = (float) ((vpnode[0x1D]>>16)&0xFFFF); // spotlight Y size + spotRange[0] = 1.0f/(*(float *) &vpnode[0x21]); // spotlight start + spotRange[1] = *(float *) &vpnode[0x1F]; // spotlight extent + spotColor[0] = color[spotColorIdx][0]; // spotlight color + spotColor[1] = color[spotColorIdx][1]; + spotColor[2] = color[spotColorIdx][2]; + //printf("(%g,%g),(%g,%g),(%g,%g) -> \n", spotEllipse[0], spotEllipse[1], spotEllipse[2], spotEllipse[3], spotRange[0], spotRange[1]); + + // Spotlight is applied on a per pixel basis, must scale its position and size to screen + spotEllipse[1] = 384.0f-spotEllipse[1]; + spotRange[1] += spotRange[0]; // limit + spotEllipse[2] = 496.0f/sqrt(spotEllipse[2]); // spotlight appears to be specified in terms of physical resolution (unconfirmed) + spotEllipse[3] = 384.0f/sqrt(spotEllipse[3]); + + // Scale the spotlight to the OpenGL viewport + spotEllipse[0] = spotEllipse[0]*xRatio + xOffs; + spotEllipse[1] = spotEllipse[1]*yRatio + yOffs; + spotEllipse[2] *= xRatio; + spotEllipse[3] *= yRatio; + + // Fog + fogParams[0] = (float) ((vpnode[0x22]>>16)&0xFF) * (1.0f/255.0f); // fog color R + fogParams[1] = (float) ((vpnode[0x22]>>8)&0xFF) * (1.0f/255.0f); // fog color G + fogParams[2] = (float) ((vpnode[0x22]>>0)&0xFF) * (1.0f/255.0f); // fog color B + fogParams[3] = *(float *) &vpnode[0x23]; // fog density + fogParams[4] = (float) (INT16) (vpnode[0x25]&0xFFFF)*(1.0f/255.0f); // fog start + if (ISINF(fogParams[3]) || ISNAN(fogParams[3]) || ISINF(fogParams[4]) || ISNAN(fogParams[4])) // Star Wars Trilogy + fogParams[3] = fogParams[4] = 0.0f; + + // Unknown light/fog parameters + scrollFog = (float) (vpnode[0x20]&0xFF) * (1.0f/255.0f); // scroll fog + scrollAtt = (float) (vpnode[0x24]&0xFF) * (1.0f/255.0f); // scroll attenuation + //printf("scrollFog = %g, scrollAtt = %g\n", scrollFog, scrollAtt); + //printf("Fog: R=%02X G=%02X B=%02X density=%g (%X) %d start=%g\n", ((vpnode[0x22]>>16)&0xFF), ((vpnode[0x22]>>8)&0xFF), ((vpnode[0x22]>>0)&0xFF), fogParams[3], vpnode[0x23], (fogParams[3]==fogParams[3]), fogParams[4]); + + // Set up coordinate system and base matrix + glMatrixMode(GL_MODELVIEW); + InitMatrixStack(matrixBase); + + // Safeguard: weird coordinate system matrices usually indicate scenes that will choke the renderer + if (NULL != matrixBasePtr) + { + float m21, m32, m13; + + // Get the three elements that are usually set and see if their magnitudes are 1 + m21 = matrixBasePtr[6]; + m32 = matrixBasePtr[10]; + m13 = matrixBasePtr[5]; + + m21 *= m21; + m32 *= m32; + m13 *= m13; + + if ((m21>1.05) || (m21<0.95)) + return; + if ((m32>1.05) || (m32<0.95)) + return; + if ((m13>1.05) || (m13<0.95)) + return; + } + + // Render + AppendDisplayList(&VROMCache, TRUE, 0); // add a viewport display list node + AppendDisplayList(&PolyCache, TRUE, 0); + stackDepth = 0; + listDepth = 0; + + // Descend down the node link: Use stack machine to traverse display list + //ClearStack(); + //StackMachine(nodeAddr); + + // Descend down the node link: Use recursive traversal + DescendNodePtr(nodeAddr); +} + +void CRender3D::RenderFrame(void) +{ + // Begin frame + ClearErrors(); // must be cleared each frame + //printf("BEGIN FRAME\n"); + + // Z buffering (Z buffer is cleared by display list viewport nodes) + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); + + // Bind Real3D shader program and texture map + glUseProgram(shaderProgram); + glBindTexture(GL_TEXTURE_2D, texID); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); // fragment shader performs its own interpolation + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + + // Enable VBO client states + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_NORMAL_ARRAY); + glEnableClientState(GL_COLOR_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + glEnableVertexAttribArray(subTextureLoc); + glEnableVertexAttribArray(texParamsLoc); + glEnableVertexAttribArray(texFormatLoc); + glEnableVertexAttribArray(transLevelLoc); + glEnableVertexAttribArray(lightEnableLoc); + glEnableVertexAttribArray(fogIntensityLoc); + + // Draw + //ClearModelCache(&VROMCache); // debug + ClearModelCache(&PolyCache); + for (int pri = 0; pri <= 3; pri++) + { + glClear(GL_DEPTH_BUFFER_BIT); + //ClearModelCache(&PolyCache); + ClearDisplayList(&PolyCache); + ClearDisplayList(&VROMCache); + RenderViewport(0x800000,pri); + DrawDisplayList(&VROMCache, POLY_STATE_NORMAL); + DrawDisplayList(&PolyCache, POLY_STATE_NORMAL); + DrawDisplayList(&VROMCache, POLY_STATE_ALPHA); + DrawDisplayList(&PolyCache, POLY_STATE_ALPHA); + } + + // Disable VBO client states + glDisableVertexAttribArray(fogIntensityLoc); + glDisableVertexAttribArray(lightEnableLoc); + glDisableVertexAttribArray(transLevelLoc); + glDisableVertexAttribArray(texFormatLoc); + glDisableVertexAttribArray(texParamsLoc); + glDisableVertexAttribArray(subTextureLoc); + glDisableClientState(GL_COLOR_ARRAY); + glDisableClientState(GL_TEXTURE_COORD_ARRAY); + glDisableClientState(GL_NORMAL_ARRAY); + glDisableClientState(GL_VERTEX_ARRAY); +} + +void CRender3D::EndFrame(void) +{ +} + +void CRender3D::BeginFrame(void) +{ +} + + +/****************************************************************************** + Configuration, Initialization, and Shutdown +******************************************************************************/ + +void CRender3D::AttachMemory(const UINT32 *cullingRAMLoPtr, const UINT32 *cullingRAMHiPtr, const UINT32 *polyRAMPtr, const UINT32 *vromPtr, const UINT16 *textureRAMPtr) +{ + cullingRAMLo = cullingRAMLoPtr; + cullingRAMHi = cullingRAMHiPtr; + polyRAM = polyRAMPtr; + vrom = vromPtr; + textureRAM = textureRAMPtr; + DebugLog("Render3D attached Real3D memory regions\n"); +} + +void CRender3D::SetStep(int stepID) +{ + step = stepID; + + if ((step!=0x10) && (step!=0x15) && (step!=0x20) && (step!=0x21)) + { + DebugLog("Render3D: Unrecognized stepping: %d.%d\n", (step>>4)&0xF, step&0xF); + step = 0x10; + } + + if (step > 0x10) + { + offset = 0; // culling nodes are 10 words + vertexFactor = (1.0f/2048.0f); // vertices are in 13.11 format + } + else + { + offset = 2; // 8 words + vertexFactor = (1.0f/128.0f); // 17.7 + } + + DebugLog("Render3D set to Step %d.%d\n", (step>>4)&0xF, step&0xF); +} + +BOOL CRender3D::Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes, const char *vsFile, const char *fsFile) +{ + // Allocate memory for texture buffer + textureBuffer = new(std::nothrow) GLfloat[512*512*4]; + if (NULL == textureBuffer) + return ErrorLog("Insufficient memory for texture decode buffer."); + + // Allocate memory for scene stack + stackSize = STACK_SIZE; + stack = new(std::nothrow) UINT32[STACK_SIZE]; + if (NULL == stack) + return ErrorLog("Insufficient memory for scene stack."); + + // Create texture map + glGetError(); // clear error flag + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + glGenTextures(1, &texID); + glActiveTexture(GL_TEXTURE0); // texture unit 0 + glBindTexture(GL_TEXTURE_2D, texID); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); // fragment shader performs its own interpolation + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 2048, 2048, 0, GL_RGBA, GL_UNSIGNED_SHORT_5_5_5_1, 0); + if (glGetError() != GL_NO_ERROR) + return ErrorLog("OpenGL was unable to provide a 2048x2048-texel texture map."); + + // Create model caches and VBOs + if (CreateModelCache(&VROMCache, NUM_STATIC_VERTS, NUM_LOCAL_VERTS, NUM_STATIC_MODELS, 0x4000000/4, NUM_DISPLAY_LIST_ITEMS, FALSE)) + return FAIL; + if (CreateModelCache(&PolyCache, NUM_DYNAMIC_VERTS, NUM_LOCAL_VERTS, NUM_DYNAMIC_MODELS, 0x400000/4, NUM_DISPLAY_LIST_ITEMS, TRUE)) + return FAIL; + + // Initialize lighting parameters (updated as viewports are traversed) + lightingParams[0] = 0.0; + lightingParams[1] = 0.0; + lightingParams[2] = 0.0; + lightingParams[3] = 0.0; + lightingParams[4] = 1.0; // full ambient intensity in case we want to render a standalone model + lightingParams[5] = 0.0; + + // Resolution and offset within physical display area + xRatio = (GLfloat) xRes / 496.0f; + yRatio = (GLfloat) yRes / 384.0f; + xOffs = xOffset; + yOffs = yOffset; + + // Load shaders + if (OKAY != LoadShaderProgram(&shaderProgram,&vertexShader,&fragmentShader,vsFile,fsFile,vertexShaderSource,fragmentShaderSource)) + return FAIL; + + // Bind the texture to the "textureMap" uniform so fragment shader can access it + textureMapLoc = glGetUniformLocation(shaderProgram, "textureMap"); + glUseProgram(shaderProgram); // bind program + glUniform1i(textureMapLoc,0); // attach it to texture unit 0 + + // Get location of the rest of the uniforms + modelViewMatrixLoc = glGetUniformLocation(shaderProgram,"modelViewMatrix"); + projectionMatrixLoc = glGetUniformLocation(shaderProgram,"projectionMatrix"); + lightingLoc = glGetUniformLocation(shaderProgram, "lighting"); + spotEllipseLoc = glGetUniformLocation(shaderProgram, "spotEllipse"); + spotRangeLoc = glGetUniformLocation(shaderProgram, "spotRange"); + spotColorLoc = glGetUniformLocation(shaderProgram, "spotColor"); + + // Get locations of custom vertex attributes + subTextureLoc = glGetAttribLocation(shaderProgram,"subTexture"); + texParamsLoc = glGetAttribLocation(shaderProgram,"texParams"); + texFormatLoc = glGetAttribLocation(shaderProgram,"texFormat"); + transLevelLoc = glGetAttribLocation(shaderProgram,"transLevel"); + lightEnableLoc = glGetAttribLocation(shaderProgram,"lightEnable"); + fogIntensityLoc = glGetAttribLocation(shaderProgram,"fogIntensity"); + + // Additional OpenGL stuff + glFrontFace(GL_CW); // polygons are uploaded w/ clockwise winding + glCullFace(GL_BACK); + glEnable(GL_CULL_FACE); + glClearDepth(1.0); + glEnable(GL_TEXTURE_2D); + glMatrixMode(GL_MODELVIEW); + glLoadIdentity(); + + // Mark all textures as dirty + UploadTextures(0,0,2048,2048); + + DebugLog("Render3D initialized\n"); + return OKAY; +} + +CRender3D::CRender3D(void) +{ + cullingRAMLo = NULL; + cullingRAMHi = NULL; + polyRAM = NULL; + vrom = NULL; + textureRAM = NULL; + textureBuffer = NULL; + stack = NULL; + + // Clear model cache pointers so we can safely destroy them if init fails + for (int i = 0; i < 2; i++) + { + VROMCache.verts[i] = NULL; + PolyCache.verts[i] = NULL; + VROMCache.Models = NULL; + PolyCache.Models = NULL; + VROMCache.lut = NULL; + PolyCache.lut = NULL; + VROMCache.List = NULL; + PolyCache.List = NULL; + VROMCache.ListHead[i] = NULL; + PolyCache.ListHead[i] = NULL; + VROMCache.ListTail[i] = NULL; + PolyCache.ListTail[i] = NULL; + } + + DebugLog("Built Render3D\n"); +} + +CRender3D::~CRender3D(void) +{ + DestroyShaderProgram(shaderProgram,vertexShader,fragmentShader); + if (glBindBuffer != NULL) // we may have failed earlier due to lack of OpenGL 2.0 functions + glBindBuffer(GL_ARRAY_BUFFER, 0); // disable VBOs by binding to 0 + glDeleteTextures(1,&texID); + + DestroyModelCache(&VROMCache); + DestroyModelCache(&PolyCache); + + cullingRAMLo = NULL; + cullingRAMHi = NULL; + polyRAM = NULL; + vrom = NULL; + textureRAM = NULL; + + if (textureBuffer != NULL) + delete [] textureBuffer; + textureBuffer = NULL; + + if (stack != NULL) + delete [] stack; + stack = NULL; + + DebugLog("Destroyed Render3D\n"); +} diff --git a/Graphics/Render3D.h b/Graphics/Render3D.h new file mode 100644 index 0000000..bc5444a --- /dev/null +++ b/Graphics/Render3D.h @@ -0,0 +1,412 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Render3D.h + * + * Header file defining the CRender3D class: OpenGL Real3D graphics engine. + */ + +#ifndef INCLUDED_RENDER3D_H +#define INCLUDED_RENDER3D_H + +#include "Pkgs/glew.h" + +/****************************************************************************** + Internal Definitions and Data Structures + + NOTE: These should probably be moved inside the Render3D namespace at some + point. +******************************************************************************/ + +// Model caches sort models by alpha (translucency) state +enum POLY_STATE +{ + POLY_STATE_NORMAL = 0, + POLY_STATE_ALPHA +}; + +struct Vertex +{ + GLfloat x,y,z; // vertex + GLfloat n[3]; // normal X, Y, Z + GLfloat u,v; // texture U, V coordinates (in texels, relative to selected texture) +}; + +struct Poly +{ + Vertex Vert[4]; + GLfloat n[3]; // polygon normal (used for backface culling) + POLY_STATE state; // alpha or normal? + unsigned numVerts; // triangle (3) or quad (4) + const UINT32 *header; // pointer to Real3D 7-word polygon header +}; + +// References to model polygons stored in a VBO +struct VBORef +{ + unsigned index[2]; // index of model polygons in VBO + unsigned numVerts[2]; // number of vertices + unsigned lutIdx; // LUT index associated with this model (for fast LUT clearing) +}; + +// Display list items: model instances and viewport settings +struct DisplayList +{ + BOOL isViewport; // if true, this is a viewport node + + union + { + // Viewport data + struct + { + GLfloat projectionMatrix[4*4]; // projection matrix + GLfloat lightingParams[6]; // lighting parameters (see RenderViewport() and vertex shader) + GLfloat spotEllipse[4]; // spotlight ellipse (see RenderViewport()) + GLfloat spotRange[2]; // Z range + GLfloat spotColor[3]; // color + GLfloat fogParams[5]; // fog parameters (...) + GLint x, y; // viewport coordinates (scaled and in OpenGL format) + GLint width, height; // viewport dimensions (scaled for display surface size) + } Viewport; + + // Model data + struct + { + GLfloat modelViewMatrix[4*4]; // model-view matrix + unsigned index; // index in VBO + unsigned numVerts; // number of vertices + } Model; + } Data; + + DisplayList *next; // next display list item with the same state (alpha or non-alpha) +}; + +/* + * ModelCache: + * + * A model cache tracks all models in a particular region (ie., VROM or polygon + * RAM). It contains a look-up table to quickly obtain VBO indices. Be careful + * when accessing the LUT, there are some special cases. + * + * If the model cache is marked dynamic, cached models may not necessarily be + * retained. Clearing the model cache is also much faster. The LUT entry for + * the last model cached will be valid, but because the LUT may not be + * cleared, one cannot assume a model exists because there is a LUT entry + * pointing to it. Always use NeedToCache() to determine whether caching is + * necessary before reading the LUT! + */ +struct ModelCache +{ + // Cache type + BOOL dynamic; + + // Vertex buffer object + unsigned vboMaxOffset; // size of VBO (in bytes) + unsigned vboCurOffset; // current offset in VBO (in bytes) + GLuint vboID; // OpenGL VBO handle + + // Local vertex buffers (enough for a single model) + unsigned maxVertIdx; // size of each local vertex buffer (in vertices) + unsigned curVertIdx[2]; // current vertex index (in vertices) + GLfloat *verts[2]; + + // Array of cached models + unsigned maxModels; // maximum number of models + unsigned numModels; // current number stored + VBORef *Models; + + /* + * Look-Up Table: + * + * Can be accessed directly with a LUT index to determine the model index. + * However, it should not be used to determine whether a model needs to be + * cached. Use NeedToCache() instead. A valid index, for example, may still + * have to be re-cached if the model cache is dynamic (polygon RAM). + */ + unsigned lutSize; // number of elements in LUT + INT16 *lut; // stores indices into Models[] or -1 if not yet cached + + // Display list + unsigned maxListSize; // maximum number of display list items + unsigned listSize; // number of items in display list + DisplayList *List; // holds all display list items + DisplayList *ListHead[2]; // heads of linked lists for each state + DisplayList *ListTail[2]; // current tail node for each state +}; + + +/****************************************************************************** + CRender3D Class Definition +******************************************************************************/ + +/* + * CRender3D: + * + * 3D renderer. Lots of work to do here :) + */ +class CRender3D +{ +public: + /* + * RenderFrame(void): + * + * Renders the complete scene database. Must be called between BeginFrame() and + * EndFrame(). This function traverses the scene database and builds up display + * lists. + */ + void RenderFrame(void); + + /* + * BeginFrame(void): + * + * Prepare to render a new frame. Must be called once per frame prior to + * drawing anything. + */ + void BeginFrame(void); + + /* + * EndFrame(void): + * + * Signals the end of rendering for this frame. Must be called last during + * the frame. + */ + void EndFrame(void); + + /* + * UploadTextures(x, y, width, height): + * + * Signals that a portion of texture RAM has been updated. + * + * Parameters: + * x X position within texture RAM. + * y Y position within texture RAM. + * width Width of texture data in texels. + * height Height. + */ + void UploadTextures(unsigned x, unsigned y, unsigned width, unsigned height); + + /* + * AttachMemory(cullingRAMLoPtr, cullingRAMHiPtr, polyRAMPtr, vromPtr, + * textureRAMPtr): + * + * Attaches RAM and ROM areas. This must be done prior to any rendering + * otherwise the program may crash with an access violation. + * + * Parameters: + * cullingRAMLoPtr Pointer to low culling RAM (4 MB). + * cullingRAMHiPtr Pointer to high culling RAM (1 MB). + * polyRAMPtr Pointer to polygon RAM (4 MB). + * vromPtr Pointer to video ROM (64 MB). + * textureRAMPtr Pointer to texture RAM (8 MB). + */ + void AttachMemory(const UINT32 *cullingRAMLoPtr, + const UINT32 *cullingRAMHiPtr, const UINT32 *polyRAMPtr, + const UINT32 *vromPtr, const UINT16 *textureRAMPtr); + + /* + * SetStep(stepID): + * + * Sets the Model 3 hardware stepping, which also determines the Real3D + * functionality. The default is Step 1.0. This should be called prior to + * any other emulation functions and after Init(). + * + * Parameters: + * stepID 0x10 for Step 1.0, 0x15 for Step 1.5, 0x20 for Step 2.0, + * or 0x21 for Step 2.1. Anything else defaults to 1.0. + */ + void SetStep(int stepID); + + /* + * Init(xOffset, yOffset, xRes, yRes, vsFile, fsFile): + * + * One-time initialization of the context. Must be called before any other + * members (meaning it should be called even before being attached to any + * other objects that want to use it). + * + * Parameters: + * xOffset X offset of display surface in pixels (in case resolution + * is smaller than the true display surface). + * yOffset Y offset. + * xRes Horizontal resolution of display surface in pixels. + * yRes Vertical resolution. + * vsFile External vertex shader path. If NULL, the internal + * shader is used. + * fsFile External fragment shader path. If NULL, the internal + * shader is used. + * + * Returns: + * OKAY is successful, otherwise FAILED if a non-recoverable error + * occurred. Any allocated memory will not be freed until the + * destructor is called. Prints own error messages. + */ + BOOL Init(unsigned xOffset, unsigned yOffset, unsigned xRes, unsigned yRes, + const char *vsFile, const char *fsFile); + + /* + * CRender3D(void): + * ~CRender3D(void): + * + * Constructor and destructor. + */ + CRender3D(void); + ~CRender3D(void); + +private: + /* + * Private Members + */ + + // Real3D address translation + const UINT32 *TranslateCullingAddress(UINT32 addr); + const UINT32 *TranslateModelAddress(UINT32 addr); + + // Model caching and display list management + void DrawDisplayList(ModelCache *Cache, POLY_STATE state); + BOOL AppendDisplayList(ModelCache *Cache, BOOL isViewport, int modelNum); + void ClearDisplayList(ModelCache *Cache); + BOOL InsertPolygon(ModelCache *cache, const Poly *p); + void InsertVertex(ModelCache *cache, const Vertex *v, const Poly *p, float normFlip); + BOOL BeginModel(ModelCache *cache); + void EndModel(ModelCache *cache, int lutIdx); + BOOL CacheModel(ModelCache *cache, int lutIdx, const UINT32 *data); + BOOL NeedToCache(ModelCache *cache, int lutIdx); + void ClearModelCache(ModelCache *cache); + BOOL CreateModelCache(ModelCache *cache, unsigned vboMaxVerts, unsigned localMaxVerts, unsigned maxNumModels, unsigned numLUTEntries, unsigned displayListSize, BOOL isDynamic); + void DestroyModelCache(ModelCache *cache); + + // Texture management + void DecodeTexture(int format, int x, int y, int width, int height); + + // Stack management + void MultMatrix(UINT32 matrixOffset); + void InitMatrixStack(UINT32 matrixBaseAddr); + void Push(UINT32 ptr, BOOL pushMatrix); + UINT32 Pop(void); + void ClearStack(void); + + // Scene database traversal + BOOL DrawModel(UINT32 modelAddr); + void DescendCullingNode(UINT32 addr); + void DescendPointerList(UINT32 addr); + void DescendNodePtr(UINT32 nodeAddr); + void StackMachine(UINT32 nodeAddr); + void RenderViewport(UINT32 addr, int pri); + + // In-frame error reporting + BOOL ErrorLocalVertexOverflow(void); + BOOL ErrorUnableToCacheModel(UINT32 modelAddr); + void ClearErrors(void); + + /* + * Data + */ + + // Stepping + int step; + int offset; // offset to subtract for words 3 and higher of culling nodes + GLfloat vertexFactor; // fixed-point conversion factor for vertices + + // Memory (passed from outside) + const UINT32 *cullingRAMLo; // 4 MB + const UINT32 *cullingRAMHi; // 1 MB + const UINT32 *polyRAM; // 4 MB + const UINT32 *vrom; // 64 MB + const UINT16 *textureRAM; // 8 MB + + // Error reporting + unsigned errorMsgFlags; // tracks which errors have been printed this frame + + // Real3D Base Matrix Pointer + const float *matrixBasePtr; + + // Processing stack (experimental) + UINT32 *stack; + int stackSize; // number of elements stack can contain + int stackTop; // current top of stack (free spot, last element is stackTop-1) + BOOL stackOverflow; // records stack overflows (cleared by ClearStack()) + + // Current viewport parameters (updated as viewports are traversed) + GLfloat lightingParams[6]; + GLfloat fogParams[5]; + GLfloat spotEllipse[4]; + GLfloat spotRange[2]; + GLfloat spotColor[3]; + GLint viewportX, viewportY; + GLint viewportWidth, viewportHeight; + + // Scene graph stack + int listDepth; // how many lists have we recursed into + int stackDepth; // for debugging and error handling purposes + + // Resolution scaling factors (to support resolutions higher than 496x384) and offsets + GLfloat xRatio, yRatio; + unsigned xOffs, yOffs; + + // Texture ID for complete 2048x2048 texture map + GLuint texID; + + // Shader programs and input data locations + GLuint shaderProgram; // shader program object + GLuint vertexShader; // vertex shader handle + GLuint fragmentShader; // fragment shader + GLuint textureMapLoc; // location of "textureMap" uniform + GLuint modelViewMatrixLoc; // uniform + GLuint projectionMatrixLoc; // uniform + GLuint lightingLoc; // uniform + GLuint spotEllipseLoc; // uniform + GLuint spotRangeLoc; // uniform + GLuint spotColorLoc; // uniform + GLuint subTextureLoc; // attribute + GLuint texParamsLoc; // attribute + GLuint texFormatLoc; // attribute + GLuint transLevelLoc; // attribute + GLuint lightEnableLoc; // attribute + GLuint fogIntensityLoc; // attribute + + // Model caching + ModelCache VROMCache; // VROM (static) models + ModelCache PolyCache; // polygon RAM (dynamic) models + + /* + * Texture Format Buffer + * + * Records the format that a texture (at a given location within the + * texture sheet) is currently stored in. A negative value indicates the + * texture has not been accessed and converted yet and non-negative values + * correspond to the texture format bits in the polygon headers. They can + * be used to determine whether a texture needs to be updated. + */ + int textureWidth[2048/32][2048/32]; + int textureHeight[2048/32][2048/32]; + INT8 textureFormat[2048/32][2048/32]; + + /* + * Texture Decode Buffer + * + * Textures are decoded and copied from texture RAM into this temporary buffer + * before being uploaded. Dimensions are 512x512. + */ + GLfloat *textureBuffer; // RGBA8 format +}; + + +#endif // INCLUDED_RENDER3D_H diff --git a/Graphics/Shader.cpp b/Graphics/Shader.cpp new file mode 100644 index 0000000..298b1b0 --- /dev/null +++ b/Graphics/Shader.cpp @@ -0,0 +1,182 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Shader.cpp + * + * OpenGL shader management. + * + * To-Do List + * ---------- + * - Mesa crashes because, evidently, the function pointers are invalid. Mesa + * returns the following information: + * Vendor: Mesa project: www.mesa3d.org + * Renderer: Mesa GLX Indirect + * Version: 1.2 (1.5 Mesa 6.5.1) + * Shading Language Version: (null) + * Maximum Vertex Array Size: -1 vertices + * Maximum Texture Size: 2048 texels + * Maximum Vertex Attributes: 16 + * Maximum Vertex Uniforms: 16 + * - Check for OpenGL 2.0 and perhaps check some of the function pointers, + * which will be NULL, if GL 2.0 and shaders are not supported. + * - Keep in mind that all these checks should probably go somewhere else... + * - Turn this into a class. + */ + +#include +#include +#include "Pkgs/glew.h" +#include "Supermodel.h" + + +// Load a source file. Pointer returned must be freed by caller. Returns NULL if failed. +static char *LoadShaderSource(const char *file) +{ + FILE *fp; + char *buf; + int size; + + // Open shader and get the file size + fp = fopen(file, "r"); + if (NULL == fp) + { + ErrorLog("Unable to open shader source file: %s", file); + return NULL; + } + fseek(fp, 0, SEEK_END); + size = ftell(fp); + rewind(fp); + + // Allocate memory and read it in + buf = new(std::nothrow) char[size+1]; + if (NULL == buf) + { + ErrorLog("Insufficient memory to load shader source file: %s", file); + fclose(fp); + return NULL; + } + buf[size] = '\0'; // for safety, actual size might be smaller once newline characters are converted + size = fread(buf, sizeof(char), size, fp); + buf[size] = '\0'; + + fclose(fp); + return buf; +} + +BOOL LoadShaderProgram(GLuint *shaderProgramPtr, GLuint *vertexShaderPtr, GLuint *fragmentShaderPtr, const char *vsFile, const char *fsFile, const char *vsString, const char *fsString) +{ + char msg[2048+128], infoLog[2048]; + const char *vsSource, *fsSource; // source code + GLuint shaderProgram, vertexShader, fragmentShader; + GLint result, len; + BOOL ret = OKAY; + + // Load shaders from files if specified + if (vsFile != NULL) + vsSource = LoadShaderSource(vsFile); + else + vsSource = vsString; + if (fsFile != NULL) + fsSource = LoadShaderSource(fsFile); + else + fsSource = fsString; + if (vsSource == NULL || fsSource == NULL) + { + ret = FAIL; + goto Quit; + } + + // Ensure that shader support exists + if ((glCreateProgram==NULL) || (glCreateShader==NULL) || (glShaderSource==NULL) || (glCompileShader==NULL)) + { + ret = FAIL; + ErrorLog("OpenGL 2.0 does not appear to be present. Unable to proceed."); + goto Quit; + } + + // Create the shaders and shader program + shaderProgram = glCreateProgram(); + vertexShader = glCreateShader(GL_VERTEX_SHADER); + fragmentShader = glCreateShader(GL_FRAGMENT_SHADER); + *shaderProgramPtr = shaderProgram; + *vertexShaderPtr = vertexShader; + *fragmentShaderPtr = fragmentShader; + + // Attempt to compile vertex shader + glShaderSource(vertexShader, 1, (const GLchar **) &vsSource, NULL); + glCompileShader(vertexShader); + glGetShaderiv(vertexShader, GL_COMPILE_STATUS, &result); + if (!result) // failed to compile + { + glGetShaderInfoLog(vertexShader, 2048, &len, infoLog); + ErrorLog("Vertex shader failed to compile. Compiler says:\n%s", infoLog); + ret = FAIL; // error + } + + // Attempt to compile fragment shader + glShaderSource(fragmentShader, 1, (const GLchar **) &fsSource, NULL); + glCompileShader(fragmentShader); + glGetShaderiv(fragmentShader, GL_COMPILE_STATUS, &result); + if (!result) // failed to compile + { + glGetShaderInfoLog(fragmentShader, 2048, &len, infoLog); + ErrorLog("Fragment shader failed to compile. Compiler says:\n%s", infoLog); + fprintf(stderr, msg); + ret = FAIL; // error + } + + // Link + glAttachShader(shaderProgram, vertexShader); + glAttachShader(shaderProgram, fragmentShader); + glLinkProgram(shaderProgram); + glGetProgramiv(shaderProgram, GL_LINK_STATUS, &result); + if (result == GL_FALSE) + { + glGetProgramInfoLog(shaderProgram, 2048, &len, infoLog); + ErrorLog("Failed to link shader objects. Linker says:\n%s\n", infoLog); + ret = FAIL; // error + } + + // Enable the shader (if no errors) + if (ret == OKAY) + glUseProgram(shaderProgram); + + // Clean up and quit +Quit: + if ((vsSource != NULL) && (vsFile != NULL)) // loaded from file, must delete + delete [] vsSource; + if ((fsSource != NULL) && (fsFile != NULL)) // "" + delete [] fsSource; + return ret; +} + +void DestroyShaderProgram(GLuint shaderProgram, GLuint vertexShader, GLuint fragmentShader) +{ + // In case LoadShaderProgram() failed above due to lack of OpenGL 2.0+ functions... + if ((glUseProgram==NULL) || (glDeleteShader==NULL) || (glDeleteProgram==NULL)) + return; + + glUseProgram(0); // return to fixed function pipeline + glDeleteShader(vertexShader); + glDeleteShader(fragmentShader); + glDeleteProgram(shaderProgram); +} diff --git a/Graphics/Shader.h b/Graphics/Shader.h new file mode 100644 index 0000000..c456af9 --- /dev/null +++ b/Graphics/Shader.h @@ -0,0 +1,73 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Shader.h + * + * OpenGL shader management functions. + */ + +#ifndef INCLUDED_SHADER_H +#define INCLUDED_SHADER_H + +#include "Pkgs/glew.h" + +/* + * LoadShaderProgram(shaderProgramPtr, vertexShaderPtr, fragmentShaderPtr, + * vsFile, fsFile, vsString, fsString): + * + * Loads and creates an OpenGL shader program. + * + * Parameters: + * shaderProgramPtr Pointer to where OpenGL shader program handle is + * written. + * vertexShaderPtr Pointer to where vertex shader handle is written. + * fragmentShaderPtr Pointer for fragment shader. + * vsFile Vertex shader file path. If this is not NULL, the + * vertex shader is loaded from the file. + * fsFile Fragment shader file path. If this is not NULL, the + * fragment shader is loaded from the file. + * vsString String containing the vertex shader. + * fsString String containing the fragment shader. + * + * Returns: + * OKAY is successfully loaded, otherwise FAIL. Prints own error messages. + */ +extern BOOL LoadShaderProgram(GLuint *shaderProgramPtr, GLuint *vertexShaderPtr, + GLuint *fragmentShaderPtr, const char *vsFile, + const char *fsFile, const char *vsString, + const char *fsString); + +/* + * DestroyShaderProgram(shaderProgram, vertexShader, fragmentShader): + * + * Removes shaders and returns to the fixed function OpenGL pipeline. + * + * Parameters: + * shaderProgram Handle for shader program. + * vertexShader Handle for vertex shader. + * fragmentShader Handle for fragment shader. + */ +extern void DestroyShaderProgram(GLuint shaderProgram, GLuint vertexShader, + GLuint fragmentShader); + + +#endif // INCLUDED_SHADER_H diff --git a/Graphics/Shaders/DIR.txt b/Graphics/Shaders/DIR.txt new file mode 100644 index 0000000..fca6919 --- /dev/null +++ b/Graphics/Shaders/DIR.txt @@ -0,0 +1,2 @@ +Shader source files go here. Completed versions of the shader files should be +copied into Src/Graphics/Shaders3D.h and Src/Graphics/Shaders2D.h. \ No newline at end of file diff --git a/Graphics/Shaders/Fragment.glsl b/Graphics/Shaders/Fragment.glsl new file mode 100644 index 0000000..5c5cc9c --- /dev/null +++ b/Graphics/Shaders/Fragment.glsl @@ -0,0 +1,194 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Fragment.glsl + * + * Fragment shader for 3D rendering. + */ + +#version 120 + +// Global uniforms +uniform sampler2D textureMap; // complete texture map, 2048x2048 texels +uniform vec4 spotEllipse; // spotlight ellipse position: .x=X position (screen coordinates), .y=Y position, .z=half-width, .w=half-height) +uniform vec2 spotRange; // spotlight Z range: .x=start (viewspace coordinates), .y=limit +uniform vec3 spotColor; // spotlight RGB color + +// Inputs from vertex shader +varying vec4 fsSubTexture; // .x=texture X, .y=texture Y, .z=texture width, .w=texture height (all in texels) +varying vec4 fsTexParams; // .x=texture enable (if 1, else 0), .y=use transparency (if > 0), .z=U wrap mode (1=mirror, 0=repeat), .w=V wrap mode +varying float fsTexFormat; // .x=T1RGB5 contour texture (if > 0) +varying float fsTransLevel; // translucence level, 0.0 (transparent) to 1.0 (opaque) +varying vec3 fsLightIntensity; // lighting intensity +varying float fsFogFactor; // fog factor +varying float fsViewZ; // Z distance to fragment from viewpoint at origin + +/* + * WrapTexelCoords(): + * + * Computes the normalized OpenGL S,T coordinates within the 2048x2048 texture + * sheet, taking into account wrapping behavior. + * + * Computing normalized OpenGL texture coordinates (0 to 1) within the + * Real3D texture sheet: + * + * If the texture is not mirrored, we simply have to clamp the + * coordinates to fit within the texture dimensions, add the texture + * X, Y position to select the appropriate one, and normalize by 2048 + * (the dimensions of the Real3D texture sheet). + * + * = [(u,v)%(w,h)+(x,y)]/(2048,2048) + * + * If mirroring is enabled, textures are mirrored every odd multiple of + * the original texture. To detect whether we are in an odd multiple, + * simply divide the coordinate by the texture dimension and check + * whether the result is odd. Then, clamp the coordinates as before but + * subtract from the last texel to mirror them: + * + * = [M*((w-1,h-1)-(u,v)%(w,h)) + (1-M)*(u,v)%(w,h) + (x,y)]/(2048,2048) + * where M is 1.0 if the texture must be mirrored. + * + * As an optimization, this function computes TWO texture coordinates + * simultaneously. The first is texCoord.xy, the second is in .zw. The other + * parameters must have .xy = .zw. + */ +vec4 WrapTexelCoords(vec4 texCoord, vec4 texOffset, vec4 texSize, vec4 mirrorEnable) +{ + vec4 clampedCoord, mirror, glTexCoord; + + clampedCoord = mod(texCoord,texSize); // clamp coordinates to within texture size + mirror = mirrorEnable * mod(floor(texCoord/texSize),2.0); // whether this texel needs to be mirrored + + glTexCoord = ( mirror*(texSize-clampedCoord) + + (vec4(1.0,1.0,1.0,1.0)-mirror)*clampedCoord + + texOffset + ) / 2048.0; +/* + glTexCoord = ( mirror*(texSize-vec4(1.0,1.0,1.0,1.0)-clampedCoord) + + (vec4(1.0,1.0,1.0,1.0)-mirror)*clampedCoord + + texOffset + ) / 2048.0; +*/ + return glTexCoord; +} + +/* + * main(): + * + * Fragment shader entry point. + */ + +void main(void) +{ + vec4 uv_top, uv_bot, c[4]; + vec2 r; + vec4 fragColor; + vec2 ellipse; + vec3 lightIntensity; + float insideSpot; + + // Get polygon color for untextured polygons (textured polygons will overwrite) + if (fsTexParams.x==0.0) + fragColor = gl_Color; + else + // Textured polygons: set fragment color to texel value + { + /* + * Bilinear Filtering + * + * In order to get this working on ATI, the number of operations is + * reduced by putting everything into vec4s. uv_top holds the UV + * coordinates for the top two texels (.xy=left, .zw=right) and uv_bot + * is for the lower two. + */ + + // Compute fractional blending factor, r, and lower left corner of texel 0 + uv_bot.xy = gl_TexCoord[0].st-vec2(0.5,0.5); // move into the lower left blending texel + r = uv_bot.xy-floor(uv_bot.xy); // fractional part + uv_bot.xy = floor(uv_bot.xy); // integral part + + // Compute texel coordinates + uv_bot.xy += vec2(0.5,0.5); // offset to center of pixel (should not be needed but it fixes a lot of glitches, esp. on Nvidia) + uv_bot.zw = uv_bot.xy + vec2(1.0,0.0); // compute coordinates of the other three neighbors + uv_top = uv_bot + vec4(0.0,1.0,0.0,1.0); + + // Compute the properly wrapped texel coordinates + uv_top = WrapTexelCoords(uv_top,vec4(fsSubTexture.xy,fsSubTexture.xy),vec4(fsSubTexture.zw,fsSubTexture.zw), vec4(fsTexParams.zw,fsTexParams.zw)); + uv_bot = WrapTexelCoords(uv_bot,vec4(fsSubTexture.xy,fsSubTexture.xy),vec4(fsSubTexture.zw,fsSubTexture.zw), vec4(fsTexParams.zw,fsTexParams.zw)); + + // Fetch the texels + c[0]=texture2D(textureMap,uv_bot.xy); // bottom-left (base texel) + c[1]=texture2D(textureMap,uv_bot.zw); // bottom-right + c[2]=texture2D(textureMap,uv_top.xy); // top-left + c[3]=texture2D(textureMap,uv_top.zw); // top-right + + // Interpolate texels and blend result with material color to determine final (unlit) fragment color + // fragColor = (c[0]*(1.0-r.s)*(1.0-r.t) + c[1]*r.s*(1.0-r.t) + c[2]*(1.0-r.s)*r.t + c[3]*r.s*r.t); + // Faster method: + c[0] += (c[1]-c[0])*r.s; // 2 alu + c[2] += (c[3]-c[2])*r.s; // 2 alu + fragColor = c[0]+(c[2]-c[0])*r.t; //2 alu + + /* + * T1RGB5: + * + * The transparency bit determines whether to discard pixels (if set). + * What is unknown is how this bit behaves when interpolated. OpenGL + * processes it as an alpha value, so it might concievably be blended + * with neighbors. Here, an arbitrary threshold is chosen. + * + * To-do: blending could probably enabled and this would work even + * better with a hard threshold. + * + * Countour processing also seems to be enabled for RGBA4 textures. + * When the alpha value is 0.0 (or close), pixels are discarded + * entirely. + */ + if (fsTexParams.y > 0.0) // contour processing enabled + { + if (fragColor.a < 0.01) // discard anything with alpha == 0 + discard; + } + + // If contour texture and not discarded, force alpha to 1.0 because will later be modified by polygon translucency + if (fsTexFormat > 0.0) // contour (T1RGB5) texture map + fragColor.a = 1.0; + } + + // Compute spotlight and apply lighting + ellipse = (gl_FragCoord.xy-spotEllipse.xy)/spotEllipse.zw; + insideSpot = dot(ellipse,ellipse); + if ((insideSpot <= 1.0) && (fsViewZ>=spotRange.x) && (fsViewZ. + **/ + +/* + * Fragment2D.glsl + * + * Fragment shader for 2D tilemap rendering. + */ + +#version 120 + +// Global uniforms +uniform sampler2D textureMap; // 512x512 layer surface +uniform vec3 colorOffset; // color offset for this layer + +/* + * main(): + * + * Fragment shader entry point. + */ + +void main(void) +{ + gl_FragColor = texture2D(textureMap, gl_TexCoord[0].st); + gl_FragColor.rgb = clamp(gl_FragColor.rgb+colorOffset,0.0,1.0); +} diff --git a/Graphics/Shaders/Fragment_Flat.glsl b/Graphics/Shaders/Fragment_Flat.glsl new file mode 100644 index 0000000..947c3fb --- /dev/null +++ b/Graphics/Shaders/Fragment_Flat.glsl @@ -0,0 +1,142 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Fragment_NoSpotlight.glsl + * + * Fragment shader for 3D rendering. Spotlight effect removed. Fixes fragment + * shader link errors on older ATI Radeon GPUs. + * + * To load external fragment shaders, use the -frag-shader= option when + * starting Supermodel. + */ + +#version 120 + +// Global uniforms +uniform sampler2D textureMap; // complete texture map, 2048x2048 texels +uniform vec4 spotEllipse; // spotlight ellipse position: .x=X position (screen coordinates), .y=Y position, .z=half-width, .w=half-height) +uniform vec2 spotRange; // spotlight Z range: .x=start (viewspace coordinates), .y=limit +uniform vec3 spotColor; // spotlight RGB color + +// Inputs from vertex shader +varying vec4 fsSubTexture; // .x=texture X, .y=texture Y, .z=texture width, .w=texture height (all in texels) +varying vec4 fsTexParams; // .x=texture enable (if 1, else 0), .y=use transparency (if > 0), .z=U wrap mode (1=mirror, 0=repeat), .w=V wrap mode +varying float fsTexFormat; // .x=T1RGB5 contour texture (if > 0) +varying float fsTransLevel; // translucence level, 0.0 (transparent) to 1.0 (opaque) +varying vec3 fsLightIntensity; // lighting intensity +varying float fsFogFactor; // fog factor +varying float fsViewZ; // Z distance to fragment from viewpoint at origin + +/* + * WrapTexelCoords(): + * + * Computes the normalized OpenGL S,T coordinates within the 2048x2048 texture + * sheet, taking into account wrapping behavior. + * + * Computing normalized OpenGL texture coordinates (0 to 1) within the + * Real3D texture sheet: + * + * If the texture is not mirrored, we simply have to clamp the + * coordinates to fit within the texture dimensions, add the texture + * X, Y position to select the appropriate one, and normalize by 2048 + * (the dimensions of the Real3D texture sheet). + * + * = [(u,v)%(w,h)+(x,y)]/(2048,2048) + * + * If mirroring is enabled, textures are mirrored every odd multiple of + * the original texture. To detect whether we are in an odd multiple, + * simply divide the coordinate by the texture dimension and check + * whether the result is odd. Then, clamp the coordinates as before but + * subtract from the last texel to mirror them: + * + * = [M*((w-1,h-1)-(u,v)%(w,h)) + (1-M)*(u,v)%(w,h) + (x,y)]/(2048,2048) + * where M is 1.0 if the texture must be mirrored. + * + * As an optimization, this function computes TWO texture coordinates + * simultaneously. The first is texCoord.xy, the second is in .zw. The other + * parameters must have .xy = .zw. + */ +vec4 WrapTexelCoords(vec4 texCoord, vec4 texOffset, vec4 texSize, vec4 mirrorEnable) +{ + vec4 clampedCoord, mirror, glTexCoord; + + clampedCoord = mod(texCoord,texSize); // clamp coordinates to within texture size + mirror = mirrorEnable * mod(floor(texCoord/texSize),2.0); // whether this texel needs to be mirrored + + glTexCoord = ( mirror*(texSize-clampedCoord) + + (vec4(1.0,1.0,1.0,1.0)-mirror)*clampedCoord + + texOffset + ) / 2048.0; +/* + glTexCoord = ( mirror*(texSize-vec4(1.0,1.0,1.0,1.0)-clampedCoord) + + (vec4(1.0,1.0,1.0,1.0)-mirror)*clampedCoord + + texOffset + ) / 2048.0; +*/ + return glTexCoord; +} + +/* + * main(): + * + * Fragment shader entry point. + */ + +void main(void) +{ + vec4 uv_top, uv_bot, c[4]; + vec2 r; + vec4 fragColor; + vec2 ellipse; + vec3 lightIntensity; + float insideSpot; + + // Get polygon color for untextured polygons (textured polygons will overwrite) + if (fsTexParams.x==0.0) + fragColor = gl_Color; + else + // Textured polygons: set fragment color to texel value + { + fragColor = texture2D(textureMap,(fsSubTexture.xy+fsSubTexture.zw/2.0)/2048.0); + //fragColor += texture2D(textureMap,(fsSubTexture.xy+fsSubTexture.zw))/2048.0); + + } + + // Compute spotlight and apply lighting + ellipse = (gl_FragCoord.xy-spotEllipse.xy)/spotEllipse.zw; + insideSpot = dot(ellipse,ellipse); + if ((insideSpot <= 1.0) && (fsViewZ>=spotRange.x) && (fsViewZ. + **/ + +/* + * Fragment_NoSpotlight.glsl + * + * Fragment shader for 3D rendering. Spotlight effect removed. Fixes fragment + * shader link errors on older ATI Radeon GPUs. + * + * To load external fragment shaders, use the -frag-shader= option when + * starting Supermodel. + */ + +#version 120 + +// Global uniforms +uniform sampler2D textureMap; // complete texture map, 2048x2048 texels +uniform vec4 spotEllipse; // spotlight ellipse position: .x=X position (screen coordinates), .y=Y position, .z=half-width, .w=half-height) +uniform vec2 spotRange; // spotlight Z range: .x=start (viewspace coordinates), .y=limit +uniform vec3 spotColor; // spotlight RGB color + +// Inputs from vertex shader +varying vec4 fsSubTexture; // .x=texture X, .y=texture Y, .z=texture width, .w=texture height (all in texels) +varying vec4 fsTexParams; // .x=texture enable (if 1, else 0), .y=use transparency (if > 0), .z=U wrap mode (1=mirror, 0=repeat), .w=V wrap mode +varying float fsTexFormat; // .x=T1RGB5 contour texture (if > 0) +varying float fsTransLevel; // translucence level, 0.0 (transparent) to 1.0 (opaque) +varying vec3 fsLightIntensity; // lighting intensity +varying float fsFogFactor; // fog factor +varying float fsViewZ; // Z distance to fragment from viewpoint at origin + +/* + * WrapTexelCoords(): + * + * Computes the normalized OpenGL S,T coordinates within the 2048x2048 texture + * sheet, taking into account wrapping behavior. + * + * Computing normalized OpenGL texture coordinates (0 to 1) within the + * Real3D texture sheet: + * + * If the texture is not mirrored, we simply have to clamp the + * coordinates to fit within the texture dimensions, add the texture + * X, Y position to select the appropriate one, and normalize by 2048 + * (the dimensions of the Real3D texture sheet). + * + * = [(u,v)%(w,h)+(x,y)]/(2048,2048) + * + * If mirroring is enabled, textures are mirrored every odd multiple of + * the original texture. To detect whether we are in an odd multiple, + * simply divide the coordinate by the texture dimension and check + * whether the result is odd. Then, clamp the coordinates as before but + * subtract from the last texel to mirror them: + * + * = [M*((w-1,h-1)-(u,v)%(w,h)) + (1-M)*(u,v)%(w,h) + (x,y)]/(2048,2048) + * where M is 1.0 if the texture must be mirrored. + * + * As an optimization, this function computes TWO texture coordinates + * simultaneously. The first is texCoord.xy, the second is in .zw. The other + * parameters must have .xy = .zw. + */ +vec4 WrapTexelCoords(vec4 texCoord, vec4 texOffset, vec4 texSize, vec4 mirrorEnable) +{ + vec4 clampedCoord, mirror, glTexCoord; + + clampedCoord = mod(texCoord,texSize); // clamp coordinates to within texture size + mirror = mirrorEnable * mod(floor(texCoord/texSize),2.0); // whether this texel needs to be mirrored + + glTexCoord = ( mirror*(texSize-clampedCoord) + + (vec4(1.0,1.0,1.0,1.0)-mirror)*clampedCoord + + texOffset + ) / 2048.0; +/* + glTexCoord = ( mirror*(texSize-vec4(1.0,1.0,1.0,1.0)-clampedCoord) + + (vec4(1.0,1.0,1.0,1.0)-mirror)*clampedCoord + + texOffset + ) / 2048.0; +*/ + return glTexCoord; +} + +/* + * main(): + * + * Fragment shader entry point. + */ + +void main(void) +{ + vec4 uv_top, uv_bot, c[4]; + vec2 r; + vec4 fragColor; + vec2 ellipse; + vec3 lightIntensity; + float insideSpot; + + // Get polygon color for untextured polygons (textured polygons will overwrite) + if (fsTexParams.x==0.0) + fragColor = gl_Color; + else + // Textured polygons: set fragment color to texel value + { + /* + * Bilinear Filtering + * + * In order to get this working on ATI, the number of operations is + * reduced by putting everything into vec4s. uv_top holds the UV + * coordinates for the top two texels (.xy=left, .zw=right) and uv_bot + * is for the lower two. + */ + + // Compute fractional blending factor, r, and lower left corner of texel 0 + uv_bot.xy = gl_TexCoord[0].st-vec2(0.5,0.5); // move into the lower left blending texel + r = uv_bot.xy-floor(uv_bot.xy); // fractional part + uv_bot.xy = floor(uv_bot.xy); // integral part + + // Compute texel coordinates + uv_bot.xy += vec2(0.5,0.5); // offset to center of pixel (should not be needed but it fixes a lot of glitches, esp. on Nvidia) + uv_bot.zw = uv_bot.xy + vec2(1.0,0.0); // compute coordinates of the other three neighbors + uv_top = uv_bot + vec4(0.0,1.0,0.0,1.0); + + // Compute the properly wrapped texel coordinates + uv_top = WrapTexelCoords(uv_top,vec4(fsSubTexture.xy,fsSubTexture.xy),vec4(fsSubTexture.zw,fsSubTexture.zw), vec4(fsTexParams.zw,fsTexParams.zw)); + uv_bot = WrapTexelCoords(uv_bot,vec4(fsSubTexture.xy,fsSubTexture.xy),vec4(fsSubTexture.zw,fsSubTexture.zw), vec4(fsTexParams.zw,fsTexParams.zw)); + + // Fetch the texels + c[0]=texture2D(textureMap,uv_bot.xy); // bottom-left (base texel) + c[1]=texture2D(textureMap,uv_bot.zw); // bottom-right + c[2]=texture2D(textureMap,uv_top.xy); // top-left + c[3]=texture2D(textureMap,uv_top.zw); // top-right + + // Interpolate texels and blend result with material color to determine final (unlit) fragment color + // fragColor = (c[0]*(1.0-r.s)*(1.0-r.t) + c[1]*r.s*(1.0-r.t) + c[2]*(1.0-r.s)*r.t + c[3]*r.s*r.t); + // Faster method: + c[0] += (c[1]-c[0])*r.s; // 2 alu + c[2] += (c[3]-c[2])*r.s; // 2 alu + fragColor = c[0]+(c[2]-c[0])*r.t; //2 alu + + /* + * T1RGB5: + * + * The transparency bit determines whether to discard pixels (if set). + * What is unknown is how this bit behaves when interpolated. OpenGL + * processes it as an alpha value, so it might concievably be blended + * with neighbors. Here, an arbitrary threshold is chosen. + * + * To-do: blending could probably enabled and this would work even + * better with a hard threshold. + * + * Countour processing also seems to be enabled for RGBA4 textures. + * When the alpha value is 0.0 (or close), pixels are discarded + * entirely. + */ + if (fsTexParams.y > 0.0) // contour processing enabled + { + if (fragColor.a < 0.01) // discard anything with alpha == 0 + discard; + } + + // If contour texture and not discarded, force alpha to 1.0 because will later be modified by polygon translucency + if (fsTexFormat > 0.0) // contour (T1RGB5) texture map + fragColor.a = 1.0; + } + + // Compute spotlight and apply lighting + /*** + ellipse = (gl_FragCoord.xy-spotEllipse.xy)/spotEllipse.zw; + insideSpot = dot(ellipse,ellipse); + if ((insideSpot <= 1.0) && (fsViewZ>=spotRange.x) && (fsViewZ. + **/ + +/* + * Vertex.glsl + * + * Vertex shader for 3D rendering. + */ + +#version 120 + +// Global uniforms +uniform mat4 modelViewMatrix; // model -> view space matrix +uniform mat4 projectionMatrix; // view space -> screen space matrix +uniform vec3 lighting[2]; // lighting state (lighting[0] = sun direction, lighting[1].x,y = diffuse, ambient intensities from 0-1.0) +uniform vec4 spotEllipse; // spotlight ellipse position: .x=X position (normalized device coordinates), .y=Y position, .z=half-width, .w=half-height) +uniform vec2 spotRange; // spotlight Z range: .x=start (viewspace coordinates), .y=limit +uniform vec3 spotColor; // spotlight RGB color + +// Custom vertex attributes +attribute vec4 subTexture; // .x=texture X, .y=texture Y, .z=texture width, .w=texture height (all in texels) +attribute vec4 texParams; // .x=texture enable (if 1, else 0), .y=use transparency (if >=0), .z=U wrap mode (1=mirror, 0=repeat), .w=V wrap mode +attribute float texFormat; // .x=T1RGB5 contour texture (if > 0) +attribute float transLevel; // translucence level, 0.0 (transparent) to 1.0 (opaque). if less than 1.0, replace alpha value +attribute float lightEnable; // lighting enabled (1.0) or luminous (0.0), drawn at full intensity +attribute float fogIntensity; // fog intensity (1.0, full fog effect, 0.0, no fog) + +// Custom outputs to fragment shader +varying vec4 fsSubTexture; +varying vec4 fsTexParams; +varying float fsTexFormat; +varying float fsTransLevel; +varying vec3 fsLightIntensity; // total light intensity for this vertex +varying float fsFogFactor; // fog factor +varying float fsViewZ; + +// Gets the 3x3 matrix out of a 4x4 (because mat3(mat4matrix) does not work on ATI!) +mat3 GetLinearPart( mat4 m ) +{ + mat3 result; + + result[0][0] = m[0][0]; + result[0][1] = m[0][1]; + result[0][2] = m[0][2]; + + result[1][0] = m[1][0]; + result[1][1] = m[1][1]; + result[1][2] = m[1][2]; + + result[2][0] = m[2][0]; + result[2][1] = m[2][1]; + result[2][2] = m[2][2]; + + return result; +} + +void main(void) +{ + vec3 viewVertex; // vertex coordinates in view space + vec3 viewNormal; // vertex normal in view space + vec3 sunVector; // sun lighting vector (as reflecting away from vertex) + float sunFactor; // sun light projection along vertex normal (0.0 to 1.0) + vec3 halfway; + float specFactor; + + // Transform vertex + gl_Position = projectionMatrix * modelViewMatrix * gl_Vertex; + viewVertex = vec3(modelViewMatrix * gl_Vertex); + + /* + * Modulation + * + * Polygon color serves as material color (modulating the light intensity) + * for textured polygons. The fragment shader will ignore (overwrite) the + * the color passed to it if the fragment is textured. + * + * Untextured fragments must be set to the polygon color and the light + * intensity is initialized to 1.0 here. Alpha must be set to 1.0 because + * the fragment shader multiplies it by the polygon translucency setting. + * + * TO-DO: Does OpenGL set alpha to 1.0 by default if no alpha is specified + * for the vertex? If so, we can remove that line from here. + */ + + gl_FrontColor = gl_Color; // untextured polygons will use this + gl_FrontColor.a = 1.0; + fsLightIntensity = vec3(1.0,1.0,1.0); + if (texParams.x > 0.0) // textured + fsLightIntensity *= gl_Color.rgb; + + /* + * Sun Light + * + * Parallel light source and ambient lighting are only applied for non- + * luminous polygons. + */ + if (lightEnable > 0.5) // not luminous + { + // Normal -> view space + viewNormal = normalize(GetLinearPart(modelViewMatrix)*gl_Normal); + + // Real3D -> OpenGL view space convention (TO-DO: do this outside of shader) + sunVector = lighting[0]*vec3(1.0,-1.0,-1.0); + + // Compute diffuse factor for sunlight + sunFactor = max(dot(sunVector,viewNormal),0.0); + + // Total light intensity: sum of all components + fsLightIntensity *= (sunFactor*lighting[1].x+lighting[1].y); + fsLightIntensity = clamp(fsLightIntensity,0.0,1.0); + } + + // Fog + float z = length(viewVertex); + fsFogFactor = clamp(1.0-fogIntensity*(gl_Fog.start+z*gl_Fog.density), 0.0, 1.0); + + // Pass viewspace Z coordinate (for spotlight) + fsViewZ = -viewVertex.z; // convert Z from GL->Real3D convention (want +Z to be further into screen) + + // Pass remaining parameters to fragment shader + gl_TexCoord[0] = gl_MultiTexCoord0; + fsSubTexture = subTexture; + fsTexParams = texParams; + fsTransLevel = transLevel; + fsTexFormat = texFormat; +} diff --git a/Graphics/Shaders/Vertex2D.glsl b/Graphics/Shaders/Vertex2D.glsl new file mode 100644 index 0000000..e2fc788 --- /dev/null +++ b/Graphics/Shaders/Vertex2D.glsl @@ -0,0 +1,34 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Vertex2D.glsl + * + * Vertex shader for 2D tilemap rendering. + */ + +#version 120 + +void main(void) +{ + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex; +} \ No newline at end of file diff --git a/Graphics/Shaders2D.h b/Graphics/Shaders2D.h new file mode 100644 index 0000000..46d2763 --- /dev/null +++ b/Graphics/Shaders2D.h @@ -0,0 +1,119 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Shaders2D.h + * + * Header file containing the 2D vertex and fragment shaders. + */ + +#ifndef INCLUDED_SHADERS2D_H +#define INCLUDED_SHADERS2D_H + +// Vertex shader +static const char vertexShaderSource[] = +{ +"/** \n" +" ** Supermodel \n" +" ** A Sega Model 3 Arcade Emulator. \n" +" ** Copyright 2011 Bart Trzynadlowski \n" +" ** \n" +" ** This file is part of Supermodel. \n" +" ** \n" +" ** Supermodel is free software: you can redistribute it and/or modify it under \n" +" ** the terms of the GNU General Public License as published by the Free \n" +" ** Software Foundation, either version 3 of the License, or (at your option) \n" +" ** any later version. \n" +" ** \n" +" ** Supermodel is distributed in the hope that it will be useful, but WITHOUT \n" +" ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or \n" +" ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for \n" +" ** more details. \n" +" ** \n" +" ** You should have received a copy of the GNU General Public License along \n" +" ** with Supermodel. If not, see . \n" +" **/ \n" +"\n" +"/* \n" +" * Vertex2D.glsl \n" +" * \n" +" * Vertex shader for 2D tilemap rendering. \n" +" */ \n" +" \n" +"#version 120 \n" +"\n" +"void main(void) \n" +"{ \n" +" gl_TexCoord[0] = gl_MultiTexCoord0; \n" +" gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex; \n" +"}\n" +}; + +// Fragment shader +static const char fragmentShaderSource[] = +{ +"/** \n" +" ** Supermodel \n" +" ** A Sega Model 3 Arcade Emulator. \n" +" ** Copyright 2011 Bart Trzynadlowski \n" +" ** \n" +" ** This file is part of Supermodel. \n" +" ** \n" +" ** Supermodel is free software: you can redistribute it and/or modify it under \n" +" ** the terms of the GNU General Public License as published by the Free \n" +" ** Software Foundation, either version 3 of the License, or (at your option) \n" +" ** any later version. \n" +" ** \n" +" ** Supermodel is distributed in the hope that it will be useful, but WITHOUT \n" +" ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or \n" +" ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for \n" +" ** more details. \n" +" ** \n" +" ** You should have received a copy of the GNU General Public License along \n" +" ** with Supermodel. If not, see . \n" +" **/ \n" +"\n" +"/* \n" +" * Fragment2D.glsl \n" +" * \n" +" * Fragment shader for 2D tilemap rendering. \n" +" */ \n" +"\n" +"#version 120 \n" +"\n" +"// Global uniforms \n" +"uniform sampler2D textureMap; // 512x512 layer surface \n" +"uniform vec3 colorOffset; // color offset for this layer \n" +"\n" +"/* \n" +" * main(): \n" +" * \n" +" * Fragment shader entry point. \n" +" */ \n" +"\n" +"void main(void) \n" +"{ \n" +" gl_FragColor = texture2D(textureMap, gl_TexCoord[0].st); \n" +" gl_FragColor.rgb = clamp(gl_FragColor.rgb+colorOffset,0.0,1.0); \n" +"}\n" +}; + +#endif // INCLUDED_SHADERS2D_H diff --git a/Graphics/Shaders3D.h b/Graphics/Shaders3D.h new file mode 100644 index 0000000..2a9c3ca --- /dev/null +++ b/Graphics/Shaders3D.h @@ -0,0 +1,374 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Shaders3D.h + * + * Header file containing the 3D vertex and fragment shaders. + */ + +#ifndef INCLUDED_SHADERS3D_H +#define INCLUDED_SHADERS3D_H + +// Vertex shader +static const char vertexShaderSource[] = +{ +"/** \n" +" ** Supermodel \n" +" ** A Sega Model 3 Arcade Emulator. \n" +" ** Copyright 2011 Bart Trzynadlowski \n" +" ** \n" +" ** This file is part of Supermodel. \n" +" ** \n" +" ** Supermodel is free software: you can redistribute it and/or modify it under \n" +" ** the terms of the GNU General Public License as published by the Free \n" +" ** Software Foundation, either version 3 of the License, or (at your option) \n" +" ** any later version. \n" +" ** \n" +" ** Supermodel is distributed in the hope that it will be useful, but WITHOUT \n" +" ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or \n" +" ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for \n" +" ** more details. \n" +" ** \n" +" ** You should have received a copy of the GNU General Public License along \n" +" ** with Supermodel. If not, see . \n" +" **/ \n" +"\n" +"/* \n" +" * Vertex.glsl \n" +" * \n" +" * Vertex shader for 3D rendering. \n" +" */ \n" +"\n" +"#version 120 \n" +"\n" +"// Global uniforms \n" +"uniform mat4 modelViewMatrix; // model -> view space matrix \n" +"uniform mat4 projectionMatrix; // view space -> screen space matrix \n" +"uniform vec3 lighting[2]; // lighting state (lighting[0] = sun direction, lighting[1].x,y = diffuse, ambient intensities from 0-1.0) \n" +"uniform vec4 spotEllipse; // spotlight ellipse position: .x=X position (normalized device coordinates), .y=Y position, .z=half-width, .w=half-height) \n" +"uniform vec2 spotRange; // spotlight Z range: .x=start (viewspace coordinates), .y=limit \n" +"uniform vec3 spotColor; // spotlight RGB color \n" +"\n" +"// Custom vertex attributes \n" +"attribute vec4 subTexture; // .x=texture X, .y=texture Y, .z=texture width, .w=texture height (all in texels) \n" +"attribute vec4 texParams; // .x=texture enable (if 1, else 0), .y=use transparency (if >=0), .z=U wrap mode (1=mirror, 0=repeat), .w=V wrap mode \n" +"attribute float texFormat; // .x=T1RGB5 contour texture (if > 0) \n" +"attribute float transLevel; // translucence level, 0.0 (transparent) to 1.0 (opaque). if less than 1.0, replace alpha value \n" +"attribute float lightEnable; // lighting enabled (1.0) or luminous (0.0), drawn at full intensity \n" +"attribute float fogIntensity; // fog intensity (1.0, full fog effect, 0.0, no fog) \n" +"\n" +"// Custom outputs to fragment shader \n" +"varying vec4 fsSubTexture; \n" +"varying vec4 fsTexParams; \n" +"varying float fsTexFormat; \n" +"varying float fsTransLevel; \n" +"varying vec3 fsLightIntensity; // total light intensity for this vertex \n" +"varying float fsFogFactor; // fog factor \n" +"varying float fsViewZ; \n" +"\n" +"// Gets the 3x3 matrix out of a 4x4 (because mat3(mat4matrix) does not work on ATI!) \n" +"mat3 GetLinearPart( mat4 m ) \n" +"{ \n" +" mat3 result; \n" +"\n" +" result[0][0] = m[0][0]; \n" +" result[0][1] = m[0][1]; \n" +" result[0][2] = m[0][2]; \n" +"\n" +" result[1][0] = m[1][0]; \n" +" result[1][1] = m[1][1]; \n" +" result[1][2] = m[1][2]; \n" +"\n" +" result[2][0] = m[2][0]; \n" +" result[2][1] = m[2][1]; \n" +" result[2][2] = m[2][2]; \n" +"\n" +" return result; \n" +"} \n" +"\n" +"void main(void) \n" +"{ \n" +" vec3 viewVertex; // vertex coordinates in view space \n" +" vec3 viewNormal; // vertex normal in view space \n" +" vec3 sunVector; // sun lighting vector (as reflecting away from vertex) \n" +" float sunFactor; // sun light projection along vertex normal (0.0 to 1.0) \n" +" vec3 halfway; \n" +" float specFactor; \n" +" \n" +" // Transform vertex \n" +" gl_Position = projectionMatrix * modelViewMatrix * gl_Vertex; \n" +" viewVertex = vec3(modelViewMatrix * gl_Vertex); \n" +" \n" +" /* \n" +" * Modulation \n" +" * \n" +" * Polygon color serves as material color (modulating the light intensity) \n" +" * for textured polygons. The fragment shader will ignore (overwrite) the \n" +" * the color passed to it if the fragment is textured. \n" +" * \n" +" * Untextured fragments must be set to the polygon color and the light \n" +" * intensity is initialized to 1.0 here. Alpha must be set to 1.0 because \n" +" * the fragment shader multiplies it by the polygon translucency setting. \n" +" * \n" +" * To-do: Does OpenGL set alpha to 1.0 by default if no alpha is specified \n" +" * for the vertex? If so, we can remove that line from here. \n" +" */ \n" +" \n" +" gl_FrontColor = gl_Color; // untextured polygons will use this \n" +" gl_FrontColor.a = 1.0; \n" +" fsLightIntensity = vec3(1.0,1.0,1.0); \n" +" if (texParams.x > 0.0) // textured \n" +" fsLightIntensity *= gl_Color.rgb; \n" +" \n" +" /* \n" +" * Sun Light \n" +" * \n" +" * Parallel light source and ambient lighting are only applied for non- \n" +" * luminous polygons. \n" +" */ \n" +" if (lightEnable > 0.5) // not luminous \n" +" { \n" +" // Normal -> view space \n" +" viewNormal = normalize(GetLinearPart(modelViewMatrix)*gl_Normal); \n" +" \n" +" // Real3D -> OpenGL view space convention (TO-DO: do this outside of shader) \n" +" sunVector = lighting[0]*vec3(1.0,-1.0,-1.0); \n" +" \n" +" // Compute diffuse factor for sunlight \n" +" sunFactor = max(dot(sunVector,viewNormal),0.0); \n" +" \n" +" // Total light intensity: sum of all components \n" +" fsLightIntensity *= (sunFactor*lighting[1].x+lighting[1].y); \n" +" fsLightIntensity = clamp(fsLightIntensity,0.0,1.0); \n" +" } \n" +" \n" +" // Fog \n" +" float z = length(viewVertex); \n" +" fsFogFactor = clamp(1.0-fogIntensity*(gl_Fog.start+z*gl_Fog.density), 0.0, 1.0); \n" +" \n" +" // Pass viewspace Z coordinate (for spotlight) \n" +" fsViewZ = -viewVertex.z; // convert Z from GL->Real3D convention (want +Z to be further into screen) \n" +" \n" +" // Pass remaining parameters to fragment shader \n" +" gl_TexCoord[0] = gl_MultiTexCoord0; \n" +" fsSubTexture = subTexture; \n" +" fsTexParams = texParams; \n" +" fsTransLevel = transLevel; \n" +" fsTexFormat = texFormat; \n" +"}\n" +}; + + +// Fragment shader +static const char fragmentShaderSource[] = +{ +"/** \n" +" ** Supermodel \n" +" ** A Sega Model 3 Arcade Emulator. \n" +" ** Copyright 2011 Bart Trzynadlowski \n" +" ** \n" +" ** This file is part of Supermodel. \n" +" ** \n" +" ** Supermodel is free software: you can redistribute it and/or modify it under \n" +" ** the terms of the GNU General Public License as published by the Free \n" +" ** Software Foundation, either version 3 of the License, or (at your option) \n" +" ** any later version. \n" +" ** \n" +" ** Supermodel is distributed in the hope that it will be useful, but WITHOUT \n" +" ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or \n" +" ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for \n" +" ** more details. \n" +" ** \n" +" ** You should have received a copy of the GNU General Public License along \n" +" ** with Supermodel. If not, see . \n" +" **/ \n" +" \n" +"/* \n" +" * Fragment.glsl \n" +" * \n" +" * Fragment shader for 3D rendering. \n" +" */ \n" +" \n" +"#version 120 \n" +" \n" +"// Global uniforms \n" +"uniform sampler2D textureMap; // complete texture map, 2048x2048 texels \n" +"uniform vec4 spotEllipse; // spotlight ellipse position: .x=X position (normalized device coordinates), .y=Y position, .z=half-width, .w=half-height) \n" +"uniform vec2 spotRange; // spotlight Z range: .x=start (viewspace coordinates), .y=limit \n" +"uniform vec3 spotColor; // spotlight RGB color \n" +"\n" +"// Inputs from vertex shader \n" +"varying vec4 fsSubTexture; // .x=texture X, .y=texture Y, .z=texture width, .w=texture height (all in texels) \n" +"varying vec4 fsTexParams; // .x=texture enable (if 1, else 0), .y=use transparency (if > 0), .z=U wrap mode (1=mirror, 0=repeat), .w=V wrap mode \n" +"varying float fsTexFormat; // .x=T1RGB5 contour texture (if > 0) \n" +"varying float fsTransLevel; // translucence level, 0.0 (transparent) to 1.0 (opaque) \n" +"varying vec3 fsLightIntensity; // lighting intensity \n" +"varying float fsFogFactor; // fog factor \n" +"varying float fsViewZ; // Z distance to fragment from viewpoint at origin \n" +"\n" +"/* \n" +" * WrapTexelCoords(): \n" +" * \n" +" * Computes the normalized OpenGL S,T coordinates within the 2048x2048 texture \n" +" * sheet, taking into account wrapping behavior. \n" +" * \n" +" * Computing normalized OpenGL texture coordinates (0 to 1) within the \n" +" * Real3D texture sheet: \n" +" * \n" +" * If the texture is not mirrored, we simply have to clamp the \n" +" * coordinates to fit within the texture dimensions, add the texture \n" +" * X, Y position to select the appropriate one, and normalize by 2048 \n" +" * (the dimensions of the Real3D texture sheet). \n" +" * \n" +" * = [(u,v)%(w,h)+(x,y)]/(2048,2048) \n" +" * \n" +" * If mirroring is enabled, textures are mirrored every odd multiple of \n" +" * the original texture. To detect whether we are in an odd multiple, \n" +" * simply divide the coordinate by the texture dimension and check \n" +" * whether the result is odd. Then, clamp the coordinates as before but \n" +" * subtract from the last texel to mirror them: \n" +" * \n" +" * = [M*((w-1,h-1)-(u,v)%(w,h)) + (1-M)*(u,v)%(w,h) + (x,y)]/(2048,2048) \n" +" * where M is 1.0 if the texture must be mirrored. \n" +" * \n" +" * As an optimization, this function computes TWO texture coordinates \n" +" * simultaneously. The first is texCoord.xy, the second is in .zw. The other \n" +" * parameters must have .xy = .zw. \n" +" */ \n" +"vec4 WrapTexelCoords(vec4 texCoord, vec4 texOffset, vec4 texSize, vec4 mirrorEnable) \n" +"{ \n" +" vec4 clampedCoord, mirror, glTexCoord; \n" +" \n" +" clampedCoord = mod(texCoord,texSize); // clamp coordinates to within texture size \n" +" mirror = mirrorEnable * mod(floor(texCoord/texSize),2.0); // whether this texel needs to be mirrored \n" +" \n" +" glTexCoord = ( mirror*(texSize-clampedCoord) + \n" +" (vec4(1.0,1.0,1.0,1.0)-mirror)*clampedCoord + \n" +" texOffset \n" +" ) / 2048.0; \n" +" return glTexCoord; \n" +"} \n" +"\n" +"/* \n" +" * main(): \n" +" * \n" +" * Fragment shader entry point. \n" +" */ \n" +"\n" +"void main(void) \n" +"{ \n" +" vec4 uv_top, uv_bot, c[4]; \n" +" vec2 r; \n" +" vec4 fragColor; \n" +" vec2 ellipse; \n" +" vec3 lightIntensity; \n" +" float insideSpot; \n" +" \n" +" // Get polygon color for untextured polygons (textured polygons will overwrite) \n" +" if (fsTexParams.x==0.0) \n" +" fragColor = gl_Color; \n" +" else \n" +" // Textured polygons: set fragment color to texel value \n" +" { \n" +" /* \n" +" * Bilinear Filtering \n" +" * \n" +" * In order to get this working on ATI, the number of operations is \n" +" * reduced by putting everything into vec4s. uv_top holds the UV \n" +" * coordinates for the top two texels (.xy=left, .zw=right) and uv_bot \n" +" * is for the lower two. \n" +" */ \n" +" \n" +" // Compute fractional blending factor, r, and lower left corner of texel 0 \n" +" uv_bot.xy = gl_TexCoord[0].st-vec2(0.5,0.5); // move into the lower left blending texel \n" +" r = uv_bot.xy-floor(uv_bot.xy); // fractional part \n" +" uv_bot.xy = floor(uv_bot.xy); // integral part \n" +" \n" +" // Compute texel coordinates \n" +" uv_bot.xy += vec2(0.5,0.5); // offset to center of pixel (should not be needed but it fixes a lot of glitches, esp. on Nvidia) \n" +" uv_bot.zw = uv_bot.xy + vec2(1.0,0.0); // compute coordinates of the other three neighbors \n" +" uv_top = uv_bot + vec4(0.0,1.0,0.0,1.0); \n" +" \n" +" // Compute the properly wrapped texel coordinates \n" +" uv_top = WrapTexelCoords(uv_top,vec4(fsSubTexture.xy,fsSubTexture.xy),vec4(fsSubTexture.zw,fsSubTexture.zw), vec4(fsTexParams.zw,fsTexParams.zw)); \n" +" uv_bot = WrapTexelCoords(uv_bot,vec4(fsSubTexture.xy,fsSubTexture.xy),vec4(fsSubTexture.zw,fsSubTexture.zw), vec4(fsTexParams.zw,fsTexParams.zw)); \n" +" \n" +" // Fetch the texels \n" +" c[0]=texture2D(textureMap,uv_bot.xy); // bottom-left (base texel) \n" +" c[1]=texture2D(textureMap,uv_bot.zw); // bottom-right \n" +" c[2]=texture2D(textureMap,uv_top.xy); // top-left \n" +" c[3]=texture2D(textureMap,uv_top.zw); // top-right \n" +" \n" +" // Interpolate texels and blend result with material color to determine final (unlit) fragment color \n" +" // fragColor = (c[0]*(1.0-r.s)*(1.0-r.t) + c[1]*r.s*(1.0-r.t) + c[2]*(1.0-r.s)*r.t + c[3]*r.s*r.t); \n" +" // Faster method: \n" +" c[0] += (c[1]-c[0])*r.s; // 2 alu \n" +" c[2] += (c[3]-c[2])*r.s; // 2 alu \n" +" fragColor = c[0]+(c[2]-c[0])*r.t; // 2 alu \n" +" \n" +" /* \n" +" * T1RGB5: \n" +" * \n" +" * The transparency bit determines whether to discard pixels (if set). \n" +" * What is unknown is how this bit behaves when interpolated. OpenGL \n" +" * processes it as an alpha value, so it might concievably be blended \n" +" * with neighbors. Here, an arbitrary threshold is chosen. \n" +" * \n" +" * To-do: blending could probably enabled and this would work even \n" +" * better with a hard threshold. \n" +" * \n" +" * Countour processing also seems to be enabled for RGBA4 textures. \n" +" * When the alpha value is 0.0 (or close), pixels are discarded \n" +" * entirely. \n" +" */ \n" +" if (fsTexParams.y > 0.0) // contour processing enabled \n" +" { \n" +" if (fragColor.a < 0.01) // discard anything with alpha == 0 \n" +" discard; \n" +" } \n" +" \n" +" // If contour texture and not discarded, force alpha to 1.0 because will later be modified by polygon translucency \n" +" if (fsTexFormat > 0.0) // contour (T1RGB5) texture map \n" +" fragColor.a = 1.0; \n" +" } \n" +" \n" +" // Compute spotlight and apply lighting \n" +" ellipse = (gl_FragCoord.xy-spotEllipse.xy)/spotEllipse.zw; \n" +" insideSpot = dot(ellipse,ellipse); \n" +" if ((insideSpot <= 1.0) && (fsViewZ>=spotRange.x) && (fsViewZ. + **/ + +/* + * INIFile.cpp + * + * INI file management. Implementation of the CINIFile class. + * + * To-Do List + * ---------- + * - Add boolean on/off, true/false keywords. + * - Allow a "default" section to be specified (other than ""). + * - Note that linePtr does not necessarily correspond to actual lines in the + * file (newlines should be counted by the tokenizer for that). + * + * Grammar + * ------- + * + * Section: '[' Identifier ']' + * Line: Identifier '=' Argument + * Argument: Number + * String + * + * Overview + * -------- + * INI files are linear in nature, divided into sections. Each section has + * settings associated with it which may be either numerical values or strings. + * Presently, only unsigned 32-bit integers are supported. + * + * INI files are first opened, then parsed, and finally closed. The parse tree + * is cleared only during object construction and when the INI file is closed. + * Default settings may be inserted before a file is opened or parsed. When an + * INI file is written out, the current INI file on the disk is cleared. If an + * error occurs during this process, the data will be lost. + * + * Blank sections (sections for which no settings are defined) are not stored + * in the parse tree. Sections are added only when a setting is found in that + * section. A default section name can be specified (for settings that are not + * associated with any section), otherwise an empty string ("") is used. + */ + +#include "Supermodel.h" +using namespace std; + + +/****************************************************************************** + Basic Functions +******************************************************************************/ + +BOOL CINIFile::Write(const char *comment) +{ + BOOL writeSuccess; + + // In order to truncate, we must close and reopen as truncated + File.close(); + File.clear(); // required to clear EOF flag (open() does not clear) + File.open(FileName.c_str(),fstream::out|fstream::trunc); + if (File.fail()) + { + return FAIL; + } + + // Output comment + if (comment != NULL) + File << comment << endl; + + // Iterate through all sections sequentially + for (unsigned i = 0; i < Sections.size(); i++) + { + // Output section name + if (Sections[i].Name != "") // if null name, don't output section at all + File << "[ " << Sections[i].Name << " ]" << endl << endl; + + // Iterate through all settings within this section + for (unsigned j = 0; j < Sections[i].Settings.size(); j++) + { + // Output setting + File << Sections[i].Settings[j].Name << " = "; + if (Sections[i].Settings[j].isNumber) + File << Sections[i].Settings[j].value << endl; + else + File << '\"' << Sections[i].Settings[j].String << '\"' << endl; + } + + // New line + File << endl; + } + + writeSuccess = File.good()?OKAY:FAIL; + + // Close and reopen as read/write + File.close(); + File.open(FileName.c_str(),fstream::in|fstream::out); + if (File.fail()) + { + //printf("unable to re-open %s for reading/writing\n", FileName.c_str()); + return FAIL; + } + + // Report any errors that occurred during writing + return writeSuccess; +} + +BOOL CINIFile::Open(const char *fileNameStr) +{ + FileName = fileNameStr; + File.open(fileNameStr, fstream::in|fstream::out); + if (File.fail()) + { + //printf("unable to open %s\n", fileNameStr); + return FAIL; + } + return OKAY; +} + +void CINIFile::Close(void) +{ + File.close(); + Sections.clear(); // clear the parse tree! +} + + +/****************************************************************************** + Management of Settings +******************************************************************************/ + +// Finds index of section in the section list. Returns FAIL if not found. +BOOL CINIFile::LookUpSection(unsigned *idx, string SectionName) +{ + for (unsigned i = 0; i < Sections.size(); i++) + { + if (Sections[i].Name == SectionName) + { + *idx = i; + return OKAY; + } + } + return FAIL; +} + +// Finds index of the setting in the given section. Returns FAIL if not found. +BOOL CINIFile::LookUpSetting(unsigned *idx, unsigned sectionIdx, string SettingName) +{ + for (unsigned i = 0; i < Sections[sectionIdx].Settings.size(); i++) + { + if (Sections[sectionIdx].Settings[i].Name == SettingName) + { + *idx = i; + return OKAY; + } + } + return FAIL; +} + + +// Assigns a value to the given setting, creating the setting if it does not exist. Nulls out the string (sets it to ""). +void CINIFile::Set(string SectionName, string SettingName, unsigned value) +{ + unsigned sectionIdx, settingIdx; + + if (OKAY != LookUpSection(§ionIdx, SectionName)) + { + //printf("unable to find %s:%s, creating section\n", SectionName.c_str(), SettingName.c_str()); + struct Section NewSection; + + NewSection.Name = SectionName; + Sections.push_back(NewSection); + sectionIdx = Sections.size()-1; // the new section will be at the last index + } + + if (OKAY != LookUpSetting(&settingIdx, sectionIdx, SettingName)) + { + //printf("unable to find %s:%s, creating setting\n", SectionName.c_str(), SettingName.c_str()); + struct Setting NewSetting; + + NewSetting.Name = SettingName; + Sections[sectionIdx].Settings.push_back(NewSetting); + settingIdx = Sections[sectionIdx].Settings.size()-1; + } + + // Update value of this setting + Sections[sectionIdx].Settings[settingIdx].isNumber = TRUE; + Sections[sectionIdx].Settings[settingIdx].value = value; + Sections[sectionIdx].Settings[settingIdx].String = ""; +} + +// Assigns the string to the given setting, creating the setting if it does not exist. Zeros out the value. +void CINIFile::Set(string SectionName, string SettingName, string String) +{ + unsigned sectionIdx, settingIdx; + + if (OKAY != LookUpSection(§ionIdx, SectionName)) + { + //printf("unable to find %s:%s, creating section\n", SectionName.c_str(), SettingName.c_str()); + struct Section NewSection; + + NewSection.Name = SectionName; + Sections.push_back(NewSection); + sectionIdx = Sections.size()-1; // the new section will be at the last index + } + + if (OKAY != LookUpSetting(&settingIdx, sectionIdx, SettingName)) + { + //printf("unable to find %s:%s, creating setting\n", SectionName.c_str(), SettingName.c_str()); + struct Setting NewSetting; + + NewSetting.Name = SettingName; + Sections[sectionIdx].Settings.push_back(NewSetting); + settingIdx = Sections[sectionIdx].Settings.size()-1; + } + + // Update string + Sections[sectionIdx].Settings[settingIdx].isNumber = FALSE; + Sections[sectionIdx].Settings[settingIdx].String = String; + Sections[sectionIdx].Settings[settingIdx].value = 0; +} + +// Obtains a numerical setting, if it exists, otherwise does nothing. +BOOL CINIFile::Get(string SectionName, string SettingName, unsigned& value) +{ + unsigned sectionIdx, settingIdx; + + if (OKAY != LookUpSection(§ionIdx, SectionName)) + return FAIL; + if (OKAY != LookUpSetting(&settingIdx, sectionIdx, SettingName)) + return FAIL; + + value = Sections[sectionIdx].Settings[settingIdx].value; + + return OKAY; +} + +// Obtains a string setting, if it exists, otherwise does nothing. +BOOL CINIFile::Get(string SectionName, string SettingName, string& String) +{ + unsigned sectionIdx, settingIdx; + + if (OKAY != LookUpSection(§ionIdx, SectionName)) + return FAIL; + if (OKAY != LookUpSetting(&settingIdx, sectionIdx, SettingName)) + return FAIL; + + String = Sections[sectionIdx].Settings[settingIdx].String; + + return OKAY; +} + + +/****************************************************************************** + Tokenizer + + Never need to check for newlines because it is assumed these have been + stripped by getline(). +******************************************************************************/ + +// Token types +#define TOKEN_INVALID -1 +#define TOKEN_NULL 0 +#define TOKEN_IDENTIFIER 1 +#define TOKEN_NUMBER 2 +#define TOKEN_STRING 3 + + +// Token constructor (initializes token to null) +CINIFile::CToken::CToken(void) +{ + type = TOKEN_NULL; +} + +// Returns true for white space, comment symbol, or null terminator. +static BOOL IsBlank(char c) +{ + if (isspace(c) || (c==';') || (c=='\0')) + return TRUE; + return FALSE; +} + +// Fetches a string. Tolerates all characters between quotes. +CINIFile::CToken CINIFile::GetString(void) +{ + CToken T; + + T.type = TOKEN_STRING; + + // Search for next quote + ++linePtr; + while (1) + { + if (linePtr[0] == '\"') + { + ++linePtr; // so we can find next token + break; + } + else if (linePtr[0] == '\0') + { + //printf("tokenizer: warning: string is missing end quote\n"); + break; + } + else + T.String += linePtr[0]; + + ++linePtr; + } + + return T; +} + +// Fetch number (decimal or hexadecimal integer). linePtr must point to a character and therefore linePtr[1] is guaranteed to be within bounds. +CINIFile::CToken CINIFile::GetNumber(void) +{ + CToken T; + unsigned long long number = 0; + int overflow = 0; + + T.type = TOKEN_NUMBER; + + // Hexadecimal? + if ((linePtr[0]=='0') && ((linePtr[1]=='X') || (linePtr[1]=='x'))) + { + linePtr += 2; // advance to digits + + // Ensure that at we have at least one digit + if (!isxdigit(linePtr[0])) + { + //printf("tokenizer: invalid hexadecimal number\n"); + T.type = TOKEN_INVALID; + return T; + } + + // Read number digit by digit + while (1) + { + if (isxdigit(linePtr[0])) + { + number <<= 4; + if (isdigit(linePtr[0])) + number |= (linePtr[0]-'0'); + else if (isupper(linePtr[0])) + number |= (linePtr[0]-'A'); + else // must be lowercase... + number |= (linePtr[0]-'a'); + ++linePtr; + + // Check for overflows + if (number > 0x00000000FFFFFFFFULL) + overflow = 1; + } + else if (IsBlank(linePtr[0])) + break; + else + { + //printf("tokenizer: invalid hexadecimal number\n"); + T.type = TOKEN_INVALID; + return T; + } + } + } + + // Decimal? + else + { + // Read number digit by digit + while (1) + { + if (isdigit(linePtr[0])) + { + number *= 10; + number += (linePtr[0]-'0'); + ++linePtr; + + // Check for overflows + if (number > 0x00000000FFFFFFFFULL) + overflow = 1; + } + else if (IsBlank(linePtr[0])) + break; + else + { + //printf("tokenizer: invalid number\n"); + T.type = TOKEN_INVALID; + return T; + } + } + } + + //if (overflow) + // printf("tokenizer: number exceeds 32 bits and has been truncated\n"); + + T.number = (unsigned) number; + return T; +} + +// Fetch identifier +CINIFile::CToken CINIFile::GetIdentifier(void) +{ + CToken T; + + T.type = TOKEN_IDENTIFIER; + while (1) + { + if (isalpha(linePtr[0]) || isdigit(linePtr[0]) || (linePtr[0]=='_')) + { + T.String += linePtr[0]; + ++linePtr; + } + else + break; + } + + return T; +} + +// Fetch token +CINIFile::CToken CINIFile::GetToken(void) +{ + CToken T; + + while (1) + { + // Gobble up whitespace + if (isspace(linePtr[0])) + ++linePtr; + + // Comment or end of line + else if ((linePtr[0]==';') || (linePtr[0]=='\0')) + { + T.type = TOKEN_NULL; + return T; + } + + // Delimiters + else if ((linePtr[0]=='[') || (linePtr[0]==']') || (linePtr[0]=='=')) + { + T.type = *linePtr++; + return T; + } + + // Identifier? + else if (isalpha(linePtr[0]) || (linePtr[0] == '_')) + { + T = GetIdentifier(); + return T; + } + + // Number? (+/-?) + else if (isdigit(linePtr[0])) + { + T = GetNumber(); + return T; + } + + // String? + else if (linePtr[0]=='\"') + { + T = GetString(); + return T; + } + + // Illegal symbol + else + break; // return null token + } + + // If we got here, invalid token + T.type = TOKEN_INVALID; + return T; +} + + +/****************************************************************************** + Parser +******************************************************************************/ + +BOOL CINIFile::Parse(void) +{ + CToken T, U, V, W; + string currentSection; // current section we're processing + BOOL parseStatus = OKAY; + + //currentSection = defaultSection; // default "global" section + lineNum = 0; + + if (!File.is_open()) + return FAIL; + File.clear(); + if (!File.good()) + return FAIL; + + while (!File.eof()) + { + ++lineNum; + File.getline(lineBuf,2048); + if (File.fail()) + return FAIL; + linePtr = lineBuf; // beginning of line + + // Top level + T = GetToken(); + U = GetToken(); + V = GetToken(); + W = GetToken(); // should always be null + switch (T.type) + { + // [ Identifier ] + case '[': + if ((U.type==TOKEN_IDENTIFIER) && (V.type==']') && (W.type==TOKEN_NULL)) + { + //printf("Section: %s\n", U.String.c_str()); + currentSection = U.String; + } + else + { + parseStatus = FAIL; + //printf("%d: parse error\n", lineNum); + } + break; + + // Identifier '=' Argument + case TOKEN_IDENTIFIER: + if (U.type != '=') + { + parseStatus = FAIL; + //printf("%d: expected '=' after identifier\n", lineNum); + } + else + { + if (((V.type==TOKEN_NUMBER) || (V.type==TOKEN_STRING)) && (W.type==TOKEN_NULL)) + { + if (V.type == TOKEN_NUMBER) + { + //printf("\t%s = %X\n", T.String.c_str(), V.number); + Set(currentSection, T.String, V.number); + } + else if (V.type == TOKEN_STRING) + { + //printf("\t%s = %s\n", T.String.c_str(), V.String.c_str()); + Set(currentSection, T.String, V.String); + } + } + else + { + parseStatus = FAIL; + //printf("%d: expected a number or string after '='\n", lineNum); + } + } + break; + + // Blank line + case TOKEN_NULL: + break; + + // Illegal + default: + parseStatus = FAIL; + //printf("%d: parse error\n", lineNum); + break; + } + } + + //printf("end of file reached\n"); + return parseStatus; +} diff --git a/INIFile.h b/INIFile.h new file mode 100644 index 0000000..669a7e1 --- /dev/null +++ b/INIFile.h @@ -0,0 +1,198 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * INIFile.h + * + * Header file for INI file management. + */ + +#ifndef INCLUDED_INIFILE_H +#define INCLUDED_INIFILE_H + +// Standard C++ and STL headers +#include +#include +#include +using namespace std; + +/* + * CINIFile: + * + * INI file parser. + */ +class CINIFile +{ +public: + /* + * Get(SectionName, SettingName, value): + * Get(SectionName, SettingName, String): + * + * Obtains the value of a setting associated with a particular section. It + * is assumed that the caller knows whether the setting should be a string + * or an integer value. If the setting was specified as a string in the + * INI file, the value will be set to 0. Otherwise, the string will be set + * to "". + * + * Parameters: + * SectionName String defining the section name. + * SettingName String defining the setting name. + * value Reference to where the setting value will be + * copied. + * String Reference to where the string will be copied. + * + * Returns: + * OKAY if the setting was found, FAIL otherwise. The type is not + * checked. + */ + BOOL Get(string SectionName, string SettingName, unsigned& value); + BOOL Get(string SectionName, string SettingName, string& String); + + /* + * Set(SectionName, SettingName, value): + * Set(SectionName, SettingName, String): + * + * Sets a setting associated with a particular section. For each overload + * type (string or integer), the opposite type is cleard (0 is written to + * values when a string is set, "" is written to strings when a value is + * set). If the setting does not exist, it is created. If the section does + * not exist, it will be added as well. + * + * Parameters: + * SectionName String defining the section name. + * SettingName String defining the setting name. + * value Value to write. String will be set to "". + * String String to write. Value will be set to 0. + */ + void Set(string SectionName, string SettingName, unsigned value); + void Set(string SectionName, string SettingName, string String); + + /* + * Write(comment): + * + * Outputs the parse tree to the INI file. The current contents of the file + * on the disk are discarded and overwritten. This means that comments are + * lost. + * + * Parameters: + * comment An optional C-string containing a comment to insert at + * the beginning of the file, otherwise NULL. The comment + * lines must include semicolons at the beginning, they + * will not be inserted automatically. The string is + * output directly, as-is. + * + * Returns: + * OKAY if successful. FAIL if an error occurred at any point. In + * order to truncate the original contents of the file, this function + * closes the file, reopends it as write-only, then reopens it again + * as a read/write file. If an error occurs during the reopening + * procedure, it is possible that nothing will be output and the + * previous contents will be lost. + */ + BOOL Write(const char *comment); + + /* + * Parse(void): + * + * Parses the contents of the file, building the parse tree. Settings + * already present in the parse tree will continue to exist and will be + * overwritten if new, matching settings are found in the file. + * + * Returns: + */ + BOOL Parse(void); + + /* + * Open(fileNameStr): + * + * Opens an INI file. + * + * Parameters: + * fileNameStr File path (C string). + * + * Returns: + * OKAY if successful, FAIL if unable to open for reading and writing. + */ + BOOL Open(const char *fileNameStr); + + /* + * Close(void): + * + * Closes the INI file and clears the parse tree. + */ + void Close(void); + +private: + // Token + class CToken + { + public: + int type; // token type (defined privately in INIFile.cpp) + unsigned number; // numbers and bools + string String; // strings and identifiers + + // Constructor (initialize to null token) + CToken(void); + }; + + // Searching/modification of settings + BOOL LookUpSection(unsigned *idx, string SectionName); + BOOL LookUpSetting(unsigned *idx, unsigned sectionIdx, string SettingName); + + // Tokenizer + CToken GetString(void); + CToken GetNumber(void); + CToken GetIdentifier(void); + CToken GetToken(void); + + // File state + fstream File; + string FileName; // name of last file opened + + // Parser state + char lineBuf[2048]; // holds current line + char *linePtr; // points to current position within line (for tokenization) + unsigned lineNum; // line number + + // Parse tree: a list of sections each of which is a list of settings for that section + struct Setting // it is up to caller to determine whether to use value or string + { + string Name; // setting name + BOOL isNumber; // internal flag: true if the setting is a number, false if it is a string + unsigned value; // value of number + string String; // string + + Setting(void) + { + value = 0; // initialize value to 0 + isNumber = TRUE; // indicate the setting is initially a number + } + }; + struct Section + { + string Name; // section name + vector Settings; // list of settings associated w/ this section + }; + vector Sections; // a list of sections +}; + + +#endif // INCLUDED_INIFILE_H diff --git a/Inputs/Input.cpp b/Inputs/Input.cpp new file mode 100644 index 0000000..5a9fdeb --- /dev/null +++ b/Inputs/Input.cpp @@ -0,0 +1,105 @@ +#include "Supermodel.h" + +CInput::CInput(const char *inputId, const char *inputLabel, unsigned inputFlags, unsigned inputGameFlags, const char *defaultMapping, UINT16 initValue) : + id(inputId), label(inputLabel), flags(inputFlags), gameFlags(inputGameFlags), m_defaultMapping(defaultMapping), value(initValue), prevValue(initValue), + m_system(NULL), m_source(NULL) +{ + ResetToDefaultMapping(); +} + +void CInput::CreateSource() +{ + // If no system set yet or mapping is empty or NONE, then set source to NULL + if (m_system == NULL || m_mapping[0] == '\0' || stricmp(m_mapping, "NONE") == 0) + m_source = NULL; + else + { + // Otherwise, ask system to parse mapping into appropriate input source + m_source = m_system->ParseSource(m_mapping, !!(flags & INPUT_FLAGS_AXIS)); + + // Check that mapping was parsed okay and if not then fall back to default mapping + if (m_source == NULL && stricmp(m_mapping, m_defaultMapping) != 0) + { + ErrorLog("Unable to map input %s to [%s] - switching to default [%s].\n", id, m_mapping, m_defaultMapping); + + ResetToDefaultMapping(); + } + } +} + +void CInput::Initialize(CInputSystem *system) +{ + m_system = system; + + CreateSource(); +} + +const char* CInput::GetInputGroup() +{ + switch (gameFlags) + { + case GAME_INPUT_COMMON: return "Common Controls"; + case GAME_INPUT_JOYSTICK1: // Fall through to below + case GAME_INPUT_JOYSTICK2: return "8-Way Joysticks"; + case GAME_INPUT_FIGHTING: return "Fighting Game Buttons"; + case GAME_INPUT_SOCCER: return "Virtua Striker Buttons"; + case GAME_INPUT_VEHICLE: return "Racing Game Steering Controls"; + case GAME_INPUT_SHIFT4: return "Racing Game Gear Shift"; + case GAME_INPUT_VR: return "Racing Game VR View Buttons"; + case GAME_INPUT_RALLY: return "Sega Rally Buttons"; + case GAME_INPUT_TWIN_JOYSTICKS: return "Virtua On Controls"; + case GAME_INPUT_ANALOG_JOYSTICK: return "Analog Joystick"; + case GAME_INPUT_GUN1: // Fall through to below + case GAME_INPUT_GUN2: return "Lightguns"; + default: return "Misc"; + } +} + +const char *CInput::GetMapping() +{ + return m_mapping; +} + +void CInput::ClearMapping() +{ + SetMapping("NONE"); +} + +void CInput::SetMapping(const char *mapping) +{ + strncpy(m_mapping, mapping, MAX_MAPPING_LENGTH - 1); + m_mapping[MAX_MAPPING_LENGTH - 1] = '\0'; + CreateSource(); +} + +void CInput::AppendMapping(const char *mapping) +{ + // If mapping is empty or NONE, then simply set mapping + if (m_mapping[0] == '\0' || stricmp(m_mapping, "NONE") == 0) + SetMapping(mapping); + else + { + // Otherwise, append to mapping string and recreate source from new mapping string + int size = MAX_MAPPING_LENGTH - strlen(m_mapping); + strncat(m_mapping, ",", size--); + strncat(m_mapping, mapping, size); + CreateSource(); + } +} + +void CInput::ResetToDefaultMapping() +{ + SetMapping(m_defaultMapping); +} + +bool CInput::Configure(bool append, const char *escapeMapping) +{ + char mapping[MAX_MAPPING_LENGTH]; + if (!m_system->ReadMapping(mapping, MAX_MAPPING_LENGTH, !!(flags & INPUT_FLAGS_AXIS), READ_ALL, escapeMapping)) + return false; + if (append) + AppendMapping(mapping); + else + SetMapping(mapping); + return true; +} diff --git a/Inputs/Input.h b/Inputs/Input.h new file mode 100644 index 0000000..0ae144b --- /dev/null +++ b/Inputs/Input.h @@ -0,0 +1,114 @@ +#ifndef INCLUDED_INPUT_H +#define INCLUDED_INPUT_H + +#include "Types.h" + +class CInputSource; +class CInputSystem; + +// Flags for inputs +#define INPUT_FLAGS_SWITCH 0x0001 +#define INPUT_FLAGS_ANALOG 0x0002 +#define INPUT_FLAGS_AXIS 0x0004 +#define INPUT_FLAGS_VIRTUAL 0x0008 + +#define MAX_MAPPING_LENGTH 255 + +/* + * Base class for any type of Model3 input control. + */ +class CInput +{ +private: + // Current mapping(s) for input, eg JOY1_XAXIS_POS + char m_mapping[MAX_MAPPING_LENGTH]; + + // Default mapping for input + const char *m_defaultMapping; + + // Assigned input system + CInputSystem *m_system; + + /* + * Creates an input source using the current input system and assigns it to this input. + */ + void CreateSource(); + +protected: + // Current input source + CInputSource *m_source; + +public: + // Input identifier + const char *id; + + // Input label + const char *label; + + // Input flags + unsigned flags; + + // Input game flags + unsigned gameFlags; + + // Current input value + UINT16 value; + + // Previous input value + UINT16 prevValue; + + /* + * Constructs an input with the given identifier, label, flags, game flags, default mapping and initial value. + */ + CInput(const char *inputId, const char *inputLabel, unsigned inputFlags, unsigned inputGameFlags, + const char *defaultMapping = "NONE", UINT16 initValue = 0); + + /* + * Initializes this input with the given input system. Must be called before any other methods are used. + */ + void Initialize(CInputSystem *system); + + /* + * Returns the name of the group of controls that this input belongs to. + */ + const char* GetInputGroup(); + + /* + * Returns the current mapping(s) assigned to this input. + */ + const char* GetMapping(); + + /* + * Clears the current mapping(s) assigned to this input. + */ + void ClearMapping(); + + /* + * Sets the current mapping(s) assigned to this input. Multiple mapping assignments are comma-separated, eg KEY_RIGHT,JOY1_XAXIS_POS + */ + void SetMapping(const char *mapping); + + /* + * Appends a mapping to this input to create a multiple mapping assignment. + */ + void AppendMapping(const char *mapping); + + /* + * Resets the mapping(s) assigned to this input to the input's default. + */ + void ResetToDefaultMapping(); + + /* + * Configures the current mapping(s) assigned to this input by asking the user for input. + * If append is true, then the user's selected mapping is appended. Otherwise, it overwrites the existing mapping(s). + * escapeMapping holds the input mapping used to exit the configuration without applying the changes. + */ + bool Configure(bool append, const char *escapeMapping = "KEY_ESCAPE"); + + /* + * Polls (updates) this input, updating its value from the input source + */ + virtual void Poll() = 0; +}; + +#endif // INCLUDED_INPUT_H diff --git a/Inputs/InputSource.cpp b/Inputs/InputSource.cpp new file mode 100644 index 0000000..9e643c2 --- /dev/null +++ b/Inputs/InputSource.cpp @@ -0,0 +1,84 @@ +#include "InputSource.h" + +#include +using namespace std; + +CInputSource::CInputSource(ESourceType sourceType) : type(sourceType) +{ + // +} + +int CInputSource::Clamp(int val, int minVal, int maxVal) +{ + if (val > maxVal) return maxVal; + else if (val < minVal) return minVal; + else return val; +} + +int CInputSource::Scale(int val, int fromMinVal, int fromMaxVal, int toMinVal, int toMaxVal) +{ + return Scale(val, fromMinVal, fromMinVal, fromMaxVal, toMinVal, toMinVal, toMaxVal); +} + +int CInputSource::Scale(int val, int fromMinVal, int fromOffVal, int fromMaxVal, int toMinVal, int toOffVal, int toMaxVal) +{ + int fromRange; + double frac; + if (fromMaxVal > fromMinVal) + { + val = Clamp(val, fromMinVal, fromMaxVal); + if (val > fromOffVal) + { + fromRange = fromMaxVal - fromOffVal; + frac = (double)(val - fromOffVal) / fromRange; + } + else if (val < fromOffVal) + { + fromRange = fromOffVal - fromMinVal; + frac = (double)(val - fromOffVal) / fromRange; + } + else + return toOffVal; + } + else if (fromMinVal > fromMaxVal) + { + val = Clamp(val, fromMaxVal, fromMinVal); + if (val > fromOffVal) + { + fromRange = fromMinVal - fromOffVal; + frac = (double)(fromOffVal - val) / fromRange; + } + else if (val < fromOffVal) + { + fromRange = fromOffVal - fromMaxVal; + frac = (double)(fromOffVal - val) / fromRange; + } + else + return toOffVal; + } + else + return toOffVal; + double toRange; + if (toMaxVal > toMinVal) + { + if (frac >= 0) + toRange = (double)(toMaxVal - toOffVal); + else + toRange = (double)(toOffVal - toMinVal); + return toOffVal + (int)(toRange * frac); + } + else + { + if (frac >= 0) + toRange = (double)(toOffVal - toMaxVal); + else + toRange = (double)(toMinVal - toOffVal); + return toOffVal - (int)(toRange * frac); + } +} + +bool CInputSource::IsActive() +{ + bool boolVal; + return GetValueAsSwitch(boolVal); +} \ No newline at end of file diff --git a/Inputs/InputSource.h b/Inputs/InputSource.h new file mode 100644 index 0000000..809bbdc --- /dev/null +++ b/Inputs/InputSource.h @@ -0,0 +1,72 @@ +#ifndef INCLUDED_INPUTSOURCE_H +#define INCLUDED_INPUTSOURCE_H + +#include +using namespace std; + +class CInputSystem; + +enum ESourceType +{ + SourceInvalid = -1, + SourceEmpty = 0, + SourceSwitch = 1, + SourceHalfAxis = 2, + SourceFullAxis = 3 +}; + +/* + * Provides values to inputs, either in the form of a bool for switch inputs or an int value within a given range for analog/axis inputs. + */ +class CInputSource +{ +protected: + CInputSource(ESourceType sourceType); + +public: + const ESourceType type; + + // + // Static helper methods + // + + /* + * Clamps the given value to between the min and max values. + */ + static int Clamp(int val, int minVal, int maxVal); + + /* + * Scales the given value, that falls within the stated 'from' range, to be between the given 'to' range. + */ + static int Scale(int val, int fromMinVal, int fromMaxVal, int toMinVal, int toMaxVal); + + /* + * Scales the given value, that falls within the stated 'from' range, to be between the given 'to' range. + * The off values are supplied to avoid rounding errors and ensure that the scaled value has the correct off value when required. + */ + static int Scale(int val, int fromMinVal, int fromOffVal, int fromMaxVal, int toMinVal, int toOffVal, int toMaxVal); + + /* + * Returns true if this source represents a switch input (such as a button). Otherwise it is assumed to be an analog input (such as axis or pedal). + */ + ESourceType GetType(); + + /* + * Returns true if the source is active (taken from GetValueAsSwitch). + */ + bool IsActive(); + + /* + * Reads a boolean value for a switch input. + * Returns true if the value was set. + */ + virtual bool GetValueAsSwitch(bool &val) = 0; + + /* + * Reads an int value for an analog/axis input, guaranteeing that the value falls within the given range and has the correct off value when required. + * Returns true if the value was set. + */ + virtual bool GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal) = 0; +}; + +#endif // INCLUDED_INPUTSOURCE_H \ No newline at end of file diff --git a/Inputs/InputSystem.cpp b/Inputs/InputSystem.cpp new file mode 100644 index 0000000..afb4ca3 --- /dev/null +++ b/Inputs/InputSystem.cpp @@ -0,0 +1,1899 @@ +#include "Supermodel.h" + +#include +#include +#include +#include +using namespace std; + +const char *CInputSystem::s_validKeyNames[] = +{ + // General keys + "BACKSPACE", + "TAB", + "CLEAR", + "RETURN", + "PAUSE", + "ESCAPE", + "SPACE", + "EXCLAIM", + "DBLQUOTE", + "HASH", + "DOLLAR", + "AMPERSAND", + "QUOTE", + "LEFTPAREN", + "RIGHTPAREN", + "ASTERISK", + "PLUS", + "COMMA", + "MINUS", + "PERIOD", + "SLASH", + "0", + "1", + "2", + "3", + "4", + "5", + "6", + "7", + "8", + "9", + "COLON", + "SEMICOLON", + "LESS", + "EQUALS", + "GREATER", + "QUESTION", + "AT", + "LEFTBRACKET", + "BACKSLASH", + "RIGHTBRACKET", + "CARET", + "UNDERSCORE", + "BACKQUOTE", + "A", + "B", + "C", + "D", + "E", + "F", + "G", + "H", + "I", + "J", + "K", + "L", + "M", + "N", + "O", + "P", + "Q", + "R", + "S", + "T", + "U", + "V", + "W", + "X", + "Y", + "Z", + "DEL", + + // Keypad + "KEYPAD0", + "KEYPAD1", + "KEYPAD2", + "KEYPAD3", + "KEYPAD4", + "KEYPAD5", + "KEYPAD6", + "KEYPAD7", + "KEYPAD8", + "KEYPAD9", + "KEYPADPERIOD", + "KEYPADDIVIDE", + "KEYPADMULTIPLY", + "KEYPADMINUS", + "KEYPADPLUS", + "KEYPADENTER", + "KEYPADEQUALS", + + // Arrows + Home/End Pad + "UP", + "DOWN", + "RIGHT", + "LEFT", + "INSERT", + "HOME", + "END", + "PGUP", + "PGDN", + + // Function Key + "F1", + "F2", + "F3", + "F4", + "F5", + "F6", + "F7", + "F8", + "F9", + "F10", + "F11", + "F12", + "F13", + "F14", + "F15", + + // Modifier Keys + "NUMLOCK", + "CAPSLOCK", + "SCROLLLOCK", + "SHIFT", + "RIGHTSHIFT", + "LEFTSHIFT", + "CTRL", + "RIGHTCTRL", + "LEFTCTRL", + "ALT", + "RIGHTALT", + "LEFTALT", + "RIGHTMETA", + "LEFTMETA", + "RIGHTWINDOWS", + "LEFTWINDOWS", + "ALTGR", + "COMPOSE", + + // Other + "HELP", + "PRINT", + "SYSREQ", + "BREAK", + "MENU", + "POWER", + "EURO", + "UNDO" +}; + +MousePartsStruct CInputSystem::s_mseParts[] = +{ + // X Axis (Axis 0) + { "XAXIS", MouseXAxis }, + { "XAXIS_INV", MouseXAxisInv }, + { "XAXIS_POS", MouseXAxisPos }, + { "XAXIS_NEG", MouseXAxisNeg }, + { "RIGHT", MouseXAxisPos }, + { "LEFT", MouseXAxisNeg }, + { "AXIS1", MouseXAxis }, + { "AXIS1_INV", MouseXAxisInv }, + { "AXIS1_POS", MouseXAxisPos }, + { "AXIS1_NEG", MouseXAxisNeg }, + + // Y Axis (Axis 1) + { "YAXIS", MouseYAxis }, + { "YAXIS_INV", MouseYAxisInv }, + { "YAXIS_POS", MouseYAxisPos }, + { "YAXIS_NEG", MouseYAxisNeg }, + { "DOWN", MouseYAxisPos }, + { "UP", MouseYAxisNeg }, + { "AXIS2", MouseYAxis }, + { "AXIS2_INV", MouseYAxisInv }, + { "AXIS2_POS", MouseYAxisPos }, + { "AXIS2_NEG", MouseYAxisNeg }, + + // Z/Wheel Axis (Axis 2) + { "ZAXIS", MouseZAxis }, + { "ZAXIS_INV", MouseZAxisInv }, + { "ZAXIS_POS", MouseZAxisPos }, + { "ZAXIS_NEG", MouseZAxisNeg }, + { "WHEEL_UP", MouseZAxisPos }, + { "WHEEL_DOWN", MouseZAxisNeg }, + { "AXIS3", MouseZAxis }, + { "AXIS3_INV", MouseZAxisInv }, + { "AXIS3_POS", MouseZAxisPos }, + { "AXIS3_NEG", MouseZAxisNeg }, + + // Left/Middle/Right Buttons (Buttons 0-2) + { "LEFT_BUTTON", MouseButtonLeft }, + { "BUTTON1", MouseButtonLeft }, + { "MIDDLE_BUTTON", MouseButtonMiddle }, + { "BUTTON2", MouseButtonMiddle }, + { "RIGHT_BUTTON", MouseButtonRight }, + { "BUTTON3", MouseButtonRight }, + + // Extra Buttons (Buttons 3 & 4) + { "BUTTONX1", MouseButtonX1 }, + { "BUTTON4", MouseButtonX1 }, + { "BUTTONX2", MouseButtonX2 }, + { "BUTTON5", MouseButtonX2 }, + + // List terminator + { NULL, MouseUnknown } +}; + +JoyPartsStruct CInputSystem::s_joyParts[] = +{ + // X-Axis (Axis 0) + { "XAXIS", JoyXAxis }, + { "XAXIS_INV", JoyXAxisInv }, + { "XAXIS_POS", JoyXAxisPos }, + { "XAXIS_NEG", JoyXAxisNeg }, + { "RIGHT", JoyXAxisPos }, + { "LEFT", JoyXAxisNeg }, + { "AXIS1", JoyXAxis }, + { "AXIS1_INV", JoyXAxisInv }, + { "AXIS1_POS", JoyXAxisPos }, + { "AXIS1_NEG", JoyXAxisNeg }, + + // Y-Axis (Axis 1) + { "YAXIS", JoyYAxis }, + { "YAXIS_INV", JoyYAxisInv }, + { "YAXIS_POS", JoyYAxisPos }, + { "YAXIS_NEG", JoyYAxisNeg }, + { "DOWN", JoyYAxisPos }, + { "UP", JoyYAxisNeg }, + { "AXIS2", JoyYAxis }, + { "AXIS2_INV", JoyYAxisInv }, + { "AXIS2_POS", JoyYAxisPos }, + { "AXIS2_NEG", JoyYAxisNeg }, + + // Z-Axis (Axis 2) + { "ZAXIS", JoyZAxis }, + { "ZAXIS_INV", JoyZAxisInv }, + { "ZAXIS_POS", JoyZAxisPos }, + { "ZAXIS_NEG", JoyZAxisNeg }, + { "AXIS3", JoyZAxis }, + { "AXIS3_INV", JoyZAxisInv }, + { "AXIS3_POS", JoyZAxisPos }, + { "AXIS3_NEG", JoyZAxisNeg }, + + // RX-Axis (Axis 3) + { "RXAXIS", JoyRXAxis }, + { "RXAXIS_INV", JoyRXAxisInv }, + { "RXAXIS_POS", JoyRXAxisPos }, + { "RXAXIS_NEG", JoyRXAxisNeg }, + { "AXIS4", JoyRXAxis }, + { "AXIS4_INV", JoyRXAxisInv }, + { "AXIS4_POS", JoyRXAxisPos }, + { "AXIS4_NEG", JoyRXAxisNeg }, + + // RY-Axis (Axis 4) + { "RYAXIS", JoyRYAxis }, + { "RYAXIS_INV", JoyRYAxisInv }, + { "RYAXIS_POS", JoyRYAxisPos }, + { "RYAXIS_NEG", JoyRYAxisNeg }, + { "AXIS5", JoyRYAxis }, + { "AXIS5_INV", JoyRYAxisInv }, + { "AXIS5_POS", JoyRYAxisPos }, + { "AXIS5_NEG", JoyRYAxisNeg }, + + // RZ-Axis (Axis 5) + { "RZAXIS", JoyRZAxis }, + { "RZAXIS_INV", JoyRZAxisInv }, + { "RZAXIS_POS", JoyRZAxisPos }, + { "RZAXIS_NEG", JoyRZAxisNeg }, + { "AXIS6", JoyRZAxis }, + { "AXIS6_INV", JoyRZAxisInv }, + { "AXIS6_POS", JoyRZAxisPos }, + { "AXIS6_NEG", JoyRZAxisNeg }, + + // POV Hat 0 + { "POV1_UP", JoyPOV0Up }, + { "POV1_DOWN", JoyPOV0Down }, + { "POV1_LEFT", JoyPOV0Left }, + { "POV1_RIGHT", JoyPOV0Right }, + + // POV Hat 1 + { "POV2_UP", JoyPOV1Up }, + { "POV2_DOWN", JoyPOV1Down }, + { "POV2_LEFT", JoyPOV1Left }, + { "POV2_RIGHT", JoyPOV1Right }, + + // POV Hat 2 + { "POV3_UP", JoyPOV2Up }, + { "POV3_DOWN", JoyPOV2Down }, + { "POV3_LEFT", JoyPOV2Left }, + { "POV3_RIGHT", JoyPOV2Right }, + + // POV Hat 3 + { "POV4_UP", JoyPOV3Up }, + { "POV4_DOWN", JoyPOV3Down }, + { "POV4_LEFT", JoyPOV3Left }, + { "POV4_RIGHT", JoyPOV3Right }, + + // Buttons 0-31 + { "BUTTON1", JoyButton0 }, + { "BUTTON2", JoyButton1 }, + { "BUTTON3", JoyButton2 }, + { "BUTTON4", JoyButton3 }, + { "BUTTON5", JoyButton4 }, + { "BUTTON6", JoyButton5 }, + { "BUTTON7", JoyButton6 }, + { "BUTTON8", JoyButton7 }, + { "BUTTON9", JoyButton8 }, + { "BUTTON10", JoyButton9 }, + { "BUTTON11", JoyButton10 }, + { "BUTTON12", JoyButton11 }, + { "BUTTON13", JoyButton12 }, + { "BUTTON14", JoyButton13 }, + { "BUTTON15", JoyButton14 }, + { "BUTTON16", JoyButton15 }, + { "BUTTON17", JoyButton16 }, + { "BUTTON18", JoyButton17 }, + { "BUTTON19", JoyButton18 }, + { "BUTTON20", JoyButton19 }, + { "BUTTON21", JoyButton20 }, + { "BUTTON22", JoyButton21 }, + { "BUTTON23", JoyButton22 }, + { "BUTTON24", JoyButton23 }, + { "BUTTON25", JoyButton24 }, + { "BUTTON26", JoyButton25 }, + { "BUTTON27", JoyButton26 }, + { "BUTTON28", JoyButton27 }, + { "BUTTON29", JoyButton28 }, + { "BUTTON30", JoyButton29 }, + { "BUTTON31", JoyButton30 }, + { "BUTTON32", JoyButton31 }, + + // List terminator + { NULL, JoyUnknown } +}; + +CMultiInputSource *CInputSystem::s_emptySource = new CMultiInputSource(); + +CInputSystem::CInputSystem(const char *systemName) : name(systemName), m_dispX(0), m_dispY(0), m_dispW(0), m_dispH(0), m_isConfiguring(false) +{ + // +} + +CInputSystem::~CInputSystem() +{ + DeleteSourceCache(); + ClearSettings(); +} + +void CInputSystem::CreateSourceCache() +{ + // Create cache for key sources + m_anyKeySources = new CInputSource*[NUM_VALID_KEYS]; + memset(m_anyKeySources, NULL, sizeof(CInputSource*) * NUM_VALID_KEYS); + if (m_numKbds != ANY_KEYBOARD) + { + m_keySources = new CInputSource**[m_numKbds]; + for (int kbdNum = 0; kbdNum < m_numKbds; kbdNum++) + { + m_keySources[kbdNum] = new CInputSource*[NUM_VALID_KEYS]; + memset(m_keySources[kbdNum], NULL, sizeof(CInputSource*) * NUM_VALID_KEYS); + } + } + + // Create cache for mouse sources + m_anyMseSources = new CInputSource*[NUM_MOUSE_PARTS]; + memset(m_anyMseSources, NULL, sizeof(CInputSource*) * NUM_MOUSE_PARTS); + if (m_numMice != ANY_MOUSE) + { + m_mseSources = new CInputSource**[m_numMice]; + for (int mseNum = 0; mseNum < m_numMice; mseNum++) + { + m_mseSources[mseNum] = new CInputSource*[NUM_MOUSE_PARTS]; + memset(m_mseSources[mseNum], NULL, sizeof(CInputSource*) * NUM_MOUSE_PARTS); + } + } + + // Create cache for joystick sources + m_anyJoySources = new CInputSource*[NUM_JOY_PARTS]; + memset(m_anyJoySources, NULL, sizeof(CInputSource*) * NUM_JOY_PARTS); + if (m_numJoys != ANY_JOYSTICK) + { + m_joySources = new CInputSource**[m_numJoys]; + for (int joyNum = 0; joyNum < m_numJoys; joyNum++) + { + m_joySources[joyNum] = new CInputSource*[NUM_JOY_PARTS]; + memset(m_joySources[joyNum], NULL, sizeof(CInputSource*) * NUM_JOY_PARTS); + } + } +} + +void CInputSystem::DeleteSourceCache() +{ + // Delete cache for keyboard sources + if (m_anyKeySources != NULL) + { + for (int keyIndex = 0; keyIndex < NUM_VALID_KEYS; keyIndex++) + DeleteSource(m_anyKeySources[keyIndex]); + delete[] m_anyKeySources; + m_anyKeySources = NULL; + if (m_numKbds != ANY_KEYBOARD) + { + for (int kbdNum = 0; kbdNum < m_numKbds; kbdNum++) + { + for (int keyIndex = 0; keyIndex < NUM_VALID_KEYS; keyIndex++) + DeleteSource(m_keySources[kbdNum][keyIndex]); + delete[] m_keySources[kbdNum]; + } + delete[] m_keySources; + m_keySources = NULL; + } + } + + // Delete cache for mouse sources + if (m_anyMseSources != NULL) + { + for (int mseIndex = 0; mseIndex < NUM_MOUSE_PARTS; mseIndex++) + DeleteSource(m_anyMseSources[mseIndex]); + delete[] m_anyMseSources; + m_anyMseSources = NULL; + if (m_numMice != ANY_MOUSE) + { + for (int mseNum = 0; mseNum < m_numMice; mseNum++) + { + for (int mseIndex = 0; mseIndex < NUM_MOUSE_PARTS; mseIndex++) + DeleteSource(m_mseSources[mseNum][mseIndex]); + delete[] m_mseSources[mseNum]; + } + delete[] m_mseSources; + m_mseSources = NULL; + } + } + + // Delete cache for joystick sources + if (m_anyJoySources != NULL) + { + for (int joyIndex = 0; joyIndex < NUM_JOY_PARTS; joyIndex++) + DeleteSource(m_anyJoySources[joyIndex]); + delete[] m_anyJoySources; + m_anyJoySources = NULL; + if (m_numJoys != ANY_JOYSTICK) + { + for (int joyNum = 0; joyNum < m_numJoys; joyNum++) + { + for (int joyIndex = 0; joyIndex < NUM_JOY_PARTS; joyIndex++) + DeleteSource(m_joySources[joyNum][joyIndex]); + delete[] m_joySources[joyNum]; + } + delete[] m_joySources; + m_joySources = NULL; + } + } +} + +void CInputSystem::DeleteSource(CInputSource *source) +{ + if (source != NULL && source != s_emptySource) + delete source; +} + +CInputSource *CInputSystem::GetKeySource(int kbdNum, int keyIndex) +{ + if (kbdNum == ANY_KEYBOARD) + { + // Check keyboard source cache first + if (m_anyKeySources[keyIndex] == NULL) + { + if (m_numKbds == ANY_KEYBOARD) + m_anyKeySources[keyIndex] = CreateKeySource(ANY_KEYBOARD, keyIndex); + else + m_anyKeySources[keyIndex] = CreateAnyKeySource(keyIndex); + } + return m_anyKeySources[keyIndex]; + } + else if (kbdNum < m_numKbds) + { + // Check keyboard source cache first + if (m_keySources[kbdNum][keyIndex] == NULL) + m_keySources[kbdNum][keyIndex] = CreateKeySource(kbdNum, keyIndex); + return m_keySources[kbdNum][keyIndex]; + } + else + return s_emptySource; +} + +CInputSource *CInputSystem::GetMouseSource(int mseNum, EMousePart msePart) +{ + int mseIndex = (int)msePart; + if (mseNum == ANY_MOUSE) + { + // Check mouse source cache first + if (m_anyMseSources[mseIndex] == NULL) + { + if (m_numMice == ANY_MOUSE) + m_anyMseSources[mseIndex] = CreateMouseSource(ANY_MOUSE, msePart); + else + m_anyMseSources[mseIndex] = CreateAnyMouseSource(msePart); + } + return m_anyMseSources[mseIndex]; + } + else if (mseNum < m_numMice) + { + // Check mouse source cache first + if (m_mseSources[mseNum][mseIndex] == NULL) + m_mseSources[mseNum][mseIndex] = CreateMouseSource(mseNum, msePart); + return m_mseSources[mseNum][mseIndex]; + } + else + return s_emptySource; +} + +CInputSource *CInputSystem::GetJoySource(int joyNum, EJoyPart joyPart) +{ + int joyIndex = (int)joyPart; + if (joyNum == ANY_JOYSTICK) + { + // Check joystick source cache first + if (m_anyJoySources[joyIndex] == NULL) + { + if (m_numJoys == ANY_JOYSTICK) + m_anyJoySources[joyIndex] = CreateJoySource(ANY_JOYSTICK, joyPart); + else + m_anyJoySources[joyIndex] = CreateAnyJoySource(joyPart); + } + return m_anyJoySources[joyIndex]; + } + else if (joyNum < m_numJoys) + { + // Check joystick source cache first + if (m_joySources[joyNum][joyIndex] == NULL) + m_joySources[joyNum][joyIndex] = CreateJoySource(joyNum, joyPart); + return m_joySources[joyNum][joyIndex]; + } + else + return s_emptySource; +} + +void CInputSystem::CheckKeySources(int kbdNum, bool fullAxisOnly, vector &sources, string &mapping) +{ + // Loop through all valid keys + for (int i = 0; i < NUM_VALID_KEYS; i++) + { + const char *keyName = s_validKeyNames[i]; + int keyIndex = GetKeyIndex(keyName); + if (keyIndex < 0) + continue; + // Get key source for keyboard number and key and test it to see if it is active (but was not previously) + CInputSource *source = GetKeySource(kbdNum, keyIndex); + if (source != NULL && source->IsActive() && find(sources.begin(), sources.end(), source) == sources.end()) + { + // Update mapping string and add source to list + if (sources.size() == 0) + mapping.assign("KEY"); + else + mapping.append("+KEY"); + if (kbdNum >= 0) + mapping.append(IntToString(kbdNum + 1)); + mapping.append("_"); + mapping.append(keyName); + sources.push_back(source); + } + } +} + +void CInputSystem::CheckMouseSources(int mseNum, bool fullAxisOnly, bool mseCentered, vector &sources, string &mapping) +{ + // Loop through all mouse parts + for (int mseIndex = 0; mseIndex < NUM_MOUSE_PARTS; mseIndex++) + { + EMousePart msePart = (EMousePart)mseIndex; + // Get axis details + int axisNum; + int axisDir; + bool isAxis = GetAxisDetails(msePart, axisNum, axisDir); + bool isXYAxis = isAxis && (axisNum == AXIS_X || axisNum == AXIS_Y); + // Ignore X- & Y-axes if mouse hasn't been centered yet and filter axes according to fullAxisOnly + if (isXYAxis && !mseCentered || isAxis && (IsFullAxis(msePart) && !fullAxisOnly || !IsFullAxis(msePart) && fullAxisOnly)) + continue; + // Get mouse source for mouse number and part and test it to see if it is active (but was not previously) + CInputSource *source = GetMouseSource(mseNum, msePart); + if (source != NULL && source->IsActive() && find(sources.begin(), sources.end(), source) == sources.end()) + { + // Otherwise, update mapping string and add source to list + const char *partName = LookupName(msePart); + if (sources.size() == 0) + mapping.assign("MOUSE"); + else + mapping.append("+MOUSE"); + if (mseNum >= 0) + mapping.append(IntToString(mseNum + 1)); + mapping.append("_"); + mapping.append(partName); + sources.push_back(source); + } + } +} + +void CInputSystem::CheckJoySources(int joyNum, bool fullAxisOnly, vector &sources, string &mapping) +{ + // Loop through all joystick parts + for (int joyIndex = 0; joyIndex < NUM_JOY_PARTS; joyIndex++) + { + EJoyPart joyPart = (EJoyPart)joyIndex; + // Filter axes according to fullAxisOnly + if (IsAxis(joyPart) && (IsFullAxis(joyPart) && !fullAxisOnly || !IsFullAxis(joyPart) && fullAxisOnly)) + continue; + // Get joystick source for joystick number and part and test it to see if it is active (but was not previously) + CInputSource *source = GetJoySource(joyNum, joyPart); + if (source != NULL && source->IsActive() && find(sources.begin(), sources.end(), source) == sources.end()) + { + // Otherwise, update mapping string and add source to list + const char *partName = LookupName(joyPart); + if (sources.size() == 0) + mapping.assign("JOY"); + else + mapping.append("+JOY"); + if (joyNum >= 0) + mapping.append(IntToString(joyNum + 1)); + mapping.append("_"); + mapping.append(partName); + sources.push_back(source); + } + } +} + +bool CInputSystem::ParseInt(string str, int &num) +{ + stringstream ss(str); + return !(ss >> num).fail(); +} + +string CInputSystem::IntToString(int num) +{ + stringstream ss; + ss << num; + return ss.str(); +} + +bool CInputSystem::EqualsIgnoreCase(string str1, const char *str2) +{ + for (string::const_iterator ci = str1.begin(); ci < str1.end(); ci++) + { + if (*str2 == '\0' || tolower(*ci) != tolower(*str2)) + return false; + str2++; + } + return *str2 == '\0'; +} + +bool CInputSystem::StartsWithIgnoreCase(string str1, const char *str2) +{ + for (string::const_iterator ci = str1.begin(); ci < str1.end(); ci++) + { + if (*str2 == '\0') + return true; + if (tolower(*ci) != tolower(*str2)) + return false; + str2++; + } + return *str2 == '\0'; +} + +bool CInputSystem::IsValidKeyName(string str) +{ + for (int i = 0; i < NUM_VALID_KEYS; i++) + { + if (EqualsIgnoreCase(str, s_validKeyNames[i])) + return true; + } + return false; +} + +EMousePart CInputSystem::LookupMousePart(string str) +{ + for (int i = 0; s_mseParts[i].id != NULL; i++) + { + if (EqualsIgnoreCase(str, s_mseParts[i].id)) + return s_mseParts[i].msePart; + } + return MouseUnknown; +} + +const char *CInputSystem::LookupName(EMousePart msePart) +{ + for (int i = 0; s_mseParts[i].id != NULL; i++) + { + if (msePart == s_mseParts[i].msePart) + return s_mseParts[i].id; + } + return NULL; +} + +EJoyPart CInputSystem::LookupJoyPart(string str) +{ + for (int i = 0; s_joyParts[i].id != NULL; i++) + { + if (EqualsIgnoreCase(str, s_joyParts[i].id)) + return s_joyParts[i].joyPart; + } + return JoyUnknown; +} + +const char *CInputSystem::LookupName(EJoyPart joyPart) +{ + for (int i = 0; s_joyParts[i].id != NULL; i++) + { + if (joyPart == s_joyParts[i].joyPart) + return s_joyParts[i].id; + } + return NULL; +} + +size_t CInputSystem::ParseDevMapping(string str, const char *devType, int &devNum) +{ + if (!StartsWithIgnoreCase(str, devType)) + return -1; + size_t size = str.size(); + size_t devLen = strlen(devType); + + // Parse optional device number + devNum = -1; + size_t i = devLen; + while (i < size && isdigit(str[i])) + i++; + if (i > devLen && i < size) + { + if (!ParseInt(str.substr(devLen, i), devNum)) + return -1; + devNum--; + } + + // Check hyphen preceeds device part + if (i < size - 1 && str[i] == '_') + return i + 1; + else + return -1; +} + +CInputSource* CInputSystem::ParseMultiSource(string str, bool fullAxisOnly, bool isOr) +{ + // Check for empty or NONE mapping + size_t size = str.size(); + if (size == 0 || EqualsIgnoreCase(str, "NONE")) + return NULL; + + CInputSource *source = NULL; + bool isMulti = false; + vector sources; + + size_t start = 0; + size_t end; + do + { + // Remove leading whitespace/quotes and see if have any plusses/commas in mapping (to specify and/or multiple assignments) + while ((isspace(str[start]) || str[start] == '"') && start < size - 1) + start++; + char delim = (isOr ? ',' : '+'); + end = str.find(delim, start); + if (end == string::npos) + end = size; + + // Remove tailing whitespace/quotes + size_t subEnd = end; + while (subEnd > 0 && (isspace(str[subEnd - 1]) || str[start] == '"')) + subEnd--; + string subStr = str.substr(start, subEnd - start); + start = end + 1; + + // Parse the multi/single source in substring + CInputSource *parsed; + if (isOr) + parsed = ParseMultiSource(subStr, fullAxisOnly, false); + else + parsed = ParseSingleSource(subStr); + + // Check the result is valid + if (parsed != NULL && parsed->type != SourceInvalid && + (parsed->type == SourceEmpty || parsed->type == SourceFullAxis && fullAxisOnly || parsed->type != SourceFullAxis && !fullAxisOnly)) + { + // Keep track of all sources parsed + if (isMulti) + sources.push_back(parsed); + else if (source != NULL) + { + sources.push_back(source); + sources.push_back(parsed); + isMulti = true; + } + else + source = parsed; + } + } + while (start < size); + + // If only parsed a single source, return that, otherwise return a CMultiInputSource combining all the sources + return (isMulti ? new CMultiInputSource(isOr, sources) : source); +} + +CInputSource *CInputSystem::ParseSingleSource(string str) +{ + // Try parsing a key mapping + int kbdNum; + int keyNameIndex = ParseDevMapping(str, "KEY", kbdNum); + if (keyNameIndex >= 0) + { + string keyName = str.substr(keyNameIndex); + if (IsValidKeyName(keyName)) + { + // Lookup key index and map to key source + int keyIndex = GetKeyIndex(keyName.c_str()); + if (keyIndex >= 0) + return GetKeySource(kbdNum, keyIndex); + else if (EqualsIgnoreCase(keyName, "SHIFT") || EqualsIgnoreCase(keyName, "CTRL") || EqualsIgnoreCase(keyName, "ALT")) + { + // Handle special cases if not handled by subclass: SHIFT, CTRL and ALT + string leftName = "LEFT" + keyName; + string rightName = "RIGHT" + keyName; + int leftIndex = GetKeyIndex(leftName.c_str()); + int rightIndex = GetKeyIndex(rightName.c_str()); + vector sources; + if (leftIndex >= 0) + { + CInputSource *leftSource = GetKeySource(kbdNum, leftIndex); + if (leftSource != NULL) + sources.push_back(leftSource); + } + if (rightIndex >= 0) + { + CInputSource *rightSource = GetKeySource(kbdNum, rightIndex); + if (rightSource != NULL) + sources.push_back(rightSource); + } + if (sources.size() > 0) + return new CMultiInputSource(true, sources); + } + return s_emptySource; + } + } + + // Try parsing a mouse mapping + int mseNum; + int msePartIndex = ParseDevMapping(str, "MOUSE", mseNum); + if (msePartIndex >= 0) + { + // Lookup mouse part and map to mouse source + EMousePart msePart = LookupMousePart(str.substr(msePartIndex)); + if (msePart != MouseUnknown) + return GetMouseSource(mseNum, msePart); + } + + // Try parsing a joystick mapping + int joyNum; + int joyPartIndex = ParseDevMapping(str, "JOY", joyNum); + if (joyPartIndex >= 0) + { + // Lookup joystick part and map to joystick source + EJoyPart joyPart = LookupJoyPart(str.substr(joyPartIndex)); + if (joyPart != JoyUnknown) + return GetJoySource(joyNum, joyPart); + } + + // As last option, assume mapping is just a key name and try creating keyboard source from it (to retain compatibility with previous + // versions of Supermodel) + if (IsValidKeyName(str)) + { + // Lookup key index and map to key source + int keyIndex = GetKeyIndex(str.c_str()); + if (keyIndex >= 0) + return GetKeySource(ANY_KEYBOARD, keyIndex); + else + return s_emptySource; + } + + // If got here, it was not possible to parse mapping string so return NULL + return NULL; +} + +void CInputSystem::PrintKeySettings(KeySettings *settings) +{ + // Get common key settings and print header + KeySettings *common; + if (settings->kbdNum == ANY_KEYBOARD) + { + puts("Common Keyboard Settings:"); + common = NULL; + } + else + { + printf("Keyboard %d Settings:\n", settings->kbdNum + 1); + common = GetKeySettings(ANY_KEYBOARD, true); + } + + // Print all common settings and any settings that are different to common settings + if (common == NULL || settings->sensitivity != common->sensitivity) printf(" Sensitivity = %d %%\n", settings->sensitivity); + if (common == NULL || settings->decaySpeed != common->decaySpeed) printf(" Decay Speed = %d %%\n", settings->decaySpeed); +} + +KeySettings *CInputSystem::ReadKeySettings(CINIFile *ini, const char *section, int kbdNum) +{ + // Get common key settings and create new key settings based on that + KeySettings *common = (kbdNum != ANY_KEYBOARD ? GetKeySettings(ANY_KEYBOARD, true) : &m_defKeySettings); + KeySettings *settings = new KeySettings(*common); + settings->kbdNum = kbdNum; + + // Read settings from ini file + string baseKey("InputKey"); + if (kbdNum != ANY_KEYBOARD) + baseKey.append(IntToString(kbdNum + 1)); + bool read = false; + read |= ini->Get(section, baseKey + "Sensitivity", settings->sensitivity) == OKAY; + read |= ini->Get(section, baseKey + "DecaySpeed", settings->decaySpeed) == OKAY; + if (read) + return settings; + delete settings; + return NULL; +} + +void CInputSystem::WriteKeySettings(CINIFile *ini, const char *section, KeySettings *settings) +{ + // Get common key settings + KeySettings *common = (settings->kbdNum != ANY_KEYBOARD ? GetKeySettings(ANY_KEYBOARD, true) : &m_defKeySettings); + + // Write to ini file any settings that are different to common settings + string baseKey("InputKey"); + if (settings->kbdNum != ANY_KEYBOARD) + baseKey.append(IntToString(settings->kbdNum + 1)); + if (settings->sensitivity != common->sensitivity) ini->Set(section, baseKey + "Sensitivity", settings->sensitivity); + if (settings->decaySpeed != common->decaySpeed) ini->Set(section, baseKey + "DecaySpeed", settings->decaySpeed); +} + +void CInputSystem::PrintMouseSettings(MouseSettings *settings) +{ + // Get common mouse settings and print header + MouseSettings *common; + if (settings->mseNum == ANY_MOUSE) + { + puts("Common Mouse Settings:"); + common = NULL; + } + else + { + printf("Mouse %d Settings:\n", settings->mseNum + 1); + common = GetMouseSettings(ANY_MOUSE, true); + } + + // Print all common settings and any settings that are different to common/default settings + if (common == NULL || settings->xDeadZone != common->xDeadZone) printf(" X Dead Zone = %d %%\n", settings->xDeadZone); + if (common == NULL || settings->yDeadZone != common->yDeadZone) printf(" Y Dead Zone = %d %%\n", settings->yDeadZone); + if (common == NULL || settings->zDeadZone != common->zDeadZone) printf(" Z Dead Zone = %d %%\n", settings->zDeadZone); +} + +MouseSettings *CInputSystem::ReadMouseSettings(CINIFile *ini, const char *section, int mseNum) +{ + // Get common mouse settings and create new mouse settings based on that + MouseSettings *common = (mseNum != ANY_MOUSE ? GetMouseSettings(ANY_MOUSE, true) : &m_defMseSettings); + MouseSettings *settings = new MouseSettings(*common); + settings->mseNum = mseNum; + + // Read settings from ini file + string baseKey("InputMouse"); + if (mseNum != ANY_MOUSE) + baseKey.append(IntToString(mseNum + 1)); + bool read = false; + read |= ini->Get(section, baseKey + "XDeadZone", settings->xDeadZone) == OKAY; + read |= ini->Get(section, baseKey + "YDeadZone", settings->yDeadZone) == OKAY; + read |= ini->Get(section, baseKey + "ZDeadZone", settings->zDeadZone) == OKAY; + if (read) + return settings; + delete settings; + return NULL; +} + +void CInputSystem::WriteMouseSettings(CINIFile *ini, const char *section, MouseSettings *settings) +{ + // Get common mouse settings + MouseSettings *common = (settings->mseNum != ANY_MOUSE ? GetMouseSettings(ANY_MOUSE, true) : &m_defMseSettings); + + // Write to ini file any settings that are different to common/default settings + string baseKey("InputMouse"); + if (settings->mseNum != ANY_MOUSE) + baseKey.append(IntToString(settings->mseNum + 1)); + if (settings->xDeadZone != common->xDeadZone) ini->Set(section, baseKey + "XDeadZone", settings->xDeadZone); + if (settings->yDeadZone != common->yDeadZone) ini->Set(section, baseKey + "YDeadZone", settings->yDeadZone); + if (settings->zDeadZone != common->zDeadZone) ini->Set(section, baseKey + "ZDeadZone", settings->zDeadZone); +} + +void CInputSystem::PrintJoySettings(JoySettings *settings) +{ + // Get common mouse settings and print header + JoySettings *common; + if (settings->joyNum == ANY_JOYSTICK) + { + puts("Common Joystick Settings:"); + common = NULL; + } + else + { + printf("Joystick %d Settings:\n", settings->joyNum + 1); + common = GetJoySettings(ANY_JOYSTICK, true); + } + + // Print all common settings and any settings that are different to common/default settings + if (common == NULL || settings->xDeadZone != common->xDeadZone) printf(" X-Axis Dead Zone = %d %%\n", settings->xDeadZone); + if (common == NULL || settings->xSaturation != common->xSaturation) printf(" X-Axis Saturation = %d %%\n", settings->xSaturation); + if (common == NULL || settings->yDeadZone != common->yDeadZone) printf(" Y-Axis Dead Zone = %d %%\n", settings->yDeadZone); + if (common == NULL || settings->ySaturation != common->ySaturation) printf(" Y-Axis Saturation = %d %%\n", settings->ySaturation); + if (common == NULL || settings->zDeadZone != common->zDeadZone) printf(" Z-Axis Dead Zone = %d %%\n", settings->zDeadZone); + if (common == NULL || settings->zSaturation != common->zSaturation) printf(" Z-Axis Saturation = %d %%\n", settings->zSaturation); + if (common == NULL || settings->rxDeadZone != common->rxDeadZone) printf(" RX-Axis Dead Zone = %d %%\n", settings->rxDeadZone); + if (common == NULL || settings->rxSaturation != common->rxSaturation) printf(" RX-Axis Saturation = %d %%\n", settings->rxSaturation); + if (common == NULL || settings->ryDeadZone != common->ryDeadZone) printf(" RY-Axis Dead Zone = %d %%\n", settings->ryDeadZone); + if (common == NULL || settings->rySaturation != common->rySaturation) printf(" RY-Axis Saturation = %d %%\n", settings->rySaturation); + if (common == NULL || settings->rzDeadZone != common->rzDeadZone) printf(" RZ-Axis Dead Zone = %d %%\n", settings->rzDeadZone); + if (common == NULL || settings->rzSaturation != common->rzSaturation) printf(" RZ-Axis Saturation = %d %%\n", settings->rzSaturation); +} + +JoySettings *CInputSystem::ReadJoySettings(CINIFile *ini, const char *section, int joyNum) +{ + // Get common/default joystick settings and create new joystick settings based on that + JoySettings *common = (joyNum != ANY_JOYSTICK ? GetJoySettings(ANY_JOYSTICK, true) : &m_defJoySettings); + JoySettings *settings = new JoySettings(*common); + settings->joyNum = joyNum; + + // Read settings from ini file + string baseKey("InputJoy"); + if (joyNum != ANY_JOYSTICK) + baseKey.append(IntToString(joyNum + 1)); + bool read = false; + read |= ini->Get(section, baseKey + "XDeadZone", settings->xDeadZone) == OKAY; + read |= ini->Get(section, baseKey + "XSaturation", settings->xSaturation) == OKAY; + read |= ini->Get(section, baseKey + "YDeadZone", settings->yDeadZone) == OKAY; + read |= ini->Get(section, baseKey + "YSaturation", settings->ySaturation) == OKAY; + read |= ini->Get(section, baseKey + "ZDeadZone", settings->zDeadZone) == OKAY; + read |= ini->Get(section, baseKey + "ZSaturation", settings->zSaturation) == OKAY; + read |= ini->Get(section, baseKey + "RXDeadZone", settings->rxDeadZone) == OKAY; + read |= ini->Get(section, baseKey + "RXSaturation", settings->rxSaturation) == OKAY; + read |= ini->Get(section, baseKey + "RYDeadZone", settings->ryDeadZone) == OKAY; + read |= ini->Get(section, baseKey + "RYSaturation", settings->rySaturation) == OKAY; + read |= ini->Get(section, baseKey + "RZDeadZone", settings->rzDeadZone) == OKAY; + read |= ini->Get(section, baseKey + "RZSaturation", settings->rzSaturation) == OKAY; + if (read) + return settings; + delete settings; + return NULL; +} + +void CInputSystem::WriteJoySettings(CINIFile *ini, const char *section, JoySettings *settings) +{ + // Get common/default joystick settings + JoySettings *common = (settings->joyNum != ANY_JOYSTICK ? GetJoySettings(ANY_JOYSTICK, true) : &m_defJoySettings); + + // Write to ini file any settings that are different to common/default settings + string baseKey("InputJoy"); + if (settings->joyNum != ANY_JOYSTICK) + baseKey.append(IntToString(settings->joyNum + 1)); + if (settings->xDeadZone != common->xDeadZone) ini->Set(section, baseKey + "XDeadZone", settings->xDeadZone); + if (settings->xSaturation != common->xSaturation) ini->Set(section, baseKey + "XSaturation", settings->xSaturation); + if (settings->yDeadZone != common->yDeadZone) ini->Set(section, baseKey + "YDeadZone", settings->yDeadZone); + if (settings->ySaturation != common->ySaturation) ini->Set(section, baseKey + "YSaturation", settings->ySaturation); + if (settings->zDeadZone != common->zDeadZone) ini->Set(section, baseKey + "ZDeadZone", settings->zDeadZone); + if (settings->zSaturation != common->zSaturation) ini->Set(section, baseKey + "ZSaturation", settings->zSaturation); + if (settings->rxDeadZone != common->rxDeadZone) ini->Set(section, baseKey + "RXDeadZone", settings->rxDeadZone); + if (settings->rxSaturation != common->rxSaturation) ini->Set(section, baseKey + "RXSaturation", settings->rxSaturation); + if (settings->ryDeadZone != common->ryDeadZone) ini->Set(section, baseKey + "RYDeadZone", settings->ryDeadZone); + if (settings->rySaturation != common->rySaturation) ini->Set(section, baseKey + "RYSaturation", settings->rySaturation); + if (settings->rzDeadZone != common->rzDeadZone) ini->Set(section, baseKey + "RZDeadZone", settings->rzDeadZone); + if (settings->rzSaturation != common->rzSaturation) ini->Set(section, baseKey + "RZSaturation", settings->rzSaturation); +} + +KeySettings *CInputSystem::GetKeySettings(int kbdNum, bool useDefault) +{ + KeySettings *common = NULL; + for (vector::iterator it = m_keySettings.begin(); it < m_keySettings.end(); it++) + { + if ((*it)->kbdNum == kbdNum) + return *it; + else if ((*it)->kbdNum == ANY_KEYBOARD) + common = *it; + } + if (!useDefault) + return NULL; + return (common != NULL ? common : &m_defKeySettings); +} + +MouseSettings *CInputSystem::GetMouseSettings(int mseNum, bool useDefault) +{ + MouseSettings *common = NULL; + for (vector::iterator it = m_mseSettings.begin(); it < m_mseSettings.end(); it++) + { + if ((*it)->mseNum == mseNum) + return *it; + else if ((*it)->mseNum == ANY_MOUSE) + common = *it; + } + if (!useDefault) + return NULL; + return (common != NULL ? common : &m_defMseSettings); +} + +JoySettings *CInputSystem::GetJoySettings(int joyNum, bool useDefault) +{ + JoySettings *common = NULL; + for (vector::iterator it = m_joySettings.begin(); it < m_joySettings.end(); it++) + { + if ((*it)->joyNum == joyNum) + return *it; + else if ((*it)->joyNum == ANY_JOYSTICK) + common = *it; + } + if (!useDefault) + return NULL; + return (common != NULL ? common : &m_defJoySettings); +} + +bool CInputSystem::IsAxis(EMousePart msePart) +{ + return msePart >= MouseXAxis && msePart <= MouseZAxisNeg; +} + +bool CInputSystem::IsFullAxis(EMousePart msePart) +{ + return IsAxis(msePart) && (((msePart - MouseXAxis) % 4) == AXIS_FULL || ((msePart - MouseXAxis) % 4) == AXIS_INVERTED); +} + +bool CInputSystem::GetAxisDetails(EMousePart msePart, int &axisNum, int &axisDir) +{ + if (!IsAxis(msePart)) + return false; + axisNum = (msePart - MouseXAxis) / 4; + axisDir = (msePart - MouseXAxis) % 4; + return true; +} + +bool CInputSystem::IsButton(EMousePart msePart) +{ + return msePart >= MouseButtonLeft && msePart <= MouseButtonX2; +} + +int CInputSystem::GetButtonNumber(EMousePart msePart) +{ + if (!IsButton(msePart)) + return -1; + return msePart - MouseButtonLeft; +} + +EMousePart CInputSystem::GetMouseAxis(int axisNum, int axisDir) +{ + if (axisNum > 0 || axisNum >= NUM_MOUSE_AXES || axisDir < 0 || axisDir > 3) + return MouseUnknown; + return (EMousePart)(MouseXAxis + 4 * axisNum + axisDir); +} + +EMousePart CInputSystem::GetMouseButton(int butNum) +{ + if (butNum < 0 || butNum >= NUM_MOUSE_BUTTONS) + return MouseUnknown; + return (EMousePart)(MouseButtonLeft + butNum); +} + +bool CInputSystem::IsAxis(EJoyPart joyPart) +{ + return joyPart >= JoyXAxis && joyPart <= JoyRZAxisNeg; +} + +bool CInputSystem::IsFullAxis(EJoyPart joyPart) +{ + return IsAxis(joyPart) && (((joyPart - JoyXAxis) % 4) == AXIS_FULL || ((joyPart - JoyXAxis) % 4) == AXIS_INVERTED); +} + +bool CInputSystem::GetAxisDetails(EJoyPart joyPart, int &axisNum, int &axisDir) +{ + if (!IsAxis(joyPart)) + return false; + axisNum = (joyPart - JoyXAxis) / 4; + axisDir = (joyPart - JoyXAxis) % 4; + return true; +} + +bool CInputSystem::IsPOV(EJoyPart joyPart) +{ + return joyPart >= JoyPOV0Up && joyPart <= JoyPOV3Right; +} + +bool CInputSystem::GetPOVDetails(EJoyPart joyPart, int &povNum, int &povDir) +{ + if (!IsPOV(joyPart)) + return false; + povNum = (joyPart - JoyPOV0Up) / 4; + povDir = (joyPart - JoyPOV0Up) % 4; + return true; +} + +bool CInputSystem::IsButton(EJoyPart joyPart) +{ + return joyPart >= JoyButton0 && joyPart <= JoyButton31; +} + +int CInputSystem::GetButtonNumber(EJoyPart joyPart) +{ + if (!IsButton(joyPart)) + return -1; + return joyPart - JoyButton0; +} + +EJoyPart CInputSystem::GetJoyAxis(int axisNum, int axisDir) +{ + if (axisNum < 0 || axisNum >= NUM_JOY_AXES || axisDir < 0 || axisDir > 3) + return JoyUnknown; + return (EJoyPart)(JoyXAxis + 4 * axisNum + axisDir); +} + +EJoyPart CInputSystem::GetJoyPOV(int povNum, int povDir) +{ + if (povNum < 0 || povNum >= NUM_JOY_POVS) + return JoyUnknown; + return (EJoyPart)(JoyPOV0Up + 4 * povNum + povDir); +} + +EJoyPart CInputSystem::GetJoyButton(int butNum) +{ + if (butNum < 0 || butNum >= NUM_JOY_BUTTONS) + return JoyUnknown; + return (EJoyPart)(JoyButton0 + butNum); +} + +bool CInputSystem::ConfigMouseCentered() +{ + // Get mouse X & Y + int mx = GetMouseAxisValue(ANY_MOUSE, AXIS_X); + int my = GetMouseAxisValue(ANY_MOUSE, AXIS_Y); + + // See if mouse in center of display + unsigned lx = m_dispX + m_dispW / 4; + unsigned ly = m_dispY + m_dispH / 4; + return mx >= lx && mx <= lx + m_dispW / 2 && my >= ly && my <= ly + m_dispH / 2; +} + +CInputSource *CInputSystem::CreateAnyKeySource(int keyIndex) +{ + // Default ANY_KEYBOARD source is to use CMultiInputSource to combine all individual sources + vector keySrcs; + for (int kbdNum = 0; kbdNum < m_numKbds; kbdNum++) + { + CInputSource *keySrc = CreateKeySource(kbdNum, keyIndex); + if (keySrc != NULL) + keySrcs.push_back(keySrc); + } + return new CMultiInputSource(true, keySrcs); +} + +CInputSource *CInputSystem::CreateAnyMouseSource(EMousePart msePart) +{ + // Default ANY_MOUSE source is to use CMultiInputSource to combine all individual sources + vector mseSrcs; + for (int mseNum = 0; mseNum < m_numMice; mseNum++) + { + CInputSource *mseSrc = CreateMouseSource(mseNum, msePart); + if (mseSrc != NULL) + mseSrcs.push_back(mseSrc); + } + return new CMultiInputSource(true, mseSrcs); +} + +CInputSource *CInputSystem::CreateAnyJoySource(EJoyPart joyPart) +{ + // Default ANY_JOYSTICK source is to use CMultiInputSource to combine all individual sources + vector joySrcs; + for (int joyNum = 0; joyNum < m_numJoys; joyNum++) + { + CInputSource *joySrc = CreateJoySource(joyNum, joyPart); + if (joySrc != NULL) + joySrcs.push_back(joySrc); + } + return new CMultiInputSource(true, joySrcs); +} + +CInputSource *CInputSystem::CreateKeySource(int kbdNum, int keyIndex) +{ + // Get key settings + KeySettings *settings = GetKeySettings(kbdNum, true); + + // Create source for given key index + return new CKeyInputSource(this, kbdNum, keyIndex, settings->sensitivity, settings->decaySpeed); +} + +CInputSource *CInputSystem::CreateMouseSource(int mseNum, EMousePart msePart) +{ + // Get mouse settings + MouseSettings *settings = GetMouseSettings(mseNum, true); + + // Create source according to given mouse part + int axisNum; + int axisDir; + if (GetAxisDetails(msePart, axisNum, axisDir)) + { + // Part is mouse axis so get the deadzone setting for it + unsigned deadZone; + switch (axisNum) + { + case AXIS_X: deadZone = settings->xDeadZone; break; + case AXIS_Y: deadZone = settings->yDeadZone; break; + case AXIS_Z: deadZone = settings->zDeadZone; break; + default: return NULL; // Any other axis numbers are invalid + } + return new CMseAxisInputSource(this, mseNum, axisNum, axisDir, deadZone); + } + else if (IsButton(msePart)) + { + // Part is mouse button so map it to button number + int butNum = GetButtonNumber(msePart); + if (butNum < 0) + return NULL; // Buttons out of range are invalid + return new CMseButInputSource(this, mseNum, butNum); + } + + // If got here, then mouse part is invalid + return NULL; +} + +CInputSource *CInputSystem::CreateJoySource(int joyNum, EJoyPart joyPart) +{ + // Get joystick details and settings + JoyDetails *joyDetails = GetJoyDetails(joyNum); + JoySettings *settings = GetJoySettings(joyNum, true); + + // Create source according to given joystick part + int axisNum; + int axisDir; + int povNum; + int povDir; + if (GetAxisDetails(joyPart, axisNum, axisDir)) + { + // Part is joystick axis so see whether joystick has this axis and get the deadzone and saturation settings for it + bool hasAxis; + unsigned axisDZone; + unsigned axisSat; + switch (axisNum) + { + case AXIS_X: hasAxis = joyDetails->hasXAxis; axisDZone = settings->xDeadZone; axisSat = settings->xSaturation; break; + case AXIS_Y: hasAxis = joyDetails->hasYAxis; axisDZone = settings->yDeadZone; axisSat = settings->ySaturation; break; + case AXIS_Z: hasAxis = joyDetails->hasZAxis; axisDZone = settings->zDeadZone; axisSat = settings->zSaturation; break; + case AXIS_RX: hasAxis = joyDetails->hasRXAxis; axisDZone = settings->rxDeadZone; axisSat = settings->rxSaturation; break; + case AXIS_RY: hasAxis = joyDetails->hasRYAxis; axisDZone = settings->ryDeadZone; axisSat = settings->rySaturation; break; + case AXIS_RZ: hasAxis = joyDetails->hasRZAxis; axisDZone = settings->rzDeadZone; axisSat = settings->rzSaturation; break; + default: return NULL; // Any other axis numbers are invalid + } + if (!hasAxis) + return s_emptySource; // If joystick doesn't have axis, then return empty source rather than NULL as not really an error + return new CJoyAxisInputSource(this, joyNum, axisNum, axisDir, axisDZone, axisSat); + } + else if (GetPOVDetails(joyPart, povNum, povDir)) + { + // Part is joystick POV hat controller so see whether joystick has this POV + if (povNum >= joyDetails->numPOVs) + return s_emptySource; // If joystick doesn't have POV, then return empty source rather than NULL as not really an error + return new CJoyPOVInputSource(this, joyNum, povNum, povDir); + } + else if (IsButton(joyPart)) + { + // Part is joystick button so map it to a button number + int butNum = GetButtonNumber(joyPart); + if (butNum < 0) + return NULL; // Buttons out of range are invalid + if (butNum >= joyDetails->numButtons) + return s_emptySource; // If joystick doesn't have button, then return empty source rather than NULL as not really an error + return new CJoyButInputSource(this, joyNum, butNum); + } + + // If got here, then joystick part is invalid + return NULL; +} + +bool CInputSystem::Initialize() +{ + // Initialize subclass + if (!InitializeSystem()) + return false; + + // Get number of keyboard, mice and joysticks + m_numKbds = GetNumKeyboards(); + m_numMice = GetNumMice(); + m_numJoys = GetNumJoysticks(); + + // Create cache to hold input sources + CreateSourceCache(); + return true; +} + +void CInputSystem::SetDisplayGeom(unsigned dispX, unsigned dispY, unsigned dispW, unsigned dispH) +{ + // Remember display geometry + m_dispX = dispX; + m_dispY = dispY; + m_dispW = dispW; + m_dispH = dispH; +} + +CInputSource* CInputSystem::ParseSource(const char *mapping, bool fullAxisOnly) +{ + return ParseMultiSource(mapping, fullAxisOnly, true); +} + +void CInputSystem::ClearSettings() +{ + // Delete all key settings + for (vector::iterator it = m_keySettings.begin(); it < m_keySettings.end(); it++) + delete *it; + m_keySettings.clear(); + + // Delete all mouse settings + for (vector::iterator it = m_mseSettings.begin(); it < m_mseSettings.end(); it++) + delete *it; + m_mseSettings.clear(); + + // Delete all joystick settings + for (vector::iterator it = m_joySettings.begin(); it < m_joySettings.end(); it++) + delete *it; + m_joySettings.clear(); +} + +void CInputSystem::PrintSettings() +{ + puts("Input System Settings"); + puts("---------------------"); + puts(""); + + printf("Input System: %s\n", name); + + puts(""); + + // Print all key settings for attached keyboards + KeySettings *keySettings = GetKeySettings(ANY_KEYBOARD, true); + PrintKeySettings(keySettings); + for (int kbdNum = 0; kbdNum < m_numKbds; kbdNum++) + { + keySettings = GetKeySettings(kbdNum, false); + if (keySettings != NULL) + PrintKeySettings(keySettings); + } + + // Print all mouse settings for attached mice + MouseSettings *mseSettings = GetMouseSettings(ANY_MOUSE, true); + PrintMouseSettings(mseSettings); + for (int mseNum = 0; mseNum < m_numMice; mseNum++) + { + mseSettings = GetMouseSettings(mseNum, false); + if (mseSettings != NULL) + PrintMouseSettings(mseSettings); + } + + // Print all joystick settings for attached joysticks + JoySettings *joySettings = GetJoySettings(ANY_JOYSTICK, true); + PrintJoySettings(joySettings); + for (int joyNum = 0; joyNum < m_numJoys; joyNum++) + { + joySettings = GetJoySettings(joyNum, false); + if (joySettings != NULL) + PrintJoySettings(joySettings); + } + + puts(""); +} + +void CInputSystem::ReadFromINIFile(CINIFile *ini, const char *section) +{ + ClearSettings(); + + // Read all key settings for attached keyboards + KeySettings *keySettings = ReadKeySettings(ini, section, ANY_KEYBOARD); + if (keySettings != NULL) + m_keySettings.push_back(keySettings); + for (int kbdNum = 0; kbdNum < m_numKbds; kbdNum++) + { + keySettings = ReadKeySettings(ini, section, kbdNum); + if (keySettings != NULL) + m_keySettings.push_back(keySettings); + } + + // Read all mouse settings for attached mice + MouseSettings *mseSettings = ReadMouseSettings(ini, section, ANY_MOUSE); + if (mseSettings != NULL) + m_mseSettings.push_back(mseSettings); + for (int mseNum = 0; mseNum < m_numMice; mseNum++) + { + mseSettings = ReadMouseSettings(ini, section, mseNum); + if (mseSettings != NULL) + m_mseSettings.push_back(mseSettings); + } + + // Read all joystick settings for attached joysticks + JoySettings *joySettings = ReadJoySettings(ini, section, ANY_JOYSTICK); + if (joySettings != NULL) + m_joySettings.push_back(joySettings); + for (int joyNum = 0; joyNum < m_numJoys; joyNum++) + { + joySettings = ReadJoySettings(ini, section, joyNum); + if (joySettings != NULL) + m_joySettings.push_back(joySettings); + } +} + +void CInputSystem::WriteToINIFile(CINIFile *ini, const char *section) +{ + // Write all key settings + for (vector::iterator it = m_keySettings.begin(); it < m_keySettings.end(); it++) + WriteKeySettings(ini, section, *it); + + // Write all mouse settings + for (vector::iterator it = m_mseSettings.begin(); it < m_mseSettings.end(); it++) + WriteMouseSettings(ini, section, *it); + + // Write all joystick settings + for (vector::iterator it = m_joySettings.begin(); it < m_joySettings.end(); it++) + WriteJoySettings(ini, section, *it); +} + +bool CInputSystem::ReadMapping(char *buffer, unsigned bufSize, bool fullAxisOnly, unsigned readFlags, const char *escapeMapping) +{ + // Map given escape mapping to an input source + CInputSource *escape = ParseSource(escapeMapping); + + string mapping; + vector sources; + bool mseCentered = false; + + // Loop until have received meaningful inputs + while (true) + { + // Poll inputs + if (!Poll()) + return false; + + // Check if escape source was triggered + if (escape != NULL && escape->IsActive()) + { + // If so, wait until source no longer active and then exit + while (escape->IsActive()) + { + if (!Poll()) + return false; + Wait(1000/60); + } + return false; + } + + // See if should read keyboards + if (readFlags & READ_KEYBOARD) + { + // Check all keyboard sources for inputs, merging devices if required + if ((readFlags & READ_MERGE_KEYBOARD) || m_numKbds == ANY_KEYBOARD) + CheckKeySources(ANY_KEYBOARD, fullAxisOnly, sources, mapping); + else + { + for (int kbdNum = 0; kbdNum < m_numKbds; kbdNum++) + CheckKeySources(kbdNum, fullAxisOnly, sources, mapping); + } + } + + // See if should read mice + if (readFlags & READ_MOUSE) + { + // For mouse input, wait until mouse is in centre of display before parsing X- and Y-axis movements + if (!mseCentered) + mseCentered = ConfigMouseCentered(); + + // Check all mouse sources for input, merging devices if required + if ((readFlags & READ_MERGE_MOUSE) || m_numMice == ANY_MOUSE) + CheckMouseSources(ANY_MOUSE, fullAxisOnly, mseCentered, sources, mapping); + else + { + for (int mseNum = 0; mseNum < m_numMice; mseNum++) + CheckMouseSources(mseNum, fullAxisOnly, mseCentered, sources, mapping); + } + } + + // See if should read joysticks + if (readFlags & READ_JOYSTICK) + { + // Check all joystick sources, merging devices if required + if ((readFlags & READ_MERGE_JOYSTICK) || m_numJoys == ANY_JOYSTICK) + CheckJoySources(ANY_JOYSTICK, fullAxisOnly, sources, mapping); + else + { + for (int joyNum = 0; joyNum < m_numJoys; joyNum++) + CheckJoySources(joyNum, fullAxisOnly, sources, mapping); + } + } + + // When some inputs have been activated, keep lopping until they have all been released again. + if (sources.size() > 0) + { + // Check each source is no longer active + bool active = false; + for (vector::iterator it = sources.begin(); it < sources.end(); it++) + { + if ((*it)->IsActive()) + { + active = true; + break; + } + } + if (!active) + { + // If so, get combined type of sources and if is valid then return + ESourceType type = CMultiInputSource::GetCombinedType(sources); + if (type != SourceInvalid && (type == SourceFullAxis && fullAxisOnly || type != SourceFullAxis && !fullAxisOnly)) + break; + + mapping.clear(); + sources.clear(); + mseCentered = false; + } + } + + // Don't poll continuously + Wait(1000/60); + } + + // Copy mapping to buffer and return + strncpy(buffer, mapping.c_str(), bufSize - 1); + buffer[bufSize - 1] = '\0'; + return true; +} + +void CInputSystem::ConfigStart() +{ + m_isConfiguring = true; + + // Make sure mouse is visible + SetMouseVisibility(true); +} + +void CInputSystem::ConfigEnd() +{ + m_isConfiguring = false; +} + +/* + * CInputSystem::CKeyInputSource + */ +CInputSystem::CKeyInputSource::CKeyInputSource(CInputSystem *system, int kbdNum, int keyIndex, unsigned sensitivity, unsigned decaySpeed) : + CInputSource(SourceSwitch), m_system(system), m_kbdNum(kbdNum), m_keyIndex(keyIndex), m_val(0) +{ + // Calculate max value and incr and decr values (sensitivity is given as percentage 1-100, with 100 being most sensitive, and + // decay speed given as percentage 1-200 of attack speed) + int s = Clamp((int)sensitivity, 1, 100); + int d = Clamp((int)decaySpeed, 1, 200); + m_incr = 100 * s; + m_decr = d * s; + m_maxVal = 10000; +} + +bool CInputSystem::CKeyInputSource::GetValueAsSwitch(bool &val) +{ + if (!m_system->IsKeyPressed(m_kbdNum, m_keyIndex)) + return false; + val = true; + return true; +} + +bool CInputSystem::CKeyInputSource::GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal) +{ + if (m_system->IsKeyPressed(m_kbdNum, m_keyIndex)) + m_val = min(m_maxVal, m_val + m_incr); + else + m_val = max(0, m_val - m_decr); + if (m_val == 0) + return false; + val = Scale(m_val, 0, 0, m_maxVal, minVal, offVal, maxVal); + return true; +} + +/* + * CInputSystem::CMseAxisInputSource + */ +CInputSystem::CMseAxisInputSource::CMseAxisInputSource(CInputSystem *system, int mseNum, int axisNum, int axisDir, unsigned deadZone) : + CInputSource(axisDir == AXIS_FULL || axisDir == AXIS_INVERTED ? SourceFullAxis : SourceHalfAxis), + m_system(system), m_mseNum(mseNum), m_axisNum(axisNum), m_axisDir(axisDir) +{ + // If X- or Y-axis then calculate size of dead pixels region in centre of display (deadzone is given as a percentage 0-99) + if (m_axisNum == AXIS_X || m_axisNum == AXIS_Y) + { + double dDeadZone = (double)Clamp((int)deadZone, 0, 99) / 100.0; + m_deadPixels = (int)(dDeadZone * (double)(m_axisNum == AXIS_X ? m_system->m_dispW : m_system->m_dispH)); + } + else + m_deadPixels = Clamp((int)deadZone, 0, 99); +} + +int CInputSystem::CMseAxisInputSource::ScaleAxisValue(int minVal, int offVal, int maxVal) +{ + int mseVal = m_system->GetMouseAxisValue(m_mseNum, m_axisNum); + // If X- or Y-axis then convert to value centered around zero (ie relative to centre of display) + int mseMin, mseMax; + if (m_axisNum == AXIS_X || m_axisNum == AXIS_Y) + { + int dispExtent = (int)(m_axisNum == AXIS_X ? m_system->m_dispW : m_system->m_dispH); + if (dispExtent == 0) + return offVal; + mseMin = -dispExtent / 2; + mseMax = mseMin + dispExtent - 1; + mseVal = (m_axisNum == AXIS_X ? mseVal - m_system->m_dispX : mseVal - m_system->m_dispY) - dispExtent / 2; + } + else + { + // Z-axis (wheel) is always between -100 and 100 + mseMin = -100; + mseMax = 100; + } + // Check value is not zero + if (mseVal == 0) + return offVal; + // Scale values from dead zone to display edge, taking positive or negative values only or using the whole axis range as required + int dZone = (mseVal > 0 ? m_deadPixels / 2 : m_deadPixels - m_deadPixels / 2); + if (m_axisDir == AXIS_POS) return Scale(mseVal, dZone, dZone, mseMax, minVal, offVal, maxVal); + else if (m_axisDir == AXIS_NEG) return Scale(mseVal, -dZone, -dZone, mseMin, minVal, offVal, maxVal); + else if (m_axisDir == AXIS_FULL) + { + // Full axis range + if (mseVal > 0) return Scale(mseVal, dZone, dZone, mseMax, minVal, offVal, maxVal); + else return Scale(mseVal, mseMin, -dZone, -dZone, minVal, offVal, maxVal); + } + else + { + // Full axis range, but inverted + if (mseVal > 0) return Scale(mseVal, dZone, dZone, mseMax, maxVal, offVal, minVal); + else return Scale(mseVal, mseMin, -dZone, -dZone, maxVal, offVal, minVal); + } +} + +bool CInputSystem::CMseAxisInputSource::GetValueAsSwitch(bool &val) +{ + // For Z-axis (wheel), switch value is handled slightly differently + if (m_axisNum == AXIS_Z) + { + int wheelDir = m_system->GetMouseWheelDir(m_mseNum); + if ((m_axisDir == AXIS_POS || m_axisDir == AXIS_FULL) && wheelDir <= 0 || + (m_axisDir == AXIS_NEG || m_axisDir == AXIS_INVERTED) && wheelDir >= 0) + return false; + } + else + { + if (ScaleAxisValue(0, 0, 3) < 2) + return false; + } + val = true; + return true; +} + +bool CInputSystem::CMseAxisInputSource::GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal) +{ + int axisVal = ScaleAxisValue(minVal, offVal, maxVal); + if (axisVal == offVal) + return false; + val = axisVal; + return true; +} + +/* + * CInputSystem::CMseButInputSource + */ +CInputSystem::CMseButInputSource::CMseButInputSource(CInputSystem *system, int mseNum, int butNum) : + CInputSource(SourceSwitch), m_system(system), m_mseNum(mseNum), m_butNum(butNum) +{ + // +} + +bool CInputSystem::CMseButInputSource::GetValueAsSwitch(bool &val) +{ + if (!m_system->IsMouseButPressed(m_mseNum, m_butNum)) + return false; + val = true; + return true; +} + +bool CInputSystem::CMseButInputSource::GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal) +{ + if (!m_system->IsMouseButPressed(m_mseNum, m_butNum)) + return false; + val = maxVal; + return true; +} + +/* + * CInputSystem::CJoyAxisInputSource + */ +CInputSystem::CJoyAxisInputSource::CJoyAxisInputSource(CInputSystem *system, int joyNum, int axisNum, int axisDir, unsigned deadZone, unsigned saturation) : + CInputSource(axisDir == AXIS_FULL || axisDir == AXIS_INVERTED ? SourceFullAxis : SourceHalfAxis), + m_system(system), m_joyNum(joyNum), m_axisNum(axisNum), m_axisDir(axisDir) +{ + // Calculate pos/neg deadzone and saturation points (joystick raw values range from -32768 to 32767, deadzone given as + // percentage 0-99 and saturation given as percentage 1-100) + double dDeadZone = (double)Clamp((int)deadZone, 0, 99) / 100.0; + double dSaturation = (double)Clamp((int)saturation, (int)deadZone + 1, 100) / 100.0; + m_posDZone = (int)(dDeadZone * 32767.0); + m_negDZone = (int)(dDeadZone * -32768.0); + m_posSat = (int)(dSaturation * 32767.0); + m_negSat = (int)(dSaturation * -32868.0); +} + +int CInputSystem::CJoyAxisInputSource::ScaleAxisValue(int minVal, int offVal, int maxVal) +{ + // Get raw axis value from input system (values range from -32768 to 32767) + int joyVal = m_system->GetJoyAxisValue(m_joyNum, m_axisNum); + // Check value is not zero + if (joyVal == 0) + return offVal; + // Scale value between deadzone and saturation points, taking positive or negative values only or using the whole axis range as required + if (m_axisDir == AXIS_POS) return Scale(joyVal, m_posDZone, m_posDZone, m_posSat, minVal, offVal, maxVal); + else if (m_axisDir == AXIS_NEG) return Scale(joyVal, m_negDZone, m_negDZone, m_negSat, minVal, offVal, maxVal); + else if (m_axisDir == AXIS_FULL) + { + // Full axis range + if (joyVal > 0) return Scale(joyVal, m_posDZone, m_posDZone, m_posSat, minVal, offVal, maxVal); + else return Scale(joyVal, m_negSat, m_negDZone, m_negDZone, minVal, offVal, maxVal); + } + else + { + // Full axis range, but inverted + if (joyVal > 0) return Scale(joyVal, m_posDZone, m_posDZone, m_posSat, maxVal, offVal, minVal); + else return Scale(joyVal, m_negSat, m_negDZone, m_negDZone, maxVal, offVal, minVal); + } +} + +bool CInputSystem::CJoyAxisInputSource::GetValueAsSwitch(bool &val) +{ + if (ScaleAxisValue(0, 0, 3) < 2) + return false; + val = true; + return true; +} + +bool CInputSystem::CJoyAxisInputSource::GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal) +{ + int axisVal = ScaleAxisValue(minVal, offVal, maxVal); + if (axisVal == offVal) + return false; + val = axisVal; + return true; +} + +/* + * CInputSystem::CJoyPOVInputSource + */ +CInputSystem::CJoyPOVInputSource::CJoyPOVInputSource(CInputSystem *system, int joyNum, int povNum, int povDir) : + CInputSource(SourceSwitch), m_system(system), m_joyNum(joyNum), m_povNum(povNum), m_povDir(povDir) +{ + // +} + +bool CInputSystem::CJoyPOVInputSource::GetValueAsSwitch(bool &val) +{ + if (!m_system->IsJoyPOVInDir(m_joyNum, m_povNum, m_povDir)) + return false; + val = true; + return true; +} + +bool CInputSystem::CJoyPOVInputSource::GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal) +{ + if (!m_system->IsJoyPOVInDir(m_joyNum, m_povNum, m_povDir)) + return false; + val = maxVal; + return true; +} + +/* + * CInputSystem::CJoyButInputSource + */ +CInputSystem::CJoyButInputSource::CJoyButInputSource(CInputSystem *system, int joyNum, int butNum) : + CInputSource(SourceSwitch), m_system(system), m_joyNum(joyNum), m_butNum(butNum) +{ + // +} + +bool CInputSystem::CJoyButInputSource::GetValueAsSwitch(bool &val) +{ + if (!m_system->IsJoyButPressed(m_joyNum, m_butNum)) + return false; + val = true; + return true; +} + +bool CInputSystem::CJoyButInputSource::GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal) +{ + if (!m_system->IsJoyButPressed(m_joyNum, m_butNum)) + return false; + val = maxVal; + return true; +} \ No newline at end of file diff --git a/Inputs/InputSystem.h b/Inputs/InputSystem.h new file mode 100644 index 0000000..2146a06 --- /dev/null +++ b/Inputs/InputSystem.h @@ -0,0 +1,925 @@ +#ifndef INCLUDED_INPUTSYSTEM_H +#define INCLUDED_INPUTSYSTEM_H + +#include +#include +using namespace std; + +#include "MultiInputSource.h" + +class CInput; +class CInputSource; +class CINIFile; + +// Read flags for ReadMapping +#define READ_KEYBOARD 1 +#define READ_MOUSE 2 +#define READ_JOYSTICK 4 +#define READ_MERGE_KEYBOARD 8 +#define READ_MERGE_MOUSE 16 +#define READ_MERGE_JOYSTICK 32 +#define READ_ALL (READ_KEYBOARD|READ_MOUSE|READ_JOYSTICK) +#define READ_MERGE (READ_MERGE_KEYBOARD|READ_MERGE_MOUSE|READ_MERGE_JOYSTICK) + +// Used to specify any keyboard, mouse or joystick when a number is required +#define ANY_KEYBOARD -1 +#define ANY_MOUSE -1 +#define ANY_JOYSTICK -1 + +// Default keyboard, mouse and joystick settings +#define DEFAULT_KEY_SENSITIVITY 25 +#define DEFAULT_KEY_DECAYSPEED 50 +#define DEFAULT_MSE_DEADZONE 0 +#define DEFAULT_JOY_DEADZONE 3 +#define DEFAULT_JOY_SATURATION 100 + +// Number of valid keys and mouse and joystick parts +#define NUM_VALID_KEYS (sizeof(s_validKeyNames) / sizeof(const char*)) +#define NUM_MOUSE_PARTS ((int)MouseButtonX2 + 1) +#define NUM_MOUSE_AXES 3 +#define NUM_MOUSE_BUTTONS 5 +#define NUM_JOY_PARTS ((int)JoyButton31 + 1) +#define NUM_JOY_AXES 6 +#define NUM_JOY_POVS 4 +#define NUM_JOY_BUTTONS 32 + +// Axis numbers +#define AXIS_X 0 +#define AXIS_Y 1 +#define AXIS_Z 2 +#define AXIS_RX 3 +#define AXIS_RY 4 +#define AXIS_RZ 5 + +// Axis directions +#define AXIS_FULL 0 +#define AXIS_INVERTED 1 +#define AXIS_POS 2 +#define AXIS_NEG 3 + +// POV directions +#define POV_UP 0 +#define POV_DOWN 1 +#define POV_LEFT 2 +#define POV_RIGHT 3 + +/* + * Enumeration of all recognised mouse parts + */ +enum EMousePart +{ + MouseUnknown = -1, + MouseXAxis = 0, + MouseXAxisInv, + MouseXAxisPos, + MouseXAxisNeg, + MouseYAxis, + MouseYAxisInv, + MouseYAxisPos, + MouseYAxisNeg, + MouseZAxis, + MouseZAxisInv, + MouseZAxisPos, + MouseZAxisNeg, + MouseButtonLeft, + MouseButtonMiddle, + MouseButtonRight, + MouseButtonX1, + MouseButtonX2, +}; + +/* + * Enumeration of all supported joystick parts + */ +enum EJoyPart +{ + JoyUnknown = -1, + JoyXAxis = 0, + JoyXAxisInv, + JoyXAxisPos, + JoyXAxisNeg, + JoyYAxis, + JoyYAxisInv, + JoyYAxisPos, + JoyYAxisNeg, + JoyZAxis, + JoyZAxisInv, + JoyZAxisPos, + JoyZAxisNeg, + JoyRXAxis, + JoyRXAxisInv, + JoyRXAxisPos, + JoyRXAxisNeg, + JoyRYAxis, + JoyRYAxisInv, + JoyRYAxisPos, + JoyRYAxisNeg, + JoyRZAxis, + JoyRZAxisInv, + JoyRZAxisPos, + JoyRZAxisNeg, + JoyPOV0Up, + JoyPOV0Down, + JoyPOV0Left, + JoyPOV0Right, + JoyPOV1Up, + JoyPOV1Down, + JoyPOV1Left, + JoyPOV1Right, + JoyPOV2Up, + JoyPOV2Down, + JoyPOV2Left, + JoyPOV2Right, + JoyPOV3Up, + JoyPOV3Down, + JoyPOV3Left, + JoyPOV3Right, + JoyButton0, + JoyButton1, + JoyButton2, + JoyButton3, + JoyButton4, + JoyButton5, + JoyButton6, + JoyButton7, + JoyButton8, + JoyButton9, + JoyButton10, + JoyButton11, + JoyButton12, + JoyButton13, + JoyButton14, + JoyButton15, + JoyButton16, + JoyButton17, + JoyButton18, + JoyButton19, + JoyButton20, + JoyButton21, + JoyButton22, + JoyButton23, + JoyButton24, + JoyButton25, + JoyButton26, + JoyButton27, + JoyButton28, + JoyButton29, + JoyButton30, + JoyButton31 +}; + +struct MousePartsStruct +{ + const char* id; + EMousePart msePart; +}; + +struct JoyPartsStruct +{ + const char* id; + EJoyPart joyPart; +}; + +/* + * Struct that holds settings for a keyboard + */ +struct KeySettings +{ + int kbdNum; // Keyboard number (or ANY_KEYBOARD for settings that apply to all keyboards) + unsigned sensitivity; // Key sensitivity for analog controls as percentage 1-100, where 100 is extremely responsive + unsigned decaySpeed; // Decay speed as percentage 1-200 of on speed + + /* + * Creates a KeySettings with default settings + */ + KeySettings() + { + kbdNum = ANY_KEYBOARD; + sensitivity = DEFAULT_KEY_SENSITIVITY; + decaySpeed = DEFAULT_KEY_DECAYSPEED; + } +}; + +/* + * Struct that holds settings for a mouse + */ +struct MouseSettings +{ + int mseNum; // Mouse number (or ANY_MOUSE for settings that apply to all mice) + unsigned xDeadZone; // X-Axis dead zone as a percentage 0-99 of display width + unsigned yDeadZone; // Y-Axis dead zone as a percentage 0-99 of display height + unsigned zDeadZone; // Z-Axis dead zone as a percentage 0-99 of axis range + + /* + * Creates a MouseSettings with default settings + */ + MouseSettings() + { + mseNum = ANY_MOUSE; + xDeadZone = DEFAULT_MSE_DEADZONE; + yDeadZone = DEFAULT_MSE_DEADZONE; + zDeadZone = 0; + } +}; + +/* + * Struct that holds settings for a joystick + */ +struct JoySettings +{ + int joyNum; // Joystick number (or ANY_JOYSTICK for settings that apply to all joysticks) + unsigned xDeadZone; // X-Axis dead zone as a percentage 0-99 of axis positive/negative ranges + unsigned xSaturation; // X-Axis saturation as a percentage 1-100 of axis positive/negative ranges + unsigned yDeadZone; // Y-Axis dead zone as a percentage 0-99 of axis positive/negative ranges + unsigned ySaturation; // Y-Axis saturation as a percentage 1-100 of axis positive/negative ranges + unsigned zDeadZone; // Z-Axis dead zone as a percentage 0-99 of axis positive/negative ranges + unsigned zSaturation; // Z-Axis saturation as a percentage 1-100 of axis positive/negative ranges + unsigned rxDeadZone; // RX-Axis dead zone as a percentage 0-99 of axis positive/negative ranges + unsigned rxSaturation; // RX-Axis saturation as a percentage 1-100 of joystick axis positive/negative ranges + unsigned ryDeadZone; // RY-Axis dead zone as a percentage 0-99 of axis positive/negative ranges + unsigned rySaturation; // RY-Axis saturation as a percentage 1-100 of joystick axis positive/negative ranges + unsigned rzDeadZone; // RZ-Axis dead zone as a percentage 0-99 of axis positive/negative ranges + unsigned rzSaturation; // RZ-Axis saturation as a percentage 1-100 of joystick axis positive/negative ranges + + /* + * Creates a JoySettings with default settings + */ + JoySettings() + { + joyNum = ANY_JOYSTICK; + xDeadZone = DEFAULT_JOY_DEADZONE; + xSaturation = DEFAULT_JOY_SATURATION; + yDeadZone = DEFAULT_JOY_DEADZONE; + ySaturation = DEFAULT_JOY_SATURATION; + zDeadZone = DEFAULT_JOY_DEADZONE; + zSaturation = DEFAULT_JOY_SATURATION; + rxDeadZone = DEFAULT_JOY_DEADZONE; + rxSaturation = DEFAULT_JOY_SATURATION; + ryDeadZone = DEFAULT_JOY_DEADZONE; + rySaturation = DEFAULT_JOY_SATURATION; + rzDeadZone = DEFAULT_JOY_DEADZONE; + rzSaturation = DEFAULT_JOY_SATURATION; + } +}; + +struct JoyDetails +{ + bool hasXAxis; // Flags to indicate which axes available on joystick + bool hasYAxis; + bool hasZAxis; + bool hasRXAxis; + bool hasRYAxis; + bool hasRZAxis; + int numAxes; // Total number of axes on joystick + int numPOVs; // Total number of POV hat controllers on joystick + int numButtons; // Total number of buttons on joystick +}; + +/* + * Abstract base class that represents an input system. An input system encapsulates all the O/S dependent code to read keyboards, + * mice and joysticks. + */ +class CInputSystem +{ +private: + // Array of valid key names + static const char *s_validKeyNames[]; + + // Lookup table for translating mouse mapping strings to their respective mouse parts + static MousePartsStruct s_mseParts[]; + + // Lookup table for translating joystick mapping strings to their respective joystick parts + static JoyPartsStruct s_joyParts[]; + + // Empty input source + static CMultiInputSource *s_emptySource; + + // Number of keyboards, mice and joysticks + int m_numKbds; + int m_numMice; + int m_numJoys; + + // Cached input sources + CInputSource **m_anyKeySources; + CInputSource **m_anyMseSources; + CInputSource **m_anyJoySources; + CInputSource ***m_keySources; + CInputSource ***m_mseSources; + CInputSource ***m_joySources; + + // Default key, mouse and joystick settings + KeySettings m_defKeySettings; + MouseSettings m_defMseSettings; + JoySettings m_defJoySettings; + + // Current key, mouse and joystick settings for attached keyboards, mice and joysticks + vector m_keySettings; + vector m_mseSettings; + vector m_joySettings; + + // + // Helper methods + // + + /* + * Creates cache for all sources. + */ + void CreateSourceCache(); + + /* + * Deletes cache for all sources. + */ + void DeleteSourceCache(); + + /* + * Deletes an input source + */ + void DeleteSource(CInputSource *source); + + /* + * Returns a key source for the given keyboard number (or all keyboards if ANY_KEYBOARD supplied) and key index + */ + CInputSource *GetKeySource(int kbdNum, int keyIndex); + + /* + * Returns a mouse source for the given mouse number (or all mice if ANY_MOUSE supplied) and mouse index + */ + CInputSource *GetMouseSource(int mseNum, EMousePart msePart); + + /* + * Returns a joystick source for the given joystick number (or all joysticks if ANY_JOYSTICK supplied) and joystick index + */ + CInputSource *GetJoySource(int joyNum, EJoyPart joyPart); + + /* + * Finds any currently activated key sources for the given keyboard number (or all keyboards if ANY_KEYBOARD supplied) + * and adds them to the sources vector, aswell as constructing the corresponding mapping(s) in the given string. + * If fullAxisOnly is true, then only sources that represent a full axis range (eg MouseXAxis) are considered. + */ + void CheckKeySources(int kbdNum, bool fullAxisOnly, vector &sources, string &mapping); + + /* + * Finds any currently activated mouse sources for the given mouse number (or all mice if ANY_MOUSE supplied) + * and adds them to the sources vector, aswell as constructing the corresponding mapping(s) in the given string. + * If fullAxisOnly is true, then only sources that represent a full axis range (eg MouseXAxis) are considered. + */ + void CheckMouseSources(int mseNum, bool fullAxisOnly, bool mseCentered, vector &sources, string &mapping); + + /* + * Finds any currently activated joystick sources for the given joystick number (or all joysticks if ANY_JOYSTICK supplied) + * and adds them to the sources vector, aswell as constructing the corresponding mapping(s) in the given string. + * If fullAxisOnly is true, then only sources that represent a full axis range (eg MouseXAxis) are considered. + */ + void CheckJoySources(int joyNum, bool fullAxisOnly, vector &sources, string &mapping); + + bool ParseInt(string str, int &num); + + string IntToString(int num); + + bool EqualsIgnoreCase(string str1, const char *str2); + + bool StartsWithIgnoreCase(string str1, const char *str2); + + /* + * Returns true if the given string represents a valid key name. + */ + bool IsValidKeyName(string str); + + /* + * Returns the EMousePart with the given mapping name or MouseUnknown if not found. + */ + EMousePart LookupMousePart(string str); + + /* + * Returns the mapping name for the given EMousePart. + */ + const char *LookupName(EMousePart msePart); + + /* + * Returns the EJoyPart with the given mapping name or JoyUnknown if not found. + */ + EJoyPart LookupJoyPart(string str); + + /* + * Returns the mapping name for the given EJoyPart. + */ + const char *LookupName(EJoyPart joyPart); + + size_t ParseDevMapping(string str, const char *devType, int &devNum); + + /* + * Parses the given mapping string, possibly representing more than one mapping, and returns an input source for it or NULL if the + * mapping is invalid. + * If fullAxisOnly is true, then only mappings that represent a full axis range (eg MouseXAxis) are parsed. + */ + CInputSource* ParseMultiSource(string str, bool fullAxisOnly, bool isOr); + + /* + * Parses the given single mapping string and returns an input source for it, or NULL if non exists. + */ + CInputSource* ParseSingleSource(string str); + + /* + * Prints the given key settings to stdout. + */ + void PrintKeySettings(KeySettings *settings); + + /* + * Reads key settings from an INI file for the given keyboard number, or common settings if ANY_KEYBOARD specified. + * Returns NULL if no relevant settings were found in the INI file. + */ + KeySettings *ReadKeySettings(CINIFile *ini, const char *section, int kbdNum); + + /* + * Writes the given key settings to an INI file, only writing out settings that are different to their defaults. + */ + void WriteKeySettings(CINIFile *ini, const char *section, KeySettings *settings); + + /* + * Prints the given mouse settings to stdout. + */ + void PrintMouseSettings(MouseSettings *settings); + + /* + * Reads mouse settings from an INI file for the given mouse number, or common settings if ANY_MOUSE specified. + * Returns NULL if no relevant settings were found in the INI file. + */ + MouseSettings *ReadMouseSettings(CINIFile *ini, const char *section, int mseNum); + + /* + * Writes the given mouse settings to an INI file, only writing out settings that are different to their defaults. + */ + void WriteMouseSettings(CINIFile *ini, const char *section, MouseSettings *settings); + + /* + * Prints the given joystick settings to stdout. + */ + void PrintJoySettings(JoySettings *settings); + + /* + * Reads joystick settings from an INI file for the given joystick number, or common settings if ANY_JOYSTICK specified. + * Returns NULL if no relevant settings were found in the INI file. + */ + JoySettings *ReadJoySettings(CINIFile *ini, const char *section, int joyNum); + + /* + * Writes the given joystick settings to an INI file, only writing out settings that are different to their defaults. + */ + void WriteJoySettings(CINIFile *ini, const char *section, JoySettings *settings); + +protected: + // Current display geometry + unsigned m_dispX; + unsigned m_dispY; + unsigned m_dispW; + unsigned m_dispH; + + // Flag to indicate if system currently being configured + bool m_isConfiguring; + + /* + * Constructs an input system with the given name. + */ + CInputSystem(const char *systemName); + + /* + * Returns the current key settings for given keyboard number, or common settings if ANY_KEYBOARD specified. + * If no settings are found and useDefault is false, NULL is returned. If useDefault is true then default settings are returned. + */ + KeySettings *GetKeySettings(int kbdNum, bool useDefault); + + /* + * Returns the current mouse settings for given mouse number, or common settings if ANY_MOUSE specified. + * If no settings are found and useDefault is false, NULL is returned. If useDefault is true then default settings are returned. + */ + MouseSettings *GetMouseSettings(int mseNum, bool useDefault); + + /* + * Returns the current joystick settings for given joystick number, or common settings if ANY_JOYSTICK specified. + * If no settings are found and useDefault is false, NULL is returned. If useDefault is true then default settings are returned. + */ + JoySettings *GetJoySettings(int joyNum, bool useDefault); + + /* + * Returns true if the given EMousePart is an axis. + */ + bool IsAxis(EMousePart msePart); + + /* + * Returns true if the given EMousePart represents a full axis, eg MouseXAxis or MouseXAxisInv. + */ + bool IsFullAxis(EMousePart msePart); + + /* + * Returns true if the EMousePart represents an axis and sets axisPart and axisDir as follows: + * axisNum will be the axis number (AXIS_X, AXIS_Y or AXIS_Z) + * axisDir will be AXIS_FULL, AXIS_INVERTED, AXIS_POS or AXIS_POS depending on whether the axis has the full range, has + * the full range but inverted, is negative only, or is positive only. + */ + bool GetAxisDetails(EMousePart msePart, int &axisNum, int &axisDir); + + /* + * Returns true if the given EMousePart represets a button, eg MouseButtonLeft. + */ + bool IsButton(EMousePart msePart); + + /* + * Returns the button number (indexed from 0) of the given EMousePart if it is a button, or -1 otherwise. + */ + int GetButtonNumber(EMousePart msePart); + + /* + * Returns the EMousePart that represents the axis component for the given axis number (AXIS_X, AXIS_Y or AXIS_Z) and direction + * (AXIS_FULL, AXIS_INVERTED, AXIS_POS or AXIS_POS), or MouseUnknown otherwise. + */ + EMousePart GetMouseAxis(int axisNum, int axisDir); + + /* + * Returns the EMousePart that represents the mouse button with the given number (0-4), or MouseUnknown otherwise. + */ + EMousePart GetMouseButton(int butNum); + + /* + * Returns true if the given EJoyPart is an axis. + */ + bool IsAxis(EJoyPart joyPart); + + /* + * Returns true if the given EJoyPart represents a full axis, eg JoyXAxis. + */ + bool IsFullAxis(EJoyPart joyPart); + + /* + * Returns true if joystick part represents an axis and sets axisPart and axisDir as follows: + * axisNum will be the axis number (AXIS_X, AXIS_Y, AXIS_Z, AXIS_RX, AXIS_RY or AXIS_RZ) + * axisDir is AXIS_FULL, AXIS_INVERTED, AXIS_POS or AXIS_POS depending on whether the axis has the full range, has + * the full range but inverted, is negative only, or is positive only. + */ + bool GetAxisDetails(EJoyPart joyPart, int &axisNum, int &axisDir); + + /* + * Returns true if the given EJoyPart represents a POV hat direction, eg JoyPOV0Left. + */ + bool IsPOV(EJoyPart joyPart); + + /* + * Returns true if the EJoyPart represents a POV hat direction and sets povNum and povDir as follows: + * povNum will be the POV hat number 0-4, + * povDir will be POV_UP, POV_DOWN, POV_LEFT or POV_RIGHT. + */ + bool GetPOVDetails(EJoyPart joyPart, int &povNum, int &povDir); + + /* + * Returns true if the given EJoyPart is a button + */ + bool IsButton(EJoyPart joyPart); + + /* + * Returns the button number (indexed from 0) of the given EJoyPart if it is a button, or -1 otherwise. + */ + int GetButtonNumber(EJoyPart joyPart); + + /* + * Returns the EJoyPart that represents the axis component for the given axis number (AXIS_X, AXIS_Y, AXIS_Z, AXIS_RX, AXIS_RY or AXIS_RZ) and + * direction (AXIS_FULL, AXIS_INVERTED, AXIS_POS or AXIS_POS), or JoyUnknown otherwise. + */ + EJoyPart GetJoyAxis(int axisNum, int axisDir); + + /* + * Returns the EJoyPart that represents the POV hot direction for the given POV number (0-4) and direction (POV_UP, POV_DOWN, + * POV_LEFT or POV_RIGHT), JoyUnknown otherwise. + */ + EJoyPart GetJoyPOV(int povNum, int povDir); + + /* + * Returns the EJoyPart that represents the joystick button with the given number (0-31), or JoyUnknown otherwise. + */ + EJoyPart GetJoyButton(int butNum); + + // + // Abstract methods subclass must implement (ie system-specific code) + // + + virtual bool InitializeSystem() = 0; + + /* + * Returns the number of attached keyboards (or 0 if the system cannot handle keyboards at all or ANY_KEYBOARD if the system cannot + * handle multiple keyboards). + */ + virtual int GetNumKeyboards() = 0; + + /* + * Returns the number of attached mice (or 0 if the system cannot handle mice at all or ANY_MOUSE if the system cannot handle + * multiple mice). + */ + virtual int GetNumMice() = 0; + + /* + * Returns number of attached joysticks (or 0 if the system cannot handle joysticks at all or ANY_JOYSTICK if the system cannot + * handle multiple joysticks). + */ + virtual int GetNumJoysticks() = 0; + + /* + * Returns the system-specific key index that represents the given key name. + */ + virtual int GetKeyIndex(const char *keyName) = 0; + + /* + * Returns the key name of the given system-specific integer key index. + */ + virtual const char *GetKeyName(int keyIndex) = 0; + + /* + * Returns details about the joystick with the given number, or NULL if it does not exist. + */ + virtual JoyDetails *GetJoyDetails(int joyNum) = 0; + + /* + * Returns true if for the given keyboard the key with the system-specific key index is currently pressed. + */ + virtual bool IsKeyPressed(int kbdNum, int keyIndex) = 0; + + /* + * Returns the current axis value for the given mouse and axis number (AXIS_X, AXIS_Y or AXIS_Z). + */ + virtual int GetMouseAxisValue(int mseNum, int axisNum) = 0; + + /* + * Returns the current direction (-1, 0 or 1) the Z-axis (wheel) is moving in for the given mouse. + */ + virtual int GetMouseWheelDir(int mseNum) = 0; + + /* + * Returns true if for the given mouse the button with the given number is currently pressed. + */ + virtual bool IsMouseButPressed(int mseNum, int butNum) = 0; + + /* + * Returns the current axis value for the given joystick and axis number (AXIS_X, AXIS_Y, AXIS_Z, AXIS_RX, AXIS_RY or AXIS_RZ). + */ + virtual int GetJoyAxisValue(int joyNum, int axisNum) = 0; + + /* + * Returns true if for the given joystick the POV-hat controller with the given number is pointing in a particular direction (POV_UP, POV_DOWN, + * POV_LEFT or POV_RIGHT) + */ + virtual bool IsJoyPOVInDir(int joyNum, int povNum, int povDir) = 0; + + /* + * Returns true if for the given joystick the button with the given number is currently pressed. + */ + virtual bool IsJoyButPressed(int joyNum, int butNum) = 0; + + /* + * Waits for the given time in milliseconds + */ + virtual void Wait(int ms) = 0; + + // + // Virtual methods subclass can override if required + // + + /* + * Returns true if the mouse is currently centered in the display. + */ + virtual bool ConfigMouseCentered(); + + /* + * Creates an input source combining all keyboards for the given key index. + */ + virtual CInputSource *CreateAnyKeySource(int keyIndex); + + /* + * Creates an input source combining all mice for the given EMousePart. + */ + virtual CInputSource *CreateAnyMouseSource(EMousePart msePart); + + /* + * Creates an input source combining all joysticks for the given EJoyPart. + */ + virtual CInputSource *CreateAnyJoySource(EJoyPart joyPart); + + /* + * Creates an input source for the given keyboard number and key index. + */ + virtual CInputSource *CreateKeySource(int kbdNum, int keyIndex); + + /* + * Creates an input source for the given mouse number and EMousePart. + */ + virtual CInputSource *CreateMouseSource(int mseNum, EMousePart msePart); + + /* + * Creates an input source for the given joystick number and EJoyPart. + */ + virtual CInputSource *CreateJoySource(int joyNum, EJoyPart joyPart); + +public: + // Name of this input system + const char *name; + + virtual ~CInputSystem(); + + /* + * Initializes the input system. Must be called before any other methods are used. + * Returns false if unable to initialize the system. + */ + bool Initialize(); + + /* + * Sets the current display geometry so that mouse movements can be scaled properly. + */ + void SetDisplayGeom(unsigned dispX, unsigned dispY, unsigned dispW, unsigned dispH); + + /* + * Returns the input source for the given mapping, or NULL if mapping is not valid. + */ + CInputSource* ParseSource(const char *mapping, bool fullAxisOnly = false); + + /* + * Clears all keyboard, mouse and joystick settings. + */ + void ClearSettings(); + + /* + * Prints current keyboard, mouse and joystick settings to stdout. + */ + void PrintSettings(); + + /* + * Reads all keyboard, mouse and joystick settings (and any additional system-specific additional settings) from the given INI file. + */ + virtual void ReadFromINIFile(CINIFile *ini, const char *section); + + /* + * Writes all keyboard, mouse and joystick settings (and any additional system-specific settings) to the given INI file. + */ + virtual void WriteToINIFile(CINIFile *ini, const char *section); + + /* + * Waits for any input from the user and once received copies a mapping configuration representing the input (eg KEY_A or JOY1_AXIS_POS) + * into the given buffer. + * Returns true if input was successfully received or false if the user activated the given escape mapping or closed the window. + * readFlags specifies which types of inputs (keyboards, mice, joysticks) are to be read and whether to merge the inputs to a common + * mapping, eg return MOUSE_XAXIS rather than MOUSE3_XAXIS. + * If fullAxisOnly is true, then only mappings representing a full axis are returned, eg JOY1_XAXIS is allowed but not JOY1_XAXIS_POS. + */ + bool ReadMapping(char *buffer, unsigned bufSize, bool fullAxisOnly, unsigned readFlags = READ_ALL, const char *escapeMapping = "KEY_ESCAPE"); + + /* + * Updates the current state of the input system (called by CInputs.Poll). + */ + virtual bool Poll() = 0; + + /* + * Lets the input system know that inputs are being configured (called by CInputs.ConfigureInputs). + */ + virtual void ConfigStart(); + + /* + * Lets the input system know that inputs are no longer being configured (called by CInputs.ConfigureInputs). + */ + virtual void ConfigEnd(); + + /* + * Sets the mouse visibility (some systems may choose to ignore this). + */ + virtual void SetMouseVisibility(bool visible) = 0; + + // + // Nested Classes + // + + /* + * Input source for a key on a keyboard. + */ + class CKeyInputSource : public CInputSource + { + private: + CInputSystem *m_system; // Parent input system + int m_kbdNum; // Keyboard number + int m_keyIndex; // Key index + int m_incr; // Key increment for analog values + int m_decr; // Key decrement for analog values + int m_val; // Current analog key value + int m_maxVal; // Maximum analog key value + + public: + CKeyInputSource(CInputSystem *system, int kbdNum, int keyIndex, unsigned sensitivity, unsigned decaySpeed); + + bool GetValueAsSwitch(bool &val); + + bool GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal); + }; + + /* + * Input source for the X- or Y-axis of a mouse. + */ + class CMseAxisInputSource : public CInputSource + { + private: + CInputSystem *m_system; // Parent input system + int m_mseNum; // Mouse number + int m_axisNum; // Axis number (0 = XAxis, 1 = YAxis, 2 = ZAxis) + int m_axisDir; // Axis direction (AXIS_FULL, AXIS_INVERTED, AXIS_POSITIVE or AXIS_NEGATIVE) + int m_deadPixels; // Size in pixels of dead zone in centre of axis + + /* + * Scales the mouse axis value to the given range. + */ + int ScaleAxisValue(int minVal, int offVal, int maxVal); + + public: + CMseAxisInputSource(CInputSystem *system, int mseNum, int axisNum, int axisDir, unsigned deadZone); + + bool GetValueAsSwitch(bool &val); + + bool GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal); + }; + + /* + * Input source for the button of a mouse. + */ + class CMseButInputSource : public CInputSource + { + private: + CInputSystem *m_system; // Parent input system + int m_mseNum; // Mouse number + int m_butNum; // Button number + + public: + CMseButInputSource(CInputSystem *system, int mseNum, int butNum); + + bool GetValueAsSwitch(bool &val); + + bool GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal); + }; + + /* + * Input source for the axis of a joystick. + */ + class CJoyAxisInputSource : public CInputSource + { + private: + CInputSystem *m_system; // Parent input system + int m_joyNum; // Joystick number + int m_axisNum; // Axis number (0 = XAxis, 1 = YAxis, 2 = ZAxis, 3 = RXAxis, 4 = RYAxis, 5 = RZAxis) + int m_axisDir; // Axis direction (AXIS_FULL, AXIS_INVERTED, AXIS_POSITIVE or AXIS_NEGATIVE) + int m_posDZone; // Dead zone for positive range + int m_negDZone; // Dead zone for negative range + int m_posSat; // Saturation for positive range + int m_negSat; // Saturation for negative range + + /* + * Scales the joystick axis value to the given range. + */ + int ScaleAxisValue(int minVal, int offVal, int maxVal); + + public: + CJoyAxisInputSource(CInputSystem *system, int joyNum, int axisNum, int axisDir, unsigned deadZone, unsigned saturation); + + bool GetValueAsSwitch(bool &val); + + bool GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal); + }; + + /* + * Input source for a particular direction of a POV hat controller of a joystick. + */ + class CJoyPOVInputSource : public CInputSource + { + private: + CInputSystem *m_system; // Parent input system + int m_joyNum; // Joystick number + int m_povNum; // POV hat number + int m_povDir; // POV hat direction (POV_UP, POV_LEFT, POV_RIGHT, POV_DOWN) + + public: + CJoyPOVInputSource(CInputSystem *system, int joyNum, int povNum, int povDir); + + bool GetValueAsSwitch(bool &val); + + bool GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal); + }; + + /* + * Input source for the button of a joystick. + */ + class CJoyButInputSource : public CInputSource + { + private: + CInputSystem *m_system; // Parent input system + int m_joyNum; // Joystick number + int m_butNum; // Button number + + public: + CJoyButInputSource(CInputSystem *system, int joyNum, int butNum); + + bool GetValueAsSwitch(bool &val); + + bool GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal); + }; +}; + +#endif // INCLUDED_INPUTSYSTEM_H diff --git a/Inputs/InputTypes.cpp b/Inputs/InputTypes.cpp new file mode 100644 index 0000000..bd4da48 --- /dev/null +++ b/Inputs/InputTypes.cpp @@ -0,0 +1,148 @@ +#include "Supermodel.h" + +// All the input subclasses have been grouped together here as they are very simple classes + +/* + * CSwitchInput + */ +CSwitchInput::CSwitchInput(const char *inputId, const char *inputLabel, unsigned inputGameFlags, const char *defaultMapping, UINT16 offVal, UINT16 onVal) : + CInput(inputId, inputLabel, INPUT_FLAGS_SWITCH, inputGameFlags, defaultMapping), m_offVal(offVal), m_onVal(onVal) +{ + // +} + +void CSwitchInput::Poll() +{ + prevValue = value; + + bool boolValue = !!value; + if (m_source != NULL && m_source->GetValueAsSwitch(boolValue)) + value = (boolValue ? m_onVal : m_offVal); + else + value = m_offVal; +} + +bool CSwitchInput::Pressed() +{ + return prevValue == m_offVal && value == m_onVal; +} + +bool CSwitchInput::Released() +{ + return prevValue == m_onVal && value == m_offVal; +} + +/* + * CAnalogInput + */ +CAnalogInput::CAnalogInput(const char *inputId, const char *inputLabel, unsigned inputGameFlags, const char *defaultMapping, UINT16 minVal, UINT16 maxVal) : + CInput(inputId, inputLabel, INPUT_FLAGS_ANALOG, inputGameFlags, defaultMapping, minVal), m_minVal(minVal), m_maxVal(maxVal) +{ + // +} + +void CAnalogInput::Poll() +{ + prevValue = value; + + if (m_source == NULL) + { + value = m_minVal; + return; + } + int intValue = value; + if (m_source->GetValueAsAnalog(intValue, m_minVal, m_minVal, m_maxVal)) + value = intValue; + else + value = m_minVal; +} + +bool CAnalogInput::HasValue() +{ + return value > m_minVal; +} + +double CAnalogInput::ValueAsFraction() +{ + double frac = (double)(value - m_minVal)/(double)(m_maxVal - m_minVal); + return (frac >= 0.0 ? frac : -frac); +} + +/* + * CAxisInput + */ +CAxisInput::CAxisInput(const char *inputId, const char *inputLabel, unsigned inputGameFlags, const char *defaultMapping, + CAnalogInput *negInput, CAnalogInput *posInput, UINT16 minVal, UINT16 offVal, UINT16 maxVal) : + CInput(inputId, inputLabel, INPUT_FLAGS_AXIS, inputGameFlags, defaultMapping, offVal), m_negInput(negInput), m_posInput(posInput), + m_minVal(minVal), m_offVal(offVal), m_maxVal(maxVal) +{ + // +} + +void CAxisInput::Poll() +{ + prevValue = value; + + // Try getting value from analog inputs that represent negative and positive range of the axis first and then try the default input source + int intValue = value; + if ((m_negInput != NULL && m_negInput->HasValue()) || (m_posInput != NULL && m_posInput->HasValue())) + { + if (m_maxVal > m_minVal) + { + value = m_offVal; + if (m_posInput != NULL) value += (int)(m_posInput->ValueAsFraction() * (double)(m_maxVal - m_offVal)); + if (m_negInput != NULL) value -= (int)(m_negInput->ValueAsFraction() * (double)(m_offVal - m_minVal)); + } + else + { + value = m_offVal; + if (m_posInput != NULL) value += (int)(m_posInput->ValueAsFraction() * (double)(m_offVal - m_maxVal)); + if (m_negInput != NULL) value -= (int)(m_negInput->ValueAsFraction() * (double)(m_minVal - m_offVal)); + } + } + else if (m_source != NULL && m_source->GetValueAsAnalog(intValue, m_minVal, m_offVal, m_maxVal)) + value = intValue; + else + value = m_offVal; +} + +bool CAxisInput::HasValue() +{ + return value != m_offVal; +} + +double CAxisInput::ValueAsFraction() +{ + double frac = (double)(value - m_minVal)/(double)(m_maxVal - m_minVal); + return (frac >= 0.0 ? frac : -frac); +} + +/* + * CGearShift4Input + */ +CGearShift4Input::CGearShift4Input(const char *inputId, const char *inputLabel, unsigned inputGameFlags, + CSwitchInput *shift1Input, CSwitchInput *shift2Input, CSwitchInput *shift3Input, CSwitchInput *shift4Input, + CSwitchInput *shiftUpInput, CSwitchInput *shiftDownInput) : + CInput(inputId, inputLabel, INPUT_FLAGS_VIRTUAL, inputGameFlags), + m_shift1Input(shift1Input), m_shift2Input(shift2Input), m_shift3Input(shift3Input), m_shift4Input(shift4Input), + m_shiftUpInput(shiftUpInput), m_shiftDownInput(shiftDownInput) +{ + // +} + +void CGearShift4Input::Poll() +{ + prevValue = value; + + // Neutral is when all gear buttons are released so shifting here is implemented as follows: + // Gears (values 1-4) are set by pressing a button (lower gears have priority) and "stick" until a shift to another gear or until the + // button is pressed again, at which point neutral (value 0) is assumed. + if (m_shift1Input->Pressed()) value = (value == 1 ? 0 : 1); + else if (m_shift2Input->Pressed()) value = (value == 2 ? 0 : 2); + else if (m_shift3Input->Pressed()) value = (value == 3 ? 0 : 3); + else if (m_shift4Input->Pressed()) value = (value == 4 ? 0 : 4); + + // Also the shift up/down controls can increase/decrease the gears too + if (m_shiftUpInput->Pressed()) value = CInputSource::Clamp(value + 1, 0, 4); + else if (m_shiftDownInput->Pressed()) value = CInputSource::Clamp(value - 1, 0, 4); +} diff --git a/Inputs/InputTypes.h b/Inputs/InputTypes.h new file mode 100644 index 0000000..27a404b --- /dev/null +++ b/Inputs/InputTypes.h @@ -0,0 +1,135 @@ +#ifndef INCLUDED_INPUTTYPES_H +#define INCLUDED_INPUTTYPES_H + +#include "Types.h" +#include "Input.h" + +// All the input subclasses have been grouped together here as they are very simple classes + +/* + * Represents a switch input (such as a button or 8-way joystick switch) whose value can be either on (usually 1) or off (usually 0). + */ +class CSwitchInput : public CInput +{ +private: + // On and off values + UINT16 m_offVal; + UINT16 m_onVal; + +public: + CSwitchInput(const char *inputId, const char *inputLabel, unsigned inputGameFlags, const char *defaultMapping, + UINT16 offVal = 0x00, UINT16 onVal = 0x01); + + /* + * Polls (updates) the input, updating its value from the input source + */ + void Poll(); + + /* + * Returns true if the input was pressed during last update (ie currently on but previously off) + */ + bool Pressed(); + + /* + * Returns true if the input was released duing last update (ie currently off but previously on) + */ + bool Released(); +}; + +/* + * Represents an analog input (such as a pedal) whose value ranges from a minimum 'off' value (usually 0) to a maximum 'on' value (usually 0xFF). + */ +class CAnalogInput : public CInput +{ +private: + // Min and max values + UINT16 m_minVal; + UINT16 m_maxVal; + +public: + CAnalogInput(const char *inputId, const char *inputLabel, unsigned inputGameFlags, const char *defaultMapping, + UINT16 minVal = 0x00, UINT16 maxVal = 0xFF); + + /* + * Polls (updates) the input, updating its value from the input source + */ + void Poll(); + + /* + * Returns true if the input is currently activated + */ + bool HasValue(); + + /* + * Returns current value as a fraction 0.0 to 1.0 of the full range + */ + double ValueAsFraction(); +}; + +/* + * Represents an axis input (such as a joystick axis, lightgun axis or steering wheel) whose value ranges from a minimum value (usually 0) to a maximum + * value (usually 0xFF) with an off value (usually 0x80) somewhere in-between. + * As well as having its own input source it takes two analog inputs that can represent the negative and positive ranges of the axis. + */ +class CAxisInput : public CInput +{ +private: + // Analog inputs that represent the negative and positive range of the axis + CAnalogInput *m_negInput; + CAnalogInput *m_posInput; + + // Min, off and max values + UINT16 m_minVal; + UINT16 m_offVal; + UINT16 m_maxVal; + +public: + CAxisInput(const char *inputId, const char *inputLabel, unsigned inputGameFlags, const char *defaultMapping, CAnalogInput *negInput, CAnalogInput *posInput, + UINT16 minVal = 0x00, UINT16 offVal = 0x80, UINT16 maxVal = 0xFF); + + /* + * Polls (updates) the input, updating its value from the switch inputs and/or input source + */ + void Poll(); + + /* + * Returns true if the input is currently activated (ie axis is not centered) + */ + bool HasValue(); + + /* + * Returns current value as a fraction -1.0 to 1.0 + */ + double ValueAsFraction(); +}; + +/* + * Represents a 4-gear shift input whose value ranges from 0 to 4, where neutral is 0 and 1-4 represents a gear selection. + * It takes six switch inputs that combine together to control the gear shifting. The first four inputs can set the gear + * directly, while the last two allow shifting up or down through the gears. + */ +class CGearShift4Input : public CInput +{ +private: + // Four switch inputs for gears 1-4 + CSwitchInput *m_shift1Input; + CSwitchInput *m_shift2Input; + CSwitchInput *m_shift3Input; + CSwitchInput *m_shift4Input; + + // Two switch inputs for up/down gear + CSwitchInput *m_shiftUpInput; + CSwitchInput *m_shiftDownInput; + +public: + CGearShift4Input(const char *inputId, const char *inputLabel, unsigned inputGameFlags, + CSwitchInput *shift1Input, CSwitchInput *shift2Input, CSwitchInput *shift3Input, CSwitchInput *shift4Input, + CSwitchInput *shiftUpInput, CSwitchInput *shiftDownInput); + + /* + * Polls (updates) the input, updating its value from the switch inputs + */ + void Poll(); +}; + +#endif // INCLUDED_INPUTTYPES_H \ No newline at end of file diff --git a/Inputs/Inputs.cpp b/Inputs/Inputs.cpp new file mode 100644 index 0000000..e8495b8 --- /dev/null +++ b/Inputs/Inputs.cpp @@ -0,0 +1,535 @@ +#include "Supermodel.h" + +#include +#include +#include +#include +using namespace std; + +#define UI_INPUT 0 + +CInputs::CInputs(CInputSystem *system) : m_system(system) +{ + // UI Controls + uiExit = AddSwitchInput("UIExit", "Exit UI", UI_INPUT, "KEY_ESCAPE"); + uiReset = AddSwitchInput("UIReset", "Reset", UI_INPUT, "KEY_ALT+KEY_R"); + uiPause = AddSwitchInput("UIPause", "Pause", UI_INPUT, "KEY_PAUSE"); + uiSaveState = AddSwitchInput("UISaveState", "Save State", UI_INPUT, "KEY_F5"); + uiChangeSlot = AddSwitchInput("UIChangeSlot", "Change Save Slot", UI_INPUT, "KEY_F6"); + uiLoadState = AddSwitchInput("UILoadState", "Load State", UI_INPUT, "KEY_F7"); + uiDumpInpState = AddSwitchInput("UIDumpInputState", "Dump Input State", UI_INPUT, "KEY_F8"); + uiClearNVRAM = AddSwitchInput("UIClearNVRAM", "Clear NVRAM", UI_INPUT, "KEY_ALT+KEY_N"); + uiToggleCursor = AddSwitchInput("UIToggleCursor", "Toggle Cursor", UI_INPUT, "KEY_ALT+KEY_I"); + uiToggleFrLimit = AddSwitchInput("UIToggleFrameLimit", "Toggle Frame Limiting", UI_INPUT, "KEY_ALT+KEY_T"); + + // Common Controls + start[0] = AddSwitchInput("Start1", "P1 Start", GAME_INPUT_COMMON, "KEY_1,JOY1_BUTTON9"); + start[1] = AddSwitchInput("Start2", "P2 Start", GAME_INPUT_COMMON, "KEY_2,JOY2_BUTTON9"); + coin[0] = AddSwitchInput("Coin1", "P1 Coin", GAME_INPUT_COMMON, "KEY_3,JOY1_BUTTON10"); + coin[1] = AddSwitchInput("Coin2", "P2 Coin", GAME_INPUT_COMMON, "KEY_4,JOY2_BUTTON10"); + service[0] = AddSwitchInput("ServiceA", "Service A", GAME_INPUT_COMMON, "KEY_5"); + service[1] = AddSwitchInput("ServiceB", "Service B", GAME_INPUT_COMMON, "KEY_7"); + test[0] = AddSwitchInput("TestA", "Test A", GAME_INPUT_COMMON, "KEY_6"); + test[1] = AddSwitchInput("TestB", "Test B", GAME_INPUT_COMMON, "KEY_8"); + + // 8-Way Joysticks + up[0] = AddSwitchInput("JoyUp", "P1 Joystick Up", GAME_INPUT_JOYSTICK1, "KEY_UP,JOY1_UP"); + down[0] = AddSwitchInput("JoyDown", "P1 Joystick Down", GAME_INPUT_JOYSTICK1, "KEY_DOWN,JOY1_DOWN"); + left[0] = AddSwitchInput("JoyLeft", "P1 Joystick Left", GAME_INPUT_JOYSTICK1, "KEY_LEFT,JOY1_LEFT"); + right[0] = AddSwitchInput("JoyRight", "P1 Joystick Right", GAME_INPUT_JOYSTICK1, "KEY_RIGHT,JOY1_RIGHT"); + up[1] = AddSwitchInput("JoyUp2", "P2 Joystick Up", GAME_INPUT_JOYSTICK2, "JOY2_UP"); + down[1] = AddSwitchInput("JoyDown2", "P2 Joystick Down", GAME_INPUT_JOYSTICK2, "JOY2_DOWN"); + left[1] = AddSwitchInput("JoyLeft2", "P2 Joystick Left", GAME_INPUT_JOYSTICK2, "JOY2_LEFT"); + right[1] = AddSwitchInput("JoyRight2", "P2 Joystick Right", GAME_INPUT_JOYSTICK2, "JOY2_RIGHT"); + + // Fighting Game Buttons + punch[0] = AddSwitchInput("Punch", "P1 Punch", GAME_INPUT_FIGHTING, "KEY_A,JOY1_BUTTON1"); + kick[0] = AddSwitchInput("Kick", "P1 Kick", GAME_INPUT_FIGHTING, "KEY_S,JOY1_BUTTON2"); + guard[0] = AddSwitchInput("Guard", "P1 Guard", GAME_INPUT_FIGHTING, "KEY_D,JOY1_BUTTON3"); + escape[0] = AddSwitchInput("Escape", "P1 Escape", GAME_INPUT_FIGHTING, "KEY_F,JOY1_BUTTON4"); + punch[1] = AddSwitchInput("Punch2", "P2 Punch", GAME_INPUT_FIGHTING, "JOY2_BUTTON1"); + kick[1] = AddSwitchInput("Kick2", "P2 Kick", GAME_INPUT_FIGHTING, "JOY2_BUTTON2"); + guard[1] = AddSwitchInput("Guard2", "P2 Guard", GAME_INPUT_FIGHTING, "JOY2_BUTTON3"); + escape[1] = AddSwitchInput("Escape2", "P2 Escape", GAME_INPUT_FIGHTING, "JOY2_BUTTON4"); + + // Virtua Striker Buttons + shortPass[0] = AddSwitchInput("ShortPass", "P1 Short Pass", GAME_INPUT_SOCCER, "KEY_A,JOY1_BUTTON1"); + longPass[0] = AddSwitchInput("LongPass", "P1 Long Pass", GAME_INPUT_SOCCER, "KEY_S,JOY1_BUTTON2"); + shoot[0] = AddSwitchInput("Shoot", "P1 Shoot", GAME_INPUT_SOCCER, "KEY_D,JOY1_BUTTON3"); + shortPass[1] = AddSwitchInput("ShortPass1", "P2 Short Pass", GAME_INPUT_SOCCER, "JOY2_BUTTON1"); + longPass[1] = AddSwitchInput("LongPass1", "P2 Long Pass", GAME_INPUT_SOCCER, "JOY2_BUTTON2"); + shoot[1] = AddSwitchInput("Shoot1", "P2 Shoot", GAME_INPUT_SOCCER, "JOY2_BUTTON3"); + + // Racing Game Steering Controls + CAnalogInput* steeringLeft = AddAnalogInput("SteeringLeft", "Steer Left", GAME_INPUT_VEHICLE, "KEY_LEFT"); + CAnalogInput* steeringRight = AddAnalogInput("SteeringRight", "Steer Right", GAME_INPUT_VEHICLE, "KEY_RIGHT"); + + steering = AddAxisInput ("Steering", "Full Steering", GAME_INPUT_VEHICLE, "JOY1_XAXIS", steeringLeft, steeringRight); + accelerator = AddAnalogInput("Accelerator", "Accelerator Pedal", GAME_INPUT_VEHICLE, "KEY_UP,JOY1_UP"); + brake = AddAnalogInput("Brake", "Brake Pedal", GAME_INPUT_VEHICLE, "KEY_DOWN,JOY1_DOWN"); + + // Racing Game Gear Shift + CSwitchInput *shift1 = AddSwitchInput("GearShift1", "Shift 1/Up", GAME_INPUT_SHIFT4, "KEY_Q,JOY1_BUTTON5"); + CSwitchInput *shift2 = AddSwitchInput("GearShift2", "Shift 2/Down", GAME_INPUT_SHIFT4, "KEY_W,JOY1_BUTTON6"); + CSwitchInput *shift3 = AddSwitchInput("GearShift3", "Shift 3", GAME_INPUT_SHIFT4, "KEY_E,JOY1_BUTTON7"); + CSwitchInput *shift4 = AddSwitchInput("GearShift4", "Shift 4", GAME_INPUT_SHIFT4, "KEY_R,JOY1_BUTTON8"); + CSwitchInput *shiftUp = AddSwitchInput("GearShiftUp", "Shift Up", GAME_INPUT_SHIFT4, "NONE"); + CSwitchInput *shiftDown = AddSwitchInput("GearShiftDown", "Shift Down", GAME_INPUT_SHIFT4, "NONE"); + + gearShift4 = AddGearShift4Input("GearShift", "Gear Shift", GAME_INPUT_SHIFT4, shift1, shift2, shift3, shift4, shiftUp, shiftDown); + + // Racing Game VR View Buttons + vr[0] = AddSwitchInput("VR1", "VR1", GAME_INPUT_VR, "KEY_A,JOY1_BUTTON1"); + vr[1] = AddSwitchInput("VR2", "VR2", GAME_INPUT_VR, "KEY_S,JOY1_BUTTON2"); + vr[2] = AddSwitchInput("VR3", "VR3", GAME_INPUT_VR, "KEY_D,JOY1_BUTTON3"); + vr[3] = AddSwitchInput("VR4", "VR4", GAME_INPUT_VR, "KEY_F,JOY1_BUTTON4"); + + // Sega Rally Buttons + viewChange = AddSwitchInput("ViewChange", "View Change", GAME_INPUT_RALLY, "KEY_A,JOY1_BUTTON1"); + handBrake = AddSwitchInput("HandBrake", "Hand Brake", GAME_INPUT_RALLY, "KEY_S,JOY1_BUTTON2"); + + // Virtua On Controls + twinJoyTurnLeft = AddSwitchInput("TwinJoyTurnLeft", "Turn Left", GAME_INPUT_TWIN_JOYSTICKS, "KEY_Q,JOY1_RZAXIS_POS"); + twinJoyTurnRight = AddSwitchInput("TwinJoyTurnRight", "Turn Right", GAME_INPUT_TWIN_JOYSTICKS, "KEY_W,JOY1_RZAXIS_NEG"); + twinJoyForward = AddSwitchInput("TwinJoyForward", "Forward", GAME_INPUT_TWIN_JOYSTICKS, "KEY_UP,JOY1_UP"); + twinJoyReverse = AddSwitchInput("TwinJoyReverse", "Reverse", GAME_INPUT_TWIN_JOYSTICKS, "KEY_DOWN,JOY1_DOWN"); + twinJoyStrafeLeft = AddSwitchInput("TwinJoyStrafeLeft", "Strafe Left", GAME_INPUT_TWIN_JOYSTICKS, "KEY_LEFT,JOY1_LEFT"); + twinJoyStrafeRight = AddSwitchInput("TwinJoyStrafeRight", "Strafe Right", GAME_INPUT_TWIN_JOYSTICKS, "KEY_RIGHT,JOY1_RIGHT"); + twinJoyJump = AddSwitchInput("TwinJoyJump", "Jump", GAME_INPUT_TWIN_JOYSTICKS, "KEY_E,JOY1_BUTTON1"); + twinJoyCrouch = AddSwitchInput("TwinJoyCrouch", "Crouch", GAME_INPUT_TWIN_JOYSTICKS, "KEY_R,JOY1_BUTTON2"); + twinJoyLeftShot = AddSwitchInput("TwinJoyLeftShot", "Left Shot Trigger", GAME_INPUT_TWIN_JOYSTICKS, "KEY_A,JOY1_BUTTON5"); + twinJoyRightShot = AddSwitchInput("TwinJoyRightShot", "Right Shot Trigger", GAME_INPUT_TWIN_JOYSTICKS, "KEY_S,JOY1_BUTTON6"); + twinJoyLeftTurbo = AddSwitchInput("TwinJoyLeftTurbo", "Left Turbo", GAME_INPUT_TWIN_JOYSTICKS, "KEY_Z,JOY1_BUTTON7"); + twinJoyRightTurbo = AddSwitchInput("TwinJoyRightTurbo", "Right Turbo", GAME_INPUT_TWIN_JOYSTICKS, "KEY_X,JOY1_BUTTON8"); + + // Analog Joystick + CAnalogInput *analogJoyLeft = AddAnalogInput("AnalogJoyLeft", "Analog Left", GAME_INPUT_ANALOG_JOYSTICK, "KEY_LEFT"); + CAnalogInput *analogJoyRight = AddAnalogInput("AnalogJoyRight", "Analog Right", GAME_INPUT_ANALOG_JOYSTICK, "KEY_RIGHT"); + CAnalogInput *analogJoyUp = AddAnalogInput("AnalogJoyUp", "Analog Up", GAME_INPUT_ANALOG_JOYSTICK, "KEY_UP"); + CAnalogInput *analogJoyDown = AddAnalogInput("AnalogJoyDown", "Analog Down", GAME_INPUT_ANALOG_JOYSTICK, "KEY_DOWN"); + + analogJoyX = AddAxisInput ("AnalogJoyX", "Analog X-Axis", GAME_INPUT_ANALOG_JOYSTICK, "JOY_XAXIS,MOUSE_XAXIS", analogJoyLeft, analogJoyRight); + analogJoyY = AddAxisInput ("AnalogJoyY", "Analog Y-Axis", GAME_INPUT_ANALOG_JOYSTICK, "JOY_YAXIS,MOUSE_YAXIS", analogJoyUp, analogJoyDown); + analogJoyTrigger = AddSwitchInput("AnalogJoyTrigger", "Trigger Button", GAME_INPUT_ANALOG_JOYSTICK, "KEY_A,JOY_BUTTON1,MOUSE_LEFT_BUTTON"); + analogJoyEvent = AddSwitchInput("AnalogJoyEvent", "Event Button", GAME_INPUT_ANALOG_JOYSTICK, "KEY_S,JOY_BUTTON2,MOUSE_RIGHT_BUTTON"); + + // Lightguns + CAnalogInput *gun1Left = AddAnalogInput("GunLeft", "P1 Gun Left", GAME_INPUT_GUN1, "KEY_LEFT"); + CAnalogInput *gun1Right = AddAnalogInput("GunRight", "P1 Gun Right", GAME_INPUT_GUN1, "KEY_RIGHT"); + CAnalogInput *gun1Up = AddAnalogInput("GunUp", "P1 Gun Up", GAME_INPUT_GUN1, "KEY_UP"); + CAnalogInput *gun1Down = AddAnalogInput("GunDown", "P1 Gun Down", GAME_INPUT_GUN1, "KEY_DOWN"); + + gunX[0] = AddAxisInput ("GunX", "P1 Gun X-Axis", GAME_INPUT_GUN1, "JOY1_XAXIS,MOUSE_XAXIS", gun1Left, gun1Right, 150, 400, 651); // normalize to [150,651] + gunY[0] = AddAxisInput ("GunY", "P1 Gun Y-Axis", GAME_INPUT_GUN1, "JOY1_YAXIS,MOUSE_YAXIS", gun1Up, gun1Down, 80, 272, 465); // normalize to [80,465] + trigger[0] = AddSwitchInput("Trigger", "P1 Trigger", GAME_INPUT_GUN1, "KEY_A,JOY1_BUTTON1,MOUSE_LEFT_BUTTON"); + offscreen[0] = AddSwitchInput("Offscreen", "P1 Point Off-screen", GAME_INPUT_GUN1, "KEY_S,JOY1_BUTTON2,MOUSE_RIGHT_BUTTON"); + + CAnalogInput *gun2Left = AddAnalogInput("GunLeft2", "P2 Gun Left", GAME_INPUT_GUN2, "NONE"); + CAnalogInput *gun2Right = AddAnalogInput("GunRight2", "P2 Gun Right", GAME_INPUT_GUN2, "NONE"); + CAnalogInput *gun2Up = AddAnalogInput("GunUp2", "P2 Gun Up", GAME_INPUT_GUN2, "NONE"); + CAnalogInput *gun2Down = AddAnalogInput("GunDown2", "P2 Gun Down", GAME_INPUT_GUN2, "NONE"); + + gunX[1] = AddAxisInput ("GunX2", "P2 Gun X-Axis", GAME_INPUT_GUN2, "JOY2_XAXIS", gun2Left, gun2Right, 150, 400, 651); // normalize to [150,651] + gunY[1] = AddAxisInput ("GunY2", "P2 Gun Y-Axis", GAME_INPUT_GUN2, "JOY2_YAXIS", gun2Up, gun2Down, 80, 272, 465); // normalize to [80,465] + trigger[1] = AddSwitchInput("Trigger2", "P2 Trigger", GAME_INPUT_GUN2, "JOY2_BUTTON1"); + offscreen[1] = AddSwitchInput("Offscreen2", "P2 Point Off-screen", GAME_INPUT_GUN2, "JOY2_BUTTON2"); +} + +CInputs::~CInputs() +{ + for (vector::iterator it = m_inputs.begin(); it < m_inputs.end(); it++) + delete *it; +} + +CSwitchInput* CInputs::AddSwitchInput(const char *id, const char *label, unsigned gameFlags, const char *defaultMapping, + UINT16 offVal, UINT16 onVal) +{ + CSwitchInput *input = new CSwitchInput(id, label, gameFlags, defaultMapping, offVal, onVal); + m_inputs.push_back(input); + return input; +} + +CAnalogInput* CInputs::AddAnalogInput(const char *id, const char *label, unsigned gameFlags, const char *defaultMapping, + UINT16 minVal, UINT16 maxVal) +{ + CAnalogInput *input = new CAnalogInput(id, label, gameFlags, defaultMapping, minVal, maxVal); + m_inputs.push_back(input); + return input; +} + +CAxisInput* CInputs::AddAxisInput(const char *id, const char *label, unsigned gameFlags, const char *defaultMapping, + CAnalogInput* axisNeg, CAnalogInput* axisPos, UINT16 minVal, UINT16 offVal, UINT16 maxVal) +{ + CAxisInput *input = new CAxisInput(id, label, gameFlags, defaultMapping, axisNeg, axisPos, minVal, offVal, maxVal); + m_inputs.push_back(input); + return input; +} + +CGearShift4Input* CInputs::AddGearShift4Input(const char *id, const char *label, unsigned gameFlags, + CSwitchInput *shift1, CSwitchInput *shift2, CSwitchInput *shift3, CSwitchInput *shift4, CSwitchInput *shiftUp, CSwitchInput *shiftDown) +{ + CGearShift4Input *input = new CGearShift4Input(id, label, gameFlags, shift1, shift2, shift3, shift4, shiftUp, shiftDown); + m_inputs.push_back(input); + return input; +} + +void CInputs::PrintHeader(const char *fmt, ...) +{ + char header[1024]; + va_list vl; + va_start(vl, fmt); + vsprintf(header, fmt, vl); + va_end(vl); + + puts(header); + for (size_t i = 0; i < strlen(header); i++) + putchar('-'); + printf("\n\n"); +} + +void CInputs::PrintConfigureInputsHelp() +{ + puts("For each control, use the following keys to map the inputs:"); + puts(""); + puts(" Return Set current input mapping and move to next control,"); + puts(" c Clear current input mapping and remain there,"); + puts(" s Set the current input mapping and remain there,"); + puts(" a Append to current input mapping (for multiple assignments)"); + puts(" and remain there,"); + puts(" r Reset current input mapping to default and remain there,"); + puts(" Down Move onto next control,"); + puts(" Up Go back to previous control,"); + puts(" h Display this help again,"); + puts(" q Finish and save all changes,"); + puts(" Esc Finish without saving any changes."); + puts(""); + puts("To assign inputs, simply press the appropriate key, mouse button or"); + puts("joystick button or move the mouse along an axis or move a joystick's"); + puts("axis or POV hat controller."); + puts(""); + puts("NOTES:"); + puts(" - in order to assign a key the configuration window must on top,"); + puts(" - in order to assign a mouse button the mouse must be clicked"); + puts(" within the window,"); + puts(" - in order to assign a mouse axis, the cursor must be placed in"); + puts(" the center of the window and moved in the corresponding"); + puts(" direction to the window's edge and then returned to the center."); + puts(""); +} + +CInputSystem *CInputs::GetInputSystem() +{ + return m_system; +} + +bool CInputs::Initialize() +{ + // Make sure the input system is initialized too + if (!m_system->Initialize()) + return false; + + // Initialize all the inputs + for (vector::iterator it = m_inputs.begin(); it < m_inputs.end(); it++) + (*it)->Initialize(m_system); + return true; +} + +bool CInputs::InputIsConfigurable(CInput *input) +{ + // All inputs except UI and virtual ones can be configured by the user + return input->flags != UI_INPUT && !(input->flags & INPUT_FLAGS_VIRTUAL); +} + +CInput* CInputs::LookupInputByID(const char* id) +{ + for (vector::iterator it = m_inputs.begin(); it < m_inputs.end(); it++) + { + if (stricmp(id, (*it)->id) == 0) + return *it; + } + return NULL; +} + +void CInputs::ReadFromINIFile(CINIFile *ini, const char *section) +{ + for (vector::iterator it = m_inputs.begin(); it < m_inputs.end(); it++) + { + if (!InputIsConfigurable(*it)) + continue; + + string key("Input"); + key.append((*it)->id); + string mapping; + if (ini->Get(section, key, mapping) == OKAY) + (*it)->SetMapping(mapping.c_str()); + } +} + +void CInputs::WriteToINIFile(CINIFile *ini, const char *section) +{ + for (vector::iterator it = m_inputs.begin(); it < m_inputs.end(); it++) + { + if (!InputIsConfigurable(*it)) + continue; + + string key("Input"); + key.append((*it)->id); + ini->Set(section, key, (*it)->GetMapping()); + } +} + +bool CInputs::ConfigureInputs(const GameInfo *game, unsigned dispX, unsigned dispY, unsigned dispW, unsigned dispH) +{ + m_system->ConfigStart(); + + // Let the input system know the display geometry + m_system->SetDisplayGeom(dispX, dispY, dispW, dispH); + + // Print header and help message + int gameFlags; + if (game != NULL) + { + PrintHeader("Configure Inputs for %s", game->title); + gameFlags = game->inputFlags; + } + else + { + PrintHeader("Configure Inputs"); + gameFlags = GAME_INPUT_ALL; + } + PrintConfigureInputsHelp(); + + // Get all inputs to be configured + vector toConfigure; + vector::iterator it; + for (it = m_inputs.begin(); it < m_inputs.end(); it++) + { + if (InputIsConfigurable(*it) && ((*it)->gameFlags & gameFlags)) + toConfigure.push_back(*it); + } + + // Remember current mappings for each input in case changes need to be undone later + vector oldMappings(toConfigure.size()); + size_t index = 0; + for (it = toConfigure.begin(); it < toConfigure.end(); it++) + oldMappings[index++] = (*it)->GetMapping(); + + const char *groupLabel = NULL; + + // Loop through all the inputs to be configured + index = 0; + while (index < toConfigure.size()) + { + // Get the current input + CInput* input = toConfigure[index]; + + // If have moved to a new input group, print the group heading + const char *itGroupLabel = input->GetInputGroup(); + if (groupLabel == NULL || stricmp(groupLabel, itGroupLabel) != 0) + { + groupLabel = itGroupLabel; + printf("%s:\n", groupLabel); + } + +Redisplay: + // Print the input label, current input mapping and available options + if (index > 0) + printf(" %s [%s]: Ret/c/s/a/r/Up/Down/h/q/Esc? ", input->label, input->GetMapping()); + else + printf(" %s [%s]: Ret/c/s/a/r/Down/h/q/Esc? ", input->label, input->GetMapping()); + fflush(stdout); // required on terminals that use buffering + + // Loop until user has selected a valid option + bool done = false; + char mapping[50]; + while (!done) + { + // Wait for input from user + if (!m_system->ReadMapping(mapping, 50, false, READ_KEYBOARD|READ_MERGE, uiExit->GetMapping())) + { + // If user pressed aborted input, then undo all changes and finish configuration + index = 0; + for (it = toConfigure.begin(); it < toConfigure.end(); it++) + { + (*it)->SetMapping(oldMappings[index].c_str()); + index++; + } + puts(""); + + m_system->ConfigEnd(); + return false; + } + + if (stricmp(mapping, "KEY_RETURN") == 0 || stricmp(mapping, "KEY_S") == 0) + { + // Set the input mapping + printf("Setting..."); + fflush(stdout); // required on terminals that use buffering + if (input->Configure(false, uiExit->GetMapping())) + { + printf(" %s\n", input->GetMapping()); + if (stricmp(mapping, "KEY_RETURN") == 0) + index++; + done = true; + } + else + { + printf(" [Cancelled]\n"); + goto Redisplay; + } + } + else if (stricmp(mapping, "KEY_A") == 0) + { + // Append to the input mapping(s) + printf("Appending..."); + fflush(stdout); // required on terminals that use buffering + if (input->Configure(true, uiExit->GetMapping())) + printf(" %s\n", input->GetMapping()); + else + printf(" [Cancelled]\n"); + goto Redisplay; + } + else if (stricmp(mapping, "KEY_C") == 0) + { + // Clear the input mapping(s) + input->SetMapping("NONE"); + printf("Cleared\n"); + goto Redisplay; + } + else if (stricmp(mapping, "KEY_R") == 0) + { + // Reset the input mapping(s) to the default + input->ResetToDefaultMapping(); + printf("Reset\n"); + goto Redisplay; + } + else if (stricmp(mapping, "KEY_DOWN") == 0) + { + // Move forward to the next mapping + puts(""); + index++; + done = true; + } + else if (stricmp(mapping, "KEY_UP") == 0) + { + // Move back to the previous mapping + if (index > 0) + { + puts(""); + index--; + done = true; + } + } + else if (stricmp(mapping, "KEY_HOME") == 0) + { + // Move to first input + puts(""); + index = 0; + done = true; + } + else if (stricmp(mapping, "KEY_H") == 0) + { + // Print the help message again + puts(""); + PrintConfigureInputsHelp(); + goto Redisplay; + } + else if (stricmp(mapping, "KEY_Q") == 0) + { + // Finish configuration + puts(""); + + m_system->ConfigEnd(); + return true; + } + } + } + + // All inputs set, finish configuration + puts(""); + + m_system->ConfigEnd(); + return true; +} + +void CInputs::PrintInputs(const GameInfo *game) +{ + // Print header + int gameFlags; + if (game != NULL) + { + PrintHeader("Input Assignments for %s", game->title); + gameFlags = game->inputFlags; + } + else + { + PrintHeader("Input Assignments"); + gameFlags = GAME_INPUT_ALL; + } + + const char *groupLabel = NULL; + + for (vector::iterator it = m_inputs.begin(); it < m_inputs.end(); it++) + { + if (!InputIsConfigurable(*it) || !((*it)->gameFlags & gameFlags)) + continue; + + const char *itGroupLabel = (*it)->GetInputGroup(); + if (groupLabel == NULL || stricmp(groupLabel, itGroupLabel) != 0) + { + groupLabel = itGroupLabel; + printf("%s:\n", groupLabel); + } + + printf(" %s = %s\n", (*it)->label, (*it)->GetMapping()); + } + + puts(""); +} + +bool CInputs::Poll(const GameInfo *game, unsigned dispX, unsigned dispY, unsigned dispW, unsigned dispH) +{ + // Update the input system with the current display geometry + m_system->SetDisplayGeom(dispX, dispY, dispW, dispH); + + // Poll the input system + if (!m_system->Poll()) + return false; + + // Poll all UI inputs and all the inputs used by the current game, or all inputs if game is NULL + int gameFlags = (game != NULL ? game->inputFlags : GAME_INPUT_ALL); + for (vector::iterator it = m_inputs.begin(); it < m_inputs.end(); it++) + { + if ((*it)->gameFlags == UI_INPUT || (*it)->gameFlags & gameFlags) + (*it)->Poll(); + } + return true; +} + +void CInputs::DumpState(const GameInfo *game) +{ + // Print header + int gameFlags; + if (game != NULL) + { + PrintHeader("Input States for %s", game->title); + gameFlags = game->inputFlags; + } + else + { + PrintHeader("Input States"); + gameFlags = GAME_INPUT_ALL; + } + + // Loop through the inputs used by the current game, or all inputs if game is NULL, and dump their values to stdout + for (vector::iterator it = m_inputs.begin(); it < m_inputs.end(); it++) + { + if (!((*it)->gameFlags & gameFlags)) + continue; + + if (InputIsConfigurable(*it)) + printf("%s [%s] = (%d)\n", (*it)->id, (*it)->GetMapping(), (*it)->value); + else + printf("%s = (%d)\n", (*it)->id, (*it)->value); + } +} diff --git a/Inputs/Inputs.h b/Inputs/Inputs.h new file mode 100644 index 0000000..fe17186 --- /dev/null +++ b/Inputs/Inputs.h @@ -0,0 +1,195 @@ +#ifndef INCLUDED_INPUTS_H +#define INCLUDED_INPUTS_H + +#include "Types.h" + +#include +using namespace std; + +class CInputSystem; +class CInput; +class CAnalogInput; +class CAxisInput; +class CSwitchInput; +class CGearShift4Input; +class CINIFile; +struct GameInfo; + +/* + * Represents the collection of Model3 inputs. + */ +class CInputs +{ +private: + // Assigned input system + CInputSystem *m_system; + + // Vector of all created inputs + vector m_inputs; + + /* + * Adds a switch input (eg button) to this collection. + */ + CSwitchInput* AddSwitchInput(const char *id, const char *label, unsigned gameFlags, const char *defaultMapping, + UINT16 offVal = 0x00, UINT16 onVal = 0x01); + + /* + * Adds an analog input (eg pedal) to this collection. + */ + CAnalogInput* AddAnalogInput(const char *id, const char *label, unsigned gameFlags, const char *defaultMapping, + UINT16 minVal = 0x00, UINT16 maxVal = 0xFF); + + /* + * Adds an axis input (eg jostick axis, light gun axis or steering wheel) to this collection. + */ + CAxisInput* AddAxisInput(const char *id, const char *label, unsigned gameFlags, const char *defaultMapping, + CAnalogInput* axisNeg, CAnalogInput* axisPos, UINT16 minVal = 0x00, UINT16 offVal = 0x80, UINT16 maxVal = 0xFF); + + /* + * Adds a 4-gear shifter input to this collection. + */ + CGearShift4Input* AddGearShift4Input(const char *id, const char *label, unsigned gameFlags, + CSwitchInput *shift1, CSwitchInput *shift2, CSwitchInput *shift3, CSwitchInput *shift4, CSwitchInput *shiftUp, CSwitchInput *shiftDown); + + void PrintHeader(const char *fmt, ...); + + void PrintConfigureInputsHelp(); + +public: + // UI controls + CSwitchInput* uiExit; + CSwitchInput* uiReset; + CSwitchInput* uiPause; + CSwitchInput* uiSaveState; + CSwitchInput* uiChangeSlot; + CSwitchInput* uiLoadState; + CSwitchInput* uiDumpInpState; + CSwitchInput* uiClearNVRAM; + CSwitchInput* uiToggleCursor; + CSwitchInput* uiToggleFrLimit; + + // Common controls between all games + CSwitchInput* coin[2]; + CSwitchInput* start[2]; + CSwitchInput* test[2]; + CSwitchInput* service[2]; + + // Joysticks (players 1 and 2) + CSwitchInput* up[2]; + CSwitchInput* down[2]; + CSwitchInput* left[2]; + CSwitchInput* right[2]; + + // Fighting game controls (players 1 and 2) + CSwitchInput* punch[2]; + CSwitchInput* kick[2]; + CSwitchInput* guard[2]; + CSwitchInput* escape[2]; + + // Soccer game controls (players 1 and 2) + CSwitchInput* shortPass[2]; + CSwitchInput* longPass[2]; + CSwitchInput* shoot[2]; + + // Vehicle controls + CAxisInput* steering; + CAnalogInput* accelerator; + CAnalogInput* brake; + + // VR view buttons: VR1 Red, VR2 Blue, VR3 Yellow, VR4 Green + CSwitchInput* vr[4]; + + // 4-speed gear shift + CGearShift4Input* gearShift4; + + // Rally controls + CSwitchInput* viewChange; + CSwitchInput* handBrake; + + // Twin joysticks + CSwitchInput* twinJoyTurnLeft; + CSwitchInput* twinJoyTurnRight; + CSwitchInput* twinJoyStrafeLeft; + CSwitchInput* twinJoyStrafeRight; + CSwitchInput* twinJoyForward; + CSwitchInput* twinJoyReverse; + CSwitchInput* twinJoyJump; + CSwitchInput* twinJoyCrouch; + CSwitchInput* twinJoyLeftShot; + CSwitchInput* twinJoyRightShot; + CSwitchInput* twinJoyLeftTurbo; + CSwitchInput* twinJoyRightTurbo; + + // Analog joystick + CAxisInput* analogJoyX; + CAxisInput* analogJoyY; + CSwitchInput* analogJoyTrigger; + CSwitchInput* analogJoyEvent; + + // Gun controls (players 1 and 2) + CAxisInput* gunX[2]; + CAxisInput* gunY[2]; + CSwitchInput* trigger[2]; + CSwitchInput* offscreen[2]; + + /* + * Creates a set of inputs with the given input system. + */ + CInputs(CInputSystem *system); + + ~CInputs(); + + /* + * Returns the assigned input system. + */ + CInputSystem *GetInputSystem(); + + /* + * Initializes the inputs. Must be called before any other methods are used. + */ + bool Initialize(); + + /* + * Looks up an input by its identifier. + */ + CInput* LookupInputByID(const char* id); + + /* + * Returns true if the given input is configurable and can be set by the user. + */ + bool InputIsConfigurable(CInput *input); + + /* + * Reads the input mapping assignments from the given INI file. + */ + void ReadFromINIFile(CINIFile *ini, const char *section); + + /* + * Writes the current input mapping assignments to the given INI file. + */ + void WriteToINIFile(CINIFile *ini, const char *section); + + /* + * Configures the current input mapping assignments for the given game, or all inputs if game is NULL, by asking the user for input. + * Returns true if the inputs were configured okay or false if the user exited without requesting to save changes. + */ + bool ConfigureInputs(const GameInfo *game, unsigned dispX, unsigned dispY, unsigned dispW, unsigned dispH); + + /* + * Prints to stdout the current input mapping assignments for the given game, or all inputs if game is NULL. + */ + void PrintInputs(const GameInfo *game); + + /* + * Polls (updates) the inputs for the given game, or all inputs if game is NULL, updating their values from their respective input sources. + * First the input system is polled (CInputSystem.Poll()) and then each input is polled (CInput.Poll()). + */ + bool Poll(const GameInfo *game, unsigned dispX, unsigned dispY, unsigned dispW, unsigned dispH); + + /* + * Prints the current values of the inputs for the given game, or all inputs if game is NULL, to stdout for debugging purposes. + */ + void DumpState(const GameInfo *game); +}; + +#endif // INCLUDED_INPUTS_H diff --git a/Inputs/MultiInputSource.cpp b/Inputs/MultiInputSource.cpp new file mode 100644 index 0000000..7bf87e3 --- /dev/null +++ b/Inputs/MultiInputSource.cpp @@ -0,0 +1,117 @@ +#include "Supermodel.h" + +#include +using namespace std; + +ESourceType CMultiInputSource::GetCombinedType(vector &sources) +{ + // Check if vector is empty + if (sources.size() == 0) + return SourceEmpty; + // Otherwise, see whether all sources are switches, or if have a full- or half-axis present + bool allSwitches = true; + bool hasFullAxis = false; + bool hasHalfAxis = false; + for (vector::iterator it = sources.begin(); it < sources.end(); it++) + { + if ((*it)->type == SourceInvalid) + return SourceInvalid; // An invalid source makes the whole lot invalid + else if ((*it)->type == SourceSwitch) + continue; + allSwitches = false; + if ((*it)->type == SourceFullAxis) + { + if (hasHalfAxis) + return SourceInvalid; // A half-axis and full-axis combined makes the whole lot invalid + hasFullAxis = true; + } + else if ((*it)->type == SourceHalfAxis) + { + if (hasFullAxis) + return SourceInvalid; // A half-axis and full-axis combined makes the whole lot invalid + hasHalfAxis = true; + } + } + // Return resulting combined type + if (allSwitches) return SourceSwitch; + else if (hasFullAxis) return SourceFullAxis; + else if (hasHalfAxis) return SourceHalfAxis; + else return SourceEmpty; +} + +CMultiInputSource::CMultiInputSource() : CInputSource(SourceEmpty), m_isOr(true), m_numSrcs(0), m_srcArray(NULL) { } + +CMultiInputSource::CMultiInputSource(bool isOr, vector &sources) : + CInputSource(GetCombinedType(sources)), m_isOr(isOr), m_numSrcs(sources.size()) +{ + m_srcArray = new CInputSource*[m_numSrcs]; + copy(sources.begin(), sources.end(), m_srcArray); +} + +CMultiInputSource::~CMultiInputSource() +{ + if (m_srcArray != NULL) + delete m_srcArray; +} + +bool CMultiInputSource::GetValueAsSwitch(bool &val) +{ + if (m_isOr) + { + // Return value for first input that is active + for (int i = 0; i < m_numSrcs; i++) + { + if (m_srcArray[i]->GetValueAsSwitch(val)) + return true; + } + return false; + } + else + { + // Check all switch inputs are active + for (int i = 0; i < m_numSrcs; i++) + { + if (m_srcArray[i]->type == SourceSwitch && !m_srcArray[i]->GetValueAsSwitch(val)) + return false; + } + // Then return value for first non-switch input that is active + for (int i = 0; i < m_numSrcs; i++) + { + if (m_srcArray[i]->type != SourceSwitch && m_srcArray[i]->GetValueAsSwitch(val)) + return true; + } + // Otherwise, value is only valid if not empty and all inputs are switches + return m_numSrcs > 0 && type == SourceSwitch; + } +} + +bool CMultiInputSource::GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal) +{ + if (m_isOr) + { + // Return value for first input that is active + for (int i = 0; i < m_numSrcs; i++) + { + if (m_srcArray[i]->GetValueAsAnalog(val, minVal, offVal, maxVal)) + return true; + } + return false; + } + else + { + // Check all switch inputs are active + for (int i = 0; i < m_numSrcs; i++) + { + if (m_srcArray[i]->type == SourceSwitch && !m_srcArray[i]->GetValueAsAnalog(val, minVal, offVal, maxVal)) + return false; + } + // Then return value for first non-switch input that is active + for (int i = 0; i < m_numSrcs; i++) + { + if (m_srcArray[i]->type != SourceSwitch && m_srcArray[i]->GetValueAsAnalog(val, minVal, offVal, maxVal)) + return true; + } + // Otherwise, value is only valid if not empty and all inputs are switches + return m_numSrcs > 0 && type == SourceSwitch; + } +} \ No newline at end of file diff --git a/Inputs/MultiInputSource.h b/Inputs/MultiInputSource.h new file mode 100644 index 0000000..10668aa --- /dev/null +++ b/Inputs/MultiInputSource.h @@ -0,0 +1,51 @@ +#ifndef INCLUDED_MULTIINPUTSOURCE_H +#define INCLUDED_MULTIINPUTSOURCE_H + +#include "InputSource.h" + +#include +using namespace std; +/* + * Represents a collection of input sources and combines their values into a single value. + * When multiple mappings are assigned to an input, this is the input source that is created. + */ +class CMultiInputSource : public CInputSource +{ +private: + + // Controls how the inputs sources are combined + bool m_isOr; + + // Number of input sources (if zero then represents an 'empty' source) + int m_numSrcs; + + // Array of the input sources + CInputSource **m_srcArray; + +public: + /* + * Returns the combined source type of the given vector of sources. + */ + static ESourceType GetCombinedType(vector &sources); + + /* + * Constructs an 'empty' source (ie one which is always 'off'). + */ + CMultiInputSource(); + + /* + * Constructs a multiple input source from the given vector of sources. + * If isOr is true, then the value of this input will always be the value of the first active input found. If false, then all + * switch inputs must be active for this input to have a value (which will be the value of the first non-switch input in the list, + * or the first switch input if there are none). + */ + CMultiInputSource(bool isOr, vector &sources); + + ~CMultiInputSource(); + + bool GetValueAsSwitch(bool &val); + + bool GetValueAsAnalog(int &val, int minVal, int offVal, int maxVal); +}; + +#endif // INCLUDED_MULTIINPUTSOURCE_H \ No newline at end of file diff --git a/Model3/53C810.cpp b/Model3/53C810.cpp new file mode 100644 index 0000000..3148713 --- /dev/null +++ b/Model3/53C810.cpp @@ -0,0 +1,506 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * 53C810.cpp + * + * Implementation of the C53C810 class: NCR 53C810 SCSI controller. + * + * TO-DO List: + * ----------- + * - VF3 does something weird: it writes DSP (triggering automatic code + * execution because MAN=0) and THEN sets single step mode, expecting an + * interrupt to occur. I suspect this is incorrect operation and that + * the SCRIPTS processor either enters single-step mode while the memory + * transfer is underway (though it is unlikely because it's such a short + * transfer), or that single step can occur even when the device is "halted" + * (which would mean the SCRIPTS processor executes an invalid instruction + * once or twice without the VF3 SCSI driver noticing). Unfortunately, the + * former is not feasible to emulate. If automatic SCRIPTS execution is + * disabled when single-stepping is enabled, Scud Race breaks (glitchy, + * jerky graphics). Enabling automatic execution and also allowing single + * stepping to occur when the processor is halted seems to work, but it + * causes invalid instructions to be hit each time. + * - Check to ensure the invalid instructions hit above would never be decoded + * as real SCRIPTS instructions (in some cases, appears they can be...) + * - Is the SIP bit supposed to be set after single stepping? + * - pg 2-22 (42) of the manual has description of how to clear interrupts. + * - Another way to fix VF3 is to just set the single-step and DMA interrupt + * flags at all times. + * + */ + +#include +#include "Supermodel.h" + + +/****************************************************************************** + Save States +******************************************************************************/ + +void C53C810::SaveState(CBlockFile *SaveState) +{ + SaveState->NewBlock("53C810", __FILE__); + SaveState->Write(Ctx.regs, sizeof(Ctx.regs)); + SaveState->Write(&Ctx.regTEMP, sizeof(Ctx.regTEMP)); + SaveState->Write(&Ctx.regDSP, sizeof(Ctx.regDSP)); + SaveState->Write(&Ctx.regDSPS, sizeof(Ctx.regDSPS)); + SaveState->Write(&Ctx.regDBC, sizeof(Ctx.regDBC)); + SaveState->Write(&Ctx.regDCMD, sizeof(Ctx.regDCMD)); + SaveState->Write(&Ctx.regDCNTL, sizeof(Ctx.regDCNTL)); + SaveState->Write(&Ctx.regDMODE, sizeof(Ctx.regDMODE)); + SaveState->Write(&Ctx.regDSTAT, sizeof(Ctx.regDSTAT)); + SaveState->Write(&Ctx.regISTAT, sizeof(Ctx.regISTAT)); +} + +void C53C810::LoadState(CBlockFile *SaveState) +{ + if (OKAY != SaveState->FindBlock("53C810")) + { + ErrorLog("Unable to load 53C810 state. Save state file is corrupted."); + return; + } + + SaveState->Read(Ctx.regs, sizeof(Ctx.regs)); + SaveState->Read(&Ctx.regTEMP, sizeof(Ctx.regTEMP)); + SaveState->Read(&Ctx.regDSP, sizeof(Ctx.regDSP)); + SaveState->Read(&Ctx.regDSPS, sizeof(Ctx.regDSPS)); + SaveState->Read(&Ctx.regDBC, sizeof(Ctx.regDBC)); + SaveState->Read(&Ctx.regDCMD, sizeof(Ctx.regDCMD)); + SaveState->Read(&Ctx.regDCNTL, sizeof(Ctx.regDCNTL)); + SaveState->Read(&Ctx.regDMODE, sizeof(Ctx.regDMODE)); + SaveState->Read(&Ctx.regDSTAT, sizeof(Ctx.regDSTAT)); + SaveState->Read(&Ctx.regISTAT, sizeof(Ctx.regISTAT)); +} + + +/****************************************************************************** + SCRIPTS Emulation +******************************************************************************/ + +static inline UINT32 Fetch(struct NCR53C810Context *Ctx) +{ + UINT32 data = Ctx->Bus->Read32(Ctx->regDSP); + Ctx->regDSP += 4; + return FLIPENDIAN32(data); // remember: bus is big endian, need to convert to little endian +} + +//TO-DO: check if this ever occurs in single-step mode (if so, we would need to stack interrupts) +static BOOL SCRIPTS_Int_IntFly(struct NCR53C810Context *Ctx) +{ + Ctx->halt = TRUE; // halt SCRIPTS execution + Ctx->regISTAT |= 1; // DMA interrupt pending + Ctx->regDSTAT |= 4; // SCRIPTS interrupt instruction received + Ctx->IRQ->Assert(Ctx->scsiIRQ); + + if ((Ctx->regDBC&0x100000)) // INTFLY + return ErrorLog("53C810 INTFLY instruction not emulated!"); + return OKAY; +} + +static BOOL SCRIPTS_MoveMemory(struct NCR53C810Context *Ctx) +{ + UINT32 src, dest; + unsigned numBytes, i; + + // Get operands + src = Ctx->regDSPS; + dest = Ctx->regTEMP = Fetch(Ctx); + numBytes = Ctx->regDBC; + // not implemented: illegal instruction interrupt when src and dest are not aligned the same way + + DebugLog("53C810: Move Memory %08X -> %08X, %X\n", src, dest, numBytes); + + // Perform a 32-bit copy if possible + for (i = 0; i < (numBytes/4); i++) + { + Ctx->Bus->Write32(dest, Ctx->Bus->Read32(src)); + dest += 4; + src += 4; + } + + // Finish off the last few odd bytes + numBytes &= 3; + while (numBytes) + { + Ctx->Bus->Write8(dest++, Ctx->Bus->Read8(src++)); + --numBytes; + } + + // Update registers + Ctx->regDBC = 0; + Ctx->regDSPS = src; + Ctx->regTEMP = dest; + + return OKAY; +} + +// Invalid instruction handler +static BOOL SCRIPTS_Invalid(struct NCR53C810Context *Ctx) +{ + DebugLog("53C810 encountered an unrecognized instruction (%02X%06X, DSP=%08X)\n!", Ctx->regDCMD, Ctx->regDBC, Ctx->regDSP); + return FAIL; +} + +void C53C810::Run(BOOL singleStep) +{ + UINT32 op; + int i; + + if (singleStep)// && !Ctx.halt) + { + // Fetch instruction (first two words are always fetched) + op = Fetch(&Ctx); // word 1 + Ctx.regDBC = op&0x00FFFFFF; + Ctx.regDCMD = (op>>24)&0xFF; + Ctx.regDSPS = Fetch(&Ctx); // word 2 + + // Single step + OpTable[Ctx.regDCMD](&Ctx); + + // Issue IRQ and finish + Ctx.regISTAT |= 3; // DMA interrupt pending (NOTE: should SIP be set? I don't think so...) + Ctx.regDSTAT |= 8; // single step interrupt + Ctx.IRQ->Assert(Ctx.scsiIRQ); // generate an interrupt + DebugLog("53C810: Asserted IRQ\n"); + } + else + { + // Automatic mode: run (as long as the processor is not halted) + for (i = 0; (i < 100) && !Ctx.halt; i++) + { + // Fetch instruction (first two words are always fetched) + op = Fetch(&Ctx); // word 1 + Ctx.regDBC = op&0x00FFFFFF; + Ctx.regDCMD = (op>>24)&0xFF; + Ctx.regDSPS = Fetch(&Ctx); // word 2 + + // Execute! + if (OpTable[Ctx.regDCMD](&Ctx) != OKAY) + break; + } + } +} + +// Insert instructions into the LUT under control of the mask +void C53C810::Insert(UINT8 mask, UINT8 op, BOOL (*Handler)(struct NCR53C810Context *)) +{ + UINT32 i; + + for (i = 0; i < 256; i++) + { + if ((i&mask) == op) + OpTable[i] = Handler; + } +} + +void C53C810::BuildOpTable(void) +{ + Insert(0, 0, &SCRIPTS_Invalid); + Insert(0xE0, 0xC0, &SCRIPTS_MoveMemory); + Insert(0xF8, 0x98, &SCRIPTS_Int_IntFly); +} + + +/****************************************************************************** + Register and PCI Access Handlers +******************************************************************************/ + +void C53C810::WriteRegister(unsigned reg, UINT8 data) +{ + if (reg >= 0x60) + { + ErrorLog("%s:%s: Invalid 53C810 register (%02X).", __FILE__, __LINE__, reg); + return; + } + + DebugLog("53C810 write: %02X=%02X (PC=%08X, LR=%08X)\n", reg, data, ppc_get_pc(), ppc_get_lr()); + + // Dump everything into the register file + Ctx.regs[reg&0xFF] = data; + + // Do something extra with the ones that we actually care about + // TO-DO: prevent invalid/reserved/read-only registers from being written? + switch(reg) + { + case 0x14: // ISTAT + Ctx.regISTAT = data; + DebugLog("ISTAT=%02X\n", data); + break; + case 0x1C: // TEMP 7-0 + Ctx.regTEMP &= 0xFFFFFF00; + Ctx.regTEMP |= data; + break; + case 0x1D: // TEMP 15-8 + Ctx.regTEMP &= 0xFFFF00FF; + Ctx.regTEMP |= (data<<8); + break; + case 0x1E: // TEMP 23-16 + Ctx.regTEMP &= 0xFF00FFFF; + Ctx.regTEMP |= (data<<16); + break; + case 0x1F: // TEMP 31-24 + Ctx.regTEMP &= 0x00FFFFFF; + Ctx.regTEMP |= (data<<24); + break; + case 0x24: // DBC 7-0 + Ctx.regDBC &= 0xFFFFFF00; + Ctx.regDBC |= data; + break; + case 0x25: // DBC 15-8 + Ctx.regDBC &= 0xFFFF00FF; + Ctx.regDBC |= (data<<8); + break; + case 0x26: // DBC 23-16 + Ctx.regDBC &= 0xFF00FFFF; + Ctx.regDBC |= (data<<16); + break; + case 0x27: // DCMD + Ctx.regDCMD = data; + break; + case 0x2C: // DSP 7-0 + Ctx.regDSP &= 0xFFFFFF00; + Ctx.regDSP |= data; + break; + case 0x2D: // DSP 15-8 + Ctx.regDSP &= 0xFFFF00FF; + Ctx.regDSP |= (data<<8); + break; + case 0x2E: // DSP 23-16 + Ctx.regDSP &= 0xFF00FFFF; + Ctx.regDSP |= (data<<16); + break; + case 0x2F: // DSP 31-24 + Ctx.regDSP &= 0x00FFFFFF; + Ctx.regDSP |= (data<<24); + Ctx.halt = FALSE; // writing this register un-halts 53C810 operation (pg.6-31 of LSI manual) + if (!(Ctx.regDMODE&1)) // if MAN=0, start SCRIPTS automatically + // To-Do: is this correct? Should single step really be tested first? + //if (!(Ctx.regDCNTL&0x10) && !(Ctx.regDMODE&1)) // if MAN=0 and not single stepping, start SCRIPTS automatically + { + DebugLog("53C810: Automatically starting (PC=%08X, LR=%08X, single step=%d)\n", ppc_get_pc(), ppc_get_lr(), !!(Ctx.regDCNTL&0x10)); + Run(FALSE); // automatic + } + break; + case 0x30: // DSPS 7-0 + Ctx.regDSPS &= 0xFFFFFF00; + Ctx.regDSPS |= data; + break; + case 0x31: // DSPS 15-8 + Ctx.regDSPS &= 0xFFFF00FF; + Ctx.regDSPS |= (data<<8); + break; + case 0x32: // DSPS 23-16 + Ctx.regDSPS &= 0xFF00FFFF; + Ctx.regDSPS |= (data<<16); + break; + case 0x33: // DSPS 31-24 + Ctx.regDSPS &= 0x00FFFFFF; + Ctx.regDSPS |= (data<<24); + break; + case 0x38: // DMODE + Ctx.regDMODE = data; + break; + case 0x3B: // DCNTL + Ctx.regDCNTL = data; + if ((Ctx.regDCNTL&0x14) == 0x14) // single step + { + DebugLog("53C810: single step: %08X, (halt=%d)\n", Ctx.regDSP, Ctx.halt); + Run(TRUE); + } + else if ((Ctx.regDCNTL&0x04)) // start DMA bit + { + DebugLog("53C810: Manually starting\n"); + Run(FALSE); + } + break; + default: + break; + } +} + +UINT8 C53C810::ReadRegister(unsigned reg) +{ + UINT8 ret; + + if (reg >= 0x60) + { + ErrorLog("%s:%s: Invalid 53C810 register (%02X).", __FILE__, __LINE__, reg); + return 0; + } + + DebugLog("53C810 read: %02X (PC=%08X, LR=%08X)\n", reg, ppc_get_pc(), ppc_get_lr()); + + // Some registers require special handling + switch(reg) + { + case 0x0C: // DSTAT + // For now, we don't generate stacked interrupts, so always clear IRQ status + ret = Ctx.regDSTAT; + //TO-DO: manual says these should be cleared here but MAME never clears them. What's up with that? + Ctx.regISTAT &= 0xFE; // clear DIP bit (DMA interrupt) + Ctx.regDSTAT &= 0xF7; // clear SSI (single step interrupt) + //Ctx.regISTAT |= 1; // doing this is another way to fix VF3 + //Ctx.regDSTAT |= 8; + Ctx.IRQ->Deassert(Ctx.scsiIRQ); + //DebugLog("53C810: DSTAT read\n"); + return ret; + case 0x14: // ISTAT + //DebugLog("53C810: ISTAT read\n"); + return Ctx.regISTAT; + case 0x1C: // TEMP 7-0 + return Ctx.regTEMP&0xFF; + case 0x1D: // TEMP 15-8 + return (Ctx.regTEMP>>8)&0xFF; + case 0x1E: // TEMP 23-16 + return (Ctx.regTEMP>>16)&0xFF; + case 0x1F: // TEMP 31-24 + return (Ctx.regTEMP>>24)&0xFF; + case 0x24: // DBC 7-0 + return Ctx.regDBC&0xFF; + case 0x25: // DBC 15-8 + return (Ctx.regDBC>>8)&0xFF; + case 0x26: // DBC 23-16 + return (Ctx.regDBC>>16)&0xFF; + case 0x27: // DCMD + return Ctx.regDCMD; + case 0x2C: // DSP 7-0 + return Ctx.regDSP&0xFF; + case 0x2D: // DSP 15-8 + return (Ctx.regDSP>>8)&0xFF; + case 0x2E: // DSP 23-16 + return (Ctx.regDSP>>16)&0xFF; + case 0x2F: // DSP 31-24 + return (Ctx.regDSP>>24)&0xFF; + case 0x30: // DSPS 7-0 + return Ctx.regDSPS&0xFF; + case 0x31: // DSPS 15-8 + return (Ctx.regDSPS>>8)&0xFF; + case 0x32: // DSPS 23-16 + return (Ctx.regDSPS>>16)&0xFF; + case 0x33: // DSPS 31-24 + return (Ctx.regDSPS>>24)&0xFF; + case 0x38: + return Ctx.regDMODE; + case 0x3B: // DCNTL + return Ctx.regDCNTL; + default: // get it from the register file + break; + } + + // Register file should be up to date + return Ctx.regs[reg&0xFF]; +} + +UINT32 C53C810::ReadPCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned offset) +{ + UINT32 d; + + if ((bits==8)) + { + DebugLog("53C810 %d-bit PCI read request for reg=%02X\n", bits, reg); + return 0; + } + + switch (reg) + { + case 0x00: // Device ID and Vendor ID + d = 0x00011000; // 0x1000 = LSI Logic + switch (bits) + { + case 8: + d >>= (3-offset)*8; // offset will be 0-3; select appropriate byte + d &= 0xFF; + break; + case 16: + d >>= (2-offset)*8; // offset will be 0 or 2 only; select either high or low word + d &= 0xFFFF; + break; + default: + break; + } + return d; + default: + DebugLog("53C810 PCI read request for reg=%02X (%d-bit)\n", reg, bits); + break; + } + + return 0; +} + +void C53C810::WritePCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned offset, UINT32 data) +{ + DebugLog("53C810 PCI %d-bit write request for reg=%02X, data=%08X\n", bits, reg, data); +} + +void C53C810::Reset(void) +{ + memset(Ctx.regs, 0, sizeof(Ctx.regs)); + Ctx.regs[0x00] = 0xC0; // SCNTL0 + Ctx.regs[0x0C] = 0x80; // DSTAT + Ctx.regs[0x0F] = 0x02; // SSTAT2 + Ctx.regs[0x18] = 0xFF; // reserved + Ctx.regs[0x19] = 0xF0; // CTEST1 + Ctx.regs[0x1A] = 0x01; // CTEST2 + Ctx.regs[0x46] = 0x60; // MACNTL + Ctx.regs[0x47] = 0x0F; // GPCNTL + Ctx.regs[0x4C] = 0x03; // STEST0 + Ctx.regTEMP = 0; + Ctx.regDSP = 0; + Ctx.regDSPS = 0; + Ctx.regDBC = 0; + Ctx.regDCMD = 0; + Ctx.regDCNTL = 0; + Ctx.regDMODE = 0; + Ctx.regDSTAT = 0x80; // DMA FIFO empty + Ctx.regISTAT = 0; + Ctx.halt = FALSE; + + DebugLog("53C810 reset\n"); +} + + +/****************************************************************************** + Configuration, Initialization, and Shutdown +******************************************************************************/ + +void C53C810::Init(CBus *BusObjectPtr, CIRQ *IRQObjectPtr, unsigned scsiIRQBit) +{ + Ctx.Bus = BusObjectPtr; + Ctx.IRQ = IRQObjectPtr; + Ctx.scsiIRQ = scsiIRQBit; +} + +C53C810::C53C810(void) +{ + BuildOpTable(); + Ctx.Bus = NULL; + Ctx.IRQ = NULL; + scsiIRQ = 0; + DebugLog("Built 53C810\n"); +} + +C53C810::~C53C810(void) +{ + Ctx.Bus = NULL; + Ctx.IRQ = NULL; + DebugLog("Destroyed 53C810\n"); +} diff --git a/Model3/53C810.h b/Model3/53C810.h new file mode 100644 index 0000000..7954ed4 --- /dev/null +++ b/Model3/53C810.h @@ -0,0 +1,202 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * 53C810.h + * + * Header file defining the C53C810 class (NCR 53C810 SCSI controller). + */ + +#ifndef INCLUDED_53C810_H +#define INCLUDED_53C810_H + + +/* + * struct NCR53C810Context: + * + * Context information for an NCR 53C810 device. Used internally by the C53C810 + * class (defined below). + */ +struct NCR53C810Context +{ + UINT8 regs[0x60]; + + // Registers defined below should not be read from here, not regs[] + UINT32 regTEMP; // TEMP + UINT32 regDSP; // DSP: DMA SCRIPTS Pointer + UINT32 regDSPS; // DSPS: DMA SCRIPTS Pointer Save + UINT32 regDBC; // DBC: DMA Byte Counter (24 bits) + UINT8 regDCMD; // DCMD: DMA Command + UINT8 regDCNTL; // DCNTL: DMA Control + UINT8 regDMODE; // DMODE: DMA Mode + UINT8 regDSTAT; // DSTAT: DMA Status (read only) + UINT8 regISTAT; // ISTAT: Interrupt Status + + // Operational status + BOOL halt; // set TRUE if halted by interrupt instruction + + // Big endian bus object for DMA memory access and instruction fetching + CBus *Bus; + + // IRQ handling + CIRQ *IRQ; // IRQ controller + unsigned scsiIRQ; // IRQ bit to use when calling IRQ handler +}; + +/* + * C53C810: + * + * NCR 53C810 SCSI controller device. + */ +class C53C810: public CPCIDevice +{ +public: + /* + * SaveState(SaveState): + * + * Saves an image of the current device state. + * + * Parameters: + * SaveState Block file to save state information to. + */ + void SaveState(CBlockFile *SaveState); + + /* + * LoadState(SaveState): + * + * Loads and a state image. + * + * Parameters: + * SaveState Block file to load state information from. + */ + void LoadState(CBlockFile *SaveState); + + /* + * ReadRegister(reg): + * + * Read from an operating register (8 bits at a time). + * + * Parameters: + * reg Register offset ranging from 0x00 to 0x5F. Anything higher + * is ignored and returns 0. + */ + UINT8 ReadRegister(unsigned reg); + + /* + * WriteRegister(reg, data): + * + * Write to an operating register (8 bits at a time). When breaking multi- + * byte words into individual bytes, make sure to write the lowest address + * first and the highest last. Some special functions registers, like DSP, + * will initiate processing only when the highest byte is written. + * + * Parameters: + * reg Register offset ranging from 0x00 to 0x5F. Anything higher + * is ignored. + * data Data to write. + */ + void WriteRegister(unsigned reg, UINT8 data); + + /* + * ReadPCIConfigSpace(device, reg, bits, offset): + * + * Reads a PCI configuration space register. See CPCIDevice definition for + * more details. + * + * Parameters: + * device Device number (ignored, not needed). + * reg Register number. + * bits Bit width of access (8, 16, or 32 only).; + * offset Byte offset within register, aligned to the specified bit + * width, and offset from the 32-bit aligned base of the + * register number. + * + * Returns: + * Register data. + */ + UINT32 ReadPCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned width); + + /* + * WritePCIConfigSpace(device, reg, bits, offset, data): + * + * Writes to a PCI configuration space register. See CPCIDevice definition + * for more details. + * + * Parameters: + * device Device number (ignored, not needed). + * reg Register number. + * bits Bit width of access (8, 16, or 32 only). + * offset Byte offset within register, aligned to the specified bit + * width, and offset from the 32-bit aligned base of the + * register number. + * data Data. + */ + void WritePCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned width, UINT32 data); + + /* + * Reset(void): + * + * Resets the device. + */ + void Reset(void); + + /* + * Init(BusObjectPtr, IRQObjectPtr, scsiIRQBit): + * + * One-time initialization of the context. Must be called prior to all + * other members. + * + * Parameters: + * BusObjectPtr Pointer to the bus that the 53C810 has control + * over. Used to read/write memory. + * IRQObjectPtr Pointer to the IRQ controller. Used to trigger SCSI + * and DMA interrupts. + * scsiIRQBit IRQ identifier bit to pass along to IRQ controller + * when asserting interrupts. + */ + void Init(CBus *BusObjectPtr, CIRQ *IRQObjectPtr, unsigned scsiIRQBit); + + /* + * C53C810(void): + * ~C53C810(void): + * + * Constructor and destructor. + */ + C53C810(void); + ~C53C810(void); + +private: + // Private members + void Run(int numOps); + void BuildOpTable(void); + void Insert(UINT8 mask, UINT8 op, BOOL (*Handler)(struct NCR53C810Context *)); + BOOL (*OpTable[256])(struct NCR53C810Context *); + + // Context (register file) + struct NCR53C810Context Ctx; + + // IRQ controller and IRQ identifier for this SCSI controller + CIRQ *IRQ; + unsigned scsiIRQ; +}; + + +#endif // INCLUDED_53C810_H diff --git a/Model3/53C810Disasm.cpp b/Model3/53C810Disasm.cpp new file mode 100644 index 0000000..789a2ea --- /dev/null +++ b/Model3/53C810Disasm.cpp @@ -0,0 +1,281 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * 53C810Disasm.cpp + * + * NCR 53C810 SCRIPTS disassembler. + * + * WARNING: Not all instructions are supported. They are being added as they + * are encountered in Model 3 games. Some of the complicated operand forms may + * be decoded incorrectly. + */ + +#include +#include +#ifdef STANDALONE +#include +#endif +#include "Types.h" + +#define DISASM_VERSION "1.0" + + +/****************************************************************************** + Disassembler Function +******************************************************************************/ + +/* + * DisassembleSCRIPTS(op, addr, mnem): + * + * Disassembles one SCRIPTS instruction. + * + * Parameters: + * op Three consecutive words. + * addr Current instruction address. + * mnem Buffer to write instruction mnemonic to. If no instruction was + * successfully decoded, will be set to '\0'. + * + * Returns: + * Number of 32-bit words decoded (1, 2, or 3) or 0 if the instruction was + * not recognized. + */ +int DisassembleSCRIPTS(UINT32 op[3], UINT32 addr, char *mnem) +{ + static const char *phase[] = { "data_out", "data_in", "command", "status", "res4", "res5", "message_out", "message_in" }; + int carry, bitTrue, compData, compPhase, wait, mask, data; + + mnem[0] = '\0'; + + if ((op[0]&0xC0000000) == 0) + { + // Block Move + if ((op[0]&0x10000000)) // FROM + sprintf(mnem, "move (%d) from %08X, when ", (op[0]>>27)&1, op[1]); + else // count + { + if ((op[0]&0x20000000)) + sprintf(mnem, "move (%d) %X, ptr %08X, when ", (op[0]>>27)&1, op[0]&0x00FFFFFF, op[1]); + else + sprintf(mnem, "move (%d) %X, %08X, when ", (op[0]>>27)&1, op[0]&0x00FFFFFF, op[1]); + } + strcat(mnem, phase[(op[0]>>24)&7]); + return 2; + } + else if ((op[0]&0xE0000000) == 0xC0000000) + { + // Move Memory + if ((op[0]&0x01000000)) + sprintf(mnem, "move memory no flush %X, %08X, %08X", op[0]&0x00FFFFFF, op[1], op[2]); + else + sprintf(mnem, "move memory %X, %08X, %08X", op[0]&0x00FFFFFF, op[1], op[2]); + return 3; + } + else if ((op[0]&0xF8000000) == 0x98000000) + { + // INT and INTFLY + mnem += sprintf(mnem, "%s %08X, ", (op[0]&0x00100000)?"intfly ":"int ", op[1]); + + carry = op[0]&0x00200000; + bitTrue = op[0]&0x00080000; + compData = op[0]&0x00040000; // data (if set) + compPhase = op[0]&0x00020000; // phase (if set) (or atn if neither phase nor data set) + wait = op[0]&0x00010000; + data = op[0]&0xFF; + mask = (op[0]>>8)&0xFF; + + if (carry) + sprintf(mnem, "%s%s carry", wait?"if":"when", bitTrue?"":" not"); + else + { + mnem += sprintf(mnem, "%s%s ", wait?"if":"when", bitTrue?"":" not"); + if (!compPhase && !compData) + sprintf(mnem, "atn"); + else + { + if (compPhase) + { + mnem += sprintf(mnem, phase[(op[0]>>24)&7]); + if (compData) + mnem += sprintf(mnem, " and "); + } + + if (compData) + mnem += sprintf(mnem, "%02X mask %02X", data, mask); + } + + } + + + return 2; + } + return 0; // no match found +} + + +/****************************************************************************** + Standalone Disassembler + + Define STANDALONE to build a command line-driven SCRIPTS disassembler. +******************************************************************************/ + +#ifdef STANDALONE + +static void PrintUsage(void) +{ + puts("scriptsd Version "DISASM_VERSION" by Bart Trzynadlowski: NCR 53C810 SCRIPTS Disassembler"); + puts("Usage: scriptsd [options]"); + puts("Options: -?,-h Show this help text"); + puts(" -s Start offset (hexadecimal)"); + puts(" -l Number of instructions (Default=16)"); + puts(" -o Set origin (hexadecimal)"); + exit(0); +} + +/* + * main(argc, argv): + * + * Standalone SCRIPTS disassembler. + */ +int main(int argc, char **argv) +{ + char mnem[64]; + FILE *fp; + UINT8 *buffer; + unsigned i, num, offset, fsize, start = 0, len, org, file = 0; + UINT32 op[3]; + BOOL len_specified = 0, org_specified = 0; + char *c; + + + if (argc <= 1) + PrintUsage(); + + for (i = 1; i < argc; i++) + { + if (!strcmp(argv[i], "-h") || !strcmp(argv[i], "-?")) + PrintUsage(); + else if (!strcmp(argv[i], "-s")) + { + ++i; + if (i >= argc) + fprintf(stderr, "scriptsd: warning: no argument to %s\n", "-s"); + else + start = strtoul(argv[i], &c, 16); + } + else if (!strcmp(argv[i], "-l")) + { + ++i; + if (i >= argc) + fprintf(stderr, "scriptsd: warning: no argument to %s\n", "-l"); + else + { + len = atoi(argv[i]); + len_specified = 1; + } + } + else if (!strcmp(argv[i], "-o")) + { + ++i; + if (i >= argc) + fprintf(stderr, "scriptsd: warning: no argument to %s\n", "-o"); + else + { + org = strtoul(argv[i], &c, 16); + org_specified = 1; + } + } + else + file = i; + } + + if (!file) + { + fprintf(stderr, "scriptsd: no input file specified\n"); + exit(1); + } + + /* + * Load file + */ + + if ((fp = fopen(argv[file], "rb")) == NULL) + { + fprintf(stderr, "scriptsd: failed to open file: %s\n", argv[file]); + exit(1); + } + fseek(fp, 0, SEEK_END); + fsize = ftell(fp); + rewind(fp); + + // Allocate some extra padding for operands + if ((buffer = (UINT8 *) calloc(fsize+4*3, sizeof(UINT8))) == NULL) + { + fprintf(stderr, "scriptsd: not enough memory to load input file: %s, %lu bytes\n", argv[file], (unsigned long) fsize); + fclose(fp); + exit(1); + } + fread(buffer, sizeof(UINT8), fsize, fp); + fclose(fp); + + if (!len_specified) + len = 16; + + if (!org_specified) + org = start; + + /* + * Disassemble! + */ + + offset = start; + for (i = 0; (i. + **/ + +/* + * 93C46.cpp + * + * Implementation of the 93C46 serial EEPROM device. + * + * To-Do List + * ---------- + * - Manual says that when a READ command is issued, the data will be + * preceded by a leading 0. This seems to cause problems. Perhaps DO + * should just be set to 0? + */ + +#include +#include "Supermodel.h" + + +/****************************************************************************** + Save States +******************************************************************************/ + +void C93C46::SaveState(CBlockFile *SaveState) +{ + SaveState->NewBlock("93C46", __FILE__); + SaveState->Write(regs, sizeof(regs)); + SaveState->Write(&CS, sizeof(CS)); + SaveState->Write(&CLK, sizeof(CLK)); + SaveState->Write(&DI, sizeof(DI)); + SaveState->Write(&DO, sizeof(DO)); + SaveState->Write(&bitBufferOut, sizeof(bitBufferOut)); + SaveState->Write(&bitBufferIn, sizeof(bitBufferIn)); + SaveState->Write(&bitsOut, sizeof(bitsOut)); + SaveState->Write(&receiving, sizeof(receiving)); + SaveState->Write(&addr, sizeof(addr)); + SaveState->Write(&busyCycles, sizeof(busyCycles)); + SaveState->Write(&locked, sizeof(locked)); +} + +void C93C46::LoadState(CBlockFile *SaveState) +{ + if (OKAY != SaveState->FindBlock("93C46")) + { + ErrorLog("Unable to load EEPROM state. File is corrupted."); + return; + } + + SaveState->Read(regs, sizeof(regs)); + SaveState->Read(&CS, sizeof(CS)); + SaveState->Read(&CLK, sizeof(CLK)); + SaveState->Read(&DI, sizeof(DI)); + SaveState->Read(&DO, sizeof(DO)); + SaveState->Read(&bitBufferOut, sizeof(bitBufferOut)); + SaveState->Read(&bitBufferIn, sizeof(bitBufferIn)); + SaveState->Read(&bitsOut, sizeof(bitsOut)); + SaveState->Read(&receiving, sizeof(receiving)); + SaveState->Read(&addr, sizeof(addr)); + SaveState->Read(&busyCycles, sizeof(busyCycles)); + SaveState->Read(&locked, sizeof(locked)); +} + + +/****************************************************************************** + Emulation Functions +******************************************************************************/ + +// Reverse the bit ordering +static UINT16 ReverseBits16(UINT16 data) +{ + UINT16 dataOut = 0, hi, lo; + + for (int i = 0; i < 16/2; i++) + { + // Isolate corresponding bits from high and low halves of word + lo = (data>>i)&1; + hi = (data>>(15-i))&1; + + // Swap them + dataOut |= (lo<<(15-i)); + dataOut |= (hi<>16)&0x3F] = bitBufferIn&0xFFFF; + DO = 1; // ready (write completed) + DebugLog("93C46: WRITE %X=%04X (lock=%d)\n", (bitBufferIn>>16)&0x3F, bitBufferIn&0xFFFF, locked); + } + else if ((bitBufferIn&0xFFF00000) == 0x01100000) // WRALL (write all) + { + if (!locked) + { + for (int i = 0; i < 64; i++) + regs[i] = bitBufferIn&0xFFFF; + } + DO = 1; + DebugLog("93C46: WRALL %04X (lock=%d)\n", bitBufferIn&0xFFFF, locked); + } + else if ((bitBufferIn&0xFFFFFFC0) == 0x1C0) // ERASE + { + if (!locked) + regs[bitBufferIn&0x3F] = 0xFFFF; + DO = 1; + DebugLog("93C46: ERASE %X (lock=%d)\n", bitBufferIn&0x3F, locked); + } + else if ((bitBufferIn&0xFFFFFFF0) == 0x120) // ERALL (erase all) + { + if (!locked) + { + for (int i = 0; i < 64; i++) + regs[i] = 0xFFFF; + DebugLog("93C46: ERALL (lock=%d)\n", locked); + } + DO = 1; + } + } + else // the chip is reading out data (transmitting) + { + // Shift out to DO pin + DO = bitBufferOut&1; + bitBufferOut >>= 1; + ++bitsOut; + + // If we've shifted out an entire 16-bit word, load up the next address (no preceding 0) + if (bitsOut == 16) + { + addr = (addr+1)&0x3F; + bitBufferOut = ReverseBits16(regs[addr]); + bitsOut = 0; + + DebugLog("93C46: Next word loaded: %X\n", addr); + } + } + } +} + +unsigned C93C46::Read(void) +{ + // When not transmitting, DO indicates whether busy or not + if (receiving) + { + if (busyCycles > 0) // simulate programming delay + { + --busyCycles; + return 0; // busy + } + else + return 1; // ready to accept new command + } + + // Transmit data + return DO; +} + +void C93C46::Clear(void) +{ + memset(regs, 0xFF, sizeof(regs)); +} + +void C93C46::Reset(void) +{ + receiving = TRUE; + locked = TRUE; + bitBufferIn = 0; + bitBufferOut = 0; + addr = 0; + busyCycles = 0; + CS = 0; +} + + +/****************************************************************************** + Configuration, Initialization, and Shutdown +******************************************************************************/ + +void C93C46::Init(void) +{ + // this function really only exists for consistency with other device classes +} + +C93C46::C93C46(void) +{ + memset(regs, 0xFF, sizeof(regs)); + DebugLog("Built 93C46 EEPROM\n"); +} + +C93C46::~C93C46(void) +{ + DebugLog("Destroyed 93C46 EEPROM\n"); +} diff --git a/Model3/93C46.h b/Model3/93C46.h new file mode 100644 index 0000000..c52c5a6 --- /dev/null +++ b/Model3/93C46.h @@ -0,0 +1,127 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * 93C46.h + * + * Header file defining the C93C46 class: 93C46 EEPROM. + */ + +#ifndef INCLUDED_93C46_H +#define INCLUDED_93C46_H + + +/* + * C93C46: + * + * 93C46 serial EEPROM. + */ +class C93C46 +{ +public: + /* + * SaveState(SaveState): + * + * Saves an image of the current device state. + * + * Parameters: + * SaveState Block file to save state information to. + */ + void SaveState(CBlockFile *SaveState); + + /* + * LoadState(SaveState): + * + * Loads and a state image. + * + * Parameters: + * SaveState Block file to load state information from. + */ + void LoadState(CBlockFile *SaveState); + + /* + * Clear(void): + * + * Clears the EEPROM contents by writing all 1's. + */ + void Clear(void); + + /* + * Write(pinCS, pinCLK, pinDI): + * + * Write to the EEPROM. All inputs must be either 0 or 1 only! + * + * Parameters: + * pinCS Chip select. + * pinCLK Serial data clock. + * pinDI Serial data input. + */ + void Write(unsigned pinCS, unsigned pinCLK, unsigned pinDI); + + /* + * Read(void): + * + * Read from the EEPROM. + * + * Returns: + * The serial data output bit (either a 1 or 0). + */ + unsigned Read(void); + + /* + * Reset(void): + * + * Resets the device, putting it into a locked state. Does not modify the + * memory. + */ + void Reset(void); + + /* + * Init(void): + * + * One-time initialization of the context. Must be called prior to all + * other members. + */ + void Init(void); + + /* + * C93C46(void): + * ~C93C46(void): + * + * Constructor and destructor. + */ + C93C46(void); + ~C93C46(void); + +private: + UINT16 regs[64]; // memory: 64 16-bit registers + unsigned CS, CLK, DI, DO; // pins + UINT32 bitBufferOut; // bits to be shifted out + UINT32 bitBufferIn; // stores bits as they are shifted in + int bitsOut; // how many bits have been shifted out + BOOL receiving; // if true, accepting data, if false, sending data out (read commands) + unsigned addr; // latched address + int busyCycles; // when > 0, counts down delay cycles and indicates busy + BOOL locked; // whether the EEPROM is in a locked state +}; + + +#endif // INCLUDED_93C46_H diff --git a/Model3/Bus.h b/Model3/Bus.h new file mode 100644 index 0000000..c5125a5 --- /dev/null +++ b/Model3/Bus.h @@ -0,0 +1,81 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Bus.h + * + * Header file for the CBus abstract base class. + */ + +#ifndef INCLUDED_BUS_H +#define INCLUDED_BUS_H + + +/* + * CBus: + * + * An abstract base class for an address bus. Defines handlers for 8-, 16-, + * 32-, and 64-bit random access. All accesses are big endian. + */ +class CBus +{ +public: + /* + * Read8(addr): + * Read16(addr): + * Read32(addr): + * Read64(addr): + * + * Read handlers. + * + * Parameters: + * addr Address (caller should ensure it is aligned to the correct + * boundary, corresponding to the size). + * + * Returns: + * Data of the appropriate size (8, 16, 32, or 64 bits). + */ + virtual UINT8 Read8(UINT32 addr) = 0; + virtual UINT16 Read16(UINT32 addr) = 0; + virtual UINT32 Read32(UINT32 addr) = 0; + virtual UINT64 Read64(UINT32 addr) = 0; + + /* + * Write8(addr, data): + * Write16(addr, data): + * Write32(addr, data): + * Write64(addr, data): + * + * Write handlers. + * + * Parameters: + * addr Address (caller should ensure it is aligned to the correct + * boundary, corresponding to the size). + * data Data to write. + */ + virtual void Write8(UINT32 addr, UINT8 data) = 0; + virtual void Write16(UINT32 addr, UINT16 data) = 0; + virtual void Write32(UINT32 addr, UINT32 data) = 0; + virtual void Write64(UINT32 addr, UINT64 data) = 0; +}; + + +#endif // INCLUDED_BUS_H diff --git a/Model3/IRQ.cpp b/Model3/IRQ.cpp new file mode 100644 index 0000000..f2af697 --- /dev/null +++ b/Model3/IRQ.cpp @@ -0,0 +1,126 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * IRQ.cpp + * + * Model 3 IRQ controller. Implementation of the CIRQ class. + * + * To-Do List: + * ----------- + * - When a proper OO CPU core is added, the CPU object should be hooked to the + * IRQ controller to assert/deassert the PowerPC IRQ line. Right now, we just + * call the PPC core directly, which should not happen in proper OO code. + */ + +#include "Supermodel.h" + + +/****************************************************************************** + Save States +******************************************************************************/ + +void CIRQ::SaveState(CBlockFile *SaveState) +{ + SaveState->NewBlock("IRQ", __FILE__); + SaveState->Write(&irqEnable, sizeof(irqEnable)); + SaveState->Write(&irqState, sizeof(irqState)); +} + +void CIRQ::LoadState(CBlockFile *SaveState) +{ + if (OKAY != SaveState->FindBlock("IRQ")) + { + ErrorLog("Unable to load IRQ controller state. Save state file is corrupted."); + return; + } + + SaveState->Read(&irqEnable, sizeof(irqEnable)); + SaveState->Read(&irqState, sizeof(irqState)); +} + + +/****************************************************************************** + Emulation Functions +******************************************************************************/ + +void CIRQ::Assert(unsigned irqBits) +{ + irqState |= irqBits; + if ((irqState&irqEnable)) // low 8 bits are maskable interrupts + //ppc_set_irq_line(0); + ppc_set_irq_line(1); + if ((irqState&(~0xFF))) // any non-maskable interrupts pending? + //ppc_set_irq_line(0); + ppc_set_irq_line(1); +} + +//TO-DO: CPU needs to have deassert logic! +void CIRQ::Deassert(unsigned irqBits) +{ + irqState &= ~irqBits; +} + +void CIRQ::WriteIRQEnable(UINT8 data) +{ + irqEnable = (unsigned) data; +} + +UINT8 CIRQ::ReadIRQEnable(void) +{ + return (UINT8) (irqEnable&0xFF); +} + +UINT8 CIRQ::ReadIRQState(void) +{ + return (UINT8) (irqState&0xFF); +} + +void CIRQ::Reset(void) +{ + irqEnable = 0; // disable all + irqState = 0; // no IRQs pending +} + + +/****************************************************************************** + Configuration, Initialization, and Shutdown +******************************************************************************/ + +void CIRQ::Init(void) +{ + // this function really only exists for consistency with other device classes +} + +CIRQ::CIRQ(void) +{ + DebugLog("Built IRQ controller\n"); +} + +/* + * CIRQ::~CIRQ(void): + * + * Destructor. + */ +CIRQ::~CIRQ(void) +{ + DebugLog("Destroyed IRQ controller\n"); +} diff --git a/Model3/IRQ.h b/Model3/IRQ.h new file mode 100644 index 0000000..918d038 --- /dev/null +++ b/Model3/IRQ.h @@ -0,0 +1,148 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * IRQ.h + * + * Header file defining the CIRQ class: Model 3 IRQ controller. + */ + +#ifndef INCLUDED_IRQ_H +#define INCLUDED_IRQ_H + + +/* + * CIRQ: + * + * Model 3 IRQ controller. + */ +class CIRQ +{ +public: + /* + * SaveState(SaveState): + * + * Saves an image of the current device state. + * + * Parameters: + * SaveState Block file to save state information to. + */ + void SaveState(CBlockFile *SaveState); + + /* + * LoadState(SaveState): + * + * Loads and a state image. + * + * Parameters: + * SaveState Block file to load state information from. + */ + void LoadState(CBlockFile *SaveState); + + /* + * Assert(irqBits): + * + * Assert IRQ(s). Also asserts the CPU IRQ line (unless no IRQs are + * actually asserted). The IRQ controller only tracks 8 state bits but for + * non-maskable interrupts, higher bits (bits 9 and above) can be used. + * They will be tracked internally but not visible when external hardware + * tries reading the IRQ state. + * + * Parameters: + * irqBits IRQ bits corresponding to the IRQ state register (1 + * indicates assertion, 0 does nothing). + */ + void Assert(unsigned irqBits); + + /* + * Deassert(irqBits): + * + * Deasserts the specified IRQs and, if there are no pending IRQs left, + * deasserts the CPU IRQ line. + * + * Parameters: + * irqBits IRQ bits corresponding to the IRQ state register (1 + * indicates deassertion, 0 does nothing). + */ + void Deassert(unsigned irqBits); + + /* + * ReadIRQEnable(void): + * + * Returns: + * The 8-bit IRQ enable register. + */ + UINT8 ReadIRQEnable(void); + + /* + * WriteIRQEnable(data): + * + * Write to the IRQ enable register. A 1 indicates the IRQ is enabled. Only + * the first 8 IRQs can be masked. + * + * Parameters: + * data IRQ enable bits (8 bits). + */ + void WriteIRQEnable(UINT8 data); + + /* + * ReadIRQState(void): + * + * Accesses the IRQ state register. Set bits indicate pending IRQs. Only + * the low 8 bits are returned. Any IRQs occupying bits above this are + * effectively invisible and non-maskable. + * + * Returns: + * The 8-bit IRQ state register. + */ + UINT8 ReadIRQState(void); + + /* + * Reset(void): + * + * Resets the IRQ controller. All IRQs are disabled. + */ + void Reset(void); + + /* + * Init(void): + * + * One-time initialization of the context. Must be called prior to all + * other members. + */ + void Init(void); + + /* + * CIRQ(void): + * ~CIRQ(void): + * + * Constructor and destructor. + */ + CIRQ(void); + ~CIRQ(void); + +private: + unsigned irqEnable; // 8 bits, 1=enabled, 0=disabled + unsigned irqState; // bits correspond to irqEnable, 1=pending, 0=not pending +}; + + +#endif // INCLUDED_IRQ_H diff --git a/Model3/MPC10x.cpp b/Model3/MPC10x.cpp new file mode 100644 index 0000000..7475cba --- /dev/null +++ b/Model3/MPC10x.cpp @@ -0,0 +1,357 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * MPC10x.cpp + * + * Implementation of the CMPC10x class: Motorola MPC105 and MPC106 PCI/bridge + * controllers. For now, only a single PCI bus can be attached and all requests + * are forwarded to it. + * + * This is a minimal implementation designed with the Model 3 in mind. It does + * not properly emulate the device and there are numerous inaccuracies in this + * code. + * + * Important Problems To Be Aware Of + * --------------------------------- + * + * The handling of accesses smaller than 32 bits is funky and probably very + * incorrect, particularly for non-32-bit-aligned register numbers. This + * problem extends to the entire PCI emulation. + * + * Little endian mode is not supported (the internal registers, however, seem + * to be stored in little endian format). The registers are implemented as byte + * read/writeable but this is not accurate. In fact, some are read only, and + * some can only be accessed as 16-bit or 32-bit words. + * + * This code assumes we are running on a little endian machine and that the + * PowerPC is a big endian machine. Therefore, bytes can be written to the + * register space directly but multi-byte words must be flipped before being + * interpreted internally. + * + * External configuration registers are not implemented. + * + * Multiple PCI buses are not yet supported (everything is assumed to be on + * bus 0). + * + * ... And lots more! + * + * References + * ---------- + * 1. "MPC106 PCI/Bridge/Memory Controller User's Manual" (MPC106UM/D Rev.1) + * + * To-Do List + * ---------- + * - The whole PCI system desperately needs a re-write to deal with different + * bit-width accesses in a cleaner manner. + * - Fix endian confusion. Should assume everything written is in the correct + * endian, pushing the responsibility onto the caller. + */ + +#include +#include "Supermodel.h" + + +/****************************************************************************** + Save States +******************************************************************************/ + +void CMPC10x::SaveState(CBlockFile *SaveState) +{ + SaveState->NewBlock("MPC10x", __FILE__); + SaveState->Write(regs, sizeof(regs)); + SaveState->Write(&pciBus, sizeof(pciBus)); + SaveState->Write(&pciDevice, sizeof(pciDevice)); + SaveState->Write(&pciFunction, sizeof(pciFunction)); + SaveState->Write(&pciReg, sizeof(pciReg)); +} + +void CMPC10x::LoadState(CBlockFile *SaveState) +{ + if (OKAY != SaveState->FindBlock("MPC10x")) + { + ErrorLog("Unable to load MPC%X state. Save state file is corrupted.", model); + return; + } + + SaveState->Read(regs, sizeof(regs)); + SaveState->Read(&pciBus, sizeof(pciBus)); + SaveState->Read(&pciDevice, sizeof(pciDevice)); + SaveState->Read(&pciFunction, sizeof(pciFunction)); + SaveState->Read(&pciReg, sizeof(pciReg)); +} + + +/****************************************************************************** + Emulation Functions +******************************************************************************/ + +/* + * CMPC10x::WritePCIConfigAddress(data): + * + * Writes to the PCI configuration space address (CONFIG_ADDR) register, which + * selects a PCI device and configuration space register. + */ +void CMPC10x::WritePCIConfigAddress(UINT32 data) +{ + UINT32 d = FLIPENDIAN32(data); + + pciBus = (d>>16)&0xFF; + pciDevice = (d>>11)&0x1F; + pciFunction = (d>>8)&7; + pciReg = d&0xFF; // NOTE: for actual PCI devices (device>0), register must be shifted right by 2 and clamped to 0x3F + + // The manual is unclear as to whether device 0 (MPC10x) register #s are clamped to 0x3F or not. Pay attention to this! +#ifdef DEBUG + if (pciDevice == 0) + { + DebugLog("MPC10x: Device 0 configuration access: %08X\n", d); + if ((d&3)) + ErrorLog("MPC10x: Device 0 configuration address with low bits set: %08X\n", d); + } + //DebugLog("MPC10x: Bus=%X, Device=%X, Function=%X, Reg=%X\n", pciBus, pciDevice, pciFunction, pciReg); +#endif + + if (pciBus != 0) + { + //printf("Multiple PCI buses detected!\n"); + DebugLog("Multiple PCI buses detected!\n"); + } +} + +/* + * CMPC10x::ReadPCIConfigData(bits, offset): + * + * Reads from the PCI configuration space data (CONFIG_DATA) register, which in + * turn calls upon the selected PCI device to return the data. + */ +UINT32 CMPC10x::ReadPCIConfigData(unsigned bits, unsigned offset) +{ + // Handle self-access first + if (pciDevice == 0) + { + // Alignment check +#ifdef DEBUG + if (((bits==16)&&(offset&1)) || ((bits==32)&&(offset&3))) + ErrorLog("Misaligned MPC10x read request (bits=%d,reg=%X,offset=%d)\n", bits, pciReg, offset); +#endif + + switch (bits) + { + case 8: + return regs[pciReg+offset]; + case 16: + return (regs[pciReg+offset+0]<<8) | regs[pciReg+offset+1]; + case 32: + return (regs[pciReg+offset+0]<<24) | + (regs[pciReg+offset+1]<<16) | + (regs[pciReg+offset+2]<<8) | + regs[pciReg+offset+3]; + default: + ErrorLog("MPC10x internal error: invalid access size (%d-bits)", bits); + break; + } + } + + // All other PCI devices passed to PCI bus + return PCIBus->ReadConfigSpace(pciDevice, (pciReg>>2)&0x3C, bits, offset); +} + +/* + * CMPC10x::WritePCIConfigData(bits, offset, data): + * + * Writes to the PCI configuration space data (CONFIG_DATA) register, which in + * turn passes the data to the selected PCI device. + */ +void CMPC10x::WritePCIConfigData(unsigned bits, unsigned offset, UINT32 data) +{ + // Handle self-access first + if (pciDevice == 0) + { + // Alignment check +#ifdef DEBUG + if (((bits==16)&&(offset&1)) || ((bits==32)&&(offset&3))) + ErrorLog("Misaligned MPC10x read request (bits=%d,reg=%X,offset=%d)\n", bits, pciReg, offset); +#endif + + switch (bits) + { + case 8: + regs[pciReg+offset] = data&0xFF; + break; + case 16: + regs[pciReg+offset+0] = (data>>8)&0xFF; + regs[pciReg+offset+1] = data&0xFF; + break; + case 32: + regs[pciReg+offset+0] = (data>>24)&0xFF; + regs[pciReg+offset+1] = (data>>16)&0xFF; + regs[pciReg+offset+2] = (data>>8)&0xFF; + regs[pciReg+offset+3] = data&0xFF; + break; + default: + ErrorLog("MPC10x internal error: invalid access size (%d-bits)", bits); + break; + } + + return; + } + + PCIBus->WriteConfigSpace(pciDevice, (pciReg>>2)&0x3C, bits, offset, data); +} + +/* + * CMPC10x::WriteRegister(reg, data): + * + * Writes to the MPC10x register space. Accesses one byte at a time so it + * should be endian-neutral (the caller ends up being responsible for this). + */ +void CMPC10x::WriteRegister(unsigned reg, UINT8 data) +{ + regs[reg&0xFF] = data; + + if ((reg&0xFF)==0xA8) + { + if ((data&0x20)) + ErrorLog("MPC10x little endian mode not yet implemented!"); + } +} + +/* + * CMPC10x::Reset(void): + * + * Resets the device. + */ +void CMPC10x::Reset(void) +{ + memset(regs, 0, sizeof(regs)); + + // Data is actually stored in little endian format, so we can write directly here + *(UINT16 *) ®s[0x00] = 0x1057; // vendor ID (Motorola) + *(UINT16 *) ®s[0x02] = (model==0x106)?0x0002:0x0001; // device ID (MPC105 or MPC106) + + if (model == 0x106) // MPC106 + { + *(UINT32 *) ®s[0x04] = 0x00800006; // PCI command and PCI status + *(UINT32 *) ®s[0x08] = 0x00060000; // class code and revision ID + *(UINT32 *) ®s[0x0C] = 0x00000800; // cache line size + *(UINT32 *) ®s[0x70] = 0x00CD0000; // output driver control + *(UINT32 *) ®s[0xA8] = 0x0010FF00; // processor interface config. 1 + *(UINT32 *) ®s[0xAC] = 0x060C000C; // processor interface config. 2 + *(UINT32 *) ®s[0xB8] = 0x04000000; // TO-DO: CHECK MANUAL + *(UINT32 *) ®s[0xC0] = 0x00000100; // error enabling 1 + *(UINT32 *) ®s[0xE0] = 0x00420FFF; // emulation support configuration 1 + *(UINT32 *) ®s[0xE8] = 0x00200000; // emulation support configuration 2 + *(UINT32 *) ®s[0xF0] = 0x0000FF02; // memory control config. 1 + *(UINT32 *) ®s[0xF4] = 0x00030000; // memory control config. 2 + *(UINT32 *) ®s[0xFC] = 0x00000010; // memory control config. 4 + } + else // MPC105 + { + *(UINT32 *) ®s[0x04] = 0x00800006; // PCI command and PCI status + *(UINT32 *) ®s[0x08] = 0x00060000; // class code and revision ID + *(UINT32 *) ®s[0xA8] = 0x0010FF00; // processor interface config. 1 + *(UINT32 *) ®s[0xAC] = 0x060C000C; // processor interface config. 2 + *(UINT32 *) ®s[0xB8] = 0x04000000; // TO-DO: CHECK MANUAL + *(UINT32 *) ®s[0xF0] = 0x0000FF02; // memory control config. 1 + *(UINT32 *) ®s[0xF4] = 0x00030000; // memory control config. 2 + *(UINT32 *) ®s[0xFC] = 0x00000010; // memory control config. 4 + // To-do: any more?? + } + + pciBus = 0; + pciDevice = 0; + pciFunction = 0; + pciReg = 0; + + DebugLog("MPC%X reset\n", model); +} + + +/****************************************************************************** + Configuration, Initialization, and Shutdown +******************************************************************************/ + +/* + * CMPC10x:AttachPCIBus(BusObjectPtr): + * + * Attaches a PCI bus object which will handle all PCI register requests. + */ +void CMPC10x::AttachPCIBus(CPCIBus *BusObjectPtr) +{ + PCIBus = BusObjectPtr; + DebugLog("MPC10x connected to a PCI bus\n"); +} + +/* + * CMPC10x::SetModel(modelNum): + * + * Sets the device behavior to either MPC105 or MPC106. + */ +void CMPC10x::SetModel(int modelNum) +{ + model = modelNum; + + if ((modelNum!=0x105) && (modelNum!=0x106)) + { + ErrorLog("%s:%s: Invalid MPC10x model number (%X).", __FILE__, __LINE__, modelNum); + model = 0x105; + } + + DebugLog("MPC10x set to MPC%X\n", model); +} + +/* + * CMPC10x::Init(): + * + * This must be called first and only once during the lifetime of the class. + */ +void CMPC10x::Init(void) +{ + // this function really only exists for consistency with other device classes +} + +/* + * CMPC10x::CMPC10x(void): + * + * Constructor. + */ +CMPC10x::CMPC10x(void) +{ + PCIBus = NULL; + model = 0x105; // default to MPC105 + pciBus = 0; + pciDevice = 0; + pciFunction = 0; + pciReg = 0; + DebugLog("Built MPC10x\n"); +} + +/* + * CMPC10x::~CMPC10x(void): + * + * Destructor. + */ +CMPC10x::~CMPC10x(void) +{ + PCIBus = NULL; + DebugLog("Destroyed MPC10x\n"); +} diff --git a/Model3/MPC10x.h b/Model3/MPC10x.h new file mode 100644 index 0000000..3c310ea --- /dev/null +++ b/Model3/MPC10x.h @@ -0,0 +1,178 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * MPC10x.h + * + * Header file defining the CMPC10x class (Motorola MPC105 and MPC106). + */ + +#ifndef INCLUDED_MPC10X_H +#define INCLUDED_MPC10X_H + + +/* + * CMPC10x: + * + * MPC105 or MPC106 PCI/bridge/memory controller device. + */ +class CMPC10x +{ +public: + /* + * SaveState(SaveState): + * + * Saves an image of the current device state. + * + * Parameters: + * SaveState Block file to save state information to. + */ + void SaveState(CBlockFile *SaveState); + + /* + * LoadState(SaveState): + * + * Loads and a state image. + * + * Parameters: + * SaveState Block file to load state information from. + */ + void LoadState(CBlockFile *SaveState); + + /* + * WritePCIConfigAddress(data): + * + * Writes to the PCI configuration space address (CONFIG_ADDR) register, + * which selects a PCI device and register. For now, only 32-bit accesses + * are supported. + * + * Parameters: + * data Data to write. + */ + void WritePCIConfigAddress(UINT32 data); + + /* + * ReadPCIConfigData(bits, offset): + * + * Reads from the PCI configuration space data (CONFIG_DATA) register, + * which in turn calls upon the selected PCI device to return the data. + * + * Parameters: + * bits Width of access (8, 16, or 32 only). + * offset Byte offset within CONFIG_DATA, aligned to bit width of + * access. For bytes, can be 0, 1, 2, or 3, but for 16-bit + * words can only be 0 or 2. The offset is just the + * CONFIG_DATA address ANDed with 0, 2, or 3 depending on the + * bit width (32, 16, or 8, respectively). + * + * Returns: + * Data from the PCI conifguration space of the presently selected + * device. Bit width will be the same as specified by 'bits'. + */ + UINT32 ReadPCIConfigData(unsigned bits, unsigned offset); + + /* + * WritePCIConfigData(bits, offset, data): + * + * Writes data (CONFIG_DATA) to the presently selected PCI device and + * register. + * + * Parameters: + * bits Width of access (8, 16, or 32 only). + * offset Byte offset within CONFIG_DATA, aligned to bit width of + * access. + * data Data to write. + */ + void WritePCIConfigData(unsigned bits, unsigned offset, UINT32 data); + + /* + * WriteRegister(reg, data): + * + * Writes to the MPC10x's internal registers. + * + * Parameters: + * reg Register (0-255). + * data Data to write. + */ + void WriteRegister(unsigned reg, UINT8 data); + + /* + * Reset(void): + * + * Resets the device. + */ + void Reset(void); + + /* + * AttachPCIBus(BusObjectPtr): + * + * Attaches a PCI bus object which will handle all PCI register accesses. + * For now, only one bus is supported. The MPCI10x will automatically + * handle any requests for device 0 (itself) without passing them on to the + * PCI bus. + * + * Parameters: + * BusObjectPtr A pointer to the PCI bus object. + */ + void AttachPCIBus(CPCIBus *BusObjectPtr); + + /* + * SetModel(modelNum): + * + * Selects either MPC105 or MPC106 behavior. This will also reset the + * device state by calling Reset(). This should be called prior to any + * other emulation functions and after Init(). + * + * Parameters: + * modelNum Either 0x105 for MPC105 or 0x106 for MPC106. Defaults + * to MPC105 if unrecognized. + */ + void SetModel(int modelNum); + + /* + * Init(void): + * + * One-time initialization of the context. Must be called prior to all + * other members. By default, initializes to MPC105. + */ + void Init(void); + + /* + * CMPC10x(void): + * ~CMPC10x(void): + * + * Constructor and destructor for MPC10x class. + */ + CMPC10x(void); + ~CMPC10x(void); + +private: + int model; // MPC105 = 0x105 (default), MPC106 = 0x106 + CPCIBus *PCIBus; // the PCI bus to which this MPC10x is attached + UINT8 regs[256]; // internal registers + unsigned pciBus; // PCI bus component of PCI address setting (8 bits) + unsigned pciDevice; // PCI device component (5 bits) + unsigned pciFunction; // PCI function component (3 bits) + unsigned pciReg; // PCI register component (7 bits) +}; + + +#endif // INCLUDED_MPC10X_H diff --git a/Model3/Model3.cpp b/Model3/Model3.cpp new file mode 100644 index 0000000..1669628 --- /dev/null +++ b/Model3/Model3.cpp @@ -0,0 +1,2363 @@ +int midiCtrlPort=0, midiPort=0; +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Model3.cpp + * + * Implementation of the CModel3 class: a complete Model 3 machine. + * + * To-Do List + * ---------- + * - ROM sets should probably be handled with a class that manages ROM + * loading, the game list, as well as ROM patching + * - Wrap up CPU emulation inside a class (hah!) + * - Update the to-do list! I forgot lots of other stuff here :) + * + * PowerPC Address Map (may be slightly out of date/incomplete) + * ------------------- + * 00000000-007FFFFF RAM + * 84000000-8400003F Real3D Status Registers + * 88000000-88000007 Real3D Command Port + * 8C000000-8C3FFFFF Real3D Culling RAM (Low) + * 8E000000-8E0FFFFF Real3D Culling RAM (High) + * 90000000-9000000B Real3D VROM Texture Port + * 94000000-940FFFFF Real3D Texture FIFO + * 98000000-980FFFFF Real3D Polygon RAM + * C0000000-C00000FF SCSI (Step 1.x) + * C1000000-C10000FF SCSI (Step 1.x) (Lost World expects it here) + * C2000000-C20000FF Real3D DMA (Step 2.x) + * F0040000-F004003F Input (Controls) Registers + * F0080000-F0080007 Sound Board Registers + * F00C0000-F00DFFFF Backup RAM + * F0100000-F010003F System Registers + * F0140000-F014003F Real-Time Clock + * F0180000-F019FFFF Security Board RAM + * F01A0000-F01A003F Security Board Registers + * F0800CF8-F0800CFF MPC105 CONFIG_ADDR (Step 1.x) + * F0C00CF8-F0800CFF MPC105 CONFIG_DATA (Step 1.x) + * F1000000-F10F7FFF Tile Generator Pattern Table + * F10F8000-F10FFFFF Tile Generator Name Table + * F1100000-F111FFFF Tile Generator Palette + * F1180000-F11800FF Tile Generator Registers + * F8FFF000-F8FFF0FF MPC105 (Step 1.x) or MPC106 (Step 2.x) Registers + * F9000000-F90000FF NCR 53C810 Registers (Step 1.x?) + * FEC00000-FEDFFFFF MPC106 CONFIG_ADDR (Step 2.x) + * FEE00000-FEFFFFFF MPC106 CONFIG_DATA (Step 2.x) + * FF000000-FF7FFFFF Banked CROM (CROMxx) + * FF800000-FFFFFFFF Fixed CROM + * + * Endianness + * ---------- + * We assume a little endian machine and so for speed, PowerPC RAM and ROM + * regions are byte reversed, which means that aligned words can be read and + * written without any conversion. Problems arise when the PowerPC accesses + * little endian devices, like the tile generator, MPC10x, or Real3D. Then, the + * access must be carried out carefully one byte at a time or by manually byte + * reversing first (because the PowerPC will already have byte reversed it). + * + * System Registers + * ---------------- + * + * F0100014: IRQ Enable + * 7 6 5 4 3 2 1 0 + * +---+---+---+---+---+---+---+---+ + * | ? |SND| ? |NET|VD3|VD2|VBL|VD0| + * +---+---+---+---+---+---+---+---+ + * SND SCSP (sound) + * NET Network + * VD3 Unknown video-related + * VD2 Unknown video-related + * VBL VBlank start + * VD0 Unknown video-related (?) + * 0 = Disable, 1 = Enable + * + * Game Buttons + * ------------ + * + * For further information, see ReadInputs(). + * + * Offset 0x04, bank 0: + * + * 7 6 5 4 3 2 1 0 + * +---+---+---+---+---+---+---+---+ + * | ? | ? |ST2|ST1|SVA|TSA|CN2|CN1| + * +---+---+---+---+---+---+---+---+ + * CNx Coin 1, Coin 2 + * TSA Test Button A + * SVA Service Button A + * STx Start 1, Start 2 + * + * Offset 0x04, bank 1: + * + * 7 6 5 4 3 2 1 0 + * +---+---+---+---+---+---+---+---+ + * |TSB|SVB|EEP| ? | ? | ? | ? | ? | + * +---+---+---+---+---+---+---+---+ + * EEP Mapped to EEPROM (values written here are ignored) + * SVB Service Button B + * TSB Test Button B + * + * Offset 0x08: + * + * 7 6 5 4 3 2 1 0 + * +---+---+---+---+---+---+---+---+ + * |G27|G26|G25|G24|G23|G22|G21|G20| + * +---+---+---+---+---+---+---+---+ + * G2x Game-specific + * + * Offset 0x0C: + * + * 7 6 5 4 3 2 1 0 + * +---+---+---+---+---+---+---+---+ + * |G37|G36|G35|G34|G33|G32|G31|G30| + * +---+---+---+---+---+---+---+---+ + * G3x Game-specific + * + * Game-specific buttons: + * + * Scud Race: + * G27 --- + * G26 Shift 2 when combined w/ G25, Shift 1 when combined w/ G24 + * G25 Shift 4 + * G24 Shift 3 + * G23 VR4 Green + * G22 VR3 Yellow + * G21 VR2 Blue + * G20 VR1 Red + * + * Virtua Fighter 3, Fighting Vipers 2: + * G27 Right + * G26 Left + * G25 Down + * G24 Up + * G23 Punch + * G22 Kick + * G21 Guard + * G20 Escape (VF3 only) + * + * Sega Rally 2: + * G21 Hand Brake + * G20 View Change + * + * Lost World, LA Machineguns: + * G20 Gun trigger + * + * Star Wars Trilogy: + * G20 Event button + * G25 Trigger + * + * Virtual On 2: + * G27 Left Lever Left + * G26 Left Lever Right + * G25 Left Lever Up + * G24 Left Lever Down + * G23 --- + * G22 --- + * G21 Left Turbo + * G20 Left Shot Trigger + * G37 Right Lever Left + * G36 Right Lever Right + * G35 Right Lever Up + * G34 Right Lever Down + * G33 --- + * G32 --- + * G31 Right Turbo + * G30 Right Shot Trigger + */ + +#include +#include +#include +#include +#include "Supermodel.h" + +/****************************************************************************** + Model 3 Inputs + + Game controls. The EEPROM is mapped here as well. +******************************************************************************/ + +UINT8 CModel3::ReadInputs(unsigned reg) +{ + UINT8 adc[8]; + UINT8 data; + + reg &= 0x3F; + switch (reg) + { + case 0x00: // input bank + return inputBank; + + case 0x04: // current input bank + + data = 0xFF; + + if ((inputBank&1) == 0) + { + data &= ~(Inputs->coin[0]->value); // Coin 1 + data &= ~(Inputs->coin[1]->value<<1); // Coin 2 + data &= ~(Inputs->test[0]->value<<2); // Test A + data &= ~(Inputs->service[0]->value<<3); // Service A + data &= ~(Inputs->start[0]->value<<4); // Start 1 + data &= ~(Inputs->start[1]->value<<5); // Start 2 + } + else + { + data &= ~(Inputs->service[1]->value<<6); // Service B + data &= ~(Inputs->test[1]->value<<7); // Test B + data = (data&0xDF)|(EEPROM.Read()<<5); // bank 1 contains EEPROM data bit + } + return data; + + case 0x08: // game-specific inputs + + data = 0xFF; + + if ((Game->inputFlags&GAME_INPUT_JOYSTICK1)) + { + data &= ~(Inputs->up[0]->value<<5); // P1 Up + data &= ~(Inputs->down[0]->value<<4); // P1 Down + data &= ~(Inputs->left[0]->value<<7); // P1 Left + data &= ~(Inputs->right[0]->value<<6); // P1 Right + } + + if ((Game->inputFlags&GAME_INPUT_FIGHTING)) + { + data &= ~(Inputs->escape[0]->value<<3); // P1 Escape + data &= ~(Inputs->guard[0]->value<<2); // P1 Guard + data &= ~(Inputs->kick[0]->value<<1); // P1 Kick + data &= ~(Inputs->punch[0]->value<<0); // P1 Punch + } + + if ((Game->inputFlags&GAME_INPUT_SOCCER)) + { + data &= ~(Inputs->shortPass[0]->value<<2); // P1 Short Pass + data &= ~(Inputs->longPass[0]->value<<0); // P1 Long Pass + data &= ~(Inputs->shoot[0]->value<<1); // P1 Shoot + } + + if ((Game->inputFlags&GAME_INPUT_VR)) + { + data &= ~(Inputs->vr[0]->value<<0); // VR1 Red + data &= ~(Inputs->vr[1]->value<<1); // VR2 Blue + data &= ~(Inputs->vr[2]->value<<2); // VR3 Yellow + data &= ~(Inputs->vr[3]->value<<3); // VR4 Green + } + + if ((Game->inputFlags&GAME_INPUT_SHIFT4)) + { + if (Inputs->gearShift4->value == 2) // Shift 2 + data &= ~0x60; + else if (Inputs->gearShift4->value == 4) // Shift 4 + data &= ~0x20; + if (Inputs->gearShift4->value == 1) // Shift 1 + data &= ~0x50; + else if (Inputs->gearShift4->value == 3) // Shift 3 + data &= ~0x10; + } + + if ((Game->inputFlags&GAME_INPUT_RALLY)) + { + data &= ~(Inputs->viewChange->value<<0); // View change + data &= ~(Inputs->handBrake->value<<1); // Hand brake + } + + if ((Game->inputFlags&GAME_INPUT_GUN1)) + data &= ~(Inputs->trigger[0]->value<<0); // P1 Trigger + + if ((Game->inputFlags&GAME_INPUT_ANALOG_JOYSTICK)) + { + data &= ~(Inputs->analogJoyTrigger->value<<5); // Trigger + data &= ~(Inputs->analogJoyEvent->value<<0); // Event Button + } + + if ((Game->inputFlags&GAME_INPUT_TWIN_JOYSTICKS)) // First twin joystick + { + /* + * Forward/reverse/turn are mutually exclusive. + * + * Turn Left: 1D 2U + * Turn Right: 1U 2D + * Forward: 1U 2U + * Reverse: 1D 2D + */ + if (Inputs->twinJoyTurnLeft->value) + data &= ~0x10; + else if (Inputs->twinJoyTurnRight->value) + data &= ~0x20; + else if (Inputs->twinJoyForward->value) + data &= ~0x20; + else if (Inputs->twinJoyReverse->value) + data &= ~0x10; + + /* + * Strafe/crouch/jump are mutually exclusive. + * + * Strafe Left: 1L 2L + * Strafe Right: 1R 2R + * Jump: 1L 2R + * Crouch: 1R 2L + */ + if (Inputs->twinJoyStrafeLeft->value) + data &= ~0x80; + else if (Inputs->twinJoyStrafeRight->value) + data &= ~0x40; + else if (Inputs->twinJoyJump->value) + data &= ~0x80; + else if (Inputs->twinJoyCrouch->value) + data &= ~0x40; + + // Shot trigger and Turbo + data &= ~(Inputs->twinJoyLeftShot->value<<0); + data &= ~(Inputs->twinJoyLeftTurbo->value<<1); + } + + return data; + + case 0x0C: // game-specific inputs + data = 0xFF; + + if ((Game->inputFlags&GAME_INPUT_JOYSTICK2)) + { + data &= ~(Inputs->up[1]->value<<5); // P2 Up + data &= ~(Inputs->down[1]->value<<4); // P2 Down + data &= ~(Inputs->left[1]->value<<7); // P2 Left + data &= ~(Inputs->right[1]->value<<6); // P2 Right + } + + if ((Game->inputFlags&GAME_INPUT_FIGHTING)) + { + data &= ~(Inputs->escape[1]->value<<3); // P2 Escape + data &= ~(Inputs->guard[1]->value<<2); // P2 Guard + data &= ~(Inputs->kick[1]->value<<1); // P2 Kick + data &= ~(Inputs->punch[1]->value<<0); // P2 Punch + } + + if ((Game->inputFlags&GAME_INPUT_SOCCER)) + { + data &= ~(Inputs->shortPass[1]->value<<2); // P2 Short Pass + data &= ~(Inputs->longPass[1]->value<<0); // P2 Long Pass + data &= ~(Inputs->shoot[1]->value<<1); // P2 Shoot + } + + if ((Game->inputFlags&GAME_INPUT_TWIN_JOYSTICKS)) // Second twin joystick (see register 0x08 for comments) + { + if (Inputs->twinJoyTurnLeft->value) + data &= ~0x20; + else if (Inputs->twinJoyTurnRight->value) + data &= ~0x10; + else if (Inputs->twinJoyForward->value) + data &= ~0x20; + else if (Inputs->twinJoyReverse->value) + data &= ~0x10; + + if (Inputs->twinJoyStrafeLeft->value) + data &= ~0x80; + else if (Inputs->twinJoyStrafeRight->value) + data &= ~0x40; + else if (Inputs->twinJoyJump->value) + data &= ~0x40; + else if (Inputs->twinJoyCrouch->value) + data &= ~0x80; + + data &= ~(Inputs->twinJoyRightShot->value<<0); + data &= ~(Inputs->twinJoyRightTurbo->value<<1); + } + + if ((Game->inputFlags&GAME_INPUT_GUN2)) + data &= ~(Inputs->trigger[1]->value<<0); // P2 Trigger + + return data; + + case 0x2C: // Serial FIFO 1 + return serialFIFO1; + + case 0x30: // Serial FIFO 2 + return serialFIFO2; + + case 0x34: // Serial FIFO full/empty flags + return 0x0C; + + case 0x3C: // ADC + + // Load ADC channels with input data + memset(adc, 0, sizeof(adc)); + if ((Game->inputFlags&GAME_INPUT_VEHICLE)) + { + adc[0] = (UINT8)Inputs->steering->value; + adc[1] = (UINT8)Inputs->accelerator->value; + adc[2] = (UINT8)Inputs->brake->value; + } + if ((Game->inputFlags&GAME_INPUT_ANALOG_JOYSTICK)) + { + adc[0] = (UINT8)Inputs->analogJoyY->value; + adc[1] = (UINT8)Inputs->analogJoyX->value; + } + + // Read out appropriate channel + data = adc[adcChannel&7]; + ++adcChannel; + return data; + + default: + break; + } + + return 0xFF; // controls are active low +} + +void CModel3::WriteInputs(unsigned reg, UINT8 data) +{ + switch (reg&0x3F) + { + case 0: + EEPROM.Write((data>>6)&1,(data>>7)&1,(data>>5)&1); + inputBank = data; + break; + case 0x24: // Serial FIFO 1 + switch (data) // Command + { + case 0x00: // Light gun register select + gunReg = serialFIFO2; + break; + case 0x87: // Read light gun register + serialFIFO1 = 0; // clear serial FIFO 1 + serialFIFO2 = 0; + if ((Game->inputFlags&GAME_INPUT_GUN1||Game->inputFlags&GAME_INPUT_GUN2)) + { + switch (gunReg) + { + case 0: // Player 1 gun Y (low 8 bits) + serialFIFO2 = Inputs->gunY[0]->value&0xFF; + break; + case 1: // Player 1 gun Y (high 2 bits) + serialFIFO2 = (Inputs->gunY[0]->value>>8)&3; + break; + case 2: // Player 1 gun X (low 8 bits) + serialFIFO2 = Inputs->gunX[0]->value&0xFF; + break; + case 3: // Player 1 gun X (high 2 bits) + serialFIFO2 = (Inputs->gunX[0]->value>>8)&3; + break; + case 4: // Player 2 gun Y (low 8 bits) + serialFIFO2 = Inputs->gunY[1]->value&0xFF; + break; + case 5: // Player 2 gun Y (high 2 bits) + serialFIFO2 = (Inputs->gunY[1]->value>>8)&3; + break; + case 6: // Player 2 gun X (low 8 bits) + serialFIFO2 = Inputs->gunX[1]->value&0xFF; + break; + case 7: // Player 2 gun X (high 2 bits) + serialFIFO2 = (Inputs->gunX[1]->value>>8)&3; + break; + case 8: // Off-screen indicator (bit 0 = player 1, bit 1 = player 2, set indicates off screen) + serialFIFO2 = (Inputs->offscreen[1]->value<<1)|Inputs->offscreen[0]->value; + break; + default: + DebugLog("Unknown gun register: %X\n", gunReg); + break; + } + } + break; + default: + DebugLog("Uknown command to serial FIFO: %02X\n", data); + break; + } + break; + case 0x28: // Serial FIFO 2 + serialFIFO2 = data; + break; + case 0x3C: + adcChannel = data&7; + break; + default: + break; + } + //printf("Controls: %X=%02X\n", reg, data); +} + + +/****************************************************************************** + Model 3 Security Device + + The security device is present in some games. Virtual On 2 reads tile pattern + data from it. +******************************************************************************/ + +static const UINT16 vs298Security[] = +{ + 0x0000, // dummy read + 0x4A20, 0x5041, 0x4E41, 0x4920, 0x4154, 0x594C, 0x4220, 0x4152, 0x4953, 0x204C, + 0x5241, 0x4547, 0x544E, 0x4E49, 0x2041, 0x4547, 0x4D52, 0x4E41, 0x2059, 0x4E45, + 0x4C47, 0x4E41, 0x2044, 0x454E, 0x4854, 0x5245, 0x414C, 0x444E, 0x2053, 0x5246, + 0x4E41, 0x4543, 0x4320, 0x4C4F, 0x4D4F, 0x4942, 0x2041, 0x4150, 0x4152, 0x5547, + 0x5941, 0x4220, 0x4C55, 0x4147, 0x4952, 0x2041, 0x5053, 0x4941, 0x204E, 0x5243, + 0x414F, 0x4954, 0x2041, 0x4542, 0x474C, 0x5549, 0x204D, 0x494E, 0x4547, 0x4952, + 0x2041, 0x4153, 0x4455, 0x2049, 0x4F4B, 0x4552, 0x2041, 0x4544, 0x4D4E, 0x5241, + 0x204B, 0x4F52, 0x414D, 0x494E, 0x2041, 0x4353, 0x544F, 0x414C, 0x444E, 0x5520, + 0x4153, 0x5320, 0x554F, 0x4854, 0x4641, 0x4952, 0x4143, 0x4D20, 0x5845, 0x4349, + 0x204F, 0x5559, 0x4F47, 0x4C53, 0x5641, 0x4149, 0x4620, 0x5F43, 0x4553, 0x4147 +}; + +static const UINT16 ecaSecurity[] = +{ + 0x0000, + 0x2d2f, 0x202d, 0x4d45, 0x5245, 0x4547, 0x434e, 0x2059, 0x4143, + 0x4c4c, 0x4120, 0x424d, 0x4c55, 0x4e41, 0x4543, 0x2d20, 0x0a2d, + 0x6f43, 0x7970, 0x6952, 0x6867, 0x2074, 0x4553, 0x4147, 0x4520, + 0x746e, 0x7265, 0x7270, 0x7369, 0x7365, 0x202c, 0x744c, 0x2e64, + 0x530a, 0x666f, 0x7774, 0x7261, 0x2065, 0x2652, 0x2044, 0x6544, + 0x7470, 0x202e, 0x3123, 0x660a, 0x726f, 0x7420, 0x7365, 0x0a74, +}; + +static const UINT16 oceanhunSecurity[57] = +{ + 0x0000, // dummy read + + 0x3d3d, 0x203d, 0x434f, 0x4145, 0x204e, 0x5548, 0x544e, 0x5245, + 0x3d20, 0x3d3d, 0x430a, 0x706f, 0x5279, 0x6769, 0x7468, 0x5320, + 0x4745, 0x2041, 0x6e45, 0x6574, 0x7072, 0x6972, 0x6573, 0x2c73, + 0x4c20, 0x6474, 0x0a2e, 0x6d41, 0x7375, 0x6d65, 0x6e65, 0x2074, + 0x2652, 0x2044, 0x6544, 0x7470, 0x202e, 0x3123, 0x4b0a, 0x7a61, + 0x6e75, 0x7261, 0x2069, 0x7354, 0x6b75, 0x6d61, 0x746f, 0x206f, + 0x6553, 0x7463, 0x6f69, 0x206e, 0x614d, 0x616e, 0x6567, 0x0a72 +}; + +static const UINT16 swtrilgySecurity[57] = +{ + 0xffff, + 0x3d3d, 0x3d3d, 0x203d, 0x5453, 0x5241, 0x5720, 0x5241, 0x2053, + 0x3d3d, 0x3d3d, 0x0a3d, 0x6f43, 0x7970, 0x6952, 0x6867, 0x2074, + 0x4553, 0x4147, 0x4520, 0x746e, 0x7265, 0x7270, 0x7369, 0x7365, + 0x202c, 0x744c, 0x2e64, 0x410a, 0x756d, 0x6573, 0x656d, 0x746e, + 0x5220, 0x4426, 0x4420, 0x7065, 0x2e74, 0x2320, 0x3231, 0x4b0a, + 0x7461, 0x7573, 0x6179, 0x7573, 0x4120, 0x646e, 0x206f, 0x2026, + 0x614b, 0x6f79, 0x6f6b, 0x5920, 0x6d61, 0x6d61, 0x746f, 0x0a6f +}; + +static const UINT16 fvipers2Security[65] = +{ + 0x2a2a, + 0x2a2a, 0x2a2a, 0x2a2a, 0x2a2a, 0x2a2a, 0x2a2a, 0x202a, 0x5b5b, + 0x4620, 0x6769, 0x7468, 0x6e69, 0x2067, 0x6956, 0x6570, 0x7372, + 0x3220, 0x5d20, 0x205d, 0x6e69, 0x3c20, 0x4d3c, 0x444f, 0x4c45, + 0x332d, 0x3e3e, 0x4320, 0x706f, 0x7279, 0x6769, 0x7468, 0x2820, + 0x2943, 0x3931, 0x3839, 0x5320, 0x4745, 0x2041, 0x6e45, 0x6574, + 0x7072, 0x6972, 0x6573, 0x2c73, 0x544c, 0x2e44, 0x2020, 0x4120, + 0x6c6c, 0x7220, 0x6769, 0x7468, 0x7220, 0x7365, 0x7265, 0x6576, + 0x2e64, 0x2a20, 0x2a2a, 0x2a2a, 0x2a2a, 0x2a2a, 0x2a2a, 0x2a2a +}; + +UINT32 CModel3::ReadSecurity(unsigned reg) +{ + UINT32 data; + + switch (reg) + { + case 0x00: // Status + return 0; + case 0x1C: // Data + + if (!strcmp(Game->id, "vs298")) + { + data = (vs298Security[securityPtr++] << 16); + securityPtr %= (sizeof(vs298Security)/sizeof(UINT16)); + } + else if (!strcmp(Game->id, "eca")) + { + data = (ecaSecurity[securityPtr++] << 16); + securityPtr %= (sizeof(ecaSecurity)/sizeof(UINT16)); + } + else if (!strcmp(Game->id, "oceanhun")) + { + data = (oceanhunSecurity[securityPtr++] << 16); + securityPtr %= (sizeof(oceanhunSecurity)/sizeof(UINT16)); + } + else if (!strcmp(Game->id, "swtrilgy") || !strcmp(Game->id, "swtrilgya")) + { + data = (swtrilgySecurity[securityPtr++] << 16); + securityPtr %= (sizeof(swtrilgySecurity)/sizeof(UINT16)); + } + else if (!strcmp(Game->id, "fvipers2")) + { + data = (fvipers2Security[securityPtr++] << 16); + securityPtr %= (sizeof(fvipers2Security)/sizeof(UINT16)); + } + else if (!strcmp(Game->id, "von2")) + data = 0xFFFFFFFF; + else + { + data = 0xFFFFFFFF; + //ErrorLog("Protection device for %s not yet implemented!", Game->title); + DebugLog("Security read: reg=%X, PC=%08X, LR=%08X\n", reg, ppc_get_pc(), ppc_get_lr()); + } + return data; + default: + DebugLog("Security read: reg=%X\n", reg); + break; + } + + return 0xFFFFFFFF; +} + +void CModel3::WriteSecurity(unsigned reg, UINT32 data) +{ + DebugLog("Security write: reg=%X, data=%08X\n", reg, data); +} + + +/****************************************************************************** + PCI Devices + + Unknown PCI devices are handled here. +******************************************************************************/ + +UINT32 CModel3::ReadPCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned offset) +{ + if ((bits==8) || (bits==16)) + { + DebugLog("Model 3: %d-bit PCI read request for reg=%02X\n", bits, reg); + return 0; + } + + switch (device) + { + case 16: // Used by Daytona 2 + switch (reg) + { + case 0: // PCI vendor and device ID + return 0x182711DB; + default: + break; + } + default: + break; + } + + DebugLog("Model 3: PCI %d-bit write request for device=%d, reg=%02X\n", bits, device, reg); + return 0; +} + +void CModel3::WritePCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned offset, UINT32 data) +{ + DebugLog("Model 3: PCI %d-bit write request for device=%d, reg=%02X, data=%08X\n", bits, device, reg, data); +} + + +/****************************************************************************** + Model 3 System Registers + + NOTE: Proper IRQ handling requires a "deassert" function in the PowerPC core, + which the interpreter presently lacks. This is because different modules that + generate IRQs, like the tilegen, Real3D, and SCSP, should each call + IRQ.Assert() on their own, which will assert the CPU IRQ line. Right now, + the CPU processes an interrupt and clears the line by itself, which means that + if multiple interrupts are asserted simultaneously, depending on the IRQ + handler code, only one may be processed. Keep an eye on this! +******************************************************************************/ + +// Set the CROM bank index (active low logic) +void CModel3::SetCROMBank(unsigned idx) +{ + cromBankReg = idx; + idx = (~idx) & 0xF; + cromBank = &crom[0x800000 + (idx*0x800000)]; + DebugLog("CROM bank setting: %d (%02X), PC=%08X, LR=%08X\n", idx, cromBankReg, ppc_get_pc(), ppc_get_lr()); +// printf("CROM bank setting: %d (%02X), PC=%08X, LR=%08X\n", idx, cromBankReg, ppc_get_pc(), ppc_get_lr()); +} + +UINT8 CModel3::ReadSystemRegister(unsigned reg) +{ + switch (reg&0x3F) + { + case 0x08: // CROM bank + return cromBankReg; + case 0x14: // IRQ enable + return IRQ.ReadIRQEnable(); + case 0x18: // IRQ pending + return IRQ.ReadIRQState(); + case 0x1C: // unknown (apparently expects some or all bits set) + //DebugLog("System register %02X read\n", reg); + return 0xFF; + case 0x10: // JTAG Test Access Port + return (GPU.ReadTAP()<< 5); + default: + //DebugLog("System register %02X read\n", reg); + break; + } + + return 0xFF; +} + +void CModel3::WriteSystemRegister(unsigned reg, UINT8 data) +{ + switch (reg&0x3F) + { + case 0x08: // CROM bank + SetCROMBank(data); + break; + case 0x14: // IRQ enable + IRQ.WriteIRQEnable(data); + DebugLog("IRQ ENABLE=%02X\n", data); + break; + case 0x18: // IRQ acknowledge + DebugLog("IRQ SETTING! %02X=%02X\n", reg, data); + break; + case 0x0C: // JTAG Test Access Port + GPU.WriteTAP((data>>6)&1,(data>>2)&1,(data>>5)&1,(data>>7)&1); // TCK, TMS, TDI, TRST + break; + case 0x0D: + case 0x0E: + case 0x0F: + case 0x1C: // LED control? + break; + default: + //DebugLog("System register %02X=%02X\n", reg, data); + break; + } +} + + +/****************************************************************************** + Optimized Address Space Access Handlers + + Although I have not yet profiled the code, these ought to be more optimal, + especially if the compiler can generate jump tables. + + NOTE: Testing of some of the address ranges is not strict enough, especially + for the MPC10x. Write32() handles the MPC10x most correctly. For now, + accesses outside of the handled ranges have not been observed. Use the DEBUG + version of these handlers for validation of new games. +******************************************************************************/ + +#ifndef DEBUG + +/* + * CModel3::Read8(addr): + * CModel3::Read16(addr): + * CModel3::Read32(addr): + * CModel3::Read64(addr): + * + * Read handlers. + */ +UINT8 CModel3::Read8(UINT32 addr) +{ + // RAM (most frequently accessed) + if (addr<0x00800000) + return ram[addr^3]; + + // Other + switch ((addr>>24)) + { + // CROM + case 0xFF: + if (addr < 0xFF800000) + return cromBank[(addr&0x7FFFFF)^3]; + else + return crom[(addr&0x7FFFFF)^3]; + + // Real3D DMA + case 0xC2: + return GPU.ReadDMARegister8(addr&0xFF); + + // Various + case 0xF0: + case 0xFE: // mirror + + switch ((addr>>16)&0xFF) + { + // Inputs + case 0x04: + return ReadInputs(addr&0x3F); + + // Sound Board + case 0x08: + printf("Read8 %08X\n", addr); + break; + + // System registers + case 0x10: + return ReadSystemRegister(addr&0x3F); + + // RTC + case 0x14: + if ((addr&3)==1) // battery voltage test + return 0x03; + else if ((addr&3)==0) + return RTC.ReadRegister((addr>>2)&0xF); + return 0; + + // Unknown + default: + break; + } + + break; + + // 53C810 SCSI + case 0xC0: // only on Step 1.0 + if (Game->step != 0x10) // check for Step 1.0 + break; + case 0xF9: + case 0xC1: + return SCSI.ReadRegister(addr&0xFF); + + // Unknown + default: + break; + } + + DebugLog("PC=%08X\tread8 : %08X\n", ppc_get_pc(), addr); + return 0xFF; +} + +UINT16 CModel3::Read16(UINT32 addr) +{ + UINT16 data; + + if ((addr&1)) + { + data = Read8(addr+0)<<8; + data |= Read8(addr+1); + return data; + } + + // RAM (most frequently accessed) + if (addr<0x00800000) + return *(UINT16 *) &ram[addr^2]; + + // Other + switch ((addr>>24)) + { + // CROM + case 0xFF: + if (addr < 0xFF800000) + return *(UINT16 *) &cromBank[(addr&0x7FFFFF)^2]; + else + return *(UINT16 *) &crom[(addr&0x7FFFFF)^2]; + + // Various + case 0xF0: + case 0xFE: // mirror + + switch ((addr>>16)&0xFF) + { + // Backup RAM + case 0x0C: + case 0x0D: + return *(UINT16 *) &backupRAM[(addr&0x1FFFF)^2]; + + // Sound Board + case 0x08: + printf("Read16 %08X\n", addr); + break; + + // MPC105 + case 0xC0: // F0C00CF8 + return PCIBridge.ReadPCIConfigData(16,addr&3); + + // MPC106 + case 0xE0: + case 0xE1: + case 0xE2: + case 0xE3: + case 0xE4: + case 0xE5: + case 0xE6: + case 0xE7: + case 0xE8: + case 0xE9: + case 0xEA: + case 0xEB: + case 0xEC: + case 0xED: + case 0xEE: + case 0xEF: + return PCIBridge.ReadPCIConfigData(16,addr&3); + + // Unknown + default: + break; + } + + break; + + // Unknown + default: + break; + } + + DebugLog("PC=%08X\tread16: %08X\n", ppc_get_pc(), addr); + return 0xFFFF; +} + +UINT32 CModel3::Read32(UINT32 addr) +{ + UINT32 data; + + if ((addr&3)) + { + data = Read16(addr+0)<<16; + data |= Read16(addr+2); + return data; + } + + // RAM (most frequently accessed) + if (addr < 0x00800000) + return *(UINT32 *) &ram[addr]; + + // Other + switch ((addr>>24)) + { + // CROM + case 0xFF: + if (addr < 0xFF800000) + return *(UINT32 *) &cromBank[(addr&0x7FFFFF)]; + else + return *(UINT32 *) &crom[(addr&0x7FFFFF)]; + + // Real3D registers + case 0x84: + return GPU.ReadRegister(addr&0x3F); + + // Real3D DMA + case 0xC2: + data = GPU.ReadDMARegister32(addr&0xFF); + return FLIPENDIAN32(data); + + // Various + case 0xF0: + case 0xFE: // mirror + + switch ((addr>>16)&0xFF) + { + // Inputs + case 0x04: + data = ReadInputs((addr&0x3F)+0) << 24; + data |= ReadInputs((addr&0x3F)+1) << 16; + data |= ReadInputs((addr&0x3F)+2) << 8; + data |= ReadInputs((addr&0x3F)+3) << 0; + return data; + + // Sound Board + case 0x08: + printf("Read32 %08X\n", addr); + break; + + // Backup RAM + case 0x0C: + case 0x0D: + return *(UINT32 *) &backupRAM[(addr&0x1FFFF)]; + + // System registers + case 0x10: + data = ReadSystemRegister((addr&0x3F)+0) << 24; + data |= ReadSystemRegister((addr&0x3F)+1) << 16; + data |= ReadSystemRegister((addr&0x3F)+2) << 8; + data |= ReadSystemRegister((addr&0x3F)+3) << 0; + return data; + + // MPC105 + case 0xC0: // F0C00CF8 + return PCIBridge.ReadPCIConfigData(32,0); + + // MPC106 + case 0xE0: + case 0xE1: + case 0xE2: + case 0xE3: + case 0xE4: + case 0xE5: + case 0xE6: + case 0xE7: + case 0xE8: + case 0xE9: + case 0xEA: + case 0xEB: + case 0xEC: + case 0xED: + case 0xEE: + case 0xEF: + return PCIBridge.ReadPCIConfigData(32,0); + + // RTC + case 0x14: + data = (RTC.ReadRegister((addr>>2)&0xF) << 24); + data |= 0x00030000; // set these bits to pass battery voltage test + return data; + + // Security board RAM + case 0x18: + case 0x19: + return *(UINT32 *) &securityRAM[(addr&0x1FFFF)]; // so far, only 32-bit access observed, so we use little endian access + + // Security board registers + case 0x1A: + return ReadSecurity(addr&0x3F); + + // Unknown + default: + break; + } + + break; + + // Tile generator + case 0xF1: + if (addr==0xF1180000) // fixes 2D graphics (TO-DO: integrate register reads into TileGen.cpp) + return 0; + + // Tile generator accesses its RAM as little endian, must flip for big endian PowerPC + if (addr < 0xF1120000) + { + data = TileGen.ReadRAM(addr&0x1FFFFF); + return FLIPENDIAN32(data); + } + + break; + + // 53C810 SCSI + case 0xC0: // only on Step 1.0 + if (Game->step != 0x10) // check for Step 1.0 + break; + case 0xF9: + case 0xC1: + data = (SCSI.ReadRegister((addr+0)&0xFF) << 24); + data |= (SCSI.ReadRegister((addr+1)&0xFF) << 16); + data |= (SCSI.ReadRegister((addr+2)&0xFF) << 8); + data |= (SCSI.ReadRegister((addr+3)&0xFF) << 0); + return data; + + // Unknown + default: + break; + } + + DebugLog("PC=%08X\tread32: %08X\n", ppc_get_pc(), addr); + return 0xFFFFFFFF; +} + +UINT64 CModel3::Read64(UINT32 addr) +{ + UINT64 data; + + data = Read32(addr+0); + data <<= 32; + data |= Read32(addr+4); + + return data; +} + +/* + * CModel3::Write8(addr, data): + * CModel3::Write16(addr, data): + * CModel3::Write32(addr, data): + * CModel3::Write64(addr, data): + * + * Write handlers. + */ +void CModel3::Write8(UINT32 addr, UINT8 data) +{ + // RAM (most frequently accessed) + if (addr < 0x00800000) + { + ram[addr^3] = data; + return; + } + + // Other + switch ((addr>>24)) + { + // Real3D DMA + case 0xC2: + GPU.WriteDMARegister8(addr&0xFF,data); + break; + + // Various + case 0xF0: + case 0xFE: // mirror + + switch ((addr>>16)&0xFF) + { + // Inputs + case 0x04: + WriteInputs(addr&0x3F,data); + break; + + // Sound Board +#if 0 //def SUPERMODEL_SOUND + case 0x08: + //printf("%08X=%02X * (PC=%08X, LR=%08X)\n", addr, data, ppc_get_pc(), ppc_get_lr()); + if ((addr&0xF)==0) + { + midiPort = data; + //SoundBoard.WriteMIDIPort(data); + Turbo68KRun(480); + IRQ.Deassert(0x40); + } + else if ((addr&0xF)==4) + { + printf("Ctrl port=%02X\n", data); + SCSP_WriteMIDICtrlPort(data); + /* + if (data==0x27) + ;//IRQ.Assert(0x40); + */ + + midiCtrlPort=data; + if (data==0x6) + { + printf("MIDI port=%02X\n", midiPort); + if (midiPort!=0xFF) + SoundBoard.WriteMIDIPort(midiPort); + } + } + break; +#endif + + // Backup RAM + case 0x0C: + case 0x0D: + backupRAM[(addr&0x1FFFF)^3] = data; + break; + + // System registers + case 0x10: + WriteSystemRegister(addr&0x3F,data); + break; + + // RTC + case 0x14: + if ((addr&3)==0) + RTC.WriteRegister((addr>>2)&0xF,data); + break; + + // Unknown + default: + break; + } + + DebugLog("PC=%08X\twrite8 : %08X=%02X\n", ppc_get_pc(), addr, data); + break; + + // MPC105/106 + case 0xF8: + PCIBridge.WriteRegister(addr&0xFF,data); + break; + + // 53C810 SCSI + case 0xC0: // only on Step 1.0 + if (Game->step != 0x10) + goto Unknown8; + case 0xF9: + case 0xC1: + SCSI.WriteRegister(addr&0xFF,data); + break; + + // Unknown: + default: + Unknown8: + DebugLog("PC=%08X\twrite8 : %08X=%02X\n", ppc_get_pc(), addr, data); + break; + } +} + +void CModel3::Write16(UINT32 addr, UINT16 data) +{ + if ((addr&1)) + { + Write8(addr+0,data>>8); + Write8(addr+1,data&0xFF); + return; + } + + // RAM (most frequently accessed) + if (addr < 0x00800000) + { + *(UINT16 *) &ram[addr^2] = data; + return; + } + + // Other + switch ((addr>>24)) + { + // Various + case 0xF0: + case 0xFE: // mirror + + switch ((addr>>16)&0xFF) + { + // Sound Board + case 0x08: + printf("%08X=%04X\n", addr, data); + break; + + // Backup RAM + case 0x0C: + case 0x0D: + *(UINT16 *) &backupRAM[(addr&0x1FFFF)^2] = data; + break; + + // MPC105 + case 0xC0: // F0C00CF8 + PCIBridge.WritePCIConfigData(16,addr&2,data); + break; + + // Unknown + default: + break; + } + + DebugLog("PC=%08X\twrite8 : %08X=%02X\n", ppc_get_pc(), addr, data); + break; + + // MPC105/106 + case 0xF8: + // Write in big endian order, like a real PowerPC + PCIBridge.WriteRegister((addr&0xFF)+0,data>>8); + PCIBridge.WriteRegister((addr&0xFF)+1,data&0xFF); + break; + + // Unknown + default: + DebugLog("PC=%08X\twrite32: %08X=%08X\n", ppc_get_pc(), addr, data); + break; + } +} + +void CModel3::Write32(UINT32 addr, UINT32 data) +{ + //if (addr==0x100060 || addr==0x100180) + // printf(" %08X=%08X\n", addr, data); + + if ((addr&3)) + { + Write16(addr+0,data>>16); + Write16(addr+2,data); + return; + } + + // RAM (most frequently accessed) + if (addr<0x00800000) + { + *(UINT32 *) &ram[addr] = data; + return; + } + + // Other + switch ((addr>>24)) + { + // Real3D trigger + case 0x88: // 88000000 + GPU.Flush(); + break; + + // Real3D low culling RAM + case 0x8C: // 8C000000-8C400000 + GPU.WriteLowCullingRAM(addr&0x3FFFFF,FLIPENDIAN32(data)); + break; + + // Real3D high culling RAM + case 0x8E: // 8E000000-8E100000 + GPU.WriteHighCullingRAM(addr&0xFFFFF,FLIPENDIAN32(data)); + break; + + // Real3D texture port + case 0x90: // 90000000-90000018 + GPU.WriteTexturePort(addr&0xFF,FLIPENDIAN32(data)); + break; + + // Real3D texture FIFO + case 0x94: // 94000000-94100000 + GPU.WriteTextureFIFO(FLIPENDIAN32(data)); + break; + + // Real3D polygon RAM + case 0x98: // 98000000-98400000 + GPU.WritePolygonRAM(addr&0x3FFFFF,FLIPENDIAN32(data)); + break; + + // Real3D DMA + case 0xC2: // C2000000-C2000100 + GPU.WriteDMARegister32(addr&0xFF,FLIPENDIAN32(data)); + break; + + // Various + case 0xF0: + case 0xFE: // mirror + + switch ((addr>>16)&0xFF) + { + // Inputs + case 0x04: + WriteInputs((addr&0x3F)+0,(data>>24)&0xFF); + WriteInputs((addr&0x3F)+1,(data>>16)&0xFF); + WriteInputs((addr&0x3F)+2,(data>>8)&0xFF); + WriteInputs((addr&0x3F)+3,(data>>0)&0xFF); + break; + + // Sound Board + case 0x08: + printf("%08X=%08X\n", addr, data); + break; + + // Backup RAM + case 0x0C: + case 0x0D: + *(UINT32 *) &backupRAM[(addr&0x1FFFF)] = data; + break; + + // MPC105 + case 0x80: // F0800CF8 (never observed at 0xFExxxxxx) + PCIBridge.WritePCIConfigAddress(data); + break; + + // MPC105/106 + case 0xC0: case 0xD0: case 0xE0: + case 0xC1: case 0xD1: case 0xE1: + case 0xC2: case 0xD2: case 0xE2: + case 0xC3: case 0xD3: case 0xE3: + case 0xC4: case 0xD4: case 0xE4: + case 0xC5: case 0xD5: case 0xE5: + case 0xC6: case 0xD6: case 0xE6: + case 0xC7: case 0xD7: case 0xE7: + case 0xC8: case 0xD8: case 0xE8: + case 0xC9: case 0xD9: case 0xE9: + case 0xCA: case 0xDA: case 0xEA: + case 0xCB: case 0xDB: case 0xEB: + case 0xCC: case 0xDC: case 0xEC: + case 0xCD: case 0xDD: case 0xED: + case 0xCE: case 0xDE: case 0xEE: + case 0xCF: case 0xDF: case 0xEF: + if ((addr>=0xF0C00CF8) && (addr<0xF0C00D00)) // MPC105 + PCIBridge.WritePCIConfigData(32,0,data); + else if ((addr>=0xFEC00000) && (addr<0xFEE00000)) // MPC106 + PCIBridge.WritePCIConfigAddress(data); + else if ((addr>=0xFEE00000) && (addr<0xFEF00000)) // MPC106 + PCIBridge.WritePCIConfigData(32,0,data); + break; + + // System registers + case 0x10: + WriteSystemRegister((addr&0x3F)+0,(data>>24)&0xFF); + WriteSystemRegister((addr&0x3F)+1,(data>>16)&0xFF); + WriteSystemRegister((addr&0x3F)+2,(data>>8)&0xFF); + WriteSystemRegister((addr&0x3F)+3,(data>>0)&0xFF); + break; + + // RTC + case 0x14: + RTC.WriteRegister((addr>>2)&0xF,data); + break; + + // Security board RAM + case 0x18: + *(UINT32 *) &securityRAM[(addr&0x1FFFF)] = data; + break; + + // Security board registers + case 0x1A: + WriteSecurity(addr&0x3F,data); + break; + + // Unknown + default: + break; + } + + DebugLog("PC=%08X\twrite32: %08X=%08X\n", ppc_get_pc(), addr, data); + break; + + // Tile generator + case 0xF1: + if (addr < 0xF1120000) + { + // Tile generator accesses its RAM as little endian, must flip for big endian PowerPC + data = FLIPENDIAN32(data); + TileGen.WriteRAM(addr&0x1FFFFF,data); + break; + } + else if ((addr>=0xF1180000) && (addr<0xF1180100)) + { + TileGen.WriteRegister(addr&0xFF,FLIPENDIAN32(data)); + break; + } + + goto Unknown32; + + // MPC105/106 + case 0xF8: // F8FFF000-F8FFF100 + // Write in big endian order, like a real PowerPC + PCIBridge.WriteRegister((addr&0xFF)+0,(data>>24)&0xFF); + PCIBridge.WriteRegister((addr&0xFF)+1,(data>>16)&0xFF); + PCIBridge.WriteRegister((addr&0xFF)+2,(data>>8)&0xFF); + PCIBridge.WriteRegister((addr&0xFF)+3,data&0xFF); + break; + + // 53C810 SCSI + case 0xC0: // step 1.0 only + if (Game->step != 0x10) + goto Unknown32; + case 0xF9: + case 0xC1: + SCSI.WriteRegister((addr&0xFF)+0,(data>>24)&0xFF); + SCSI.WriteRegister((addr&0xFF)+1,(data>>16)&0xFF); + SCSI.WriteRegister((addr&0xFF)+2,(data>>8)&0xFF); + SCSI.WriteRegister((addr&0xFF)+3,data&0xFF); + break; + + // Unknown + default: + Unknown32: + DebugLog("PC=%08X\twrite32: %08X=%08X\n", ppc_get_pc(), addr, data); + break; + } +} + +void CModel3::Write64(UINT32 addr, UINT64 data) +{ + Write32(addr+0, (UINT32) (data>>32)); + Write32(addr+4, (UINT32) data); +} + +#endif + + +/****************************************************************************** + Debug Mode (Strict) Address Space Access Handlers + + Enabled only if DEBUG is defined. These perform stricter checks than the + "optimized" handlers but may be slower. +******************************************************************************/ + +#ifdef DEBUG + +/* + * CModel3::Read8(addr): + * CModel3::Read16(addr): + * CModel3::Read32(addr): + * CModel3::Read64(addr): + * + * Read handlers. + */ +UINT8 CModel3::Read8(UINT32 addr) +{ + if (addr<0x00800000) + return ram[addr^3]; + else if ((addr>=0xFF000000) && (addr<0xFF800000)) + return cromBank[(addr&0x7FFFFF)^3]; + else if (addr>=0xFF800000) + return crom[(addr&0x7FFFFF)^3]; + else if ((addr>=0xC2000000) && (addr<0xC2000100)) + return GPU.ReadDMARegister8(addr&0xFF); + else if (((addr>=0xF0040000) && (addr<0xF0040040)) || ((addr>=0xFE040000) && (addr<0xFE040040))) + return ReadInputs(addr&0x3F); + else if (((addr>=0xF00C0000) && (addr<0xF00DFFFF)) || ((addr>=0xFE0C0000) && (addr<0xFE0DFFFF))) + return backupRAM[(addr&0x1FFFF)^3]; + else if (((addr>=0xF0100000) && (addr<0xF0100040)) || ((addr>=0xFE100000) && (addr<0xFE100040))) + return ReadSystemRegister(addr&0x3F); + else if (((addr>=0xF0140000) && (addr<0xF0140040)) || ((addr>=0xFE140000) && (addr<0xFE140040))) + { + if ((addr&3)==1) // battery voltage test + return 0x03; + else if ((addr&3)==0) + return RTC.ReadRegister((addr>>2)&0xF); + return 0; + } + else if (((addr>=0xF9000000) && (addr<0xF9000100)) || ((addr>=0xC1000000) && (addr<0xC1000100)) || ((Game->step==0x10) && ((addr>=0xC0000000) && (addr<0xC0000100)))) + return SCSI.ReadRegister(addr&0xFF); + + DebugLog("PC=%08X\tread8 : %08X\n", ppc_get_pc(), addr); + return 0xFF; +} + +UINT16 CModel3::Read16(UINT32 addr) +{ + UINT16 data; + + if ((addr&1)) + { + data = Read8(addr+0)<<8; + data |= Read8(addr+1); + return data; + } + + if (addr<0x00800000) + return *(UINT16 *) &ram[addr^2]; + else if ((addr>=0xFF000000) && (addr<0xFF800000)) + return *(UINT16 *) &cromBank[(addr&0x7FFFFF)^2]; + else if (addr>=0xFF800000) + return *(UINT16 *) &crom[(addr&0x7FFFFF)^2]; + else if (((addr>=0xF00C0000) && (addr<0xF00DFFFF)) || ((addr>=0xFE0C0000) && (addr<0xFE0DFFFF))) + return *(UINT16 *) &backupRAM[(addr&0x1FFFF)^2]; + else if ((addr>=0xF0C00CF8) && (addr<0xF0C00D00)) // MPC105 + return PCIBridge.ReadPCIConfigData(16,addr&3); + else if ((addr>=0xFEE00000) && (addr<0xFEF00000)) // MPC106 + return PCIBridge.ReadPCIConfigData(16,addr&3); + + DebugLog("PC=%08X\tread16: %08X\n", ppc_get_pc(), addr); + return 0xFFFF; +} + +UINT32 CModel3::Read32(UINT32 addr) +{ + UINT32 data; + + if ((addr&3)) + { + data = Read16(addr+0)<<16; + data |= Read16(addr+2); + return data; + } + + if (addr<0x00800000) + return *(UINT32 *) &ram[addr]; + else if ((addr>=0xFF000000) && (addr<0xFF800000)) + return *(UINT32 *) &cromBank[(addr&0x7FFFFF)]; + else if (addr>=0xFF800000) + return *(UINT32 *) &crom[(addr&0x7FFFFF)]; + else if ((addr>=0x84000000) && (addr<0x8400003F)) + return GPU.ReadRegister(addr&0x3F); + else if ((addr>=0xC2000000) && (addr<0xC2000100)) + { + data = GPU.ReadDMARegister32(addr&0xFF); + return FLIPENDIAN32(data); + } + else if (((addr>=0xF0040000) && (addr<0xF0040040)) || ((addr>=0xFE040000) && (addr<0xFE040040))) + { + data = ReadInputs((addr&0x3F)+0) << 24; + data |= ReadInputs((addr&0x3F)+1) << 16; + data |= ReadInputs((addr&0x3F)+2) << 8; + data |= ReadInputs((addr&0x3F)+3) << 0; + return data; + } + else if (((addr>=0xF00C0000) && (addr<0xF00DFFFF)) || ((addr>=0xFE0C0000) && (addr<0xFE0DFFFF))) + return *(UINT32 *) &backupRAM[(addr&0x1FFFF)]; + else if (((addr>=0xF0100000) && (addr<0xF0100040)) || ((addr>=0xFE100000) && (addr<0xFE100040))) + { + data = ReadSystemRegister((addr&0x3F)+0) << 24; + data |= ReadSystemRegister((addr&0x3F)+1) << 16; + data |= ReadSystemRegister((addr&0x3F)+2) << 8; + data |= ReadSystemRegister((addr&0x3F)+3) << 0; + return data; + } + else if ((addr>=0xF0C00CF8) && (addr<0xF0C00D00)) // MPC105 + return PCIBridge.ReadPCIConfigData(32,0); + else if ((addr>=0xFEE00000) && (addr<0xFEF00000)) // MPC106 + return PCIBridge.ReadPCIConfigData(32,0); + else if (((addr>=0xF0140000) && (addr<0xF0140040)) || ((addr>=0xFE140000) && (addr<0xFE140040))) + { + data = (RTC.ReadRegister((addr>>2)&0xF) << 24); + data |= 0x00030000; // set these bits to pass battery voltage test + return data; + } + else if (((addr>=0xF0180000) && (addr<0xF019FFFF)) || ((addr>=0xFE180000) && (addr<0xFE19FFFF))) + return *(UINT32 *) &securityRAM[(addr&0x1FFFF)]; // so far, only 32-bit access observed, so we use little endian access + else if (((addr>=0xF01A0000) && (addr<0xF01A003F)) || ((addr>=0xFE1A0000) && (addr<0xFE1A003F))) + return ReadSecurity(addr&0x3F); + else if ((addr>=0xF1000000) && (addr<0xF1120000)) + { + // Tile generator accesses its RAM as little endian, must flip for big endian PowerPC + data = TileGen.ReadRAM(addr&0x1FFFFF); + return FLIPENDIAN32(data); + } + else if (((addr>=0xF9000000) && (addr<0xF9000100)) || ((addr>=0xC1000000) && (addr<0xC1000100)) || ((Game->step==0x10) && ((addr>=0xC0000000) && (addr<0xC0000100)))) + { + data = (SCSI.ReadRegister((addr+0)&0xFF) << 24); + data |= (SCSI.ReadRegister((addr+1)&0xFF) << 16); + data |= (SCSI.ReadRegister((addr+2)&0xFF) << 8); + data |= (SCSI.ReadRegister((addr+3)&0xFF) << 0); + return data; + } + + // FIXES 2D GRAPHICS (to-do: integrate this into tilegen.cpp) + if (addr==0xF1180000) + return 0; + + DebugLog("PC=%08X\tread32: %08X\n", ppc_get_pc(), addr); + return 0xFFFFFFFF; +} + +UINT64 CModel3::Read64(UINT32 addr) +{ + UINT64 data; + + data = Read32(addr+0); + data <<= 32; + data |= Read32(addr+4); + + return data; +} + +/* + * CModel3::Write8(addr, data): + * CModel3::Write16(addr, data): + * CModel3::Write32(addr, data): + * CModel3::Write64(addr, data): + * + * Write handlers. + */ +void CModel3::Write8(UINT32 addr, UINT8 data) +{ + if (addr<0x00800000) + ram[addr^3] = data; + else if ((addr>=0xC2000000) && (addr<0xC2000100)) + GPU.WriteDMARegister8(addr&0xFF,data); + else if (((addr>=0xF0040000) && (addr<0xF0040040)) || ((addr>=0xFE040000) && (addr<0xFE040040))) + WriteInputs(addr&0x3F,data); + else if (((addr>=0xF00C0000) && (addr<0xF00E0000)) || ((addr>=0xFE0C0000) && (addr<0xFE0E0000))) + backupRAM[(addr&0x1FFFF)^3] = data; + else if (((addr>=0xF0100000) && (addr<0xF0100040)) || ((addr>=0xFE100000) && (addr<0xFE100040))) + WriteSystemRegister(addr&0x3F,data); + else if (((addr>=0xF0140000) && (addr<0xF0140040)) || ((addr>=0xFE140000) && (addr<0xFE140040))) + { + if ((addr&3)==0) + RTC.WriteRegister((addr>>2)&0xF,data); + } + else if ((addr>=0xF8FFF000) && (addr<0xF8FFF100)) + PCIBridge.WriteRegister(addr&0xFF,data); + else if (((addr>=0xF9000000) && (addr<0xF9000100)) || ((addr>=0xC1000000) && (addr<0xC1000100)) || ((Game->step==0x10) && ((addr>=0xC0000000) && (addr<0xC0000100)))) + SCSI.WriteRegister(addr&0xFF,data); + else + { + DebugLog("PC=%08X\twrite8 : %08X=%02X\n", ppc_get_pc(), addr, data); + //printf("PC=%08X\twrite8 : %08X=%02X\n", ppc_get_pc(), addr, data); + } +} + +void CModel3::Write16(UINT32 addr, UINT16 data) +{ + if ((addr&1)) + { + Write8(addr+0,data>>8); + Write8(addr+1,data&0xFF); + return; + } + + if (addr<0x00800000) + *(UINT16 *) &ram[addr^2] = data; + else if (((addr>=0xF00C0000) && (addr<0xF00E0000)) || ((addr>=0xFE0C0000) && (addr<0xFE0E0000))) + *(UINT16 *) &backupRAM[(addr&0x1FFFF)^2] = data; + else if ((addr>=0xF0C00CF8) && (addr<0xF0C00D00)) + PCIBridge.WritePCIConfigData(16,addr&2,data); + else if ((addr>=0xF8FFF000) && (addr<0xF8FFF100)) + { + // Write in big endian order, like a real PowerPC + PCIBridge.WriteRegister((addr&0xFF)+0,data>>8); + PCIBridge.WriteRegister((addr&0xFF)+1,data&0xFF); + } + else + { + DebugLog("PC=%08X\twrite16: %08X=%04X\n", ppc_get_pc(), addr, data); + //printf("PC=%08X\twrite16: %08X=%04X\n", ppc_get_pc(), addr, data); + } +} + +void CModel3::Write32(UINT32 addr, UINT32 data) +{ + if ((addr&3)) + { + Write16(addr+0,data>>16); + Write16(addr+2,data); + return; + } + + if (addr<0x00800000) + *(UINT32 *) &ram[addr] = data; + else if ((addr>=0x88000000) && (addr<0x88000008)) + GPU.Flush(); + else if ((addr>=0x8C000000) && (addr<0x8C400000)) + GPU.WriteLowCullingRAM(addr&0x3FFFFF,FLIPENDIAN32(data)); + else if ((addr>=0x8E000000) && (addr<0x8E100000)) + GPU.WriteHighCullingRAM(addr&0xFFFFF,FLIPENDIAN32(data)); + else if ((addr>=0x90000000) && (addr<0x90000018)) + GPU.WriteTexturePort(addr&0xFF,FLIPENDIAN32(data)); + else if ((addr>=0x94000000) && (addr<0x94100000)) + GPU.WriteTextureFIFO(FLIPENDIAN32(data)); + else if ((addr>=0x98000000) && (addr<0x98400000)) + GPU.WritePolygonRAM(addr&0x3FFFFF,FLIPENDIAN32(data)); + else if ((addr>=0xC2000000) && (addr<0xC2000100)) + GPU.WriteDMARegister32(addr&0xFF,FLIPENDIAN32(data)); + else if (((addr>=0xF0040000) && (addr<0xF0040040)) || ((addr>=0xFE040000) && (addr<0xFE040040))) + { + WriteInputs((addr&0x3F)+0,(data>>24)&0xFF); + WriteInputs((addr&0x3F)+1,(data>>16)&0xFF); + WriteInputs((addr&0x3F)+2,(data>>8)&0xFF); + WriteInputs((addr&0x3F)+3,(data>>0)&0xFF); + } + else if (((addr>=0xF00C0000) && (addr<0xF00E0000)) || ((addr>=0xFE0C0000) && (addr<0xFE0E0000))) + *(UINT32 *) &backupRAM[(addr&0x1FFFF)] = data; + else if ((addr>=0xF0800CF8) && (addr<0xF0800D00)) // MPC105 + PCIBridge.WritePCIConfigAddress(data); + else if ((addr>=0xF0C00CF8) && (addr<0xF0C00D00)) // MPC105 + PCIBridge.WritePCIConfigData(32,0,data); + else if ((addr>=0xFEC00000) && (addr<0xFEE00000)) // MPC106 + PCIBridge.WritePCIConfigAddress(data); + else if ((addr>=0xFEE00000) && (addr<0xFEF00000)) // MPC106 + PCIBridge.WritePCIConfigData(32,0,data); + else if (((addr>=0xF0100000) && (addr<0xF0100040)) || ((addr>=0xFE100000) && (addr<0xFE100040))) + { + WriteSystemRegister((addr&0x3F)+0,(data>>24)&0xFF); + WriteSystemRegister((addr&0x3F)+1,(data>>16)&0xFF); + WriteSystemRegister((addr&0x3F)+2,(data>>8)&0xFF); + WriteSystemRegister((addr&0x3F)+3,(data>>0)&0xFF); + } + else if (((addr>=0xF0140000) && (addr<0xF0140040)) || ((addr>=0xFE140000) && (addr<0xFE140040))) + RTC.WriteRegister((addr>>2)&0xF,data); + else if (((addr>=0xF0180000) && (addr<0xF019FFFF)) || ((addr>=0xFE180000) && (addr<0xFE19FFFF))) + *(UINT32 *) &securityRAM[(addr&0x1FFFF)] = data; // so far, only 32-bit access observed, so just store little endian + else if (((addr>=0xF01A0000) && (addr<0xF01A003F)) || ((addr>=0xFE1A0000) && (addr<0xFE1A003F))) + WriteSecurity(addr&0x3F,data); + else if ((addr>=0xF1000000) && (addr<0xF1120000)) + { + // Tile generator accesses its RAM as little endian, must flip for big endian PowerPC + data = FLIPENDIAN32(data); + TileGen.WriteRAM(addr&0x1FFFFF,data); + } + else if ((addr>=0xF1180000) && (addr<0xF1180100)) + TileGen.WriteRegister(addr&0xFF,FLIPENDIAN32(data)); + else if ((addr>=0xF8FFF000) && (addr<0xF8FFF100)) + { + // Write in big endian order, like a real PowerPC + PCIBridge.WriteRegister((addr&0xFF)+0,(data>>24)&0xFF); + PCIBridge.WriteRegister((addr&0xFF)+1,(data>>16)&0xFF); + PCIBridge.WriteRegister((addr&0xFF)+2,(data>>8)&0xFF); + PCIBridge.WriteRegister((addr&0xFF)+3,data&0xFF); + } + else if (((addr>=0xF9000000) && (addr<0xF9000100)) || ((addr>=0xC1000000) && (addr<0xC1000100)) || ((Game->step==0x10) && ((addr>=0xC0000000) && (addr<0xC0000100)))) + { + SCSI.WriteRegister((addr&0xFF)+0,(data>>24)&0xFF); + SCSI.WriteRegister((addr&0xFF)+1,(data>>16)&0xFF); + SCSI.WriteRegister((addr&0xFF)+2,(data>>8)&0xFF); + SCSI.WriteRegister((addr&0xFF)+3,data&0xFF); + } + else + { + //printf("%08X=%08X\n", addr, data); + DebugLog("PC=%08X\twrite32: %08X=%08X\n", ppc_get_pc(), addr, data); + } +} + +void CModel3::Write64(UINT32 addr, UINT64 data) +{ + Write32(addr+0, (UINT32) (data>>32)); + Write32(addr+4, (UINT32) data); +} + + +#endif + + +/****************************************************************************** + Emulation and Interface Functions +******************************************************************************/ + +void CModel3::SaveState(CBlockFile *SaveState) +{ + // Write Model 3 state + SaveState->NewBlock("Model 3", __FILE__); + SaveState->Write(&inputBank, sizeof(inputBank)); + SaveState->Write(&serialFIFO1, sizeof(serialFIFO1)); + SaveState->Write(&serialFIFO2, sizeof(serialFIFO2)); + SaveState->Write(&gunReg, sizeof(gunReg)); + SaveState->Write(&adcChannel, sizeof(adcChannel)); + SaveState->Write(&cromBankReg, sizeof(cromBankReg)); + SaveState->Write(&securityPtr, sizeof(securityPtr)); + SaveState->Write(ram, 0x800000); + SaveState->Write(backupRAM, 0x20000); + SaveState->Write(securityRAM, 0x20000); + + // All devices... + ppc_save_state(SaveState); + IRQ.SaveState(SaveState); + PCIBridge.SaveState(SaveState); + SCSI.SaveState(SaveState); + EEPROM.SaveState(SaveState); + TileGen.SaveState(SaveState); + GPU.SaveState(SaveState); +} + +void CModel3::LoadState(CBlockFile *SaveState) +{ + // Load Model 3 state + if (OKAY != SaveState->FindBlock("Model 3")) + { + ErrorLog("Unable to load Model 3 core state. Save state file is corrupted."); + return; + } + + SaveState->Read(&inputBank, sizeof(inputBank)); + SaveState->Read(&serialFIFO1, sizeof(serialFIFO1)); + SaveState->Read(&serialFIFO2, sizeof(serialFIFO2)); + SaveState->Read(&gunReg, sizeof(gunReg)); + SaveState->Read(&adcChannel, sizeof(adcChannel)); + SaveState->Read(&cromBankReg, sizeof(cromBankReg)); + SetCROMBank(cromBankReg); // update CROM bank + SaveState->Read(&securityPtr, sizeof(securityPtr)); + SaveState->Read(ram, 0x800000); + SaveState->Read(backupRAM, 0x20000); + SaveState->Read(securityRAM, 0x20000); + + // All devices... + GPU.LoadState(SaveState); + TileGen.LoadState(SaveState); + EEPROM.LoadState(SaveState); + SCSI.LoadState(SaveState); + PCIBridge.LoadState(SaveState); + IRQ.LoadState(SaveState); + ppc_load_state(SaveState); +} + +void CModel3::SaveNVRAM(CBlockFile *NVRAM) +{ + // Load EEPROM + EEPROM.SaveState(NVRAM); + + // Save backup RAM + NVRAM->NewBlock("Backup RAM", __FILE__); + NVRAM->Write(backupRAM, 0x20000); +} + +void CModel3::LoadNVRAM(CBlockFile *NVRAM) +{ + // Load EEPROM + EEPROM.LoadState(NVRAM); + + // Load backup RAM + if (OKAY != NVRAM->FindBlock("Backup RAM")) + { + ErrorLog("Unable to load Model 3 backup RAM. NVRAM file is corrupted."); + return; + } + NVRAM->Read(backupRAM, 0x20000); +} + +void CModel3::ClearNVRAM(void) +{ + memset(backupRAM, 0, 0x20000); + EEPROM.Clear(); +} + +void CModel3::RunFrame(void) +{ + printf("cmdbuf=%08X %08X %08X %08X %08X %08X %08X %08X\n", Read32(0x100180), Read32(0x100184), Read32(0x100188), Read32(0x10018C), Read32(0x100190), Read32(0x100194), Read32(0x100198), Read32(0x10019C)); + + // Run the PowerPC for a frame + ppc_execute(ppcFrequency/60-10000); + + // VBlank + TileGen.BeginFrame(); + GPU.BeginFrame(); + GPU.RenderFrame(); + IRQ.Assert(0x02); + ppc_execute(10000); // TO-DO: Vblank probably needs to be longer. Maybe that's why some games run too fast/slow + + // Update sound +#if 0 //def SUPERMODEL_SOUND + //if (midiCtrlPort==0x27) + { + //printf("*---\n"); + + for (int i = 0; i < 128; i++) + { + IRQ.Assert(0x40); + ppc_execute(2000); + } + + //printf("---*\n"); + } + SoundBoard.RunFrame(); + IRQ.Deassert(0x40); +#endif + + // End frame + GPU.EndFrame(); + TileGen.EndFrame(); + IRQ.Assert(0x0D); +} + +void CModel3::Reset(void) +{ + // Clear memory (but do not modify backup RAM!) + memset(ram, 0, 0x800000); + + // Initial bank is bank 0 + SetCROMBank(0xFF); + + // Reset security device + securityPtr = 0; + + // Reset inputs + inputBank = 0; + serialFIFO1 = 0; + serialFIFO2 = 0; + adcChannel = 0; + + // Reset all devices + ppc_reset(); + IRQ.Reset(); + PCIBridge.Reset(); + PCIBus.Reset(); + SCSI.Reset(); + RTC.Reset(); + EEPROM.Reset(); + TileGen.Reset(); + GPU.Reset(); + SoundBoard.Reset(); + + DebugLog("Model 3 reset\n"); +} + + +/****************************************************************************** + Initialization, Shutdown, and ROM Management +******************************************************************************/ + +// Apply patches to games +void CModel3::Patch(void) +{ + if (!strcmp(Game->id, "vf3")) + { + *(UINT32 *) &crom[0x713C7C] = 0x60000000; + *(UINT32 *) &crom[0x713E54] = 0x60000000; + *(UINT32 *) &crom[0x7125B0] = 0x60000000; + *(UINT32 *) &crom[0x7125D0] = 0x60000000; + } + else if (!strcmp(Game->id, "lemans24")) + { + // Base offset of program in CROM: 6473C0 + *(UINT32 *) &crom[0x6D8C4C] = 0x00000002; // comm. mode: 00=master, 01=slave, 02=satellite + *(UINT32 *) &crom[0x73FE38] = 0x38840004; // an actual bug in the game code + *(UINT32 *) &crom[0x73EB5C] = 0x60000000; + *(UINT32 *) &crom[0x73EDD0] = 0x60000000; + *(UINT32 *) &crom[0x73EDC4] = 0x60000000; + //*(UINT32 *) &crom[0x6473C0+0xF8BD0] = 0x60000000; // waiting for something from network card, called at F8CD8 + //*(UINT32 *) &crom[0x6473C0+0xF8B80] = 0x60000000; // "", called at 0xF8D90 + } + else if (!strcmp(Game->id, "scud")) + { + *(UINT32 *) &crom[0x712734] = 0x60000000; // skips some ridiculously slow delay loop during boot-up + *(UINT32 *) &crom[0x71AEBC] = 0x60000000; // waiting for some flag in RAM that never gets modified (IRQ problem? try emulating VBL on Real3D) + *(UINT32 *) &crom[0x712268] = 0x60000000; // this corrects the boot-up menu (but why?) + crom[0x787B36^3] = 0x00; // Link ID: 00=single, 01=master, 02=slave (can bypass network board error) + *(UINT32 *) &crom[0x71277C] = 0x60000000; // seems to allow the game to start + *(UINT32 *) &crom[0x74072C] = 0x60000000; // ... ditto + + //*(UINT32 *)&crom[0x799DE8] = 0x00050208; // debug menu + } + else if (!strcmp(Game->id, "scudp")) + { + /* + * RAM program structure: + * + * 1540: Reset vector transfers control here. Effective start of + * program. On error, game often resets here. + * 14844: Appears to be beginning of the actual boot-up process. + */ + + // Base offset of program in CROM: 710000 + // *(UINT32 *) &crom[0x713724] = 0x60000000; + // *(UINT32 *) &crom[0x713744] = 0x60000000; + // *(UINT32 *) &crom[0x741f48] = 0x60000000; + + *(UINT32 *) &crom[0x741f68] = 0x60000000; + *(UINT32 *) &crom[0x7126B8] = 0x60000000; // waits for something in RAM + + crom[0x7C62B2^3] = 0x00; // link ID is copied to 0x10011E, set it to single + } + else if (!strcmp(Game->id, "von2")) + { + *(UINT32 *) &crom[0x1B0] = 0x7C631A78; // eliminate annoyingly long delay loop + *(UINT32 *) &crom[0x1B4] = 0x60000000; // "" + } + else if (!strcmp(Game->id, "lostwsga")) + { + *(UINT32 *) &crom[0x7374f4] = 0x38840004; // an actual bug in the game code + } + else if (!strcmp(Game->id, "vs298")) + { + // Base offset of program in CROM: 600000 + // Inexplicably, at PC=AFC1C, a call is made to FC78, which is right in the middle of some + // totally unrelated initialization code (ASIC checks). This causes an invalid pointer to be fetched. + // Perhaps FC78 should be overwritten with other program data by then? Why is it not? + // Or, 300138 needs to be written with a non-zero value, it is loaded from EEPROM but is 0. + *(UINT32 *) &crom[0x6AFC1C] = 0x60000000; + } + else if (!strcmp(Game->id, "srally2")) + { + *(UINT32 *) &crom[0x7C0C4] = 0x60000000; + *(UINT32 *) &crom[0x7C0C8] = 0x60000000; + *(UINT32 *) &crom[0x7C0CC] = 0x60000000; + } + else if (!strcmp(Game->id, "daytona2")) + { + // Base address of program in CROM: 0x600000 + // 0x10019E is the location in RAM which contains link type. + // Region menu can be accessed by entering test mode, holding start, + // and pressing: green, green, blue, yellow, red, yellow, blue (VR4,4,2,3,1,3,2) + *(UINT32 *) &crom[0x68468c] = 0x60000000; // protection device + *(UINT32 *) &crom[0x6063c4] = 0x60000000; // needed to allow levels to load + *(UINT32 *) &crom[0x616434] = 0x60000000; // prevents PPC from executing invalid code (MMU?) + *(UINT32 *) &crom[0x69f4e4] = 0x60000000; // "" + *(UINT32 *) &crom[0x600000+0x4C744] = 0x60000000; // decrementer loop? + } + else if (!strcmp(Game->id, "dayto2pe")) + { + *(UINT32 *) &crom[0x606784] = 0x60000000; + *(UINT32 *) &crom[0x69A3FC] = 0x60000000; // MAME says: jump to encrypted code + *(UINT32 *) &crom[0x618B28] = 0x60000000; // MAME says: jump to encrypted code + *(UINT32 *) &crom[0x64CA34] = 0x60000000; // decrementer + } + else if (!strcmp(Game->id, "fvipers2")) + { + /* + * Game code is copied to RAM in a non-trivial fashion (it may be + * compressed) just prior to the following sequence of code, which then + * transfers control to the RAM program: + * + * FFF0153C: 3C200070 li r1,0x00700000 + * FFF01540: 3C60FF80 li r3,0xFF800000 + * FFF01544: 38800000 li r4,0x00000000 + * FFF01548: 48000751 bl 0xFFF01C98 + * FFF0154C: 7C7F42A6 mfspr r3,pvr + * FFF01550: 90600080 stw r3,0x00000080 + * FFF01554: 92E00084 stw r23,0x00000084 + * FFF01558: 38600100 li r3,0x00000100 + * FFF0155C: 7C6803A6 mtspr lr,r3 + * FFF01560: 4E800020 bclr 0x14,0 + * + * In order to patch the necessary portions of the RAM program, we must + * insert a routine that executes after the program is loaded. There is + * ample room in the vector table between 0xFFF00004 and 0xFFF000FC. + * The patching routine must terminate with a "bclr 0x14,0" to jump to + * the RAM program. + */ + *(UINT32 *) &crom[0xFFF01560-0xFF800000] = 0x4BF00006; // ba 0xFFF00004 + *(UINT32 *) &crom[0xFFF00004-0xFF800000] = (31<<26)|(316<<1); // xor r0,r0,r0 ; R0 = 0 + *(UINT32 *) &crom[0xFFF00008-0xFF800000] = (15<<26)|(2<<21)|0x6000; // addis r2,0,0x6000 ; R2 = nop + *(UINT32 *) &crom[0xFFF0000C-0xFF800000] = (24<<26)|(1<<16)|0xA2E8; // ori r1,r0,0xA2E8 ; [A2E8] <- nop (decrementer loop) + *(UINT32 *) &crom[0xFFF00010-0xFF800000] = (36<<26)|(2<<21)|(1<<16); // stw r2,0(r1) + *(UINT32 *) &crom[0xFFF00014-0xFF800000] = 0x4E800020; // bclr 0x14,0 ; return to RAM code + + // NOTE: At 32714, a test is made that determines the message: ONE PROCESSOR DETECTED, TWO "", etc. + } + else if (!strcmp(Game->id, "harley")) + { + *(UINT32 *) &crom[0x50E8D4] = 0x60000000; + *(UINT32 *) &crom[0x50E8F4] = 0x60000000; + *(UINT32 *) &crom[0x50FB84] = 0x60000000; + + *(UINT32 *) &crom[0x4F736C] = 0x60000000; + *(UINT32 *) &crom[0x4F738C] = 0x60000000; + } + else if (!strcmp(Game->id, "oceanhun")) + { + // Base address of program in CROM: 588FD8-108FD8=480000 + //*(UINT32 *) &crom[0x480000+0x108FE0] = 0x60000000; // bad DMA copies from CROM + //*(UINT32 *) &crom[0x480000+0x112020] = 0x60000000; // reads from invalid addresses (due to CROM?) + *(UINT32 *) &crom[0x480000+0xF995C] = 0x60000000; // decrementer + } + else if (!strcmp(Game->id, "swtrilgy")) + { + *(UINT32 *) &crom[0xF0E48] = 0x60000000; + *(UINT32 *) &crom[0x043DC] = 0x48000090; + *(UINT32 *) &crom[0x029A0] = 0x60000000; + *(UINT32 *) &crom[0x02A0C] = 0x60000000; + } + else if (!strcmp(Game->id, "eca")) + { + *(UINT32 *) &crom[0x535580] = 0x60000000; + *(UINT32 *) &crom[0x5023B4] = 0x60000000; + *(UINT32 *) &crom[0x5023D4] = 0x60000000; + + *(UINT32 *) &crom[0x535560] = 0x60000000; // decrementer loop + } +} + +// Reverses all aligned 16-bit words, thereby switching their endianness (assumes buffer size is divisible by 2) +static void Reverse16(UINT8 *buf, unsigned size) +{ + unsigned i; + UINT8 tmp; + + for (i = 0; i < size; i += 2) + { + tmp = buf[i+0]; + buf[i+0] = buf[i+1]; + buf[i+1] = tmp; + } +} + +// Reverses all aligned 32-bit words, thereby switching their endianness (assumes buffer size is divisible by 4) +static void Reverse32(UINT8 *buf, unsigned size) +{ + unsigned i; + UINT8 tmp1, tmp2; + + for (i = 0; i < size; i += 4) + { + tmp1 = buf[i+0]; + tmp2 = buf[i+1]; + buf[i+0] = buf[i+3]; + buf[i+1] = buf[i+2]; + buf[i+2] = tmp2; + buf[i+3] = tmp1; + } +} + +// Dumps a memory region to a file for debugging purposes +static void Dump(const char *file, UINT8 *buf, unsigned size, BOOL reverse32, BOOL reverse16) +{ + FILE *fp; + + fp = fopen(file, "wb"); + if (NULL != fp) + { + if (reverse32) + Reverse32(buf, size); + else if (reverse16) + Reverse16(buf, size); + fwrite(buf, sizeof(UINT8), size, fp); + fclose(fp); + printf("dumped %s\n", file); + } + else + printf("unable to dump %s\n", file); +} + +// Offsets of memory regions within Model 3's pool +#define OFFSET_RAM 0 // 8 MB +#define OFFSET_CROM 0x800000 // 8 MB (fixed CROM) +#define OFFSET_CROMxx 0x1000000 // 128 MB (banked CROM0-3 must follow fixed CROM) +#define OFFSET_VROM 0x9000000 // 64 MB +#define OFFSET_BACKUPRAM 0xD000000 // 128 KB +#define OFFSET_SECURITYRAM 0xD020000 // 128 KB +#define OFFSET_SOUNDROM 0xD040000 // 512 KB +#define OFFSET_SAMPLEROM 0xD0C0000 // 8 MB +#define MEMORY_POOL_SIZE (0x800000+0x800000+0x8000000+0x4000000+0x20000+0x20000+0x80000+0x800000) + +const struct GameInfo * CModel3::GetGameInfo(void) +{ + return Game; +} + +// Stepping-dependent parameters (MPC10x type, etc.) are initialized here +BOOL CModel3::LoadROMSet(const struct GameInfo *GameList, const char *zipFile) +{ + struct ROMMap Map[] = + { + { "CROM", crom }, + { "CROMxx", &crom[0x800000] }, + { "VROM", vrom }, + { "SndProg", soundROM }, + { "Samples", sampleROM }, + { NULL, NULL } + }; + PPC_CONFIG PPCConfig; + + // Load game + Game = LoadROMSetFromZIPFile(Map, GameList, zipFile, TRUE); + if (NULL == Game) + return ErrorLog("Failed to load ROM set."); + + // Perform mirroring as necessary + if (Game->vromSize < 0x4000000) // VROM is actually 64 MB + CopyRegion(vrom, Game->vromSize, 0x4000000, vrom, Game->vromSize); + if (Game->cromSize < 0x800000) // low part of fixed CROM region contains CROM0 + CopyRegion(crom, 0, 0x800000-Game->cromSize, &crom[0x800000], 0x800000); + if (Game->mirrorLow64MB) // for games w/ 64 MB or less banked CROM, mirror to upper 128 MB + CopyRegion(&crom[0x800000], 0x4000000, 0x8000000, &crom[0x800000], 0x4000000); + + // Byte reverse the PowerPC ROMs (convert to little endian words) + Reverse32(crom, 0x800000+0x8000000); + + // Byte swap 68K ROMs + Reverse16(soundROM, 0x80000); + Reverse16(sampleROM, 0x800000); // is this correct? + + // Initialize CPU and configure hardware (CPU speed is set in Init()) + if (Game->step >= 0x20) // Step 2.0+ + { + PPCConfig.pvr = PPC_MODEL_603R; // 166 MHz + PPCConfig.bus_frequency = BUS_FREQUENCY_66MHZ; + PPCConfig.bus_frequency_multiplier = 0x25; // 2.5X multiplier + PCIBridge.SetModel(0x106); // MPC106 + } + else if (Game->step == 0x15) // Step 1.5 + { + PPCConfig.pvr = PPC_MODEL_603E; // 100 MHz + PPCConfig.bus_frequency = BUS_FREQUENCY_66MHZ; + PPCConfig.bus_frequency_multiplier = 0x15; // 1.5X multiplier + PCIBridge.SetModel(0x105); // MPC105 + } + else if (Game->step == 0x10) // Step 1.0 + { + PPCConfig.pvr = PPC_MODEL_603R; // 66 MHz + PPCConfig.bus_frequency = BUS_FREQUENCY_66MHZ; + PPCConfig.bus_frequency_multiplier = 0x10; // 1X multiplier + PCIBridge.SetModel(0x105); // MPC105 + } + else + return ErrorLog("Game uses an unrecognized stepping (%d.%d), cannot configure Model 3.", (Game->step>>4)&0xF, Game->step&0xF); + + GPU.SetStep(Game->step); + + ppc_init(&PPCConfig); + ppc_attach_bus(this); + + PPCFetchRegions[0].start = 0; + PPCFetchRegions[0].end = 0x007FFFFF; + PPCFetchRegions[0].ptr = (UINT32 *) ram; + PPCFetchRegions[1].start = 0xFF800000; + PPCFetchRegions[1].end = 0xFFFFFFFF; + PPCFetchRegions[1].ptr = (UINT32 *) crom; + PPCFetchRegions[2].start = 0; + PPCFetchRegions[2].end = 0; + PPCFetchRegions[2].ptr = NULL; + + ppc_set_fetch(PPCFetchRegions); + + // Apply ROM patches + Patch(); + + // Print game information + printf(" Title: %s\n", Game->title); + printf(" ROM Set: %s\n", Game->id); + printf(" Manufacturer: %s\n", Game->mfgName); + printf(" Year: %d\n", Game->year); + printf(" Step: %d.%d\n", (Game->step>>4)&0xF, Game->step&0xF); + printf("\n"); + return OKAY; +} + +void CModel3::AttachRenderers(CRender2D *Render2DPtr, CRender3D *Render3DPtr) +{ + TileGen.AttachRenderer(Render2DPtr); + GPU.AttachRenderer(Render3DPtr); +} + +void CModel3::AttachInputs(CInputs *InputsPtr) +{ + Inputs = InputsPtr; + + DebugLog("Model 3 attached inputs\n"); +} + +BOOL CModel3::Init(unsigned ppcFrequencyParam) +{ + float memSizeMB = (float)MEMORY_POOL_SIZE/(float)0x100000; + + // PowerPC frequency + ppcFrequency = ppcFrequencyParam; + if (ppcFrequency < 1000000) + ppcFrequency = 1000000; + + // Allocate all memory for ROMs and PPC RAM + memoryPool = new(std::nothrow) UINT8[MEMORY_POOL_SIZE]; + if (NULL == memoryPool) + return ErrorLog("Insufficient memory for Model 3 object (needs %1.1f MB).", memSizeMB); + + // Set up pointers + ram = &memoryPool[OFFSET_RAM]; + crom = &memoryPool[OFFSET_CROM]; + vrom = &memoryPool[OFFSET_VROM]; + soundROM = &memoryPool[OFFSET_SOUNDROM]; + sampleROM = &memoryPool[OFFSET_SAMPLEROM]; + backupRAM = &memoryPool[OFFSET_BACKUPRAM]; + securityRAM = &memoryPool[OFFSET_SECURITYRAM]; + SetCROMBank(0xFF); + + // Initialize other devices + IRQ.Init(); + PCIBridge.Init(); + PCIBus.Init(); + SCSI.Init(this,&IRQ,0x100); // SCSI is actually a non-maskable interrupt, so we give it a bit number outside of 8-bit range + RTC.Init(); + EEPROM.Init(); + if (OKAY != TileGen.Init(&IRQ)) + return FAIL; + if (OKAY != GPU.Init(vrom,this,&IRQ,0x100)) // same for Real3D DMA interrupt + return FAIL; + if (OKAY != SoundBoard.Init(soundROM,sampleROM,&IRQ,0x40)) + return FAIL; + + PCIBridge.AttachPCIBus(&PCIBus); + PCIBus.AttachDevice(13,&GPU); + PCIBus.AttachDevice(14,&SCSI); + PCIBus.AttachDevice(16,this); + + DebugLog("Initialized Model 3 (allocated %1.1f MB)\n", memSizeMB); + return OKAY; +} + +CModel3::CModel3(void) +{ + // Initialize pointers so dtor can know whether to free them + memoryPool = NULL; + + // Various uninitialized pointers + Game = NULL; + ram = NULL; + crom = NULL; + vrom = NULL; + soundROM = NULL; + sampleROM = NULL; + cromBank = NULL; + backupRAM = NULL; + securityRAM = NULL; + + securityPtr = 0; + + DebugLog("Built Model 3\n"); +} + +CModel3::~CModel3(void) +{ + // Dump some files first +#if 0 + Dump("ram", ram, 0x800000, TRUE, FALSE); + //Dump("vrom", vrom, 0x4000000, TRUE, FALSE); + //Dump("crom", crom, 0x800000, TRUE, FALSE); + //Dump("bankedCrom", &crom[0x800000], 0x7000000, TRUE, FALSE); + Dump("soundROM", soundROM, 0x80000, FALSE, TRUE); + Dump("sampleROM", sampleROM, 0x800000, FALSE, TRUE); +#endif + + if (memoryPool != NULL) + { + delete [] memoryPool; + memoryPool = NULL; + } + + Game = NULL; + ram = NULL; + crom = NULL; + vrom = NULL; + soundROM = NULL; + sampleROM = NULL; + cromBank = NULL; + backupRAM = NULL; + securityRAM = NULL; + + DebugLog("Destroyed Model 3\n"); +} diff --git a/Model3/Model3.h b/Model3/Model3.h new file mode 100644 index 0000000..b418a6b --- /dev/null +++ b/Model3/Model3.h @@ -0,0 +1,318 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Model3.h + * + * Header file defining the CModel3 and CModel3Inputs classes. + */ + +#ifndef INCLUDED_MODEL3_H +#define INCLUDED_MODEL3_H + +#include "Inputs/Inputs.h" + +/* + * CModel3: + * + * A complete Model 3 system. + * + * Inherits CBus in order to pass the address space handlers to devices that + * may need them (CPU, DMA, etc.) + * + * NOTE: Currently NOT re-entrant due to a non-OOP PowerPC core. Do NOT create + * create more than one CModel3 object! + */ +class CModel3: public CBus, public CPCIDevice +{ +public: + /* + * ReadPCIConfigSpace(device, reg, bits, offset): + * + * Handles unknown PCI devices. See CPCIDevice definition for more details. + * + * Parameters: + * device Device number. + * reg Register number. + * bits Bit width of access (8, 16, or 32 only).; + * offset Byte offset within register, aligned to the specified bit + * width, and offset from the 32-bit aligned base of the + * register number. + * + * Returns: + * Register data. + */ + UINT32 ReadPCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned width); + + /* + * WritePCIConfigSpace(device, reg, bits, offset, data): + * + * Handles unknown PCI devices. See CPCIDevice definition for more details. + * + * Parameters: + * device Device number. + * reg Register number. + * bits Bit width of access (8, 16, or 32 only). + * offset Byte offset within register, aligned to the specified bit + * width, and offset from the 32-bit aligned base of the + * register number. + * data Data. + */ + void WritePCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned width, UINT32 data); + + /* + * Read8(addr): + * Read16(addr): + * Read32(addr): + * Read64(addr): + * + * Read a byte, 16-bit half word, 32-bit word, or 64-bit double word from + * the PowerPC address space. This implements the PowerPC address bus. Note + * that it is big endian, so when accessing from a little endian device, + * the byte order must be manually reversed. + * + * Parameters: + * addr Address to read. + * + * Returns: + * Data at the address. + */ + UINT8 Read8(UINT32 addr); + UINT16 Read16(UINT32 addr); + UINT32 Read32(UINT32 addr); + UINT64 Read64(UINT32 addr); + + /* + * Write8(addr, data): + * Write16(addr, data): + * Write32(addr, data): + * Write64(addr, data): + * + * Write a byte, half word, word, or double word to the PowerPC address + * space. Note that everything is stored in big endian form, so when + * accessing with a little endian device, the byte order must be manually + * reversed. + * + * Parameters: + * addr Address to write. + * data Data to write. + */ + void Write8(UINT32 addr, UINT8 data); + void Write16(UINT32 addr, UINT16 data); + void Write32(UINT32 addr, UINT32 data); + void Write64(UINT32 addr, UINT64 data); + + /* + * SaveState(SaveState): + * + * Saves an image of the current state. + * + * Parameters: + * SaveState Block file to save state information to. + */ + void SaveState(CBlockFile *SaveState); + + /* + * LoadState(SaveState): + * + * Loads and resumes execution from a state image. + * + * Parameters: + * SaveState Block file to load state information from. + */ + void LoadState(CBlockFile *SaveState); + + /* + * SaveNVRAM(NVRAM): + * + * Saves an image of the current NVRAM state. + * + * Parameters: + * NVRAM Block file to save NVRAM to. + */ + void SaveNVRAM(CBlockFile *NVRAM); + + /* + * LoadNVRAM(NVRAM): + * + * Loads an NVRAM image. + * + * Parameters: + * NVRAM Block file to load NVRAM state from. + */ + void LoadNVRAM(CBlockFile *NVRAM); + + /* + * ClearNVRAM(void): + * + * Clears all NVRAM (backup RAM and EEPROM). + */ + void ClearNVRAM(void); + + /* + * RunFrame(void): + * + * Runs one frame (assuming 60 Hz video refresh rate). + */ + void RunFrame(void); + + /* + * Reset(void): + * + * Resets the system. Does not modify non-volatile memory. + */ + void Reset(void); + + /* + * GetGameInfo(void): + * + * Returns: + * A pointer to the presently loaded game's information structure (or + * NULL if no ROM set has yet been loaded). + */ + const struct GameInfo * GetGameInfo(void); + + /* + * LoadROMSet(GameList, zipFile): + * + * Loads a complete ROM set from the specified ZIP archive. + * + * Parameters: + * GameList List of all supported games and their ROMs. + * zipFile ZIP file to load from. + * + * Returns: + * OKAY if successful, FAIL otherwise. Prints errors. + */ + BOOL LoadROMSet(const struct GameInfo *GameList, const char *zipFile); + + /* + * AttachRenderers(Render2DPtr, Render3DPtr): + * + * Attaches the renderers to the appropriate device objects. + * + * Parameters: + * Render2DPtr Pointer to a tile renderer object. + * Render3DPtr Same as above but for a 3D renderer. + */ + void AttachRenderers(CRender2D *Render2DPtr, CRender3D *Render3DPtr); + + /* + * AttachInputs(InputsPtr): + * + * Attaches OSD-managed inputs. + * + * Parameters: + * InputsPtr Pointer to the object containing input states. + */ + void AttachInputs(CInputs *InputsPtr); + + /* + * Init(ppcFrequencyParam): + * + * One-time initialization of the context. Must be called prior to all + * other members. Allocates memory and initializes device states. + * + * Parameters: + * ppcFrequencyParam PowerPC frequency in Hz. If less than 1 MHz, + * will be clamped to 1 MHz. + * + * Returns: + * OKAY is successful, otherwise FAILED if a non-recoverable error + * occurred. Prints own error messages. + */ + BOOL Init(unsigned ppcFrequencyParam); + + /* + * CModel3(void): + * ~CModel3(void): + * + * Constructor and destructor for Model 3 class. Constructor performs a + * bare-bones initialization of object; does not perform any memory + * allocation or any actions that can fail. The destructor will deallocate + * memory and free resources used by the object (and its child objects). + */ + CModel3(void); + ~CModel3(void); + + /* + * Private Property. + * Tresspassers will be shot! ;) + */ +private: + + // Private member functions + UINT8 ReadInputs(unsigned reg); + void WriteInputs(unsigned reg, UINT8 data); + UINT32 ReadSecurity(unsigned reg); + void WriteSecurity(unsigned reg, UINT32 data); + void SetCROMBank(unsigned idx); + UINT8 ReadSystemRegister(unsigned reg); + void WriteSystemRegister(unsigned reg, UINT8 data); + void Patch(void); + + // Game and hardware information + const struct GameInfo *Game; + + // Game inputs + CInputs *Inputs; + + // Input registers (game controls) + UINT8 inputBank; + UINT8 serialFIFO1, serialFIFO2; + UINT8 gunReg; + int adcChannel; + + // Emulated core Model 3 memory regions + UINT8 *memoryPool; // single allocated region for all ROM and system RAM + UINT8 *ram; // 8 MB PowerPC RAM + UINT8 *crom; // 8+128 MB CROM (fixed CROM first, then 64MB of banked CROMs -- Daytona2 might need extra?) + UINT8 *vrom; // 64 MB VROM (video ROM, visible only to Real3D) + UINT8 *soundROM; // 512 KB sound ROM (68K program) + UINT8 *sampleROM; // 8 MB samples (68K) + UINT8 *backupRAM; // 128 KB Backup RAM (battery backed) + UINT8 *securityRAM; // 128 KB Security Board RAM + + // Banked CROM + UINT8 *cromBank; // currently mapped in CROM bank + unsigned cromBankReg; // the CROM bank register + + // Security device + unsigned securityPtr; // pointer to current offset in security data + + // PowerPC + PPC_FETCH_REGION PPCFetchRegions[3]; + unsigned ppcFrequency; // clock frequency (Hz) + + // Other devices + CIRQ IRQ; // Model 3 IRQ controller + CMPC10x PCIBridge; // MPC10x PCI/bridge/memory controller + CPCIBus PCIBus; // Model 3's PCI bus + C53C810 SCSI; // NCR 53C810 SCSI controller + CRTC72421 RTC; // Epson RTC-72421 real-time clock + C93C46 EEPROM; // 93C46 EEPROM + CTileGen TileGen; // Sega 2D tile generator + CReal3D GPU; // Real3D graphics hardware + CSoundBoard SoundBoard; // sound board +}; + + +#endif // INCLUDED_MODEL3_H diff --git a/Model3/PCI.cpp b/Model3/PCI.cpp new file mode 100644 index 0000000..3551f6b --- /dev/null +++ b/Model3/PCI.cpp @@ -0,0 +1,154 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * PCI.cpp + * + * PCI bus and device emulation. Implementation of the CPCIBus class. + * CPCIDevice is just a base class from which others are derived. Only the + * transfer of PCI register data is emulated. Device functionality is + * handled by device objects (derived from CPCIDevice). + * + * TO-DO List: + * ----------- + * - Exception handling for out-of-memory errors in STL? Right now, we assume + * the vectors do not run out of memory because so few PCI devices exist. + */ + +#include "Supermodel.h" + + +/****************************************************************************** + Emulation Functions +******************************************************************************/ + +/* + * CPCIBus::ReadConfigSpace(device, reg, bits offset): + * + * Reads a PCI register belonging to a particular device. + */ +UINT32 CPCIBus::ReadConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned offset) +{ + unsigned i; + + // Alignment check +#ifdef DEBUG + if (((bits==16)&&(offset&1)) || ((bits==32)&&(offset&3))) + ErrorLog("Misaligned PCI read request (device=%d,reg=%X,offset=%d)\n", device, reg, offset); +#endif + + // Search device vector for a matching device + for (i = 0; i < DeviceVector.size(); i++) + { + if (DeviceVector[i].device == device) + return DeviceVector[i].DeviceObject->ReadPCIConfigSpace(device, reg, bits, offset); + } + + DebugLog("PCI read request for unknown device (device=%d,reg=%X)\n", device, reg); + return 0; +} + +/* + * CPCIBus::WriteConfigSpace(device, reg, bits, offset, data): + * + * Writes to the PCI configuration space register belonging to a particular + * device. + */ +void CPCIBus::WriteConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned offset, UINT32 data) +{ + unsigned i; + + // Search device vector for a matching device + for (i = 0; i < DeviceVector.size(); i++) + { + if (DeviceVector[i].device == device) + { + DeviceVector[i].DeviceObject->WritePCIConfigSpace(device, reg, bits, offset, data); + return; + } + } + +// printf("PCI write request for unknown device (device=%d, reg=%X, data=%X)\n", device, reg, data); + DebugLog("PCI write request for unknown device (device=%d, reg=%X, data=%X)\n", device, reg, data); +} + +/* + * CPCIBus::Reset(): + * + * Resets the PCI bus emulation only. The devices attached to the bus are NOT + * reset or accessed. + */ +void CPCIBus::Reset(void) +{ + // this function really only exists for consistency with other device classes +} + + +/****************************************************************************** + Configuration, Initialization, and Shutdown +******************************************************************************/ + +/* + * CPCIBus::AttachDevice(device, DeviceObjectPtr): + * + * Attaches a device to the PCI bus. This means it is added to a list of + * devices to scan when handling PCI configuration space requests. + */ +void CPCIBus::AttachDevice(unsigned device, CPCIDevice *DeviceObjectPtr) +{ + struct DeviceObjectLink D; + + D.device = device; + D.DeviceObject = DeviceObjectPtr; + DeviceVector.push_back(D); + + DebugLog("Attached device %d to PCI bus\n", device); +} + +/* + * CPCIBus::Init(): + * + * This must be called first and only once during the lifetime of the class. + */ +void CPCIBus::Init(void) +{ + DeviceVector.clear(); +} + +/* + * CPCIBus::CPCIBus(void): + * + * Constructor. + */ +CPCIBus::CPCIBus(void) +{ + DebugLog("Built PCI bus\n"); +} + +/* + * CPCIBus::~CPCIBus(void): + * + * Destructor. + */ +CPCIBus::~CPCIBus(void) +{ + DebugLog("Destroyed PCI bus\n"); +} diff --git a/Model3/PCI.h b/Model3/PCI.h new file mode 100644 index 0000000..e22ba07 --- /dev/null +++ b/Model3/PCI.h @@ -0,0 +1,190 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * PCI.h + * + * Header file for PCI bus and device emulation. Defines the CPCIDevice and + * CPCIBus classes. + * + * References + * ---------- + * 1. "MPC106 PCI/Bridge/Memory Controller User's Manual" (MPC106UM/D Rev.1) + * Sec.7.4.5 describes the PCI configuration space header, which CPCIDevice- + * derived classes are supposed to implement. + */ + +#ifndef INCLUDED_PCI_H +#define INCLUDED_PCI_H + +#include + +using namespace std; + + +/* + * CPCIDevice: + * + * An abstract base class for PCI devices. Devices can inherit this class to + * provide PCI configuration space access handlers. + */ +class CPCIDevice +{ +public: + /* + * ReadPCIConfigSpace(reg, bits, offset): + * + * Reads a PCI configuration space register. Returns data in big endian + * form (little endian devices must byte reverse it). + * + * Parameters: + * device The device number. This is system-specific and ought to be + * ignored in most cases (devices ought to know what they + * are) but is provided in case multiple devices are handled + * by the same object. + * reg Register number (32-bit offset). + * bits Width of access (8, 16, or 32 only). + * offset Byte offset within register, aligned to bit width of + * access. For bytes, can be 0, 1, 2, or 3, but for 16-bit + * words can only be 0 or 2. Offsets are relative to the base + * of the 32-bit aligned register address, so register must be + * ANDed with ~3 first by caller. + * + * Returns: + * Register data. Bit width will be the same as specified by 'bits'. + */ + virtual UINT32 ReadPCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned offset) = 0; + + /* + * WritePCIConfigSpace(reg, bits, offset, data): + * + * Writes to a PCI configuration space register. + * + * Parameters: + * device Device number. + * reg Register number (32-bit offset). + * bits Width of access (8, 16, or 32 only). + * offset Byte offset within register, aligned to bit width of + * access. + * data Data. Interpreted according to specified bit width. + */ + virtual void WritePCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned offset, UINT32 data) = 0; +}; + +/* + * CPCIBus: + * + * A PCI bus. Dispatches commands to various attached devices. Because PCI + * configuration space access is not a critical or frequently-used function, + * dedicated 8-, 16-, and 32-bit handlers are not provided. Rather, the access + * size is passed to the handler to respond accordingly. + */ +class CPCIBus +{ +public: + + /* + * ReadConfigSpace(device, reg, bits, offset): + * + * Reads a PCI configuration space register belonging to a particular + * device. + * + * Parameters: + * device PCI device ID. + * reg Register number. + * bits Width of access (8, 16, or 32 only). + * offset Byte offset within register, aligned to bit width of + * access. Offsets are relative to the base of the 32-bit + * aligned register address, so register must be ANDed with ~3 + * first by caller. + * + * Returns: + * Register data. Bit width will be the same as specified by 'bits'. + */ + UINT32 ReadConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned offset); + + /* + * WriteConfigSpace(device, reg, bits, offset, data): + * + * Writes a PCI configuration space register. + * + * Parameters: + * device PCI device ID. + * reg Register number. + * bits Width of access (8, 16, or 32 only). + * offset Byte offset within register, aligned to bit width of + * access. + * data Data being written. Interpreted according to bit width. + */ + void WriteConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned offset, UINT32 data); + + /* + * Reset(void): + * + * Resets the PCI bus emulation. Does not reset or access any devices + * attached to the PCI bus. These must be reset manually. + */ + void Reset(void); + + /* + * AttachDevice(device, DeviceObjectPtr): + * + * Attaches a device to the PCI bus. This means it is added to a list of + * devices to scan when handling PCI configuration space requests. + * + * Parameters: + * device PCI ID of the device being attached. + * DeviceObjectPtr Pointer to the device object. + */ + void AttachDevice(unsigned device, CPCIDevice *DeviceObjectPtr); + + /* + * Init(void): + * + * One-time initialization of the context. Must be called prior to all + * other members. + */ + void Init(void); + + /* + * CPCIBus(void): + * ~CPCIBus(void): + * + * Constructor and destructor. + */ + CPCIBus(void); + ~CPCIBus(void); + +private: + + // Map device IDs to objects + struct DeviceObjectLink + { + unsigned device; + CPCIDevice *DeviceObject; + }; + + // An array of device objects + vector DeviceVector; +}; + + +#endif // INCLUDED_PCI_H diff --git a/Model3/RTC72421.cpp b/Model3/RTC72421.cpp new file mode 100644 index 0000000..a2ffc3d --- /dev/null +++ b/Model3/RTC72421.cpp @@ -0,0 +1,117 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * RTC72421.cpp + * + * Epson RTC-72421 implementation. + * + * TO-DO List: + * ----------- + * - Rather than returning the host system time, should compute the "virtual" + * time inside the Model 3, which could differ. + * - Writes do nothing yet. + */ + +#include +#include "Supermodel.h" + + +/****************************************************************************** + Emulation Functions +******************************************************************************/ + +UINT8 CRTC72421::ReadRegister(unsigned reg) +{ + time_t currentTime; + struct tm *Time; + + time(¤tTime); + Time = localtime(¤tTime); + + switch (reg&0xF) + { + case 0: // 1-second digit + return (Time->tm_sec % 10) & 0xF; + case 1: // 10-seconds digit + return (Time->tm_sec / 10) & 0x7; + case 2: // 1-minute digit + return (Time->tm_min % 10) & 0xF; + case 3: // 10-minute digit + return (Time->tm_min / 10) & 0x7; + case 4: // 1-hour digit + return (Time->tm_hour % 10) & 0xF; + case 5: // 10-hours digit + return (Time->tm_hour / 10) & 0x7; + case 6: // 1-day digit (days in month) + return (Time->tm_mday % 10) & 0xF; + case 7: // 10-days digit + return (Time->tm_mday / 10) & 0x3; + case 8: // 1-month digit + return ((Time->tm_mon + 1) % 10) & 0xF; + case 9: // 10-months digit + return ((Time->tm_mon + 1) / 10) & 0x1; + case 10: // 1-year digit + return (Time->tm_year % 10) & 0xF; + case 11: // 10-years digit + return ((Time->tm_year % 100) / 10) & 0xF; + case 12: // day of the week + return Time->tm_wday & 0x7; + case 13: + break; + case 14: + break; + case 15: + break; + } + + return 0; +} + +void CRTC72421::WriteRegister(unsigned reg, UINT8 data) +{ + // TO-DO: emulate me! +} + +void CRTC72421::Reset(void) +{ + // nothing to do +} + + +/****************************************************************************** + Initialization and Shutdown +******************************************************************************/ + +void CRTC72421::Init(void) +{ + // this function really only exists for consistency with other device classes +} + +CRTC72421::CRTC72421(void) +{ + DebugLog("Built RTC-72421\n"); +} + +CRTC72421::~CRTC72421(void) +{ + DebugLog("Destroyed RTC-72421\n"); +} diff --git a/Model3/RTC72421.h b/Model3/RTC72421.h new file mode 100644 index 0000000..e9d342c --- /dev/null +++ b/Model3/RTC72421.h @@ -0,0 +1,91 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * RTC72421.h + * + * Header file defining the CRTC72421 class: RTC-72421 real-time clock. + */ + +#ifndef INCLUDED_RTC72421_H +#define INCLUDED_RTC72421_H + + +/* + * CRTC72421: + * + * Epson RTC-72421 real-time clock. + */ +class CRTC72421 +{ +public: + /* + * ReadRegister(unsigned reg): + * + * Reads data from one of the RTC registers. + * + * Parameters: + * reg Register number (0-15). + * + * Returns: + * Data in the lower nibble. + */ + UINT8 ReadRegister(unsigned reg); + + /* + * WriteRegister(unsigned reg, UINT8 data): + * + * Writes data to one of the RTC registers. + * + * Parameters: + * reg Register number (0-15). + * data Data to write. + */ + void WriteRegister(unsigned reg, UINT8 data); + + /* + * Reset(void): + * + * Does nothing. Provided for compability with other device objects. The + * RTC is battery-backed and always available. + */ + void Reset(void); + + /* + * Init(void): + * + * One-time initialization of the context. Must be called prior to all + * other members. + */ + void Init(void); + + /* + * CRTC72421(void): + * ~CRTC72421(void): + * + * Constructor and destructor. + */ + CRTC72421(void); + ~CRTC72421(void); +}; + + +#endif // INCLUDED_RTC72421_H diff --git a/Model3/Real3D.cpp b/Model3/Real3D.cpp new file mode 100644 index 0000000..6c7478d --- /dev/null +++ b/Model3/Real3D.cpp @@ -0,0 +1,945 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Real3D.cpp + * + * The Model 3's Real3D-based graphics hardware. Based on the Real3D Pro-1000 + * family of image generators. + * + * PCI IDs + * ------- + * It appears that Step 2.0 returns a different PCI ID depending on whether + * the PCI configuration space or DMA register are accessed. For example, + * Virtual On 2 expects 0x178611DB from the PCI configuration header but + * 0x16C311DB from the DMA device. + * + * To-Do List + * ---------- + * - For consistency, the status registers should probably be byte reversed (this is a + * little endian device), forcing the Model3 Read32/Write32 handlers to + * manually reverse the data. This keeps with the convention for VRAM. + * - Keep an eye out for games writing non-mipmap textures to the mipmap area. + * The render currently cannot cope with this. + */ + +#include +#include "Supermodel.h" + +// Offsets of memory regions within Real3D memory pool +#define OFFSET_8C 0 // 4 MB, culling RAM low (at 0x8C000000) +#define OFFSET_8E 0x400000 // 1 MB, culling RAM high (at 0x8E000000) +#define OFFSET_98 0x500000 // 4 MB, polygon RAM (at 0x98000000) +#define OFFSET_TEXRAM 0x900000 // 8 MB, texture RAM +#define OFFSET_TEXFIFO 0x1100000 // 1 MB, texture FIFO +#define MEMORY_POOL_SIZE (0x400000+0x100000+0x400000+0x800000+0x100000) + + +/****************************************************************************** + Save States +******************************************************************************/ + +void CReal3D::SaveState(CBlockFile *SaveState) +{ + SaveState->NewBlock("Real3D", __FILE__); + + SaveState->Write(memoryPool, MEMORY_POOL_SIZE); + SaveState->Write(&fifoIdx, sizeof(fifoIdx)); + SaveState->Write(&vromTextureAddr, sizeof(vromTextureAddr)); + SaveState->Write(&vromTextureHeader, sizeof(vromTextureHeader)); + + SaveState->Write(&dmaSrc, sizeof(dmaSrc)); + SaveState->Write(&dmaDest, sizeof(dmaDest)); + SaveState->Write(&dmaLength, sizeof(dmaLength)); + SaveState->Write(&dmaData, sizeof(dmaData)); + SaveState->Write(&dmaUnknownReg, sizeof(dmaUnknownReg)); + SaveState->Write(&dmaStatus, sizeof(dmaStatus)); + SaveState->Write(&dmaConfig, sizeof(dmaConfig)); + + SaveState->Write(&tapCurrentInstruction, sizeof(tapCurrentInstruction)); + SaveState->Write(&tapIR, sizeof(tapIR)); + SaveState->Write(tapID, sizeof(tapID)); + SaveState->Write(&tapIDSize, sizeof(tapIDSize)); + SaveState->Write(&tapTDO, sizeof(tapTDO)); + SaveState->Write(&tapState, sizeof(tapState)); +} + +void CReal3D::LoadState(CBlockFile *SaveState) +{ + if (OKAY != SaveState->FindBlock("Real3D")) + { + ErrorLog("Unable to load Real3D GPU state. Save state file is corrupted."); + return; + } + + SaveState->Read(memoryPool, MEMORY_POOL_SIZE); + Render3D->UploadTextures(0,0,2048,2048); + SaveState->Read(&fifoIdx, sizeof(fifoIdx)); + SaveState->Read(&vromTextureAddr, sizeof(vromTextureAddr)); + SaveState->Read(&vromTextureHeader, sizeof(vromTextureHeader)); + + SaveState->Read(&dmaSrc, sizeof(dmaSrc)); + SaveState->Read(&dmaDest, sizeof(dmaDest)); + SaveState->Read(&dmaLength, sizeof(dmaLength)); + SaveState->Read(&dmaData, sizeof(dmaData)); + SaveState->Read(&dmaUnknownReg, sizeof(dmaUnknownReg)); + SaveState->Read(&dmaStatus, sizeof(dmaStatus)); + SaveState->Read(&dmaConfig, sizeof(dmaConfig)); + + SaveState->Read(&tapCurrentInstruction, sizeof(tapCurrentInstruction)); + SaveState->Read(&tapIR, sizeof(tapIR)); + SaveState->Read(tapID, sizeof(tapID)); + SaveState->Read(&tapIDSize, sizeof(tapIDSize)); + SaveState->Read(&tapTDO, sizeof(tapTDO)); + SaveState->Read(&tapState, sizeof(tapState)); +} + + +/****************************************************************************** + Rendering +******************************************************************************/ + +void CReal3D::RenderFrame(void) +{ + //if (commandPortWritten) + Render3D->RenderFrame(); + commandPortWritten = FALSE; +} + +void CReal3D::BeginFrame(void) +{ + status |= 2; // VBlank bit + Render3D->BeginFrame(); +} + +void CReal3D::EndFrame(void) +{ + status &= ~2; + Render3D->EndFrame(); +} + +/****************************************************************************** + DMA Device + + Register 0xC: + ------------- + +---+---+---+---+---+---+---+---+ + |BUS|???|???|???|???|???|???|IRQ| + +---+---+---+---+---+---+---+---+ + BUS: Busy (see von2 0x18A104) if 1. + IRQ: IRQ pending. +******************************************************************************/ + +void CReal3D::DMACopy(void) +{ + DebugLog("Real3D DMA copy (PC=%08X, LR=%08X): %08X -> %08X, %X %s\n", ppc_get_pc(), ppc_get_lr(), dmaSrc, dmaDest, dmaLength*4, (dmaConfig&0x80)?"(byte reversed)":""); + //printf("Real3D DMA copy (PC=%08X, LR=%08X): %08X -> %08X, %X %s\n", ppc_get_pc(), ppc_get_lr(), dmaSrc, dmaDest, dmaLength*4, (dmaConfig&0x80)?"(byte reversed)":""); + if ((dmaConfig&0x80)) // reverse bytes + { + while (dmaLength != 0) + { + UINT32 data = Bus->Read32(dmaSrc); + Bus->Write32(dmaDest, FLIPENDIAN32(data)); + dmaSrc += 4; + dmaDest += 4; + --dmaLength; + } + } + else + { + while (dmaLength != 0) + { + Bus->Write32(dmaDest, Bus->Read32(dmaSrc)); + dmaSrc += 4; + dmaDest += 4; + --dmaLength; + } + } +} + +UINT8 CReal3D::ReadDMARegister8(unsigned reg) +{ + switch (reg) + { + case 0xC: // status + return dmaStatus; + case 0xE: // configuration + return dmaConfig; + default: + break; + } + + DebugLog("Real3D: ReadDMARegister8: reg=%X\n", reg); + return 0; +} + +void CReal3D::WriteDMARegister8(unsigned reg, UINT8 data) +{ + switch (reg) + { + case 0xD: // IRQ acknowledge + if ((data&1)) + { + dmaStatus &= ~1; + IRQ->Deassert(dmaIRQ); + } + break; + case 0xE: // configuration + dmaConfig = data; + break; + default: + DebugLog("Real3D: WriteDMARegister8: reg=%X, data=%02X\n", reg, data); + break; + } + //DebugLog("Real3D: WriteDMARegister8: reg=%X, data=%02X\n", reg, data); +} + +UINT32 CReal3D::ReadDMARegister32(unsigned reg) +{ + switch (reg) + { + case 0x14: // command result + return dmaData; + default: + break; + } + + DebugLog("Real3D: ReadDMARegister32: reg=%X\n", reg); + return 0; +} + +void CReal3D::WriteDMARegister32(unsigned reg, UINT32 data) +{ + switch (reg) + { + case 0x00: // DMA source address + dmaSrc = data; + break; + case 0x04: // DMA destination address + dmaDest = data; + break; + case 0x08: // DMA length + dmaLength = data; + DMACopy(); + dmaStatus |= 1; + IRQ->Assert(dmaIRQ); + break; + case 0x10: // command register + if ((data&0x20000000)) + { + dmaData = 0x16C311DB; // Virtual On 2 expects this from DMA + DebugLog("Real3D: DMA ID command issued (ATTENTION: make sure we're returning the correct value), PC=%08X, LR=%08X\n", ppc_get_pc(), ppc_get_lr()); + } + else if ((data&0x80000000)) + { + dmaUnknownReg ^= 0xFFFFFFFF; + dmaData = dmaUnknownReg; + } + break; + case 0x14: // ? + dmaData = 0xFFFFFFFF; + break; + default: + DebugLog("Real3D: WriteDMARegister32: reg=%X, data=%08X\n", reg, data); + break; + } + //DebugLog("Real3D: WriteDMARegister32: reg=%X, data=%08X\n", reg, data); +} + +/****************************************************************************** + JTAG Test Access Port Simulation + + What I term as "IDs" here are really boundary scan values. +******************************************************************************/ + +static const int tapFSM[][2] = // finite state machine, each state can lead to 2 next states + { + { 1, 0 }, // 0 Test-Logic/Reset + { 1, 2 }, // 1 Run-Test/Idle + { 3, 9 }, // 2 Select-DR-Scan + { 4, 5 }, // 3 Capture-DR + { 4, 5 }, // 4 Shift-DR + { 6, 8 }, // 5 Exit1-DR + { 6, 7 }, // 6 Pause-DR + { 4, 8 }, // 7 Exit2-DR + { 1, 2 }, // 8 Update-DR + { 10, 0 }, // 9 Select-IR-Scan + { 11, 12 }, // 10 Capture-IR + { 11, 12 }, // 11 Shift-IR + { 13, 15 }, // 12 Exit1-IR + { 13, 14 }, // 13 Pause-IR + { 11, 15 }, // 14 Exit2-IR + { 1, 2 } // 15 Update-IR + }; + +/* + * InsertBit(): + * + * Inserts a bit into an arbitrarily long bit field. Bit 0 is assumed to be + * the MSB of the first byte in the buffer. + */ +void CReal3D::InsertBit(UINT8 *buf, unsigned bitNum, unsigned bit) +{ + unsigned bitInByte; + + bitInByte = 7 - (bitNum & 7); + + buf[bitNum / 8] &= ~(1 << bitInByte); + buf[bitNum / 8] |= (bit << bitInByte); +} + +/* + * InsertID(): + * + * Inserts a 32-bit ID code into the ID bit field. + */ +void CReal3D::InsertID(UINT32 id, unsigned startBit) +{ + int i; + + for (i = 31; i >= 0; i--) + InsertBit(tapID, startBit++, (id >> i) & 1); +} + +/* + * Shift(): + * + * Shifts the data buffer right (towards LSB at byte 0) by 1 bit. The size of + * the number of bits must be specified. The bit shifted out of the LSB is + * returned. + */ +unsigned CReal3D::Shift(UINT8 *data, unsigned numBits) +{ + unsigned i; + unsigned shiftOut, shiftIn; + + // This loop takes care of all the fully-filled bytes + shiftIn = 0; + shiftOut = 0; + for (i = 0; i < numBits / 8; i++) + { + shiftOut = data[i] & 1; + data[i] >>= 1; + data[i] |= (shiftIn << 7); + shiftIn = shiftOut; // carry over to next element's MSB + } + + // Take care of the last partial byte (if there is one) + if ((numBits & 7) != 0) + { + shiftOut = (data[i] >> (8 - (numBits & 7))) & 1; + data[i] >>= 1; + data[i] |= (shiftIn << 7); + } + + return shiftOut; +} + +unsigned CReal3D::ReadTAP(void) +{ + return tapTDO; +} + +void CReal3D::WriteTAP(unsigned tck, unsigned tms, unsigned tdi, unsigned trst) +{ + if (!tck) + return; + + // Go to next state + tapState = tapFSM[tapState][tms]; + + switch (tapState) + { + case 3: // Capture-DR + + /* + * Read ASIC IDs. + * + * The ID Sequence is: + * - Jupiter + * - Mercury + * - Venus + * - Earth + * - Mars + * - Mars (again) + * + * Note that different Model 3 steps have different chip + * revisions, hence the different IDs returned below. + * + * On Step 1.5 and 1.0, instruction 0x0C631F8C7FFE is used to retrieve + * the ID codes but Step 2.0 is a little weirder. It seems to use this + * and either the state of the TAP after reset or other instructions + * to read the IDs as well. This can be emulated in one of 2 ways: + * Ignore the instruction and always load up the data or load the + * data on TAP reset and when the instruction is issued. + */ + if (step == 0x10) + { + InsertID(0x116C7057, 1 + 0 * 32); + InsertID(0x216C3057, 1 + 1 * 32); + InsertID(0x116C4057, 1 + 2 * 32); + InsertID(0x216C5057, 1 + 3 * 32); + InsertID(0x116C6057, 1 + 4 * 32 + 1); + InsertID(0x116C6057, 1 + 5 * 32 + 1); + } + else if (step == 0x15) + { + InsertID(0x316C7057, 1 + 0 * 32); + InsertID(0x316C3057, 1 + 1 * 32); + InsertID(0x216C4057, 1 + 2 * 32); // Lost World may to use 0x016C4057 + InsertID(0x316C5057, 1 + 3 * 32); + InsertID(0x216C6057, 1 + 4 * 32 + 1); + InsertID(0x216C6057, 1 + 5 * 32 + 1); + } + else if (step >= 0x20) + { + InsertID(0x416C7057, 1 + 0 * 32); + InsertID(0x416C3057, 1 + 1 * 32); + InsertID(0x316C4057, 1 + 2 * 32); + InsertID(0x416C5057, 1 + 3 * 32); + InsertID(0x316C6057, 1 + 4 * 32 + 1); + InsertID(0x316C6057, 1 + 5 * 32 + 1); + } + + break; + + case 4: // Shift-DR + + tapTDO = Shift(tapID, tapIDSize); + break; + + case 10: // Capture-IR + + // Load lower 2 bits with 01 as per IEEE 1149.1-1990 + tapIR = 1; + break; + + case 11: // Shift-IR + + // Shift IR towards output and load in new data from TDI + tapTDO = tapIR & 1; // shift LSB to output + tapIR >>= 1; + tapIR |= ((UINT64) tdi << 45); + break; + + case 15: // Update-IR + + /* + * Latch IR (technically, this should occur on the falling edge of + * TCK) + */ + tapIR &= 0x3FFFFFFFFFFFULL; + tapCurrentInstruction = tapIR; + break; + + default: + break; + } +} + + +/****************************************************************************** + Texture Uploading and Decoding +******************************************************************************/ + +// Mipmap coordinates for each reduction level (within a single 2048x1024 page) +static const int mipXBase[11] = +{ + 1024, // 1024/2 + 1536, // 512/2 + 1792, // 256/2 + 1920, // ... + 1984, + 2016, + 2032, + 2040, + 2044, + 2046, + 2047 +}; + +static const int mipYBase[11] = +{ + 512, + 768, + 896, + 960, + 992, + 1008, + 1016, + 1020, + 1022, + 1023, + 0 +}; + +// Mipmap reduction factors +static const int mipDivisor[9] = { 2, 4, 8, 16, 32, 64, 128, 256, 512 }; + +// Table of texel offsets corresponding to an 8x8 texel texture tile +static const unsigned decode[64] = +{ + 0, 1, 4, 5, 8, 9,12,13, + 2, 3, 6, 7,10,11,14,15, + 16,17,20,21,24,25,28,29, + 18,19,22,23,26,27,30,31, + 32,33,36,37,40,41,44,45, + 34,35,38,39,42,43,46,47, + 48,49,52,53,56,57,60,61, + 50,51,54,55,58,59,62,63 +}; + +void CReal3D::StoreTexture(unsigned xPos, unsigned yPos, unsigned width, unsigned height, UINT16 *texData, unsigned bytesPerTexel) +{ + unsigned x, y, xx, yy, destOffset; + + if (bytesPerTexel == 2) // 16-bit textures + { + // Outer 2 loops: 8x8 tiles + for (y = yPos; y < (yPos+height); y += 8) + { + for (x = xPos; x < (xPos+width); x += 8) + { + // Inner 2 loops: 8x8 texels for the current tile + destOffset = y*2048+x; + for (yy = 0; yy < 8; yy++) + { + for (xx = 0; xx < 8; xx++) + textureRAM[destOffset++] = texData[decode[(yy*8+xx)^1]]; + destOffset += 2048-8; // next line + } + texData += 8*8; // next tile + } + } + } + else // 8-bit textures + { + /* + * 8-bit textures appear to be unpacked into 16-bit words in the + * texture RAM. Oddly, the rows of the decoding table seem to be + * swapped. + */ + + // Outer 2 loops: 8x8 tiles + for (y = yPos; y < (yPos+height); y += 8) + { + for (x = xPos; x < (xPos+width); x += 8) + { + // Inner 2 loops: 8x8 texels for the current tile + destOffset = y*2048+x; + for (yy = 0; yy < 8; yy++) + { + for (xx = 0; xx < 8; xx += 2) + { + textureRAM[destOffset++] = texData[decode[(yy^1)*8+((xx+0)^1)]/2]>>8; + textureRAM[destOffset++] = texData[decode[(yy^1)*8+((xx+1)^1)]/2]&0xFF; + + } + destOffset += 2048-8; + } + texData += 8*8/2; // next tile + } + } + } +} + +// Texture data will be in little endian format +void CReal3D::UploadTexture(UINT32 header, UINT16 *texData) +{ + unsigned x, y, page, width, height, bytesPerTexel, + mipYPos, mipWidth, mipHeight, mipNum, mipX, mipY; + + + // Position: texture RAM is arranged as 2 2048x1024 texel sheets + x = 32*(header&0x3F); + y = 32*((header>>7)&0x1F); + page = (header>>20)&1; + y += page*1024; // treat page as additional Y bit (one 2048x2048 sheet) + + // Texture size and bit depth + width = 32<<((header>>14)&7); + height = 32<<((header>>17)&7); + if ((header&0x00800000)) // 16 bits per texel + bytesPerTexel = 2; + else // 8 bits + { + bytesPerTexel = 1; + //printf("8-bit textures!\n"); + } + + // Mipmaps + mipYPos = 32*((header>>7)&0x1F); + + // Process texture data + DebugLog("Real3D: Texture upload: pos=(%d,%d) size=(%d,%d), %d-bit\n", x, y, width, height, bytesPerTexel*8); + //printf("Real3D: Texture upload: pos=(%d,%d) size=(%d,%d), %d-bit\n", x, y, width, height, bytesPerTexel*8); + switch ((header>>24)&0x0F) + { + case 0x00: // texture w/ mipmaps + StoreTexture(x, y, width, height, texData, bytesPerTexel); + mipWidth = width; + mipHeight = height; + mipNum = 0; + + while((mipHeight>8) && (mipWidth>8)) + { + if (bytesPerTexel == 1) + texData += (mipWidth*mipHeight)/2; + else + texData += (mipWidth*mipHeight); + mipWidth /= 2; + mipHeight /= 2; + mipX = mipXBase[mipNum] + (x / mipDivisor[mipNum]); + mipY = mipYBase[mipNum] + (mipYPos / mipDivisor[mipNum]); + if(page) + mipY += 1024; + mipNum++; + StoreTexture(mipX, mipY, mipWidth, mipHeight, (UINT16 *) texData, bytesPerTexel); + } + + break; + case 0x01: // texture w/out mipmaps + StoreTexture(x, y, width, height, texData, bytesPerTexel); + break; + case 0x02: // mipmaps only + mipWidth = width; + mipHeight = height; + mipNum = 0; + while((mipHeight>8) && (mipWidth>8)) + { + mipWidth /= 2; + mipHeight /= 2; + mipX = mipXBase[mipNum] + (x / mipDivisor[mipNum]); + mipY = mipYBase[mipNum] + (mipYPos / mipDivisor[mipNum]); + if(page) + mipY += 1024; + mipNum++; + StoreTexture(mipX, mipY, mipWidth, mipHeight, texData, bytesPerTexel); + if (bytesPerTexel == 1) + texData += (mipWidth*mipHeight)/2; + else + texData += (mipWidth*mipHeight); + } + break; + case 0x80: // MAME thinks these might be a gamma table + //break; + default: // unknown + printf("unknown texture format %02X\n", header>>24); + break; + } + + // Signal to renderer that textures have changed + // TO-DO: mipmaps? What if a game writes non-mipmap textures to mipmap area? + //Render3D->UploadTextures(x,y,width,height); + Render3D->UploadTextures(0,0,2048,2048); // TO-DO: should not have to upload all 2048x2048 texels +} + + +/****************************************************************************** + Basic Emulation Functions, Registers, Memory, and Texture FIFO +******************************************************************************/ + +void CReal3D::Flush(void) +{ + unsigned i, size; + UINT32 header; + + commandPortWritten = TRUE; + + DebugLog("Real3D 88000000 written @ PC=%08X\n", ppc_get_pc()); + + // Upload textures (if any) + if (fifoIdx > 0) + { + for (i = 0; i < fifoIdx; ) + { + size = 2+textureFIFO[i+0]/2; + size /= 4; + header = textureFIFO[i+1]; // texture information header + UploadTexture(header,(UINT16 *)&textureFIFO[i+2]); + DebugLog("Real3D: Texture upload completed: %X bytes (%X)\n", size*4, textureFIFO[i+0]); + i += size; + } + } + + // Reset texture FIFO + fifoIdx = 0; +} + +void CReal3D::WriteTextureFIFO(UINT32 data) +{ + textureFIFO[fifoIdx++] = data; + if (fifoIdx >= (0x100000/4)) + ErrorLog("Real3D texture FIFO maxed out!"); +} + +void CReal3D::WriteTexturePort(unsigned reg, UINT32 data) +{ + //printf("Texture Port: %X=%08X\n", reg, data); + switch (reg) + { + case 0x0: // VROM texture address + case 0xC: + vromTextureAddr = data; + break; + case 0x4: // VROM texture header + case 0x10: + vromTextureHeader = data; + break; + case 0x8: // VROM texture length (also used to trigger uploads) + case 0x14: + UploadTexture(vromTextureHeader,(UINT16 *)&vrom[vromTextureAddr&0xFFFFFF]); + //printf("texture upload: addr=%08X\n", vromTextureAddr); + break; + default: + DebugLog("Real3D texture port write: %X=%08X\n", reg, data); + break; + } +} + +void CReal3D::WriteLowCullingRAM(UINT32 addr, UINT32 data) +{ + cullingRAMLo[addr/4] = data; +} + +void CReal3D::WriteHighCullingRAM(UINT32 addr, UINT32 data) +{ + cullingRAMHi[addr/4] = data; +} + +void CReal3D::WritePolygonRAM(UINT32 addr, UINT32 data) +{ + polyRAM[addr/4] = data; +} + +// Registers seem to range from 0x00 to around 0x3C but they are not understood +UINT32 CReal3D::ReadRegister(unsigned reg) +{ + DebugLog("Real3D: Read reg %X\n", reg); + if (reg == 0) + return 0xFFFFFFFD|status; + else + return 0xFFFFFFFF; +} + +UINT32 CReal3D::ReadPCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned offset) +{ + UINT32 d; + + if ((bits==8)) + { + DebugLog("Real3D: %d-bit PCI read request for reg=%02X\n", bits, reg); + return 0; + } + + // This is a little endian device, must return little endian words + switch (reg) + { + case 0x00: // Device ID and Vendor ID + d = FLIPENDIAN32(pciID); + switch (bits) + { + case 8: + d >>= (3-offset)*8; // offset will be 0-3; select appropriate byte + d &= 0xFF; + break; + case 16: + d >>= (2-offset)*8; // offset will be 0 or 2 only; select either high or low word + d &= 0xFFFF; + break; + default: + break; + } + DebugLog("Real3D: PCI ID read. Returning %X (%d-bits). PC=%08X, LR=%08X\n", d, bits, ppc_get_pc(), ppc_get_lr()); + return d; + default: + DebugLog("Real3D: PCI read request for reg=%02X (%d-bit)\n", reg, bits); + break; + } + + return 0; +} + +void CReal3D::WritePCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned offset, UINT32 data) +{ + DebugLog("Real3D: PCI %d-bit write request for reg=%02X, data=%08X\n", bits, reg, data); +} + +void CReal3D::Reset(void) +{ + commandPortWritten = FALSE; + + fifoIdx = 0; + status = 0; + vromTextureAddr = 0; + vromTextureHeader = 0; + tapState = 0; + tapIDSize = 197; + dmaStatus = 0; + dmaUnknownReg = 0; + + memset(memoryPool, 0, MEMORY_POOL_SIZE); + + DebugLog("Real3D reset\n"); +} + + +/****************************************************************************** + Configuration, Initialization, and Shutdown +******************************************************************************/ + +void CReal3D::AttachRenderer(CRender3D *Render3DPtr) +{ + Render3D = Render3DPtr; + Render3D->AttachMemory(cullingRAMLo,cullingRAMHi,polyRAM,vrom,textureRAM); + Render3D->SetStep(step); + DebugLog("Real3D attached a Render3D object\n"); +} + +void CReal3D::SetStep(int stepID) +{ + step = stepID; + if ((step!=0x10) && (step!=0x15) && (step!=0x20) && (step!=0x21)) + { + DebugLog("Real3D: Unrecognized stepping: %d.%d\n", (step>>4)&0xF, step&0xF); + step = 0x10; + } + + // Set PCI ID + if (step < 0x20) + pciID = 0x16C311DB; // vendor 0x11DB = Sega + else + pciID = 0x178611DB; + + // Pass to renderer + if (Render3D != NULL) + Render3D->SetStep(step); + + DebugLog("Real3D set to Step %d.%d\n", (step>>4)&0xF, step&0xF); +} + +BOOL CReal3D::Init(const UINT8 *vromPtr, CBus *BusObjectPtr, CIRQ *IRQObjectPtr, unsigned dmaIRQBit) +{ + float memSizeMB = (float)MEMORY_POOL_SIZE/(float)0x100000; + + // IRQ and bus objects + Bus = BusObjectPtr; + IRQ = IRQObjectPtr; + dmaIRQ = dmaIRQBit; + + // Allocate all Real3D RAM regions + memoryPool = new(std::nothrow) UINT8[MEMORY_POOL_SIZE]; + if (NULL == memoryPool) + return ErrorLog("Insufficient memory for Real3D object (needs %1.1f MB).", memSizeMB); + + // Set up pointers + cullingRAMLo = (UINT32 *) &memoryPool[OFFSET_8C]; + cullingRAMHi = (UINT32 *) &memoryPool[OFFSET_8E]; + polyRAM = (UINT32 *) &memoryPool[OFFSET_98]; + textureRAM = (UINT16 *) &memoryPool[OFFSET_TEXRAM]; + textureFIFO = (UINT32 *) &memoryPool[OFFSET_TEXFIFO]; + + // VROM pointer passed to us + vrom = (UINT32 *) vromPtr; + + return OKAY; +} + +CReal3D::CReal3D(void) +{ + Render3D = NULL; + memoryPool = NULL; + cullingRAMLo = NULL; + cullingRAMHi = NULL; + polyRAM = NULL; + textureRAM = NULL; + textureFIFO = NULL; + vrom = NULL; + fifoIdx = 0; + vromTextureAddr = 0; + vromTextureHeader = 0; + tapState = 0; + tapIDSize = 197; + DebugLog("Built Real3D\n"); +} + +/* + * CReal3D::~CReal3D(void): + * + * Destructor. + */ +CReal3D::~CReal3D(void) +{ + // Dump memory +#if 0 + FILE *fp; + fp = fopen("8c000000", "wb"); + if (NULL != fp) + { + fwrite(cullingRAMLo, sizeof(UINT8), 0x400000, fp); + fclose(fp); + printf("dumped %s\n", "8c000000"); + } + else + printf("unable to dump %s\n", "8c000000"); + fp = fopen("8e000000", "wb"); + if (NULL != fp) + { + fwrite(cullingRAMHi, sizeof(UINT8), 0x100000, fp); + fclose(fp); + printf("dumped %s\n", "8e000000"); + } + else + printf("unable to dump %s\n", "8e000000"); + fp = fopen("98000000", "wb"); + if (NULL != fp) + { + fwrite(polyRAM, sizeof(UINT8), 0x400000, fp); + fclose(fp); + printf("dumped %s\n", "98000000"); + } + else + printf("unable to dump %s\n", "98000000"); + fp = fopen("texram", "wb"); + if (NULL != fp) + { + fwrite(textureRAM, sizeof(UINT8), 0x800000, fp); + fclose(fp); + printf("dumped %s\n", "texram"); + } + else + printf("unable to dump %s\n", "texram"); +#endif + + Render3D = NULL; + if (memoryPool != NULL) + { + delete [] memoryPool; + memoryPool = NULL; + } + cullingRAMLo = NULL; + cullingRAMHi = NULL; + polyRAM = NULL; + textureRAM = NULL; + textureFIFO = NULL; + vrom = NULL; + DebugLog("Destroyed Real3D\n"); +} diff --git a/Model3/Real3D.h b/Model3/Real3D.h new file mode 100644 index 0000000..8e62f1c --- /dev/null +++ b/Model3/Real3D.h @@ -0,0 +1,398 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Real3D.h + * + * Header file defining the CReal3D class: the Model 3's Real3D-based graphics + * hardware. + */ + +#ifndef INCLUDED_REAL3D_H +#define INCLUDED_REAL3D_H + + +/* + * CReal3D: + * + * Model 3 Real3D-based graphics hardware. This class manages the hardware + * state and drives the rendering process (scene database traversal). Actual + * rasterization and matrix transformations are carried out by the graphics + * engine. + */ +class CReal3D: public CPCIDevice +{ +public: + /* + * SaveState(SaveState): + * + * Saves an image of the current device state. + * + * Parameters: + * SaveState Block file to save state information to. + */ + void SaveState(CBlockFile *SaveState); + + /* + * LoadState(SaveState): + * + * Loads and a state image. + * + * Parameters: + * SaveState Block file to load state information from. + */ + void LoadState(CBlockFile *SaveState); + + /* + * RenderFrame(void): + * + * Traverses the scene database and renders a frame. Must be called after + * BeginFrame() but before EndFrame(). + */ + void RenderFrame(void); + + /* + * BeginFrame(void): + * + * Prepare to render a new frame. Must be called once per frame prior to + * drawing anything. + */ + void BeginFrame(void); + + /* + * EndFrame(void): + * + * Signals the end of rendering for this frame. Must be called last during + * the frame. + */ + void EndFrame(void); + + /* + * Flush(void): + * + * Triggers the beginning of a new frame. All textures in the texture FIFO + * are uploaded and the FIFO is reset. On the real device, this seems to + * cause a frame to be rendered as well but this is not performed here. + * + * This should be called when the command port is written. + */ + void Flush(void); + + /* + * ReadDMARegister8(reg): + * ReadDMARegister32(reg): + * + * Reads from a DMA register. Multi-byte reads are returned as little + * endian and must be flipped if called by a big endian device. + * + * Parameters: + * reg Register number to read from (0-0xFF only). + * + * Returns: + * Data of the requested size, in little endian. + */ + UINT8 ReadDMARegister8(unsigned reg); + UINT32 ReadDMARegister32(unsigned reg); + + /* + * WriteDMARegister8(reg, data): + * WriteDMARegister32(reg, data); + * + * Write to a DMA register. Multi-byte writes by big endian devices must be + * byte reversed (this is a little endian device). + * + * Parameters: + * reg Register number to read from (0-0xFF only). + * data Data to write. + */ + void WriteDMARegister8(unsigned reg, UINT8 data); + void WriteDMARegister32(unsigned reg, UINT32 data); + + /* + * WriteLowCullingRAM(addr, data): + * + * Writes the low culling RAM region. Because this is a little endian + * device, big endian devices/buses have to take care to manually reverse + * the data before writing. + * + * Parameters: + * addr Word (32-bit) aligned address ranging from 0 to 0x3FFFFC. + * User must ensure address is properly clamped. + * data Data to write. + */ + void WriteLowCullingRAM(UINT32 addr, UINT32 data); + + /* + * WriteHighCullingRAM(addr, data): + * + * Writes the high culling RAM region. Because this is a little endian + * device, big endian devices/buses have to take care to manually reverse + * the data before writing. + * + * Parameters: + * addr Word (32-bit) aligned address ranging from 0 to 0xFFFFC. + * User must ensure address is properly clamped. + * data Data to write. + */ + void WriteHighCullingRAM(UINT32 addr, UINT32 data); + + /* + * WriteTextureFIFO(data): + * + * Writes to the 1MB texture FIFO. Because this is a little endian device, + * big endian devices/buses have to take care to manually reverse the data + * before writing. + * + * Parameters: + * data Data to write. + */ + void WriteTextureFIFO(UINT32 data); + + /* + * WriteTexturePort(reg, data): + * + * Writes to the VROM texture ports. Register 0 is the word-granular VROM + * address of the texture, register 4 is the texture information header, + * and register 8 is the size of the texture in words. + * + * Parameters: + * reg Register number: must be 0, 4, 8, 0xC, 0x10, or 0x14 only. + * data The 32-bit word to write to the register. A write to + * register 8 triggers the upload. + */ + void WriteTexturePort(unsigned reg, UINT32 data); + + /* + * WritePolygonRAM(addr, data): + * + * Writes the polygon RAM region. Because this is a little endian device, + * big endian devices/buses have to take care to manually reverse the data + * before writing. + * + * Parameters: + * addr Word (32-bit) aligned address ranging from 0 to 0x3FFFFC. + * User must ensure address is properly clamped. + * data Data to write. + */ + void WritePolygonRAM(UINT32 addr, UINT32 data); + + /* + * ReadTAP(void): + * + * Reads the JTAG Test Access Port. + * + * Returns: + * The TDO bit (either 1 or 0). + */ + unsigned ReadTAP(void); + + /* + * void WriteTAP(tck, tms, tdi, trst): + * + * Writes to the JTAG TAP. State changes only occur on the rising edge of + * the clock (tck = 1). Each of the inputs is a single bit only and must be + * either 0 or 1, or the code will fail. + * + * Parameters: + * tck Clock. + * tms Test mode select. + * tdi Serial data input. Must be 0 or 1 only! + * trst Reset. + */ + void WriteTAP(unsigned tck, unsigned tms, unsigned tdi, unsigned trst); + + /* + * ReadRegister(reg): + * + * Reads one of the status registers. + * + * Parameters: + * reg Register offset (32-bit aligned). From 0x00 to 0x3C. + * + * Returns: + * The 32-bit status register. + */ + UINT32 ReadRegister(unsigned reg); + + /* + * ReadPCIConfigSpace(device, reg, bits, offset): + * + * Reads a PCI configuration space register. See CPCIDevice definition for + * more details. + * + * Parameters: + * device Device number (ignored, not needed). + * reg Register number. + * bits Bit width of access (8, 16, or 32 only).; + * offset Byte offset within register, aligned to the specified bit + * width, and offset from the 32-bit aligned base of the + * register number. + * + * Returns: + * Register data. + */ + UINT32 ReadPCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned width); + + /* + * WritePCIConfigSpace(device, reg, bits, offset, data): + * + * Writes to a PCI configuration space register. See CPCIDevice definition + * for more details. + * + * Parameters: + * device Device number (ignored, not needed). + * reg Register number. + * bits Bit width of access (8, 16, or 32 only). + * offset Byte offset within register, aligned to the specified bit + * width, and offset from the 32-bit aligned base of the + * register number. + * data Data. + */ + void WritePCIConfigSpace(unsigned device, unsigned reg, unsigned bits, unsigned width, UINT32 data); + + /* + * Reset(void): + * + * Resets the Real3D device. Must be called before reading/writing the + * device. + */ + void Reset(void); + + /* + * AttachRenderer(render2DPtr): + * + * Attaches a 3D renderer for the Real3D to use. This function will + * immediately pass along the information that a CRender3D object needs to + * work with. + * + * Parameters: + * Render3DPtr Pointer to a 3D renderer object. + */ + void AttachRenderer(CRender3D *Render3DPtr); + + /* + * SetStep(stepID): + * + * Sets the Model 3 hardware stepping, which also determines the Real3D + * functionality. The default is Step 1.0. This should be called prior to + * any other emulation functions and after Init(). + * + * Parameters: + * stepID 0x10 for Step 1.0, 0x15 for Step 1.5, 0x20 for Step 2.0, + * or 0x21 for Step 2.1. Anything else defaults to 1.0. + */ + void SetStep(int stepID); + + /* + * Init(vromPtr, BusObjectPtr, IRQObjectPtr, dmaIRQBit): + * + * One-time initialization of the context. Must be called prior to all + * other members. Connects the Real3D device to its video ROM and allocates + * memory for RAM regions. + * + * Parameters: + * vromPtr A pointer to video ROM (with each 32-bit word in + * its native little endian format). + * BusObjectPtr Pointer to the bus that the 53C810 has control + * over. Used to read/write memory. + * IRQObjectPtr Pointer to the IRQ controller. Used to trigger SCSI + * and DMA interrupts. + * dmaIRQBit IRQ identifier bit to pass along to IRQ controller + * when asserting interrupts. + + * + * Returns: + * OKAY if successful otherwise FAIL (not enough memory). Prints own + * errors. + */ + BOOL Init(const UINT8 *vromPtr, CBus *BusObjectPtr, CIRQ *IRQObjectPtr, unsigned dmaIRQBit); + + /* + * CReal3D(void): + * ~CReal3D(void): + * + * Constructor and destructor. + */ + CReal3D(void); + ~CReal3D(void); + +private: + // Private member functions + void DMACopy(void); + void InsertBit(UINT8 *buf, unsigned bitNum, unsigned bit); + void InsertID(UINT32 id, unsigned startBit); + unsigned Shift(UINT8 *data, unsigned numBits); + void StoreTexture(unsigned xPos, unsigned yPos, unsigned width, unsigned height, UINT16 *texData, unsigned bytesPerTexel); + void UploadTexture(UINT32 header, UINT16 *texData); + + // Renderer attached to the Real3D + CRender3D *Render3D; + + // Data passed from Model 3 object + const UINT32 *vrom; // Video ROM + int step; // hardware stepping (as in GameInfo structure) + UINT32 pciID; // PCI vendor and device ID + + // Real3D memory + UINT8 *memoryPool; // all memory allocated here + UINT32 *cullingRAMLo; // 4MB of culling RAM at 8C000000 + UINT32 *cullingRAMHi; // 1MB of culling RAM at 8E000000 + UINT32 *polyRAM; // 4MB of polygon RAM at 98000000 + UINT16 *textureRAM; // 8MB of internal texture RAM + UINT32 *textureFIFO; // 1MB texture FIFO at 0x94000000 + unsigned fifoIdx; // index into texture FIFO + UINT32 vromTextureAddr; // VROM texture port address data + UINT32 vromTextureHeader; // VROM texture port header data + + // Big endian bus object for DMA memory access + CBus *Bus; + + // IRQ handling + CIRQ *IRQ; // IRQ controller + unsigned dmaIRQ; // IRQ bit to use when calling IRQ handler + + // DMA device + UINT32 dmaSrc; + UINT32 dmaDest; + UINT32 dmaLength; + UINT32 dmaData; + UINT32 dmaUnknownReg; + UINT8 dmaStatus; + UINT8 dmaConfig; + + // Command port + BOOL commandPortWritten; + + // Status and command registers + UINT32 status; + + // JTAG Test Access Port + UINT64 tapCurrentInstruction; // latched IR (not always equal to IR) + UINT64 tapIR; // instruction register (46 bits) + UINT8 tapID[32]; // ASIC ID code data buffer + unsigned tapIDSize; // size of ID data in bits + unsigned tapTDO; // bit shifted out to TDO + int tapState; // current state + +}; + + +#endif // INCLUDED_REAL3D_H diff --git a/Model3/SoundBoard.cpp b/Model3/SoundBoard.cpp new file mode 100644 index 0000000..9286f3c --- /dev/null +++ b/Model3/SoundBoard.cpp @@ -0,0 +1,379 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * SoundBoard.cpp + * + * Model 3 sound board. Implementation of the CSoundBoard class. This class can + * only be instantiated once because it relies on global variables (the non-OOP + * 68K core). + */ + +#include "Supermodel.h" + +//TEMP: these need to be dynamically allocated in the memory pool +static INT16 leftBuffer[44100/60],rightBuffer[44100/60]; +static FILE *soundFP; + +/****************************************************************************** + Global 68K Access Handlers + + The 68K must interface with globally-accessible memory maps and access + handlers. Turbo68K uses the __cdecl calling convention. Note that this is not + explicitly defined for the Turbo68K functions themselves but in case Turbo68K + crashes, this may be the culprit. +******************************************************************************/ + +// Prototypes for access handlers +static UINT8 __cdecl UnknownRead8(UINT32); +static UINT16 __cdecl UnknownRead16(UINT32); +static UINT32 __cdecl UnknownRead32(UINT32); +static void __cdecl UnknownWrite8(UINT32, UINT8); +static void __cdecl UnknownWrite16(UINT32, UINT16); +static void __cdecl UnknownWrite32(UINT32, UINT32); + +// Memory maps for 68K +#ifdef SUPERMODEL_SOUND +struct TURBO68K_FETCHREGION mapFetch[] = +{ + { 0x000000, 0x0FFFFF, NULL }, // SCSP1 RAM + { 0x200000, 0x2FFFFF, NULL }, // SCSP2 RAM + { 0x600000, 0x67FFFF, NULL }, // program ROM + { -1, -1, NULL } +}; + +struct TURBO68K_DATAREGION mapRead8[] = +{ + { 0x000000, 0x0FFFFF, NULL, NULL }, // SCSP1 RAM + { 0x200000, 0x2FFFFF, NULL, NULL }, // SCSP2 RAM + { 0x600000, 0x67FFFF, NULL, NULL }, // program ROM + { 0x800000, 0x9FFFFF, NULL, NULL }, // sample ROM (low 2 MB) + { 0xA00000, 0xDFFFFF, NULL, NULL }, // sample ROM (bank) + { 0xE00000, 0xFFFFFF, NULL, NULL }, // sample ROM (bank) + { 0x100000, 0x10FFFF, NULL, SCSP_Master_r8 }, + { 0x300000, 0x30FFFF, NULL, SCSP_Slave_r8 }, + { 0x000000, 0xFFFFFF, NULL, UnknownRead8 }, + { -1, -1, NULL, NULL } +}; + +struct TURBO68K_DATAREGION mapRead16[] = +{ + { 0x000000, 0x0FFFFF, NULL, NULL }, // SCSP1 RAM + { 0x200000, 0x2FFFFF, NULL, NULL }, // SCSP2 RAM + { 0x600000, 0x67FFFF, NULL, NULL }, // program ROM + { 0x800000, 0x9FFFFF, NULL, NULL }, // sample ROM (low 2 MB) + { 0xA00000, 0xDFFFFF, NULL, NULL }, // sample ROM (bank) + { 0xE00000, 0xFFFFFF, NULL, NULL }, // sample ROM (bank) + { 0x100000, 0x10FFFF, NULL, SCSP_Master_r16 }, + { 0x300000, 0x30FFFF, NULL, SCSP_Slave_r16 }, + { 0x000000, 0xFFFFFF, NULL, UnknownRead16 }, + { -1, -1, NULL, NULL } +}; + +struct TURBO68K_DATAREGION mapRead32[] = +{ + { 0x000000, 0x0FFFFF, NULL, NULL }, // SCSP1 RAM + { 0x200000, 0x2FFFFF, NULL, NULL }, // SCSP2 RAM + { 0x600000, 0x67FFFF, NULL, NULL }, // program ROM + { 0x800000, 0x9FFFFF, NULL, NULL }, // sample ROM (low 2 MB) + { 0xA00000, 0xDFFFFF, NULL, NULL }, // sample ROM (bank) + { 0xE00000, 0xFFFFFF, NULL, NULL }, // sample ROM (bank) + { 0x100000, 0x10FFFF, NULL, SCSP_Master_r32 }, + { 0x300000, 0x30FFFF, NULL, SCSP_Slave_r32 }, + { 0x000000, 0xFFFFFF, NULL, UnknownRead32 }, + { -1, -1, NULL, NULL } +}; + +struct TURBO68K_DATAREGION mapWrite8[] = +{ + { 0x000000, 0x0FFFFF, NULL, NULL }, // SCSP1 RAM + { 0x200000, 0x2FFFFF, NULL, NULL }, // SCSP2 RAM + { 0x100000, 0x10FFFF, NULL, SCSP_Master_w8 }, + { 0x300000, 0x30FFFF, NULL, SCSP_Slave_w8 }, + { 0x000000, 0xFFFFFF, NULL, UnknownWrite8 }, + { -1, -1, NULL, NULL } +}; + +struct TURBO68K_DATAREGION mapWrite16[] = +{ + { 0x000000, 0x0FFFFF, NULL, NULL }, // SCSP1 RAM + { 0x200000, 0x2FFFFF, NULL, NULL }, // SCSP2 RAM + { 0x100000, 0x10FFFF, NULL, SCSP_Master_w16 }, + { 0x300000, 0x30FFFF, NULL, SCSP_Slave_w16 }, + { 0x000000, 0xFFFFFF, NULL, UnknownWrite16 }, + { -1, -1, NULL, NULL } +}; + +struct TURBO68K_DATAREGION mapWrite32[] = +{ + { 0x000000, 0x0FFFFF, NULL, NULL }, // SCSP1 RAM + { 0x200000, 0x2FFFFF, NULL, NULL }, // SCSP2 RAM + { 0x100000, 0x10FFFF, NULL, SCSP_Master_w32 }, + { 0x300000, 0x30FFFF, NULL, SCSP_Slave_w32 }, + { 0x000000, 0xFFFFFF, NULL, UnknownWrite32 }, + { -1, -1, NULL, NULL } +}; +#endif + +static UINT8 __cdecl UnknownRead8(UINT32 addr) +{ + printf("68K read from %06X (byte)\n", addr); + return 0; +} + +static UINT16 __cdecl UnknownRead16(UINT32 addr) +{ + printf("68K read from %06X (word)\n", addr); + return 0; +} + +static UINT32 __cdecl UnknownRead32(UINT32 addr) +{ + printf("68K read from %06X (longword)\n", addr); + return 0; +} + + +static void __cdecl UnknownWrite8(UINT32 addr, UINT8 data) +{ + printf("68K wrote %06X=%02X\n", addr, data); +} + +static void __cdecl UnknownWrite16(UINT32 addr, UINT16 data) +{ + printf("68K wrote %06X=%04X\n", addr, data); +} + +static void __cdecl UnknownWrite32(UINT32 addr, UINT32 data) +{ + printf("68K wrote %06X=%08X\n", addr, data); +} + + +/****************************************************************************** + Emulation Functions +******************************************************************************/ +int irqLine = 0; + +// SCSP callback for generating IRQs +void SCSP68KIRQCallback(int irqNum) +{ +#ifdef SUPERMODEL_SOUND + //printf("IRQ: %d\n", irqNum); + irqLine = irqNum; + //Turbo68KInterrupt(irqNum, TURBO68K_AUTOVECTOR); +#endif +} + +// SCSP callback for running the 68K +int SCSP68KRunCallback(int numCycles) +{ +#ifdef SUPERMODEL_SOUND + for (int i = 0; i < numCycles; i++) + { + if (irqLine) + Turbo68KInterrupt(irqLine,TURBO68K_AUTOVECTOR); + Turbo68KRun(1); + } + return numCycles; + //Turbo68KRun(numCycles); + //return Turbo68KGetElapsedCycles(); +#else + return numCycles; +#endif +} + +void CSoundBoard::WriteMIDIPort(UINT8 data) +{ + SCSP_MidiIn(data); +} + +void CSoundBoard::RunFrame(void) +{ +#ifdef SUPERMODEL_SOUND + SCSP_Update(); + + // Output to binary file + INT16 s; + for (int i = 0; i < 44100/60; i++) + { + s = ((UINT16)leftBuffer[i]>>8) | ((leftBuffer[i]&0xFF)<<8); + fwrite(&s, sizeof(INT16), 1, soundFP); // left channel + s = ((UINT16)rightBuffer[i]>>8) | ((rightBuffer[i]&0xFF)<<8); + fwrite(&s, sizeof(INT16), 1, soundFP); // right channel + } +#endif +} + +void CSoundBoard::Reset(void) +{ +#ifdef SUPERMODEL_SOUND + memcpy(ram1, soundROM, 16); // copy 68K vector table + Turbo68KReset(); + /* + printf("68K PC=%06X\n", Turbo68KReadPC()); + for (int i = 0; i < 1000000; i++) + { + //printf("%06X\n", Turbo68KReadPC()); + Turbo68KRun(1); + } + */ +#endif + DebugLog("Sound Board Reset\n"); +} + + +/****************************************************************************** + Configuration, Initialization, and Shutdown +******************************************************************************/ + +// Offsets of memory regions within sound board's pool +#define OFFSET_RAM1 0 // 1 MB SCSP1 RAM +#define OFFSET_RAM2 0x100000 // 1 MB SCSP2 RAM +#define MEMORY_POOL_SIZE (0x100000+0x100000) + +BOOL CSoundBoard::Init(const UINT8 *soundROMPtr, const UINT8 *sampleROMPtr, CIRQ *ppcIRQObjectPtr, unsigned soundIRQBit) +{ + float memSizeMB = (float)MEMORY_POOL_SIZE/(float)0x100000; + + // Attach IRQ controller + ppcIRQ = ppcIRQObjectPtr; + ppcSoundIRQBit = soundIRQBit; + + // Receive sound ROMs + soundROM = soundROMPtr; + sampleROM = sampleROMPtr; + + // Allocate all memory for RAM + memoryPool = new(std::nothrow) UINT8[MEMORY_POOL_SIZE]; + if (NULL == memoryPool) + return ErrorLog("Insufficient memory for sound board (needs %1.1f MB).", memSizeMB); + memset(memoryPool, 0, MEMORY_POOL_SIZE); + + // Set up memory pointers + ram1 = &memoryPool[OFFSET_RAM1]; + ram2 = &memoryPool[OFFSET_RAM2]; + + // Initialize 68K core +#ifdef SUPERMODEL_SOUND + mapFetch[0].ptr = mapRead8[0].ptr = mapRead16[0].ptr = mapRead32[0].ptr = + mapWrite8[0].ptr = mapWrite16[0].ptr = mapWrite32[0].ptr = (UINT32)ram1 - mapFetch[0].base;; + + mapFetch[1].ptr = mapRead8[1].ptr = mapRead16[1].ptr = mapRead32[1].ptr = + mapWrite8[1].ptr = mapWrite16[1].ptr = mapWrite32[1].ptr = (UINT32)ram2 - mapFetch[1].base; + + mapFetch[2].ptr = mapRead8[2].ptr = mapRead16[2].ptr = mapRead32[2].ptr = (UINT32)soundROM - mapFetch[2].base; + + mapRead8[3].ptr = mapRead16[3].ptr = mapRead32[3].ptr = (UINT32)&sampleROM[0x000000] - mapRead8[3].base; + + mapRead8[4].ptr = mapRead16[4].ptr = mapRead32[4].ptr = (UINT32)&sampleROM[0x200000] - mapRead8[4].base; + + mapRead8[5].ptr = mapRead16[5].ptr = mapRead32[5].ptr = (UINT32)&sampleROM[0x600000] - mapRead8[5].base; + + Turbo68KInit(); + Turbo68KSetFetch(mapFetch, NULL); + Turbo68KSetReadByte(mapRead8, NULL); + Turbo68KSetReadWord(mapRead16, NULL); + Turbo68KSetReadLong(mapRead32, NULL); + Turbo68KSetWriteByte(mapWrite8, NULL); + Turbo68KSetWriteWord(mapWrite16, NULL); + Turbo68KSetWriteLong(mapWrite32, NULL); +#endif + + // Initialize SCSPs + SCSP_SetBuffers(leftBuffer, rightBuffer, 44100/60); + SCSP_SetCB(SCSP68KRunCallback, SCSP68KIRQCallback, ppcIRQ, ppcSoundIRQBit); + SCSP_Init(2); + SCSP_SetRAM(0, ram1); + SCSP_SetRAM(1, ram2); + + // Binary logging +#ifdef SUPERMODEL_SOUND + soundFP = fopen("sound.bin","wb"); // delete existing file + fclose(soundFP); + soundFP = fopen("sound.bin","ab"); // append mode +#endif + + return OKAY; +} + +CSoundBoard::CSoundBoard(void) +{ + memoryPool = NULL; + ram1 = NULL; + ram2 = NULL; + + DebugLog("Built Sound Board\n"); +} + +static void Reverse16(UINT8 *buf, unsigned size) +{ + unsigned i; + UINT8 tmp; + + for (i = 0; i < size; i += 2) + { + tmp = buf[i+0]; + buf[i+0] = buf[i+1]; + buf[i+1] = tmp; + } +} + +CSoundBoard::~CSoundBoard(void) +{ +#ifdef SUPERMODEL_SOUND + // close binary log file + fclose(soundFP); +//#if 0 + FILE *fp; + + Reverse16(ram1, 0x100000); + Reverse16(ram2, 0x100000); + fp = fopen("scspRAM1", "wb"); + if (NULL != fp) + { + fwrite(ram1, sizeof(UINT8), 0x100000, fp); + fclose(fp); + printf("dumped %s\n", "scspRAM1"); + + } + fp = fopen("scspRAM2", "wb"); + if (NULL != fp) + { + fwrite(ram2, sizeof(UINT8), 0x100000, fp); + fclose(fp); + printf("dumped %s\n", "scspRAM2"); + + } +//#endif +#endif + + SCSP_Deinit(); + + if (memoryPool != NULL) + { + delete [] memoryPool; + memoryPool = NULL; + } + ram1 = NULL; + ram2 = NULL; + DebugLog("Destroyed Sound Board\n"); +} diff --git a/Model3/SoundBoard.h b/Model3/SoundBoard.h new file mode 100644 index 0000000..566b892 --- /dev/null +++ b/Model3/SoundBoard.h @@ -0,0 +1,103 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * SoundBoard.h + * + * Header file defining the CSoundBoard class: Model 3 audio subsystem. + */ + +#ifndef INCLUDED_SOUNDBOARD_H +#define INCLUDED_SOUNDBOARD_H + + +/* + * CSoundBoard: + * + * Model 3 sound board (68K CPU + 2 x SCSP). + */ +class CSoundBoard +{ +public: + /* + * WriteMIDIPort(data): + * + * Writes to the sound board MIDI port. + * + * Parameters: + * data Byte to write to MIDI port. + */ + void WriteMIDIPort(UINT8 data); + + /* + * RunFrame(void): + * + * Runs the sound board for one frame, updating sound in the process. + */ + void RunFrame(void); + + /* + * Reset(void): + * + * Resets the sound board. + */ + void Reset(void); + + /* + * Init(soundROMPtr, sampleROMPtr): + * + * One-time initialization. Must be called prior to all other members. + * + * Parameters: + * soundROMPtr Pointer to sound ROM (68K program). + * sampleROMPtr Pointer to sample ROM. + * ppcIRQObjectPtr Pointer to PowerPC-side IRQ object. + * soundIRQBit IRQ bit mask to use for sound board PowerPC IRQs. + * + * Returns: + * OKAY if successful, FAIL if unable to allocate memory. Prints own + * error messages. + */ + BOOL Init(const UINT8 *soundROMPtr, const UINT8 *sampleROMPtr, CIRQ *ppcIRQObjectPtr, unsigned soundIRQBit); + + /* + * CSoundBoard(void): + * ~CSoundBoard(void): + * + * Constructor and destructor. + */ + CSoundBoard(void); + ~CSoundBoard(void); + +private: + // PowerPC IRQ controller + CIRQ *ppcIRQ; + unsigned ppcSoundIRQBit; + + // Sound board memory + const UINT8 *soundROM; // 68K program ROM (passed in from parent object) + const UINT8 *sampleROM; // 68K sample ROM (passed in from parent object) + UINT8 *memoryPool; // single allocated region for all sound board RAM + UINT8 *ram1, *ram2; // SCSP1 and SCSP2 RAM +}; + + +#endif // INCLUDED_SOUNDBOARD_H diff --git a/Model3/TileGen.cpp b/Model3/TileGen.cpp new file mode 100644 index 0000000..9c96ae8 --- /dev/null +++ b/Model3/TileGen.cpp @@ -0,0 +1,205 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * TileGen.cpp + * + * Implementation of the CTileGen class: 2D tile generator. + * + * TO-DO List: + * ----------- + * - For consistency, the registers should probably be byte reversed (this is a + * little endian device), forcing the Model3 Read32/Write32 handlers to + * manually reverse the data. This keeps with the convention for VRAM. + */ + +#include +#include "Supermodel.h" + + +/****************************************************************************** + Save States +******************************************************************************/ + +void CTileGen::SaveState(CBlockFile *SaveState) +{ + SaveState->NewBlock("Tile Generator", __FILE__); + SaveState->Write(memoryPool, 0x100000+0x20000); + SaveState->Write(regs, sizeof(regs)); +} + +void CTileGen::LoadState(CBlockFile *SaveState) +{ + if (OKAY != SaveState->FindBlock("Tile Generator")) + { + ErrorLog("Unable to load tile generator state. Save state file is corrupted."); + return; + } + + // Load memory one word at a time + for (int i = 0; i < (0x100000+0x20000); i += 4) + { + UINT32 data; + + SaveState->Read(&data, sizeof(data)); + Render2D->WriteVRAM(i, data); + *(UINT32 *) &memoryPool[i] = data; + } + + SaveState->Read(regs, sizeof(regs)); +} + + +/****************************************************************************** + Rendering +******************************************************************************/ + +void CTileGen::BeginFrame(void) +{ + Render2D->BeginFrame(); +/* + printf("08: %X\n", regs[0x08/4]); + printf("0C: %X\n", regs[0x0C/4]); + printf("20: %X\n", regs[0x20/4]); + printf("40: %X\n", regs[0x40/4]); + printf("44: %X\n", regs[0x44/4]); + printf("60: %08X\n", regs[0x60/4]); + printf("64: %08X\n", regs[0x64/4]); + printf("68: %08X\n", regs[0x68/4]); + printf("6C: %08X\n", regs[0x6C/4]); +*/ +} + +void CTileGen::EndFrame(void) +{ + Render2D->EndFrame(); +} + + +/****************************************************************************** + Emulation Functions +******************************************************************************/ + +UINT32 CTileGen::ReadRAM(unsigned addr) +{ + return *(UINT32 *) &memoryPool[addr]; +} + +void CTileGen::WriteRAM(unsigned addr, UINT32 data) +{ + Render2D->WriteVRAM(addr,data); // inform renderer of update first + *(UINT32 *) &memoryPool[addr] = data; +} + +void CTileGen::WriteRegister(unsigned reg, UINT32 data) +{ + reg &= 0xFF; + regs[reg/4] = data; + + switch (reg) + { + case 0x10: // IRQ acknowledge + IRQ->Deassert(data&0xFF); + break; + case 0x60: + break; + case 0x64: + break; + case 0x68: + break; + case 0x6C: + break; + default: + DebugLog("Tile Generator reg %02X = %08X\n", reg, data); + //printf("%02X = %08X\n", reg, data); + break; + } +} + +void CTileGen::Reset(void) +{ + memset(regs, 0, sizeof(regs)); + memset(memoryPool, 0, 0x120000); + DebugLog("Tile Generator reset\n"); +} + + +/****************************************************************************** + Configuration, Initialization, and Shutdown +******************************************************************************/ + +void CTileGen::AttachRenderer(CRender2D *Render2DPtr) +{ + Render2D = Render2DPtr; + Render2D->AttachVRAM(memoryPool); + Render2D->AttachRegisters(regs); + DebugLog("Tile Generator attached a Render2D object\n"); +} + +#define MEMORY_POOL_SIZE 0x120000 + +BOOL CTileGen::Init(CIRQ *IRQObjectPtr) +{ + float memSizeMB = (float)MEMORY_POOL_SIZE/(float)0x100000; + + // Allocate all memory for ROMs and PPC RAM + memoryPool = new(std::nothrow) UINT8[MEMORY_POOL_SIZE]; + if (NULL == memoryPool) + return ErrorLog("Insufficient memory for tile generator object (needs %1.1f MB).", memSizeMB); + + // Hook up the IRQ controller + IRQ = IRQObjectPtr; + + DebugLog("Initialized Tile Generator (allocated %1.1f MB and connected to IRQ controller)\n", memSizeMB); + return OKAY; +} + +CTileGen::CTileGen(void) +{ + IRQ = NULL; + memoryPool = NULL; + DebugLog("Built Tile Generator\n"); +} + +CTileGen::~CTileGen(void) +{ + // Dump tile generator RAM +#if 0 + FILE *fp; + fp = fopen("tileram", "wb"); + if (NULL != fp) + { + fwrite(memoryPool, sizeof(UINT8), 0x120000, fp); + fclose(fp); + printf("dumped %s\n", "tileram"); + } + else + printf("unable to dump %s\n", "tileram"); +#endif + + IRQ = NULL; + if (memoryPool != NULL) + { + delete [] memoryPool; + memoryPool = NULL; + } + DebugLog("Destroyed Tile Generator\n"); +} diff --git a/Model3/TileGen.h b/Model3/TileGen.h new file mode 100644 index 0000000..bd9c4b8 --- /dev/null +++ b/Model3/TileGen.h @@ -0,0 +1,177 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * TileGen.h + * + * Header file defining the CTileGen (tile generator device) class. + */ + +#ifndef INCLUDED_TILEGEN_H +#define INCLUDED_TILEGEN_H + + +/* + * CTileGen: + * + * Tile generator device. The Model 3's tile generator handles not only the 2D + * tile map layers but also seems to control video output and VBL IRQs. + */ +class CTileGen +{ +public: + /* + * SaveState(SaveState): + * + * Saves an image of the current device state. + * + * Parameters: + * SaveState Block file to save state information to. + */ + void SaveState(CBlockFile *SaveState); + + /* + * LoadState(SaveState): + * + * Loads and a state image. + * + * Parameters: + * SaveState Block file to load state information from. + */ + void LoadState(CBlockFile *SaveState); + + /* + * BeginFrame(void): + * + * Prepare to render a new frame. Must be called once per frame prior to + * drawing anything. + */ + void BeginFrame(void); + + /* + * EndFrame(void): + * + * Signals the end of rendering for this frame. Must be called last during + * the frame. + */ + void EndFrame(void); + + /* + * ReadRAM(addr): + * + * Reads the tile generator's little endian RAM (the word is returned with + * the MSB read from addr+3). If a big endian device is reading (PowerPC), + * the result must be manually flipped. + * + * Parameters: + * addr Address in tile generator RAM. Caller must ensure it is + * clamped to the range 0x000000 to 0x11FFFF because this + * function does not. + * + * Returns: + * A 32-bit word read as little endian from the RAM address. + */ + UINT32 ReadRAM(unsigned addr); + + /* + * WriteRAM(addr, data): + * + * Writes to the tile generator's little endian RAM (the word's MSB is + * written to addr+3). If a big endian device is writing, the word must be + * flipped manually before passing it to this function. + * + * Parameters: + * addr Address in tile generator RAM. Caller must ensure it is + * clamped to the range 0x000000 to 0x11FFFF because this + * function does not. + * data The data to write. + */ + void WriteRAM(unsigned addr, UINT32 data); + + /* + * WriteRegister(reg, data): + * + * Writes 32 bits of data to a (little endian) register. If a big endian + * device is writing, th word must be flipped. + * + * Parameters: + * reg Aligned (32 bits) register offset (0x00-0xFC). + * data Data to write. + */ + void WriteRegister(unsigned reg, UINT32 data); + + /* + * Reset(void): + * + * Resets the device. + */ + void Reset(void); + + /* + * AttachRenderer(render2DPtr): + * + * Attaches a 2D renderer for the tile generator to use. This function will + * immediately pass along the information that a CRender2D object needs to + * work with. + * + * Parameters: + * Render2DPtr Pointer to a 2D renderer object. + */ + void AttachRenderer(CRender2D *Render2DPtr); + + /* + * Init(IRQObjectPtr): + * + * One-time initialization of the context. Must be called prior to all + * other members. Links the tile generator to an IRQ controller and + * allocates memory for tile generator RAM. + * + * Parameters: + * IRQObjectPtr Pointer to the IRQ controller object. + * + * Returns: + * OKAY is successful, otherwise FAILED if a non-recoverable error + * occurred. Prints own error messages. + */ + BOOL Init(CIRQ *IRQObjectPtr); + + /* + * CTileGen(void): + * ~CTileGen(void): + * + * Constructor and destructor. + */ + CTileGen(void); + ~CTileGen(void); + +private: + CIRQ *IRQ; // IRQ controller the tile generator is attached to + CRender2D *Render2D; // 2D renderer the tile generator is attached to + + // Tile generator VRAM + UINT8 *memoryPool; // all memory allocated here + + // Registers + UINT32 regs[64]; +}; + + +#endif // INCLUDED_TILEGEN_H diff --git a/OSD/SDL/Main.cpp b/OSD/SDL/Main.cpp new file mode 100644 index 0000000..576916c --- /dev/null +++ b/OSD/SDL/Main.cpp @@ -0,0 +1,1097 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Main.cpp + * + * Main program driver for the SDL port. + * + * Compile-Time Options + * -------------------- + * - SUPERMODEL_SOUND: Enables experimental sound code. The 68K core (Turbo68K) + * only works on x86 (32-bit) systems, so this cannot be enabled on 64-bit + * builds. + * - SUPERMODEL_WIN32: Define this if compiling on Windows. + * - SUPERMODEL_OSX: Define this if compiling on Mac OS X. + * + * TO-DO List + * ---------- + * - A lot of this code is actually OS-independent! Should it be moved into the + * root of the source tree? Might not be worth it; eventually, OS-dependent + * UIs will be introduced. + */ + +#include +#include +#include +#include +#include +#include "Pkgs/glew.h" +#ifdef SUPERMODEL_OSX +#include +#else +#include +#endif + +#include "Supermodel.h" +#include "SDLInputSystem.h" +#ifdef SUPERMODEL_WIN32 +#include "OSD/Windows/DirectInputSystem.h" +#endif + +/****************************************************************************** + Display Management +******************************************************************************/ + +/* + * Position and size of rectangular region within OpenGL display to render to + */ +unsigned xOffset, yOffset; // offset of renderer output within OpenGL viewport +unsigned xRes, yRes; // renderer output resolution (can be smaller than GL viewport) + +/* + * CreateGLScreen(): + * + * Creates an OpenGL display surface of the requested size. xOffset and yOffset + * are used to return a display surface offset (for OpenGL viewport commands) + * because the actual drawing area may need to be adjusted to preserve the + * Model 3 aspect ratio. The new resolution will be passed back as well. + */ +static BOOL CreateGLScreen(const char *caption, unsigned *xOffsetPtr, unsigned *yOffsetPtr, unsigned *xResPtr, unsigned *yResPtr, BOOL fullScreen) +{ + const SDL_VideoInfo *VideoInfo; + GLenum err; + float model3Ratio, ratio; + float xRes, yRes; + + // Initialize video subsystem + if (SDL_InitSubSystem(SDL_INIT_VIDEO) != 0) + return ErrorLog("Unable to initialize SDL video subsystem: %s\n", SDL_GetError()); + + // Important GL attributes + SDL_GL_SetAttribute(SDL_GL_RED_SIZE,5); // need at least RGB555 for Model 3 textures + SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE,5); + SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE,5); + SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE,16); + SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER,1); + + // Set video mode + if (SDL_SetVideoMode(*xResPtr,*yResPtr,0,SDL_OPENGL|(fullScreen?SDL_FULLSCREEN|SDL_HWSURFACE:0)) == NULL) + { + ErrorLog("Unable to create an OpenGL display: %s\n", SDL_GetError()); + return FAIL; + } + + VideoInfo = SDL_GetVideoInfo(); // what resolution did we actually get? + + // Fix the aspect ratio of the resolution that the user passed to match Model 3 ratio + xRes = (float) *xResPtr; + yRes = (float) *yResPtr; + model3Ratio = 496.0f/384.0f; + ratio = xRes/yRes; + if (yRes < (xRes/model3Ratio)) + xRes = yRes*model3Ratio; + if (xRes < (yRes*model3Ratio)) + yRes = xRes/model3Ratio; + + // Center the visible area + *xOffsetPtr = (*xResPtr - (unsigned) xRes)/2; + *yOffsetPtr = (*yResPtr - (unsigned) yRes)/2; + + // If the desired resolution is smaller than what we got, re-center again + if (*xResPtr < VideoInfo->current_w) + *xOffsetPtr += (VideoInfo->current_w - *xResPtr)/2; + if (*yResPtr < VideoInfo->current_h) + *yOffsetPtr += (VideoInfo->current_h - *yResPtr)/2; + + // Create window caption + SDL_WM_SetCaption(caption,NULL); + + // Initialize GLEW, allowing us to use features beyond OpenGL 1.2 + err = glewInit(); + if (GLEW_OK != err) + { + ErrorLog("OpenGL initialization failed: %s\n", glewGetErrorString(err)); + return FAIL; + } + + // OpenGL initialization + glViewport(0,0,*xResPtr,*yResPtr); + glClearColor(0.0,0.0,0.0,0.0); + glClearDepth(1.0); + glDepthFunc(GL_LESS); + glEnable(GL_DEPTH_TEST); + glShadeModel(GL_SMOOTH); + glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST); + glDisable(GL_CULL_FACE); + glMatrixMode(GL_PROJECTION); + glLoadIdentity(); + gluPerspective(90.0,(GLfloat)xRes/(GLfloat)yRes,0.1,1e5); + glMatrixMode(GL_MODELVIEW); + glClear(GL_COLOR_BUFFER_BIT|GL_DEPTH_BUFFER_BIT); // clear at least once to ensure black border + + // Write back resolution parameters + *xResPtr = (unsigned) xRes; + *yResPtr = (unsigned) yRes; + + return 0; +} + +/****************************************************************************** + Configuration +******************************************************************************/ + +#define CONFIG_FILE_PATH "Config/Supermodel.ini" +#define CONFIG_FILE_COMMENT ";\n" \ + "; Supermodel Configuration File\n" \ + ";\n" + +// Create and configure inputs +static CInputs *CreateInputs(CInputSystem *InputSystem, BOOL configure) +{ + // Create and initialize inputs + CInputs* Inputs = new CInputs(InputSystem); + if (!Inputs->Initialize()) + { + ErrorLog("Unable to initalize inputs.\n"); + return NULL; + } + + // Open and parse configuration file + CINIFile INI; + INI.Open(CONFIG_FILE_PATH); // doesn't matter if it exists or not, will get overwritten + INI.Parse(); + + Inputs->ReadFromINIFile(&INI, "Global"); + InputSystem->ReadFromINIFile(&INI, "Global"); + + // If the user wants to configure the inputs, do that now + if (configure) + { + // Open an SDL window + unsigned xOffset, yOffset, xRes=496, yRes=384; + if (OKAY != CreateGLScreen("Supermodel - Configuring Inputs...",&xOffset,&yOffset,&xRes,&yRes,FALSE)) + { + ErrorLog("Unable to start SDL to configure inputs.\n"); + return NULL; + } + + // Configure the inputs + if (Inputs->ConfigureInputs(NULL, xOffset, yOffset, xRes, yRes)) + { + // Write input configuration and input system settings to config file + Inputs->WriteToINIFile(&INI, "Global"); + InputSystem->WriteToINIFile(&INI, "Global"); + + if (OKAY != INI.Write(CONFIG_FILE_COMMENT)) + ErrorLog("Unable to save configuration to %s.", CONFIG_FILE_PATH); + else + printf("Configuration successfully saved to %s.\n", CONFIG_FILE_PATH); + } + else + puts("Configuration aborted..."); + puts(""); + } + + return Inputs; +} + +/****************************************************************************** + Save States and NVRAM + + Save states and NVRAM use the same basic format. + + Header block name: "Supermodel Save State" or "Supermodel NVRAM State" + Data: Save state file version (4-byte integer), ROM set ID (up to 9 bytes, + including terminating \0). + + Different subsystems output their own blocks. +******************************************************************************/ + +#define STATE_FILE_VERSION 0 // save state file version + +static unsigned saveSlot = 0; // save state slot # + +static void SaveState(CModel3 *Model3) +{ + CBlockFile SaveState; + char filePath[24]; + int fileVersion = STATE_FILE_VERSION; + + sprintf(filePath, "Saves/%s.st%d", Model3->GetGameInfo()->id, saveSlot); + if (OKAY != SaveState.Create(filePath, "Supermodel Save State", "Supermodel Version " SUPERMODEL_VERSION)) + { + ErrorLog("Unable to save state to %s.", filePath); + return; + } + + // Write file format version and ROM set ID to header block + SaveState.Write(&fileVersion, sizeof(fileVersion)); + SaveState.Write(Model3->GetGameInfo()->id, strlen(Model3->GetGameInfo()->id)+1); + + // Save state + Model3->SaveState(&SaveState); + SaveState.Close(); + printf("Saved state to %s.\n", filePath); + DebugLog("Saved state to %s.\n", filePath); +} + +static void LoadState(CModel3 *Model3) +{ + CBlockFile SaveState; + char filePath[24]; + int fileVersion; + + // Generate file path + sprintf(filePath, "Saves/%s.st%d", Model3->GetGameInfo()->id, saveSlot); + + // Open and check to make sure format is correct + if (OKAY != SaveState.Load(filePath)) + { + ErrorLog("Unable to load state from %s.", filePath); + return; + } + + if (OKAY != SaveState.FindBlock("Supermodel Save State")) + { + ErrorLog("%s does not appear to be a valid save state file.", filePath); + return; + } + + SaveState.Read(&fileVersion, sizeof(fileVersion)); + if (fileVersion != STATE_FILE_VERSION) + { + ErrorLog("Format of %s is incompatible with this version of Supermodel.", filePath); + return; + } + + // Load + Model3->LoadState(&SaveState); + SaveState.Close(); + printf("Loaded state from %s.\n", filePath); + DebugLog("Loaded state from %s.\n", filePath); +} + +static void SaveNVRAM(CModel3 *Model3) +{ + CBlockFile NVRAM; + char filePath[24]; + int fileVersion = STATE_FILE_VERSION; + + sprintf(filePath, "NVRAM/%s.nv", Model3->GetGameInfo()->id); + if (OKAY != NVRAM.Create(filePath, "Supermodel NVRAM State", "Supermodel Version " SUPERMODEL_VERSION)) + { + ErrorLog("Unable to save NVRAM to %s. Make sure directory exists!", filePath); + return; + } + + // Write file format version and ROM set ID to header block + NVRAM.Write(&fileVersion, sizeof(fileVersion)); + NVRAM.Write(Model3->GetGameInfo()->id, strlen(Model3->GetGameInfo()->id)+1); + + // Save NVRAM + Model3->SaveNVRAM(&NVRAM); + NVRAM.Close(); + DebugLog("Saved NVRAM to %s.\n", filePath); +} + +static void LoadNVRAM(CModel3 *Model3) +{ + CBlockFile NVRAM; + char filePath[24]; + int fileVersion; + + // Generate file path + sprintf(filePath, "NVRAM/%s.nv", Model3->GetGameInfo()->id); + + // Open and check to make sure format is correct + if (OKAY != NVRAM.Load(filePath)) + { + //ErrorLog("Unable to restore NVRAM from %s.", filePath); + return; + } + + if (OKAY != NVRAM.FindBlock("Supermodel NVRAM State")) + { + ErrorLog("%s does not appear to be a valid NVRAM file.", filePath); + return; + } + + NVRAM.Read(&fileVersion, sizeof(fileVersion)); + if (fileVersion != STATE_FILE_VERSION) + { + ErrorLog("Format of %s is incompatible with this version of Supermodel.", filePath); + return; + } + + // Load + Model3->LoadNVRAM(&NVRAM); + NVRAM.Close(); + DebugLog("Loaded NVRAM from %s.\n", filePath); +} + + +/****************************************************************************** + Main Program Driver + + All configuration management is done prior to calling Supermodel(). +******************************************************************************/ + +static int Supermodel(const char *zipFile, CInputs *Inputs, unsigned ppcFrequency, unsigned xResParam, unsigned yResParam, BOOL fullScreen, BOOL noThrottle, BOOL showFPS, const char *vsFile, const char *fsFile) +{ + char titleStr[128], titleFPSStr[128]; + CModel3 *Model3 = new CModel3(); + CRender2D *Render2D = new CRender2D(); + CRender3D *Render3D = new CRender3D(); + unsigned prevFPSTicks, currentFPSTicks, currentTicks, targetTicks, startTicks; + unsigned fpsFramesElapsed, framesElapsed; + BOOL showCursor = FALSE; // show cursor in full screen mode? + BOOL quit = 0; + BOOL paused = 0; + + // Info log user options + InfoLog("PowerPC frequency: %d Hz", ppcFrequency); + InfoLog("Resolution: %dx%d (%s)", xResParam, yResParam, fullScreen?"full screen":"windowed"); + InfoLog("Frame rate limiting: %s", noThrottle?"Disabled":"Enabled"); + + // Initialize and load ROMs + Model3->Init(ppcFrequency); + if (OKAY != Model3->LoadROMSet(Model3GameList, zipFile)) + return 1; + + // Load NVRAM + LoadNVRAM(Model3); + + // Start up SDL and open a GL window + xRes = xResParam; + yRes = yResParam; + sprintf(titleStr, "Supermodel - %s", Model3->GetGameInfo()->title); + if (OKAY != CreateGLScreen(titleStr,&xOffset,&yOffset,&xRes,&yRes,fullScreen)) + return 1; + + // Hide mouse if fullscreen + Inputs->GetInputSystem()->SetMouseVisibility(!fullScreen); + + // Attach the inputs to the emulator + Model3->AttachInputs(Inputs); + + // Initialize the renderer + if (OKAY != Render2D->Init(xOffset, yOffset, xRes, yRes)) + goto QuitError; + if (OKAY != Render3D->Init(xOffset, yOffset, xRes, yRes, vsFile, fsFile)) + goto QuitError; + Model3->AttachRenderers(Render2D,Render3D); + + // Emulate! + Model3->Reset(); + fpsFramesElapsed = 0; + framesElapsed = 0; + prevFPSTicks = SDL_GetTicks(); + startTicks = prevFPSTicks; + while (!quit) + { + // If not paused, run one frame + if (!paused) + { + // If not, run one frame + Model3->RunFrame(); + + // Swap the buffers + SDL_GL_SwapBuffers(); + } + + // Poll the inputs + if (!Inputs->Poll(Model3->GetGameInfo(), xOffset, yOffset, xRes, yRes)) + quit = 1; + + // Check UI controls + if (Inputs->uiExit->Pressed()) + { + // Quit emulator + quit = 1; + } + else if (Inputs->uiReset->Pressed()) + { + // Reset emulator + Model3->Reset(); + printf("Model 3 reset.\n"); + } + else if (Inputs->uiPause->Pressed()) + { + // Toggle emulator paused flag + paused = !paused; + } + else if (Inputs->uiSaveState->Pressed()) + { + // Save game state + SaveState(Model3); + } + else if (Inputs->uiChangeSlot->Pressed()) + { + // Change save slot + ++saveSlot; + saveSlot %= 10; // clamp to [0,9] + printf("Save slot: %d\n", saveSlot); + } + else if (Inputs->uiLoadState->Pressed()) + { + // Load game state + LoadState(Model3); + } + else if (Inputs->uiDumpInpState->Pressed()) + { + // Dump input states + Inputs->DumpState(Model3->GetGameInfo()); + } + else if (Inputs->uiToggleCursor->Pressed() && fullScreen) + { + // Toggle cursor in full screen mode + showCursor = !showCursor; + Inputs->GetInputSystem()->SetMouseVisibility(!!showCursor); + } + else if (Inputs->uiClearNVRAM->Pressed()) + { + // Clear NVRAM + Model3->ClearNVRAM(); + printf("NVRAM cleared.\n"); + } + else if (Inputs->uiToggleFrLimit->Pressed()) + { + // Toggle frame limiting + noThrottle = !noThrottle; + printf("Frame limiting: %s\n", noThrottle?"Off":"On"); +/* + SCSP_MidiIn(0xA0); + SCSP_MidiIn(0x00); + SCSP_MidiIn(0x01); // stop? + + SCSP_MidiIn(0xA0); + SCSP_MidiIn(0x11); + SCSP_MidiIn(0x2E); + + SCSP_MidiIn(0xA1); + SCSP_MidiIn(0x70); + SCSP_MidiIn(0x03); + + SCSP_MidiIn(0xAF);SCSP_MidiIn(0x10);SCSP_MidiIn(0x01); + */ + //Sound codes: + // A0 11 xx (0F=time extend, 11=jumbo left right) + // AF 10 xx (music -- 01 seems to work) + } + + // FPS and frame rate + currentFPSTicks = SDL_GetTicks(); + currentTicks = currentFPSTicks; + + // FPS + if (showFPS) + { + ++fpsFramesElapsed; + if((currentFPSTicks-prevFPSTicks) >= 1000) // update FPS every 1 second (each tick is 1 ms) + { + sprintf(titleFPSStr, "%s - %1.1f FPS", titleStr, (float)fpsFramesElapsed*(float)(currentFPSTicks-prevFPSTicks)/1000.0f); + SDL_WM_SetCaption(titleFPSStr,NULL); + prevFPSTicks = currentFPSTicks; // reset tick count + fpsFramesElapsed = 0; // reset frame count + } + } + + // Frame limiting/paused + if (paused || !noThrottle) + { + ++framesElapsed; + targetTicks = startTicks + (unsigned) ((float)framesElapsed * 1000.0f/60.0f); + if (currentTicks <= targetTicks) // add a delay until we reach the next (target) frame time + SDL_Delay(targetTicks-currentTicks); + else // begin a new frame + { + framesElapsed = 0; + startTicks = currentTicks; + } + } + } + + // Save NVRAM + SaveNVRAM(Model3); + + // Shut down + delete Model3; + delete Render2D; + delete Render3D; + + // Dump PowerPC registers +#ifdef DEBUG + for (int i = 0; i < 32; i += 4) + printf("R%d=%08X\tR%d=%08X\tR%d=%08X\tR%d=%08X\n", + i + 0, ppc_get_gpr(i + 0), + i + 1, ppc_get_gpr(i + 1), + i + 2, ppc_get_gpr(i + 2), + i + 3, ppc_get_gpr(i + 3)); + printf("PC =%08X\n", ppc_get_pc()); + printf("LR =%08X\n", ppc_get_lr()); + /* + printf("DBAT0U=%08X\tIBAT0U=%08X\n", ppc_read_spr(SPR603E_DBAT0U), ppc_read_spr(SPR603E_IBAT0U)); + printf("DBAT0L=%08X\tIBAT0L=%08X\n", ppc_read_spr(SPR603E_DBAT0L), ppc_read_spr(SPR603E_IBAT0L)); + printf("DBAT1U=%08X\tIBAT1U=%08X\n", ppc_read_spr(SPR603E_DBAT1U), ppc_read_spr(SPR603E_IBAT1U)); + printf("DBAT1L=%08X\tIBAT1L=%08X\n", ppc_read_spr(SPR603E_DBAT1L), ppc_read_spr(SPR603E_IBAT1L)); + printf("DBAT2U=%08X\tIBAT2U=%08X\n", ppc_read_spr(SPR603E_DBAT2U), ppc_read_spr(SPR603E_IBAT2U)); + printf("DBAT2L=%08X\tIBAT2L=%08X\n", ppc_read_spr(SPR603E_DBAT2L), ppc_read_spr(SPR603E_IBAT2L)); + printf("DBAT3U=%08X\tIBAT3U=%08X\n", ppc_read_spr(SPR603E_DBAT3U), ppc_read_spr(SPR603E_IBAT3U)); + printf("DBAT3L=%08X\tIBAT3L=%08X\n", ppc_read_spr(SPR603E_DBAT3L), ppc_read_spr(SPR603E_IBAT3L)); + for (int i = 0; i < 10; i++) + printf("SR%d =%08X\n", i, ppc_read_sr(i)); + for (int i = 10; i < 16; i++) + printf("SR%d=%08X\n", i, ppc_read_sr(i)); + printf("SDR1=%08X\n", ppc_read_spr(SPR603E_SDR1)); + */ + printf("68K PC =%08X\n", Turbo68KReadPC()); +#endif + + return 0; + + // Quit with an error +QuitError: + delete Model3; + delete Render2D; + delete Render3D; + return 1; +} + + +/****************************************************************************** + Error and Debug Logging +******************************************************************************/ + +#define DEBUG_LOG_FILE "debug.log" +#define ERROR_LOG_FILE "error.log" + +/* + * DebugLog(fmt, ...): + * + * Prints to debug log. The file is opened and closed each time so that its + * contents are preserved even if the program crashes. + * + * Parameters: + * fmt Format string (same as printf()). + * ... Variable number of arguments as required by format string. + */ +void DebugLog(const char *fmt, ...) +{ +#ifdef DEBUG + char string[1024]; + va_list vl; + FILE *fp; + + fp = fopen(DEBUG_LOG_FILE, "ab"); + if (NULL != fp) + { + va_start(vl, fmt); + vsprintf(string, fmt, vl); + va_end(vl); + fprintf(fp, string); + fclose(fp); + } +#endif +} + +/* + * InfoLog(fmt, ...); + * + * Prints information to the error log file but does not print to stderr. This + * is useful for logging non-error information. + * + * Parameters: + * fmt Format string (same as printf()). + * ... Variable number of arguments as required by format string. + */ +void InfoLog(const char *fmt, ...) +{ + char string[4096]; + va_list vl; + FILE *fp; + + va_start(vl, fmt); + vsprintf(string, fmt, vl); + va_end(vl); + + fp = fopen(ERROR_LOG_FILE, "ab"); + if (NULL != fp) + { + fprintf(fp, "%s\n", string); + fclose(fp); + } + + DebugLog("Info: "); + DebugLog(string); + DebugLog("\n"); +} + +/* + * ErrorLog(fmt, ...): + * + * Prints an error to stderr and the error log file. + * + * Parameters: + * fmt Format string (same as printf()). + * ... Variable number of arguments as required by format string. + * + * Returns: + * Always returns FAIL. + */ +BOOL ErrorLog(const char *fmt, ...) +{ + char string[4096]; + va_list vl; + FILE *fp; + + va_start(vl, fmt); + vsprintf(string, fmt, vl); + va_end(vl); + fprintf(stderr, "Error: %s\n", string); + + fp = fopen(ERROR_LOG_FILE, "ab"); + if (NULL != fp) + { + fprintf(fp, "%s\n", string); + fclose(fp); + } + + DebugLog("Error: "); + DebugLog(string); + DebugLog("\n"); + + return FAIL; +} + +// Clear log file +static void ClearLog(const char *file, const char *title) +{ + FILE *fp = fopen(file, "w"); + if (NULL != fp) + { + unsigned i; + fprintf(fp, "%s\n", title); + for (i = 0; i < strlen(title); i++) + fputc('-', fp); + fprintf(fp, "\n\n"); + fclose(fp); + } +} + + +/****************************************************************************** + Diagnostic Commands +******************************************************************************/ + +// Disassemble instructions from CROM +static int DisassembleCROM(const char *zipFile, UINT32 addr, unsigned n) +{ + const struct GameInfo *Game; + UINT8 *crom; + struct ROMMap Map[] = + { + { "CROM", NULL }, + { "CROMxx", NULL }, + { NULL, NULL } + }; + char mnem[16], oprs[48]; + UINT32 op; + + // Do we have a valid CROM address? + if (addr < 0xFF800000) + return ErrorLog("Valid CROM address range is FF800000-FFFFFFFF."); + + // Allocate memory and set ROM region + crom = new(std::nothrow) UINT8[0x8800000]; + if (NULL == crom) + return ErrorLog("Insufficient memory to load CROM (need %d MB).", (0x8800000/8)); + Map[0].ptr = crom; + Map[1].ptr = &crom[0x800000]; + + // Load ROM set + Game = LoadROMSetFromZIPFile(Map, Model3GameList, zipFile, FALSE); + if (NULL == Game) + return ErrorLog("Failed to load ROM set."); + + // Mirror CROM if necessary + if (Game->cromSize < 0x800000) // high part of fixed CROM region contains CROM0 + CopyRegion(crom, 0, 0x800000-0x200000, &crom[0x800000], 0x800000); + + // Disassemble! + addr -= 0xFF800000; + while ((n > 0) && ((addr+4) <= 0x800000)) + { + op = (crom[addr+0]<<24) | (crom[addr+1]<<16) | (crom[addr+2]<<8) | crom[addr+3]; + + printf("%08X: ", addr+0xFF800000); + if (DisassemblePowerPC(op, addr+0xFF800000, mnem, oprs, 1)) + { + if (mnem[0] != '\0') // invalid form + printf("%08X %s*\t%s\n", op, mnem, oprs); + else + printf("%08X ?\n", op); + } + else + printf("%08X %s\t%s\n", op, mnem, oprs); + + addr += 4; + --n; + } + + delete [] crom; + return OKAY; +} + +/* + * PrintGLInfo(): + * + * Queries and prints OpenGL information. A full list of extensions can + * optionally be printed. + */ +static void PrintGLInfo(BOOL printExtensions) +{ + const GLubyte *str; + char *strLocal; + GLint value; + unsigned xOffset, yOffset, xRes=496, yRes=384; + + if (OKAY != CreateGLScreen("Supermodel - Querying OpenGL Information...",&xOffset,&yOffset,&xRes,&yRes,FALSE)) + { + ErrorLog("Unable to query OpenGL.\n"); + return; + } + + puts("OpenGL information:\n"); + + str = glGetString(GL_VENDOR); + printf(" Vendor: %s\n", str); + + str = glGetString(GL_RENDERER); + printf(" Renderer: %s\n", str); + + str = glGetString(GL_VERSION); + printf(" Version: %s\n", str); + + str = glGetString(GL_SHADING_LANGUAGE_VERSION); + printf(" Shading Language Version: %s\n", str); + + glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, &value); + printf("Maximum Vertex Array Size: %d vertices\n", value); + + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &value); + printf(" Maximum Texture Size: %d texels\n", value); + + glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &value); + printf("Maximum Vertex Attributes: %d\n", value); + + glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, &value); + printf(" Maximum Vertex Uniforms: %d\n", value); + + if (printExtensions) + { + str = glGetString(GL_EXTENSIONS); + strLocal = (char *) malloc((strlen((char *) str)+1)*sizeof(char)); + if (NULL == strLocal) + printf(" Supported Extensions: %s\n", str); + else + { + strcpy(strLocal, (char *) str); + printf(" Supported Extensions: %s\n", (strLocal = strtok(strLocal, " \t\n"))); + while ((strLocal = strtok(NULL, " \t\n")) != NULL) + printf(" %s\n", strLocal); + } + } + + printf("\n"); +} + + +/****************************************************************************** + Entry Point and Command Line Procesing +******************************************************************************/ + +// Print Supermodel title and copyright information +static void Title(void) +{ + puts("Supermodel: A Sega Model 3 Arcade Emulator (Version "SUPERMODEL_VERSION")"); + puts("Copyright (C) 2011 by Bart Trzynadlowski"); + puts(""); +} + +// Print usage information +static void Help(void) +{ + puts("Usage: Supermodel [options]"); + puts("ROM set must be a valid ZIP file containing a single game."); + puts(""); + puts("General Options:"); + puts(" -?, -h Print this help text"); + puts(" -print-games List supported games"); + puts(""); + puts("Emulation Options:"); + puts(" -ppc-frequency= Set PowerPC frequency in MHz [Default: 25]"); + puts(""); + puts("Video Options:"); + puts(" -res=, Resolution"); + puts(" -fullscreen Full screen mode"); + puts(" -no-throttle Disable 60 Hz frame rate limit"); + puts(" -show-fps Display frame rate in window title bar"); +#ifdef DEBUG // ordinary users do not need to know about these, but they are always available + puts(" -vert-shader= Load 3D vertex shader from external file"); + puts(" -frag-shader= Load 3D fragment shader from external file"); +#endif + puts(""); + puts("Input Options:"); + puts(" -input-system= Set input system [Default: SDL]"); + puts(" -print-inputs Prints current input configuration"); + puts(" -config-inputs Configure inputs for keyboards, mice and joysticks"); + puts(""); + puts("Diagnostic Options:"); +#ifdef DEBUG + puts(" -dis=[,n] Disassemble PowerPC code from CROM"); +#endif + puts(" -print-gl-info Print extensive OpenGL information\n"); +} + +// Print game list +static void PrintGameList(void) +{ + int i, j; + + puts("Supported games:"); + puts(""); + puts(" ROM Set Title"); + puts(" ------- -----"); + for (i = 0; Model3GameList[i].title != NULL; i++) + { + printf(" %s", Model3GameList[i].id); + for (j = strlen(Model3GameList[i].id); j < 8; j++) // pad for alignment (no game ID is more than 8 letters) + printf(" "); + printf(" %s\n", Model3GameList[i].title); + } +} + +/* + * main(argc, argv): + * + * Program entry point. + */ +int main(int argc, char **argv) +{ + int i, ret; + int cmd=0, fileIdx=0, cmdFullScreen=0, cmdNoThrottle=0, cmdShowFPS=0, cmdPrintInputs=0, cmdConfigInputs=0, cmdPrintGames=0, cmdDis=0, cmdPrintGLInfo=0; + unsigned n, xRes=496, yRes=384, ppcFrequency=25000000; + char *vsFile = NULL, *fsFile = NULL, *inpSysName = NULL; + UINT32 addr; + + Title(); + if (argc <= 1) + { + Help(); + return 0; + } + +#ifdef DEBUG + ClearLog(DEBUG_LOG_FILE, "Supermodel v"SUPERMODEL_VERSION" Debug Log"); +#endif + ClearLog(ERROR_LOG_FILE, "Supermodel v"SUPERMODEL_VERSION" Error Log"); + + // Parse command line + for (i = 1; i < argc; i++) + { + if (!strcmp(argv[i],"-h") || !strcmp(argv[i],"-?")) + { + Help(); + return 0; + } + else if (!strcmp(argv[i],"-print-games")) + cmd = cmdPrintGames = 1; + else if (!strncmp(argv[i],"-ppc-frequency",14)) + { + int f; + ret = sscanf(&argv[i][14],"=%d",&f); + if (ret != 1) + ErrorLog("-ppc-frequency requires a frequency."); + else + { + if ((f<1) || (f>1000)) // limit to 1-1000MHz + ErrorLog("PowerPC frequency must be between 1 and 1000 MHz. Ignoring."); + else + ppcFrequency = f*1000000; + } + } + else if (!strncmp(argv[i],"-res",4)) + { + unsigned x, y; + + ret = sscanf(&argv[i][4],"=%d,%d",&x,&y); + if (ret != 2) + ErrorLog("-res requires both a width and a height."); + else + { + xRes = x; + yRes = y; + } + } + else if (!strcmp(argv[i],"-fullscreen")) + cmd = cmdFullScreen = 1; + else if (!strcmp(argv[i],"-no-throttle")) + cmd = cmdNoThrottle = 1; + else if (!strcmp(argv[i],"-show-fps")) + cmd = cmdShowFPS = 1; + else if (!strncmp(argv[i],"-vert-shader=",13)) + { + if (argv[i][13] == '\0') + ErrorLog("-vert-shader requires a file path."); + else + vsFile = &argv[i][13]; + } + else if (!strncmp(argv[i],"-frag-shader=",13)) + { + if (argv[i][13] == '\0') + ErrorLog("-frag-shader requires a file path."); + else + fsFile = &argv[i][13]; + } + else if (!strncmp(argv[i],"-input-system=", 14)) + { + if (argv[i][14] == '\0') + ErrorLog("-input-system requires an input system name."); + else + inpSysName = &argv[i][14]; + } + else if (!strcmp(argv[i],"-print-inputs")) + cmd = cmdPrintInputs = 1; + else if (!strcmp(argv[i],"-config-inputs")) + cmd = cmdConfigInputs = 1; + else if (!strncmp(argv[i],"-dis",4)) + { + ret = sscanf(&argv[i][4],"=%X,%X",&addr,&n); + if (ret == 1) + { + n = 16; + cmd = cmdDis = 1; + } + else if (ret == 2) + cmd = cmdDis = 1; + else + ErrorLog("-dis requires address and, optionally, number of instructions."); + } + else if (!strcmp(argv[i],"-print-gl-info")) + cmd = cmdPrintGLInfo = 1; + else if (argv[i][0] == '-') + ErrorLog("Ignoring invalid option: %s.", argv[i]); + else + { + if (fileIdx) // already specified a file + ErrorLog("Multiple files specified. Using %s, ignoring %s.", argv[i], argv[fileIdx]); + else + fileIdx = i; + } + } + + // Initialize SDL (individual subsystems get initialized later) + if (SDL_Init(0) != 0) + { + ErrorLog("Unable to initialize SDL: %s\n", SDL_GetError()); + return 1; + } + + CInputSystem *InputSystem = NULL; + CInputs *Inputs = NULL; + int exitCode = 0; + + // Create input system (default is SDL) + if (inpSysName == NULL || stricmp(inpSysName, "sdl") == 0) + InputSystem = new CSDLInputSystem(); +#ifdef SUPERMODEL_WIN32 + else if (stricmp(inpSysName, "dinput") == 0) + InputSystem = new CDirectInputSystem(false); + else if (stricmp(inpSysName, "rawinput") == 0) + InputSystem = new CDirectInputSystem(true); +#endif + else + { + ErrorLog("Unknown input system: '%s'.\n", inpSysName); + exitCode = 1; + goto Exit; + } + + // Create inputs from input system (configuring them if required) + Inputs = CreateInputs(InputSystem, cmdConfigInputs); + if (Inputs == NULL) + { + exitCode = 1; + goto Exit; + } + + if (cmdPrintInputs) + { + Inputs->PrintInputs(NULL); + InputSystem->PrintSettings(); + } + + // Process commands that don't require ROM set + if (cmd) + { + if (cmdPrintGames) + { + PrintGameList(); + goto Exit; + } + + if (cmdPrintGLInfo) + { + PrintGLInfo(FALSE); + goto Exit; + } + } + + if (fileIdx == 0) + { + ErrorLog("No ROM set specified."); + exitCode = 1; + goto Exit; + } + + // Process commands that require ROMs + if (cmd) + { + if (cmdDis) + { + if (OKAY != DisassembleCROM(argv[fileIdx], addr, n)) + exitCode = 1; + goto Exit; + } + } + + // Fire up Supermodel + exitCode = Supermodel(argv[fileIdx],Inputs,ppcFrequency,xRes,yRes,cmdFullScreen,cmdNoThrottle,cmdShowFPS,vsFile,fsFile); + +Exit: + if (InputSystem != NULL) + delete InputSystem; + if (Inputs != NULL) + delete Inputs; + SDL_Quit(); + return exitCode; +} diff --git a/OSD/SDL/SDLInputSystem.cpp b/OSD/SDL/SDLInputSystem.cpp new file mode 100644 index 0000000..eefa274 --- /dev/null +++ b/OSD/SDL/SDLInputSystem.cpp @@ -0,0 +1,386 @@ +#include "SDLInputSystem.h" +#include "Supermodel.h" + +#include +using namespace std; + +SDLKeyMapStruct CSDLInputSystem::s_keyMap[] = +{ + // General keys + { "BACKSPACE", SDLK_BACKSPACE }, + { "TAB", SDLK_TAB }, + { "CLEAR", SDLK_CLEAR }, + { "RETURN", SDLK_RETURN }, + { "PAUSE", SDLK_PAUSE }, + { "ESCAPE", SDLK_ESCAPE }, + { "SPACE", SDLK_SPACE }, + { "EXCLAIM", SDLK_EXCLAIM }, + { "DBLQUOTE", SDLK_QUOTEDBL }, + { "HASH", SDLK_HASH }, + { "DOLLAR", SDLK_DOLLAR }, + { "AMPERSAND", SDLK_AMPERSAND }, + { "QUOTE", SDLK_QUOTE }, + { "LEFTPAREN", SDLK_LEFTPAREN }, + { "RIGHTPAREN", SDLK_RIGHTPAREN }, + { "ASTERISK", SDLK_ASTERISK }, + { "PLUS", SDLK_PLUS }, + { "COMMA", SDLK_COMMA }, + { "MINUS", SDLK_MINUS }, + { "PERIOD", SDLK_PERIOD }, + { "SLASH", SDLK_SLASH }, + { "0", SDLK_0 }, + { "1", SDLK_1 }, + { "2", SDLK_2 }, + { "3", SDLK_3 }, + { "4", SDLK_4 }, + { "5", SDLK_5 }, + { "6", SDLK_6 }, + { "7", SDLK_7 }, + { "8", SDLK_8 }, + { "9", SDLK_9 }, + { "COLON", SDLK_COLON }, + { "SEMICOLON", SDLK_SEMICOLON }, + { "LESS", SDLK_LESS }, + { "EQUALS", SDLK_EQUALS }, + { "GREATER", SDLK_GREATER }, + { "QUESTION", SDLK_QUESTION }, + { "AT", SDLK_AT }, + { "LEFTBRACKET", SDLK_LEFTBRACKET }, + { "BACKSLASH", SDLK_BACKSLASH }, + { "RIGHTBRACKET", SDLK_RIGHTBRACKET }, + { "CARET", SDLK_CARET }, + { "UNDERSCORE", SDLK_UNDERSCORE }, + { "BACKQUOTE", SDLK_BACKQUOTE }, + { "A", SDLK_a }, + { "B", SDLK_b }, + { "C", SDLK_c }, + { "D", SDLK_d }, + { "E", SDLK_e }, + { "F", SDLK_f }, + { "G", SDLK_g }, + { "H", SDLK_h }, + { "I", SDLK_i }, + { "J", SDLK_j }, + { "K", SDLK_k }, + { "L", SDLK_l }, + { "M", SDLK_m }, + { "N", SDLK_n }, + { "O", SDLK_o }, + { "P", SDLK_p }, + { "Q", SDLK_q }, + { "R", SDLK_r }, + { "S", SDLK_s }, + { "T", SDLK_t }, + { "U", SDLK_u }, + { "V", SDLK_v }, + { "W", SDLK_w }, + { "X", SDLK_x }, + { "Y", SDLK_y }, + { "Z", SDLK_z }, + { "DEL", SDLK_DELETE }, + + // Keypad + { "KEYPAD0", SDLK_KP0 }, + { "KEYPAD1", SDLK_KP1 }, + { "KEYPAD2", SDLK_KP2 }, + { "KEYPAD3", SDLK_KP3 }, + { "KEYPAD4", SDLK_KP4 }, + { "KEYPAD5", SDLK_KP5 }, + { "KEYPAD6", SDLK_KP6 }, + { "KEYPAD7", SDLK_KP7 }, + { "KEYPAD8", SDLK_KP8 }, + { "KEYPAD9", SDLK_KP9 }, + { "KEYPADPERIOD", SDLK_KP_PERIOD }, + { "KEYPADDIVIDE", SDLK_KP_DIVIDE }, + { "KEYPADMULTIPLY", SDLK_KP_MULTIPLY }, + { "KEYPADMINUS", SDLK_KP_MINUS }, + { "KEYPADPLUS", SDLK_KP_PLUS }, + { "KEYPADENTER", SDLK_KP_ENTER }, + { "KEYPADEQUALS", SDLK_KP_EQUALS }, + + // Arrows + Home/End Pad + { "UP", SDLK_UP }, + { "DOWN", SDLK_DOWN }, + { "RIGHT", SDLK_RIGHT }, + { "LEFT", SDLK_LEFT }, + { "INSERT", SDLK_INSERT }, + { "HOME", SDLK_HOME }, + { "END", SDLK_END }, + { "PGUP", SDLK_PAGEUP }, + { "PGDN", SDLK_PAGEDOWN }, + + // Function Key + { "F1", SDLK_F1 }, + { "F2", SDLK_F2 }, + { "F3", SDLK_F3 }, + { "F4", SDLK_F4 }, + { "F5", SDLK_F5 }, + { "F6", SDLK_F6 }, + { "F7", SDLK_F7 }, + { "F8", SDLK_F8 }, + { "F9", SDLK_F9 }, + { "F10", SDLK_F10 }, + { "F11", SDLK_F11 }, + { "F12", SDLK_F12 }, + { "F13", SDLK_F13 }, + { "F14", SDLK_F14 }, + { "F15", SDLK_F15 }, + + // Modifier Keys + // Removed Numlock, Capslock and Scrollock as don't seem to be handled well by SDL + //{ "NUMLOCK", SDLK_NUMLOCK }, + //{ "CAPSLOCK", SDLK_CAPSLOCK }, + //{ "SCROLLLOCK", SDLK_SCROLLOCK }, + { "RIGHTSHIFT", SDLK_RSHIFT }, + { "LEFTSHIFT", SDLK_LSHIFT }, + { "RIGHTCTRL", SDLK_RCTRL }, + { "LEFTCTRL", SDLK_LCTRL }, + { "RIGHTALT", SDLK_RALT }, + { "LEFTALT", SDLK_LALT }, + { "RIGHTMETA", SDLK_RMETA }, + { "LEFTMETA", SDLK_LMETA }, + { "RIGHTWINDOWS", SDLK_RSUPER }, + { "LEFTWINDOWS", SDLK_LSUPER }, + { "ALTGR", SDLK_MODE }, + { "COMPOSE", SDLK_COMPOSE }, + + // Other + { "HELP", SDLK_HELP }, + { "PRINT", SDLK_PRINT }, + { "SYSREQ", SDLK_SYSREQ }, + { "BREAK", SDLK_BREAK }, + { "MENU", SDLK_MENU }, + { "POWER", SDLK_POWER }, + { "EURO", SDLK_EURO }, + { "UNDO", SDLK_UNDO } +}; + +CSDLInputSystem::CSDLInputSystem() : CInputSystem("SDL"), m_keyState(NULL), m_mouseX(0), m_mouseY(0), m_mouseZ(0), m_mouseButtons(0) +{ + // +} + +CSDLInputSystem::~CSDLInputSystem() +{ + CloseJoysticks(); +} + +void CSDLInputSystem::OpenJoysticks() +{ + // Open all available joysticks + int numJoys = SDL_NumJoysticks(); + for (int joyNum = 0; joyNum < numJoys; joyNum++) + { + SDL_Joystick *joystick = SDL_JoystickOpen(joyNum); + if (joystick == NULL) + { + ErrorLog("Unable to open joystick device %d with SDL - skipping joystick.\n", joyNum + 1); + continue; + } + + // Gather joystick details (num POVs & buttons and which axes are available) + int numAxes = SDL_JoystickNumAxes(joystick); + JoyDetails *joyDetails = new JoyDetails(); + joyDetails->hasXAxis = numAxes > 0; + joyDetails->hasYAxis = numAxes > 1; + joyDetails->hasZAxis = numAxes > 2; + joyDetails->hasRXAxis = numAxes > 3; + joyDetails->hasRYAxis = numAxes > 4; + joyDetails->hasRZAxis = numAxes > 5; + joyDetails->numPOVs = SDL_JoystickNumHats(joystick); + joyDetails->numButtons = SDL_JoystickNumButtons(joystick); + + m_joysticks.push_back(joystick); + m_joyDetails.push_back(joyDetails); + } +} + +void CSDLInputSystem::CloseJoysticks() +{ + // Close all previously opened joysticks + for (size_t i = 0; i < m_joysticks.size(); i++) + { + SDL_Joystick *joystick = m_joysticks[i]; + JoyDetails *joyDetails = m_joyDetails[i]; + + SDL_JoystickClose(joystick); + delete joyDetails; + } + + m_joysticks.clear(); + m_joyDetails.clear(); +} + +bool CSDLInputSystem::InitializeSystem() +{ + // Make sure joystick subsystem is initialized and joystick events are enabled + if (SDL_InitSubSystem(SDL_INIT_JOYSTICK) != 0) + { + ErrorLog("Unable to initialize SDL joystick subsystem (%s).\n", SDL_GetError()); + + return false; + } + SDL_JoystickEventState(SDL_ENABLE); + + // Open attached joysticks + OpenJoysticks(); + return true; +} + +int CSDLInputSystem::GetNumKeyboards() +{ + // Return ANY_KEYBOARD as SDL 1.2 cannot handle multiple keyboards + return ANY_KEYBOARD; +} + +int CSDLInputSystem::GetNumMice() +{ + // Return ANY_MOUSE as SDL 1.2 cannot handle multiple mice + return ANY_MOUSE; +} + +int CSDLInputSystem::GetNumJoysticks() +{ + // Return number of joysticks found + return m_joysticks.size(); +} + +int CSDLInputSystem::GetKeyIndex(const char *keyName) +{ + for (int i = 0; i < NUM_SDL_KEYS; i++) + { + if (stricmp(keyName, s_keyMap[i].keyName) == 0) + return i; + } + return -1; +} + +const char *CSDLInputSystem::GetKeyName(int keyIndex) +{ + if (keyIndex < 0 || keyIndex >= NUM_SDL_KEYS) + return NULL; + return s_keyMap[keyIndex].keyName; +} + +JoyDetails *CSDLInputSystem::GetJoyDetails(int joyNum) +{ + return m_joyDetails[joyNum]; +} + +bool CSDLInputSystem::IsKeyPressed(int kbdNum, int keyIndex) +{ + // Get SDL key for given index and check if currently pressed + SDLKey sdlKey = s_keyMap[keyIndex].sdlKey; + return !!m_keyState[sdlKey]; +} + +int CSDLInputSystem::GetMouseAxisValue(int mseNum, int axisNum) +{ + // Return value for given mouse axis + switch (axisNum) + { + case AXIS_X: return m_mouseX; + case AXIS_Y: return m_mouseY; + case AXIS_Z: return m_mouseZ; + default: return 0; + } +} + +int CSDLInputSystem::GetMouseWheelDir(int mseNum) +{ + // Return wheel value + return m_mouseWheelDir; +} + +bool CSDLInputSystem::IsMouseButPressed(int mseNum, int butNum) +{ + // Return value for given mouse button + switch (butNum) + { + case 0: return !!(m_mouseButtons & SDL_BUTTON_LMASK); + case 1: return !!(m_mouseButtons & SDL_BUTTON_MMASK); + case 2: return !!(m_mouseButtons & SDL_BUTTON_RMASK); + case 3: return !!(m_mouseButtons & SDL_BUTTON_X1MASK); + case 4: return !!(m_mouseButtons & SDL_BUTTON_X2MASK); + default: return false; + } +} + +int CSDLInputSystem::GetJoyAxisValue(int joyNum, int axisNum) +{ + // Get raw joystick axis value for given joystick from SDL (values range from -32768 to 32767) + SDL_Joystick *joystick = m_joysticks[joyNum]; + return SDL_JoystickGetAxis(joystick, axisNum); +} + +bool CSDLInputSystem::IsJoyPOVInDir(int joyNum, int povNum, int povDir) +{ + // Get current joystick POV-hat value for given joystick and POV number from SDL and check if pointing in required direction + SDL_Joystick *joystick = m_joysticks[joyNum]; + int hatVal = SDL_JoystickGetHat(joystick, povNum); + switch (povDir) + { + case POV_UP: return !!(hatVal & SDL_HAT_UP); + case POV_DOWN: return !!(hatVal & SDL_HAT_DOWN); + case POV_LEFT: return !!(hatVal & SDL_HAT_LEFT); + case POV_RIGHT: return !!(hatVal & SDL_HAT_RIGHT); + default: return false; + } + return false; +} + +bool CSDLInputSystem::IsJoyButPressed(int joyNum, int butNum) +{ + // Get current joystick button state for given joystick and button number from SDL + SDL_Joystick *joystick = m_joysticks[joyNum]; + return !!SDL_JoystickGetButton(joystick, butNum); +} + +void CSDLInputSystem::Wait(int ms) +{ + SDL_Delay(ms); +} + +void CSDLInputSystem::SetMouseVisibility(bool visible) +{ + SDL_ShowCursor(visible ? SDL_ENABLE : SDL_DISABLE); +} + +bool CSDLInputSystem::Poll() +{ + // Reset mouse wheel direction + m_mouseWheelDir = 0; + + // Poll for event from SDL + SDL_Event e; + while (SDL_PollEvent(&e)) + { + if (e.type == SDL_QUIT) + return false; + else if (e.type == SDL_MOUSEBUTTONDOWN) + { + // Mouse wheel movements are not returned by SDL_GetMouseState below, so they are handled here instead + // The mouse absolute Z-axis value and mouse wheel direction value are updated appropriately + if (e.button.button == SDL_BUTTON_WHEELUP) + { + m_mouseZ += 5; + m_mouseWheelDir = 1; + } + else if (e.button.button == SDL_BUTTON_WHEELDOWN) + { + m_mouseZ -= 5; + m_mouseWheelDir = -1; + } + } + } + + // Get key state from SDL + m_keyState = SDL_GetKeyState(NULL); + + // Get mouse state from SDL (except mouse wheel which was handled earlier) + m_mouseButtons = SDL_GetMouseState(&m_mouseX, &m_mouseY); + + // Update joystick state (not required as called implicitly by SDL_PollEvent above) + //SDL_JoystickUpdate(); + return true; +} \ No newline at end of file diff --git a/OSD/SDL/SDLInputSystem.h b/OSD/SDL/SDLInputSystem.h new file mode 100644 index 0000000..32219d8 --- /dev/null +++ b/OSD/SDL/SDLInputSystem.h @@ -0,0 +1,106 @@ +#ifndef INCLUDED_SDLINPUTSYSTEM_H +#define INCLUDED_SDLINPUTSYSTEM_H + +#include "Types.h" +#include "Inputs/InputSource.h" +#include "Inputs/InputSystem.h" + +#ifdef SUPERMODEL_OSX +#include +#else +#include +#endif + +#include +using namespace std; + +#define NUM_SDL_KEYS (sizeof(s_keyMap) / sizeof(SDLKeyMapStruct)) + +struct SDLKeyMapStruct +{ + const char *keyName; + SDLKey sdlKey; +}; + +/* + * Input system that uses SDL. + */ +class CSDLInputSystem : public CInputSystem +{ +private: + // Lookup table to map key names to SDLKeys + static SDLKeyMapStruct s_keyMap[]; + + // Vector to keep track of attached joysticks + vector m_joysticks; + + vector m_joyDetails; + + // Current key state obtained from SDL + Uint8 *m_keyState; + + // Current mouse state obtained from SDL + int m_mouseX; + int m_mouseY; + int m_mouseZ; + short m_mouseWheelDir; + Uint8 m_mouseButtons; + + /* + * Opens all attached joysticks. + */ + void OpenJoysticks(); + + /* + * Closes all attached joysticks. + */ + void CloseJoysticks(); + +protected: + /* + * Initializes the SDL input system. + */ + bool InitializeSystem(); + + int GetNumKeyboards(); + + int GetNumMice(); + + int GetNumJoysticks(); + + int GetKeyIndex(const char *keyName); + + const char *GetKeyName(int keyIndex); + + JoyDetails *GetJoyDetails(int joyNum); + + bool IsKeyPressed(int kbdNum, int keyIndex); + + int GetMouseAxisValue(int mseNum, int axisNum); + + int GetMouseWheelDir(int mseNum); + + bool IsMouseButPressed(int mseNum, int butNum); + + int GetJoyAxisValue(int joyNum, int axisNum); + + bool IsJoyPOVInDir(int joyNum, int povNum, int povDir); + + bool IsJoyButPressed(int joyNum, int butNum); + + void Wait(int ms); + + void SetMouseVisibility(bool visible); + +public: + /* + * Constructs an SDL input system. + */ + CSDLInputSystem(); + + ~CSDLInputSystem(); + + bool Poll(); +}; + +#endif // INCLUDED_SDLINPUTSYSTEM_H diff --git a/OSD/SDL/SDLMain_tmpl.h b/OSD/SDL/SDLMain_tmpl.h new file mode 100644 index 0000000..4683df5 --- /dev/null +++ b/OSD/SDL/SDLMain_tmpl.h @@ -0,0 +1,11 @@ +/* SDLMain.m - main entry point for our Cocoa-ized SDL app + Initial Version: Darrell Walisser + Non-NIB-Code & other changes: Max Horn + + Feel free to customize this file to suit your needs +*/ + +#import + +@interface SDLMain : NSObject +@end diff --git a/OSD/SDL/SDLMain_tmpl.m b/OSD/SDL/SDLMain_tmpl.m new file mode 100644 index 0000000..21c1ff2 --- /dev/null +++ b/OSD/SDL/SDLMain_tmpl.m @@ -0,0 +1,384 @@ +/* SDLMain.m - main entry point for our Cocoa-ized SDL app + Initial Version: Darrell Walisser + Non-NIB-Code & other changes: Max Horn + + Feel free to customize this file to suit your needs +*/ + +#import "SDL/SDL.h" +#import "SDLMain_tmpl.h" +#import /* for MAXPATHLEN */ +#import + +/* For some reaon, Apple removed setAppleMenu from the headers in 10.4, + but the method still is there and works. To avoid warnings, we declare + it ourselves here. */ +@interface NSApplication(SDL_Missing_Methods) +- (void)setAppleMenu:(NSMenu *)menu; +@end + +/* Use this flag to determine whether we use SDLMain.nib or not */ +#define SDL_USE_NIB_FILE 0 + +/* Use this flag to determine whether we use CPS (docking) or not */ +#define SDL_USE_CPS 0 +#ifdef SDL_USE_CPS +/* Portions of CPS.h */ +typedef struct CPSProcessSerNum +{ + UInt32 lo; + UInt32 hi; +} CPSProcessSerNum; + +extern "C" OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn); +extern "C" OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5); +extern "C" OSErr CPSSetFrontProcess( CPSProcessSerNum *psn); + +#endif /* SDL_USE_CPS */ + +static int gArgc; +static char **gArgv; +static BOOL gFinderLaunch; +static BOOL gCalledAppMainline = FALSE; + +static NSString *getApplicationName(void) +{ + NSDictionary *dict; + NSString *appName = 0; + + /* Determine the application name */ + dict = (NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle()); + if (dict) + appName = [dict objectForKey: @"CFBundleName"]; + + if (![appName length]) + appName = [[NSProcessInfo processInfo] processName]; + + return appName; +} + +#if SDL_USE_NIB_FILE +/* A helper category for NSString */ +@interface NSString (ReplaceSubString) +- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString; +@end +#endif + +@interface SDLApplication : NSApplication +@end + +@implementation SDLApplication +/* Invoked from the Quit menu item */ +- (void)terminate:(id)sender +{ + /* Post a SDL_QUIT event */ + SDL_Event event; + event.type = SDL_QUIT; + SDL_PushEvent(&event); +} +@end + +/* The main class of the application, the application's delegate */ +@implementation SDLMain + +/* Set the working directory to the .app's parent directory */ +- (void) setupWorkingDirectory:(BOOL)shouldChdir +{ + if (shouldChdir) + { + char parentdir[MAXPATHLEN]; + CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle()); + CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url); + if (CFURLGetFileSystemRepresentation(url2, true, (UInt8 *)parentdir, MAXPATHLEN)) { + assert ( chdir (parentdir) == 0 ); /* chdir to the binary app's parent */ + } + CFRelease(url); + CFRelease(url2); + } + +} + +#if SDL_USE_NIB_FILE + +/* Fix menu to contain the real app name instead of "SDL App" */ +- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName +{ + NSRange aRange; + NSEnumerator *enumerator; + NSMenuItem *menuItem; + + aRange = [[aMenu title] rangeOfString:@"SDL App"]; + if (aRange.length != 0) + [aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]]; + + enumerator = [[aMenu itemArray] objectEnumerator]; + while ((menuItem = [enumerator nextObject])) + { + aRange = [[menuItem title] rangeOfString:@"SDL App"]; + if (aRange.length != 0) + [menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]]; + if ([menuItem hasSubmenu]) + [self fixMenu:[menuItem submenu] withAppName:appName]; + } + [ aMenu sizeToFit ]; +} + +#else + +static void setApplicationMenu(void) +{ + /* warning: this code is very odd */ + NSMenu *appleMenu; + NSMenuItem *menuItem; + NSString *title; + NSString *appName; + + appName = getApplicationName(); + appleMenu = [[NSMenu alloc] initWithTitle:@""]; + + /* Add menu items */ + title = [@"About " stringByAppendingString:appName]; + [appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""]; + + [appleMenu addItem:[NSMenuItem separatorItem]]; + + title = [@"Hide " stringByAppendingString:appName]; + [appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"]; + + menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"]; + [menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)]; + + [appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""]; + + [appleMenu addItem:[NSMenuItem separatorItem]]; + + title = [@"Quit " stringByAppendingString:appName]; + [appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"]; + + + /* Put menu into the menubar */ + menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]; + [menuItem setSubmenu:appleMenu]; + [[NSApp mainMenu] addItem:menuItem]; + + /* Tell the application object that this is now the application menu */ + [NSApp setAppleMenu:appleMenu]; + + /* Finally give up our references to the objects */ + [appleMenu release]; + [menuItem release]; +} + +/* Create a window menu */ +static void setupWindowMenu(void) +{ + NSMenu *windowMenu; + NSMenuItem *windowMenuItem; + NSMenuItem *menuItem; + + windowMenu = [[NSMenu alloc] initWithTitle:@"Window"]; + + /* "Minimize" item */ + menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"]; + [windowMenu addItem:menuItem]; + [menuItem release]; + + /* Put menu into the menubar */ + windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""]; + [windowMenuItem setSubmenu:windowMenu]; + [[NSApp mainMenu] addItem:windowMenuItem]; + + /* Tell the application object that this is now the window menu */ + [NSApp setWindowsMenu:windowMenu]; + + /* Finally give up our references to the objects */ + [windowMenu release]; + [windowMenuItem release]; +} + +/* Replacement for NSApplicationMain */ +static void CustomApplicationMain (int argc, char **argv) +{ + NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; + SDLMain *sdlMain; + + /* Ensure the application object is initialised */ + [SDLApplication sharedApplication]; + +#ifdef SDL_USE_CPS + { + CPSProcessSerNum PSN; + /* Tell the dock about us */ + if (!CPSGetCurrentProcess(&PSN)) + if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103)) + if (!CPSSetFrontProcess(&PSN)) + [SDLApplication sharedApplication]; + } +#endif /* SDL_USE_CPS */ + + /* Set up the menubar */ + [NSApp setMainMenu:[[NSMenu alloc] init]]; + setApplicationMenu(); + setupWindowMenu(); + + /* Create SDLMain and make it the app delegate */ + sdlMain = [[SDLMain alloc] init]; + [NSApp setDelegate:sdlMain]; + + /* Start the main event loop */ + [NSApp run]; + + [sdlMain release]; + [pool release]; +} + +#endif + + +/* + * Catch document open requests...this lets us notice files when the app + * was launched by double-clicking a document, or when a document was + * dragged/dropped on the app's icon. You need to have a + * CFBundleDocumentsType section in your Info.plist to get this message, + * apparently. + * + * Files are added to gArgv, so to the app, they'll look like command line + * arguments. Previously, apps launched from the finder had nothing but + * an argv[0]. + * + * This message may be received multiple times to open several docs on launch. + * + * This message is ignored once the app's mainline has been called. + */ +- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename +{ + const char *temparg; + size_t arglen; + char *arg; + char **newargv; + + if (!gFinderLaunch) /* MacOS is passing command line args. */ + return FALSE; + + if (gCalledAppMainline) /* app has started, ignore this document. */ + return FALSE; + + temparg = [filename UTF8String]; + arglen = SDL_strlen(temparg) + 1; + arg = (char *) SDL_malloc(arglen); + if (arg == NULL) + return FALSE; + + newargv = (char **) SDL_realloc(gArgv, sizeof (char *) * (gArgc + 2)); + if (newargv == NULL) + { + SDL_free(arg); + return FALSE; + } + gArgv = newargv; + + SDL_strlcpy(arg, temparg, arglen); + gArgv[gArgc++] = arg; + gArgv[gArgc] = NULL; + return TRUE; +} + + +/* Called when the internal event loop has just started running */ +- (void) applicationDidFinishLaunching: (NSNotification *) note +{ + int status; + + /* Set the working directory to the .app's parent directory */ + [self setupWorkingDirectory:gFinderLaunch]; + +#if SDL_USE_NIB_FILE + /* Set the main menu to contain the real app name instead of "SDL App" */ + [self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()]; +#endif + + /* Hand off to main application code */ + gCalledAppMainline = TRUE; + status = SDL_main (gArgc, gArgv); + + /* We're done, thank you for playing */ + exit(status); +} +@end + + +@implementation NSString (ReplaceSubString) + +- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString +{ + unsigned int bufferSize; + unsigned int selfLen = [self length]; + unsigned int aStringLen = [aString length]; + unichar *buffer; + NSRange localRange; + NSString *result; + + bufferSize = selfLen + aStringLen - aRange.length; + buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar)); + + /* Get first part into buffer */ + localRange.location = 0; + localRange.length = aRange.location; + [self getCharacters:buffer range:localRange]; + + /* Get middle part into buffer */ + localRange.location = 0; + localRange.length = aStringLen; + [aString getCharacters:(buffer+aRange.location) range:localRange]; + + /* Get last part into buffer */ + localRange.location = aRange.location + aRange.length; + localRange.length = selfLen - localRange.location; + [self getCharacters:(buffer+aRange.location+aStringLen) range:localRange]; + + /* Build output string */ + result = [NSString stringWithCharacters:buffer length:bufferSize]; + + NSDeallocateMemoryPages(buffer, bufferSize); + + return result; +} + +@end + + + +#ifdef main +# undef main +#endif + + +/* Main entry point to executable - should *not* be SDL_main! */ +int main (int argc, char **argv) +{ + /* Copy the arguments into a global variable */ + /* This is passed if we are launched by double-clicking */ + if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) { + gArgv = (char **) SDL_malloc(sizeof (char *) * 2); + gArgv[0] = argv[0]; + gArgv[1] = NULL; + gArgc = 1; + gFinderLaunch = YES; + } else { + int i; + gArgc = argc; + gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1)); + for (i = 0; i <= argc; i++) + gArgv[i] = argv[i]; + gFinderLaunch = NO; + } + +#if SDL_USE_NIB_FILE + [SDLApplication poseAsClass:[NSApplication class]]; + NSApplicationMain (argc, argv); +#else + CustomApplicationMain (argc, argv); +#endif + return 0; +} + diff --git a/OSD/SDL/Types.h b/OSD/SDL/Types.h new file mode 100644 index 0000000..3b23e76 --- /dev/null +++ b/OSD/SDL/Types.h @@ -0,0 +1,51 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Types.h + * + * Fundamental data types. + */ + +#ifndef INCLUDED_TYPES_H +#define INCLUDED_TYPES_H + +// Booleans (must be 0 or 1 only) +#define TRUE 1 +#define FALSE 0 +#define OKAY FALSE +#define FAIL TRUE + +// Types +typedef int BOOL; +typedef unsigned long long UINT64; +typedef signed long long INT64; +typedef unsigned int UINT32; +typedef signed int INT32; +typedef unsigned short int UINT16; +typedef signed short int INT16; +typedef unsigned char UINT8; +typedef signed char INT8; +typedef float FLOAT32; +typedef double FLOAT64; + + +#endif // INCLUDED_TYPES_H diff --git a/OSD/Windows/DirectInputSystem.cpp b/OSD/Windows/DirectInputSystem.cpp new file mode 100644 index 0000000..31e7332 --- /dev/null +++ b/OSD/Windows/DirectInputSystem.cpp @@ -0,0 +1,1135 @@ +#include "DirectInputSystem.h" +#include "Supermodel.h" + +#include +#include + +// TODO - need to double check these all correct and see if can fill in any missing codes (although most just don't exist) +DIKeyMapStruct CDirectInputSystem::s_keyMap[] = +{ + // General keys + { "BACKSPACE", DIK_BACK }, + { "TAB", DIK_TAB }, + //{ "CLEAR", ?? }, + { "RETURN", DIK_RETURN }, + { "PAUSE", DIK_PAUSE }, + { "ESCAPE", DIK_ESCAPE }, + { "SPACE", DIK_SPACE }, + //{ "EXCLAIM", ?? }, + //{ "DBLQUOTE", ?? }, + //{ "HASH", ?? }, + //{ "DOLLAR", ?? }, + //{ "AMPERSAND", ?? }, + { "QUOTE", DIK_APOSTROPHE }, + { "LEFTPAREN", DIK_LBRACKET }, + { "RIGHTPAREN", DIK_RBRACKET }, + //{ "ASTERISK", ?? }, + //{ "PLUS", ?? }, + { "COMMA", DIK_COMMA }, + { "MINUS", DIK_MINUS }, + { "PERIOD", DIK_PERIOD }, + { "SLASH", DIK_SLASH }, + { "0", DIK_0 }, + { "1", DIK_1 }, + { "2", DIK_2 }, + { "3", DIK_3 }, + { "4", DIK_4 }, + { "5", DIK_5 }, + { "6", DIK_6 }, + { "7", DIK_7 }, + { "8", DIK_8 }, + { "9", DIK_9 }, + //{ "COLON", ?? }, + { "SEMICOLON", DIK_SEMICOLON }, + { "LESS", DIK_OEM_102 }, + { "EQUALS", DIK_EQUALS }, + //{ "GREATER", ?? }, + //{ "QUESTION", ?? }, + //{ "AT", ?? }, + //{ "LEFTBRACKET", ?? }, + //{ "BACKSLASH", ?? }, + //{ "RIGHTBRACKET", ?? }, + //{ "CARET", ?? }, + //{ "UNDERSCORE", ?? }, + { "BACKQUOTE", DIK_GRAVE }, + { "A", DIK_A }, + { "B", DIK_B }, + { "C", DIK_C }, + { "D", DIK_D }, + { "E", DIK_E }, + { "F", DIK_F }, + { "G", DIK_G }, + { "H", DIK_H }, + { "I", DIK_I }, + { "J", DIK_J }, + { "K", DIK_K }, + { "L", DIK_L }, + { "M", DIK_M }, + { "N", DIK_N }, + { "O", DIK_O }, + { "P", DIK_P }, + { "Q", DIK_Q }, + { "R", DIK_R }, + { "S", DIK_S }, + { "T", DIK_T }, + { "U", DIK_U }, + { "V", DIK_V }, + { "W", DIK_W }, + { "X", DIK_X }, + { "Y", DIK_Y }, + { "Z", DIK_Z }, + { "DEL", DIK_DELETE }, + + // Keypad + { "KEYPAD0", DIK_NUMPAD0 }, + { "KEYPAD1", DIK_NUMPAD1 }, + { "KEYPAD2", DIK_NUMPAD2 }, + { "KEYPAD3", DIK_NUMPAD3 }, + { "KEYPAD4", DIK_NUMPAD4 }, + { "KEYPAD5", DIK_NUMPAD5 }, + { "KEYPAD6", DIK_NUMPAD6 }, + { "KEYPAD7", DIK_NUMPAD7 }, + { "KEYPAD8", DIK_NUMPAD8 }, + { "KEYPAD9", DIK_NUMPAD9 }, + { "KEYPADPERIOD", DIK_DECIMAL }, + { "KEYPADDIVIDE", DIK_DIVIDE }, + { "KEYPADMULTIPLY", DIK_MULTIPLY }, + { "KEYPADMINUS", DIK_SUBTRACT }, + { "KEYPADPLUS", DIK_ADD }, + { "KEYPADENTER", DIK_NUMPADENTER }, + { "KEYPADEQUALS", DIK_NUMPADEQUALS }, + + // Arrows + Home/End Pad + { "UP", DIK_UP }, + { "DOWN", DIK_DOWN }, + { "RIGHT", DIK_RIGHT }, + { "LEFT", DIK_LEFT }, + { "INSERT", DIK_INSERT }, + { "HOME", DIK_HOME }, + { "END", DIK_END }, + { "PGUP", DIK_PRIOR }, + { "PGDN", DIK_NEXT }, + + // Function Key + { "F1", DIK_F1 }, + { "F2", DIK_F2 }, + { "F3", DIK_F3 }, + { "F4", DIK_F4 }, + { "F5", DIK_F5 }, + { "F6", DIK_F6 }, + { "F7", DIK_F7 }, + { "F8", DIK_F8 }, + { "F9", DIK_F9 }, + { "F10", DIK_F10 }, + { "F11", DIK_F11 }, + { "F12", DIK_F12 }, + { "F13", DIK_F13 }, + { "F14", DIK_F14 }, + { "F15", DIK_F15 }, + + // Modifier Keys + { "NUMLOCK", DIK_NUMLOCK }, + { "CAPSLOCK", DIK_CAPITAL }, + { "SCROLLLOCK", DIK_SCROLL }, + { "RIGHTSHIFT", DIK_RSHIFT }, + { "LEFTSHIFT", DIK_LSHIFT }, + { "RIGHTCTRL", DIK_RCONTROL }, + { "LEFTCTRL", DIK_LCONTROL }, + { "RIGHTALT", DIK_RMENU }, + { "LEFTALT", DIK_LMENU }, + //{ "RIGHTMETA", ?? }, + //{ "LEFTMETA", ?? }, + { "RIGHTWINDOWS", DIK_RWIN }, + { "LEFTWINDOWS", DIK_LWIN }, + //{ "ALTGR", ?? }, + //{ "COMPOSE", ?? }, + + // Other + //{ "HELP", ?? }, + { "PRINT", DIK_SYSRQ }, + //{ "SYSREQ", ?? }, + //{ "BREAK", ?? }, + //{ "MENU", ?? }, + //{ "POWER", ?? }, + //{ "EURO", ?? }, + //{ "UNDO", ?? }, +}; + +BOOL CALLBACK DI8EnumDevicesCallback(LPCDIDEVICEINSTANCE instance, LPVOID context) +{ + // Keep track of all joystick device GUIDs + vector *guids = (vector*)context; + guids->push_back(instance->guidInstance); + return DIENUM_CONTINUE; +} + +BOOL CALLBACK DI8EnumAxesCallback(LPCDIDEVICEOBJECTINSTANCE instance, LPVOID context) +{ + // Find out which joystick axes are present + // TODO - is usage/usage page best method or is better to use something like: + // int axisNum = (instance->dwOfs - offsetof(DIJOYSTATE2, lX)) / sizeof(LONG)? + JoyDetails *joyDetails = (JoyDetails*)context; + if (MATCHES_USAGE(instance->wUsage, instance->wUsagePage, X_AXIS_USAGE)) joyDetails->hasXAxis = true; + else if (MATCHES_USAGE(instance->wUsage, instance->wUsagePage, Y_AXIS_USAGE)) joyDetails->hasYAxis = true; + else if (MATCHES_USAGE(instance->wUsage, instance->wUsagePage, Z_AXIS_USAGE)) joyDetails->hasZAxis = true; + else if (MATCHES_USAGE(instance->wUsage, instance->wUsagePage, RX_AXIS_USAGE)) joyDetails->hasRXAxis = true; + else if (MATCHES_USAGE(instance->wUsage, instance->wUsagePage, RY_AXIS_USAGE)) joyDetails->hasRYAxis = true; + else if (MATCHES_USAGE(instance->wUsage, instance->wUsagePage, RZ_AXIS_USAGE)) joyDetails->hasRZAxis = true; + return DIENUM_CONTINUE; +} + +CDirectInputSystem::CDirectInputSystem(bool useRawInput) : CInputSystem("DirectInput/RawInput"), m_useRawInput(useRawInput), + m_activated(false), m_hwnd(NULL), m_getRIDevListPtr(NULL), m_getRIDevInfoPtr(NULL), m_regRIDevsPtr(NULL), m_getRIDataPtr(NULL), + m_di8(NULL), m_di8Keyboard(NULL), m_di8Mouse(NULL) +{ + // Reset initial states + memset(&m_combRawMseState, 0, sizeof(RawMseState)); + memset(&m_diKeyState, 0, sizeof(LPDIRECTINPUTDEVICE8)); + memset(&m_diMseState, 0, sizeof(LPDIRECTINPUTDEVICE8)); +} + +CDirectInputSystem::~CDirectInputSystem() +{ + CloseKeyboardsAndMice(); + CloseJoysticks(); + + if (m_di8 != NULL) + { + m_di8->Release(); + m_di8 = NULL; + } +} + +void CDirectInputSystem::OpenKeyboardsAndMice() +{ + if (m_useRawInput) + { + // If RawInput enabled, get list of available devices + UINT nDevices; + if (m_getRIDevListPtr(NULL, &nDevices, sizeof(RAWINPUTDEVICELIST)) == 0 && nDevices > 0) + { + PRAWINPUTDEVICELIST pDeviceList = new RAWINPUTDEVICELIST[nDevices]; + if (pDeviceList != NULL && m_getRIDevListPtr(pDeviceList, &nDevices, sizeof(RAWINPUTDEVICELIST)) != (UINT)-1) + { + // Loop through devices backwards (since new devices are usually added at beginning) + for (int devNum = nDevices - 1; devNum >= 0; devNum--) + { + RAWINPUTDEVICELIST device = pDeviceList[devNum]; + + // Get device name + UINT nLength; + if (m_getRIDevInfoPtr(device.hDevice, RIDI_DEVICENAME, NULL, &nLength) != 0) + continue; + char *name = new char[nLength]; + if (m_getRIDevInfoPtr(device.hDevice, RIDI_DEVICENAME, name, &nLength) == -1) + continue; + + // Ignore any RDP devices + if (strstr(name, "Root#RDP_") != NULL) + continue; + + // Store device handles for attached keyboards and mice + if (device.dwType == RIM_TYPEKEYBOARD) + { + m_rawKeyboards.push_back(device.hDevice); + + BOOL *keyState = new BOOL[255]; + memset(keyState, 0, sizeof(BOOL) * 255); + m_rawKeyStates.push_back(keyState); + } + else if (device.dwType == RIM_TYPEMOUSE) + { + m_rawMice.push_back(device.hDevice); + + RawMseState *mseState = new RawMseState(); + memset(mseState, 0, sizeof(RawMseState)); + m_rawMseStates.push_back(mseState); + } + } + + DebugLog("RawInput - found %d keyboards and %d mice", m_rawKeyboards.size(), m_rawMice.size()); + + // Check some devices were actually found + m_useRawInput = m_rawKeyboards.size() > 0 && m_rawMice.size() > 0; + } + else + { + ErrorLog("Unable to query RawInput API for attached devices (error %d) - switching to DirectInput.\n", GetLastError()); + + m_useRawInput = false; + } + + if (pDeviceList != NULL) + delete[] pDeviceList; + } + else + { + ErrorLog("Unable to query RawInput API for attached devices (error %d) - switching to DirectInput.\n", GetLastError()); + + m_useRawInput = false; + } + + if (m_useRawInput) + return; + } + + // If get here then either RawInput disabled or getting its devices failed so default to DirectInput. + // Open DirectInput system keyboard and set its data format + HRESULT hr; + if (FAILED(hr = m_di8->CreateDevice(GUID_SysKeyboard, &m_di8Keyboard, NULL))) + { + ErrorLog("Unable to create DirectInput keyboard device (error %d) - key input will be unavailable.\n", hr); + + m_di8Keyboard = NULL; + } + else if (FAILED(hr = m_di8Keyboard->SetDataFormat(&c_dfDIKeyboard))) + { + ErrorLog("Unable to set data format for DirectInput keyboard (error %d) - key input will be unavailable.\n", hr); + + m_di8Keyboard->Release(); + m_di8Keyboard = NULL; + } + + // Open DirectInput system mouse and set its data format + if (FAILED(hr = m_di8->CreateDevice(GUID_SysMouse, &m_di8Mouse, NULL))) + { + ErrorLog("Unable to create DirectInput mouse device (error %d) - mouse input will be unavailable.\n", hr); + + m_di8Mouse = NULL; + return; + } + if (FAILED(hr = m_di8Mouse->SetDataFormat(&c_dfDIMouse2))) + { + ErrorLog("Unable to set data format for DirectInput mouse (error %d) - mouse input will be unavailable.\n", hr); + + m_di8Mouse->Release(); + m_di8Mouse = NULL; + return; + } + + // Set mouse axis mode to relative + DIPROPDWORD dipdw; + dipdw.diph.dwSize = sizeof(DIPROPDWORD); + dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dipdw.diph.dwHow = DIPH_DEVICE; + dipdw.diph.dwObj = 0; + dipdw.dwData = DIPROPAXISMODE_REL; + if (FAILED(hr = m_di8Mouse->SetProperty(DIPROP_AXISMODE, &dipdw.diph))) + { + ErrorLog("Unable to set axis mode for DirectInput mouse (error %d) - mouse input will be unavailable.\n", hr); + + m_di8Mouse->Release(); + m_di8Mouse = NULL; + } +} + +void CDirectInputSystem::ActivateKeyboardsAndMice() +{ + // Sync up all mice with current cursor position + ResetMice(); + + if (m_useRawInput) + { + // Register for RawInput + RAWINPUTDEVICE rid[2]; + + // Register for keyboard input + rid[0].usUsagePage = 0x01; + rid[0].usUsage = 0x06; + rid[0].dwFlags = (m_isConfiguring ? RIDEV_INPUTSINK : RIDEV_CAPTUREMOUSE) | RIDEV_NOLEGACY; + rid[0].hwndTarget = m_hwnd; + + // Register for mouse input + rid[1].usUsagePage = 0x01; + rid[1].usUsage = 0x02; + rid[1].dwFlags = (m_isConfiguring ? RIDEV_INPUTSINK : RIDEV_CAPTUREMOUSE) | RIDEV_NOLEGACY; + rid[1].hwndTarget = m_hwnd; + + if (!m_regRIDevsPtr(rid, 2, sizeof(RAWINPUTDEVICE))) + ErrorLog("Unable to register for keyboard and mouse input with RawInput API (error %d) - keyboard and mouse input will be unavailable.\n", GetLastError()); + return; + } + + // Set DirectInput cooperative level of keyboard and mouse + if (m_di8Keyboard != NULL) + m_di8Keyboard->SetCooperativeLevel(m_hwnd, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND); + if (m_di8Mouse != NULL) + m_di8Mouse->SetCooperativeLevel(m_hwnd, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND); +} + +void CDirectInputSystem::PollKeyboardsAndMice() +{ + if (m_useRawInput) + { + // For RawInput, only thing to do is update wheelDir from wheelData for each mouse state. Everything else is updated via WM events. + for (vector::iterator it = m_rawMseStates.begin(); it < m_rawMseStates.end(); it++) + { + if ((*it)->wheelDelta != 0) + { + (*it)->wheelDir = ((*it)->wheelDelta > 0 ? 1 : -1); + (*it)->wheelDelta = 0; + } + else + (*it)->wheelDir = 0; + } + if (m_combRawMseState.wheelDelta != 0) + { + m_combRawMseState.wheelDir = (m_combRawMseState.wheelDelta > 0 ? 1 : -1); + m_combRawMseState.wheelDelta = 0; + } + else + m_combRawMseState.wheelDir = 0; + return; + } + + // Get current keyboard state from DirectInput + HRESULT hr; + if (m_di8Keyboard != NULL) + { + if (FAILED(hr = m_di8Keyboard->Poll())) + { + hr = m_di8Keyboard->Acquire(); + while (hr == DIERR_INPUTLOST) + hr = m_di8Keyboard->Acquire(); + + if (hr == DIERR_OTHERAPPHASPRIO || hr == DIERR_INVALIDPARAM || hr == DIERR_NOTINITIALIZED) + return; + } + + // Keep track of keyboard state + m_di8Keyboard->GetDeviceState(sizeof(m_diKeyState), m_diKeyState); + } + + // Get current mouse state from DirectInput + if (m_di8Mouse != NULL) + { + if (FAILED(hr = m_di8Mouse->Poll())) + { + hr = m_di8Mouse->Acquire(); + while (hr == DIERR_INPUTLOST) + hr = m_di8Mouse->Acquire(); + + if (hr == DIERR_OTHERAPPHASPRIO || hr == DIERR_INVALIDPARAM || hr == DIERR_NOTINITIALIZED) + return; + } + + // Keep track of mouse absolute axis values, clamping them at display edges, aswell as wheel direction and buttons + DIMOUSESTATE2 mseState; + m_di8Mouse->GetDeviceState(sizeof(mseState), &mseState); + m_diMseState.x = CInputSource::Clamp(m_diMseState.x + mseState.lX, m_dispX, m_dispX + m_dispW); + m_diMseState.y = CInputSource::Clamp(m_diMseState.y + mseState.lY, m_dispY, m_dispY + m_dispH); + if (mseState.lZ != 0) + { + // Z-axis is clamped to range -100 to 100 (DirectInput returns +120 & -120 for wheel delta which are scaled to +5 & -5) + LONG wheelDelta = 5 * mseState.lZ / 120; + m_diMseState.z = CInputSource::Clamp(m_diMseState.z + wheelDelta, -100, 100); + m_diMseState.wheelDir = (wheelDelta > 0 ? 1 : -1); + } + else + m_diMseState.wheelDir = 0; + memcpy(&m_diMseState.buttons, mseState.rgbButtons, sizeof(m_diMseState.buttons)); + } +} + +void CDirectInputSystem::CloseKeyboardsAndMice() +{ + if (m_useRawInput) + { + if (m_activated) + { + // If RawInput was registered, then unregister now + RAWINPUTDEVICE rid[2]; + + // Unregister from keyboard input + rid[0].usUsagePage = 0x01; + rid[0].usUsage = 0x06; + rid[0].dwFlags = RIDEV_REMOVE; + rid[0].hwndTarget = m_hwnd; + + // Unregister from mouse input + rid[1].usUsagePage = 0x01; + rid[1].usUsage = 0x02; + rid[1].dwFlags = RIDEV_REMOVE; + rid[1].hwndTarget = m_hwnd; + + m_regRIDevsPtr(rid, 2, sizeof(RAWINPUTDEVICE)); + } + + for (vector::iterator it = m_rawKeyStates.begin(); it < m_rawKeyStates.end(); it++) + delete[] *it; + for (vector::iterator it = m_rawMseStates.begin(); it < m_rawMseStates.end(); it++) + delete *it; + } + + // If DirectInput keyboard and mouse were created, then release them now + if (m_di8Keyboard != NULL) + { + m_di8Keyboard->Unacquire(); + m_di8Keyboard->Release(); + m_di8Keyboard = NULL; + } + if (m_di8Mouse != NULL) + { + m_di8Mouse->Unacquire(); + m_di8Mouse->Release(); + m_di8Mouse = NULL; + } +} + +void CDirectInputSystem::ResetMice() +{ + // Get current mouse cursor position in window + POINT p; + if (!GetCursorPos(&p) || !ScreenToClient(m_hwnd, &p)) + return; + + // Set all mice coords to current cursor position + if (m_useRawInput) + { + m_combRawMseState.x = p.x; + m_combRawMseState.y = p.y; + m_combRawMseState.z = 0; + for (vector::iterator it = m_rawMseStates.begin(); it < m_rawMseStates.end(); it++) + { + (*it)->x = p.x; + (*it)->y = p.y; + (*it)->z = 0; + } + } + + m_diMseState.x = p.x; + m_diMseState.y = p.y; + m_diMseState.z = 0; +} + +void CDirectInputSystem::ProcessRawInput(HRAWINPUT hInput) +{ + // RawInput data event + BYTE buffer[4096]; + LPBYTE pBuf = buffer; + + // Get size of data structure to receive + UINT dwSize; + if (m_getRIDataPtr(hInput, RID_INPUT, NULL, &dwSize, sizeof(RAWINPUTHEADER)) != 0) + return; + if (dwSize > sizeof(buffer)) + { + pBuf = new BYTE[dwSize]; + if (pBuf == NULL) + return; + } + + // Get data + if (m_getRIDataPtr(hInput, RID_INPUT, pBuf, &dwSize, sizeof(RAWINPUTHEADER)) == dwSize) + { + RAWINPUT *pData = (RAWINPUT*)pBuf; + if (pData->header.dwType == RIM_TYPEKEYBOARD) + { + // Keyboard event, so identify which keyboard produced event + BOOL *keyState = NULL; + size_t kbdNum; + for (kbdNum = 0; kbdNum < m_rawKeyboards.size(); kbdNum++) + { + if (m_rawKeyboards[kbdNum] == pData->header.hDevice) + { + keyState = m_rawKeyStates[kbdNum]; + break; + } + } + + // Check is a valid keyboard + if (keyState != NULL) + { + // Get scancode of key and whether key was pressed or released + BOOL isRight = pData->data.keyboard.Flags & RI_KEY_E0; + UINT8 scanCode = (pData->data.keyboard.MakeCode & 0x7f) | (isRight ? 0x80 : 0x00); + BOOL pressed = !(pData->data.keyboard.Flags & RI_KEY_BREAK); + + // Store current state for key + if (scanCode != 0xAA) + keyState[scanCode] = pressed; + } + } + else if (pData->header.dwType == RIM_TYPEMOUSE) + { + // Mouse event, so identify which mouse produced event + RawMseState *mseState = NULL; + size_t mseNum; + for (mseNum = 0; mseNum < m_rawMice.size(); mseNum++) + { + if (m_rawMice[mseNum] == pData->header.hDevice) + { + mseState = m_rawMseStates[mseNum]; + break; + } + } + + // Check is a valid mouse + if (mseState != NULL) + { + // Get X- & Y-axis data + LONG lx = pData->data.mouse.lLastX; + LONG ly = pData->data.mouse.lLastY; + if (pData->data.mouse.usFlags & MOUSE_MOVE_ABSOLUTE) + { + // If data is absolute, then scale source values (0 to 65535) to display dimensions + mseState->x = CInputSource::Scale(lx, 0, 0xFFFF, m_dispX, m_dispX + m_dispW); + mseState->y = CInputSource::Scale(ly, 0, 0xFFFF, m_dispY, m_dispY + m_dispH); + + // Also update combined state + m_combRawMseState.x = mseState->x; + m_combRawMseState.y = mseState->y; + } + else + { + // If data is relative, then keep track of absolute position, clamping it at display edges + mseState->x = CInputSource::Clamp(mseState->x + lx, m_dispX, m_dispX + m_dispW); + mseState->y = CInputSource::Clamp(mseState->y + ly, m_dispY, m_dispY + m_dispH); + + // Also update combined state + m_combRawMseState.x = CInputSource::Clamp(m_combRawMseState.x + lx, m_dispX, m_dispX + m_dispW); + m_combRawMseState.y = CInputSource::Clamp(m_combRawMseState.y + ly, m_dispY, m_dispY + m_dispH); + } + + // Get button flags and wheel delta (RawInput returns +120 & -120 for the latter which are scaled to +5 & -5) + USHORT butFlags = pData->data.mouse.usButtonFlags; + LONG wheelDelta = 5 * (SHORT)pData->data.mouse.usButtonData / 120; + + // Update Z-axis (wheel) value + if (butFlags & RI_MOUSE_WHEEL) + { + // Z-axis is clamped to range -100 to 100 + mseState->z = CInputSource::Clamp(mseState->z + wheelDelta, -100, 100); + mseState->wheelDelta += wheelDelta; + } + + // Keep track of buttons pressed/released + if (butFlags & RI_MOUSE_LEFT_BUTTON_DOWN) mseState->buttons |= 1; + else if (butFlags & RI_MOUSE_LEFT_BUTTON_UP) mseState->buttons ^= 1; + if (butFlags & RI_MOUSE_MIDDLE_BUTTON_DOWN) mseState->buttons |= 2; + else if (butFlags & RI_MOUSE_MIDDLE_BUTTON_UP) mseState->buttons ^= 2; + if (butFlags & RI_MOUSE_RIGHT_BUTTON_DOWN) mseState->buttons |= 4; + else if (butFlags & RI_MOUSE_RIGHT_BUTTON_UP) mseState->buttons ^= 4; + if (butFlags & RI_MOUSE_BUTTON_4_DOWN) mseState->buttons |= 8; + else if (butFlags & RI_MOUSE_BUTTON_4_UP) mseState->buttons ^= 8; + if (butFlags & RI_MOUSE_BUTTON_5_DOWN) mseState->buttons |= 16; + else if (butFlags & RI_MOUSE_BUTTON_5_UP) mseState->buttons ^= 16; + + // Also update combined state for wheel axis and buttons + if (butFlags & RI_MOUSE_WHEEL) + { + // Z-axis is clamped to range -100 to 100 + m_combRawMseState.z = CInputSource::Clamp(m_combRawMseState.z + wheelDelta, -100, 100); + m_combRawMseState.wheelDelta += wheelDelta; + } + + m_combRawMseState.buttons = 0; + for (vector::iterator it = m_rawMseStates.begin(); it < m_rawMseStates.end(); it++) + m_combRawMseState.buttons |= (*it)->buttons; + } + } + } + + if (pBuf != buffer) + delete[] pBuf; +} + +void CDirectInputSystem::OpenJoysticks() +{ + // Get the GUIDs of all attached joystick devices + vector guids; + HRESULT hr; + if (FAILED(hr = m_di8->EnumDevices(DI8DEVCLASS_GAMECTRL, DI8EnumDevicesCallback, &guids, DIEDFL_ATTACHEDONLY))) + return; + + // Loop through those found + int joyNum = 0; + for (vector::iterator it = guids.begin(); it < guids.end(); it++) + { + joyNum++; + + // Open joystick with DirectInput for given GUID and set its data format + LPDIRECTINPUTDEVICE8 di8Joystick; + if (FAILED(hr = m_di8->CreateDevice((*it), &di8Joystick, NULL))) + { + ErrorLog("Unable to create DirectInput joystick device %d (error %d) - skipping joystick.\n", joyNum, hr); + continue; + } + if (FAILED(hr = di8Joystick->SetDataFormat(&c_dfDIJoystick2))) + { + ErrorLog("Unable to set data format for DirectInput joystick %d (error %d) - skipping joystick.\n", joyNum, hr); + + di8Joystick->Release(); + continue; + } + + // Get joystick's capabilities + DIDEVCAPS devCaps; + devCaps.dwSize = sizeof(DIDEVCAPS); + if (FAILED(hr = di8Joystick->GetCapabilities(&devCaps))) + { + ErrorLog("Unable to query capabilities of DirectInput joystick %d (error %d) - skipping joystick.\n", joyNum, hr); + + di8Joystick->Release(); + continue; + } + + // Gather joystick details (num POVs & buttons and which axes are available) + JoyDetails *joyDetails = new JoyDetails(); + joyDetails->numPOVs = devCaps.dwPOVs; + joyDetails->numButtons = devCaps.dwButtons; + if (FAILED(hr = di8Joystick->EnumObjects(DI8EnumAxesCallback, joyDetails, DIDFT_AXIS))) + { + ErrorLog("Unable to enumerate axes of DirectInput joystick %d (error %d) - skipping joystick.\n", joyNum, hr); + + di8Joystick->Release(); + continue; + } + joyDetails->numAxes = + joyDetails->hasXAxis + joyDetails->hasYAxis + joyDetails->hasZAxis + + joyDetails->hasRXAxis + joyDetails->hasRYAxis + joyDetails->hasRZAxis; + + // Configure axes, if any + if (joyDetails->numAxes > 0) + { + // Set axis range to be from -32768 to 32767 + DIPROPRANGE didpr; + didpr.diph.dwSize = sizeof(DIPROPRANGE); + didpr.diph.dwHeaderSize = sizeof(DIPROPHEADER); + didpr.diph.dwHow = DIPH_DEVICE; + didpr.diph.dwObj = 0; + didpr.lMin = -32768; + didpr.lMax = 32767; + if (FAILED(hr = di8Joystick->SetProperty(DIPROP_RANGE, &didpr.diph))) + { + ErrorLog("Unable to set axis range of DirectInput joystick %d (error %d) - skipping joystick.\n", joyNum, hr); + + di8Joystick->Release(); + continue; + } + + // Set axis mode to absolute + DIPROPDWORD dipdw; + dipdw.diph.dwSize = sizeof(DIPROPDWORD); + dipdw.diph.dwHeaderSize = sizeof(DIPROPHEADER); + dipdw.diph.dwHow = DIPH_DEVICE; + dipdw.diph.dwObj = 0; + dipdw.dwData = DIPROPAXISMODE_ABS; + if (FAILED(hr = di8Joystick->SetProperty(DIPROP_AXISMODE, &dipdw.diph))) + { + ErrorLog("Unable to set axis mode of DirectInput joystick %d (error %d) - skipping joystick.\n", joyNum, hr); + + di8Joystick->Release(); + continue; + } + + // Turn off deadzone as handled by this class + dipdw.dwData = 0; + if (FAILED(hr = di8Joystick->SetProperty(DIPROP_DEADZONE, &dipdw.diph))) + { + ErrorLog("Unable to set deadzone of DirectInput joystick %d (error %d) - skipping joystick.\n", joyNum, hr); + + di8Joystick->Release(); + continue; + } + + // Turn off saturation as handle by this class + dipdw.dwData = 10000; + if (FAILED(hr = di8Joystick->SetProperty(DIPROP_SATURATION, &dipdw.diph))) + { + ErrorLog("Unable to set saturation of DirectInput joystick %d (error %d) - skipping joystick.\n", joyNum, hr); + + di8Joystick->Release(); + continue; + } + } + + // Create initial blank joystick state + LPDIJOYSTATE2 joyState = new DIJOYSTATE2(); + memset(joyState, 0, sizeof(DIJOYSTATE2)); + for (int povNum = 0; povNum < 4; povNum++) + joyState->rgdwPOV[povNum] = -1; + + m_di8Joysticks.push_back(di8Joystick); + m_joyDetails.push_back(joyDetails); + m_diJoyStates.push_back(joyState); + } +} + +void CDirectInputSystem::ActivateJoysticks() +{ + // Set DirectInput cooperative level of joysticks + for (vector::iterator it = m_di8Joysticks.begin(); it < m_di8Joysticks.end(); it++) + (*it)->SetCooperativeLevel(m_hwnd, DISCL_NONEXCLUSIVE | DISCL_BACKGROUND); +} + +void CDirectInputSystem::PollJoysticks() +{ + // Get current joystick states from DirectInput + for (size_t i = 0; i < m_di8Joysticks.size(); i++) + { + LPDIRECTINPUTDEVICE8 joystick = m_di8Joysticks[i]; + LPDIJOYSTATE2 state = m_diJoyStates[i]; + + HRESULT hr; + if (FAILED(hr = joystick->Poll())) + { + hr = joystick->Acquire(); + while (hr == DIERR_INPUTLOST) + hr = joystick->Acquire(); + + if (hr == DIERR_OTHERAPPHASPRIO || hr == DIERR_INVALIDPARAM || hr == DIERR_NOTINITIALIZED) + continue; + } + + // Keep tack of each joystick state + joystick->GetDeviceState(sizeof(DIJOYSTATE2), state); + } +} + +void CDirectInputSystem::CloseJoysticks() +{ + // Release each DirectInput joystick + for (size_t joyNum = 0; joyNum < m_di8Joysticks.size(); joyNum++) + { + LPDIRECTINPUTDEVICE8 joystick = m_di8Joysticks[joyNum]; + JoyDetails *joyDetails = m_joyDetails[joyNum]; + LPDIJOYSTATE2 diJoyState = m_diJoyStates[joyNum]; + + joystick->Unacquire(); + joystick->Release(); + + delete joyDetails; + delete diJoyState; + } + + m_di8Joysticks.clear(); + m_joyDetails.clear(); + m_diJoyStates.clear(); +} + +bool CDirectInputSystem::InitializeSystem() +{ + if (m_useRawInput) + { + // Dynamically load RawInput API + HMODULE user32 = LoadLibrary(TEXT("user32.dll")); + if (user32 != NULL) + { + m_getRIDevListPtr = (GetRawInputDeviceListPtr)GetProcAddress(user32, "GetRawInputDeviceList"); + m_getRIDevInfoPtr = (GetRawInputDeviceInfoPtr)GetProcAddress(user32, "GetRawInputDeviceInfoA"); + m_regRIDevsPtr = (RegisterRawInputDevicesPtr)GetProcAddress(user32, "RegisterRawInputDevices"); + m_getRIDataPtr = (GetRawInputDataPtr)GetProcAddress(user32, "GetRawInputData"); + m_useRawInput = m_getRIDevListPtr != NULL && m_getRIDevInfoPtr != NULL && m_regRIDevsPtr != NULL && m_getRIDataPtr != NULL; + } + else + m_useRawInput = false; + + if (!m_useRawInput) + ErrorLog("Unable to initialize RawInput API (library hooks are not available) - switching to DirectInput.\n"); + } + + // Dynamically create DirectInput8 via COM, rather than statically linking to dinput8.dll + // TODO - if fails, try older versions of DirectInput + HRESULT hr; + if (FAILED(hr = CoInitialize(NULL))) + { + ErrorLog("Unable to initialize COM (error %d).\n", hr); + + return false; + } + if (FAILED(hr = CoCreateInstance(CLSID_DirectInput8, NULL, CLSCTX_INPROC_SERVER, IID_IDirectInput8A, (LPVOID*)&m_di8))) + { + ErrorLog("Unable to initialize DirectInput API (error %d) - is DirectX 8 or later installed?\n", hr); + + CoUninitialize(); + return false; + } + if (FAILED(hr = m_di8->Initialize(GetModuleHandle(NULL), DIRECTINPUT_VERSION))) + { + ErrorLog("Unable to initialize DirectInput API (error %d) - is DirectX 8 or later installed?\n", hr); + + m_di8->Release(); + return false; + } + + // Open all devices + OpenKeyboardsAndMice(); + OpenJoysticks(); + + return true; +} + +int CDirectInputSystem::GetNumKeyboards() +{ + // If RawInput enabled, then return number of keyboards found. Otherwise, return ANY_KEYBOARD as DirectInput cannot handle multiple keyboards + return (m_useRawInput ? m_rawKeyboards.size() : ANY_KEYBOARD); +} + +int CDirectInputSystem::GetNumMice() +{ + // If RawInput enabled, then return number of mice found. Otherwise, return ANY_MOUSE as DirectInput cannot handle multiple keyboards + return (m_useRawInput ? m_rawMice.size() : ANY_MOUSE); +} + +int CDirectInputSystem::GetNumJoysticks() +{ + // Return number of joysticks found + return m_di8Joysticks.size(); +} + +int CDirectInputSystem::GetKeyIndex(const char *keyName) +{ + for (int i = 0; i < NUM_DI_KEYS; i++) + { + if (stricmp(keyName, s_keyMap[i].keyName) == 0) + return i; + } + return -1; +} + +const char *CDirectInputSystem::GetKeyName(int keyIndex) +{ + if (keyIndex < 0 || keyIndex >= NUM_DI_KEYS) + return NULL; + return s_keyMap[keyIndex].keyName; +} + +JoyDetails *CDirectInputSystem::GetJoyDetails(int joyNum) +{ + return m_joyDetails[joyNum]; +} + +bool CDirectInputSystem::IsKeyPressed(int kbdNum, int keyIndex) +{ + // Get DI key code (scancode) for given key index + int diKey = s_keyMap[keyIndex].diKey; + + if (m_useRawInput) + { + // For RawInput, check if key is currently pressed for given keyboard number + BOOL *keyState = m_rawKeyStates[kbdNum]; + return !!keyState[diKey]; + } + + // For DirectInput, just check common keyboard state + return !!(m_diKeyState[diKey] & 0x80); +} + +int CDirectInputSystem::GetMouseAxisValue(int mseNum, int axisNum) +{ + if (m_useRawInput) + { + // For RawInput, get combined or individual mouse state and return value for given axis + // The cursor is always hidden when using RawInput, so it does not matter if these values don't match with the cursor (with multiple + // mice the cursor is irrelevant anyway) + RawMseState *mseState = (mseNum == ANY_MOUSE ? &m_combRawMseState : m_rawMseStates[mseNum]); + switch (axisNum) + { + case AXIS_X: return mseState->x; + case AXIS_Y: return mseState->y; + case AXIS_Z: return mseState->z; + default: return 0; + } + } + + // For DirectInput, for X- and Y-axes just use cursor position within window if available (so that mouse movements sync with the cursor) + if (axisNum == AXIS_X || axisNum == AXIS_Y) + { + POINT p; + if (GetCursorPos(&p) && ScreenToClient(m_hwnd, &p)) + return (axisNum == AXIS_X ? p.x : p.y); + } + + // Otherwise, return the raw DirectInput axis values + switch (axisNum) + { + case AXIS_X: return m_diMseState.x; + case AXIS_Y: return m_diMseState.y; + case AXIS_Z: return m_diMseState.z; + default: return 0; + } +} + +int CDirectInputSystem::GetMouseWheelDir(int mseNum) +{ + if (m_useRawInput) + { + // For RawInput, get combined or individual mouse state and return the wheel value + RawMseState *mseState = (mseNum == ANY_MOUSE ? &m_combRawMseState : m_rawMseStates[mseNum]); + return mseState->wheelDir; + } + + // For DirectInput just return the common wheel value + return m_diMseState.wheelDir; +} + +bool CDirectInputSystem::IsMouseButPressed(int mseNum, int butNum) +{ + if (m_useRawInput) + { + // For RawInput, get combined or individual mouse state and return the button state + RawMseState *mseState = (mseNum == ANY_MOUSE ? &m_combRawMseState : m_rawMseStates[mseNum]); + return !!(mseState->buttons & (1<lX; + case AXIS_Y: return (int)diJoyState->lY; + case AXIS_Z: return (int)diJoyState->lZ; + case AXIS_RX: return (int)diJoyState->lRx; + case AXIS_RY: return (int)diJoyState->lRy; + case AXIS_RZ: return (int)diJoyState->lRz; + default: return 0; + } +} + +bool CDirectInputSystem::IsJoyPOVInDir(int joyNum, int povNum, int povDir) +{ + // Get joystick state for given joystick and check if POV-hat value for given POV number is pointing in required direction + LPDIJOYSTATE2 diJoyState = m_diJoyStates[joyNum]; + int povVal = diJoyState->rgdwPOV[povNum] / 100; // DirectInput value is angle of POV-hat in 100ths of a degree + switch (povDir) + { + case POV_UP: return povVal == 315 || povVal == 0 || povVal == 45; + case POV_DOWN: return povVal == 135 || povVal == 180 || povVal == 225; + case POV_RIGHT: return povVal == 45 || povVal == 90 || povVal == 135; + case POV_LEFT: return povVal == 225 || povVal == 270 || povVal == 315; + default: return false; + } +} + +bool CDirectInputSystem::IsJoyButPressed(int joyNum, int butNum) +{ + // Get joystick state for given joystick and return current button value for given button number + LPDIJOYSTATE2 diJoyState = m_diJoyStates[joyNum]; + return !!diJoyState->rgbButtons[butNum]; +} + +void CDirectInputSystem::Wait(int ms) +{ + Sleep(ms); +} + +bool CDirectInputSystem::ConfigMouseCentered() +{ + // When checking if mouse centered, use system cursor rather than raw values (otherwise user's mouse movements won't match up + // with onscreen cursor during configuration) + POINT p; + if (!GetCursorPos(&p) || !ScreenToClient(m_hwnd, &p)) + return false; + + // See if mouse in center of display + unsigned lx = m_dispX + m_dispW / 4; + unsigned ly = m_dispY + m_dispH / 4; + if (p.x < lx || p.x > lx + m_dispW / 2 || p.y < ly || p.y > ly + m_dispH / 2) + return false; + + // Once mouse has been centered, sync up mice raw values with current cursor position so that movements are detected correctly + ResetMice(); + return true; +} + +CInputSource *CDirectInputSystem::CreateAnyMouseSource(EMousePart msePart) +{ + // If using RawInput, create a mouse source that uses the combined mouse state m_combRawState, rather than combining all the individual mouse + // sources in the default manner + if (m_useRawInput) + return CreateMouseSource(ANY_MOUSE, msePart); + + return CInputSystem::CreateAnyMouseSource(msePart); +} + +bool CDirectInputSystem::Poll() +{ + // See if keyboard, mice and joysticks have been activated yet + if (!m_activated) + { + // If not, then get Window handle of SDL window + SDL_SysWMinfo info; + SDL_VERSION(&info.version); + if (SDL_GetWMInfo(&info)) + m_hwnd = info.window; + + // Tell SDL to pass on all Windows events + // Removed - see below + //SDL_EventState(SDL_SYSWMEVENT, SDL_ENABLE); + + // Activate the devices now that a Window handle is available + ActivateKeyboardsAndMice(); + ActivateJoysticks(); + + m_activated = true; + } + + // Wait or poll for event from SDL + // Removed - see below + /* + SDL_Event e; + while (SDL_PollEvent(&e)) + { + if (e.type == SDL_QUIT) + return false; + else if (e.type == SDL_SYSWMEVENT) + { + SDL_SysWMmsg *wmMsg = e.syswm.msg; + ProcessWMEvent(wmMsg->hwnd, wmMsg->msg, wmMsg->wParam, wmMsg->lParam); + } + }*/ + + // Wait or poll for event on Windows message queue (done this way instead of using SDL_PollEvent as above because + // for some reason this causes RawInput HRAWINPUT handles to arrive stale. Not sure what SDL_PollEvent is doing to cause this + // but the following code can replace it without any problems as it is effectively what SDL_PollEvent does anyway) + MSG msg; + while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE)) + { + int ret = GetMessage(&msg, NULL, 0, 0); + if (ret == 0) + return false; + else if (ret > 0) + { + TranslateMessage(&msg); + + // Handle RawInput messages here + if (m_useRawInput && msg.message == WM_INPUT) + ProcessRawInput((HRAWINPUT)msg.lParam); + + // Propagate all messages to default (SDL) handlers + DispatchMessage(&msg); + } + } + + // Poll keyboards, mice and joysticks + PollKeyboardsAndMice(); + PollJoysticks(); + + return true; +} + +void CDirectInputSystem::SetMouseVisibility(bool visible) +{ + if (m_useRawInput) + ShowCursor(m_isConfiguring && visible ? TRUE : FALSE); + else + ShowCursor(visible ? TRUE : FALSE); +} + +void CDirectInputSystem::ConfigEnd() +{ + CInputSystem::ConfigEnd(); + + // When configuration has taken place, make sure devices get re-activated + m_activated = false; +} diff --git a/OSD/Windows/DirectInputSystem.h b/OSD/Windows/DirectInputSystem.h new file mode 100644 index 0000000..231061a --- /dev/null +++ b/OSD/Windows/DirectInputSystem.h @@ -0,0 +1,176 @@ +#ifndef INCLUDED_DIRECTINPUTSYSTEM_H +#define INCLUDED_DIRECTINPUTSYSTEM_H + +#include "Types.h" +#include "Inputs/InputSource.h" +#include "Inputs/InputSystem.h" + +#define WIN32_LEAN_AND_MEAN +#include +#include + +#include +using namespace std; + +#define NUM_DI_KEYS (sizeof(s_keyMap) / sizeof(DIKeyMapStruct)) + +#define MATCHES_USAGE(wUsage, wUsagePage, word) wUsage == LOWORD(word) && wUsagePage == HIWORD(word) +#define X_AXIS_USAGE 0x00010030 +#define Y_AXIS_USAGE 0x00010031 +#define Z_AXIS_USAGE 0x00010032 +#define RX_AXIS_USAGE 0x00010033 +#define RY_AXIS_USAGE 0x00010034 +#define RZ_AXIS_USAGE 0x00010035 + +struct DIKeyMapStruct +{ + const char *keyName; + int diKey; +}; + +struct RawMseState +{ + LONG x; + LONG y; + LONG z; + LONG wheelDelta; + SHORT wheelDir; + USHORT buttons; +}; + +struct DIMseState +{ + LONG x; + LONG y; + LONG z; + SHORT wheelDir; + BYTE buttons[5]; +}; + +typedef /*WINUSERAPI*/ INT (WINAPI *GetRawInputDeviceListPtr)(OUT PRAWINPUTDEVICELIST pRawInputDeviceList, IN OUT PUINT puiNumDevices, IN UINT cbSize); +typedef /*WINUSERAPI*/ INT (WINAPI *GetRawInputDeviceInfoPtr)(IN HANDLE hDevice, IN UINT uiCommand, OUT LPVOID pData, IN OUT PUINT pcbSize); +typedef /*WINUSERAPI*/ BOOL (WINAPI *RegisterRawInputDevicesPtr)(IN PCRAWINPUTDEVICE pRawInputDevices, IN UINT uiNumDevices, IN UINT cbSize); +typedef /*WINUSERAPI*/ INT (WINAPI *GetRawInputDataPtr)(IN HRAWINPUT hRawInput, IN UINT uiCommand, OUT LPVOID pData, IN OUT PUINT pcbSize, IN UINT cbSizeHeader); + +LRESULT WINAPI CallWndProc(int nCode, WPARAM wParam, LPARAM lParam); + +LRESULT WINAPI GetMsgProc(int nCode, WPARAM wParam, LPARAM lParam); + +BOOL CALLBACK DI8EnumDevicesCallback(LPCDIDEVICEINSTANCE instance, LPVOID context); + +BOOL CALLBACK DI8EnumAxesCallback(LPDIDEVICEOBJECTINSTANCE instance, LPVOID context); + +/* + * Input system that uses DirectInput and RawInput APIs. + */ +class CDirectInputSystem : public CInputSystem +{ +private: + // Lookup table to map key names to DirectInput keycodes and Virtual keycodes + static DIKeyMapStruct s_keyMap[]; + + bool m_useRawInput; + + HWND m_hwnd; + + bool m_activated; + + GetRawInputDeviceListPtr m_getRIDevListPtr; + GetRawInputDeviceInfoPtr m_getRIDevInfoPtr; + RegisterRawInputDevicesPtr m_regRIDevsPtr; + GetRawInputDataPtr m_getRIDataPtr; + + vector m_rawKeyboards; + vector m_rawKeyStates; + vector m_rawMice; + RawMseState m_combRawMseState; + vector m_rawMseStates; + + LPDIRECTINPUT8 m_di8; + LPDIRECTINPUTDEVICE8 m_di8Keyboard; + LPDIRECTINPUTDEVICE8 m_di8Mouse; + vector m_di8Joysticks; + + vector m_joyDetails; + + BYTE m_diKeyState[256]; + DIMseState m_diMseState; + vector m_diJoyStates; + + void OpenKeyboardsAndMice(); + + void ActivateKeyboardsAndMice(); + + void PollKeyboardsAndMice(); + + void CloseKeyboardsAndMice(); + + void ResetMice(); + + void ProcessRawInput(HRAWINPUT hInput); + + void OpenJoysticks(); + + void ActivateJoysticks(); + + void PollJoysticks(); + + void CloseJoysticks(); + +protected: + /* + * Initializes the DirectInput input system. + */ + bool InitializeSystem(); + + int GetNumKeyboards(); + + int GetNumMice(); + + int GetNumJoysticks(); + + int GetKeyIndex(const char *keyName); + + const char *GetKeyName(int keyIndex); + + JoyDetails *GetJoyDetails(int joyNum); + + bool IsKeyPressed(int joyNum, int keyIndex); + + int GetMouseAxisValue(int mseNum, int axisNum); + + int GetMouseWheelDir(int mseNum); + + bool IsMouseButPressed(int mseNum, int butNum); + + int GetJoyAxisValue(int joyNum, int axisNum); + + bool IsJoyPOVInDir(int joyNum, int povNum, int povDir); + + bool IsJoyButPressed(int joyNum, int butNum); + + void Wait(int ms); + + bool ConfigMouseCentered(); + + CInputSource *CreateAnyMouseSource(EMousePart msePart); + +public: + /* + * Constructs a DirectInput/RawInput input system. + * If useRawInput is true then RawInput is used for keyboard and mice movements (allowing multiple devices). If false + * then DirectInput is used instead (which doesn't allow multiple devices). + * In both cases, DirectInput is used for reading joysticks. + */ + CDirectInputSystem(bool useRawInput); + + ~CDirectInputSystem(); + + bool Poll(); + + void SetMouseVisibility(bool visible); + + void ConfigEnd(); +}; + +#endif // INCLUDED_DIRECTINPUTSYSTEM_H diff --git a/Pkgs/glew.c b/Pkgs/glew.c new file mode 100644 index 0000000..934f575 --- /dev/null +++ b/Pkgs/glew.c @@ -0,0 +1,15201 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** 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. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** 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 OWNER 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. +*/ + +#include "Pkgs/glew.h" +#if defined(_WIN32) +# include "Pkgs/wglew.h" +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) +# include "Pkgs/glxew.h" +#endif + +/* + * Define glewGetContext and related helper macros. + */ +#ifdef GLEW_MX +# define glewGetContext() ctx +# ifdef _WIN32 +# define GLEW_CONTEXT_ARG_DEF_INIT GLEWContext* ctx +# define GLEW_CONTEXT_ARG_VAR_INIT ctx +# define wglewGetContext() ctx +# define WGLEW_CONTEXT_ARG_DEF_INIT WGLEWContext* ctx +# define WGLEW_CONTEXT_ARG_DEF_LIST WGLEWContext* ctx +# else /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define glxewGetContext() ctx +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST GLXEWContext* ctx +# endif /* _WIN32 */ +# define GLEW_CONTEXT_ARG_DEF_LIST GLEWContext* ctx +#else /* GLEW_MX */ +# define GLEW_CONTEXT_ARG_DEF_INIT void +# define GLEW_CONTEXT_ARG_VAR_INIT +# define GLEW_CONTEXT_ARG_DEF_LIST void +# define WGLEW_CONTEXT_ARG_DEF_INIT void +# define WGLEW_CONTEXT_ARG_DEF_LIST void +# define GLXEW_CONTEXT_ARG_DEF_INIT void +# define GLXEW_CONTEXT_ARG_DEF_LIST void +#endif /* GLEW_MX */ + +#if defined(__sgi) || defined (__sun) || defined(GLEW_APPLE_GLX) +#include +#include +#include + +void* dlGetProcAddress (const GLubyte* name) +{ + static void* h = NULL; + static void* gpa; + + if (h == NULL) + { + if ((h = dlopen(NULL, RTLD_LAZY | RTLD_LOCAL)) == NULL) return NULL; + gpa = dlsym(h, "glXGetProcAddress"); + } + + if (gpa != NULL) + return ((void*(*)(const GLubyte*))gpa)(name); + else + return dlsym(h, (const char*)name); +} +#endif /* __sgi || __sun || GLEW_APPLE_GLX */ + +#if defined(__APPLE__) +#include +#include +#include + +#ifdef MAC_OS_X_VERSION_10_3 + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static void* image = NULL; + if (NULL == image) + { + image = dlopen("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", RTLD_LAZY); + } + if( !image ) return NULL; + void* addr = dlsym(image, (const char*)name); + if( addr ) return addr; +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#else + +#include + +void* NSGLGetProcAddress (const GLubyte *name) +{ + static const struct mach_header* image = NULL; + NSSymbol symbol; + char* symbolName; + if (NULL == image) + { + image = NSAddImage("/System/Library/Frameworks/OpenGL.framework/Versions/Current/OpenGL", NSADDIMAGE_OPTION_RETURN_ON_ERROR); + } + /* prepend a '_' for the Unix C symbol mangling convention */ + symbolName = malloc(strlen((const char*)name) + 2); + strcpy(symbolName+1, (const char*)name); + symbolName[0] = '_'; + symbol = NULL; + /* if (NSIsSymbolNameDefined(symbolName)) + symbol = NSLookupAndBindSymbol(symbolName); */ + symbol = image ? NSLookupSymbolInImage(image, symbolName, NSLOOKUPSYMBOLINIMAGE_OPTION_BIND | NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR) : NULL; + free(symbolName); + if( symbol ) return NSAddressOfSymbol(symbol); +#ifdef GLEW_APPLE_GLX + return dlGetProcAddress( name ); // try next for glx symbols +#else + return NULL; +#endif +} +#endif /* MAC_OS_X_VERSION_10_3 */ +#endif /* __APPLE__ */ + +/* + * Define glewGetProcAddress. + */ +#if defined(_WIN32) +# define glewGetProcAddress(name) wglGetProcAddress((LPCSTR)name) +#else +# if defined(__APPLE__) +# define glewGetProcAddress(name) NSGLGetProcAddress(name) +# else +# if defined(__sgi) || defined(__sun) +# define glewGetProcAddress(name) dlGetProcAddress(name) +# else /* __linux */ +# define glewGetProcAddress(name) (*glXGetProcAddressARB)(name) +# endif +# endif +#endif + +/* + * Define GLboolean const cast. + */ +#define CONST_CAST(x) (*(GLboolean*)&x) + +/* + * GLEW, just like OpenGL or GLU, does not rely on the standard C library. + * These functions implement the functionality required in this file. + */ +static GLuint _glewStrLen (const GLubyte* s) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0') i++; + return i; +} + +static GLuint _glewStrCLen (const GLubyte* s, GLubyte c) +{ + GLuint i=0; + if (s == NULL) return 0; + while (s[i] != '\0' && s[i] != c) i++; + return (s[i] == '\0' || s[i] == c) ? i : 0; +} + +static GLboolean _glewStrSame (const GLubyte* a, const GLubyte* b, GLuint n) +{ + GLuint i=0; + if(a == NULL || b == NULL) + return (a == NULL && b == NULL && n == 0) ? GL_TRUE : GL_FALSE; + while (i < n && a[i] != '\0' && b[i] != '\0' && a[i] == b[i]) i++; + return i == n ? GL_TRUE : GL_FALSE; +} + +static GLboolean _glewStrSame1 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + while (*na > 0 && (**a == ' ' || **a == '\n' || **a == '\r' || **a == '\t')) + { + (*a)++; + (*na)--; + } + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame2 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if(i == nb) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +static GLboolean _glewStrSame3 (GLubyte** a, GLuint* na, const GLubyte* b, GLuint nb) +{ + if(*na >= nb) + { + GLuint i=0; + while (i < nb && (*a)+i != NULL && b+i != NULL && (*a)[i] == b[i]) i++; + if (i == nb && (*na == nb || (*a)[i] == ' ' || (*a)[i] == '\n' || (*a)[i] == '\r' || (*a)[i] == '\t')) + { + *a = *a + nb; + *na = *na - nb; + return GL_TRUE; + } + } + return GL_FALSE; +} + +#if !defined(_WIN32) || !defined(GLEW_MX) + +PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D = NULL; +PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements = NULL; +PFNGLTEXIMAGE3DPROC __glewTexImage3D = NULL; +PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D = NULL; + +PFNGLACTIVETEXTUREPROC __glewActiveTexture = NULL; +PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture = NULL; +PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage = NULL; +PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd = NULL; +PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf = NULL; +PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd = NULL; +PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf = NULL; +PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d = NULL; +PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv = NULL; +PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f = NULL; +PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv = NULL; +PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i = NULL; +PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv = NULL; +PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s = NULL; +PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv = NULL; +PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d = NULL; +PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv = NULL; +PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f = NULL; +PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv = NULL; +PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i = NULL; +PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv = NULL; +PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s = NULL; +PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv = NULL; +PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d = NULL; +PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv = NULL; +PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f = NULL; +PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv = NULL; +PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i = NULL; +PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv = NULL; +PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s = NULL; +PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv = NULL; +PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d = NULL; +PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv = NULL; +PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f = NULL; +PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv = NULL; +PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i = NULL; +PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv = NULL; +PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s = NULL; +PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv = NULL; +PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage = NULL; + +PFNGLBLENDCOLORPROC __glewBlendColor = NULL; +PFNGLBLENDEQUATIONPROC __glewBlendEquation = NULL; +PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate = NULL; +PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer = NULL; +PFNGLFOGCOORDDPROC __glewFogCoordd = NULL; +PFNGLFOGCOORDDVPROC __glewFogCoorddv = NULL; +PFNGLFOGCOORDFPROC __glewFogCoordf = NULL; +PFNGLFOGCOORDFVPROC __glewFogCoordfv = NULL; +PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays = NULL; +PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements = NULL; +PFNGLPOINTPARAMETERFPROC __glewPointParameterf = NULL; +PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv = NULL; +PFNGLPOINTPARAMETERIPROC __glewPointParameteri = NULL; +PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv = NULL; +PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b = NULL; +PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv = NULL; +PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d = NULL; +PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv = NULL; +PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f = NULL; +PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv = NULL; +PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i = NULL; +PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv = NULL; +PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s = NULL; +PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv = NULL; +PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub = NULL; +PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv = NULL; +PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui = NULL; +PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv = NULL; +PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us = NULL; +PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv = NULL; +PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer = NULL; +PFNGLWINDOWPOS2DPROC __glewWindowPos2d = NULL; +PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv = NULL; +PFNGLWINDOWPOS2FPROC __glewWindowPos2f = NULL; +PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv = NULL; +PFNGLWINDOWPOS2IPROC __glewWindowPos2i = NULL; +PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv = NULL; +PFNGLWINDOWPOS2SPROC __glewWindowPos2s = NULL; +PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv = NULL; +PFNGLWINDOWPOS3DPROC __glewWindowPos3d = NULL; +PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv = NULL; +PFNGLWINDOWPOS3FPROC __glewWindowPos3f = NULL; +PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv = NULL; +PFNGLWINDOWPOS3IPROC __glewWindowPos3i = NULL; +PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv = NULL; +PFNGLWINDOWPOS3SPROC __glewWindowPos3s = NULL; +PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv = NULL; + +PFNGLBEGINQUERYPROC __glewBeginQuery = NULL; +PFNGLBINDBUFFERPROC __glewBindBuffer = NULL; +PFNGLBUFFERDATAPROC __glewBufferData = NULL; +PFNGLBUFFERSUBDATAPROC __glewBufferSubData = NULL; +PFNGLDELETEBUFFERSPROC __glewDeleteBuffers = NULL; +PFNGLDELETEQUERIESPROC __glewDeleteQueries = NULL; +PFNGLENDQUERYPROC __glewEndQuery = NULL; +PFNGLGENBUFFERSPROC __glewGenBuffers = NULL; +PFNGLGENQUERIESPROC __glewGenQueries = NULL; +PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv = NULL; +PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv = NULL; +PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData = NULL; +PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv = NULL; +PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv = NULL; +PFNGLGETQUERYIVPROC __glewGetQueryiv = NULL; +PFNGLISBUFFERPROC __glewIsBuffer = NULL; +PFNGLISQUERYPROC __glewIsQuery = NULL; +PFNGLMAPBUFFERPROC __glewMapBuffer = NULL; +PFNGLUNMAPBUFFERPROC __glewUnmapBuffer = NULL; + +PFNGLATTACHSHADERPROC __glewAttachShader = NULL; +PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation = NULL; +PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate = NULL; +PFNGLCOMPILESHADERPROC __glewCompileShader = NULL; +PFNGLCREATEPROGRAMPROC __glewCreateProgram = NULL; +PFNGLCREATESHADERPROC __glewCreateShader = NULL; +PFNGLDELETEPROGRAMPROC __glewDeleteProgram = NULL; +PFNGLDELETESHADERPROC __glewDeleteShader = NULL; +PFNGLDETACHSHADERPROC __glewDetachShader = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray = NULL; +PFNGLDRAWBUFFERSPROC __glewDrawBuffers = NULL; +PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray = NULL; +PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib = NULL; +PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform = NULL; +PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders = NULL; +PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation = NULL; +PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog = NULL; +PFNGLGETPROGRAMIVPROC __glewGetProgramiv = NULL; +PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog = NULL; +PFNGLGETSHADERSOURCEPROC __glewGetShaderSource = NULL; +PFNGLGETSHADERIVPROC __glewGetShaderiv = NULL; +PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation = NULL; +PFNGLGETUNIFORMFVPROC __glewGetUniformfv = NULL; +PFNGLGETUNIFORMIVPROC __glewGetUniformiv = NULL; +PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv = NULL; +PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv = NULL; +PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv = NULL; +PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv = NULL; +PFNGLISPROGRAMPROC __glewIsProgram = NULL; +PFNGLISSHADERPROC __glewIsShader = NULL; +PFNGLLINKPROGRAMPROC __glewLinkProgram = NULL; +PFNGLSHADERSOURCEPROC __glewShaderSource = NULL; +PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate = NULL; +PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate = NULL; +PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate = NULL; +PFNGLUNIFORM1FPROC __glewUniform1f = NULL; +PFNGLUNIFORM1FVPROC __glewUniform1fv = NULL; +PFNGLUNIFORM1IPROC __glewUniform1i = NULL; +PFNGLUNIFORM1IVPROC __glewUniform1iv = NULL; +PFNGLUNIFORM2FPROC __glewUniform2f = NULL; +PFNGLUNIFORM2FVPROC __glewUniform2fv = NULL; +PFNGLUNIFORM2IPROC __glewUniform2i = NULL; +PFNGLUNIFORM2IVPROC __glewUniform2iv = NULL; +PFNGLUNIFORM3FPROC __glewUniform3f = NULL; +PFNGLUNIFORM3FVPROC __glewUniform3fv = NULL; +PFNGLUNIFORM3IPROC __glewUniform3i = NULL; +PFNGLUNIFORM3IVPROC __glewUniform3iv = NULL; +PFNGLUNIFORM4FPROC __glewUniform4f = NULL; +PFNGLUNIFORM4FVPROC __glewUniform4fv = NULL; +PFNGLUNIFORM4IPROC __glewUniform4i = NULL; +PFNGLUNIFORM4IVPROC __glewUniform4iv = NULL; +PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv = NULL; +PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv = NULL; +PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv = NULL; +PFNGLUSEPROGRAMPROC __glewUseProgram = NULL; +PFNGLVALIDATEPROGRAMPROC __glewValidateProgram = NULL; +PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d = NULL; +PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv = NULL; +PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f = NULL; +PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv = NULL; +PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s = NULL; +PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv = NULL; +PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d = NULL; +PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv = NULL; +PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f = NULL; +PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv = NULL; +PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s = NULL; +PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv = NULL; +PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d = NULL; +PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv = NULL; +PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f = NULL; +PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv = NULL; +PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s = NULL; +PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv = NULL; +PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv = NULL; +PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv = NULL; +PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv = NULL; +PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub = NULL; +PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv = NULL; +PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv = NULL; +PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv = NULL; +PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv = NULL; +PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d = NULL; +PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv = NULL; +PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f = NULL; +PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv = NULL; +PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv = NULL; +PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s = NULL; +PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv = NULL; +PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv = NULL; +PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv = NULL; +PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv = NULL; +PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer = NULL; + +PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv = NULL; +PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv = NULL; +PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv = NULL; +PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv = NULL; +PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv = NULL; +PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv = NULL; + +PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender = NULL; +PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback = NULL; +PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation = NULL; +PFNGLCLAMPCOLORPROC __glewClampColor = NULL; +PFNGLCLEARBUFFERFIPROC __glewClearBufferfi = NULL; +PFNGLCLEARBUFFERFVPROC __glewClearBufferfv = NULL; +PFNGLCLEARBUFFERIVPROC __glewClearBufferiv = NULL; +PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv = NULL; +PFNGLCOLORMASKIPROC __glewColorMaski = NULL; +PFNGLDISABLEIPROC __glewDisablei = NULL; +PFNGLENABLEIPROC __glewEnablei = NULL; +PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender = NULL; +PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback = NULL; +PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v = NULL; +PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation = NULL; +PFNGLGETSTRINGIPROC __glewGetStringi = NULL; +PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv = NULL; +PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying = NULL; +PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv = NULL; +PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv = NULL; +PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv = NULL; +PFNGLISENABLEDIPROC __glewIsEnabledi = NULL; +PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv = NULL; +PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings = NULL; +PFNGLUNIFORM1UIPROC __glewUniform1ui = NULL; +PFNGLUNIFORM1UIVPROC __glewUniform1uiv = NULL; +PFNGLUNIFORM2UIPROC __glewUniform2ui = NULL; +PFNGLUNIFORM2UIVPROC __glewUniform2uiv = NULL; +PFNGLUNIFORM3UIPROC __glewUniform3ui = NULL; +PFNGLUNIFORM3UIVPROC __glewUniform3uiv = NULL; +PFNGLUNIFORM4UIPROC __glewUniform4ui = NULL; +PFNGLUNIFORM4UIVPROC __glewUniform4uiv = NULL; +PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i = NULL; +PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv = NULL; +PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui = NULL; +PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv = NULL; +PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i = NULL; +PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv = NULL; +PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui = NULL; +PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv = NULL; +PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i = NULL; +PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv = NULL; +PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui = NULL; +PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv = NULL; +PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv = NULL; +PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i = NULL; +PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv = NULL; +PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv = NULL; +PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv = NULL; +PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui = NULL; +PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv = NULL; +PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv = NULL; +PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer = NULL; + +PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced = NULL; +PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced = NULL; +PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex = NULL; +PFNGLTEXBUFFERPROC __glewTexBuffer = NULL; + +PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture = NULL; +PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v = NULL; +PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v = NULL; + +PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor = NULL; + +PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei = NULL; +PFNGLBLENDEQUATIONIPROC __glewBlendEquationi = NULL; +PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei = NULL; +PFNGLBLENDFUNCIPROC __glewBlendFunci = NULL; +PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading = NULL; + +PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX = NULL; + +PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD = NULL; +PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD = NULL; +PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD = NULL; +PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD = NULL; + +PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD = NULL; +PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD = NULL; +PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD = NULL; +PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD = NULL; + +PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD = NULL; +PFNGLGENNAMESAMDPROC __glewGenNamesAMD = NULL; +PFNGLISNAMEAMDPROC __glewIsNameAMD = NULL; + +PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD = NULL; +PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD = NULL; +PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD = NULL; +PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD = NULL; +PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD = NULL; +PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD = NULL; +PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD = NULL; +PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD = NULL; +PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD = NULL; +PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD = NULL; +PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD = NULL; + +PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD = NULL; +PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD = NULL; + +PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE = NULL; +PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE = NULL; +PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE = NULL; +PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE = NULL; +PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE = NULL; + +PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE = NULL; +PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE = NULL; +PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE = NULL; +PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE = NULL; +PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE = NULL; +PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE = NULL; +PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE = NULL; +PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE = NULL; + +PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE = NULL; +PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE = NULL; + +PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE = NULL; +PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE = NULL; +PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE = NULL; + +PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE = NULL; +PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE = NULL; + +PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE = NULL; +PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE = NULL; +PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE = NULL; +PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE = NULL; + +PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE = NULL; +PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE = NULL; +PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE = NULL; + +PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE = NULL; +PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE = NULL; +PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE = NULL; +PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE = NULL; +PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE = NULL; +PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE = NULL; +PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE = NULL; + +PFNGLCLEARDEPTHFPROC __glewClearDepthf = NULL; +PFNGLDEPTHRANGEFPROC __glewDepthRangef = NULL; +PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat = NULL; +PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler = NULL; +PFNGLSHADERBINARYPROC __glewShaderBinary = NULL; + +PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed = NULL; +PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex = NULL; + +PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB = NULL; + +PFNGLCLAMPCOLORARBPROC __glewClampColorARB = NULL; + +PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData = NULL; + +PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB = NULL; +PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB = NULL; +PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB = NULL; +PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB = NULL; + +PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB = NULL; + +PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB = NULL; +PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB = NULL; +PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB = NULL; +PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB = NULL; + +PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex = NULL; +PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex = NULL; +PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex = NULL; +PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex = NULL; + +PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect = NULL; +PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect = NULL; + +PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB = NULL; +PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB = NULL; + +PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer = NULL; +PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer = NULL; +PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus = NULL; +PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers = NULL; +PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers = NULL; +PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer = NULL; +PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D = NULL; +PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D = NULL; +PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer = NULL; +PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers = NULL; +PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers = NULL; +PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv = NULL; +PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer = NULL; +PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer = NULL; +PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage = NULL; +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample = NULL; + +PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB = NULL; +PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB = NULL; +PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB = NULL; +PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB = NULL; + +PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary = NULL; +PFNGLPROGRAMBINARYPROC __glewProgramBinary = NULL; +PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri = NULL; + +PFNGLGETUNIFORMDVPROC __glewGetUniformdv = NULL; +PFNGLPROGRAMUNIFORM1DEXTPROC __glewProgramUniform1dEXT = NULL; +PFNGLPROGRAMUNIFORM1DVEXTPROC __glewProgramUniform1dvEXT = NULL; +PFNGLPROGRAMUNIFORM2DEXTPROC __glewProgramUniform2dEXT = NULL; +PFNGLPROGRAMUNIFORM2DVEXTPROC __glewProgramUniform2dvEXT = NULL; +PFNGLPROGRAMUNIFORM3DEXTPROC __glewProgramUniform3dEXT = NULL; +PFNGLPROGRAMUNIFORM3DVEXTPROC __glewProgramUniform3dvEXT = NULL; +PFNGLPROGRAMUNIFORM4DEXTPROC __glewProgramUniform4dEXT = NULL; +PFNGLPROGRAMUNIFORM4DVEXTPROC __glewProgramUniform4dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC __glewProgramUniformMatrix2dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC __glewProgramUniformMatrix2x3dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC __glewProgramUniformMatrix2x4dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC __glewProgramUniformMatrix3dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC __glewProgramUniformMatrix3x2dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC __glewProgramUniformMatrix3x4dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC __glewProgramUniformMatrix4dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC __glewProgramUniformMatrix4x2dvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC __glewProgramUniformMatrix4x3dvEXT = NULL; +PFNGLUNIFORM1DPROC __glewUniform1d = NULL; +PFNGLUNIFORM1DVPROC __glewUniform1dv = NULL; +PFNGLUNIFORM2DPROC __glewUniform2d = NULL; +PFNGLUNIFORM2DVPROC __glewUniform2dv = NULL; +PFNGLUNIFORM3DPROC __glewUniform3d = NULL; +PFNGLUNIFORM3DVPROC __glewUniform3dv = NULL; +PFNGLUNIFORM4DPROC __glewUniform4d = NULL; +PFNGLUNIFORM4DVPROC __glewUniform4dv = NULL; +PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv = NULL; +PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv = NULL; +PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv = NULL; +PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv = NULL; +PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv = NULL; +PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv = NULL; +PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv = NULL; +PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv = NULL; +PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv = NULL; + +PFNGLCOLORSUBTABLEPROC __glewColorSubTable = NULL; +PFNGLCOLORTABLEPROC __glewColorTable = NULL; +PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv = NULL; +PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv = NULL; +PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D = NULL; +PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D = NULL; +PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf = NULL; +PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv = NULL; +PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri = NULL; +PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv = NULL; +PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable = NULL; +PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable = NULL; +PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D = NULL; +PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D = NULL; +PFNGLGETCOLORTABLEPROC __glewGetColorTable = NULL; +PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv = NULL; +PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv = NULL; +PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter = NULL; +PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv = NULL; +PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv = NULL; +PFNGLGETHISTOGRAMPROC __glewGetHistogram = NULL; +PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv = NULL; +PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv = NULL; +PFNGLGETMINMAXPROC __glewGetMinmax = NULL; +PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv = NULL; +PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv = NULL; +PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter = NULL; +PFNGLHISTOGRAMPROC __glewHistogram = NULL; +PFNGLMINMAXPROC __glewMinmax = NULL; +PFNGLRESETHISTOGRAMPROC __glewResetHistogram = NULL; +PFNGLRESETMINMAXPROC __glewResetMinmax = NULL; +PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D = NULL; + +PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB = NULL; + +PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange = NULL; +PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange = NULL; + +PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB = NULL; +PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB = NULL; +PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB = NULL; +PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB = NULL; +PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB = NULL; + +PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB = NULL; + +PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB = NULL; +PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB = NULL; +PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB = NULL; +PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB = NULL; +PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB = NULL; +PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB = NULL; +PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB = NULL; +PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB = NULL; +PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB = NULL; +PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB = NULL; +PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB = NULL; +PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB = NULL; +PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB = NULL; +PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB = NULL; +PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB = NULL; +PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB = NULL; +PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB = NULL; +PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB = NULL; +PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB = NULL; +PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB = NULL; +PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB = NULL; +PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB = NULL; +PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB = NULL; +PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB = NULL; +PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB = NULL; +PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB = NULL; +PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB = NULL; +PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB = NULL; +PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB = NULL; +PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB = NULL; +PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB = NULL; +PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB = NULL; +PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB = NULL; +PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB = NULL; + +PFNGLBEGINQUERYARBPROC __glewBeginQueryARB = NULL; +PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB = NULL; +PFNGLENDQUERYARBPROC __glewEndQueryARB = NULL; +PFNGLGENQUERIESARBPROC __glewGenQueriesARB = NULL; +PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB = NULL; +PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB = NULL; +PFNGLGETQUERYIVARBPROC __glewGetQueryivARB = NULL; +PFNGLISQUERYARBPROC __glewIsQueryARB = NULL; + +PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB = NULL; +PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB = NULL; + +PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex = NULL; + +PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB = NULL; +PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB = NULL; +PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB = NULL; +PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB = NULL; +PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB = NULL; +PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB = NULL; +PFNGLGETNMAPIVARBPROC __glewGetnMapivARB = NULL; +PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB = NULL; +PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB = NULL; +PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB = NULL; +PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB = NULL; +PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB = NULL; +PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB = NULL; +PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB = NULL; +PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB = NULL; +PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB = NULL; +PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB = NULL; +PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB = NULL; +PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB = NULL; + +PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB = NULL; + +PFNGLBINDSAMPLERPROC __glewBindSampler = NULL; +PFNGLDELETESAMPLERSPROC __glewDeleteSamplers = NULL; +PFNGLGENSAMPLERSPROC __glewGenSamplers = NULL; +PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv = NULL; +PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv = NULL; +PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv = NULL; +PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv = NULL; +PFNGLISSAMPLERPROC __glewIsSampler = NULL; +PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv = NULL; +PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv = NULL; +PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf = NULL; +PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv = NULL; +PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri = NULL; +PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv = NULL; + +PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram = NULL; +PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline = NULL; +PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv = NULL; +PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines = NULL; +PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines = NULL; +PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog = NULL; +PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv = NULL; +PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline = NULL; +PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d = NULL; +PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv = NULL; +PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f = NULL; +PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv = NULL; +PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i = NULL; +PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv = NULL; +PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui = NULL; +PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv = NULL; +PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d = NULL; +PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv = NULL; +PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f = NULL; +PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv = NULL; +PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i = NULL; +PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv = NULL; +PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui = NULL; +PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv = NULL; +PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d = NULL; +PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv = NULL; +PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f = NULL; +PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv = NULL; +PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i = NULL; +PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv = NULL; +PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui = NULL; +PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv = NULL; +PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d = NULL; +PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv = NULL; +PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f = NULL; +PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv = NULL; +PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i = NULL; +PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv = NULL; +PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui = NULL; +PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv = NULL; +PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages = NULL; +PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline = NULL; + +PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB = NULL; +PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB = NULL; +PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB = NULL; +PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB = NULL; +PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB = NULL; +PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB = NULL; +PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB = NULL; +PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB = NULL; +PFNGLGETHANDLEARBPROC __glewGetHandleARB = NULL; +PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB = NULL; +PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB = NULL; +PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB = NULL; +PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB = NULL; +PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB = NULL; +PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB = NULL; +PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB = NULL; +PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB = NULL; +PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB = NULL; +PFNGLUNIFORM1FARBPROC __glewUniform1fARB = NULL; +PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB = NULL; +PFNGLUNIFORM1IARBPROC __glewUniform1iARB = NULL; +PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB = NULL; +PFNGLUNIFORM2FARBPROC __glewUniform2fARB = NULL; +PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB = NULL; +PFNGLUNIFORM2IARBPROC __glewUniform2iARB = NULL; +PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB = NULL; +PFNGLUNIFORM3FARBPROC __glewUniform3fARB = NULL; +PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB = NULL; +PFNGLUNIFORM3IARBPROC __glewUniform3iARB = NULL; +PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB = NULL; +PFNGLUNIFORM4FARBPROC __glewUniform4fARB = NULL; +PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB = NULL; +PFNGLUNIFORM4IARBPROC __glewUniform4iARB = NULL; +PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB = NULL; +PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB = NULL; +PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB = NULL; +PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB = NULL; +PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB = NULL; +PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB = NULL; + +PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName = NULL; +PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName = NULL; +PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv = NULL; +PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv = NULL; +PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex = NULL; +PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation = NULL; +PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv = NULL; +PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv = NULL; + +PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB = NULL; +PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB = NULL; +PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB = NULL; +PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB = NULL; +PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB = NULL; +PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB = NULL; + +PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync = NULL; +PFNGLDELETESYNCPROC __glewDeleteSync = NULL; +PFNGLFENCESYNCPROC __glewFenceSync = NULL; +PFNGLGETINTEGER64VPROC __glewGetInteger64v = NULL; +PFNGLGETSYNCIVPROC __glewGetSynciv = NULL; +PFNGLISSYNCPROC __glewIsSync = NULL; +PFNGLWAITSYNCPROC __glewWaitSync = NULL; + +PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv = NULL; +PFNGLPATCHPARAMETERIPROC __glewPatchParameteri = NULL; + +PFNGLTEXBUFFERARBPROC __glewTexBufferARB = NULL; + +PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB = NULL; +PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB = NULL; +PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB = NULL; +PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB = NULL; +PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB = NULL; + +PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv = NULL; +PFNGLSAMPLEMASKIPROC __glewSampleMaski = NULL; +PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample = NULL; +PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample = NULL; + +PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v = NULL; +PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v = NULL; +PFNGLQUERYCOUNTERPROC __glewQueryCounter = NULL; + +PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback = NULL; +PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks = NULL; +PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback = NULL; +PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks = NULL; +PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback = NULL; +PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback = NULL; +PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback = NULL; + +PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed = NULL; +PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream = NULL; +PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed = NULL; +PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv = NULL; + +PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB = NULL; +PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB = NULL; +PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB = NULL; +PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB = NULL; + +PFNGLBINDBUFFERBASEPROC __glewBindBufferBase = NULL; +PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange = NULL; +PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName = NULL; +PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv = NULL; +PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName = NULL; +PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv = NULL; +PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v = NULL; +PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex = NULL; +PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices = NULL; +PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding = NULL; + +PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray = NULL; +PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays = NULL; +PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays = NULL; +PFNGLISVERTEXARRAYPROC __glewIsVertexArray = NULL; + +PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv = NULL; +PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d = NULL; +PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv = NULL; +PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d = NULL; +PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv = NULL; +PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d = NULL; +PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv = NULL; +PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d = NULL; +PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv = NULL; +PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer = NULL; + +PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB = NULL; +PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB = NULL; +PFNGLWEIGHTBVARBPROC __glewWeightbvARB = NULL; +PFNGLWEIGHTDVARBPROC __glewWeightdvARB = NULL; +PFNGLWEIGHTFVARBPROC __glewWeightfvARB = NULL; +PFNGLWEIGHTIVARBPROC __glewWeightivARB = NULL; +PFNGLWEIGHTSVARBPROC __glewWeightsvARB = NULL; +PFNGLWEIGHTUBVARBPROC __glewWeightubvARB = NULL; +PFNGLWEIGHTUIVARBPROC __glewWeightuivARB = NULL; +PFNGLWEIGHTUSVARBPROC __glewWeightusvARB = NULL; + +PFNGLBINDBUFFERARBPROC __glewBindBufferARB = NULL; +PFNGLBUFFERDATAARBPROC __glewBufferDataARB = NULL; +PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB = NULL; +PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB = NULL; +PFNGLGENBUFFERSARBPROC __glewGenBuffersARB = NULL; +PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB = NULL; +PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB = NULL; +PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB = NULL; +PFNGLISBUFFERARBPROC __glewIsBufferARB = NULL; +PFNGLMAPBUFFERARBPROC __glewMapBufferARB = NULL; +PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB = NULL; + +PFNGLBINDPROGRAMARBPROC __glewBindProgramARB = NULL; +PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB = NULL; +PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB = NULL; +PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB = NULL; +PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB = NULL; +PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB = NULL; +PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB = NULL; +PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB = NULL; +PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB = NULL; +PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB = NULL; +PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB = NULL; +PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB = NULL; +PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB = NULL; +PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB = NULL; +PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB = NULL; +PFNGLISPROGRAMARBPROC __glewIsProgramARB = NULL; +PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB = NULL; +PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB = NULL; +PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB = NULL; +PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB = NULL; +PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB = NULL; +PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB = NULL; +PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB = NULL; +PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB = NULL; +PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB = NULL; +PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB = NULL; +PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB = NULL; +PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB = NULL; +PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB = NULL; +PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB = NULL; +PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB = NULL; +PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB = NULL; +PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB = NULL; +PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB = NULL; +PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB = NULL; +PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB = NULL; +PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB = NULL; +PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB = NULL; +PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB = NULL; +PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB = NULL; +PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB = NULL; +PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB = NULL; +PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB = NULL; +PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB = NULL; +PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB = NULL; +PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB = NULL; +PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB = NULL; +PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB = NULL; +PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB = NULL; +PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB = NULL; +PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB = NULL; +PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB = NULL; +PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB = NULL; +PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB = NULL; +PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB = NULL; +PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB = NULL; +PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB = NULL; +PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB = NULL; +PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB = NULL; + +PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB = NULL; +PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB = NULL; +PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB = NULL; + +PFNGLCOLORP3UIPROC __glewColorP3ui = NULL; +PFNGLCOLORP3UIVPROC __glewColorP3uiv = NULL; +PFNGLCOLORP4UIPROC __glewColorP4ui = NULL; +PFNGLCOLORP4UIVPROC __glewColorP4uiv = NULL; +PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui = NULL; +PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv = NULL; +PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui = NULL; +PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv = NULL; +PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui = NULL; +PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv = NULL; +PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui = NULL; +PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv = NULL; +PFNGLNORMALP3UIPROC __glewNormalP3ui = NULL; +PFNGLNORMALP3UIVPROC __glewNormalP3uiv = NULL; +PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui = NULL; +PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv = NULL; +PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui = NULL; +PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv = NULL; +PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui = NULL; +PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv = NULL; +PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui = NULL; +PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv = NULL; +PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui = NULL; +PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv = NULL; +PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui = NULL; +PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv = NULL; +PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui = NULL; +PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv = NULL; +PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui = NULL; +PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv = NULL; +PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui = NULL; +PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv = NULL; +PFNGLVERTEXP2UIPROC __glewVertexP2ui = NULL; +PFNGLVERTEXP2UIVPROC __glewVertexP2uiv = NULL; +PFNGLVERTEXP3UIPROC __glewVertexP3ui = NULL; +PFNGLVERTEXP3UIVPROC __glewVertexP3uiv = NULL; +PFNGLVERTEXP4UIPROC __glewVertexP4ui = NULL; +PFNGLVERTEXP4UIVPROC __glewVertexP4uiv = NULL; + +PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv = NULL; +PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed = NULL; +PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v = NULL; +PFNGLGETFLOATI_VPROC __glewGetFloati_v = NULL; +PFNGLSCISSORARRAYVPROC __glewScissorArrayv = NULL; +PFNGLSCISSORINDEXEDPROC __glewScissorIndexed = NULL; +PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv = NULL; +PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv = NULL; +PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf = NULL; +PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv = NULL; + +PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB = NULL; +PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB = NULL; +PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB = NULL; +PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB = NULL; +PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB = NULL; +PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB = NULL; +PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB = NULL; +PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB = NULL; +PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB = NULL; +PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB = NULL; +PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB = NULL; +PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB = NULL; +PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB = NULL; +PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB = NULL; +PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB = NULL; +PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB = NULL; + +PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI = NULL; + +PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI = NULL; +PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI = NULL; +PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI = NULL; + +PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI = NULL; +PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI = NULL; +PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI = NULL; +PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI = NULL; + +PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI = NULL; +PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI = NULL; +PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI = NULL; +PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI = NULL; +PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI = NULL; +PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI = NULL; +PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI = NULL; +PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI = NULL; +PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI = NULL; +PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI = NULL; +PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI = NULL; +PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI = NULL; +PFNGLSAMPLEMAPATIPROC __glewSampleMapATI = NULL; +PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI = NULL; + +PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI = NULL; +PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI = NULL; + +PFNGLPNTRIANGLESFATIPROC __glPNTrianglewesfATI = NULL; +PFNGLPNTRIANGLESIATIPROC __glPNTrianglewesiATI = NULL; + +PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI = NULL; +PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI = NULL; + +PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI = NULL; +PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI = NULL; +PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI = NULL; +PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI = NULL; +PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI = NULL; +PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI = NULL; +PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI = NULL; +PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI = NULL; +PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI = NULL; +PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI = NULL; +PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI = NULL; +PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI = NULL; + +PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI = NULL; +PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI = NULL; +PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI = NULL; + +PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI = NULL; +PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI = NULL; +PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI = NULL; +PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI = NULL; +PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI = NULL; +PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI = NULL; +PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI = NULL; +PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI = NULL; +PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI = NULL; +PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI = NULL; +PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI = NULL; +PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI = NULL; +PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI = NULL; +PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI = NULL; +PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI = NULL; +PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI = NULL; +PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI = NULL; +PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI = NULL; +PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI = NULL; +PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI = NULL; +PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI = NULL; +PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI = NULL; +PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI = NULL; +PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI = NULL; +PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI = NULL; +PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI = NULL; +PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI = NULL; +PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI = NULL; +PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI = NULL; +PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI = NULL; +PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI = NULL; +PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI = NULL; +PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI = NULL; +PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI = NULL; +PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI = NULL; +PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI = NULL; +PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI = NULL; + +PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT = NULL; +PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT = NULL; +PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT = NULL; + +PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT = NULL; + +PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT = NULL; + +PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT = NULL; + +PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT = NULL; + +PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT = NULL; +PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT = NULL; + +PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT = NULL; +PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT = NULL; + +PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT = NULL; +PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT = NULL; +PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT = NULL; +PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT = NULL; +PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT = NULL; +PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT = NULL; +PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT = NULL; +PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT = NULL; +PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT = NULL; +PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT = NULL; +PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT = NULL; +PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT = NULL; +PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT = NULL; + +PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT = NULL; +PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT = NULL; + +PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT = NULL; +PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT = NULL; +PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT = NULL; + +PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT = NULL; +PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT = NULL; + +PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT = NULL; + +PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT = NULL; +PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT = NULL; +PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT = NULL; +PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT = NULL; +PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT = NULL; +PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT = NULL; +PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT = NULL; +PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT = NULL; +PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT = NULL; +PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT = NULL; +PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT = NULL; +PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT = NULL; +PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT = NULL; +PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT = NULL; +PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT = NULL; +PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT = NULL; +PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT = NULL; +PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT = NULL; +PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT = NULL; +PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT = NULL; +PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT = NULL; +PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT = NULL; +PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT = NULL; +PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT = NULL; +PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT = NULL; +PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT = NULL; +PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT = NULL; +PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT = NULL; +PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT = NULL; +PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT = NULL; +PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT = NULL; +PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT = NULL; +PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT = NULL; +PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT = NULL; +PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT = NULL; +PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT = NULL; +PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT = NULL; +PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT = NULL; +PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT = NULL; +PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT = NULL; +PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT = NULL; +PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT = NULL; +PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT = NULL; +PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT = NULL; +PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT = NULL; +PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT = NULL; +PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT = NULL; +PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT = NULL; +PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT = NULL; +PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT = NULL; +PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT = NULL; +PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT = NULL; +PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT = NULL; +PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT = NULL; +PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT = NULL; +PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT = NULL; +PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT = NULL; +PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT = NULL; +PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT = NULL; +PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT = NULL; +PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT = NULL; +PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT = NULL; +PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT = NULL; +PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT = NULL; +PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT = NULL; +PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT = NULL; +PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT = NULL; +PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT = NULL; +PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT = NULL; +PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT = NULL; +PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT = NULL; +PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT = NULL; +PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT = NULL; +PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT = NULL; +PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT = NULL; +PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT = NULL; +PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT = NULL; +PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT = NULL; +PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT = NULL; +PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT = NULL; +PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT = NULL; +PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT = NULL; +PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT = NULL; +PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT = NULL; +PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT = NULL; +PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT = NULL; +PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT = NULL; +PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT = NULL; +PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT = NULL; +PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT = NULL; +PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT = NULL; +PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT = NULL; +PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT = NULL; +PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT = NULL; +PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT = NULL; +PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT = NULL; +PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT = NULL; +PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT = NULL; +PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT = NULL; +PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT = NULL; +PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT = NULL; +PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT = NULL; +PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT = NULL; +PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT = NULL; +PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT = NULL; +PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT = NULL; +PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT = NULL; +PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT = NULL; +PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT = NULL; +PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT = NULL; +PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT = NULL; +PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT = NULL; +PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT = NULL; +PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT = NULL; +PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT = NULL; +PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT = NULL; +PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT = NULL; +PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT = NULL; +PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT = NULL; +PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT = NULL; +PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT = NULL; +PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT = NULL; +PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT = NULL; +PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT = NULL; +PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT = NULL; +PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT = NULL; +PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT = NULL; +PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT = NULL; +PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT = NULL; +PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT = NULL; +PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT = NULL; +PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT = NULL; +PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT = NULL; +PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT = NULL; +PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT = NULL; +PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT = NULL; +PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT = NULL; +PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT = NULL; +PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT = NULL; +PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT = NULL; +PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT = NULL; +PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT = NULL; +PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT = NULL; +PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT = NULL; +PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT = NULL; +PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT = NULL; +PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT = NULL; +PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT = NULL; +PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT = NULL; +PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT = NULL; +PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT = NULL; +PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT = NULL; +PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT = NULL; +PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT = NULL; +PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT = NULL; +PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT = NULL; +PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT = NULL; +PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT = NULL; +PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT = NULL; +PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT = NULL; +PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT = NULL; +PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT = NULL; +PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT = NULL; +PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT = NULL; +PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT = NULL; +PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT = NULL; +PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT = NULL; +PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT = NULL; + +PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT = NULL; +PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT = NULL; +PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT = NULL; +PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT = NULL; +PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT = NULL; +PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT = NULL; + +PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT = NULL; +PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT = NULL; + +PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT = NULL; + +PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT = NULL; +PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT = NULL; +PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT = NULL; +PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT = NULL; +PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT = NULL; + +PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT = NULL; +PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT = NULL; +PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT = NULL; +PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT = NULL; +PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT = NULL; +PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT = NULL; +PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT = NULL; +PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT = NULL; +PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT = NULL; +PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT = NULL; +PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT = NULL; +PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT = NULL; +PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT = NULL; +PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT = NULL; +PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT = NULL; +PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT = NULL; +PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT = NULL; +PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT = NULL; + +PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT = NULL; + +PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT = NULL; +PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT = NULL; +PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT = NULL; +PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT = NULL; +PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT = NULL; +PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT = NULL; +PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT = NULL; +PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT = NULL; +PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT = NULL; +PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT = NULL; +PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT = NULL; +PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT = NULL; +PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT = NULL; +PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT = NULL; +PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT = NULL; + +PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT = NULL; +PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT = NULL; +PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT = NULL; +PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT = NULL; + +PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT = NULL; +PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT = NULL; + +PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT = NULL; +PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT = NULL; +PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT = NULL; +PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT = NULL; +PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT = NULL; +PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT = NULL; +PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT = NULL; +PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT = NULL; +PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT = NULL; +PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT = NULL; +PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT = NULL; +PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT = NULL; +PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT = NULL; +PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT = NULL; +PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT = NULL; +PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT = NULL; +PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT = NULL; +PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT = NULL; +PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT = NULL; +PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT = NULL; +PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT = NULL; +PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT = NULL; +PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT = NULL; +PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT = NULL; +PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT = NULL; +PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT = NULL; +PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT = NULL; +PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT = NULL; +PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT = NULL; +PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT = NULL; +PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT = NULL; +PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT = NULL; +PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT = NULL; +PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT = NULL; + +PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT = NULL; +PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT = NULL; +PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT = NULL; +PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT = NULL; +PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT = NULL; +PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT = NULL; +PFNGLHISTOGRAMEXTPROC __glewHistogramEXT = NULL; +PFNGLMINMAXEXTPROC __glewMinmaxEXT = NULL; +PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT = NULL; +PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT = NULL; + +PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT = NULL; + +PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT = NULL; + +PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT = NULL; +PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT = NULL; +PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT = NULL; + +PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT = NULL; +PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT = NULL; + +PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT = NULL; +PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT = NULL; + +PFNGLCOLORTABLEEXTPROC __glewColorTableEXT = NULL; +PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT = NULL; +PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT = NULL; +PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT = NULL; + +PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT = NULL; +PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT = NULL; +PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT = NULL; + +PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT = NULL; +PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT = NULL; + +PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT = NULL; + +PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT = NULL; + +PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT = NULL; +PFNGLENDSCENEEXTPROC __glewEndSceneEXT = NULL; + +PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT = NULL; +PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT = NULL; +PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT = NULL; +PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT = NULL; +PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT = NULL; +PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT = NULL; +PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT = NULL; +PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT = NULL; +PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT = NULL; +PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT = NULL; +PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT = NULL; +PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT = NULL; +PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT = NULL; +PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT = NULL; +PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT = NULL; +PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT = NULL; +PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT = NULL; + +PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT = NULL; +PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT = NULL; +PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT = NULL; + +PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT = NULL; +PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT = NULL; + +PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT = NULL; + +PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT = NULL; +PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT = NULL; +PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT = NULL; + +PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT = NULL; + +PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT = NULL; + +PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT = NULL; +PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT = NULL; +PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT = NULL; +PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT = NULL; +PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT = NULL; +PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT = NULL; + +PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT = NULL; +PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT = NULL; +PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT = NULL; +PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT = NULL; +PFNGLISTEXTUREEXTPROC __glewIsTextureEXT = NULL; +PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT = NULL; + +PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT = NULL; + +PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT = NULL; +PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT = NULL; + +PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT = NULL; +PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT = NULL; +PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT = NULL; +PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT = NULL; +PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT = NULL; + +PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT = NULL; +PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT = NULL; +PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT = NULL; +PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT = NULL; +PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT = NULL; +PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT = NULL; +PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT = NULL; +PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT = NULL; + +PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT = NULL; +PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT = NULL; +PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT = NULL; +PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT = NULL; +PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT = NULL; +PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT = NULL; +PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT = NULL; +PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT = NULL; +PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT = NULL; +PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT = NULL; +PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT = NULL; + +PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT = NULL; +PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT = NULL; +PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT = NULL; +PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT = NULL; +PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT = NULL; +PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT = NULL; +PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT = NULL; +PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT = NULL; +PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT = NULL; +PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT = NULL; +PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT = NULL; +PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT = NULL; +PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT = NULL; +PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT = NULL; +PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT = NULL; +PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT = NULL; +PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT = NULL; +PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT = NULL; +PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT = NULL; +PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT = NULL; +PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT = NULL; +PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT = NULL; +PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT = NULL; +PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT = NULL; +PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT = NULL; +PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT = NULL; +PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT = NULL; +PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT = NULL; +PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT = NULL; +PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT = NULL; +PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT = NULL; +PFNGLSWIZZLEEXTPROC __glewSwizzleEXT = NULL; +PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT = NULL; +PFNGLVARIANTBVEXTPROC __glewVariantbvEXT = NULL; +PFNGLVARIANTDVEXTPROC __glewVariantdvEXT = NULL; +PFNGLVARIANTFVEXTPROC __glewVariantfvEXT = NULL; +PFNGLVARIANTIVEXTPROC __glewVariantivEXT = NULL; +PFNGLVARIANTSVEXTPROC __glewVariantsvEXT = NULL; +PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT = NULL; +PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT = NULL; +PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT = NULL; +PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT = NULL; + +PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT = NULL; +PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT = NULL; +PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT = NULL; + +PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY = NULL; + +PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY = NULL; + +PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP = NULL; +PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP = NULL; +PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP = NULL; + +PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM = NULL; +PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM = NULL; + +PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM = NULL; +PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM = NULL; +PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM = NULL; +PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM = NULL; +PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM = NULL; +PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM = NULL; +PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM = NULL; +PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM = NULL; + +PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL = NULL; +PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL = NULL; +PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL = NULL; +PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL = NULL; + +PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL = NULL; +PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL = NULL; + +PFNGLBUFFERREGIONENABLEDEXTPROC __glewBufferRegionEnabledEXT = NULL; +PFNGLDELETEBUFFERREGIONEXTPROC __glewDeleteBufferRegionEXT = NULL; +PFNGLDRAWBUFFERREGIONEXTPROC __glewDrawBufferRegionEXT = NULL; +PFNGLNEWBUFFERREGIONEXTPROC __glewNewBufferRegionEXT = NULL; +PFNGLREADBUFFERREGIONEXTPROC __glewReadBufferRegionEXT = NULL; + +PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA = NULL; + +PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA = NULL; +PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA = NULL; +PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA = NULL; +PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA = NULL; +PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA = NULL; +PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA = NULL; +PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA = NULL; +PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA = NULL; +PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA = NULL; +PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA = NULL; +PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA = NULL; +PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA = NULL; +PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA = NULL; +PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA = NULL; +PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA = NULL; +PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA = NULL; +PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA = NULL; +PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA = NULL; +PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA = NULL; +PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA = NULL; +PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA = NULL; +PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA = NULL; +PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA = NULL; +PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA = NULL; + +PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV = NULL; +PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV = NULL; + +PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV = NULL; + +PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV = NULL; +PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV = NULL; +PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV = NULL; + +PFNGLEVALMAPSNVPROC __glewEvalMapsNV = NULL; +PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV = NULL; +PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV = NULL; +PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV = NULL; +PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV = NULL; +PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV = NULL; +PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV = NULL; +PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV = NULL; +PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV = NULL; + +PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV = NULL; +PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV = NULL; +PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV = NULL; + +PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV = NULL; +PFNGLFINISHFENCENVPROC __glewFinishFenceNV = NULL; +PFNGLGENFENCESNVPROC __glewGenFencesNV = NULL; +PFNGLGETFENCEIVNVPROC __glewGetFenceivNV = NULL; +PFNGLISFENCENVPROC __glewIsFenceNV = NULL; +PFNGLSETFENCENVPROC __glewSetFenceNV = NULL; +PFNGLTESTFENCENVPROC __glewTestFenceNV = NULL; + +PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV = NULL; +PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV = NULL; +PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV = NULL; + +PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV = NULL; + +PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV = NULL; + +PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV = NULL; +PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV = NULL; +PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV = NULL; +PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV = NULL; +PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV = NULL; +PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV = NULL; +PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV = NULL; +PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV = NULL; + +PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV = NULL; +PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV = NULL; +PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV = NULL; +PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV = NULL; +PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV = NULL; +PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV = NULL; +PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV = NULL; +PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV = NULL; +PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV = NULL; +PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV = NULL; +PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV = NULL; +PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV = NULL; +PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV = NULL; +PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV = NULL; +PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV = NULL; +PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV = NULL; +PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV = NULL; +PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV = NULL; +PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV = NULL; +PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV = NULL; +PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV = NULL; +PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV = NULL; +PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV = NULL; +PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV = NULL; +PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV = NULL; +PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV = NULL; +PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV = NULL; +PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV = NULL; +PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV = NULL; +PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV = NULL; +PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV = NULL; +PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV = NULL; +PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV = NULL; +PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV = NULL; + +PFNGLCOLOR3HNVPROC __glewColor3hNV = NULL; +PFNGLCOLOR3HVNVPROC __glewColor3hvNV = NULL; +PFNGLCOLOR4HNVPROC __glewColor4hNV = NULL; +PFNGLCOLOR4HVNVPROC __glewColor4hvNV = NULL; +PFNGLFOGCOORDHNVPROC __glewFogCoordhNV = NULL; +PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV = NULL; +PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV = NULL; +PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV = NULL; +PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV = NULL; +PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV = NULL; +PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV = NULL; +PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV = NULL; +PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV = NULL; +PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV = NULL; +PFNGLNORMAL3HNVPROC __glewNormal3hNV = NULL; +PFNGLNORMAL3HVNVPROC __glewNormal3hvNV = NULL; +PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV = NULL; +PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV = NULL; +PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV = NULL; +PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV = NULL; +PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV = NULL; +PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV = NULL; +PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV = NULL; +PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV = NULL; +PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV = NULL; +PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV = NULL; +PFNGLVERTEX2HNVPROC __glewVertex2hNV = NULL; +PFNGLVERTEX2HVNVPROC __glewVertex2hvNV = NULL; +PFNGLVERTEX3HNVPROC __glewVertex3hNV = NULL; +PFNGLVERTEX3HVNVPROC __glewVertex3hvNV = NULL; +PFNGLVERTEX4HNVPROC __glewVertex4hNV = NULL; +PFNGLVERTEX4HVNVPROC __glewVertex4hvNV = NULL; +PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV = NULL; +PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV = NULL; +PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV = NULL; +PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV = NULL; +PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV = NULL; +PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV = NULL; +PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV = NULL; +PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV = NULL; +PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV = NULL; +PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV = NULL; +PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV = NULL; +PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV = NULL; +PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV = NULL; +PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV = NULL; + +PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV = NULL; +PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV = NULL; +PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV = NULL; +PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV = NULL; +PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV = NULL; +PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV = NULL; +PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV = NULL; + +PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV = NULL; +PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV = NULL; +PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV = NULL; + +PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV = NULL; +PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV = NULL; + +PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV = NULL; +PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV = NULL; + +PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV = NULL; +PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV = NULL; +PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV = NULL; +PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV = NULL; +PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV = NULL; +PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV = NULL; + +PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV = NULL; +PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV = NULL; + +PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV = NULL; +PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV = NULL; +PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV = NULL; +PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV = NULL; +PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV = NULL; +PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV = NULL; +PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV = NULL; +PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV = NULL; +PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV = NULL; +PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV = NULL; +PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV = NULL; +PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV = NULL; +PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV = NULL; + +PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV = NULL; +PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV = NULL; + +PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV = NULL; +PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV = NULL; +PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV = NULL; +PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV = NULL; +PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV = NULL; +PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV = NULL; +PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV = NULL; +PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV = NULL; +PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV = NULL; +PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV = NULL; +PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV = NULL; +PFNGLUNIFORMUI64NVPROC __glewUniformui64NV = NULL; +PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV = NULL; + +PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV = NULL; + +PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV = NULL; +PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV = NULL; +PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV = NULL; +PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV = NULL; +PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV = NULL; +PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV = NULL; +PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV = NULL; +PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV = NULL; +PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV = NULL; +PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV = NULL; +PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV = NULL; + +PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV = NULL; +PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV = NULL; +PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV = NULL; +PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV = NULL; +PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV = NULL; +PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV = NULL; +PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV = NULL; + +PFNGLVDPAUFININVPROC __glewVDPAUFiniNV = NULL; +PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV = NULL; +PFNGLVDPAUINITNVPROC __glewVDPAUInitNV = NULL; +PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV = NULL; +PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV = NULL; +PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV = NULL; +PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV = NULL; +PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV = NULL; +PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV = NULL; +PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV = NULL; + +PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV = NULL; +PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV = NULL; + +PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV = NULL; +PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV = NULL; +PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV = NULL; +PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV = NULL; +PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV = NULL; +PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV = NULL; +PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV = NULL; +PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV = NULL; +PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV = NULL; +PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV = NULL; +PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV = NULL; +PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV = NULL; +PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV = NULL; +PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV = NULL; +PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV = NULL; +PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV = NULL; +PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV = NULL; +PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV = NULL; +PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV = NULL; + +PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV = NULL; +PFNGLCOLORFORMATNVPROC __glewColorFormatNV = NULL; +PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV = NULL; +PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV = NULL; +PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV = NULL; +PFNGLINDEXFORMATNVPROC __glewIndexFormatNV = NULL; +PFNGLNORMALFORMATNVPROC __glewNormalFormatNV = NULL; +PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV = NULL; +PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV = NULL; +PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV = NULL; +PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV = NULL; +PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV = NULL; + +PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV = NULL; +PFNGLBINDPROGRAMNVPROC __glewBindProgramNV = NULL; +PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV = NULL; +PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV = NULL; +PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV = NULL; +PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV = NULL; +PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV = NULL; +PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV = NULL; +PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV = NULL; +PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV = NULL; +PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV = NULL; +PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV = NULL; +PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV = NULL; +PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV = NULL; +PFNGLISPROGRAMNVPROC __glewIsProgramNV = NULL; +PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV = NULL; +PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV = NULL; +PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV = NULL; +PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV = NULL; +PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV = NULL; +PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV = NULL; +PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV = NULL; +PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV = NULL; +PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV = NULL; +PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV = NULL; +PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV = NULL; +PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV = NULL; +PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV = NULL; +PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV = NULL; +PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV = NULL; +PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV = NULL; +PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV = NULL; +PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV = NULL; +PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV = NULL; +PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV = NULL; +PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV = NULL; +PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV = NULL; +PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV = NULL; +PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV = NULL; +PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV = NULL; +PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV = NULL; +PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV = NULL; +PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV = NULL; +PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV = NULL; +PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV = NULL; +PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV = NULL; +PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV = NULL; +PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV = NULL; +PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV = NULL; +PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV = NULL; +PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV = NULL; +PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV = NULL; +PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV = NULL; +PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV = NULL; +PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV = NULL; +PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV = NULL; +PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV = NULL; +PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV = NULL; +PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV = NULL; +PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV = NULL; +PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV = NULL; +PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV = NULL; +PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV = NULL; +PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV = NULL; + +PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES = NULL; +PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES = NULL; +PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES = NULL; +PFNGLFRUSTUMFOESPROC __glewFrustumfOES = NULL; +PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES = NULL; +PFNGLORTHOFOESPROC __glewOrthofOES = NULL; + +PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS = NULL; +PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS = NULL; + +PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS = NULL; +PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS = NULL; + +PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS = NULL; +PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS = NULL; + +PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS = NULL; +PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS = NULL; + +PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS = NULL; +PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS = NULL; + +PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS = NULL; +PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS = NULL; + +PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX = NULL; +PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX = NULL; +PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX = NULL; +PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX = NULL; +PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX = NULL; +PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX = NULL; + +PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX = NULL; + +PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX = NULL; + +PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX = NULL; +PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX = NULL; +PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX = NULL; +PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX = NULL; +PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX = NULL; +PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX = NULL; +PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX = NULL; +PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX = NULL; +PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX = NULL; +PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX = NULL; +PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX = NULL; +PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX = NULL; +PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX = NULL; +PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX = NULL; + +PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX = NULL; + +PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX = NULL; + +PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX = NULL; + +PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX = NULL; +PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX = NULL; +PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX = NULL; +PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX = NULL; + +PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX = NULL; + +PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI = NULL; +PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI = NULL; +PFNGLCOLORTABLESGIPROC __glewColorTableSGI = NULL; +PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI = NULL; +PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI = NULL; +PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI = NULL; +PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI = NULL; + +PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX = NULL; + +PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN = NULL; +PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN = NULL; +PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN = NULL; +PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN = NULL; +PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN = NULL; +PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN = NULL; +PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN = NULL; +PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN = NULL; + +PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN = NULL; + +PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN = NULL; +PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN = NULL; +PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN = NULL; +PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN = NULL; +PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN = NULL; +PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN = NULL; +PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN = NULL; + +PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN = NULL; +PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN = NULL; +PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN = NULL; +PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN = NULL; +PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN = NULL; +PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN = NULL; +PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN = NULL; +PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN = NULL; +PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN = NULL; +PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN = NULL; +PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN = NULL; +PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN = NULL; +PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN = NULL; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN = NULL; +PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN = NULL; +PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN = NULL; +PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN = NULL; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN = NULL; +PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN = NULL; +PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN = NULL; +PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN = NULL; + +PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN = NULL; + +#endif /* !WIN32 || !GLEW_MX */ + +#if !defined(GLEW_MX) + +GLboolean __GLEW_VERSION_1_1 = GL_FALSE; +GLboolean __GLEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLEW_VERSION_1_2_1 = GL_FALSE; +GLboolean __GLEW_VERSION_1_3 = GL_FALSE; +GLboolean __GLEW_VERSION_1_4 = GL_FALSE; +GLboolean __GLEW_VERSION_1_5 = GL_FALSE; +GLboolean __GLEW_VERSION_2_0 = GL_FALSE; +GLboolean __GLEW_VERSION_2_1 = GL_FALSE; +GLboolean __GLEW_VERSION_3_0 = GL_FALSE; +GLboolean __GLEW_VERSION_3_1 = GL_FALSE; +GLboolean __GLEW_VERSION_3_2 = GL_FALSE; +GLboolean __GLEW_VERSION_3_3 = GL_FALSE; +GLboolean __GLEW_VERSION_4_0 = GL_FALSE; +GLboolean __GLEW_VERSION_4_1 = GL_FALSE; +GLboolean __GLEW_3DFX_multisample = GL_FALSE; +GLboolean __GLEW_3DFX_tbuffer = GL_FALSE; +GLboolean __GLEW_3DFX_texture_compression_FXT1 = GL_FALSE; +GLboolean __GLEW_AMD_conservative_depth = GL_FALSE; +GLboolean __GLEW_AMD_debug_output = GL_FALSE; +GLboolean __GLEW_AMD_depth_clamp_separate = GL_FALSE; +GLboolean __GLEW_AMD_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_AMD_name_gen_delete = GL_FALSE; +GLboolean __GLEW_AMD_performance_monitor = GL_FALSE; +GLboolean __GLEW_AMD_seamless_cubemap_per_texture = GL_FALSE; +GLboolean __GLEW_AMD_shader_stencil_export = GL_FALSE; +GLboolean __GLEW_AMD_texture_texture4 = GL_FALSE; +GLboolean __GLEW_AMD_transform_feedback3_lines_triangles = GL_FALSE; +GLboolean __GLEW_AMD_vertex_shader_tessellator = GL_FALSE; +GLboolean __GLEW_APPLE_aux_depth_stencil = GL_FALSE; +GLboolean __GLEW_APPLE_client_storage = GL_FALSE; +GLboolean __GLEW_APPLE_element_array = GL_FALSE; +GLboolean __GLEW_APPLE_fence = GL_FALSE; +GLboolean __GLEW_APPLE_float_pixels = GL_FALSE; +GLboolean __GLEW_APPLE_flush_buffer_range = GL_FALSE; +GLboolean __GLEW_APPLE_object_purgeable = GL_FALSE; +GLboolean __GLEW_APPLE_pixel_buffer = GL_FALSE; +GLboolean __GLEW_APPLE_rgb_422 = GL_FALSE; +GLboolean __GLEW_APPLE_row_bytes = GL_FALSE; +GLboolean __GLEW_APPLE_specular_vector = GL_FALSE; +GLboolean __GLEW_APPLE_texture_range = GL_FALSE; +GLboolean __GLEW_APPLE_transform_hint = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_array_object = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_array_range = GL_FALSE; +GLboolean __GLEW_APPLE_vertex_program_evaluators = GL_FALSE; +GLboolean __GLEW_APPLE_ycbcr_422 = GL_FALSE; +GLboolean __GLEW_ARB_ES2_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_blend_func_extended = GL_FALSE; +GLboolean __GLEW_ARB_cl_event = GL_FALSE; +GLboolean __GLEW_ARB_color_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_compatibility = GL_FALSE; +GLboolean __GLEW_ARB_copy_buffer = GL_FALSE; +GLboolean __GLEW_ARB_debug_output = GL_FALSE; +GLboolean __GLEW_ARB_depth_buffer_float = GL_FALSE; +GLboolean __GLEW_ARB_depth_clamp = GL_FALSE; +GLboolean __GLEW_ARB_depth_texture = GL_FALSE; +GLboolean __GLEW_ARB_draw_buffers = GL_FALSE; +GLboolean __GLEW_ARB_draw_buffers_blend = GL_FALSE; +GLboolean __GLEW_ARB_draw_elements_base_vertex = GL_FALSE; +GLboolean __GLEW_ARB_draw_indirect = GL_FALSE; +GLboolean __GLEW_ARB_draw_instanced = GL_FALSE; +GLboolean __GLEW_ARB_explicit_attrib_location = GL_FALSE; +GLboolean __GLEW_ARB_fragment_coord_conventions = GL_FALSE; +GLboolean __GLEW_ARB_fragment_program = GL_FALSE; +GLboolean __GLEW_ARB_fragment_program_shadow = GL_FALSE; +GLboolean __GLEW_ARB_fragment_shader = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_object = GL_FALSE; +GLboolean __GLEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __GLEW_ARB_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_ARB_get_program_binary = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader5 = GL_FALSE; +GLboolean __GLEW_ARB_gpu_shader_fp64 = GL_FALSE; +GLboolean __GLEW_ARB_half_float_pixel = GL_FALSE; +GLboolean __GLEW_ARB_half_float_vertex = GL_FALSE; +GLboolean __GLEW_ARB_imaging = GL_FALSE; +GLboolean __GLEW_ARB_instanced_arrays = GL_FALSE; +GLboolean __GLEW_ARB_map_buffer_range = GL_FALSE; +GLboolean __GLEW_ARB_matrix_palette = GL_FALSE; +GLboolean __GLEW_ARB_multisample = GL_FALSE; +GLboolean __GLEW_ARB_multitexture = GL_FALSE; +GLboolean __GLEW_ARB_occlusion_query = GL_FALSE; +GLboolean __GLEW_ARB_occlusion_query2 = GL_FALSE; +GLboolean __GLEW_ARB_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_point_parameters = GL_FALSE; +GLboolean __GLEW_ARB_point_sprite = GL_FALSE; +GLboolean __GLEW_ARB_provoking_vertex = GL_FALSE; +GLboolean __GLEW_ARB_robustness = GL_FALSE; +GLboolean __GLEW_ARB_sample_shading = GL_FALSE; +GLboolean __GLEW_ARB_sampler_objects = GL_FALSE; +GLboolean __GLEW_ARB_seamless_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_separate_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_bit_encoding = GL_FALSE; +GLboolean __GLEW_ARB_shader_objects = GL_FALSE; +GLboolean __GLEW_ARB_shader_precision = GL_FALSE; +GLboolean __GLEW_ARB_shader_stencil_export = GL_FALSE; +GLboolean __GLEW_ARB_shader_subroutine = GL_FALSE; +GLboolean __GLEW_ARB_shader_texture_lod = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_100 = GL_FALSE; +GLboolean __GLEW_ARB_shading_language_include = GL_FALSE; +GLboolean __GLEW_ARB_shadow = GL_FALSE; +GLboolean __GLEW_ARB_shadow_ambient = GL_FALSE; +GLboolean __GLEW_ARB_sync = GL_FALSE; +GLboolean __GLEW_ARB_tessellation_shader = GL_FALSE; +GLboolean __GLEW_ARB_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_texture_buffer_object_rgb32 = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression_bptc = GL_FALSE; +GLboolean __GLEW_ARB_texture_compression_rgtc = GL_FALSE; +GLboolean __GLEW_ARB_texture_cube_map = GL_FALSE; +GLboolean __GLEW_ARB_texture_cube_map_array = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_add = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_combine = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_crossbar = GL_FALSE; +GLboolean __GLEW_ARB_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_ARB_texture_float = GL_FALSE; +GLboolean __GLEW_ARB_texture_gather = GL_FALSE; +GLboolean __GLEW_ARB_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_ARB_texture_multisample = GL_FALSE; +GLboolean __GLEW_ARB_texture_non_power_of_two = GL_FALSE; +GLboolean __GLEW_ARB_texture_query_lod = GL_FALSE; +GLboolean __GLEW_ARB_texture_rectangle = GL_FALSE; +GLboolean __GLEW_ARB_texture_rg = GL_FALSE; +GLboolean __GLEW_ARB_texture_rgb10_a2ui = GL_FALSE; +GLboolean __GLEW_ARB_texture_swizzle = GL_FALSE; +GLboolean __GLEW_ARB_timer_query = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback2 = GL_FALSE; +GLboolean __GLEW_ARB_transform_feedback3 = GL_FALSE; +GLboolean __GLEW_ARB_transpose_matrix = GL_FALSE; +GLboolean __GLEW_ARB_uniform_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_array_bgra = GL_FALSE; +GLboolean __GLEW_ARB_vertex_array_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_attrib_64bit = GL_FALSE; +GLboolean __GLEW_ARB_vertex_blend = GL_FALSE; +GLboolean __GLEW_ARB_vertex_buffer_object = GL_FALSE; +GLboolean __GLEW_ARB_vertex_program = GL_FALSE; +GLboolean __GLEW_ARB_vertex_shader = GL_FALSE; +GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev = GL_FALSE; +GLboolean __GLEW_ARB_viewport_array = GL_FALSE; +GLboolean __GLEW_ARB_window_pos = GL_FALSE; +GLboolean __GLEW_ATIX_point_sprites = GL_FALSE; +GLboolean __GLEW_ATIX_texture_env_combine3 = GL_FALSE; +GLboolean __GLEW_ATIX_texture_env_route = GL_FALSE; +GLboolean __GLEW_ATIX_vertex_shader_output_point_size = GL_FALSE; +GLboolean __GLEW_ATI_draw_buffers = GL_FALSE; +GLboolean __GLEW_ATI_element_array = GL_FALSE; +GLboolean __GLEW_ATI_envmap_bumpmap = GL_FALSE; +GLboolean __GLEW_ATI_fragment_shader = GL_FALSE; +GLboolean __GLEW_ATI_map_object_buffer = GL_FALSE; +GLboolean __GLEW_ATI_meminfo = GL_FALSE; +GLboolean __GLEW_ATI_pn_triangles = GL_FALSE; +GLboolean __GLEW_ATI_separate_stencil = GL_FALSE; +GLboolean __GLEW_ATI_shader_texture_lod = GL_FALSE; +GLboolean __GLEW_ATI_text_fragment_shader = GL_FALSE; +GLboolean __GLEW_ATI_texture_compression_3dc = GL_FALSE; +GLboolean __GLEW_ATI_texture_env_combine3 = GL_FALSE; +GLboolean __GLEW_ATI_texture_float = GL_FALSE; +GLboolean __GLEW_ATI_texture_mirror_once = GL_FALSE; +GLboolean __GLEW_ATI_vertex_array_object = GL_FALSE; +GLboolean __GLEW_ATI_vertex_attrib_array_object = GL_FALSE; +GLboolean __GLEW_ATI_vertex_streams = GL_FALSE; +GLboolean __GLEW_EXT_422_pixels = GL_FALSE; +GLboolean __GLEW_EXT_Cg_shader = GL_FALSE; +GLboolean __GLEW_EXT_abgr = GL_FALSE; +GLboolean __GLEW_EXT_bgra = GL_FALSE; +GLboolean __GLEW_EXT_bindable_uniform = GL_FALSE; +GLboolean __GLEW_EXT_blend_color = GL_FALSE; +GLboolean __GLEW_EXT_blend_equation_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_func_separate = GL_FALSE; +GLboolean __GLEW_EXT_blend_logic_op = GL_FALSE; +GLboolean __GLEW_EXT_blend_minmax = GL_FALSE; +GLboolean __GLEW_EXT_blend_subtract = GL_FALSE; +GLboolean __GLEW_EXT_clip_volume_hint = GL_FALSE; +GLboolean __GLEW_EXT_cmyka = GL_FALSE; +GLboolean __GLEW_EXT_color_subtable = GL_FALSE; +GLboolean __GLEW_EXT_compiled_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_convolution = GL_FALSE; +GLboolean __GLEW_EXT_coordinate_frame = GL_FALSE; +GLboolean __GLEW_EXT_copy_texture = GL_FALSE; +GLboolean __GLEW_EXT_cull_vertex = GL_FALSE; +GLboolean __GLEW_EXT_depth_bounds_test = GL_FALSE; +GLboolean __GLEW_EXT_direct_state_access = GL_FALSE; +GLboolean __GLEW_EXT_draw_buffers2 = GL_FALSE; +GLboolean __GLEW_EXT_draw_instanced = GL_FALSE; +GLboolean __GLEW_EXT_draw_range_elements = GL_FALSE; +GLboolean __GLEW_EXT_fog_coord = GL_FALSE; +GLboolean __GLEW_EXT_fragment_lighting = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_blit = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_multisample = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_object = GL_FALSE; +GLboolean __GLEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_EXT_gpu_program_parameters = GL_FALSE; +GLboolean __GLEW_EXT_gpu_shader4 = GL_FALSE; +GLboolean __GLEW_EXT_histogram = GL_FALSE; +GLboolean __GLEW_EXT_index_array_formats = GL_FALSE; +GLboolean __GLEW_EXT_index_func = GL_FALSE; +GLboolean __GLEW_EXT_index_material = GL_FALSE; +GLboolean __GLEW_EXT_index_texture = GL_FALSE; +GLboolean __GLEW_EXT_light_texture = GL_FALSE; +GLboolean __GLEW_EXT_misc_attribute = GL_FALSE; +GLboolean __GLEW_EXT_multi_draw_arrays = GL_FALSE; +GLboolean __GLEW_EXT_multisample = GL_FALSE; +GLboolean __GLEW_EXT_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_EXT_packed_float = GL_FALSE; +GLboolean __GLEW_EXT_packed_pixels = GL_FALSE; +GLboolean __GLEW_EXT_paletted_texture = GL_FALSE; +GLboolean __GLEW_EXT_pixel_buffer_object = GL_FALSE; +GLboolean __GLEW_EXT_pixel_transform = GL_FALSE; +GLboolean __GLEW_EXT_pixel_transform_color_table = GL_FALSE; +GLboolean __GLEW_EXT_point_parameters = GL_FALSE; +GLboolean __GLEW_EXT_polygon_offset = GL_FALSE; +GLboolean __GLEW_EXT_provoking_vertex = GL_FALSE; +GLboolean __GLEW_EXT_rescale_normal = GL_FALSE; +GLboolean __GLEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLEW_EXT_secondary_color = GL_FALSE; +GLboolean __GLEW_EXT_separate_shader_objects = GL_FALSE; +GLboolean __GLEW_EXT_separate_specular_color = GL_FALSE; +GLboolean __GLEW_EXT_shader_image_load_store = GL_FALSE; +GLboolean __GLEW_EXT_shadow_funcs = GL_FALSE; +GLboolean __GLEW_EXT_shared_texture_palette = GL_FALSE; +GLboolean __GLEW_EXT_stencil_clear_tag = GL_FALSE; +GLboolean __GLEW_EXT_stencil_two_side = GL_FALSE; +GLboolean __GLEW_EXT_stencil_wrap = GL_FALSE; +GLboolean __GLEW_EXT_subtexture = GL_FALSE; +GLboolean __GLEW_EXT_texture = GL_FALSE; +GLboolean __GLEW_EXT_texture3D = GL_FALSE; +GLboolean __GLEW_EXT_texture_array = GL_FALSE; +GLboolean __GLEW_EXT_texture_buffer_object = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_dxt1 = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_latc = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_rgtc = GL_FALSE; +GLboolean __GLEW_EXT_texture_compression_s3tc = GL_FALSE; +GLboolean __GLEW_EXT_texture_cube_map = GL_FALSE; +GLboolean __GLEW_EXT_texture_edge_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_env = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_add = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_combine = GL_FALSE; +GLboolean __GLEW_EXT_texture_env_dot3 = GL_FALSE; +GLboolean __GLEW_EXT_texture_filter_anisotropic = GL_FALSE; +GLboolean __GLEW_EXT_texture_integer = GL_FALSE; +GLboolean __GLEW_EXT_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_EXT_texture_mirror_clamp = GL_FALSE; +GLboolean __GLEW_EXT_texture_object = GL_FALSE; +GLboolean __GLEW_EXT_texture_perturb_normal = GL_FALSE; +GLboolean __GLEW_EXT_texture_rectangle = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB = GL_FALSE; +GLboolean __GLEW_EXT_texture_sRGB_decode = GL_FALSE; +GLboolean __GLEW_EXT_texture_shared_exponent = GL_FALSE; +GLboolean __GLEW_EXT_texture_snorm = GL_FALSE; +GLboolean __GLEW_EXT_texture_swizzle = GL_FALSE; +GLboolean __GLEW_EXT_timer_query = GL_FALSE; +GLboolean __GLEW_EXT_transform_feedback = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array = GL_FALSE; +GLboolean __GLEW_EXT_vertex_array_bgra = GL_FALSE; +GLboolean __GLEW_EXT_vertex_attrib_64bit = GL_FALSE; +GLboolean __GLEW_EXT_vertex_shader = GL_FALSE; +GLboolean __GLEW_EXT_vertex_weighting = GL_FALSE; +GLboolean __GLEW_GREMEDY_frame_terminator = GL_FALSE; +GLboolean __GLEW_GREMEDY_string_marker = GL_FALSE; +GLboolean __GLEW_HP_convolution_border_modes = GL_FALSE; +GLboolean __GLEW_HP_image_transform = GL_FALSE; +GLboolean __GLEW_HP_occlusion_test = GL_FALSE; +GLboolean __GLEW_HP_texture_lighting = GL_FALSE; +GLboolean __GLEW_IBM_cull_vertex = GL_FALSE; +GLboolean __GLEW_IBM_multimode_draw_arrays = GL_FALSE; +GLboolean __GLEW_IBM_rasterpos_clip = GL_FALSE; +GLboolean __GLEW_IBM_static_data = GL_FALSE; +GLboolean __GLEW_IBM_texture_mirrored_repeat = GL_FALSE; +GLboolean __GLEW_IBM_vertex_array_lists = GL_FALSE; +GLboolean __GLEW_INGR_color_clamp = GL_FALSE; +GLboolean __GLEW_INGR_interlace_read = GL_FALSE; +GLboolean __GLEW_INTEL_parallel_arrays = GL_FALSE; +GLboolean __GLEW_INTEL_texture_scissor = GL_FALSE; +GLboolean __GLEW_KTX_buffer_region = GL_FALSE; +GLboolean __GLEW_MESAX_texture_stack = GL_FALSE; +GLboolean __GLEW_MESA_pack_invert = GL_FALSE; +GLboolean __GLEW_MESA_resize_buffers = GL_FALSE; +GLboolean __GLEW_MESA_window_pos = GL_FALSE; +GLboolean __GLEW_MESA_ycbcr_texture = GL_FALSE; +GLboolean __GLEW_NVX_gpu_memory_info = GL_FALSE; +GLboolean __GLEW_NV_blend_square = GL_FALSE; +GLboolean __GLEW_NV_conditional_render = GL_FALSE; +GLboolean __GLEW_NV_copy_depth_to_color = GL_FALSE; +GLboolean __GLEW_NV_copy_image = GL_FALSE; +GLboolean __GLEW_NV_depth_buffer_float = GL_FALSE; +GLboolean __GLEW_NV_depth_clamp = GL_FALSE; +GLboolean __GLEW_NV_depth_range_unclamped = GL_FALSE; +GLboolean __GLEW_NV_evaluators = GL_FALSE; +GLboolean __GLEW_NV_explicit_multisample = GL_FALSE; +GLboolean __GLEW_NV_fence = GL_FALSE; +GLboolean __GLEW_NV_float_buffer = GL_FALSE; +GLboolean __GLEW_NV_fog_distance = GL_FALSE; +GLboolean __GLEW_NV_fragment_program = GL_FALSE; +GLboolean __GLEW_NV_fragment_program2 = GL_FALSE; +GLboolean __GLEW_NV_fragment_program4 = GL_FALSE; +GLboolean __GLEW_NV_fragment_program_option = GL_FALSE; +GLboolean __GLEW_NV_framebuffer_multisample_coverage = GL_FALSE; +GLboolean __GLEW_NV_geometry_program4 = GL_FALSE; +GLboolean __GLEW_NV_geometry_shader4 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program4 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program5 = GL_FALSE; +GLboolean __GLEW_NV_gpu_program_fp64 = GL_FALSE; +GLboolean __GLEW_NV_gpu_shader5 = GL_FALSE; +GLboolean __GLEW_NV_half_float = GL_FALSE; +GLboolean __GLEW_NV_light_max_exponent = GL_FALSE; +GLboolean __GLEW_NV_multisample_coverage = GL_FALSE; +GLboolean __GLEW_NV_multisample_filter_hint = GL_FALSE; +GLboolean __GLEW_NV_occlusion_query = GL_FALSE; +GLboolean __GLEW_NV_packed_depth_stencil = GL_FALSE; +GLboolean __GLEW_NV_parameter_buffer_object = GL_FALSE; +GLboolean __GLEW_NV_parameter_buffer_object2 = GL_FALSE; +GLboolean __GLEW_NV_pixel_data_range = GL_FALSE; +GLboolean __GLEW_NV_point_sprite = GL_FALSE; +GLboolean __GLEW_NV_present_video = GL_FALSE; +GLboolean __GLEW_NV_primitive_restart = GL_FALSE; +GLboolean __GLEW_NV_register_combiners = GL_FALSE; +GLboolean __GLEW_NV_register_combiners2 = GL_FALSE; +GLboolean __GLEW_NV_shader_buffer_load = GL_FALSE; +GLboolean __GLEW_NV_tessellation_program5 = GL_FALSE; +GLboolean __GLEW_NV_texgen_emboss = GL_FALSE; +GLboolean __GLEW_NV_texgen_reflection = GL_FALSE; +GLboolean __GLEW_NV_texture_barrier = GL_FALSE; +GLboolean __GLEW_NV_texture_compression_vtc = GL_FALSE; +GLboolean __GLEW_NV_texture_env_combine4 = GL_FALSE; +GLboolean __GLEW_NV_texture_expand_normal = GL_FALSE; +GLboolean __GLEW_NV_texture_rectangle = GL_FALSE; +GLboolean __GLEW_NV_texture_shader = GL_FALSE; +GLboolean __GLEW_NV_texture_shader2 = GL_FALSE; +GLboolean __GLEW_NV_texture_shader3 = GL_FALSE; +GLboolean __GLEW_NV_transform_feedback = GL_FALSE; +GLboolean __GLEW_NV_transform_feedback2 = GL_FALSE; +GLboolean __GLEW_NV_vdpau_interop = GL_FALSE; +GLboolean __GLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLEW_NV_vertex_array_range2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_attrib_integer_64bit = GL_FALSE; +GLboolean __GLEW_NV_vertex_buffer_unified_memory = GL_FALSE; +GLboolean __GLEW_NV_vertex_program = GL_FALSE; +GLboolean __GLEW_NV_vertex_program1_1 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program2 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program2_option = GL_FALSE; +GLboolean __GLEW_NV_vertex_program3 = GL_FALSE; +GLboolean __GLEW_NV_vertex_program4 = GL_FALSE; +GLboolean __GLEW_OES_byte_coordinates = GL_FALSE; +GLboolean __GLEW_OES_compressed_paletted_texture = GL_FALSE; +GLboolean __GLEW_OES_read_format = GL_FALSE; +GLboolean __GLEW_OES_single_precision = GL_FALSE; +GLboolean __GLEW_OML_interlace = GL_FALSE; +GLboolean __GLEW_OML_resample = GL_FALSE; +GLboolean __GLEW_OML_subsample = GL_FALSE; +GLboolean __GLEW_PGI_misc_hints = GL_FALSE; +GLboolean __GLEW_PGI_vertex_hints = GL_FALSE; +GLboolean __GLEW_REND_screen_coordinates = GL_FALSE; +GLboolean __GLEW_S3_s3tc = GL_FALSE; +GLboolean __GLEW_SGIS_color_range = GL_FALSE; +GLboolean __GLEW_SGIS_detail_texture = GL_FALSE; +GLboolean __GLEW_SGIS_fog_function = GL_FALSE; +GLboolean __GLEW_SGIS_generate_mipmap = GL_FALSE; +GLboolean __GLEW_SGIS_multisample = GL_FALSE; +GLboolean __GLEW_SGIS_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIS_point_line_texgen = GL_FALSE; +GLboolean __GLEW_SGIS_sharpen_texture = GL_FALSE; +GLboolean __GLEW_SGIS_texture4D = GL_FALSE; +GLboolean __GLEW_SGIS_texture_border_clamp = GL_FALSE; +GLboolean __GLEW_SGIS_texture_edge_clamp = GL_FALSE; +GLboolean __GLEW_SGIS_texture_filter4 = GL_FALSE; +GLboolean __GLEW_SGIS_texture_lod = GL_FALSE; +GLboolean __GLEW_SGIS_texture_select = GL_FALSE; +GLboolean __GLEW_SGIX_async = GL_FALSE; +GLboolean __GLEW_SGIX_async_histogram = GL_FALSE; +GLboolean __GLEW_SGIX_async_pixel = GL_FALSE; +GLboolean __GLEW_SGIX_blend_alpha_minmax = GL_FALSE; +GLboolean __GLEW_SGIX_clipmap = GL_FALSE; +GLboolean __GLEW_SGIX_convolution_accuracy = GL_FALSE; +GLboolean __GLEW_SGIX_depth_texture = GL_FALSE; +GLboolean __GLEW_SGIX_flush_raster = GL_FALSE; +GLboolean __GLEW_SGIX_fog_offset = GL_FALSE; +GLboolean __GLEW_SGIX_fog_texture = GL_FALSE; +GLboolean __GLEW_SGIX_fragment_specular_lighting = GL_FALSE; +GLboolean __GLEW_SGIX_framezoom = GL_FALSE; +GLboolean __GLEW_SGIX_interlace = GL_FALSE; +GLboolean __GLEW_SGIX_ir_instrument1 = GL_FALSE; +GLboolean __GLEW_SGIX_list_priority = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture = GL_FALSE; +GLboolean __GLEW_SGIX_pixel_texture_bits = GL_FALSE; +GLboolean __GLEW_SGIX_reference_plane = GL_FALSE; +GLboolean __GLEW_SGIX_resample = GL_FALSE; +GLboolean __GLEW_SGIX_shadow = GL_FALSE; +GLboolean __GLEW_SGIX_shadow_ambient = GL_FALSE; +GLboolean __GLEW_SGIX_sprite = GL_FALSE; +GLboolean __GLEW_SGIX_tag_sample_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_add_env = GL_FALSE; +GLboolean __GLEW_SGIX_texture_coordinate_clamp = GL_FALSE; +GLboolean __GLEW_SGIX_texture_lod_bias = GL_FALSE; +GLboolean __GLEW_SGIX_texture_multi_buffer = GL_FALSE; +GLboolean __GLEW_SGIX_texture_range = GL_FALSE; +GLboolean __GLEW_SGIX_texture_scale_bias = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_preclip = GL_FALSE; +GLboolean __GLEW_SGIX_vertex_preclip_hint = GL_FALSE; +GLboolean __GLEW_SGIX_ycrcb = GL_FALSE; +GLboolean __GLEW_SGI_color_matrix = GL_FALSE; +GLboolean __GLEW_SGI_color_table = GL_FALSE; +GLboolean __GLEW_SGI_texture_color_table = GL_FALSE; +GLboolean __GLEW_SUNX_constant_data = GL_FALSE; +GLboolean __GLEW_SUN_convolution_border_modes = GL_FALSE; +GLboolean __GLEW_SUN_global_alpha = GL_FALSE; +GLboolean __GLEW_SUN_mesh_array = GL_FALSE; +GLboolean __GLEW_SUN_read_video_pixels = GL_FALSE; +GLboolean __GLEW_SUN_slice_accum = GL_FALSE; +GLboolean __GLEW_SUN_triangle_list = GL_FALSE; +GLboolean __GLEW_SUN_vertex = GL_FALSE; +GLboolean __GLEW_WIN_phong_shading = GL_FALSE; +GLboolean __GLEW_WIN_specular_fog = GL_FALSE; +GLboolean __GLEW_WIN_swap_hint = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef GL_VERSION_1_2 + +static GLboolean _glewInit_GL_VERSION_1_2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTexSubImage3D = (PFNGLCOPYTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3D")) == NULL) || r; + r = ((glDrawRangeElements = (PFNGLDRAWRANGEELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElements")) == NULL) || r; + r = ((glTexImage3D = (PFNGLTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexImage3D")) == NULL) || r; + r = ((glTexSubImage3D = (PFNGLTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3D")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_2 */ + +#ifdef GL_VERSION_1_2_1 + +#endif /* GL_VERSION_1_2_1 */ + +#ifdef GL_VERSION_1_3 + +static GLboolean _glewInit_GL_VERSION_1_3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveTexture = (PFNGLACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glActiveTexture")) == NULL) || r; + r = ((glClientActiveTexture = (PFNGLCLIENTACTIVETEXTUREPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTexture")) == NULL) || r; + r = ((glCompressedTexImage1D = (PFNGLCOMPRESSEDTEXIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1D")) == NULL) || r; + r = ((glCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2D")) == NULL) || r; + r = ((glCompressedTexImage3D = (PFNGLCOMPRESSEDTEXIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3D")) == NULL) || r; + r = ((glCompressedTexSubImage1D = (PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1D")) == NULL) || r; + r = ((glCompressedTexSubImage2D = (PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2D")) == NULL) || r; + r = ((glCompressedTexSubImage3D = (PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3D")) == NULL) || r; + r = ((glGetCompressedTexImage = (PFNGLGETCOMPRESSEDTEXIMAGEPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImage")) == NULL) || r; + r = ((glLoadTransposeMatrixd = (PFNGLLOADTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixd")) == NULL) || r; + r = ((glLoadTransposeMatrixf = (PFNGLLOADTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixf")) == NULL) || r; + r = ((glMultTransposeMatrixd = (PFNGLMULTTRANSPOSEMATRIXDPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixd")) == NULL) || r; + r = ((glMultTransposeMatrixf = (PFNGLMULTTRANSPOSEMATRIXFPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixf")) == NULL) || r; + r = ((glMultiTexCoord1d = (PFNGLMULTITEXCOORD1DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1d")) == NULL) || r; + r = ((glMultiTexCoord1dv = (PFNGLMULTITEXCOORD1DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dv")) == NULL) || r; + r = ((glMultiTexCoord1f = (PFNGLMULTITEXCOORD1FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1f")) == NULL) || r; + r = ((glMultiTexCoord1fv = (PFNGLMULTITEXCOORD1FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fv")) == NULL) || r; + r = ((glMultiTexCoord1i = (PFNGLMULTITEXCOORD1IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1i")) == NULL) || r; + r = ((glMultiTexCoord1iv = (PFNGLMULTITEXCOORD1IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iv")) == NULL) || r; + r = ((glMultiTexCoord1s = (PFNGLMULTITEXCOORD1SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1s")) == NULL) || r; + r = ((glMultiTexCoord1sv = (PFNGLMULTITEXCOORD1SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sv")) == NULL) || r; + r = ((glMultiTexCoord2d = (PFNGLMULTITEXCOORD2DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2d")) == NULL) || r; + r = ((glMultiTexCoord2dv = (PFNGLMULTITEXCOORD2DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dv")) == NULL) || r; + r = ((glMultiTexCoord2f = (PFNGLMULTITEXCOORD2FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2f")) == NULL) || r; + r = ((glMultiTexCoord2fv = (PFNGLMULTITEXCOORD2FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fv")) == NULL) || r; + r = ((glMultiTexCoord2i = (PFNGLMULTITEXCOORD2IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2i")) == NULL) || r; + r = ((glMultiTexCoord2iv = (PFNGLMULTITEXCOORD2IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iv")) == NULL) || r; + r = ((glMultiTexCoord2s = (PFNGLMULTITEXCOORD2SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2s")) == NULL) || r; + r = ((glMultiTexCoord2sv = (PFNGLMULTITEXCOORD2SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sv")) == NULL) || r; + r = ((glMultiTexCoord3d = (PFNGLMULTITEXCOORD3DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3d")) == NULL) || r; + r = ((glMultiTexCoord3dv = (PFNGLMULTITEXCOORD3DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dv")) == NULL) || r; + r = ((glMultiTexCoord3f = (PFNGLMULTITEXCOORD3FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3f")) == NULL) || r; + r = ((glMultiTexCoord3fv = (PFNGLMULTITEXCOORD3FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fv")) == NULL) || r; + r = ((glMultiTexCoord3i = (PFNGLMULTITEXCOORD3IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3i")) == NULL) || r; + r = ((glMultiTexCoord3iv = (PFNGLMULTITEXCOORD3IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iv")) == NULL) || r; + r = ((glMultiTexCoord3s = (PFNGLMULTITEXCOORD3SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3s")) == NULL) || r; + r = ((glMultiTexCoord3sv = (PFNGLMULTITEXCOORD3SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sv")) == NULL) || r; + r = ((glMultiTexCoord4d = (PFNGLMULTITEXCOORD4DPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4d")) == NULL) || r; + r = ((glMultiTexCoord4dv = (PFNGLMULTITEXCOORD4DVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dv")) == NULL) || r; + r = ((glMultiTexCoord4f = (PFNGLMULTITEXCOORD4FPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4f")) == NULL) || r; + r = ((glMultiTexCoord4fv = (PFNGLMULTITEXCOORD4FVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fv")) == NULL) || r; + r = ((glMultiTexCoord4i = (PFNGLMULTITEXCOORD4IPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4i")) == NULL) || r; + r = ((glMultiTexCoord4iv = (PFNGLMULTITEXCOORD4IVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iv")) == NULL) || r; + r = ((glMultiTexCoord4s = (PFNGLMULTITEXCOORD4SPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4s")) == NULL) || r; + r = ((glMultiTexCoord4sv = (PFNGLMULTITEXCOORD4SVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sv")) == NULL) || r; + r = ((glSampleCoverage = (PFNGLSAMPLECOVERAGEPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverage")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_3 */ + +#ifdef GL_VERSION_1_4 + +static GLboolean _glewInit_GL_VERSION_1_4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendColor = (PFNGLBLENDCOLORPROC)glewGetProcAddress((const GLubyte*)"glBlendColor")) == NULL) || r; + r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; + r = ((glBlendFuncSeparate = (PFNGLBLENDFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparate")) == NULL) || r; + r = ((glFogCoordPointer = (PFNGLFOGCOORDPOINTERPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointer")) == NULL) || r; + r = ((glFogCoordd = (PFNGLFOGCOORDDPROC)glewGetProcAddress((const GLubyte*)"glFogCoordd")) == NULL) || r; + r = ((glFogCoorddv = (PFNGLFOGCOORDDVPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddv")) == NULL) || r; + r = ((glFogCoordf = (PFNGLFOGCOORDFPROC)glewGetProcAddress((const GLubyte*)"glFogCoordf")) == NULL) || r; + r = ((glFogCoordfv = (PFNGLFOGCOORDFVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfv")) == NULL) || r; + r = ((glMultiDrawArrays = (PFNGLMULTIDRAWARRAYSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArrays")) == NULL) || r; + r = ((glMultiDrawElements = (PFNGLMULTIDRAWELEMENTSPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElements")) == NULL) || r; + r = ((glPointParameterf = (PFNGLPOINTPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glPointParameterf")) == NULL) || r; + r = ((glPointParameterfv = (PFNGLPOINTPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfv")) == NULL) || r; + r = ((glPointParameteri = (PFNGLPOINTPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPointParameteri")) == NULL) || r; + r = ((glPointParameteriv = (PFNGLPOINTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriv")) == NULL) || r; + r = ((glSecondaryColor3b = (PFNGLSECONDARYCOLOR3BPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3b")) == NULL) || r; + r = ((glSecondaryColor3bv = (PFNGLSECONDARYCOLOR3BVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bv")) == NULL) || r; + r = ((glSecondaryColor3d = (PFNGLSECONDARYCOLOR3DPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3d")) == NULL) || r; + r = ((glSecondaryColor3dv = (PFNGLSECONDARYCOLOR3DVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dv")) == NULL) || r; + r = ((glSecondaryColor3f = (PFNGLSECONDARYCOLOR3FPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3f")) == NULL) || r; + r = ((glSecondaryColor3fv = (PFNGLSECONDARYCOLOR3FVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fv")) == NULL) || r; + r = ((glSecondaryColor3i = (PFNGLSECONDARYCOLOR3IPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3i")) == NULL) || r; + r = ((glSecondaryColor3iv = (PFNGLSECONDARYCOLOR3IVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iv")) == NULL) || r; + r = ((glSecondaryColor3s = (PFNGLSECONDARYCOLOR3SPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3s")) == NULL) || r; + r = ((glSecondaryColor3sv = (PFNGLSECONDARYCOLOR3SVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sv")) == NULL) || r; + r = ((glSecondaryColor3ub = (PFNGLSECONDARYCOLOR3UBPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ub")) == NULL) || r; + r = ((glSecondaryColor3ubv = (PFNGLSECONDARYCOLOR3UBVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubv")) == NULL) || r; + r = ((glSecondaryColor3ui = (PFNGLSECONDARYCOLOR3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ui")) == NULL) || r; + r = ((glSecondaryColor3uiv = (PFNGLSECONDARYCOLOR3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiv")) == NULL) || r; + r = ((glSecondaryColor3us = (PFNGLSECONDARYCOLOR3USPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3us")) == NULL) || r; + r = ((glSecondaryColor3usv = (PFNGLSECONDARYCOLOR3USVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usv")) == NULL) || r; + r = ((glSecondaryColorPointer = (PFNGLSECONDARYCOLORPOINTERPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointer")) == NULL) || r; + r = ((glWindowPos2d = (PFNGLWINDOWPOS2DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2d")) == NULL) || r; + r = ((glWindowPos2dv = (PFNGLWINDOWPOS2DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dv")) == NULL) || r; + r = ((glWindowPos2f = (PFNGLWINDOWPOS2FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2f")) == NULL) || r; + r = ((glWindowPos2fv = (PFNGLWINDOWPOS2FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fv")) == NULL) || r; + r = ((glWindowPos2i = (PFNGLWINDOWPOS2IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2i")) == NULL) || r; + r = ((glWindowPos2iv = (PFNGLWINDOWPOS2IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iv")) == NULL) || r; + r = ((glWindowPos2s = (PFNGLWINDOWPOS2SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2s")) == NULL) || r; + r = ((glWindowPos2sv = (PFNGLWINDOWPOS2SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sv")) == NULL) || r; + r = ((glWindowPos3d = (PFNGLWINDOWPOS3DPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3d")) == NULL) || r; + r = ((glWindowPos3dv = (PFNGLWINDOWPOS3DVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dv")) == NULL) || r; + r = ((glWindowPos3f = (PFNGLWINDOWPOS3FPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3f")) == NULL) || r; + r = ((glWindowPos3fv = (PFNGLWINDOWPOS3FVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fv")) == NULL) || r; + r = ((glWindowPos3i = (PFNGLWINDOWPOS3IPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3i")) == NULL) || r; + r = ((glWindowPos3iv = (PFNGLWINDOWPOS3IVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iv")) == NULL) || r; + r = ((glWindowPos3s = (PFNGLWINDOWPOS3SPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3s")) == NULL) || r; + r = ((glWindowPos3sv = (PFNGLWINDOWPOS3SVPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_4 */ + +#ifdef GL_VERSION_1_5 + +static GLboolean _glewInit_GL_VERSION_1_5 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQuery = (PFNGLBEGINQUERYPROC)glewGetProcAddress((const GLubyte*)"glBeginQuery")) == NULL) || r; + r = ((glBindBuffer = (PFNGLBINDBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindBuffer")) == NULL) || r; + r = ((glBufferData = (PFNGLBUFFERDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferData")) == NULL) || r; + r = ((glBufferSubData = (PFNGLBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glBufferSubData")) == NULL) || r; + r = ((glDeleteBuffers = (PFNGLDELETEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffers")) == NULL) || r; + r = ((glDeleteQueries = (PFNGLDELETEQUERIESPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueries")) == NULL) || r; + r = ((glEndQuery = (PFNGLENDQUERYPROC)glewGetProcAddress((const GLubyte*)"glEndQuery")) == NULL) || r; + r = ((glGenBuffers = (PFNGLGENBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenBuffers")) == NULL) || r; + r = ((glGenQueries = (PFNGLGENQUERIESPROC)glewGetProcAddress((const GLubyte*)"glGenQueries")) == NULL) || r; + r = ((glGetBufferParameteriv = (PFNGLGETBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteriv")) == NULL) || r; + r = ((glGetBufferPointerv = (PFNGLGETBUFFERPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointerv")) == NULL) || r; + r = ((glGetBufferSubData = (PFNGLGETBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubData")) == NULL) || r; + r = ((glGetQueryObjectiv = (PFNGLGETQUERYOBJECTIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectiv")) == NULL) || r; + r = ((glGetQueryObjectuiv = (PFNGLGETQUERYOBJECTUIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuiv")) == NULL) || r; + r = ((glGetQueryiv = (PFNGLGETQUERYIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryiv")) == NULL) || r; + r = ((glIsBuffer = (PFNGLISBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsBuffer")) == NULL) || r; + r = ((glIsQuery = (PFNGLISQUERYPROC)glewGetProcAddress((const GLubyte*)"glIsQuery")) == NULL) || r; + r = ((glMapBuffer = (PFNGLMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glMapBuffer")) == NULL) || r; + r = ((glUnmapBuffer = (PFNGLUNMAPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glUnmapBuffer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_1_5 */ + +#ifdef GL_VERSION_2_0 + +static GLboolean _glewInit_GL_VERSION_2_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAttachShader = (PFNGLATTACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glAttachShader")) == NULL) || r; + r = ((glBindAttribLocation = (PFNGLBINDATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocation")) == NULL) || r; + r = ((glBlendEquationSeparate = (PFNGLBLENDEQUATIONSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparate")) == NULL) || r; + r = ((glCompileShader = (PFNGLCOMPILESHADERPROC)glewGetProcAddress((const GLubyte*)"glCompileShader")) == NULL) || r; + r = ((glCreateProgram = (PFNGLCREATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glCreateProgram")) == NULL) || r; + r = ((glCreateShader = (PFNGLCREATESHADERPROC)glewGetProcAddress((const GLubyte*)"glCreateShader")) == NULL) || r; + r = ((glDeleteProgram = (PFNGLDELETEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgram")) == NULL) || r; + r = ((glDeleteShader = (PFNGLDELETESHADERPROC)glewGetProcAddress((const GLubyte*)"glDeleteShader")) == NULL) || r; + r = ((glDetachShader = (PFNGLDETACHSHADERPROC)glewGetProcAddress((const GLubyte*)"glDetachShader")) == NULL) || r; + r = ((glDisableVertexAttribArray = (PFNGLDISABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArray")) == NULL) || r; + r = ((glDrawBuffers = (PFNGLDRAWBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffers")) == NULL) || r; + r = ((glEnableVertexAttribArray = (PFNGLENABLEVERTEXATTRIBARRAYPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArray")) == NULL) || r; + r = ((glGetActiveAttrib = (PFNGLGETACTIVEATTRIBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttrib")) == NULL) || r; + r = ((glGetActiveUniform = (PFNGLGETACTIVEUNIFORMPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniform")) == NULL) || r; + r = ((glGetAttachedShaders = (PFNGLGETATTACHEDSHADERSPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedShaders")) == NULL) || r; + r = ((glGetAttribLocation = (PFNGLGETATTRIBLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocation")) == NULL) || r; + r = ((glGetProgramInfoLog = (PFNGLGETPROGRAMINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramInfoLog")) == NULL) || r; + r = ((glGetProgramiv = (PFNGLGETPROGRAMIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramiv")) == NULL) || r; + r = ((glGetShaderInfoLog = (PFNGLGETSHADERINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetShaderInfoLog")) == NULL) || r; + r = ((glGetShaderSource = (PFNGLGETSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSource")) == NULL) || r; + r = ((glGetShaderiv = (PFNGLGETSHADERIVPROC)glewGetProcAddress((const GLubyte*)"glGetShaderiv")) == NULL) || r; + r = ((glGetUniformLocation = (PFNGLGETUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocation")) == NULL) || r; + r = ((glGetUniformfv = (PFNGLGETUNIFORMFVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfv")) == NULL) || r; + r = ((glGetUniformiv = (PFNGLGETUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformiv")) == NULL) || r; + r = ((glGetVertexAttribPointerv = (PFNGLGETVERTEXATTRIBPOINTERVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointerv")) == NULL) || r; + r = ((glGetVertexAttribdv = (PFNGLGETVERTEXATTRIBDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdv")) == NULL) || r; + r = ((glGetVertexAttribfv = (PFNGLGETVERTEXATTRIBFVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfv")) == NULL) || r; + r = ((glGetVertexAttribiv = (PFNGLGETVERTEXATTRIBIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribiv")) == NULL) || r; + r = ((glIsProgram = (PFNGLISPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glIsProgram")) == NULL) || r; + r = ((glIsShader = (PFNGLISSHADERPROC)glewGetProcAddress((const GLubyte*)"glIsShader")) == NULL) || r; + r = ((glLinkProgram = (PFNGLLINKPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glLinkProgram")) == NULL) || r; + r = ((glShaderSource = (PFNGLSHADERSOURCEPROC)glewGetProcAddress((const GLubyte*)"glShaderSource")) == NULL) || r; + r = ((glStencilFuncSeparate = (PFNGLSTENCILFUNCSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparate")) == NULL) || r; + r = ((glStencilMaskSeparate = (PFNGLSTENCILMASKSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilMaskSeparate")) == NULL) || r; + r = ((glStencilOpSeparate = (PFNGLSTENCILOPSEPARATEPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparate")) == NULL) || r; + r = ((glUniform1f = (PFNGLUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glUniform1f")) == NULL) || r; + r = ((glUniform1fv = (PFNGLUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glUniform1fv")) == NULL) || r; + r = ((glUniform1i = (PFNGLUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glUniform1i")) == NULL) || r; + r = ((glUniform1iv = (PFNGLUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glUniform1iv")) == NULL) || r; + r = ((glUniform2f = (PFNGLUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glUniform2f")) == NULL) || r; + r = ((glUniform2fv = (PFNGLUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glUniform2fv")) == NULL) || r; + r = ((glUniform2i = (PFNGLUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glUniform2i")) == NULL) || r; + r = ((glUniform2iv = (PFNGLUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glUniform2iv")) == NULL) || r; + r = ((glUniform3f = (PFNGLUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glUniform3f")) == NULL) || r; + r = ((glUniform3fv = (PFNGLUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glUniform3fv")) == NULL) || r; + r = ((glUniform3i = (PFNGLUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glUniform3i")) == NULL) || r; + r = ((glUniform3iv = (PFNGLUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glUniform3iv")) == NULL) || r; + r = ((glUniform4f = (PFNGLUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glUniform4f")) == NULL) || r; + r = ((glUniform4fv = (PFNGLUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glUniform4fv")) == NULL) || r; + r = ((glUniform4i = (PFNGLUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glUniform4i")) == NULL) || r; + r = ((glUniform4iv = (PFNGLUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glUniform4iv")) == NULL) || r; + r = ((glUniformMatrix2fv = (PFNGLUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fv")) == NULL) || r; + r = ((glUniformMatrix3fv = (PFNGLUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fv")) == NULL) || r; + r = ((glUniformMatrix4fv = (PFNGLUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fv")) == NULL) || r; + r = ((glUseProgram = (PFNGLUSEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glUseProgram")) == NULL) || r; + r = ((glValidateProgram = (PFNGLVALIDATEPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glValidateProgram")) == NULL) || r; + r = ((glVertexAttrib1d = (PFNGLVERTEXATTRIB1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1d")) == NULL) || r; + r = ((glVertexAttrib1dv = (PFNGLVERTEXATTRIB1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dv")) == NULL) || r; + r = ((glVertexAttrib1f = (PFNGLVERTEXATTRIB1FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1f")) == NULL) || r; + r = ((glVertexAttrib1fv = (PFNGLVERTEXATTRIB1FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fv")) == NULL) || r; + r = ((glVertexAttrib1s = (PFNGLVERTEXATTRIB1SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1s")) == NULL) || r; + r = ((glVertexAttrib1sv = (PFNGLVERTEXATTRIB1SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sv")) == NULL) || r; + r = ((glVertexAttrib2d = (PFNGLVERTEXATTRIB2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2d")) == NULL) || r; + r = ((glVertexAttrib2dv = (PFNGLVERTEXATTRIB2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dv")) == NULL) || r; + r = ((glVertexAttrib2f = (PFNGLVERTEXATTRIB2FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2f")) == NULL) || r; + r = ((glVertexAttrib2fv = (PFNGLVERTEXATTRIB2FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fv")) == NULL) || r; + r = ((glVertexAttrib2s = (PFNGLVERTEXATTRIB2SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2s")) == NULL) || r; + r = ((glVertexAttrib2sv = (PFNGLVERTEXATTRIB2SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sv")) == NULL) || r; + r = ((glVertexAttrib3d = (PFNGLVERTEXATTRIB3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3d")) == NULL) || r; + r = ((glVertexAttrib3dv = (PFNGLVERTEXATTRIB3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dv")) == NULL) || r; + r = ((glVertexAttrib3f = (PFNGLVERTEXATTRIB3FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3f")) == NULL) || r; + r = ((glVertexAttrib3fv = (PFNGLVERTEXATTRIB3FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fv")) == NULL) || r; + r = ((glVertexAttrib3s = (PFNGLVERTEXATTRIB3SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3s")) == NULL) || r; + r = ((glVertexAttrib3sv = (PFNGLVERTEXATTRIB3SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sv")) == NULL) || r; + r = ((glVertexAttrib4Nbv = (PFNGLVERTEXATTRIB4NBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nbv")) == NULL) || r; + r = ((glVertexAttrib4Niv = (PFNGLVERTEXATTRIB4NIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Niv")) == NULL) || r; + r = ((glVertexAttrib4Nsv = (PFNGLVERTEXATTRIB4NSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nsv")) == NULL) || r; + r = ((glVertexAttrib4Nub = (PFNGLVERTEXATTRIB4NUBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nub")) == NULL) || r; + r = ((glVertexAttrib4Nubv = (PFNGLVERTEXATTRIB4NUBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nubv")) == NULL) || r; + r = ((glVertexAttrib4Nuiv = (PFNGLVERTEXATTRIB4NUIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nuiv")) == NULL) || r; + r = ((glVertexAttrib4Nusv = (PFNGLVERTEXATTRIB4NUSVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4Nusv")) == NULL) || r; + r = ((glVertexAttrib4bv = (PFNGLVERTEXATTRIB4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bv")) == NULL) || r; + r = ((glVertexAttrib4d = (PFNGLVERTEXATTRIB4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4d")) == NULL) || r; + r = ((glVertexAttrib4dv = (PFNGLVERTEXATTRIB4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dv")) == NULL) || r; + r = ((glVertexAttrib4f = (PFNGLVERTEXATTRIB4FPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4f")) == NULL) || r; + r = ((glVertexAttrib4fv = (PFNGLVERTEXATTRIB4FVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fv")) == NULL) || r; + r = ((glVertexAttrib4iv = (PFNGLVERTEXATTRIB4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4iv")) == NULL) || r; + r = ((glVertexAttrib4s = (PFNGLVERTEXATTRIB4SPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4s")) == NULL) || r; + r = ((glVertexAttrib4sv = (PFNGLVERTEXATTRIB4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sv")) == NULL) || r; + r = ((glVertexAttrib4ubv = (PFNGLVERTEXATTRIB4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubv")) == NULL) || r; + r = ((glVertexAttrib4uiv = (PFNGLVERTEXATTRIB4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uiv")) == NULL) || r; + r = ((glVertexAttrib4usv = (PFNGLVERTEXATTRIB4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usv")) == NULL) || r; + r = ((glVertexAttribPointer = (PFNGLVERTEXATTRIBPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_2_0 */ + +#ifdef GL_VERSION_2_1 + +static GLboolean _glewInit_GL_VERSION_2_1 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glUniformMatrix2x3fv = (PFNGLUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3fv")) == NULL) || r; + r = ((glUniformMatrix2x4fv = (PFNGLUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4fv")) == NULL) || r; + r = ((glUniformMatrix3x2fv = (PFNGLUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2fv")) == NULL) || r; + r = ((glUniformMatrix3x4fv = (PFNGLUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4fv")) == NULL) || r; + r = ((glUniformMatrix4x2fv = (PFNGLUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2fv")) == NULL) || r; + r = ((glUniformMatrix4x3fv = (PFNGLUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3fv")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_2_1 */ + +#ifdef GL_VERSION_3_0 + +static GLboolean _glewInit_GL_VERSION_3_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginConditionalRender = (PFNGLBEGINCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRender")) == NULL) || r; + r = ((glBeginTransformFeedback = (PFNGLBEGINTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedback")) == NULL) || r; + r = ((glBindFragDataLocation = (PFNGLBINDFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocation")) == NULL) || r; + r = ((glClampColor = (PFNGLCLAMPCOLORPROC)glewGetProcAddress((const GLubyte*)"glClampColor")) == NULL) || r; + r = ((glClearBufferfi = (PFNGLCLEARBUFFERFIPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfi")) == NULL) || r; + r = ((glClearBufferfv = (PFNGLCLEARBUFFERFVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferfv")) == NULL) || r; + r = ((glClearBufferiv = (PFNGLCLEARBUFFERIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferiv")) == NULL) || r; + r = ((glClearBufferuiv = (PFNGLCLEARBUFFERUIVPROC)glewGetProcAddress((const GLubyte*)"glClearBufferuiv")) == NULL) || r; + r = ((glColorMaski = (PFNGLCOLORMASKIPROC)glewGetProcAddress((const GLubyte*)"glColorMaski")) == NULL) || r; + r = ((glDisablei = (PFNGLDISABLEIPROC)glewGetProcAddress((const GLubyte*)"glDisablei")) == NULL) || r; + r = ((glEnablei = (PFNGLENABLEIPROC)glewGetProcAddress((const GLubyte*)"glEnablei")) == NULL) || r; + r = ((glEndConditionalRender = (PFNGLENDCONDITIONALRENDERPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRender")) == NULL) || r; + r = ((glEndTransformFeedback = (PFNGLENDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedback")) == NULL) || r; + r = ((glGetBooleani_v = (PFNGLGETBOOLEANI_VPROC)glewGetProcAddress((const GLubyte*)"glGetBooleani_v")) == NULL) || r; + r = ((glGetFragDataLocation = (PFNGLGETFRAGDATALOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocation")) == NULL) || r; + r = ((glGetStringi = (PFNGLGETSTRINGIPROC)glewGetProcAddress((const GLubyte*)"glGetStringi")) == NULL) || r; + r = ((glGetTexParameterIiv = (PFNGLGETTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIiv")) == NULL) || r; + r = ((glGetTexParameterIuiv = (PFNGLGETTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuiv")) == NULL) || r; + r = ((glGetTransformFeedbackVarying = (PFNGLGETTRANSFORMFEEDBACKVARYINGPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVarying")) == NULL) || r; + r = ((glGetUniformuiv = (PFNGLGETUNIFORMUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuiv")) == NULL) || r; + r = ((glGetVertexAttribIiv = (PFNGLGETVERTEXATTRIBIIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIiv")) == NULL) || r; + r = ((glGetVertexAttribIuiv = (PFNGLGETVERTEXATTRIBIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuiv")) == NULL) || r; + r = ((glIsEnabledi = (PFNGLISENABLEDIPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledi")) == NULL) || r; + r = ((glTexParameterIiv = (PFNGLTEXPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIiv")) == NULL) || r; + r = ((glTexParameterIuiv = (PFNGLTEXPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuiv")) == NULL) || r; + r = ((glTransformFeedbackVaryings = (PFNGLTRANSFORMFEEDBACKVARYINGSPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryings")) == NULL) || r; + r = ((glUniform1ui = (PFNGLUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui")) == NULL) || r; + r = ((glUniform1uiv = (PFNGLUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiv")) == NULL) || r; + r = ((glUniform2ui = (PFNGLUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui")) == NULL) || r; + r = ((glUniform2uiv = (PFNGLUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiv")) == NULL) || r; + r = ((glUniform3ui = (PFNGLUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui")) == NULL) || r; + r = ((glUniform3uiv = (PFNGLUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiv")) == NULL) || r; + r = ((glUniform4ui = (PFNGLUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui")) == NULL) || r; + r = ((glUniform4uiv = (PFNGLUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiv")) == NULL) || r; + r = ((glVertexAttribI1i = (PFNGLVERTEXATTRIBI1IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1i")) == NULL) || r; + r = ((glVertexAttribI1iv = (PFNGLVERTEXATTRIBI1IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iv")) == NULL) || r; + r = ((glVertexAttribI1ui = (PFNGLVERTEXATTRIBI1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ui")) == NULL) || r; + r = ((glVertexAttribI1uiv = (PFNGLVERTEXATTRIBI1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiv")) == NULL) || r; + r = ((glVertexAttribI2i = (PFNGLVERTEXATTRIBI2IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2i")) == NULL) || r; + r = ((glVertexAttribI2iv = (PFNGLVERTEXATTRIBI2IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iv")) == NULL) || r; + r = ((glVertexAttribI2ui = (PFNGLVERTEXATTRIBI2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ui")) == NULL) || r; + r = ((glVertexAttribI2uiv = (PFNGLVERTEXATTRIBI2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiv")) == NULL) || r; + r = ((glVertexAttribI3i = (PFNGLVERTEXATTRIBI3IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3i")) == NULL) || r; + r = ((glVertexAttribI3iv = (PFNGLVERTEXATTRIBI3IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iv")) == NULL) || r; + r = ((glVertexAttribI3ui = (PFNGLVERTEXATTRIBI3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ui")) == NULL) || r; + r = ((glVertexAttribI3uiv = (PFNGLVERTEXATTRIBI3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiv")) == NULL) || r; + r = ((glVertexAttribI4bv = (PFNGLVERTEXATTRIBI4BVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bv")) == NULL) || r; + r = ((glVertexAttribI4i = (PFNGLVERTEXATTRIBI4IPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4i")) == NULL) || r; + r = ((glVertexAttribI4iv = (PFNGLVERTEXATTRIBI4IVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iv")) == NULL) || r; + r = ((glVertexAttribI4sv = (PFNGLVERTEXATTRIBI4SVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4sv")) == NULL) || r; + r = ((glVertexAttribI4ubv = (PFNGLVERTEXATTRIBI4UBVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubv")) == NULL) || r; + r = ((glVertexAttribI4ui = (PFNGLVERTEXATTRIBI4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ui")) == NULL) || r; + r = ((glVertexAttribI4uiv = (PFNGLVERTEXATTRIBI4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiv")) == NULL) || r; + r = ((glVertexAttribI4usv = (PFNGLVERTEXATTRIBI4USVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usv")) == NULL) || r; + r = ((glVertexAttribIPointer = (PFNGLVERTEXATTRIBIPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_0 */ + +#ifdef GL_VERSION_3_1 + +static GLboolean _glewInit_GL_VERSION_3_1 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstanced = (PFNGLDRAWARRAYSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstanced")) == NULL) || r; + r = ((glDrawElementsInstanced = (PFNGLDRAWELEMENTSINSTANCEDPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstanced")) == NULL) || r; + r = ((glPrimitiveRestartIndex = (PFNGLPRIMITIVERESTARTINDEXPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndex")) == NULL) || r; + r = ((glTexBuffer = (PFNGLTEXBUFFERPROC)glewGetProcAddress((const GLubyte*)"glTexBuffer")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_1 */ + +#ifdef GL_VERSION_3_2 + +static GLboolean _glewInit_GL_VERSION_3_2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTexture = (PFNGLFRAMEBUFFERTEXTUREPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture")) == NULL) || r; + r = ((glGetBufferParameteri64v = (PFNGLGETBUFFERPARAMETERI64VPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameteri64v")) == NULL) || r; + r = ((glGetInteger64i_v = (PFNGLGETINTEGER64I_VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64i_v")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_2 */ + +#ifdef GL_VERSION_3_3 + +static GLboolean _glewInit_GL_VERSION_3_3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribDivisor = (PFNGLVERTEXATTRIBDIVISORPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisor")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_3_3 */ + +#ifdef GL_VERSION_4_0 + +static GLboolean _glewInit_GL_VERSION_4_0 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparatei = (PFNGLBLENDEQUATIONSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparatei")) == NULL) || r; + r = ((glBlendEquationi = (PFNGLBLENDEQUATIONIPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationi")) == NULL) || r; + r = ((glBlendFuncSeparatei = (PFNGLBLENDFUNCSEPARATEIPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparatei")) == NULL) || r; + r = ((glBlendFunci = (PFNGLBLENDFUNCIPROC)glewGetProcAddress((const GLubyte*)"glBlendFunci")) == NULL) || r; + r = ((glMinSampleShading = (PFNGLMINSAMPLESHADINGPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShading")) == NULL) || r; + + return r; +} + +#endif /* GL_VERSION_4_0 */ + +#ifdef GL_VERSION_4_1 + +#endif /* GL_VERSION_4_1 */ + +#ifdef GL_3DFX_multisample + +#endif /* GL_3DFX_multisample */ + +#ifdef GL_3DFX_tbuffer + +static GLboolean _glewInit_GL_3DFX_tbuffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTbufferMask3DFX = (PFNGLTBUFFERMASK3DFXPROC)glewGetProcAddress((const GLubyte*)"glTbufferMask3DFX")) == NULL) || r; + + return r; +} + +#endif /* GL_3DFX_tbuffer */ + +#ifdef GL_3DFX_texture_compression_FXT1 + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +#ifdef GL_AMD_conservative_depth + +#endif /* GL_AMD_conservative_depth */ + +#ifdef GL_AMD_debug_output + +static GLboolean _glewInit_GL_AMD_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallbackAMD = (PFNGLDEBUGMESSAGECALLBACKAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackAMD")) == NULL) || r; + r = ((glDebugMessageEnableAMD = (PFNGLDEBUGMESSAGEENABLEAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageEnableAMD")) == NULL) || r; + r = ((glDebugMessageInsertAMD = (PFNGLDEBUGMESSAGEINSERTAMDPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertAMD")) == NULL) || r; + r = ((glGetDebugMessageLogAMD = (PFNGLGETDEBUGMESSAGELOGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_debug_output */ + +#ifdef GL_AMD_depth_clamp_separate + +#endif /* GL_AMD_depth_clamp_separate */ + +#ifdef GL_AMD_draw_buffers_blend + +static GLboolean _glewInit_GL_AMD_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationIndexedAMD = (PFNGLBLENDEQUATIONINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationIndexedAMD")) == NULL) || r; + r = ((glBlendEquationSeparateIndexedAMD = (PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateIndexedAMD")) == NULL) || r; + r = ((glBlendFuncIndexedAMD = (PFNGLBLENDFUNCINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncIndexedAMD")) == NULL) || r; + r = ((glBlendFuncSeparateIndexedAMD = (PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateIndexedAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_draw_buffers_blend */ + +#ifdef GL_AMD_name_gen_delete + +static GLboolean _glewInit_GL_AMD_name_gen_delete (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteNamesAMD = (PFNGLDELETENAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamesAMD")) == NULL) || r; + r = ((glGenNamesAMD = (PFNGLGENNAMESAMDPROC)glewGetProcAddress((const GLubyte*)"glGenNamesAMD")) == NULL) || r; + r = ((glIsNameAMD = (PFNGLISNAMEAMDPROC)glewGetProcAddress((const GLubyte*)"glIsNameAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_name_gen_delete */ + +#ifdef GL_AMD_performance_monitor + +static GLboolean _glewInit_GL_AMD_performance_monitor (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginPerfMonitorAMD = (PFNGLBEGINPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glBeginPerfMonitorAMD")) == NULL) || r; + r = ((glDeletePerfMonitorsAMD = (PFNGLDELETEPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glDeletePerfMonitorsAMD")) == NULL) || r; + r = ((glEndPerfMonitorAMD = (PFNGLENDPERFMONITORAMDPROC)glewGetProcAddress((const GLubyte*)"glEndPerfMonitorAMD")) == NULL) || r; + r = ((glGenPerfMonitorsAMD = (PFNGLGENPERFMONITORSAMDPROC)glewGetProcAddress((const GLubyte*)"glGenPerfMonitorsAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterDataAMD = (PFNGLGETPERFMONITORCOUNTERDATAAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterDataAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterInfoAMD = (PFNGLGETPERFMONITORCOUNTERINFOAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterInfoAMD")) == NULL) || r; + r = ((glGetPerfMonitorCounterStringAMD = (PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCounterStringAMD")) == NULL) || r; + r = ((glGetPerfMonitorCountersAMD = (PFNGLGETPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorCountersAMD")) == NULL) || r; + r = ((glGetPerfMonitorGroupStringAMD = (PFNGLGETPERFMONITORGROUPSTRINGAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupStringAMD")) == NULL) || r; + r = ((glGetPerfMonitorGroupsAMD = (PFNGLGETPERFMONITORGROUPSAMDPROC)glewGetProcAddress((const GLubyte*)"glGetPerfMonitorGroupsAMD")) == NULL) || r; + r = ((glSelectPerfMonitorCountersAMD = (PFNGLSELECTPERFMONITORCOUNTERSAMDPROC)glewGetProcAddress((const GLubyte*)"glSelectPerfMonitorCountersAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_performance_monitor */ + +#ifdef GL_AMD_seamless_cubemap_per_texture + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +#ifdef GL_AMD_shader_stencil_export + +#endif /* GL_AMD_shader_stencil_export */ + +#ifdef GL_AMD_texture_texture4 + +#endif /* GL_AMD_texture_texture4 */ + +#ifdef GL_AMD_transform_feedback3_lines_triangles + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +#ifdef GL_AMD_vertex_shader_tessellator + +static GLboolean _glewInit_GL_AMD_vertex_shader_tessellator (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTessellationFactorAMD = (PFNGLTESSELLATIONFACTORAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationFactorAMD")) == NULL) || r; + r = ((glTessellationModeAMD = (PFNGLTESSELLATIONMODEAMDPROC)glewGetProcAddress((const GLubyte*)"glTessellationModeAMD")) == NULL) || r; + + return r; +} + +#endif /* GL_AMD_vertex_shader_tessellator */ + +#ifdef GL_APPLE_aux_depth_stencil + +#endif /* GL_APPLE_aux_depth_stencil */ + +#ifdef GL_APPLE_client_storage + +#endif /* GL_APPLE_client_storage */ + +#ifdef GL_APPLE_element_array + +static GLboolean _glewInit_GL_APPLE_element_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementArrayAPPLE = (PFNGLDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayAPPLE")) == NULL) || r; + r = ((glDrawRangeElementArrayAPPLE = (PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayAPPLE")) == NULL) || r; + r = ((glElementPointerAPPLE = (PFNGLELEMENTPOINTERAPPLEPROC)glewGetProcAddress((const GLubyte*)"glElementPointerAPPLE")) == NULL) || r; + r = ((glMultiDrawElementArrayAPPLE = (PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementArrayAPPLE")) == NULL) || r; + r = ((glMultiDrawRangeElementArrayAPPLE = (PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawRangeElementArrayAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_element_array */ + +#ifdef GL_APPLE_fence + +static GLboolean _glewInit_GL_APPLE_fence (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteFencesAPPLE = (PFNGLDELETEFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesAPPLE")) == NULL) || r; + r = ((glFinishFenceAPPLE = (PFNGLFINISHFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceAPPLE")) == NULL) || r; + r = ((glFinishObjectAPPLE = (PFNGLFINISHOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFinishObjectAPPLE")) == NULL) || r; + r = ((glGenFencesAPPLE = (PFNGLGENFENCESAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenFencesAPPLE")) == NULL) || r; + r = ((glIsFenceAPPLE = (PFNGLISFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsFenceAPPLE")) == NULL) || r; + r = ((glSetFenceAPPLE = (PFNGLSETFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glSetFenceAPPLE")) == NULL) || r; + r = ((glTestFenceAPPLE = (PFNGLTESTFENCEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestFenceAPPLE")) == NULL) || r; + r = ((glTestObjectAPPLE = (PFNGLTESTOBJECTAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTestObjectAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_fence */ + +#ifdef GL_APPLE_float_pixels + +#endif /* GL_APPLE_float_pixels */ + +#ifdef GL_APPLE_flush_buffer_range + +static GLboolean _glewInit_GL_APPLE_flush_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferParameteriAPPLE = (PFNGLBUFFERPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBufferParameteriAPPLE")) == NULL) || r; + r = ((glFlushMappedBufferRangeAPPLE = (PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_flush_buffer_range */ + +#ifdef GL_APPLE_object_purgeable + +static GLboolean _glewInit_GL_APPLE_object_purgeable (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetObjectParameterivAPPLE = (PFNGLGETOBJECTPARAMETERIVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivAPPLE")) == NULL) || r; + r = ((glObjectPurgeableAPPLE = (PFNGLOBJECTPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectPurgeableAPPLE")) == NULL) || r; + r = ((glObjectUnpurgeableAPPLE = (PFNGLOBJECTUNPURGEABLEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glObjectUnpurgeableAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_object_purgeable */ + +#ifdef GL_APPLE_pixel_buffer + +#endif /* GL_APPLE_pixel_buffer */ + +#ifdef GL_APPLE_rgb_422 + +#endif /* GL_APPLE_rgb_422 */ + +#ifdef GL_APPLE_row_bytes + +#endif /* GL_APPLE_row_bytes */ + +#ifdef GL_APPLE_specular_vector + +#endif /* GL_APPLE_specular_vector */ + +#ifdef GL_APPLE_texture_range + +static GLboolean _glewInit_GL_APPLE_texture_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexParameterPointervAPPLE = (PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterPointervAPPLE")) == NULL) || r; + r = ((glTextureRangeAPPLE = (PFNGLTEXTURERANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glTextureRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_texture_range */ + +#ifdef GL_APPLE_transform_hint + +#endif /* GL_APPLE_transform_hint */ + +#ifdef GL_APPLE_vertex_array_object + +static GLboolean _glewInit_GL_APPLE_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexArrayAPPLE = (PFNGLBINDVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArrayAPPLE")) == NULL) || r; + r = ((glDeleteVertexArraysAPPLE = (PFNGLDELETEVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArraysAPPLE")) == NULL) || r; + r = ((glGenVertexArraysAPPLE = (PFNGLGENVERTEXARRAYSAPPLEPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArraysAPPLE")) == NULL) || r; + r = ((glIsVertexArrayAPPLE = (PFNGLISVERTEXARRAYAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArrayAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_array_object */ + +#ifdef GL_APPLE_vertex_array_range + +static GLboolean _glewInit_GL_APPLE_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushVertexArrayRangeAPPLE = (PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeAPPLE")) == NULL) || r; + r = ((glVertexArrayParameteriAPPLE = (PFNGLVERTEXARRAYPARAMETERIAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayParameteriAPPLE")) == NULL) || r; + r = ((glVertexArrayRangeAPPLE = (PFNGLVERTEXARRAYRANGEAPPLEPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_array_range */ + +#ifdef GL_APPLE_vertex_program_evaluators + +static GLboolean _glewInit_GL_APPLE_vertex_program_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDisableVertexAttribAPPLE = (PFNGLDISABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribAPPLE")) == NULL) || r; + r = ((glEnableVertexAttribAPPLE = (PFNGLENABLEVERTEXATTRIBAPPLEPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribAPPLE")) == NULL) || r; + r = ((glIsVertexAttribEnabledAPPLE = (PFNGLISVERTEXATTRIBENABLEDAPPLEPROC)glewGetProcAddress((const GLubyte*)"glIsVertexAttribEnabledAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib1dAPPLE = (PFNGLMAPVERTEXATTRIB1DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1dAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib1fAPPLE = (PFNGLMAPVERTEXATTRIB1FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib1fAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib2dAPPLE = (PFNGLMAPVERTEXATTRIB2DAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2dAPPLE")) == NULL) || r; + r = ((glMapVertexAttrib2fAPPLE = (PFNGLMAPVERTEXATTRIB2FAPPLEPROC)glewGetProcAddress((const GLubyte*)"glMapVertexAttrib2fAPPLE")) == NULL) || r; + + return r; +} + +#endif /* GL_APPLE_vertex_program_evaluators */ + +#ifdef GL_APPLE_ycbcr_422 + +#endif /* GL_APPLE_ycbcr_422 */ + +#ifdef GL_ARB_ES2_compatibility + +static GLboolean _glewInit_GL_ARB_ES2_compatibility (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthf = (PFNGLCLEARDEPTHFPROC)glewGetProcAddress((const GLubyte*)"glClearDepthf")) == NULL) || r; + r = ((glDepthRangef = (PFNGLDEPTHRANGEFPROC)glewGetProcAddress((const GLubyte*)"glDepthRangef")) == NULL) || r; + r = ((glGetShaderPrecisionFormat = (PFNGLGETSHADERPRECISIONFORMATPROC)glewGetProcAddress((const GLubyte*)"glGetShaderPrecisionFormat")) == NULL) || r; + r = ((glReleaseShaderCompiler = (PFNGLRELEASESHADERCOMPILERPROC)glewGetProcAddress((const GLubyte*)"glReleaseShaderCompiler")) == NULL) || r; + r = ((glShaderBinary = (PFNGLSHADERBINARYPROC)glewGetProcAddress((const GLubyte*)"glShaderBinary")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_ES2_compatibility */ + +#ifdef GL_ARB_blend_func_extended + +static GLboolean _glewInit_GL_ARB_blend_func_extended (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationIndexed = (PFNGLBINDFRAGDATALOCATIONINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationIndexed")) == NULL) || r; + r = ((glGetFragDataIndex = (PFNGLGETFRAGDATAINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataIndex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_blend_func_extended */ + +#ifdef GL_ARB_cl_event + +static GLboolean _glewInit_GL_ARB_cl_event (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCreateSyncFromCLeventARB = (PFNGLCREATESYNCFROMCLEVENTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateSyncFromCLeventARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_cl_event */ + +#ifdef GL_ARB_color_buffer_float + +static GLboolean _glewInit_GL_ARB_color_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClampColorARB = (PFNGLCLAMPCOLORARBPROC)glewGetProcAddress((const GLubyte*)"glClampColorARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_color_buffer_float */ + +#ifdef GL_ARB_compatibility + +#endif /* GL_ARB_compatibility */ + +#ifdef GL_ARB_copy_buffer + +static GLboolean _glewInit_GL_ARB_copy_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyBufferSubData = (PFNGLCOPYBUFFERSUBDATAPROC)glewGetProcAddress((const GLubyte*)"glCopyBufferSubData")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_copy_buffer */ + +#ifdef GL_ARB_debug_output + +static GLboolean _glewInit_GL_ARB_debug_output (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDebugMessageCallbackARB = (PFNGLDEBUGMESSAGECALLBACKARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageCallbackARB")) == NULL) || r; + r = ((glDebugMessageControlARB = (PFNGLDEBUGMESSAGECONTROLARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageControlARB")) == NULL) || r; + r = ((glDebugMessageInsertARB = (PFNGLDEBUGMESSAGEINSERTARBPROC)glewGetProcAddress((const GLubyte*)"glDebugMessageInsertARB")) == NULL) || r; + r = ((glGetDebugMessageLogARB = (PFNGLGETDEBUGMESSAGELOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetDebugMessageLogARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_debug_output */ + +#ifdef GL_ARB_depth_buffer_float + +#endif /* GL_ARB_depth_buffer_float */ + +#ifdef GL_ARB_depth_clamp + +#endif /* GL_ARB_depth_clamp */ + +#ifdef GL_ARB_depth_texture + +#endif /* GL_ARB_depth_texture */ + +#ifdef GL_ARB_draw_buffers + +static GLboolean _glewInit_GL_ARB_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersARB = (PFNGLDRAWBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_buffers */ + +#ifdef GL_ARB_draw_buffers_blend + +static GLboolean _glewInit_GL_ARB_draw_buffers_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateiARB = (PFNGLBLENDEQUATIONSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateiARB")) == NULL) || r; + r = ((glBlendEquationiARB = (PFNGLBLENDEQUATIONIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationiARB")) == NULL) || r; + r = ((glBlendFuncSeparateiARB = (PFNGLBLENDFUNCSEPARATEIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateiARB")) == NULL) || r; + r = ((glBlendFunciARB = (PFNGLBLENDFUNCIARBPROC)glewGetProcAddress((const GLubyte*)"glBlendFunciARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_buffers_blend */ + +#ifdef GL_ARB_draw_elements_base_vertex + +static GLboolean _glewInit_GL_ARB_draw_elements_base_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementsBaseVertex = (PFNGLDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsBaseVertex")) == NULL) || r; + r = ((glDrawElementsInstancedBaseVertex = (PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedBaseVertex")) == NULL) || r; + r = ((glDrawRangeElementsBaseVertex = (PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsBaseVertex")) == NULL) || r; + r = ((glMultiDrawElementsBaseVertex = (PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsBaseVertex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_elements_base_vertex */ + +#ifdef GL_ARB_draw_indirect + +static GLboolean _glewInit_GL_ARB_draw_indirect (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysIndirect = (PFNGLDRAWARRAYSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysIndirect")) == NULL) || r; + r = ((glDrawElementsIndirect = (PFNGLDRAWELEMENTSINDIRECTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsIndirect")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_indirect */ + +#ifdef GL_ARB_draw_instanced + +static GLboolean _glewInit_GL_ARB_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedARB = (PFNGLDRAWARRAYSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedARB")) == NULL) || r; + r = ((glDrawElementsInstancedARB = (PFNGLDRAWELEMENTSINSTANCEDARBPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_draw_instanced */ + +#ifdef GL_ARB_explicit_attrib_location + +#endif /* GL_ARB_explicit_attrib_location */ + +#ifdef GL_ARB_fragment_coord_conventions + +#endif /* GL_ARB_fragment_coord_conventions */ + +#ifdef GL_ARB_fragment_program + +#endif /* GL_ARB_fragment_program */ + +#ifdef GL_ARB_fragment_program_shadow + +#endif /* GL_ARB_fragment_program_shadow */ + +#ifdef GL_ARB_fragment_shader + +#endif /* GL_ARB_fragment_shader */ + +#ifdef GL_ARB_framebuffer_object + +static GLboolean _glewInit_GL_ARB_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindFramebuffer")) == NULL) || r; + r = ((glBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbuffer")) == NULL) || r; + r = ((glBlitFramebuffer = (PFNGLBLITFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebuffer")) == NULL) || r; + r = ((glCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatus")) == NULL) || r; + r = ((glDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffers")) == NULL) || r; + r = ((glDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffers")) == NULL) || r; + r = ((glFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbuffer")) == NULL) || r; + r = ((glFramebufferTexture1D = (PFNGLFRAMEBUFFERTEXTURE1DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1D")) == NULL) || r; + r = ((glFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2D")) == NULL) || r; + r = ((glFramebufferTexture3D = (PFNGLFRAMEBUFFERTEXTURE3DPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3D")) == NULL) || r; + r = ((glFramebufferTextureLayer = (PFNGLFRAMEBUFFERTEXTURELAYERPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayer")) == NULL) || r; + r = ((glGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffers")) == NULL) || r; + r = ((glGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffers")) == NULL) || r; + r = ((glGenerateMipmap = (PFNGLGENERATEMIPMAPPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmap")) == NULL) || r; + r = ((glGetFramebufferAttachmentParameteriv = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameteriv")) == NULL) || r; + r = ((glGetRenderbufferParameteriv = (PFNGLGETRENDERBUFFERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameteriv")) == NULL) || r; + r = ((glIsFramebuffer = (PFNGLISFRAMEBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsFramebuffer")) == NULL) || r; + r = ((glIsRenderbuffer = (PFNGLISRENDERBUFFERPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbuffer")) == NULL) || r; + r = ((glRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorage")) == NULL) || r; + r = ((glRenderbufferStorageMultisample = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisample")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_framebuffer_object */ + +#ifdef GL_ARB_framebuffer_sRGB + +#endif /* GL_ARB_framebuffer_sRGB */ + +#ifdef GL_ARB_geometry_shader4 + +static GLboolean _glewInit_GL_ARB_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureARB = (PFNGLFRAMEBUFFERTEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureARB")) == NULL) || r; + r = ((glFramebufferTextureFaceARB = (PFNGLFRAMEBUFFERTEXTUREFACEARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceARB")) == NULL) || r; + r = ((glFramebufferTextureLayerARB = (PFNGLFRAMEBUFFERTEXTURELAYERARBPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerARB")) == NULL) || r; + r = ((glProgramParameteriARB = (PFNGLPROGRAMPARAMETERIARBPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_geometry_shader4 */ + +#ifdef GL_ARB_get_program_binary + +static GLboolean _glewInit_GL_ARB_get_program_binary (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramBinary = (PFNGLGETPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glGetProgramBinary")) == NULL) || r; + r = ((glProgramBinary = (PFNGLPROGRAMBINARYPROC)glewGetProcAddress((const GLubyte*)"glProgramBinary")) == NULL) || r; + r = ((glProgramParameteri = (PFNGLPROGRAMPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteri")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_get_program_binary */ + +#ifdef GL_ARB_gpu_shader5 + +#endif /* GL_ARB_gpu_shader5 */ + +#ifdef GL_ARB_gpu_shader_fp64 + +static GLboolean _glewInit_GL_ARB_gpu_shader_fp64 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformdv = (PFNGLGETUNIFORMDVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformdv")) == NULL) || r; + r = ((glProgramUniform1dEXT = (PFNGLPROGRAMUNIFORM1DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dEXT")) == NULL) || r; + r = ((glProgramUniform1dvEXT = (PFNGLPROGRAMUNIFORM1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dvEXT")) == NULL) || r; + r = ((glProgramUniform2dEXT = (PFNGLPROGRAMUNIFORM2DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dEXT")) == NULL) || r; + r = ((glProgramUniform2dvEXT = (PFNGLPROGRAMUNIFORM2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dvEXT")) == NULL) || r; + r = ((glProgramUniform3dEXT = (PFNGLPROGRAMUNIFORM3DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dEXT")) == NULL) || r; + r = ((glProgramUniform3dvEXT = (PFNGLPROGRAMUNIFORM3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dvEXT")) == NULL) || r; + r = ((glProgramUniform4dEXT = (PFNGLPROGRAMUNIFORM4DEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dEXT")) == NULL) || r; + r = ((glProgramUniform4dvEXT = (PFNGLPROGRAMUNIFORM4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x2dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x3dvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dvEXT")) == NULL) || r; + r = ((glUniform1d = (PFNGLUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glUniform1d")) == NULL) || r; + r = ((glUniform1dv = (PFNGLUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glUniform1dv")) == NULL) || r; + r = ((glUniform2d = (PFNGLUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glUniform2d")) == NULL) || r; + r = ((glUniform2dv = (PFNGLUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glUniform2dv")) == NULL) || r; + r = ((glUniform3d = (PFNGLUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glUniform3d")) == NULL) || r; + r = ((glUniform3dv = (PFNGLUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glUniform3dv")) == NULL) || r; + r = ((glUniform4d = (PFNGLUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glUniform4d")) == NULL) || r; + r = ((glUniform4dv = (PFNGLUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glUniform4dv")) == NULL) || r; + r = ((glUniformMatrix2dv = (PFNGLUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2dv")) == NULL) || r; + r = ((glUniformMatrix2x3dv = (PFNGLUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x3dv")) == NULL) || r; + r = ((glUniformMatrix2x4dv = (PFNGLUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2x4dv")) == NULL) || r; + r = ((glUniformMatrix3dv = (PFNGLUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3dv")) == NULL) || r; + r = ((glUniformMatrix3x2dv = (PFNGLUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x2dv")) == NULL) || r; + r = ((glUniformMatrix3x4dv = (PFNGLUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3x4dv")) == NULL) || r; + r = ((glUniformMatrix4dv = (PFNGLUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4dv")) == NULL) || r; + r = ((glUniformMatrix4x2dv = (PFNGLUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x2dv")) == NULL) || r; + r = ((glUniformMatrix4x3dv = (PFNGLUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4x3dv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_gpu_shader_fp64 */ + +#ifdef GL_ARB_half_float_pixel + +#endif /* GL_ARB_half_float_pixel */ + +#ifdef GL_ARB_half_float_vertex + +#endif /* GL_ARB_half_float_vertex */ + +#ifdef GL_ARB_imaging + +static GLboolean _glewInit_GL_ARB_imaging (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquation = (PFNGLBLENDEQUATIONPROC)glewGetProcAddress((const GLubyte*)"glBlendEquation")) == NULL) || r; + r = ((glColorSubTable = (PFNGLCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorSubTable")) == NULL) || r; + r = ((glColorTable = (PFNGLCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glColorTable")) == NULL) || r; + r = ((glColorTableParameterfv = (PFNGLCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfv")) == NULL) || r; + r = ((glColorTableParameteriv = (PFNGLCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameteriv")) == NULL) || r; + r = ((glConvolutionFilter1D = (PFNGLCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1D")) == NULL) || r; + r = ((glConvolutionFilter2D = (PFNGLCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2D")) == NULL) || r; + r = ((glConvolutionParameterf = (PFNGLCONVOLUTIONPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterf")) == NULL) || r; + r = ((glConvolutionParameterfv = (PFNGLCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfv")) == NULL) || r; + r = ((glConvolutionParameteri = (PFNGLCONVOLUTIONPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteri")) == NULL) || r; + r = ((glConvolutionParameteriv = (PFNGLCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriv")) == NULL) || r; + r = ((glCopyColorSubTable = (PFNGLCOPYCOLORSUBTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTable")) == NULL) || r; + r = ((glCopyColorTable = (PFNGLCOPYCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTable")) == NULL) || r; + r = ((glCopyConvolutionFilter1D = (PFNGLCOPYCONVOLUTIONFILTER1DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1D")) == NULL) || r; + r = ((glCopyConvolutionFilter2D = (PFNGLCOPYCONVOLUTIONFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2D")) == NULL) || r; + r = ((glGetColorTable = (PFNGLGETCOLORTABLEPROC)glewGetProcAddress((const GLubyte*)"glGetColorTable")) == NULL) || r; + r = ((glGetColorTableParameterfv = (PFNGLGETCOLORTABLEPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfv")) == NULL) || r; + r = ((glGetColorTableParameteriv = (PFNGLGETCOLORTABLEPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameteriv")) == NULL) || r; + r = ((glGetConvolutionFilter = (PFNGLGETCONVOLUTIONFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilter")) == NULL) || r; + r = ((glGetConvolutionParameterfv = (PFNGLGETCONVOLUTIONPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfv")) == NULL) || r; + r = ((glGetConvolutionParameteriv = (PFNGLGETCONVOLUTIONPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameteriv")) == NULL) || r; + r = ((glGetHistogram = (PFNGLGETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glGetHistogram")) == NULL) || r; + r = ((glGetHistogramParameterfv = (PFNGLGETHISTOGRAMPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfv")) == NULL) || r; + r = ((glGetHistogramParameteriv = (PFNGLGETHISTOGRAMPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameteriv")) == NULL) || r; + r = ((glGetMinmax = (PFNGLGETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glGetMinmax")) == NULL) || r; + r = ((glGetMinmaxParameterfv = (PFNGLGETMINMAXPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfv")) == NULL) || r; + r = ((glGetMinmaxParameteriv = (PFNGLGETMINMAXPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameteriv")) == NULL) || r; + r = ((glGetSeparableFilter = (PFNGLGETSEPARABLEFILTERPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilter")) == NULL) || r; + r = ((glHistogram = (PFNGLHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glHistogram")) == NULL) || r; + r = ((glMinmax = (PFNGLMINMAXPROC)glewGetProcAddress((const GLubyte*)"glMinmax")) == NULL) || r; + r = ((glResetHistogram = (PFNGLRESETHISTOGRAMPROC)glewGetProcAddress((const GLubyte*)"glResetHistogram")) == NULL) || r; + r = ((glResetMinmax = (PFNGLRESETMINMAXPROC)glewGetProcAddress((const GLubyte*)"glResetMinmax")) == NULL) || r; + r = ((glSeparableFilter2D = (PFNGLSEPARABLEFILTER2DPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2D")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_imaging */ + +#ifdef GL_ARB_instanced_arrays + +static GLboolean _glewInit_GL_ARB_instanced_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexAttribDivisorARB = (PFNGLVERTEXATTRIBDIVISORARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribDivisorARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_instanced_arrays */ + +#ifdef GL_ARB_map_buffer_range + +static GLboolean _glewInit_GL_ARB_map_buffer_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushMappedBufferRange = (PFNGLFLUSHMAPPEDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedBufferRange")) == NULL) || r; + r = ((glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glMapBufferRange")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_map_buffer_range */ + +#ifdef GL_ARB_matrix_palette + +static GLboolean _glewInit_GL_ARB_matrix_palette (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCurrentPaletteMatrixARB = (PFNGLCURRENTPALETTEMATRIXARBPROC)glewGetProcAddress((const GLubyte*)"glCurrentPaletteMatrixARB")) == NULL) || r; + r = ((glMatrixIndexPointerARB = (PFNGLMATRIXINDEXPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexPointerARB")) == NULL) || r; + r = ((glMatrixIndexubvARB = (PFNGLMATRIXINDEXUBVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexubvARB")) == NULL) || r; + r = ((glMatrixIndexuivARB = (PFNGLMATRIXINDEXUIVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexuivARB")) == NULL) || r; + r = ((glMatrixIndexusvARB = (PFNGLMATRIXINDEXUSVARBPROC)glewGetProcAddress((const GLubyte*)"glMatrixIndexusvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_matrix_palette */ + +#ifdef GL_ARB_multisample + +static GLboolean _glewInit_GL_ARB_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleCoverageARB = (PFNGLSAMPLECOVERAGEARBPROC)glewGetProcAddress((const GLubyte*)"glSampleCoverageARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multisample */ + +#ifdef GL_ARB_multitexture + +static GLboolean _glewInit_GL_ARB_multitexture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveTextureARB = (PFNGLACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glActiveTextureARB")) == NULL) || r; + r = ((glClientActiveTextureARB = (PFNGLCLIENTACTIVETEXTUREARBPROC)glewGetProcAddress((const GLubyte*)"glClientActiveTextureARB")) == NULL) || r; + r = ((glMultiTexCoord1dARB = (PFNGLMULTITEXCOORD1DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dARB")) == NULL) || r; + r = ((glMultiTexCoord1dvARB = (PFNGLMULTITEXCOORD1DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1dvARB")) == NULL) || r; + r = ((glMultiTexCoord1fARB = (PFNGLMULTITEXCOORD1FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fARB")) == NULL) || r; + r = ((glMultiTexCoord1fvARB = (PFNGLMULTITEXCOORD1FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1fvARB")) == NULL) || r; + r = ((glMultiTexCoord1iARB = (PFNGLMULTITEXCOORD1IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1iARB")) == NULL) || r; + r = ((glMultiTexCoord1ivARB = (PFNGLMULTITEXCOORD1IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1ivARB")) == NULL) || r; + r = ((glMultiTexCoord1sARB = (PFNGLMULTITEXCOORD1SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1sARB")) == NULL) || r; + r = ((glMultiTexCoord1svARB = (PFNGLMULTITEXCOORD1SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1svARB")) == NULL) || r; + r = ((glMultiTexCoord2dARB = (PFNGLMULTITEXCOORD2DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dARB")) == NULL) || r; + r = ((glMultiTexCoord2dvARB = (PFNGLMULTITEXCOORD2DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2dvARB")) == NULL) || r; + r = ((glMultiTexCoord2fARB = (PFNGLMULTITEXCOORD2FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fARB")) == NULL) || r; + r = ((glMultiTexCoord2fvARB = (PFNGLMULTITEXCOORD2FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2fvARB")) == NULL) || r; + r = ((glMultiTexCoord2iARB = (PFNGLMULTITEXCOORD2IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2iARB")) == NULL) || r; + r = ((glMultiTexCoord2ivARB = (PFNGLMULTITEXCOORD2IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2ivARB")) == NULL) || r; + r = ((glMultiTexCoord2sARB = (PFNGLMULTITEXCOORD2SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2sARB")) == NULL) || r; + r = ((glMultiTexCoord2svARB = (PFNGLMULTITEXCOORD2SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2svARB")) == NULL) || r; + r = ((glMultiTexCoord3dARB = (PFNGLMULTITEXCOORD3DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dARB")) == NULL) || r; + r = ((glMultiTexCoord3dvARB = (PFNGLMULTITEXCOORD3DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3dvARB")) == NULL) || r; + r = ((glMultiTexCoord3fARB = (PFNGLMULTITEXCOORD3FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fARB")) == NULL) || r; + r = ((glMultiTexCoord3fvARB = (PFNGLMULTITEXCOORD3FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3fvARB")) == NULL) || r; + r = ((glMultiTexCoord3iARB = (PFNGLMULTITEXCOORD3IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3iARB")) == NULL) || r; + r = ((glMultiTexCoord3ivARB = (PFNGLMULTITEXCOORD3IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3ivARB")) == NULL) || r; + r = ((glMultiTexCoord3sARB = (PFNGLMULTITEXCOORD3SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3sARB")) == NULL) || r; + r = ((glMultiTexCoord3svARB = (PFNGLMULTITEXCOORD3SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3svARB")) == NULL) || r; + r = ((glMultiTexCoord4dARB = (PFNGLMULTITEXCOORD4DARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dARB")) == NULL) || r; + r = ((glMultiTexCoord4dvARB = (PFNGLMULTITEXCOORD4DVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4dvARB")) == NULL) || r; + r = ((glMultiTexCoord4fARB = (PFNGLMULTITEXCOORD4FARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fARB")) == NULL) || r; + r = ((glMultiTexCoord4fvARB = (PFNGLMULTITEXCOORD4FVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4fvARB")) == NULL) || r; + r = ((glMultiTexCoord4iARB = (PFNGLMULTITEXCOORD4IARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4iARB")) == NULL) || r; + r = ((glMultiTexCoord4ivARB = (PFNGLMULTITEXCOORD4IVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4ivARB")) == NULL) || r; + r = ((glMultiTexCoord4sARB = (PFNGLMULTITEXCOORD4SARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4sARB")) == NULL) || r; + r = ((glMultiTexCoord4svARB = (PFNGLMULTITEXCOORD4SVARBPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4svARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_multitexture */ + +#ifdef GL_ARB_occlusion_query + +static GLboolean _glewInit_GL_ARB_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryARB = (PFNGLBEGINQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryARB")) == NULL) || r; + r = ((glDeleteQueriesARB = (PFNGLDELETEQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteQueriesARB")) == NULL) || r; + r = ((glEndQueryARB = (PFNGLENDQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glEndQueryARB")) == NULL) || r; + r = ((glGenQueriesARB = (PFNGLGENQUERIESARBPROC)glewGetProcAddress((const GLubyte*)"glGenQueriesARB")) == NULL) || r; + r = ((glGetQueryObjectivARB = (PFNGLGETQUERYOBJECTIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectivARB")) == NULL) || r; + r = ((glGetQueryObjectuivARB = (PFNGLGETQUERYOBJECTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectuivARB")) == NULL) || r; + r = ((glGetQueryivARB = (PFNGLGETQUERYIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetQueryivARB")) == NULL) || r; + r = ((glIsQueryARB = (PFNGLISQUERYARBPROC)glewGetProcAddress((const GLubyte*)"glIsQueryARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_occlusion_query */ + +#ifdef GL_ARB_occlusion_query2 + +#endif /* GL_ARB_occlusion_query2 */ + +#ifdef GL_ARB_pixel_buffer_object + +#endif /* GL_ARB_pixel_buffer_object */ + +#ifdef GL_ARB_point_parameters + +static GLboolean _glewInit_GL_ARB_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameterfARB = (PFNGLPOINTPARAMETERFARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfARB")) == NULL) || r; + r = ((glPointParameterfvARB = (PFNGLPOINTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_point_parameters */ + +#ifdef GL_ARB_point_sprite + +#endif /* GL_ARB_point_sprite */ + +#ifdef GL_ARB_provoking_vertex + +static GLboolean _glewInit_GL_ARB_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProvokingVertex = (PFNGLPROVOKINGVERTEXPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertex")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_provoking_vertex */ + +#ifdef GL_ARB_robustness + +static GLboolean _glewInit_GL_ARB_robustness (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetnColorTableARB = (PFNGLGETNCOLORTABLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnColorTableARB")) == NULL) || r; + r = ((glGetnCompressedTexImageARB = (PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnCompressedTexImageARB")) == NULL) || r; + r = ((glGetnConvolutionFilterARB = (PFNGLGETNCONVOLUTIONFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnConvolutionFilterARB")) == NULL) || r; + r = ((glGetnHistogramARB = (PFNGLGETNHISTOGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glGetnHistogramARB")) == NULL) || r; + r = ((glGetnMapdvARB = (PFNGLGETNMAPDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapdvARB")) == NULL) || r; + r = ((glGetnMapfvARB = (PFNGLGETNMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapfvARB")) == NULL) || r; + r = ((glGetnMapivARB = (PFNGLGETNMAPIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMapivARB")) == NULL) || r; + r = ((glGetnMinmaxARB = (PFNGLGETNMINMAXARBPROC)glewGetProcAddress((const GLubyte*)"glGetnMinmaxARB")) == NULL) || r; + r = ((glGetnPixelMapfvARB = (PFNGLGETNPIXELMAPFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapfvARB")) == NULL) || r; + r = ((glGetnPixelMapuivARB = (PFNGLGETNPIXELMAPUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapuivARB")) == NULL) || r; + r = ((glGetnPixelMapusvARB = (PFNGLGETNPIXELMAPUSVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPixelMapusvARB")) == NULL) || r; + r = ((glGetnPolygonStippleARB = (PFNGLGETNPOLYGONSTIPPLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnPolygonStippleARB")) == NULL) || r; + r = ((glGetnSeparableFilterARB = (PFNGLGETNSEPARABLEFILTERARBPROC)glewGetProcAddress((const GLubyte*)"glGetnSeparableFilterARB")) == NULL) || r; + r = ((glGetnTexImageARB = (PFNGLGETNTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetnTexImageARB")) == NULL) || r; + r = ((glGetnUniformdvARB = (PFNGLGETNUNIFORMDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformdvARB")) == NULL) || r; + r = ((glGetnUniformfvARB = (PFNGLGETNUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformfvARB")) == NULL) || r; + r = ((glGetnUniformivARB = (PFNGLGETNUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformivARB")) == NULL) || r; + r = ((glGetnUniformuivARB = (PFNGLGETNUNIFORMUIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetnUniformuivARB")) == NULL) || r; + r = ((glReadnPixelsARB = (PFNGLREADNPIXELSARBPROC)glewGetProcAddress((const GLubyte*)"glReadnPixelsARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_robustness */ + +#ifdef GL_ARB_sample_shading + +static GLboolean _glewInit_GL_ARB_sample_shading (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMinSampleShadingARB = (PFNGLMINSAMPLESHADINGARBPROC)glewGetProcAddress((const GLubyte*)"glMinSampleShadingARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sample_shading */ + +#ifdef GL_ARB_sampler_objects + +static GLboolean _glewInit_GL_ARB_sampler_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindSampler = (PFNGLBINDSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glBindSampler")) == NULL) || r; + r = ((glDeleteSamplers = (PFNGLDELETESAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glDeleteSamplers")) == NULL) || r; + r = ((glGenSamplers = (PFNGLGENSAMPLERSPROC)glewGetProcAddress((const GLubyte*)"glGenSamplers")) == NULL) || r; + r = ((glGetSamplerParameterIiv = (PFNGLGETSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIiv")) == NULL) || r; + r = ((glGetSamplerParameterIuiv = (PFNGLGETSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterIuiv")) == NULL) || r; + r = ((glGetSamplerParameterfv = (PFNGLGETSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameterfv")) == NULL) || r; + r = ((glGetSamplerParameteriv = (PFNGLGETSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glGetSamplerParameteriv")) == NULL) || r; + r = ((glIsSampler = (PFNGLISSAMPLERPROC)glewGetProcAddress((const GLubyte*)"glIsSampler")) == NULL) || r; + r = ((glSamplerParameterIiv = (PFNGLSAMPLERPARAMETERIIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIiv")) == NULL) || r; + r = ((glSamplerParameterIuiv = (PFNGLSAMPLERPARAMETERIUIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterIuiv")) == NULL) || r; + r = ((glSamplerParameterf = (PFNGLSAMPLERPARAMETERFPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterf")) == NULL) || r; + r = ((glSamplerParameterfv = (PFNGLSAMPLERPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameterfv")) == NULL) || r; + r = ((glSamplerParameteri = (PFNGLSAMPLERPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteri")) == NULL) || r; + r = ((glSamplerParameteriv = (PFNGLSAMPLERPARAMETERIVPROC)glewGetProcAddress((const GLubyte*)"glSamplerParameteriv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sampler_objects */ + +#ifdef GL_ARB_seamless_cube_map + +#endif /* GL_ARB_seamless_cube_map */ + +#ifdef GL_ARB_separate_shader_objects + +static GLboolean _glewInit_GL_ARB_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveShaderProgram = (PFNGLACTIVESHADERPROGRAMPROC)glewGetProcAddress((const GLubyte*)"glActiveShaderProgram")) == NULL) || r; + r = ((glBindProgramPipeline = (PFNGLBINDPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glBindProgramPipeline")) == NULL) || r; + r = ((glCreateShaderProgramv = (PFNGLCREATESHADERPROGRAMVPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramv")) == NULL) || r; + r = ((glDeleteProgramPipelines = (PFNGLDELETEPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramPipelines")) == NULL) || r; + r = ((glGenProgramPipelines = (PFNGLGENPROGRAMPIPELINESPROC)glewGetProcAddress((const GLubyte*)"glGenProgramPipelines")) == NULL) || r; + r = ((glGetProgramPipelineInfoLog = (PFNGLGETPROGRAMPIPELINEINFOLOGPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineInfoLog")) == NULL) || r; + r = ((glGetProgramPipelineiv = (PFNGLGETPROGRAMPIPELINEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramPipelineiv")) == NULL) || r; + r = ((glIsProgramPipeline = (PFNGLISPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glIsProgramPipeline")) == NULL) || r; + r = ((glProgramUniform1d = (PFNGLPROGRAMUNIFORM1DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1d")) == NULL) || r; + r = ((glProgramUniform1dv = (PFNGLPROGRAMUNIFORM1DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1dv")) == NULL) || r; + r = ((glProgramUniform1f = (PFNGLPROGRAMUNIFORM1FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1f")) == NULL) || r; + r = ((glProgramUniform1fv = (PFNGLPROGRAMUNIFORM1FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fv")) == NULL) || r; + r = ((glProgramUniform1i = (PFNGLPROGRAMUNIFORM1IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i")) == NULL) || r; + r = ((glProgramUniform1iv = (PFNGLPROGRAMUNIFORM1IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iv")) == NULL) || r; + r = ((glProgramUniform1ui = (PFNGLPROGRAMUNIFORM1UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui")) == NULL) || r; + r = ((glProgramUniform1uiv = (PFNGLPROGRAMUNIFORM1UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiv")) == NULL) || r; + r = ((glProgramUniform2d = (PFNGLPROGRAMUNIFORM2DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2d")) == NULL) || r; + r = ((glProgramUniform2dv = (PFNGLPROGRAMUNIFORM2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2dv")) == NULL) || r; + r = ((glProgramUniform2f = (PFNGLPROGRAMUNIFORM2FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2f")) == NULL) || r; + r = ((glProgramUniform2fv = (PFNGLPROGRAMUNIFORM2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fv")) == NULL) || r; + r = ((glProgramUniform2i = (PFNGLPROGRAMUNIFORM2IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i")) == NULL) || r; + r = ((glProgramUniform2iv = (PFNGLPROGRAMUNIFORM2IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iv")) == NULL) || r; + r = ((glProgramUniform2ui = (PFNGLPROGRAMUNIFORM2UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui")) == NULL) || r; + r = ((glProgramUniform2uiv = (PFNGLPROGRAMUNIFORM2UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiv")) == NULL) || r; + r = ((glProgramUniform3d = (PFNGLPROGRAMUNIFORM3DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3d")) == NULL) || r; + r = ((glProgramUniform3dv = (PFNGLPROGRAMUNIFORM3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3dv")) == NULL) || r; + r = ((glProgramUniform3f = (PFNGLPROGRAMUNIFORM3FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3f")) == NULL) || r; + r = ((glProgramUniform3fv = (PFNGLPROGRAMUNIFORM3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fv")) == NULL) || r; + r = ((glProgramUniform3i = (PFNGLPROGRAMUNIFORM3IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i")) == NULL) || r; + r = ((glProgramUniform3iv = (PFNGLPROGRAMUNIFORM3IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iv")) == NULL) || r; + r = ((glProgramUniform3ui = (PFNGLPROGRAMUNIFORM3UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui")) == NULL) || r; + r = ((glProgramUniform3uiv = (PFNGLPROGRAMUNIFORM3UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiv")) == NULL) || r; + r = ((glProgramUniform4d = (PFNGLPROGRAMUNIFORM4DPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4d")) == NULL) || r; + r = ((glProgramUniform4dv = (PFNGLPROGRAMUNIFORM4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4dv")) == NULL) || r; + r = ((glProgramUniform4f = (PFNGLPROGRAMUNIFORM4FPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4f")) == NULL) || r; + r = ((glProgramUniform4fv = (PFNGLPROGRAMUNIFORM4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fv")) == NULL) || r; + r = ((glProgramUniform4i = (PFNGLPROGRAMUNIFORM4IPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i")) == NULL) || r; + r = ((glProgramUniform4iv = (PFNGLPROGRAMUNIFORM4IVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iv")) == NULL) || r; + r = ((glProgramUniform4ui = (PFNGLPROGRAMUNIFORM4UIPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui")) == NULL) || r; + r = ((glProgramUniform4uiv = (PFNGLPROGRAMUNIFORM4UIVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiv")) == NULL) || r; + r = ((glProgramUniformMatrix2dv = (PFNGLPROGRAMUNIFORMMATRIX2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2dv")) == NULL) || r; + r = ((glProgramUniformMatrix2fv = (PFNGLPROGRAMUNIFORMMATRIX2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fv")) == NULL) || r; + r = ((glProgramUniformMatrix2x3dv = (PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3dv")) == NULL) || r; + r = ((glProgramUniformMatrix2x3fv = (PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fv")) == NULL) || r; + r = ((glProgramUniformMatrix2x4dv = (PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4dv")) == NULL) || r; + r = ((glProgramUniformMatrix2x4fv = (PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fv")) == NULL) || r; + r = ((glProgramUniformMatrix3dv = (PFNGLPROGRAMUNIFORMMATRIX3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3dv")) == NULL) || r; + r = ((glProgramUniformMatrix3fv = (PFNGLPROGRAMUNIFORMMATRIX3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fv")) == NULL) || r; + r = ((glProgramUniformMatrix3x2dv = (PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2dv")) == NULL) || r; + r = ((glProgramUniformMatrix3x2fv = (PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fv")) == NULL) || r; + r = ((glProgramUniformMatrix3x4dv = (PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4dv")) == NULL) || r; + r = ((glProgramUniformMatrix3x4fv = (PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fv")) == NULL) || r; + r = ((glProgramUniformMatrix4dv = (PFNGLPROGRAMUNIFORMMATRIX4DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4dv")) == NULL) || r; + r = ((glProgramUniformMatrix4fv = (PFNGLPROGRAMUNIFORMMATRIX4FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fv")) == NULL) || r; + r = ((glProgramUniformMatrix4x2dv = (PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2dv")) == NULL) || r; + r = ((glProgramUniformMatrix4x2fv = (PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fv")) == NULL) || r; + r = ((glProgramUniformMatrix4x3dv = (PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3dv")) == NULL) || r; + r = ((glProgramUniformMatrix4x3fv = (PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fv")) == NULL) || r; + r = ((glUseProgramStages = (PFNGLUSEPROGRAMSTAGESPROC)glewGetProcAddress((const GLubyte*)"glUseProgramStages")) == NULL) || r; + r = ((glValidateProgramPipeline = (PFNGLVALIDATEPROGRAMPIPELINEPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramPipeline")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_separate_shader_objects */ + +#ifdef GL_ARB_shader_bit_encoding + +#endif /* GL_ARB_shader_bit_encoding */ + +#ifdef GL_ARB_shader_objects + +static GLboolean _glewInit_GL_ARB_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAttachObjectARB = (PFNGLATTACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glAttachObjectARB")) == NULL) || r; + r = ((glCompileShaderARB = (PFNGLCOMPILESHADERARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderARB")) == NULL) || r; + r = ((glCreateProgramObjectARB = (PFNGLCREATEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateProgramObjectARB")) == NULL) || r; + r = ((glCreateShaderObjectARB = (PFNGLCREATESHADEROBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderObjectARB")) == NULL) || r; + r = ((glDeleteObjectARB = (PFNGLDELETEOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteObjectARB")) == NULL) || r; + r = ((glDetachObjectARB = (PFNGLDETACHOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glDetachObjectARB")) == NULL) || r; + r = ((glGetActiveUniformARB = (PFNGLGETACTIVEUNIFORMARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformARB")) == NULL) || r; + r = ((glGetAttachedObjectsARB = (PFNGLGETATTACHEDOBJECTSARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttachedObjectsARB")) == NULL) || r; + r = ((glGetHandleARB = (PFNGLGETHANDLEARBPROC)glewGetProcAddress((const GLubyte*)"glGetHandleARB")) == NULL) || r; + r = ((glGetInfoLogARB = (PFNGLGETINFOLOGARBPROC)glewGetProcAddress((const GLubyte*)"glGetInfoLogARB")) == NULL) || r; + r = ((glGetObjectParameterfvARB = (PFNGLGETOBJECTPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterfvARB")) == NULL) || r; + r = ((glGetObjectParameterivARB = (PFNGLGETOBJECTPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetObjectParameterivARB")) == NULL) || r; + r = ((glGetShaderSourceARB = (PFNGLGETSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glGetShaderSourceARB")) == NULL) || r; + r = ((glGetUniformLocationARB = (PFNGLGETUNIFORMLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformLocationARB")) == NULL) || r; + r = ((glGetUniformfvARB = (PFNGLGETUNIFORMFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformfvARB")) == NULL) || r; + r = ((glGetUniformivARB = (PFNGLGETUNIFORMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetUniformivARB")) == NULL) || r; + r = ((glLinkProgramARB = (PFNGLLINKPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glLinkProgramARB")) == NULL) || r; + r = ((glShaderSourceARB = (PFNGLSHADERSOURCEARBPROC)glewGetProcAddress((const GLubyte*)"glShaderSourceARB")) == NULL) || r; + r = ((glUniform1fARB = (PFNGLUNIFORM1FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fARB")) == NULL) || r; + r = ((glUniform1fvARB = (PFNGLUNIFORM1FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1fvARB")) == NULL) || r; + r = ((glUniform1iARB = (PFNGLUNIFORM1IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1iARB")) == NULL) || r; + r = ((glUniform1ivARB = (PFNGLUNIFORM1IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform1ivARB")) == NULL) || r; + r = ((glUniform2fARB = (PFNGLUNIFORM2FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fARB")) == NULL) || r; + r = ((glUniform2fvARB = (PFNGLUNIFORM2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2fvARB")) == NULL) || r; + r = ((glUniform2iARB = (PFNGLUNIFORM2IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2iARB")) == NULL) || r; + r = ((glUniform2ivARB = (PFNGLUNIFORM2IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform2ivARB")) == NULL) || r; + r = ((glUniform3fARB = (PFNGLUNIFORM3FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fARB")) == NULL) || r; + r = ((glUniform3fvARB = (PFNGLUNIFORM3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3fvARB")) == NULL) || r; + r = ((glUniform3iARB = (PFNGLUNIFORM3IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3iARB")) == NULL) || r; + r = ((glUniform3ivARB = (PFNGLUNIFORM3IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform3ivARB")) == NULL) || r; + r = ((glUniform4fARB = (PFNGLUNIFORM4FARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fARB")) == NULL) || r; + r = ((glUniform4fvARB = (PFNGLUNIFORM4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4fvARB")) == NULL) || r; + r = ((glUniform4iARB = (PFNGLUNIFORM4IARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4iARB")) == NULL) || r; + r = ((glUniform4ivARB = (PFNGLUNIFORM4IVARBPROC)glewGetProcAddress((const GLubyte*)"glUniform4ivARB")) == NULL) || r; + r = ((glUniformMatrix2fvARB = (PFNGLUNIFORMMATRIX2FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix2fvARB")) == NULL) || r; + r = ((glUniformMatrix3fvARB = (PFNGLUNIFORMMATRIX3FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix3fvARB")) == NULL) || r; + r = ((glUniformMatrix4fvARB = (PFNGLUNIFORMMATRIX4FVARBPROC)glewGetProcAddress((const GLubyte*)"glUniformMatrix4fvARB")) == NULL) || r; + r = ((glUseProgramObjectARB = (PFNGLUSEPROGRAMOBJECTARBPROC)glewGetProcAddress((const GLubyte*)"glUseProgramObjectARB")) == NULL) || r; + r = ((glValidateProgramARB = (PFNGLVALIDATEPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glValidateProgramARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_objects */ + +#ifdef GL_ARB_shader_precision + +#endif /* GL_ARB_shader_precision */ + +#ifdef GL_ARB_shader_stencil_export + +#endif /* GL_ARB_shader_stencil_export */ + +#ifdef GL_ARB_shader_subroutine + +static GLboolean _glewInit_GL_ARB_shader_subroutine (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetActiveSubroutineName = (PFNGLGETACTIVESUBROUTINENAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineName")) == NULL) || r; + r = ((glGetActiveSubroutineUniformName = (PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformName")) == NULL) || r; + r = ((glGetActiveSubroutineUniformiv = (PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveSubroutineUniformiv")) == NULL) || r; + r = ((glGetProgramStageiv = (PFNGLGETPROGRAMSTAGEIVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStageiv")) == NULL) || r; + r = ((glGetSubroutineIndex = (PFNGLGETSUBROUTINEINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineIndex")) == NULL) || r; + r = ((glGetSubroutineUniformLocation = (PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC)glewGetProcAddress((const GLubyte*)"glGetSubroutineUniformLocation")) == NULL) || r; + r = ((glGetUniformSubroutineuiv = (PFNGLGETUNIFORMSUBROUTINEUIVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformSubroutineuiv")) == NULL) || r; + r = ((glUniformSubroutinesuiv = (PFNGLUNIFORMSUBROUTINESUIVPROC)glewGetProcAddress((const GLubyte*)"glUniformSubroutinesuiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shader_subroutine */ + +#ifdef GL_ARB_shader_texture_lod + +#endif /* GL_ARB_shader_texture_lod */ + +#ifdef GL_ARB_shading_language_100 + +#endif /* GL_ARB_shading_language_100 */ + +#ifdef GL_ARB_shading_language_include + +static GLboolean _glewInit_GL_ARB_shading_language_include (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCompileShaderIncludeARB = (PFNGLCOMPILESHADERINCLUDEARBPROC)glewGetProcAddress((const GLubyte*)"glCompileShaderIncludeARB")) == NULL) || r; + r = ((glDeleteNamedStringARB = (PFNGLDELETENAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteNamedStringARB")) == NULL) || r; + r = ((glGetNamedStringARB = (PFNGLGETNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringARB")) == NULL) || r; + r = ((glGetNamedStringivARB = (PFNGLGETNAMEDSTRINGIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetNamedStringivARB")) == NULL) || r; + r = ((glIsNamedStringARB = (PFNGLISNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glIsNamedStringARB")) == NULL) || r; + r = ((glNamedStringARB = (PFNGLNAMEDSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glNamedStringARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_shading_language_include */ + +#ifdef GL_ARB_shadow + +#endif /* GL_ARB_shadow */ + +#ifdef GL_ARB_shadow_ambient + +#endif /* GL_ARB_shadow_ambient */ + +#ifdef GL_ARB_sync + +static GLboolean _glewInit_GL_ARB_sync (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glClientWaitSync")) == NULL) || r; + r = ((glDeleteSync = (PFNGLDELETESYNCPROC)glewGetProcAddress((const GLubyte*)"glDeleteSync")) == NULL) || r; + r = ((glFenceSync = (PFNGLFENCESYNCPROC)glewGetProcAddress((const GLubyte*)"glFenceSync")) == NULL) || r; + r = ((glGetInteger64v = (PFNGLGETINTEGER64VPROC)glewGetProcAddress((const GLubyte*)"glGetInteger64v")) == NULL) || r; + r = ((glGetSynciv = (PFNGLGETSYNCIVPROC)glewGetProcAddress((const GLubyte*)"glGetSynciv")) == NULL) || r; + r = ((glIsSync = (PFNGLISSYNCPROC)glewGetProcAddress((const GLubyte*)"glIsSync")) == NULL) || r; + r = ((glWaitSync = (PFNGLWAITSYNCPROC)glewGetProcAddress((const GLubyte*)"glWaitSync")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_sync */ + +#ifdef GL_ARB_tessellation_shader + +static GLboolean _glewInit_GL_ARB_tessellation_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPatchParameterfv = (PFNGLPATCHPARAMETERFVPROC)glewGetProcAddress((const GLubyte*)"glPatchParameterfv")) == NULL) || r; + r = ((glPatchParameteri = (PFNGLPATCHPARAMETERIPROC)glewGetProcAddress((const GLubyte*)"glPatchParameteri")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_tessellation_shader */ + +#ifdef GL_ARB_texture_border_clamp + +#endif /* GL_ARB_texture_border_clamp */ + +#ifdef GL_ARB_texture_buffer_object + +static GLboolean _glewInit_GL_ARB_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferARB = (PFNGLTEXBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glTexBufferARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_buffer_object */ + +#ifdef GL_ARB_texture_buffer_object_rgb32 + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +#ifdef GL_ARB_texture_compression + +static GLboolean _glewInit_GL_ARB_texture_compression (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCompressedTexImage1DARB = (PFNGLCOMPRESSEDTEXIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage1DARB")) == NULL) || r; + r = ((glCompressedTexImage2DARB = (PFNGLCOMPRESSEDTEXIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage2DARB")) == NULL) || r; + r = ((glCompressedTexImage3DARB = (PFNGLCOMPRESSEDTEXIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexImage3DARB")) == NULL) || r; + r = ((glCompressedTexSubImage1DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage1DARB")) == NULL) || r; + r = ((glCompressedTexSubImage2DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage2DARB")) == NULL) || r; + r = ((glCompressedTexSubImage3DARB = (PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC)glewGetProcAddress((const GLubyte*)"glCompressedTexSubImage3DARB")) == NULL) || r; + r = ((glGetCompressedTexImageARB = (PFNGLGETCOMPRESSEDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTexImageARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_compression */ + +#ifdef GL_ARB_texture_compression_bptc + +#endif /* GL_ARB_texture_compression_bptc */ + +#ifdef GL_ARB_texture_compression_rgtc + +#endif /* GL_ARB_texture_compression_rgtc */ + +#ifdef GL_ARB_texture_cube_map + +#endif /* GL_ARB_texture_cube_map */ + +#ifdef GL_ARB_texture_cube_map_array + +#endif /* GL_ARB_texture_cube_map_array */ + +#ifdef GL_ARB_texture_env_add + +#endif /* GL_ARB_texture_env_add */ + +#ifdef GL_ARB_texture_env_combine + +#endif /* GL_ARB_texture_env_combine */ + +#ifdef GL_ARB_texture_env_crossbar + +#endif /* GL_ARB_texture_env_crossbar */ + +#ifdef GL_ARB_texture_env_dot3 + +#endif /* GL_ARB_texture_env_dot3 */ + +#ifdef GL_ARB_texture_float + +#endif /* GL_ARB_texture_float */ + +#ifdef GL_ARB_texture_gather + +#endif /* GL_ARB_texture_gather */ + +#ifdef GL_ARB_texture_mirrored_repeat + +#endif /* GL_ARB_texture_mirrored_repeat */ + +#ifdef GL_ARB_texture_multisample + +static GLboolean _glewInit_GL_ARB_texture_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetMultisamplefv = (PFNGLGETMULTISAMPLEFVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefv")) == NULL) || r; + r = ((glSampleMaski = (PFNGLSAMPLEMASKIPROC)glewGetProcAddress((const GLubyte*)"glSampleMaski")) == NULL) || r; + r = ((glTexImage2DMultisample = (PFNGLTEXIMAGE2DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage2DMultisample")) == NULL) || r; + r = ((glTexImage3DMultisample = (PFNGLTEXIMAGE3DMULTISAMPLEPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DMultisample")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_texture_multisample */ + +#ifdef GL_ARB_texture_non_power_of_two + +#endif /* GL_ARB_texture_non_power_of_two */ + +#ifdef GL_ARB_texture_query_lod + +#endif /* GL_ARB_texture_query_lod */ + +#ifdef GL_ARB_texture_rectangle + +#endif /* GL_ARB_texture_rectangle */ + +#ifdef GL_ARB_texture_rg + +#endif /* GL_ARB_texture_rg */ + +#ifdef GL_ARB_texture_rgb10_a2ui + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +#ifdef GL_ARB_texture_swizzle + +#endif /* GL_ARB_texture_swizzle */ + +#ifdef GL_ARB_timer_query + +static GLboolean _glewInit_GL_ARB_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetQueryObjecti64v = (PFNGLGETQUERYOBJECTI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64v")) == NULL) || r; + r = ((glGetQueryObjectui64v = (PFNGLGETQUERYOBJECTUI64VPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64v")) == NULL) || r; + r = ((glQueryCounter = (PFNGLQUERYCOUNTERPROC)glewGetProcAddress((const GLubyte*)"glQueryCounter")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_timer_query */ + +#ifdef GL_ARB_transform_feedback2 + +static GLboolean _glewInit_GL_ARB_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindTransformFeedback = (PFNGLBINDTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedback")) == NULL) || r; + r = ((glDeleteTransformFeedbacks = (PFNGLDELETETRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacks")) == NULL) || r; + r = ((glDrawTransformFeedback = (PFNGLDRAWTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedback")) == NULL) || r; + r = ((glGenTransformFeedbacks = (PFNGLGENTRANSFORMFEEDBACKSPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacks")) == NULL) || r; + r = ((glIsTransformFeedback = (PFNGLISTRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedback")) == NULL) || r; + r = ((glPauseTransformFeedback = (PFNGLPAUSETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedback")) == NULL) || r; + r = ((glResumeTransformFeedback = (PFNGLRESUMETRANSFORMFEEDBACKPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedback")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback2 */ + +#ifdef GL_ARB_transform_feedback3 + +static GLboolean _glewInit_GL_ARB_transform_feedback3 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginQueryIndexed = (PFNGLBEGINQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glBeginQueryIndexed")) == NULL) || r; + r = ((glDrawTransformFeedbackStream = (PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackStream")) == NULL) || r; + r = ((glEndQueryIndexed = (PFNGLENDQUERYINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glEndQueryIndexed")) == NULL) || r; + r = ((glGetQueryIndexediv = (PFNGLGETQUERYINDEXEDIVPROC)glewGetProcAddress((const GLubyte*)"glGetQueryIndexediv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transform_feedback3 */ + +#ifdef GL_ARB_transpose_matrix + +static GLboolean _glewInit_GL_ARB_transpose_matrix (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glLoadTransposeMatrixdARB = (PFNGLLOADTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixdARB")) == NULL) || r; + r = ((glLoadTransposeMatrixfARB = (PFNGLLOADTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glLoadTransposeMatrixfARB")) == NULL) || r; + r = ((glMultTransposeMatrixdARB = (PFNGLMULTTRANSPOSEMATRIXDARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixdARB")) == NULL) || r; + r = ((glMultTransposeMatrixfARB = (PFNGLMULTTRANSPOSEMATRIXFARBPROC)glewGetProcAddress((const GLubyte*)"glMultTransposeMatrixfARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_transpose_matrix */ + +#ifdef GL_ARB_uniform_buffer_object + +static GLboolean _glewInit_GL_ARB_uniform_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindBufferBase = (PFNGLBINDBUFFERBASEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBase")) == NULL) || r; + r = ((glBindBufferRange = (PFNGLBINDBUFFERRANGEPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRange")) == NULL) || r; + r = ((glGetActiveUniformBlockName = (PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockName")) == NULL) || r; + r = ((glGetActiveUniformBlockiv = (PFNGLGETACTIVEUNIFORMBLOCKIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformBlockiv")) == NULL) || r; + r = ((glGetActiveUniformName = (PFNGLGETACTIVEUNIFORMNAMEPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformName")) == NULL) || r; + r = ((glGetActiveUniformsiv = (PFNGLGETACTIVEUNIFORMSIVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveUniformsiv")) == NULL) || r; + r = ((glGetIntegeri_v = (PFNGLGETINTEGERI_VPROC)glewGetProcAddress((const GLubyte*)"glGetIntegeri_v")) == NULL) || r; + r = ((glGetUniformBlockIndex = (PFNGLGETUNIFORMBLOCKINDEXPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBlockIndex")) == NULL) || r; + r = ((glGetUniformIndices = (PFNGLGETUNIFORMINDICESPROC)glewGetProcAddress((const GLubyte*)"glGetUniformIndices")) == NULL) || r; + r = ((glUniformBlockBinding = (PFNGLUNIFORMBLOCKBINDINGPROC)glewGetProcAddress((const GLubyte*)"glUniformBlockBinding")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_uniform_buffer_object */ + +#ifdef GL_ARB_vertex_array_bgra + +#endif /* GL_ARB_vertex_array_bgra */ + +#ifdef GL_ARB_vertex_array_object + +static GLboolean _glewInit_GL_ARB_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindVertexArray = (PFNGLBINDVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glBindVertexArray")) == NULL) || r; + r = ((glDeleteVertexArrays = (PFNGLDELETEVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexArrays")) == NULL) || r; + r = ((glGenVertexArrays = (PFNGLGENVERTEXARRAYSPROC)glewGetProcAddress((const GLubyte*)"glGenVertexArrays")) == NULL) || r; + r = ((glIsVertexArray = (PFNGLISVERTEXARRAYPROC)glewGetProcAddress((const GLubyte*)"glIsVertexArray")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_array_object */ + +#ifdef GL_ARB_vertex_attrib_64bit + +static GLboolean _glewInit_GL_ARB_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLdv = (PFNGLGETVERTEXATTRIBLDVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdv")) == NULL) || r; + r = ((glVertexAttribL1d = (PFNGLVERTEXATTRIBL1DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1d")) == NULL) || r; + r = ((glVertexAttribL1dv = (PFNGLVERTEXATTRIBL1DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dv")) == NULL) || r; + r = ((glVertexAttribL2d = (PFNGLVERTEXATTRIBL2DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2d")) == NULL) || r; + r = ((glVertexAttribL2dv = (PFNGLVERTEXATTRIBL2DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dv")) == NULL) || r; + r = ((glVertexAttribL3d = (PFNGLVERTEXATTRIBL3DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3d")) == NULL) || r; + r = ((glVertexAttribL3dv = (PFNGLVERTEXATTRIBL3DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dv")) == NULL) || r; + r = ((glVertexAttribL4d = (PFNGLVERTEXATTRIBL4DPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4d")) == NULL) || r; + r = ((glVertexAttribL4dv = (PFNGLVERTEXATTRIBL4DVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dv")) == NULL) || r; + r = ((glVertexAttribLPointer = (PFNGLVERTEXATTRIBLPOINTERPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointer")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_attrib_64bit */ + +#ifdef GL_ARB_vertex_blend + +static GLboolean _glewInit_GL_ARB_vertex_blend (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexBlendARB = (PFNGLVERTEXBLENDARBPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendARB")) == NULL) || r; + r = ((glWeightPointerARB = (PFNGLWEIGHTPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glWeightPointerARB")) == NULL) || r; + r = ((glWeightbvARB = (PFNGLWEIGHTBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightbvARB")) == NULL) || r; + r = ((glWeightdvARB = (PFNGLWEIGHTDVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightdvARB")) == NULL) || r; + r = ((glWeightfvARB = (PFNGLWEIGHTFVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightfvARB")) == NULL) || r; + r = ((glWeightivARB = (PFNGLWEIGHTIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightivARB")) == NULL) || r; + r = ((glWeightsvARB = (PFNGLWEIGHTSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightsvARB")) == NULL) || r; + r = ((glWeightubvARB = (PFNGLWEIGHTUBVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightubvARB")) == NULL) || r; + r = ((glWeightuivARB = (PFNGLWEIGHTUIVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightuivARB")) == NULL) || r; + r = ((glWeightusvARB = (PFNGLWEIGHTUSVARBPROC)glewGetProcAddress((const GLubyte*)"glWeightusvARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_blend */ + +#ifdef GL_ARB_vertex_buffer_object + +static GLboolean _glewInit_GL_ARB_vertex_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindBufferARB = (PFNGLBINDBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glBindBufferARB")) == NULL) || r; + r = ((glBufferDataARB = (PFNGLBUFFERDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferDataARB")) == NULL) || r; + r = ((glBufferSubDataARB = (PFNGLBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glBufferSubDataARB")) == NULL) || r; + r = ((glDeleteBuffersARB = (PFNGLDELETEBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteBuffersARB")) == NULL) || r; + r = ((glGenBuffersARB = (PFNGLGENBUFFERSARBPROC)glewGetProcAddress((const GLubyte*)"glGenBuffersARB")) == NULL) || r; + r = ((glGetBufferParameterivARB = (PFNGLGETBUFFERPARAMETERIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterivARB")) == NULL) || r; + r = ((glGetBufferPointervARB = (PFNGLGETBUFFERPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferPointervARB")) == NULL) || r; + r = ((glGetBufferSubDataARB = (PFNGLGETBUFFERSUBDATAARBPROC)glewGetProcAddress((const GLubyte*)"glGetBufferSubDataARB")) == NULL) || r; + r = ((glIsBufferARB = (PFNGLISBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glIsBufferARB")) == NULL) || r; + r = ((glMapBufferARB = (PFNGLMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glMapBufferARB")) == NULL) || r; + r = ((glUnmapBufferARB = (PFNGLUNMAPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"glUnmapBufferARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_buffer_object */ + +#ifdef GL_ARB_vertex_program + +static GLboolean _glewInit_GL_ARB_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindProgramARB = (PFNGLBINDPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glBindProgramARB")) == NULL) || r; + r = ((glDeleteProgramsARB = (PFNGLDELETEPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsARB")) == NULL) || r; + r = ((glDisableVertexAttribArrayARB = (PFNGLDISABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexAttribArrayARB")) == NULL) || r; + r = ((glEnableVertexAttribArrayARB = (PFNGLENABLEVERTEXATTRIBARRAYARBPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexAttribArrayARB")) == NULL) || r; + r = ((glGenProgramsARB = (PFNGLGENPROGRAMSARBPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsARB")) == NULL) || r; + r = ((glGetProgramEnvParameterdvARB = (PFNGLGETPROGRAMENVPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterdvARB")) == NULL) || r; + r = ((glGetProgramEnvParameterfvARB = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramEnvParameterfvARB")) == NULL) || r; + r = ((glGetProgramLocalParameterdvARB = (PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterdvARB")) == NULL) || r; + r = ((glGetProgramLocalParameterfvARB = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramLocalParameterfvARB")) == NULL) || r; + r = ((glGetProgramStringARB = (PFNGLGETPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringARB")) == NULL) || r; + r = ((glGetProgramivARB = (PFNGLGETPROGRAMIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivARB")) == NULL) || r; + r = ((glGetVertexAttribPointervARB = (PFNGLGETVERTEXATTRIBPOINTERVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervARB")) == NULL) || r; + r = ((glGetVertexAttribdvARB = (PFNGLGETVERTEXATTRIBDVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvARB")) == NULL) || r; + r = ((glGetVertexAttribfvARB = (PFNGLGETVERTEXATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvARB")) == NULL) || r; + r = ((glGetVertexAttribivARB = (PFNGLGETVERTEXATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivARB")) == NULL) || r; + r = ((glIsProgramARB = (PFNGLISPROGRAMARBPROC)glewGetProcAddress((const GLubyte*)"glIsProgramARB")) == NULL) || r; + r = ((glProgramEnvParameter4dARB = (PFNGLPROGRAMENVPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dARB")) == NULL) || r; + r = ((glProgramEnvParameter4dvARB = (PFNGLPROGRAMENVPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4dvARB")) == NULL) || r; + r = ((glProgramEnvParameter4fARB = (PFNGLPROGRAMENVPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fARB")) == NULL) || r; + r = ((glProgramEnvParameter4fvARB = (PFNGLPROGRAMENVPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameter4fvARB")) == NULL) || r; + r = ((glProgramLocalParameter4dARB = (PFNGLPROGRAMLOCALPARAMETER4DARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dARB")) == NULL) || r; + r = ((glProgramLocalParameter4dvARB = (PFNGLPROGRAMLOCALPARAMETER4DVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4dvARB")) == NULL) || r; + r = ((glProgramLocalParameter4fARB = (PFNGLPROGRAMLOCALPARAMETER4FARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fARB")) == NULL) || r; + r = ((glProgramLocalParameter4fvARB = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameter4fvARB")) == NULL) || r; + r = ((glProgramStringARB = (PFNGLPROGRAMSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"glProgramStringARB")) == NULL) || r; + r = ((glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dARB")) == NULL) || r; + r = ((glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvARB")) == NULL) || r; + r = ((glVertexAttrib1fARB = (PFNGLVERTEXATTRIB1FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fARB")) == NULL) || r; + r = ((glVertexAttrib1fvARB = (PFNGLVERTEXATTRIB1FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvARB")) == NULL) || r; + r = ((glVertexAttrib1sARB = (PFNGLVERTEXATTRIB1SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sARB")) == NULL) || r; + r = ((glVertexAttrib1svARB = (PFNGLVERTEXATTRIB1SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svARB")) == NULL) || r; + r = ((glVertexAttrib2dARB = (PFNGLVERTEXATTRIB2DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dARB")) == NULL) || r; + r = ((glVertexAttrib2dvARB = (PFNGLVERTEXATTRIB2DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvARB")) == NULL) || r; + r = ((glVertexAttrib2fARB = (PFNGLVERTEXATTRIB2FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fARB")) == NULL) || r; + r = ((glVertexAttrib2fvARB = (PFNGLVERTEXATTRIB2FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvARB")) == NULL) || r; + r = ((glVertexAttrib2sARB = (PFNGLVERTEXATTRIB2SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sARB")) == NULL) || r; + r = ((glVertexAttrib2svARB = (PFNGLVERTEXATTRIB2SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svARB")) == NULL) || r; + r = ((glVertexAttrib3dARB = (PFNGLVERTEXATTRIB3DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dARB")) == NULL) || r; + r = ((glVertexAttrib3dvARB = (PFNGLVERTEXATTRIB3DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvARB")) == NULL) || r; + r = ((glVertexAttrib3fARB = (PFNGLVERTEXATTRIB3FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fARB")) == NULL) || r; + r = ((glVertexAttrib3fvARB = (PFNGLVERTEXATTRIB3FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvARB")) == NULL) || r; + r = ((glVertexAttrib3sARB = (PFNGLVERTEXATTRIB3SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sARB")) == NULL) || r; + r = ((glVertexAttrib3svARB = (PFNGLVERTEXATTRIB3SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svARB")) == NULL) || r; + r = ((glVertexAttrib4NbvARB = (PFNGLVERTEXATTRIB4NBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NbvARB")) == NULL) || r; + r = ((glVertexAttrib4NivARB = (PFNGLVERTEXATTRIB4NIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NivARB")) == NULL) || r; + r = ((glVertexAttrib4NsvARB = (PFNGLVERTEXATTRIB4NSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NsvARB")) == NULL) || r; + r = ((glVertexAttrib4NubARB = (PFNGLVERTEXATTRIB4NUBARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubARB")) == NULL) || r; + r = ((glVertexAttrib4NubvARB = (PFNGLVERTEXATTRIB4NUBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NubvARB")) == NULL) || r; + r = ((glVertexAttrib4NuivARB = (PFNGLVERTEXATTRIB4NUIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NuivARB")) == NULL) || r; + r = ((glVertexAttrib4NusvARB = (PFNGLVERTEXATTRIB4NUSVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4NusvARB")) == NULL) || r; + r = ((glVertexAttrib4bvARB = (PFNGLVERTEXATTRIB4BVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4bvARB")) == NULL) || r; + r = ((glVertexAttrib4dARB = (PFNGLVERTEXATTRIB4DARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dARB")) == NULL) || r; + r = ((glVertexAttrib4dvARB = (PFNGLVERTEXATTRIB4DVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvARB")) == NULL) || r; + r = ((glVertexAttrib4fARB = (PFNGLVERTEXATTRIB4FARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fARB")) == NULL) || r; + r = ((glVertexAttrib4fvARB = (PFNGLVERTEXATTRIB4FVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvARB")) == NULL) || r; + r = ((glVertexAttrib4ivARB = (PFNGLVERTEXATTRIB4IVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ivARB")) == NULL) || r; + r = ((glVertexAttrib4sARB = (PFNGLVERTEXATTRIB4SARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sARB")) == NULL) || r; + r = ((glVertexAttrib4svARB = (PFNGLVERTEXATTRIB4SVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svARB")) == NULL) || r; + r = ((glVertexAttrib4ubvARB = (PFNGLVERTEXATTRIB4UBVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvARB")) == NULL) || r; + r = ((glVertexAttrib4uivARB = (PFNGLVERTEXATTRIB4UIVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4uivARB")) == NULL) || r; + r = ((glVertexAttrib4usvARB = (PFNGLVERTEXATTRIB4USVARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4usvARB")) == NULL) || r; + r = ((glVertexAttribPointerARB = (PFNGLVERTEXATTRIBPOINTERARBPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_program */ + +#ifdef GL_ARB_vertex_shader + +static GLboolean _glewInit_GL_ARB_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glBindAttribLocationARB")) == NULL) || r; + r = ((glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"glGetActiveAttribARB")) == NULL) || r; + r = ((glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)glewGetProcAddress((const GLubyte*)"glGetAttribLocationARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_shader */ + +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + +static GLboolean _glewInit_GL_ARB_vertex_type_2_10_10_10_rev (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorP3ui = (PFNGLCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glColorP3ui")) == NULL) || r; + r = ((glColorP3uiv = (PFNGLCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP3uiv")) == NULL) || r; + r = ((glColorP4ui = (PFNGLCOLORP4UIPROC)glewGetProcAddress((const GLubyte*)"glColorP4ui")) == NULL) || r; + r = ((glColorP4uiv = (PFNGLCOLORP4UIVPROC)glewGetProcAddress((const GLubyte*)"glColorP4uiv")) == NULL) || r; + r = ((glMultiTexCoordP1ui = (PFNGLMULTITEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1ui")) == NULL) || r; + r = ((glMultiTexCoordP1uiv = (PFNGLMULTITEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP1uiv")) == NULL) || r; + r = ((glMultiTexCoordP2ui = (PFNGLMULTITEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2ui")) == NULL) || r; + r = ((glMultiTexCoordP2uiv = (PFNGLMULTITEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP2uiv")) == NULL) || r; + r = ((glMultiTexCoordP3ui = (PFNGLMULTITEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3ui")) == NULL) || r; + r = ((glMultiTexCoordP3uiv = (PFNGLMULTITEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP3uiv")) == NULL) || r; + r = ((glMultiTexCoordP4ui = (PFNGLMULTITEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4ui")) == NULL) || r; + r = ((glMultiTexCoordP4uiv = (PFNGLMULTITEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordP4uiv")) == NULL) || r; + r = ((glNormalP3ui = (PFNGLNORMALP3UIPROC)glewGetProcAddress((const GLubyte*)"glNormalP3ui")) == NULL) || r; + r = ((glNormalP3uiv = (PFNGLNORMALP3UIVPROC)glewGetProcAddress((const GLubyte*)"glNormalP3uiv")) == NULL) || r; + r = ((glSecondaryColorP3ui = (PFNGLSECONDARYCOLORP3UIPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3ui")) == NULL) || r; + r = ((glSecondaryColorP3uiv = (PFNGLSECONDARYCOLORP3UIVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorP3uiv")) == NULL) || r; + r = ((glTexCoordP1ui = (PFNGLTEXCOORDP1UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1ui")) == NULL) || r; + r = ((glTexCoordP1uiv = (PFNGLTEXCOORDP1UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP1uiv")) == NULL) || r; + r = ((glTexCoordP2ui = (PFNGLTEXCOORDP2UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2ui")) == NULL) || r; + r = ((glTexCoordP2uiv = (PFNGLTEXCOORDP2UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP2uiv")) == NULL) || r; + r = ((glTexCoordP3ui = (PFNGLTEXCOORDP3UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3ui")) == NULL) || r; + r = ((glTexCoordP3uiv = (PFNGLTEXCOORDP3UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP3uiv")) == NULL) || r; + r = ((glTexCoordP4ui = (PFNGLTEXCOORDP4UIPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4ui")) == NULL) || r; + r = ((glTexCoordP4uiv = (PFNGLTEXCOORDP4UIVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordP4uiv")) == NULL) || r; + r = ((glVertexAttribP1ui = (PFNGLVERTEXATTRIBP1UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1ui")) == NULL) || r; + r = ((glVertexAttribP1uiv = (PFNGLVERTEXATTRIBP1UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP1uiv")) == NULL) || r; + r = ((glVertexAttribP2ui = (PFNGLVERTEXATTRIBP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2ui")) == NULL) || r; + r = ((glVertexAttribP2uiv = (PFNGLVERTEXATTRIBP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP2uiv")) == NULL) || r; + r = ((glVertexAttribP3ui = (PFNGLVERTEXATTRIBP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3ui")) == NULL) || r; + r = ((glVertexAttribP3uiv = (PFNGLVERTEXATTRIBP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP3uiv")) == NULL) || r; + r = ((glVertexAttribP4ui = (PFNGLVERTEXATTRIBP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4ui")) == NULL) || r; + r = ((glVertexAttribP4uiv = (PFNGLVERTEXATTRIBP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribP4uiv")) == NULL) || r; + r = ((glVertexP2ui = (PFNGLVERTEXP2UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP2ui")) == NULL) || r; + r = ((glVertexP2uiv = (PFNGLVERTEXP2UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP2uiv")) == NULL) || r; + r = ((glVertexP3ui = (PFNGLVERTEXP3UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP3ui")) == NULL) || r; + r = ((glVertexP3uiv = (PFNGLVERTEXP3UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP3uiv")) == NULL) || r; + r = ((glVertexP4ui = (PFNGLVERTEXP4UIPROC)glewGetProcAddress((const GLubyte*)"glVertexP4ui")) == NULL) || r; + r = ((glVertexP4uiv = (PFNGLVERTEXP4UIVPROC)glewGetProcAddress((const GLubyte*)"glVertexP4uiv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +#ifdef GL_ARB_viewport_array + +static GLboolean _glewInit_GL_ARB_viewport_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDepthRangeArrayv = (PFNGLDEPTHRANGEARRAYVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeArrayv")) == NULL) || r; + r = ((glDepthRangeIndexed = (PFNGLDEPTHRANGEINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glDepthRangeIndexed")) == NULL) || r; + r = ((glGetDoublei_v = (PFNGLGETDOUBLEI_VPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_v")) == NULL) || r; + r = ((glGetFloati_v = (PFNGLGETFLOATI_VPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_v")) == NULL) || r; + r = ((glScissorArrayv = (PFNGLSCISSORARRAYVPROC)glewGetProcAddress((const GLubyte*)"glScissorArrayv")) == NULL) || r; + r = ((glScissorIndexed = (PFNGLSCISSORINDEXEDPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexed")) == NULL) || r; + r = ((glScissorIndexedv = (PFNGLSCISSORINDEXEDVPROC)glewGetProcAddress((const GLubyte*)"glScissorIndexedv")) == NULL) || r; + r = ((glViewportArrayv = (PFNGLVIEWPORTARRAYVPROC)glewGetProcAddress((const GLubyte*)"glViewportArrayv")) == NULL) || r; + r = ((glViewportIndexedf = (PFNGLVIEWPORTINDEXEDFPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedf")) == NULL) || r; + r = ((glViewportIndexedfv = (PFNGLVIEWPORTINDEXEDFVPROC)glewGetProcAddress((const GLubyte*)"glViewportIndexedfv")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_viewport_array */ + +#ifdef GL_ARB_window_pos + +static GLboolean _glewInit_GL_ARB_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glWindowPos2dARB = (PFNGLWINDOWPOS2DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dARB")) == NULL) || r; + r = ((glWindowPos2dvARB = (PFNGLWINDOWPOS2DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvARB")) == NULL) || r; + r = ((glWindowPos2fARB = (PFNGLWINDOWPOS2FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fARB")) == NULL) || r; + r = ((glWindowPos2fvARB = (PFNGLWINDOWPOS2FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvARB")) == NULL) || r; + r = ((glWindowPos2iARB = (PFNGLWINDOWPOS2IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iARB")) == NULL) || r; + r = ((glWindowPos2ivARB = (PFNGLWINDOWPOS2IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivARB")) == NULL) || r; + r = ((glWindowPos2sARB = (PFNGLWINDOWPOS2SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sARB")) == NULL) || r; + r = ((glWindowPos2svARB = (PFNGLWINDOWPOS2SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svARB")) == NULL) || r; + r = ((glWindowPos3dARB = (PFNGLWINDOWPOS3DARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dARB")) == NULL) || r; + r = ((glWindowPos3dvARB = (PFNGLWINDOWPOS3DVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvARB")) == NULL) || r; + r = ((glWindowPos3fARB = (PFNGLWINDOWPOS3FARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fARB")) == NULL) || r; + r = ((glWindowPos3fvARB = (PFNGLWINDOWPOS3FVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvARB")) == NULL) || r; + r = ((glWindowPos3iARB = (PFNGLWINDOWPOS3IARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iARB")) == NULL) || r; + r = ((glWindowPos3ivARB = (PFNGLWINDOWPOS3IVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivARB")) == NULL) || r; + r = ((glWindowPos3sARB = (PFNGLWINDOWPOS3SARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sARB")) == NULL) || r; + r = ((glWindowPos3svARB = (PFNGLWINDOWPOS3SVARBPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svARB")) == NULL) || r; + + return r; +} + +#endif /* GL_ARB_window_pos */ + +#ifdef GL_ATIX_point_sprites + +#endif /* GL_ATIX_point_sprites */ + +#ifdef GL_ATIX_texture_env_combine3 + +#endif /* GL_ATIX_texture_env_combine3 */ + +#ifdef GL_ATIX_texture_env_route + +#endif /* GL_ATIX_texture_env_route */ + +#ifdef GL_ATIX_vertex_shader_output_point_size + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +#ifdef GL_ATI_draw_buffers + +static GLboolean _glewInit_GL_ATI_draw_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawBuffersATI = (PFNGLDRAWBUFFERSATIPROC)glewGetProcAddress((const GLubyte*)"glDrawBuffersATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_draw_buffers */ + +#ifdef GL_ATI_element_array + +static GLboolean _glewInit_GL_ATI_element_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawElementArrayATI = (PFNGLDRAWELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawElementArrayATI")) == NULL) || r; + r = ((glDrawRangeElementArrayATI = (PFNGLDRAWRANGEELEMENTARRAYATIPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementArrayATI")) == NULL) || r; + r = ((glElementPointerATI = (PFNGLELEMENTPOINTERATIPROC)glewGetProcAddress((const GLubyte*)"glElementPointerATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_element_array */ + +#ifdef GL_ATI_envmap_bumpmap + +static GLboolean _glewInit_GL_ATI_envmap_bumpmap (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexBumpParameterfvATI = (PFNGLGETTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterfvATI")) == NULL) || r; + r = ((glGetTexBumpParameterivATI = (PFNGLGETTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetTexBumpParameterivATI")) == NULL) || r; + r = ((glTexBumpParameterfvATI = (PFNGLTEXBUMPPARAMETERFVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterfvATI")) == NULL) || r; + r = ((glTexBumpParameterivATI = (PFNGLTEXBUMPPARAMETERIVATIPROC)glewGetProcAddress((const GLubyte*)"glTexBumpParameterivATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_envmap_bumpmap */ + +#ifdef GL_ATI_fragment_shader + +static GLboolean _glewInit_GL_ATI_fragment_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAlphaFragmentOp1ATI = (PFNGLALPHAFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp1ATI")) == NULL) || r; + r = ((glAlphaFragmentOp2ATI = (PFNGLALPHAFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp2ATI")) == NULL) || r; + r = ((glAlphaFragmentOp3ATI = (PFNGLALPHAFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glAlphaFragmentOp3ATI")) == NULL) || r; + r = ((glBeginFragmentShaderATI = (PFNGLBEGINFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBeginFragmentShaderATI")) == NULL) || r; + r = ((glBindFragmentShaderATI = (PFNGLBINDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glBindFragmentShaderATI")) == NULL) || r; + r = ((glColorFragmentOp1ATI = (PFNGLCOLORFRAGMENTOP1ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp1ATI")) == NULL) || r; + r = ((glColorFragmentOp2ATI = (PFNGLCOLORFRAGMENTOP2ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp2ATI")) == NULL) || r; + r = ((glColorFragmentOp3ATI = (PFNGLCOLORFRAGMENTOP3ATIPROC)glewGetProcAddress((const GLubyte*)"glColorFragmentOp3ATI")) == NULL) || r; + r = ((glDeleteFragmentShaderATI = (PFNGLDELETEFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glDeleteFragmentShaderATI")) == NULL) || r; + r = ((glEndFragmentShaderATI = (PFNGLENDFRAGMENTSHADERATIPROC)glewGetProcAddress((const GLubyte*)"glEndFragmentShaderATI")) == NULL) || r; + r = ((glGenFragmentShadersATI = (PFNGLGENFRAGMENTSHADERSATIPROC)glewGetProcAddress((const GLubyte*)"glGenFragmentShadersATI")) == NULL) || r; + r = ((glPassTexCoordATI = (PFNGLPASSTEXCOORDATIPROC)glewGetProcAddress((const GLubyte*)"glPassTexCoordATI")) == NULL) || r; + r = ((glSampleMapATI = (PFNGLSAMPLEMAPATIPROC)glewGetProcAddress((const GLubyte*)"glSampleMapATI")) == NULL) || r; + r = ((glSetFragmentShaderConstantATI = (PFNGLSETFRAGMENTSHADERCONSTANTATIPROC)glewGetProcAddress((const GLubyte*)"glSetFragmentShaderConstantATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_fragment_shader */ + +#ifdef GL_ATI_map_object_buffer + +static GLboolean _glewInit_GL_ATI_map_object_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMapObjectBufferATI = (PFNGLMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glMapObjectBufferATI")) == NULL) || r; + r = ((glUnmapObjectBufferATI = (PFNGLUNMAPOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUnmapObjectBufferATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_map_object_buffer */ + +#ifdef GL_ATI_meminfo + +#endif /* GL_ATI_meminfo */ + +#ifdef GL_ATI_pn_triangles + +static GLboolean _glewInit_GL_ATI_pn_triangles (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPNTrianglesfATI = (PFNGLPNTRIANGLESFATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesfATI")) == NULL) || r; + r = ((glPNTrianglesiATI = (PFNGLPNTRIANGLESIATIPROC)glewGetProcAddress((const GLubyte*)"glPNTrianglesiATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_pn_triangles */ + +#ifdef GL_ATI_separate_stencil + +static GLboolean _glewInit_GL_ATI_separate_stencil (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStencilFuncSeparateATI = (PFNGLSTENCILFUNCSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilFuncSeparateATI")) == NULL) || r; + r = ((glStencilOpSeparateATI = (PFNGLSTENCILOPSEPARATEATIPROC)glewGetProcAddress((const GLubyte*)"glStencilOpSeparateATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_separate_stencil */ + +#ifdef GL_ATI_shader_texture_lod + +#endif /* GL_ATI_shader_texture_lod */ + +#ifdef GL_ATI_text_fragment_shader + +#endif /* GL_ATI_text_fragment_shader */ + +#ifdef GL_ATI_texture_compression_3dc + +#endif /* GL_ATI_texture_compression_3dc */ + +#ifdef GL_ATI_texture_env_combine3 + +#endif /* GL_ATI_texture_env_combine3 */ + +#ifdef GL_ATI_texture_float + +#endif /* GL_ATI_texture_float */ + +#ifdef GL_ATI_texture_mirror_once + +#endif /* GL_ATI_texture_mirror_once */ + +#ifdef GL_ATI_vertex_array_object + +static GLboolean _glewInit_GL_ATI_vertex_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glArrayObjectATI = (PFNGLARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glArrayObjectATI")) == NULL) || r; + r = ((glFreeObjectBufferATI = (PFNGLFREEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glFreeObjectBufferATI")) == NULL) || r; + r = ((glGetArrayObjectfvATI = (PFNGLGETARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectfvATI")) == NULL) || r; + r = ((glGetArrayObjectivATI = (PFNGLGETARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetArrayObjectivATI")) == NULL) || r; + r = ((glGetObjectBufferfvATI = (PFNGLGETOBJECTBUFFERFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferfvATI")) == NULL) || r; + r = ((glGetObjectBufferivATI = (PFNGLGETOBJECTBUFFERIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetObjectBufferivATI")) == NULL) || r; + r = ((glGetVariantArrayObjectfvATI = (PFNGLGETVARIANTARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectfvATI")) == NULL) || r; + r = ((glGetVariantArrayObjectivATI = (PFNGLGETVARIANTARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVariantArrayObjectivATI")) == NULL) || r; + r = ((glIsObjectBufferATI = (PFNGLISOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glIsObjectBufferATI")) == NULL) || r; + r = ((glNewObjectBufferATI = (PFNGLNEWOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glNewObjectBufferATI")) == NULL) || r; + r = ((glUpdateObjectBufferATI = (PFNGLUPDATEOBJECTBUFFERATIPROC)glewGetProcAddress((const GLubyte*)"glUpdateObjectBufferATI")) == NULL) || r; + r = ((glVariantArrayObjectATI = (PFNGLVARIANTARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVariantArrayObjectATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_array_object */ + +#ifdef GL_ATI_vertex_attrib_array_object + +static GLboolean _glewInit_GL_ATI_vertex_attrib_array_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribArrayObjectfvATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectfvATI")) == NULL) || r; + r = ((glGetVertexAttribArrayObjectivATI = (PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribArrayObjectivATI")) == NULL) || r; + r = ((glVertexAttribArrayObjectATI = (PFNGLVERTEXATTRIBARRAYOBJECTATIPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribArrayObjectATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_attrib_array_object */ + +#ifdef GL_ATI_vertex_streams + +static GLboolean _glewInit_GL_ATI_vertex_streams (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClientActiveVertexStreamATI = (PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC)glewGetProcAddress((const GLubyte*)"glClientActiveVertexStreamATI")) == NULL) || r; + r = ((glNormalStream3bATI = (PFNGLNORMALSTREAM3BATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bATI")) == NULL) || r; + r = ((glNormalStream3bvATI = (PFNGLNORMALSTREAM3BVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3bvATI")) == NULL) || r; + r = ((glNormalStream3dATI = (PFNGLNORMALSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dATI")) == NULL) || r; + r = ((glNormalStream3dvATI = (PFNGLNORMALSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3dvATI")) == NULL) || r; + r = ((glNormalStream3fATI = (PFNGLNORMALSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fATI")) == NULL) || r; + r = ((glNormalStream3fvATI = (PFNGLNORMALSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3fvATI")) == NULL) || r; + r = ((glNormalStream3iATI = (PFNGLNORMALSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3iATI")) == NULL) || r; + r = ((glNormalStream3ivATI = (PFNGLNORMALSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3ivATI")) == NULL) || r; + r = ((glNormalStream3sATI = (PFNGLNORMALSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3sATI")) == NULL) || r; + r = ((glNormalStream3svATI = (PFNGLNORMALSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glNormalStream3svATI")) == NULL) || r; + r = ((glVertexBlendEnvfATI = (PFNGLVERTEXBLENDENVFATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnvfATI")) == NULL) || r; + r = ((glVertexBlendEnviATI = (PFNGLVERTEXBLENDENVIATIPROC)glewGetProcAddress((const GLubyte*)"glVertexBlendEnviATI")) == NULL) || r; + r = ((glVertexStream2dATI = (PFNGLVERTEXSTREAM2DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dATI")) == NULL) || r; + r = ((glVertexStream2dvATI = (PFNGLVERTEXSTREAM2DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2dvATI")) == NULL) || r; + r = ((glVertexStream2fATI = (PFNGLVERTEXSTREAM2FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fATI")) == NULL) || r; + r = ((glVertexStream2fvATI = (PFNGLVERTEXSTREAM2FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2fvATI")) == NULL) || r; + r = ((glVertexStream2iATI = (PFNGLVERTEXSTREAM2IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2iATI")) == NULL) || r; + r = ((glVertexStream2ivATI = (PFNGLVERTEXSTREAM2IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2ivATI")) == NULL) || r; + r = ((glVertexStream2sATI = (PFNGLVERTEXSTREAM2SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2sATI")) == NULL) || r; + r = ((glVertexStream2svATI = (PFNGLVERTEXSTREAM2SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream2svATI")) == NULL) || r; + r = ((glVertexStream3dATI = (PFNGLVERTEXSTREAM3DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dATI")) == NULL) || r; + r = ((glVertexStream3dvATI = (PFNGLVERTEXSTREAM3DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3dvATI")) == NULL) || r; + r = ((glVertexStream3fATI = (PFNGLVERTEXSTREAM3FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fATI")) == NULL) || r; + r = ((glVertexStream3fvATI = (PFNGLVERTEXSTREAM3FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3fvATI")) == NULL) || r; + r = ((glVertexStream3iATI = (PFNGLVERTEXSTREAM3IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3iATI")) == NULL) || r; + r = ((glVertexStream3ivATI = (PFNGLVERTEXSTREAM3IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3ivATI")) == NULL) || r; + r = ((glVertexStream3sATI = (PFNGLVERTEXSTREAM3SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3sATI")) == NULL) || r; + r = ((glVertexStream3svATI = (PFNGLVERTEXSTREAM3SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream3svATI")) == NULL) || r; + r = ((glVertexStream4dATI = (PFNGLVERTEXSTREAM4DATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dATI")) == NULL) || r; + r = ((glVertexStream4dvATI = (PFNGLVERTEXSTREAM4DVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4dvATI")) == NULL) || r; + r = ((glVertexStream4fATI = (PFNGLVERTEXSTREAM4FATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fATI")) == NULL) || r; + r = ((glVertexStream4fvATI = (PFNGLVERTEXSTREAM4FVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4fvATI")) == NULL) || r; + r = ((glVertexStream4iATI = (PFNGLVERTEXSTREAM4IATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4iATI")) == NULL) || r; + r = ((glVertexStream4ivATI = (PFNGLVERTEXSTREAM4IVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4ivATI")) == NULL) || r; + r = ((glVertexStream4sATI = (PFNGLVERTEXSTREAM4SATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4sATI")) == NULL) || r; + r = ((glVertexStream4svATI = (PFNGLVERTEXSTREAM4SVATIPROC)glewGetProcAddress((const GLubyte*)"glVertexStream4svATI")) == NULL) || r; + + return r; +} + +#endif /* GL_ATI_vertex_streams */ + +#ifdef GL_EXT_422_pixels + +#endif /* GL_EXT_422_pixels */ + +#ifdef GL_EXT_Cg_shader + +#endif /* GL_EXT_Cg_shader */ + +#ifdef GL_EXT_abgr + +#endif /* GL_EXT_abgr */ + +#ifdef GL_EXT_bgra + +#endif /* GL_EXT_bgra */ + +#ifdef GL_EXT_bindable_uniform + +static GLboolean _glewInit_GL_EXT_bindable_uniform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformBufferSizeEXT = (PFNGLGETUNIFORMBUFFERSIZEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformBufferSizeEXT")) == NULL) || r; + r = ((glGetUniformOffsetEXT = (PFNGLGETUNIFORMOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformOffsetEXT")) == NULL) || r; + r = ((glUniformBufferEXT = (PFNGLUNIFORMBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUniformBufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_bindable_uniform */ + +#ifdef GL_EXT_blend_color + +static GLboolean _glewInit_GL_EXT_blend_color (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendColorEXT = (PFNGLBLENDCOLOREXTPROC)glewGetProcAddress((const GLubyte*)"glBlendColorEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_color */ + +#ifdef GL_EXT_blend_equation_separate + +static GLboolean _glewInit_GL_EXT_blend_equation_separate (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationSeparateEXT = (PFNGLBLENDEQUATIONSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationSeparateEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_equation_separate */ + +#ifdef GL_EXT_blend_func_separate + +static GLboolean _glewInit_GL_EXT_blend_func_separate (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendFuncSeparateEXT = (PFNGLBLENDFUNCSEPARATEEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendFuncSeparateEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_func_separate */ + +#ifdef GL_EXT_blend_logic_op + +#endif /* GL_EXT_blend_logic_op */ + +#ifdef GL_EXT_blend_minmax + +static GLboolean _glewInit_GL_EXT_blend_minmax (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlendEquationEXT = (PFNGLBLENDEQUATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBlendEquationEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_blend_minmax */ + +#ifdef GL_EXT_blend_subtract + +#endif /* GL_EXT_blend_subtract */ + +#ifdef GL_EXT_clip_volume_hint + +#endif /* GL_EXT_clip_volume_hint */ + +#ifdef GL_EXT_cmyka + +#endif /* GL_EXT_cmyka */ + +#ifdef GL_EXT_color_subtable + +static GLboolean _glewInit_GL_EXT_color_subtable (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorSubTableEXT = (PFNGLCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorSubTableEXT")) == NULL) || r; + r = ((glCopyColorSubTableEXT = (PFNGLCOPYCOLORSUBTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyColorSubTableEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_color_subtable */ + +#ifdef GL_EXT_compiled_vertex_array + +static GLboolean _glewInit_GL_EXT_compiled_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glLockArraysEXT = (PFNGLLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glLockArraysEXT")) == NULL) || r; + r = ((glUnlockArraysEXT = (PFNGLUNLOCKARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glUnlockArraysEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_compiled_vertex_array */ + +#ifdef GL_EXT_convolution + +static GLboolean _glewInit_GL_EXT_convolution (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glConvolutionFilter1DEXT = (PFNGLCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter1DEXT")) == NULL) || r; + r = ((glConvolutionFilter2DEXT = (PFNGLCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionFilter2DEXT")) == NULL) || r; + r = ((glConvolutionParameterfEXT = (PFNGLCONVOLUTIONPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfEXT")) == NULL) || r; + r = ((glConvolutionParameterfvEXT = (PFNGLCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterfvEXT")) == NULL) || r; + r = ((glConvolutionParameteriEXT = (PFNGLCONVOLUTIONPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameteriEXT")) == NULL) || r; + r = ((glConvolutionParameterivEXT = (PFNGLCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glConvolutionParameterivEXT")) == NULL) || r; + r = ((glCopyConvolutionFilter1DEXT = (PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter1DEXT")) == NULL) || r; + r = ((glCopyConvolutionFilter2DEXT = (PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyConvolutionFilter2DEXT")) == NULL) || r; + r = ((glGetConvolutionFilterEXT = (PFNGLGETCONVOLUTIONFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionFilterEXT")) == NULL) || r; + r = ((glGetConvolutionParameterfvEXT = (PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterfvEXT")) == NULL) || r; + r = ((glGetConvolutionParameterivEXT = (PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetConvolutionParameterivEXT")) == NULL) || r; + r = ((glGetSeparableFilterEXT = (PFNGLGETSEPARABLEFILTEREXTPROC)glewGetProcAddress((const GLubyte*)"glGetSeparableFilterEXT")) == NULL) || r; + r = ((glSeparableFilter2DEXT = (PFNGLSEPARABLEFILTER2DEXTPROC)glewGetProcAddress((const GLubyte*)"glSeparableFilter2DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_convolution */ + +#ifdef GL_EXT_coordinate_frame + +static GLboolean _glewInit_GL_EXT_coordinate_frame (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBinormalPointerEXT = (PFNGLBINORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glBinormalPointerEXT")) == NULL) || r; + r = ((glTangentPointerEXT = (PFNGLTANGENTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTangentPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_coordinate_frame */ + +#ifdef GL_EXT_copy_texture + +static GLboolean _glewInit_GL_EXT_copy_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyTexImage1DEXT = (PFNGLCOPYTEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage1DEXT")) == NULL) || r; + r = ((glCopyTexImage2DEXT = (PFNGLCOPYTEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexImage2DEXT")) == NULL) || r; + r = ((glCopyTexSubImage1DEXT = (PFNGLCOPYTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage1DEXT")) == NULL) || r; + r = ((glCopyTexSubImage2DEXT = (PFNGLCOPYTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage2DEXT")) == NULL) || r; + r = ((glCopyTexSubImage3DEXT = (PFNGLCOPYTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTexSubImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_copy_texture */ + +#ifdef GL_EXT_cull_vertex + +static GLboolean _glewInit_GL_EXT_cull_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCullParameterdvEXT = (PFNGLCULLPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterdvEXT")) == NULL) || r; + r = ((glCullParameterfvEXT = (PFNGLCULLPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glCullParameterfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_cull_vertex */ + +#ifdef GL_EXT_depth_bounds_test + +static GLboolean _glewInit_GL_EXT_depth_bounds_test (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDepthBoundsEXT = (PFNGLDEPTHBOUNDSEXTPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_depth_bounds_test */ + +#ifdef GL_EXT_direct_state_access + +static GLboolean _glewInit_GL_EXT_direct_state_access (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindMultiTextureEXT = (PFNGLBINDMULTITEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindMultiTextureEXT")) == NULL) || r; + r = ((glCheckNamedFramebufferStatusEXT = (PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckNamedFramebufferStatusEXT")) == NULL) || r; + r = ((glClientAttribDefaultEXT = (PFNGLCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glClientAttribDefaultEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage1DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage1DEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage2DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage2DEXT")) == NULL) || r; + r = ((glCompressedMultiTexImage3DEXT = (PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexImage3DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage1DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage2DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glCompressedMultiTexSubImage3DEXT = (PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glCompressedTextureImage1DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage1DEXT")) == NULL) || r; + r = ((glCompressedTextureImage2DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage2DEXT")) == NULL) || r; + r = ((glCompressedTextureImage3DEXT = (PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureImage3DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage1DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage1DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage2DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage2DEXT")) == NULL) || r; + r = ((glCompressedTextureSubImage3DEXT = (PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCompressedTextureSubImage3DEXT")) == NULL) || r; + r = ((glCopyMultiTexImage1DEXT = (PFNGLCOPYMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage1DEXT")) == NULL) || r; + r = ((glCopyMultiTexImage2DEXT = (PFNGLCOPYMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexImage2DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage1DEXT = (PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage2DEXT = (PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glCopyMultiTexSubImage3DEXT = (PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glCopyTextureImage1DEXT = (PFNGLCOPYTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage1DEXT")) == NULL) || r; + r = ((glCopyTextureImage2DEXT = (PFNGLCOPYTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureImage2DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage1DEXT = (PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage1DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage2DEXT = (PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage2DEXT")) == NULL) || r; + r = ((glCopyTextureSubImage3DEXT = (PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glCopyTextureSubImage3DEXT")) == NULL) || r; + r = ((glDisableClientStateIndexedEXT = (PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateIndexedEXT")) == NULL) || r; + r = ((glDisableClientStateiEXT = (PFNGLDISABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableClientStateiEXT")) == NULL) || r; + r = ((glDisableVertexArrayAttribEXT = (PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayAttribEXT")) == NULL) || r; + r = ((glDisableVertexArrayEXT = (PFNGLDISABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVertexArrayEXT")) == NULL) || r; + r = ((glEnableClientStateIndexedEXT = (PFNGLENABLECLIENTSTATEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateIndexedEXT")) == NULL) || r; + r = ((glEnableClientStateiEXT = (PFNGLENABLECLIENTSTATEIEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableClientStateiEXT")) == NULL) || r; + r = ((glEnableVertexArrayAttribEXT = (PFNGLENABLEVERTEXARRAYATTRIBEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayAttribEXT")) == NULL) || r; + r = ((glEnableVertexArrayEXT = (PFNGLENABLEVERTEXARRAYEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVertexArrayEXT")) == NULL) || r; + r = ((glFlushMappedNamedBufferRangeEXT = (PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glFlushMappedNamedBufferRangeEXT")) == NULL) || r; + r = ((glFramebufferDrawBufferEXT = (PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBufferEXT")) == NULL) || r; + r = ((glFramebufferDrawBuffersEXT = (PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferDrawBuffersEXT")) == NULL) || r; + r = ((glFramebufferReadBufferEXT = (PFNGLFRAMEBUFFERREADBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferReadBufferEXT")) == NULL) || r; + r = ((glGenerateMultiTexMipmapEXT = (PFNGLGENERATEMULTITEXMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMultiTexMipmapEXT")) == NULL) || r; + r = ((glGenerateTextureMipmapEXT = (PFNGLGENERATETEXTUREMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateTextureMipmapEXT")) == NULL) || r; + r = ((glGetCompressedMultiTexImageEXT = (PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedMultiTexImageEXT")) == NULL) || r; + r = ((glGetCompressedTextureImageEXT = (PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetCompressedTextureImageEXT")) == NULL) || r; + r = ((glGetDoubleIndexedvEXT = (PFNGLGETDOUBLEINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoubleIndexedvEXT")) == NULL) || r; + r = ((glGetDoublei_vEXT = (PFNGLGETDOUBLEI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetDoublei_vEXT")) == NULL) || r; + r = ((glGetFloatIndexedvEXT = (PFNGLGETFLOATINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloatIndexedvEXT")) == NULL) || r; + r = ((glGetFloati_vEXT = (PFNGLGETFLOATI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFloati_vEXT")) == NULL) || r; + r = ((glGetFramebufferParameterivEXT = (PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferParameterivEXT")) == NULL) || r; + r = ((glGetMultiTexEnvfvEXT = (PFNGLGETMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvfvEXT")) == NULL) || r; + r = ((glGetMultiTexEnvivEXT = (PFNGLGETMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexEnvivEXT")) == NULL) || r; + r = ((glGetMultiTexGendvEXT = (PFNGLGETMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGendvEXT")) == NULL) || r; + r = ((glGetMultiTexGenfvEXT = (PFNGLGETMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenfvEXT")) == NULL) || r; + r = ((glGetMultiTexGenivEXT = (PFNGLGETMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexGenivEXT")) == NULL) || r; + r = ((glGetMultiTexImageEXT = (PFNGLGETMULTITEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexImageEXT")) == NULL) || r; + r = ((glGetMultiTexLevelParameterfvEXT = (PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterfvEXT")) == NULL) || r; + r = ((glGetMultiTexLevelParameterivEXT = (PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexLevelParameterivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterIivEXT = (PFNGLGETMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterIuivEXT = (PFNGLGETMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterIuivEXT")) == NULL) || r; + r = ((glGetMultiTexParameterfvEXT = (PFNGLGETMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterfvEXT")) == NULL) || r; + r = ((glGetMultiTexParameterivEXT = (PFNGLGETMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMultiTexParameterivEXT")) == NULL) || r; + r = ((glGetNamedBufferParameterivEXT = (PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterivEXT")) == NULL) || r; + r = ((glGetNamedBufferPointervEXT = (PFNGLGETNAMEDBUFFERPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferPointervEXT")) == NULL) || r; + r = ((glGetNamedBufferSubDataEXT = (PFNGLGETNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferSubDataEXT")) == NULL) || r; + r = ((glGetNamedFramebufferAttachmentParameterivEXT = (PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedFramebufferAttachmentParameterivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterIivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterIuivEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterIuivEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterdvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterdvEXT")) == NULL) || r; + r = ((glGetNamedProgramLocalParameterfvEXT = (PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramLocalParameterfvEXT")) == NULL) || r; + r = ((glGetNamedProgramStringEXT = (PFNGLGETNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramStringEXT")) == NULL) || r; + r = ((glGetNamedProgramivEXT = (PFNGLGETNAMEDPROGRAMIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedProgramivEXT")) == NULL) || r; + r = ((glGetNamedRenderbufferParameterivEXT = (PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetNamedRenderbufferParameterivEXT")) == NULL) || r; + r = ((glGetPointerIndexedvEXT = (PFNGLGETPOINTERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointerIndexedvEXT")) == NULL) || r; + r = ((glGetPointeri_vEXT = (PFNGLGETPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPointeri_vEXT")) == NULL) || r; + r = ((glGetTextureImageEXT = (PFNGLGETTEXTUREIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureImageEXT")) == NULL) || r; + r = ((glGetTextureLevelParameterfvEXT = (PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterfvEXT")) == NULL) || r; + r = ((glGetTextureLevelParameterivEXT = (PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureLevelParameterivEXT")) == NULL) || r; + r = ((glGetTextureParameterIivEXT = (PFNGLGETTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIivEXT")) == NULL) || r; + r = ((glGetTextureParameterIuivEXT = (PFNGLGETTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterIuivEXT")) == NULL) || r; + r = ((glGetTextureParameterfvEXT = (PFNGLGETTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterfvEXT")) == NULL) || r; + r = ((glGetTextureParameterivEXT = (PFNGLGETTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTextureParameterivEXT")) == NULL) || r; + r = ((glGetVertexArrayIntegeri_vEXT = (PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegeri_vEXT")) == NULL) || r; + r = ((glGetVertexArrayIntegervEXT = (PFNGLGETVERTEXARRAYINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayIntegervEXT")) == NULL) || r; + r = ((glGetVertexArrayPointeri_vEXT = (PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointeri_vEXT")) == NULL) || r; + r = ((glGetVertexArrayPointervEXT = (PFNGLGETVERTEXARRAYPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexArrayPointervEXT")) == NULL) || r; + r = ((glMapNamedBufferEXT = (PFNGLMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferEXT")) == NULL) || r; + r = ((glMapNamedBufferRangeEXT = (PFNGLMAPNAMEDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glMapNamedBufferRangeEXT")) == NULL) || r; + r = ((glMatrixFrustumEXT = (PFNGLMATRIXFRUSTUMEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixFrustumEXT")) == NULL) || r; + r = ((glMatrixLoadIdentityEXT = (PFNGLMATRIXLOADIDENTITYEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadIdentityEXT")) == NULL) || r; + r = ((glMatrixLoadTransposedEXT = (PFNGLMATRIXLOADTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposedEXT")) == NULL) || r; + r = ((glMatrixLoadTransposefEXT = (PFNGLMATRIXLOADTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadTransposefEXT")) == NULL) || r; + r = ((glMatrixLoaddEXT = (PFNGLMATRIXLOADDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoaddEXT")) == NULL) || r; + r = ((glMatrixLoadfEXT = (PFNGLMATRIXLOADFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixLoadfEXT")) == NULL) || r; + r = ((glMatrixMultTransposedEXT = (PFNGLMATRIXMULTTRANSPOSEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposedEXT")) == NULL) || r; + r = ((glMatrixMultTransposefEXT = (PFNGLMATRIXMULTTRANSPOSEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultTransposefEXT")) == NULL) || r; + r = ((glMatrixMultdEXT = (PFNGLMATRIXMULTDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultdEXT")) == NULL) || r; + r = ((glMatrixMultfEXT = (PFNGLMATRIXMULTFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixMultfEXT")) == NULL) || r; + r = ((glMatrixOrthoEXT = (PFNGLMATRIXORTHOEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixOrthoEXT")) == NULL) || r; + r = ((glMatrixPopEXT = (PFNGLMATRIXPOPEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPopEXT")) == NULL) || r; + r = ((glMatrixPushEXT = (PFNGLMATRIXPUSHEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixPushEXT")) == NULL) || r; + r = ((glMatrixRotatedEXT = (PFNGLMATRIXROTATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatedEXT")) == NULL) || r; + r = ((glMatrixRotatefEXT = (PFNGLMATRIXROTATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixRotatefEXT")) == NULL) || r; + r = ((glMatrixScaledEXT = (PFNGLMATRIXSCALEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScaledEXT")) == NULL) || r; + r = ((glMatrixScalefEXT = (PFNGLMATRIXSCALEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixScalefEXT")) == NULL) || r; + r = ((glMatrixTranslatedEXT = (PFNGLMATRIXTRANSLATEDEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatedEXT")) == NULL) || r; + r = ((glMatrixTranslatefEXT = (PFNGLMATRIXTRANSLATEFEXTPROC)glewGetProcAddress((const GLubyte*)"glMatrixTranslatefEXT")) == NULL) || r; + r = ((glMultiTexBufferEXT = (PFNGLMULTITEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexBufferEXT")) == NULL) || r; + r = ((glMultiTexCoordPointerEXT = (PFNGLMULTITEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoordPointerEXT")) == NULL) || r; + r = ((glMultiTexEnvfEXT = (PFNGLMULTITEXENVFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfEXT")) == NULL) || r; + r = ((glMultiTexEnvfvEXT = (PFNGLMULTITEXENVFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvfvEXT")) == NULL) || r; + r = ((glMultiTexEnviEXT = (PFNGLMULTITEXENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnviEXT")) == NULL) || r; + r = ((glMultiTexEnvivEXT = (PFNGLMULTITEXENVIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexEnvivEXT")) == NULL) || r; + r = ((glMultiTexGendEXT = (PFNGLMULTITEXGENDEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendEXT")) == NULL) || r; + r = ((glMultiTexGendvEXT = (PFNGLMULTITEXGENDVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGendvEXT")) == NULL) || r; + r = ((glMultiTexGenfEXT = (PFNGLMULTITEXGENFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfEXT")) == NULL) || r; + r = ((glMultiTexGenfvEXT = (PFNGLMULTITEXGENFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenfvEXT")) == NULL) || r; + r = ((glMultiTexGeniEXT = (PFNGLMULTITEXGENIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGeniEXT")) == NULL) || r; + r = ((glMultiTexGenivEXT = (PFNGLMULTITEXGENIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexGenivEXT")) == NULL) || r; + r = ((glMultiTexImage1DEXT = (PFNGLMULTITEXIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage1DEXT")) == NULL) || r; + r = ((glMultiTexImage2DEXT = (PFNGLMULTITEXIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage2DEXT")) == NULL) || r; + r = ((glMultiTexImage3DEXT = (PFNGLMULTITEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexImage3DEXT")) == NULL) || r; + r = ((glMultiTexParameterIivEXT = (PFNGLMULTITEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIivEXT")) == NULL) || r; + r = ((glMultiTexParameterIuivEXT = (PFNGLMULTITEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterIuivEXT")) == NULL) || r; + r = ((glMultiTexParameterfEXT = (PFNGLMULTITEXPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfEXT")) == NULL) || r; + r = ((glMultiTexParameterfvEXT = (PFNGLMULTITEXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterfvEXT")) == NULL) || r; + r = ((glMultiTexParameteriEXT = (PFNGLMULTITEXPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameteriEXT")) == NULL) || r; + r = ((glMultiTexParameterivEXT = (PFNGLMULTITEXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexParameterivEXT")) == NULL) || r; + r = ((glMultiTexRenderbufferEXT = (PFNGLMULTITEXRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexRenderbufferEXT")) == NULL) || r; + r = ((glMultiTexSubImage1DEXT = (PFNGLMULTITEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage1DEXT")) == NULL) || r; + r = ((glMultiTexSubImage2DEXT = (PFNGLMULTITEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage2DEXT")) == NULL) || r; + r = ((glMultiTexSubImage3DEXT = (PFNGLMULTITEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiTexSubImage3DEXT")) == NULL) || r; + r = ((glNamedBufferDataEXT = (PFNGLNAMEDBUFFERDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferDataEXT")) == NULL) || r; + r = ((glNamedBufferSubDataEXT = (PFNGLNAMEDBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedBufferSubDataEXT")) == NULL) || r; + r = ((glNamedCopyBufferSubDataEXT = (PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedCopyBufferSubDataEXT")) == NULL) || r; + r = ((glNamedFramebufferRenderbufferEXT = (PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferRenderbufferEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture1DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture1DEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture2DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture2DEXT")) == NULL) || r; + r = ((glNamedFramebufferTexture3DEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTexture3DEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureFaceEXT = (PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureFaceEXT")) == NULL) || r; + r = ((glNamedFramebufferTextureLayerEXT = (PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glNamedFramebufferTextureLayerEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4dEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4dvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4dvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4fEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameter4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameter4fvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4iEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4iEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4ivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4uiEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uiEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameterI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameterI4uivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParameters4fvEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParameters4fvEXT")) == NULL) || r; + r = ((glNamedProgramLocalParametersI4ivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4ivEXT")) == NULL) || r; + r = ((glNamedProgramLocalParametersI4uivEXT = (PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramLocalParametersI4uivEXT")) == NULL) || r; + r = ((glNamedProgramStringEXT = (PFNGLNAMEDPROGRAMSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedProgramStringEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisampleCoverageEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleCoverageEXT")) == NULL) || r; + r = ((glNamedRenderbufferStorageMultisampleEXT = (PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glNamedRenderbufferStorageMultisampleEXT")) == NULL) || r; + r = ((glProgramUniform1fEXT = (PFNGLPROGRAMUNIFORM1FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fEXT")) == NULL) || r; + r = ((glProgramUniform1fvEXT = (PFNGLPROGRAMUNIFORM1FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1fvEXT")) == NULL) || r; + r = ((glProgramUniform1iEXT = (PFNGLPROGRAMUNIFORM1IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1iEXT")) == NULL) || r; + r = ((glProgramUniform1ivEXT = (PFNGLPROGRAMUNIFORM1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ivEXT")) == NULL) || r; + r = ((glProgramUniform1uiEXT = (PFNGLPROGRAMUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uiEXT")) == NULL) || r; + r = ((glProgramUniform1uivEXT = (PFNGLPROGRAMUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1uivEXT")) == NULL) || r; + r = ((glProgramUniform2fEXT = (PFNGLPROGRAMUNIFORM2FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fEXT")) == NULL) || r; + r = ((glProgramUniform2fvEXT = (PFNGLPROGRAMUNIFORM2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2fvEXT")) == NULL) || r; + r = ((glProgramUniform2iEXT = (PFNGLPROGRAMUNIFORM2IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2iEXT")) == NULL) || r; + r = ((glProgramUniform2ivEXT = (PFNGLPROGRAMUNIFORM2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ivEXT")) == NULL) || r; + r = ((glProgramUniform2uiEXT = (PFNGLPROGRAMUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uiEXT")) == NULL) || r; + r = ((glProgramUniform2uivEXT = (PFNGLPROGRAMUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2uivEXT")) == NULL) || r; + r = ((glProgramUniform3fEXT = (PFNGLPROGRAMUNIFORM3FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fEXT")) == NULL) || r; + r = ((glProgramUniform3fvEXT = (PFNGLPROGRAMUNIFORM3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3fvEXT")) == NULL) || r; + r = ((glProgramUniform3iEXT = (PFNGLPROGRAMUNIFORM3IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3iEXT")) == NULL) || r; + r = ((glProgramUniform3ivEXT = (PFNGLPROGRAMUNIFORM3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ivEXT")) == NULL) || r; + r = ((glProgramUniform3uiEXT = (PFNGLPROGRAMUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uiEXT")) == NULL) || r; + r = ((glProgramUniform3uivEXT = (PFNGLPROGRAMUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3uivEXT")) == NULL) || r; + r = ((glProgramUniform4fEXT = (PFNGLPROGRAMUNIFORM4FEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fEXT")) == NULL) || r; + r = ((glProgramUniform4fvEXT = (PFNGLPROGRAMUNIFORM4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4fvEXT")) == NULL) || r; + r = ((glProgramUniform4iEXT = (PFNGLPROGRAMUNIFORM4IEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4iEXT")) == NULL) || r; + r = ((glProgramUniform4ivEXT = (PFNGLPROGRAMUNIFORM4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ivEXT")) == NULL) || r; + r = ((glProgramUniform4uiEXT = (PFNGLPROGRAMUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uiEXT")) == NULL) || r; + r = ((glProgramUniform4uivEXT = (PFNGLPROGRAMUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4uivEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x3fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix2x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix2x4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix3x4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix3x4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x2fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x2fvEXT")) == NULL) || r; + r = ((glProgramUniformMatrix4x3fvEXT = (PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformMatrix4x3fvEXT")) == NULL) || r; + r = ((glPushClientAttribDefaultEXT = (PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC)glewGetProcAddress((const GLubyte*)"glPushClientAttribDefaultEXT")) == NULL) || r; + r = ((glTextureBufferEXT = (PFNGLTEXTUREBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureBufferEXT")) == NULL) || r; + r = ((glTextureImage1DEXT = (PFNGLTEXTUREIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage1DEXT")) == NULL) || r; + r = ((glTextureImage2DEXT = (PFNGLTEXTUREIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage2DEXT")) == NULL) || r; + r = ((glTextureImage3DEXT = (PFNGLTEXTUREIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureImage3DEXT")) == NULL) || r; + r = ((glTextureParameterIivEXT = (PFNGLTEXTUREPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIivEXT")) == NULL) || r; + r = ((glTextureParameterIuivEXT = (PFNGLTEXTUREPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterIuivEXT")) == NULL) || r; + r = ((glTextureParameterfEXT = (PFNGLTEXTUREPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfEXT")) == NULL) || r; + r = ((glTextureParameterfvEXT = (PFNGLTEXTUREPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterfvEXT")) == NULL) || r; + r = ((glTextureParameteriEXT = (PFNGLTEXTUREPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameteriEXT")) == NULL) || r; + r = ((glTextureParameterivEXT = (PFNGLTEXTUREPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureParameterivEXT")) == NULL) || r; + r = ((glTextureRenderbufferEXT = (PFNGLTEXTURERENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTextureRenderbufferEXT")) == NULL) || r; + r = ((glTextureSubImage1DEXT = (PFNGLTEXTURESUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage1DEXT")) == NULL) || r; + r = ((glTextureSubImage2DEXT = (PFNGLTEXTURESUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage2DEXT")) == NULL) || r; + r = ((glTextureSubImage3DEXT = (PFNGLTEXTURESUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureSubImage3DEXT")) == NULL) || r; + r = ((glUnmapNamedBufferEXT = (PFNGLUNMAPNAMEDBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glUnmapNamedBufferEXT")) == NULL) || r; + r = ((glVertexArrayColorOffsetEXT = (PFNGLVERTEXARRAYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayColorOffsetEXT")) == NULL) || r; + r = ((glVertexArrayEdgeFlagOffsetEXT = (PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayEdgeFlagOffsetEXT")) == NULL) || r; + r = ((glVertexArrayFogCoordOffsetEXT = (PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayFogCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayIndexOffsetEXT = (PFNGLVERTEXARRAYINDEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayIndexOffsetEXT")) == NULL) || r; + r = ((glVertexArrayMultiTexCoordOffsetEXT = (PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayMultiTexCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayNormalOffsetEXT = (PFNGLVERTEXARRAYNORMALOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayNormalOffsetEXT")) == NULL) || r; + r = ((glVertexArraySecondaryColorOffsetEXT = (PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArraySecondaryColorOffsetEXT")) == NULL) || r; + r = ((glVertexArrayTexCoordOffsetEXT = (PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayTexCoordOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribIOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribIOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribOffsetEXT")) == NULL) || r; + r = ((glVertexArrayVertexOffsetEXT = (PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexOffsetEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_direct_state_access */ + +#ifdef GL_EXT_draw_buffers2 + +static GLboolean _glewInit_GL_EXT_draw_buffers2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorMaskIndexedEXT = (PFNGLCOLORMASKINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glColorMaskIndexedEXT")) == NULL) || r; + r = ((glDisableIndexedEXT = (PFNGLDISABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableIndexedEXT")) == NULL) || r; + r = ((glEnableIndexedEXT = (PFNGLENABLEINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableIndexedEXT")) == NULL) || r; + r = ((glGetBooleanIndexedvEXT = (PFNGLGETBOOLEANINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetBooleanIndexedvEXT")) == NULL) || r; + r = ((glGetIntegerIndexedvEXT = (PFNGLGETINTEGERINDEXEDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerIndexedvEXT")) == NULL) || r; + r = ((glIsEnabledIndexedEXT = (PFNGLISENABLEDINDEXEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsEnabledIndexedEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_buffers2 */ + +#ifdef GL_EXT_draw_instanced + +static GLboolean _glewInit_GL_EXT_draw_instanced (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawArraysInstancedEXT = (PFNGLDRAWARRAYSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysInstancedEXT")) == NULL) || r; + r = ((glDrawElementsInstancedEXT = (PFNGLDRAWELEMENTSINSTANCEDEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawElementsInstancedEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_instanced */ + +#ifdef GL_EXT_draw_range_elements + +static GLboolean _glewInit_GL_EXT_draw_range_elements (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDrawRangeElementsEXT = (PFNGLDRAWRANGEELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawRangeElementsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_draw_range_elements */ + +#ifdef GL_EXT_fog_coord + +static GLboolean _glewInit_GL_EXT_fog_coord (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFogCoordPointerEXT = (PFNGLFOGCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerEXT")) == NULL) || r; + r = ((glFogCoorddEXT = (PFNGLFOGCOORDDEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddEXT")) == NULL) || r; + r = ((glFogCoorddvEXT = (PFNGLFOGCOORDDVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoorddvEXT")) == NULL) || r; + r = ((glFogCoordfEXT = (PFNGLFOGCOORDFEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfEXT")) == NULL) || r; + r = ((glFogCoordfvEXT = (PFNGLFOGCOORDFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFogCoordfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_fog_coord */ + +#ifdef GL_EXT_fragment_lighting + +static GLboolean _glewInit_GL_EXT_fragment_lighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFragmentColorMaterialEXT = (PFNGLFRAGMENTCOLORMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialEXT")) == NULL) || r; + r = ((glFragmentLightModelfEXT = (PFNGLFRAGMENTLIGHTMODELFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfEXT")) == NULL) || r; + r = ((glFragmentLightModelfvEXT = (PFNGLFRAGMENTLIGHTMODELFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvEXT")) == NULL) || r; + r = ((glFragmentLightModeliEXT = (PFNGLFRAGMENTLIGHTMODELIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliEXT")) == NULL) || r; + r = ((glFragmentLightModelivEXT = (PFNGLFRAGMENTLIGHTMODELIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivEXT")) == NULL) || r; + r = ((glFragmentLightfEXT = (PFNGLFRAGMENTLIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfEXT")) == NULL) || r; + r = ((glFragmentLightfvEXT = (PFNGLFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvEXT")) == NULL) || r; + r = ((glFragmentLightiEXT = (PFNGLFRAGMENTLIGHTIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiEXT")) == NULL) || r; + r = ((glFragmentLightivEXT = (PFNGLFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivEXT")) == NULL) || r; + r = ((glFragmentMaterialfEXT = (PFNGLFRAGMENTMATERIALFEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfEXT")) == NULL) || r; + r = ((glFragmentMaterialfvEXT = (PFNGLFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvEXT")) == NULL) || r; + r = ((glFragmentMaterialiEXT = (PFNGLFRAGMENTMATERIALIEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiEXT")) == NULL) || r; + r = ((glFragmentMaterialivEXT = (PFNGLFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivEXT")) == NULL) || r; + r = ((glGetFragmentLightfvEXT = (PFNGLGETFRAGMENTLIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvEXT")) == NULL) || r; + r = ((glGetFragmentLightivEXT = (PFNGLGETFRAGMENTLIGHTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivEXT")) == NULL) || r; + r = ((glGetFragmentMaterialfvEXT = (PFNGLGETFRAGMENTMATERIALFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvEXT")) == NULL) || r; + r = ((glGetFragmentMaterialivEXT = (PFNGLGETFRAGMENTMATERIALIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivEXT")) == NULL) || r; + r = ((glLightEnviEXT = (PFNGLLIGHTENVIEXTPROC)glewGetProcAddress((const GLubyte*)"glLightEnviEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_fragment_lighting */ + +#ifdef GL_EXT_framebuffer_blit + +static GLboolean _glewInit_GL_EXT_framebuffer_blit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBlitFramebufferEXT = (PFNGLBLITFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBlitFramebufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_blit */ + +#ifdef GL_EXT_framebuffer_multisample + +static GLboolean _glewInit_GL_EXT_framebuffer_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleEXT = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_multisample */ + +#ifdef GL_EXT_framebuffer_object + +static GLboolean _glewInit_GL_EXT_framebuffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindFramebufferEXT")) == NULL) || r; + r = ((glBindRenderbufferEXT = (PFNGLBINDRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindRenderbufferEXT")) == NULL) || r; + r = ((glCheckFramebufferStatusEXT = (PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC)glewGetProcAddress((const GLubyte*)"glCheckFramebufferStatusEXT")) == NULL) || r; + r = ((glDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteFramebuffersEXT")) == NULL) || r; + r = ((glDeleteRenderbuffersEXT = (PFNGLDELETERENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteRenderbuffersEXT")) == NULL) || r; + r = ((glFramebufferRenderbufferEXT = (PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferRenderbufferEXT")) == NULL) || r; + r = ((glFramebufferTexture1DEXT = (PFNGLFRAMEBUFFERTEXTURE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture1DEXT")) == NULL) || r; + r = ((glFramebufferTexture2DEXT = (PFNGLFRAMEBUFFERTEXTURE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture2DEXT")) == NULL) || r; + r = ((glFramebufferTexture3DEXT = (PFNGLFRAMEBUFFERTEXTURE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTexture3DEXT")) == NULL) || r; + r = ((glGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenFramebuffersEXT")) == NULL) || r; + r = ((glGenRenderbuffersEXT = (PFNGLGENRENDERBUFFERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenRenderbuffersEXT")) == NULL) || r; + r = ((glGenerateMipmapEXT = (PFNGLGENERATEMIPMAPEXTPROC)glewGetProcAddress((const GLubyte*)"glGenerateMipmapEXT")) == NULL) || r; + r = ((glGetFramebufferAttachmentParameterivEXT = (PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFramebufferAttachmentParameterivEXT")) == NULL) || r; + r = ((glGetRenderbufferParameterivEXT = (PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetRenderbufferParameterivEXT")) == NULL) || r; + r = ((glIsFramebufferEXT = (PFNGLISFRAMEBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsFramebufferEXT")) == NULL) || r; + r = ((glIsRenderbufferEXT = (PFNGLISRENDERBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glIsRenderbufferEXT")) == NULL) || r; + r = ((glRenderbufferStorageEXT = (PFNGLRENDERBUFFERSTORAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_framebuffer_object */ + +#ifdef GL_EXT_framebuffer_sRGB + +#endif /* GL_EXT_framebuffer_sRGB */ + +#ifdef GL_EXT_geometry_shader4 + +static GLboolean _glewInit_GL_EXT_geometry_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFramebufferTextureEXT = (PFNGLFRAMEBUFFERTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureEXT")) == NULL) || r; + r = ((glFramebufferTextureFaceEXT = (PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureFaceEXT")) == NULL) || r; + r = ((glFramebufferTextureLayerEXT = (PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC)glewGetProcAddress((const GLubyte*)"glFramebufferTextureLayerEXT")) == NULL) || r; + r = ((glProgramParameteriEXT = (PFNGLPROGRAMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramParameteriEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_geometry_shader4 */ + +#ifdef GL_EXT_gpu_program_parameters + +static GLboolean _glewInit_GL_EXT_gpu_program_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramEnvParameters4fvEXT = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameters4fvEXT")) == NULL) || r; + r = ((glProgramLocalParameters4fvEXT = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameters4fvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_gpu_program_parameters */ + +#ifdef GL_EXT_gpu_shader4 + +static GLboolean _glewInit_GL_EXT_gpu_shader4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindFragDataLocationEXT = (PFNGLBINDFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glBindFragDataLocationEXT")) == NULL) || r; + r = ((glGetFragDataLocationEXT = (PFNGLGETFRAGDATALOCATIONEXTPROC)glewGetProcAddress((const GLubyte*)"glGetFragDataLocationEXT")) == NULL) || r; + r = ((glGetUniformuivEXT = (PFNGLGETUNIFORMUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetUniformuivEXT")) == NULL) || r; + r = ((glGetVertexAttribIivEXT = (PFNGLGETVERTEXATTRIBIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIivEXT")) == NULL) || r; + r = ((glGetVertexAttribIuivEXT = (PFNGLGETVERTEXATTRIBIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribIuivEXT")) == NULL) || r; + r = ((glUniform1uiEXT = (PFNGLUNIFORM1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uiEXT")) == NULL) || r; + r = ((glUniform1uivEXT = (PFNGLUNIFORM1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform1uivEXT")) == NULL) || r; + r = ((glUniform2uiEXT = (PFNGLUNIFORM2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uiEXT")) == NULL) || r; + r = ((glUniform2uivEXT = (PFNGLUNIFORM2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform2uivEXT")) == NULL) || r; + r = ((glUniform3uiEXT = (PFNGLUNIFORM3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uiEXT")) == NULL) || r; + r = ((glUniform3uivEXT = (PFNGLUNIFORM3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform3uivEXT")) == NULL) || r; + r = ((glUniform4uiEXT = (PFNGLUNIFORM4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uiEXT")) == NULL) || r; + r = ((glUniform4uivEXT = (PFNGLUNIFORM4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glUniform4uivEXT")) == NULL) || r; + r = ((glVertexAttribI1iEXT = (PFNGLVERTEXATTRIBI1IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1iEXT")) == NULL) || r; + r = ((glVertexAttribI1ivEXT = (PFNGLVERTEXATTRIBI1IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1ivEXT")) == NULL) || r; + r = ((glVertexAttribI1uiEXT = (PFNGLVERTEXATTRIBI1UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uiEXT")) == NULL) || r; + r = ((glVertexAttribI1uivEXT = (PFNGLVERTEXATTRIBI1UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI1uivEXT")) == NULL) || r; + r = ((glVertexAttribI2iEXT = (PFNGLVERTEXATTRIBI2IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2iEXT")) == NULL) || r; + r = ((glVertexAttribI2ivEXT = (PFNGLVERTEXATTRIBI2IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2ivEXT")) == NULL) || r; + r = ((glVertexAttribI2uiEXT = (PFNGLVERTEXATTRIBI2UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uiEXT")) == NULL) || r; + r = ((glVertexAttribI2uivEXT = (PFNGLVERTEXATTRIBI2UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI2uivEXT")) == NULL) || r; + r = ((glVertexAttribI3iEXT = (PFNGLVERTEXATTRIBI3IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3iEXT")) == NULL) || r; + r = ((glVertexAttribI3ivEXT = (PFNGLVERTEXATTRIBI3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3ivEXT")) == NULL) || r; + r = ((glVertexAttribI3uiEXT = (PFNGLVERTEXATTRIBI3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uiEXT")) == NULL) || r; + r = ((glVertexAttribI3uivEXT = (PFNGLVERTEXATTRIBI3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI3uivEXT")) == NULL) || r; + r = ((glVertexAttribI4bvEXT = (PFNGLVERTEXATTRIBI4BVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4bvEXT")) == NULL) || r; + r = ((glVertexAttribI4iEXT = (PFNGLVERTEXATTRIBI4IEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4iEXT")) == NULL) || r; + r = ((glVertexAttribI4ivEXT = (PFNGLVERTEXATTRIBI4IVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ivEXT")) == NULL) || r; + r = ((glVertexAttribI4svEXT = (PFNGLVERTEXATTRIBI4SVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4svEXT")) == NULL) || r; + r = ((glVertexAttribI4ubvEXT = (PFNGLVERTEXATTRIBI4UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4ubvEXT")) == NULL) || r; + r = ((glVertexAttribI4uiEXT = (PFNGLVERTEXATTRIBI4UIEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uiEXT")) == NULL) || r; + r = ((glVertexAttribI4uivEXT = (PFNGLVERTEXATTRIBI4UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4uivEXT")) == NULL) || r; + r = ((glVertexAttribI4usvEXT = (PFNGLVERTEXATTRIBI4USVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribI4usvEXT")) == NULL) || r; + r = ((glVertexAttribIPointerEXT = (PFNGLVERTEXATTRIBIPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_gpu_shader4 */ + +#ifdef GL_EXT_histogram + +static GLboolean _glewInit_GL_EXT_histogram (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetHistogramEXT = (PFNGLGETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramEXT")) == NULL) || r; + r = ((glGetHistogramParameterfvEXT = (PFNGLGETHISTOGRAMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterfvEXT")) == NULL) || r; + r = ((glGetHistogramParameterivEXT = (PFNGLGETHISTOGRAMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetHistogramParameterivEXT")) == NULL) || r; + r = ((glGetMinmaxEXT = (PFNGLGETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxEXT")) == NULL) || r; + r = ((glGetMinmaxParameterfvEXT = (PFNGLGETMINMAXPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterfvEXT")) == NULL) || r; + r = ((glGetMinmaxParameterivEXT = (PFNGLGETMINMAXPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetMinmaxParameterivEXT")) == NULL) || r; + r = ((glHistogramEXT = (PFNGLHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glHistogramEXT")) == NULL) || r; + r = ((glMinmaxEXT = (PFNGLMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glMinmaxEXT")) == NULL) || r; + r = ((glResetHistogramEXT = (PFNGLRESETHISTOGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glResetHistogramEXT")) == NULL) || r; + r = ((glResetMinmaxEXT = (PFNGLRESETMINMAXEXTPROC)glewGetProcAddress((const GLubyte*)"glResetMinmaxEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_histogram */ + +#ifdef GL_EXT_index_array_formats + +#endif /* GL_EXT_index_array_formats */ + +#ifdef GL_EXT_index_func + +static GLboolean _glewInit_GL_EXT_index_func (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glIndexFuncEXT = (PFNGLINDEXFUNCEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexFuncEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_index_func */ + +#ifdef GL_EXT_index_material + +static GLboolean _glewInit_GL_EXT_index_material (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glIndexMaterialEXT = (PFNGLINDEXMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glIndexMaterialEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_index_material */ + +#ifdef GL_EXT_index_texture + +#endif /* GL_EXT_index_texture */ + +#ifdef GL_EXT_light_texture + +static GLboolean _glewInit_GL_EXT_light_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glApplyTextureEXT = (PFNGLAPPLYTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glApplyTextureEXT")) == NULL) || r; + r = ((glTextureLightEXT = (PFNGLTEXTURELIGHTEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureLightEXT")) == NULL) || r; + r = ((glTextureMaterialEXT = (PFNGLTEXTUREMATERIALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureMaterialEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_light_texture */ + +#ifdef GL_EXT_misc_attribute + +#endif /* GL_EXT_misc_attribute */ + +#ifdef GL_EXT_multi_draw_arrays + +static GLboolean _glewInit_GL_EXT_multi_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiDrawArraysEXT = (PFNGLMULTIDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawArraysEXT")) == NULL) || r; + r = ((glMultiDrawElementsEXT = (PFNGLMULTIDRAWELEMENTSEXTPROC)glewGetProcAddress((const GLubyte*)"glMultiDrawElementsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multi_draw_arrays */ + +#ifdef GL_EXT_multisample + +static GLboolean _glewInit_GL_EXT_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleMaskEXT = (PFNGLSAMPLEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskEXT")) == NULL) || r; + r = ((glSamplePatternEXT = (PFNGLSAMPLEPATTERNEXTPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_multisample */ + +#ifdef GL_EXT_packed_depth_stencil + +#endif /* GL_EXT_packed_depth_stencil */ + +#ifdef GL_EXT_packed_float + +#endif /* GL_EXT_packed_float */ + +#ifdef GL_EXT_packed_pixels + +#endif /* GL_EXT_packed_pixels */ + +#ifdef GL_EXT_paletted_texture + +static GLboolean _glewInit_GL_EXT_paletted_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorTableEXT = (PFNGLCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glColorTableEXT")) == NULL) || r; + r = ((glGetColorTableEXT = (PFNGLGETCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableEXT")) == NULL) || r; + r = ((glGetColorTableParameterfvEXT = (PFNGLGETCOLORTABLEPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvEXT")) == NULL) || r; + r = ((glGetColorTableParameterivEXT = (PFNGLGETCOLORTABLEPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_paletted_texture */ + +#ifdef GL_EXT_pixel_buffer_object + +#endif /* GL_EXT_pixel_buffer_object */ + +#ifdef GL_EXT_pixel_transform + +static GLboolean _glewInit_GL_EXT_pixel_transform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetPixelTransformParameterfvEXT = (PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterfvEXT")) == NULL) || r; + r = ((glGetPixelTransformParameterivEXT = (PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetPixelTransformParameterivEXT")) == NULL) || r; + r = ((glPixelTransformParameterfEXT = (PFNGLPIXELTRANSFORMPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfEXT")) == NULL) || r; + r = ((glPixelTransformParameterfvEXT = (PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterfvEXT")) == NULL) || r; + r = ((glPixelTransformParameteriEXT = (PFNGLPIXELTRANSFORMPARAMETERIEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameteriEXT")) == NULL) || r; + r = ((glPixelTransformParameterivEXT = (PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC)glewGetProcAddress((const GLubyte*)"glPixelTransformParameterivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_pixel_transform */ + +#ifdef GL_EXT_pixel_transform_color_table + +#endif /* GL_EXT_pixel_transform_color_table */ + +#ifdef GL_EXT_point_parameters + +static GLboolean _glewInit_GL_EXT_point_parameters (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameterfEXT = (PFNGLPOINTPARAMETERFEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfEXT")) == NULL) || r; + r = ((glPointParameterfvEXT = (PFNGLPOINTPARAMETERFVEXTPROC)glewGetProcAddress((const GLubyte*)"glPointParameterfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_point_parameters */ + +#ifdef GL_EXT_polygon_offset + +static GLboolean _glewInit_GL_EXT_polygon_offset (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPolygonOffsetEXT = (PFNGLPOLYGONOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glPolygonOffsetEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_polygon_offset */ + +#ifdef GL_EXT_provoking_vertex + +static GLboolean _glewInit_GL_EXT_provoking_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProvokingVertexEXT = (PFNGLPROVOKINGVERTEXEXTPROC)glewGetProcAddress((const GLubyte*)"glProvokingVertexEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_provoking_vertex */ + +#ifdef GL_EXT_rescale_normal + +#endif /* GL_EXT_rescale_normal */ + +#ifdef GL_EXT_scene_marker + +static GLboolean _glewInit_GL_EXT_scene_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginSceneEXT = (PFNGLBEGINSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginSceneEXT")) == NULL) || r; + r = ((glEndSceneEXT = (PFNGLENDSCENEEXTPROC)glewGetProcAddress((const GLubyte*)"glEndSceneEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_scene_marker */ + +#ifdef GL_EXT_secondary_color + +static GLboolean _glewInit_GL_EXT_secondary_color (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSecondaryColor3bEXT = (PFNGLSECONDARYCOLOR3BEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bEXT")) == NULL) || r; + r = ((glSecondaryColor3bvEXT = (PFNGLSECONDARYCOLOR3BVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3bvEXT")) == NULL) || r; + r = ((glSecondaryColor3dEXT = (PFNGLSECONDARYCOLOR3DEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dEXT")) == NULL) || r; + r = ((glSecondaryColor3dvEXT = (PFNGLSECONDARYCOLOR3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3dvEXT")) == NULL) || r; + r = ((glSecondaryColor3fEXT = (PFNGLSECONDARYCOLOR3FEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fEXT")) == NULL) || r; + r = ((glSecondaryColor3fvEXT = (PFNGLSECONDARYCOLOR3FVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3fvEXT")) == NULL) || r; + r = ((glSecondaryColor3iEXT = (PFNGLSECONDARYCOLOR3IEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3iEXT")) == NULL) || r; + r = ((glSecondaryColor3ivEXT = (PFNGLSECONDARYCOLOR3IVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ivEXT")) == NULL) || r; + r = ((glSecondaryColor3sEXT = (PFNGLSECONDARYCOLOR3SEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3sEXT")) == NULL) || r; + r = ((glSecondaryColor3svEXT = (PFNGLSECONDARYCOLOR3SVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3svEXT")) == NULL) || r; + r = ((glSecondaryColor3ubEXT = (PFNGLSECONDARYCOLOR3UBEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubEXT")) == NULL) || r; + r = ((glSecondaryColor3ubvEXT = (PFNGLSECONDARYCOLOR3UBVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3ubvEXT")) == NULL) || r; + r = ((glSecondaryColor3uiEXT = (PFNGLSECONDARYCOLOR3UIEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uiEXT")) == NULL) || r; + r = ((glSecondaryColor3uivEXT = (PFNGLSECONDARYCOLOR3UIVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3uivEXT")) == NULL) || r; + r = ((glSecondaryColor3usEXT = (PFNGLSECONDARYCOLOR3USEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usEXT")) == NULL) || r; + r = ((glSecondaryColor3usvEXT = (PFNGLSECONDARYCOLOR3USVEXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3usvEXT")) == NULL) || r; + r = ((glSecondaryColorPointerEXT = (PFNGLSECONDARYCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_secondary_color */ + +#ifdef GL_EXT_separate_shader_objects + +static GLboolean _glewInit_GL_EXT_separate_shader_objects (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveProgramEXT = (PFNGLACTIVEPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveProgramEXT")) == NULL) || r; + r = ((glCreateShaderProgramEXT = (PFNGLCREATESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glCreateShaderProgramEXT")) == NULL) || r; + r = ((glUseShaderProgramEXT = (PFNGLUSESHADERPROGRAMEXTPROC)glewGetProcAddress((const GLubyte*)"glUseShaderProgramEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_separate_shader_objects */ + +#ifdef GL_EXT_separate_specular_color + +#endif /* GL_EXT_separate_specular_color */ + +#ifdef GL_EXT_shader_image_load_store + +static GLboolean _glewInit_GL_EXT_shader_image_load_store (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindImageTextureEXT = (PFNGLBINDIMAGETEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindImageTextureEXT")) == NULL) || r; + r = ((glMemoryBarrierEXT = (PFNGLMEMORYBARRIEREXTPROC)glewGetProcAddress((const GLubyte*)"glMemoryBarrierEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_shader_image_load_store */ + +#ifdef GL_EXT_shadow_funcs + +#endif /* GL_EXT_shadow_funcs */ + +#ifdef GL_EXT_shared_texture_palette + +#endif /* GL_EXT_shared_texture_palette */ + +#ifdef GL_EXT_stencil_clear_tag + +#endif /* GL_EXT_stencil_clear_tag */ + +#ifdef GL_EXT_stencil_two_side + +static GLboolean _glewInit_GL_EXT_stencil_two_side (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveStencilFaceEXT = (PFNGLACTIVESTENCILFACEEXTPROC)glewGetProcAddress((const GLubyte*)"glActiveStencilFaceEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_stencil_two_side */ + +#ifdef GL_EXT_stencil_wrap + +#endif /* GL_EXT_stencil_wrap */ + +#ifdef GL_EXT_subtexture + +static GLboolean _glewInit_GL_EXT_subtexture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexSubImage1DEXT = (PFNGLTEXSUBIMAGE1DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage1DEXT")) == NULL) || r; + r = ((glTexSubImage2DEXT = (PFNGLTEXSUBIMAGE2DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage2DEXT")) == NULL) || r; + r = ((glTexSubImage3DEXT = (PFNGLTEXSUBIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_subtexture */ + +#ifdef GL_EXT_texture + +#endif /* GL_EXT_texture */ + +#ifdef GL_EXT_texture3D + +static GLboolean _glewInit_GL_EXT_texture3D (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage3DEXT = (PFNGLTEXIMAGE3DEXTPROC)glewGetProcAddress((const GLubyte*)"glTexImage3DEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture3D */ + +#ifdef GL_EXT_texture_array + +#endif /* GL_EXT_texture_array */ + +#ifdef GL_EXT_texture_buffer_object + +static GLboolean _glewInit_GL_EXT_texture_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexBufferEXT = (PFNGLTEXBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexBufferEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_buffer_object */ + +#ifdef GL_EXT_texture_compression_dxt1 + +#endif /* GL_EXT_texture_compression_dxt1 */ + +#ifdef GL_EXT_texture_compression_latc + +#endif /* GL_EXT_texture_compression_latc */ + +#ifdef GL_EXT_texture_compression_rgtc + +#endif /* GL_EXT_texture_compression_rgtc */ + +#ifdef GL_EXT_texture_compression_s3tc + +#endif /* GL_EXT_texture_compression_s3tc */ + +#ifdef GL_EXT_texture_cube_map + +#endif /* GL_EXT_texture_cube_map */ + +#ifdef GL_EXT_texture_edge_clamp + +#endif /* GL_EXT_texture_edge_clamp */ + +#ifdef GL_EXT_texture_env + +#endif /* GL_EXT_texture_env */ + +#ifdef GL_EXT_texture_env_add + +#endif /* GL_EXT_texture_env_add */ + +#ifdef GL_EXT_texture_env_combine + +#endif /* GL_EXT_texture_env_combine */ + +#ifdef GL_EXT_texture_env_dot3 + +#endif /* GL_EXT_texture_env_dot3 */ + +#ifdef GL_EXT_texture_filter_anisotropic + +#endif /* GL_EXT_texture_filter_anisotropic */ + +#ifdef GL_EXT_texture_integer + +static GLboolean _glewInit_GL_EXT_texture_integer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearColorIiEXT = (PFNGLCLEARCOLORIIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIiEXT")) == NULL) || r; + r = ((glClearColorIuiEXT = (PFNGLCLEARCOLORIUIEXTPROC)glewGetProcAddress((const GLubyte*)"glClearColorIuiEXT")) == NULL) || r; + r = ((glGetTexParameterIivEXT = (PFNGLGETTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIivEXT")) == NULL) || r; + r = ((glGetTexParameterIuivEXT = (PFNGLGETTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTexParameterIuivEXT")) == NULL) || r; + r = ((glTexParameterIivEXT = (PFNGLTEXPARAMETERIIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIivEXT")) == NULL) || r; + r = ((glTexParameterIuivEXT = (PFNGLTEXPARAMETERIUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glTexParameterIuivEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_integer */ + +#ifdef GL_EXT_texture_lod_bias + +#endif /* GL_EXT_texture_lod_bias */ + +#ifdef GL_EXT_texture_mirror_clamp + +#endif /* GL_EXT_texture_mirror_clamp */ + +#ifdef GL_EXT_texture_object + +static GLboolean _glewInit_GL_EXT_texture_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAreTexturesResidentEXT = (PFNGLARETEXTURESRESIDENTEXTPROC)glewGetProcAddress((const GLubyte*)"glAreTexturesResidentEXT")) == NULL) || r; + r = ((glBindTextureEXT = (PFNGLBINDTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureEXT")) == NULL) || r; + r = ((glDeleteTexturesEXT = (PFNGLDELETETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteTexturesEXT")) == NULL) || r; + r = ((glGenTexturesEXT = (PFNGLGENTEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glGenTexturesEXT")) == NULL) || r; + r = ((glIsTextureEXT = (PFNGLISTEXTUREEXTPROC)glewGetProcAddress((const GLubyte*)"glIsTextureEXT")) == NULL) || r; + r = ((glPrioritizeTexturesEXT = (PFNGLPRIORITIZETEXTURESEXTPROC)glewGetProcAddress((const GLubyte*)"glPrioritizeTexturesEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_object */ + +#ifdef GL_EXT_texture_perturb_normal + +static GLboolean _glewInit_GL_EXT_texture_perturb_normal (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureNormalEXT = (PFNGLTEXTURENORMALEXTPROC)glewGetProcAddress((const GLubyte*)"glTextureNormalEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_texture_perturb_normal */ + +#ifdef GL_EXT_texture_rectangle + +#endif /* GL_EXT_texture_rectangle */ + +#ifdef GL_EXT_texture_sRGB + +#endif /* GL_EXT_texture_sRGB */ + +#ifdef GL_EXT_texture_sRGB_decode + +#endif /* GL_EXT_texture_sRGB_decode */ + +#ifdef GL_EXT_texture_shared_exponent + +#endif /* GL_EXT_texture_shared_exponent */ + +#ifdef GL_EXT_texture_snorm + +#endif /* GL_EXT_texture_snorm */ + +#ifdef GL_EXT_texture_swizzle + +#endif /* GL_EXT_texture_swizzle */ + +#ifdef GL_EXT_timer_query + +static GLboolean _glewInit_GL_EXT_timer_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetQueryObjecti64vEXT = (PFNGLGETQUERYOBJECTI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjecti64vEXT")) == NULL) || r; + r = ((glGetQueryObjectui64vEXT = (PFNGLGETQUERYOBJECTUI64VEXTPROC)glewGetProcAddress((const GLubyte*)"glGetQueryObjectui64vEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_timer_query */ + +#ifdef GL_EXT_transform_feedback + +static GLboolean _glewInit_GL_EXT_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginTransformFeedbackEXT = (PFNGLBEGINTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackEXT")) == NULL) || r; + r = ((glBindBufferBaseEXT = (PFNGLBINDBUFFERBASEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseEXT")) == NULL) || r; + r = ((glBindBufferOffsetEXT = (PFNGLBINDBUFFEROFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetEXT")) == NULL) || r; + r = ((glBindBufferRangeEXT = (PFNGLBINDBUFFERRANGEEXTPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeEXT")) == NULL) || r; + r = ((glEndTransformFeedbackEXT = (PFNGLENDTRANSFORMFEEDBACKEXTPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackEXT")) == NULL) || r; + r = ((glGetTransformFeedbackVaryingEXT = (PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingEXT")) == NULL) || r; + r = ((glTransformFeedbackVaryingsEXT = (PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_transform_feedback */ + +#ifdef GL_EXT_vertex_array + +static GLboolean _glewInit_GL_EXT_vertex_array (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glArrayElementEXT = (PFNGLARRAYELEMENTEXTPROC)glewGetProcAddress((const GLubyte*)"glArrayElementEXT")) == NULL) || r; + r = ((glColorPointerEXT = (PFNGLCOLORPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glColorPointerEXT")) == NULL) || r; + r = ((glDrawArraysEXT = (PFNGLDRAWARRAYSEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawArraysEXT")) == NULL) || r; + r = ((glEdgeFlagPointerEXT = (PFNGLEDGEFLAGPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerEXT")) == NULL) || r; + r = ((glIndexPointerEXT = (PFNGLINDEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerEXT")) == NULL) || r; + r = ((glNormalPointerEXT = (PFNGLNORMALPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerEXT")) == NULL) || r; + r = ((glTexCoordPointerEXT = (PFNGLTEXCOORDPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerEXT")) == NULL) || r; + r = ((glVertexPointerEXT = (PFNGLVERTEXPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_array */ + +#ifdef GL_EXT_vertex_array_bgra + +#endif /* GL_EXT_vertex_array_bgra */ + +#ifdef GL_EXT_vertex_attrib_64bit + +static GLboolean _glewInit_GL_EXT_vertex_attrib_64bit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLdvEXT = (PFNGLGETVERTEXATTRIBLDVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLdvEXT")) == NULL) || r; + r = ((glVertexArrayVertexAttribLOffsetEXT = (PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayVertexAttribLOffsetEXT")) == NULL) || r; + r = ((glVertexAttribL1dEXT = (PFNGLVERTEXATTRIBL1DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dEXT")) == NULL) || r; + r = ((glVertexAttribL1dvEXT = (PFNGLVERTEXATTRIBL1DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1dvEXT")) == NULL) || r; + r = ((glVertexAttribL2dEXT = (PFNGLVERTEXATTRIBL2DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dEXT")) == NULL) || r; + r = ((glVertexAttribL2dvEXT = (PFNGLVERTEXATTRIBL2DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2dvEXT")) == NULL) || r; + r = ((glVertexAttribL3dEXT = (PFNGLVERTEXATTRIBL3DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dEXT")) == NULL) || r; + r = ((glVertexAttribL3dvEXT = (PFNGLVERTEXATTRIBL3DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3dvEXT")) == NULL) || r; + r = ((glVertexAttribL4dEXT = (PFNGLVERTEXATTRIBL4DEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dEXT")) == NULL) || r; + r = ((glVertexAttribL4dvEXT = (PFNGLVERTEXATTRIBL4DVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4dvEXT")) == NULL) || r; + r = ((glVertexAttribLPointerEXT = (PFNGLVERTEXATTRIBLPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLPointerEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_attrib_64bit */ + +#ifdef GL_EXT_vertex_shader + +static GLboolean _glewInit_GL_EXT_vertex_shader (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginVertexShaderEXT = (PFNGLBEGINVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBeginVertexShaderEXT")) == NULL) || r; + r = ((glBindLightParameterEXT = (PFNGLBINDLIGHTPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindLightParameterEXT")) == NULL) || r; + r = ((glBindMaterialParameterEXT = (PFNGLBINDMATERIALPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindMaterialParameterEXT")) == NULL) || r; + r = ((glBindParameterEXT = (PFNGLBINDPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindParameterEXT")) == NULL) || r; + r = ((glBindTexGenParameterEXT = (PFNGLBINDTEXGENPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTexGenParameterEXT")) == NULL) || r; + r = ((glBindTextureUnitParameterEXT = (PFNGLBINDTEXTUREUNITPARAMETEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindTextureUnitParameterEXT")) == NULL) || r; + r = ((glBindVertexShaderEXT = (PFNGLBINDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glBindVertexShaderEXT")) == NULL) || r; + r = ((glDeleteVertexShaderEXT = (PFNGLDELETEVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteVertexShaderEXT")) == NULL) || r; + r = ((glDisableVariantClientStateEXT = (PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glDisableVariantClientStateEXT")) == NULL) || r; + r = ((glEnableVariantClientStateEXT = (PFNGLENABLEVARIANTCLIENTSTATEEXTPROC)glewGetProcAddress((const GLubyte*)"glEnableVariantClientStateEXT")) == NULL) || r; + r = ((glEndVertexShaderEXT = (PFNGLENDVERTEXSHADEREXTPROC)glewGetProcAddress((const GLubyte*)"glEndVertexShaderEXT")) == NULL) || r; + r = ((glExtractComponentEXT = (PFNGLEXTRACTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glExtractComponentEXT")) == NULL) || r; + r = ((glGenSymbolsEXT = (PFNGLGENSYMBOLSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenSymbolsEXT")) == NULL) || r; + r = ((glGenVertexShadersEXT = (PFNGLGENVERTEXSHADERSEXTPROC)glewGetProcAddress((const GLubyte*)"glGenVertexShadersEXT")) == NULL) || r; + r = ((glGetInvariantBooleanvEXT = (PFNGLGETINVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantBooleanvEXT")) == NULL) || r; + r = ((glGetInvariantFloatvEXT = (PFNGLGETINVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantFloatvEXT")) == NULL) || r; + r = ((glGetInvariantIntegervEXT = (PFNGLGETINVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetInvariantIntegervEXT")) == NULL) || r; + r = ((glGetLocalConstantBooleanvEXT = (PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantBooleanvEXT")) == NULL) || r; + r = ((glGetLocalConstantFloatvEXT = (PFNGLGETLOCALCONSTANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantFloatvEXT")) == NULL) || r; + r = ((glGetLocalConstantIntegervEXT = (PFNGLGETLOCALCONSTANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetLocalConstantIntegervEXT")) == NULL) || r; + r = ((glGetVariantBooleanvEXT = (PFNGLGETVARIANTBOOLEANVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantBooleanvEXT")) == NULL) || r; + r = ((glGetVariantFloatvEXT = (PFNGLGETVARIANTFLOATVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantFloatvEXT")) == NULL) || r; + r = ((glGetVariantIntegervEXT = (PFNGLGETVARIANTINTEGERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantIntegervEXT")) == NULL) || r; + r = ((glGetVariantPointervEXT = (PFNGLGETVARIANTPOINTERVEXTPROC)glewGetProcAddress((const GLubyte*)"glGetVariantPointervEXT")) == NULL) || r; + r = ((glInsertComponentEXT = (PFNGLINSERTCOMPONENTEXTPROC)glewGetProcAddress((const GLubyte*)"glInsertComponentEXT")) == NULL) || r; + r = ((glIsVariantEnabledEXT = (PFNGLISVARIANTENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glIsVariantEnabledEXT")) == NULL) || r; + r = ((glSetInvariantEXT = (PFNGLSETINVARIANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetInvariantEXT")) == NULL) || r; + r = ((glSetLocalConstantEXT = (PFNGLSETLOCALCONSTANTEXTPROC)glewGetProcAddress((const GLubyte*)"glSetLocalConstantEXT")) == NULL) || r; + r = ((glShaderOp1EXT = (PFNGLSHADEROP1EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp1EXT")) == NULL) || r; + r = ((glShaderOp2EXT = (PFNGLSHADEROP2EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp2EXT")) == NULL) || r; + r = ((glShaderOp3EXT = (PFNGLSHADEROP3EXTPROC)glewGetProcAddress((const GLubyte*)"glShaderOp3EXT")) == NULL) || r; + r = ((glSwizzleEXT = (PFNGLSWIZZLEEXTPROC)glewGetProcAddress((const GLubyte*)"glSwizzleEXT")) == NULL) || r; + r = ((glVariantPointerEXT = (PFNGLVARIANTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVariantPointerEXT")) == NULL) || r; + r = ((glVariantbvEXT = (PFNGLVARIANTBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantbvEXT")) == NULL) || r; + r = ((glVariantdvEXT = (PFNGLVARIANTDVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantdvEXT")) == NULL) || r; + r = ((glVariantfvEXT = (PFNGLVARIANTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantfvEXT")) == NULL) || r; + r = ((glVariantivEXT = (PFNGLVARIANTIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantivEXT")) == NULL) || r; + r = ((glVariantsvEXT = (PFNGLVARIANTSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantsvEXT")) == NULL) || r; + r = ((glVariantubvEXT = (PFNGLVARIANTUBVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantubvEXT")) == NULL) || r; + r = ((glVariantuivEXT = (PFNGLVARIANTUIVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantuivEXT")) == NULL) || r; + r = ((glVariantusvEXT = (PFNGLVARIANTUSVEXTPROC)glewGetProcAddress((const GLubyte*)"glVariantusvEXT")) == NULL) || r; + r = ((glWriteMaskEXT = (PFNGLWRITEMASKEXTPROC)glewGetProcAddress((const GLubyte*)"glWriteMaskEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_shader */ + +#ifdef GL_EXT_vertex_weighting + +static GLboolean _glewInit_GL_EXT_vertex_weighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVertexWeightPointerEXT = (PFNGLVERTEXWEIGHTPOINTEREXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightPointerEXT")) == NULL) || r; + r = ((glVertexWeightfEXT = (PFNGLVERTEXWEIGHTFEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfEXT")) == NULL) || r; + r = ((glVertexWeightfvEXT = (PFNGLVERTEXWEIGHTFVEXTPROC)glewGetProcAddress((const GLubyte*)"glVertexWeightfvEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_EXT_vertex_weighting */ + +#ifdef GL_GREMEDY_frame_terminator + +static GLboolean _glewInit_GL_GREMEDY_frame_terminator (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFrameTerminatorGREMEDY = (PFNGLFRAMETERMINATORGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glFrameTerminatorGREMEDY")) == NULL) || r; + + return r; +} + +#endif /* GL_GREMEDY_frame_terminator */ + +#ifdef GL_GREMEDY_string_marker + +static GLboolean _glewInit_GL_GREMEDY_string_marker (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glStringMarkerGREMEDY = (PFNGLSTRINGMARKERGREMEDYPROC)glewGetProcAddress((const GLubyte*)"glStringMarkerGREMEDY")) == NULL) || r; + + return r; +} + +#endif /* GL_GREMEDY_string_marker */ + +#ifdef GL_HP_convolution_border_modes + +#endif /* GL_HP_convolution_border_modes */ + +#ifdef GL_HP_image_transform + +static GLboolean _glewInit_GL_HP_image_transform (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetImageTransformParameterfvHP = (PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterfvHP")) == NULL) || r; + r = ((glGetImageTransformParameterivHP = (PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glGetImageTransformParameterivHP")) == NULL) || r; + r = ((glImageTransformParameterfHP = (PFNGLIMAGETRANSFORMPARAMETERFHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfHP")) == NULL) || r; + r = ((glImageTransformParameterfvHP = (PFNGLIMAGETRANSFORMPARAMETERFVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterfvHP")) == NULL) || r; + r = ((glImageTransformParameteriHP = (PFNGLIMAGETRANSFORMPARAMETERIHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameteriHP")) == NULL) || r; + r = ((glImageTransformParameterivHP = (PFNGLIMAGETRANSFORMPARAMETERIVHPPROC)glewGetProcAddress((const GLubyte*)"glImageTransformParameterivHP")) == NULL) || r; + + return r; +} + +#endif /* GL_HP_image_transform */ + +#ifdef GL_HP_occlusion_test + +#endif /* GL_HP_occlusion_test */ + +#ifdef GL_HP_texture_lighting + +#endif /* GL_HP_texture_lighting */ + +#ifdef GL_IBM_cull_vertex + +#endif /* GL_IBM_cull_vertex */ + +#ifdef GL_IBM_multimode_draw_arrays + +static GLboolean _glewInit_GL_IBM_multimode_draw_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glMultiModeDrawArraysIBM = (PFNGLMULTIMODEDRAWARRAYSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawArraysIBM")) == NULL) || r; + r = ((glMultiModeDrawElementsIBM = (PFNGLMULTIMODEDRAWELEMENTSIBMPROC)glewGetProcAddress((const GLubyte*)"glMultiModeDrawElementsIBM")) == NULL) || r; + + return r; +} + +#endif /* GL_IBM_multimode_draw_arrays */ + +#ifdef GL_IBM_rasterpos_clip + +#endif /* GL_IBM_rasterpos_clip */ + +#ifdef GL_IBM_static_data + +#endif /* GL_IBM_static_data */ + +#ifdef GL_IBM_texture_mirrored_repeat + +#endif /* GL_IBM_texture_mirrored_repeat */ + +#ifdef GL_IBM_vertex_array_lists + +static GLboolean _glewInit_GL_IBM_vertex_array_lists (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorPointerListIBM = (PFNGLCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glColorPointerListIBM")) == NULL) || r; + r = ((glEdgeFlagPointerListIBM = (PFNGLEDGEFLAGPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagPointerListIBM")) == NULL) || r; + r = ((glFogCoordPointerListIBM = (PFNGLFOGCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glFogCoordPointerListIBM")) == NULL) || r; + r = ((glIndexPointerListIBM = (PFNGLINDEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glIndexPointerListIBM")) == NULL) || r; + r = ((glNormalPointerListIBM = (PFNGLNORMALPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glNormalPointerListIBM")) == NULL) || r; + r = ((glSecondaryColorPointerListIBM = (PFNGLSECONDARYCOLORPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorPointerListIBM")) == NULL) || r; + r = ((glTexCoordPointerListIBM = (PFNGLTEXCOORDPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointerListIBM")) == NULL) || r; + r = ((glVertexPointerListIBM = (PFNGLVERTEXPOINTERLISTIBMPROC)glewGetProcAddress((const GLubyte*)"glVertexPointerListIBM")) == NULL) || r; + + return r; +} + +#endif /* GL_IBM_vertex_array_lists */ + +#ifdef GL_INGR_color_clamp + +#endif /* GL_INGR_color_clamp */ + +#ifdef GL_INGR_interlace_read + +#endif /* GL_INGR_interlace_read */ + +#ifdef GL_INTEL_parallel_arrays + +static GLboolean _glewInit_GL_INTEL_parallel_arrays (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorPointervINTEL = (PFNGLCOLORPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glColorPointervINTEL")) == NULL) || r; + r = ((glNormalPointervINTEL = (PFNGLNORMALPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glNormalPointervINTEL")) == NULL) || r; + r = ((glTexCoordPointervINTEL = (PFNGLTEXCOORDPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glTexCoordPointervINTEL")) == NULL) || r; + r = ((glVertexPointervINTEL = (PFNGLVERTEXPOINTERVINTELPROC)glewGetProcAddress((const GLubyte*)"glVertexPointervINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_parallel_arrays */ + +#ifdef GL_INTEL_texture_scissor + +static GLboolean _glewInit_GL_INTEL_texture_scissor (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexScissorFuncINTEL = (PFNGLTEXSCISSORFUNCINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorFuncINTEL")) == NULL) || r; + r = ((glTexScissorINTEL = (PFNGLTEXSCISSORINTELPROC)glewGetProcAddress((const GLubyte*)"glTexScissorINTEL")) == NULL) || r; + + return r; +} + +#endif /* GL_INTEL_texture_scissor */ + +#ifdef GL_KTX_buffer_region + +static GLboolean _glewInit_GL_KTX_buffer_region (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferRegionEnabledEXT = (PFNGLBUFFERREGIONENABLEDEXTPROC)glewGetProcAddress((const GLubyte*)"glBufferRegionEnabledEXT")) == NULL) || r; + r = ((glDeleteBufferRegionEXT = (PFNGLDELETEBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glDeleteBufferRegionEXT")) == NULL) || r; + r = ((glDrawBufferRegionEXT = (PFNGLDRAWBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glDrawBufferRegionEXT")) == NULL) || r; + r = ((glNewBufferRegionEXT = (PFNGLNEWBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glNewBufferRegionEXT")) == NULL) || r; + r = ((glReadBufferRegionEXT = (PFNGLREADBUFFERREGIONEXTPROC)glewGetProcAddress((const GLubyte*)"glReadBufferRegionEXT")) == NULL) || r; + + return r; +} + +#endif /* GL_KTX_buffer_region */ + +#ifdef GL_MESAX_texture_stack + +#endif /* GL_MESAX_texture_stack */ + +#ifdef GL_MESA_pack_invert + +#endif /* GL_MESA_pack_invert */ + +#ifdef GL_MESA_resize_buffers + +static GLboolean _glewInit_GL_MESA_resize_buffers (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glResizeBuffersMESA = (PFNGLRESIZEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glResizeBuffersMESA")) == NULL) || r; + + return r; +} + +#endif /* GL_MESA_resize_buffers */ + +#ifdef GL_MESA_window_pos + +static GLboolean _glewInit_GL_MESA_window_pos (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glWindowPos2dMESA = (PFNGLWINDOWPOS2DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dMESA")) == NULL) || r; + r = ((glWindowPos2dvMESA = (PFNGLWINDOWPOS2DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2dvMESA")) == NULL) || r; + r = ((glWindowPos2fMESA = (PFNGLWINDOWPOS2FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fMESA")) == NULL) || r; + r = ((glWindowPos2fvMESA = (PFNGLWINDOWPOS2FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2fvMESA")) == NULL) || r; + r = ((glWindowPos2iMESA = (PFNGLWINDOWPOS2IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2iMESA")) == NULL) || r; + r = ((glWindowPos2ivMESA = (PFNGLWINDOWPOS2IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2ivMESA")) == NULL) || r; + r = ((glWindowPos2sMESA = (PFNGLWINDOWPOS2SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2sMESA")) == NULL) || r; + r = ((glWindowPos2svMESA = (PFNGLWINDOWPOS2SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos2svMESA")) == NULL) || r; + r = ((glWindowPos3dMESA = (PFNGLWINDOWPOS3DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dMESA")) == NULL) || r; + r = ((glWindowPos3dvMESA = (PFNGLWINDOWPOS3DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3dvMESA")) == NULL) || r; + r = ((glWindowPos3fMESA = (PFNGLWINDOWPOS3FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fMESA")) == NULL) || r; + r = ((glWindowPos3fvMESA = (PFNGLWINDOWPOS3FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3fvMESA")) == NULL) || r; + r = ((glWindowPos3iMESA = (PFNGLWINDOWPOS3IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3iMESA")) == NULL) || r; + r = ((glWindowPos3ivMESA = (PFNGLWINDOWPOS3IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3ivMESA")) == NULL) || r; + r = ((glWindowPos3sMESA = (PFNGLWINDOWPOS3SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3sMESA")) == NULL) || r; + r = ((glWindowPos3svMESA = (PFNGLWINDOWPOS3SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos3svMESA")) == NULL) || r; + r = ((glWindowPos4dMESA = (PFNGLWINDOWPOS4DMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dMESA")) == NULL) || r; + r = ((glWindowPos4dvMESA = (PFNGLWINDOWPOS4DVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4dvMESA")) == NULL) || r; + r = ((glWindowPos4fMESA = (PFNGLWINDOWPOS4FMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fMESA")) == NULL) || r; + r = ((glWindowPos4fvMESA = (PFNGLWINDOWPOS4FVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4fvMESA")) == NULL) || r; + r = ((glWindowPos4iMESA = (PFNGLWINDOWPOS4IMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4iMESA")) == NULL) || r; + r = ((glWindowPos4ivMESA = (PFNGLWINDOWPOS4IVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4ivMESA")) == NULL) || r; + r = ((glWindowPos4sMESA = (PFNGLWINDOWPOS4SMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4sMESA")) == NULL) || r; + r = ((glWindowPos4svMESA = (PFNGLWINDOWPOS4SVMESAPROC)glewGetProcAddress((const GLubyte*)"glWindowPos4svMESA")) == NULL) || r; + + return r; +} + +#endif /* GL_MESA_window_pos */ + +#ifdef GL_MESA_ycbcr_texture + +#endif /* GL_MESA_ycbcr_texture */ + +#ifdef GL_NVX_gpu_memory_info + +#endif /* GL_NVX_gpu_memory_info */ + +#ifdef GL_NV_blend_square + +#endif /* GL_NV_blend_square */ + +#ifdef GL_NV_conditional_render + +static GLboolean _glewInit_GL_NV_conditional_render (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginConditionalRenderNV = (PFNGLBEGINCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glBeginConditionalRenderNV")) == NULL) || r; + r = ((glEndConditionalRenderNV = (PFNGLENDCONDITIONALRENDERNVPROC)glewGetProcAddress((const GLubyte*)"glEndConditionalRenderNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_conditional_render */ + +#ifdef GL_NV_copy_depth_to_color + +#endif /* GL_NV_copy_depth_to_color */ + +#ifdef GL_NV_copy_image + +static GLboolean _glewInit_GL_NV_copy_image (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCopyImageSubDataNV = (PFNGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_copy_image */ + +#ifdef GL_NV_depth_buffer_float + +static GLboolean _glewInit_GL_NV_depth_buffer_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthdNV = (PFNGLCLEARDEPTHDNVPROC)glewGetProcAddress((const GLubyte*)"glClearDepthdNV")) == NULL) || r; + r = ((glDepthBoundsdNV = (PFNGLDEPTHBOUNDSDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthBoundsdNV")) == NULL) || r; + r = ((glDepthRangedNV = (PFNGLDEPTHRANGEDNVPROC)glewGetProcAddress((const GLubyte*)"glDepthRangedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_depth_buffer_float */ + +#ifdef GL_NV_depth_clamp + +#endif /* GL_NV_depth_clamp */ + +#ifdef GL_NV_depth_range_unclamped + +#endif /* GL_NV_depth_range_unclamped */ + +#ifdef GL_NV_evaluators + +static GLboolean _glewInit_GL_NV_evaluators (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glEvalMapsNV = (PFNGLEVALMAPSNVPROC)glewGetProcAddress((const GLubyte*)"glEvalMapsNV")) == NULL) || r; + r = ((glGetMapAttribParameterfvNV = (PFNGLGETMAPATTRIBPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterfvNV")) == NULL) || r; + r = ((glGetMapAttribParameterivNV = (PFNGLGETMAPATTRIBPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapAttribParameterivNV")) == NULL) || r; + r = ((glGetMapControlPointsNV = (PFNGLGETMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapControlPointsNV")) == NULL) || r; + r = ((glGetMapParameterfvNV = (PFNGLGETMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterfvNV")) == NULL) || r; + r = ((glGetMapParameterivNV = (PFNGLGETMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMapParameterivNV")) == NULL) || r; + r = ((glMapControlPointsNV = (PFNGLMAPCONTROLPOINTSNVPROC)glewGetProcAddress((const GLubyte*)"glMapControlPointsNV")) == NULL) || r; + r = ((glMapParameterfvNV = (PFNGLMAPPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterfvNV")) == NULL) || r; + r = ((glMapParameterivNV = (PFNGLMAPPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glMapParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_evaluators */ + +#ifdef GL_NV_explicit_multisample + +static GLboolean _glewInit_GL_NV_explicit_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetMultisamplefvNV = (PFNGLGETMULTISAMPLEFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetMultisamplefvNV")) == NULL) || r; + r = ((glSampleMaskIndexedNV = (PFNGLSAMPLEMASKINDEXEDNVPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskIndexedNV")) == NULL) || r; + r = ((glTexRenderbufferNV = (PFNGLTEXRENDERBUFFERNVPROC)glewGetProcAddress((const GLubyte*)"glTexRenderbufferNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_explicit_multisample */ + +#ifdef GL_NV_fence + +static GLboolean _glewInit_GL_NV_fence (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDeleteFencesNV = (PFNGLDELETEFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteFencesNV")) == NULL) || r; + r = ((glFinishFenceNV = (PFNGLFINISHFENCENVPROC)glewGetProcAddress((const GLubyte*)"glFinishFenceNV")) == NULL) || r; + r = ((glGenFencesNV = (PFNGLGENFENCESNVPROC)glewGetProcAddress((const GLubyte*)"glGenFencesNV")) == NULL) || r; + r = ((glGetFenceivNV = (PFNGLGETFENCEIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFenceivNV")) == NULL) || r; + r = ((glIsFenceNV = (PFNGLISFENCENVPROC)glewGetProcAddress((const GLubyte*)"glIsFenceNV")) == NULL) || r; + r = ((glSetFenceNV = (PFNGLSETFENCENVPROC)glewGetProcAddress((const GLubyte*)"glSetFenceNV")) == NULL) || r; + r = ((glTestFenceNV = (PFNGLTESTFENCENVPROC)glewGetProcAddress((const GLubyte*)"glTestFenceNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fence */ + +#ifdef GL_NV_float_buffer + +#endif /* GL_NV_float_buffer */ + +#ifdef GL_NV_fog_distance + +#endif /* GL_NV_fog_distance */ + +#ifdef GL_NV_fragment_program + +static GLboolean _glewInit_GL_NV_fragment_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetProgramNamedParameterdvNV = (PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterdvNV")) == NULL) || r; + r = ((glGetProgramNamedParameterfvNV = (PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramNamedParameterfvNV")) == NULL) || r; + r = ((glProgramNamedParameter4dNV = (PFNGLPROGRAMNAMEDPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dNV")) == NULL) || r; + r = ((glProgramNamedParameter4dvNV = (PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4dvNV")) == NULL) || r; + r = ((glProgramNamedParameter4fNV = (PFNGLPROGRAMNAMEDPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fNV")) == NULL) || r; + r = ((glProgramNamedParameter4fvNV = (PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramNamedParameter4fvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_fragment_program */ + +#ifdef GL_NV_fragment_program2 + +#endif /* GL_NV_fragment_program2 */ + +#ifdef GL_NV_fragment_program4 + +#endif /* GL_NV_fragment_program4 */ + +#ifdef GL_NV_fragment_program_option + +#endif /* GL_NV_fragment_program_option */ + +#ifdef GL_NV_framebuffer_multisample_coverage + +static GLboolean _glewInit_GL_NV_framebuffer_multisample_coverage (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glRenderbufferStorageMultisampleCoverageNV = (PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC)glewGetProcAddress((const GLubyte*)"glRenderbufferStorageMultisampleCoverageNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +#ifdef GL_NV_geometry_program4 + +static GLboolean _glewInit_GL_NV_geometry_program4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramVertexLimitNV = (PFNGLPROGRAMVERTEXLIMITNVPROC)glewGetProcAddress((const GLubyte*)"glProgramVertexLimitNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_geometry_program4 */ + +#ifdef GL_NV_geometry_shader4 + +#endif /* GL_NV_geometry_shader4 */ + +#ifdef GL_NV_gpu_program4 + +static GLboolean _glewInit_GL_NV_gpu_program4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramEnvParameterI4iNV = (PFNGLPROGRAMENVPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4iNV")) == NULL) || r; + r = ((glProgramEnvParameterI4ivNV = (PFNGLPROGRAMENVPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4ivNV")) == NULL) || r; + r = ((glProgramEnvParameterI4uiNV = (PFNGLPROGRAMENVPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uiNV")) == NULL) || r; + r = ((glProgramEnvParameterI4uivNV = (PFNGLPROGRAMENVPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParameterI4uivNV")) == NULL) || r; + r = ((glProgramEnvParametersI4ivNV = (PFNGLPROGRAMENVPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4ivNV")) == NULL) || r; + r = ((glProgramEnvParametersI4uivNV = (PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramEnvParametersI4uivNV")) == NULL) || r; + r = ((glProgramLocalParameterI4iNV = (PFNGLPROGRAMLOCALPARAMETERI4INVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4iNV")) == NULL) || r; + r = ((glProgramLocalParameterI4ivNV = (PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4ivNV")) == NULL) || r; + r = ((glProgramLocalParameterI4uiNV = (PFNGLPROGRAMLOCALPARAMETERI4UINVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uiNV")) == NULL) || r; + r = ((glProgramLocalParameterI4uivNV = (PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParameterI4uivNV")) == NULL) || r; + r = ((glProgramLocalParametersI4ivNV = (PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4ivNV")) == NULL) || r; + r = ((glProgramLocalParametersI4uivNV = (PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramLocalParametersI4uivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_program4 */ + +#ifdef GL_NV_gpu_program5 + +#endif /* GL_NV_gpu_program5 */ + +#ifdef GL_NV_gpu_program_fp64 + +#endif /* GL_NV_gpu_program_fp64 */ + +#ifdef GL_NV_gpu_shader5 + +static GLboolean _glewInit_GL_NV_gpu_shader5 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetUniformi64vNV = (PFNGLGETUNIFORMI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformi64vNV")) == NULL) || r; + r = ((glGetUniformui64vNV = (PFNGLGETUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetUniformui64vNV")) == NULL) || r; + r = ((glProgramUniform1i64NV = (PFNGLPROGRAMUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64NV")) == NULL) || r; + r = ((glProgramUniform1i64vNV = (PFNGLPROGRAMUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1i64vNV")) == NULL) || r; + r = ((glProgramUniform1ui64NV = (PFNGLPROGRAMUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64NV")) == NULL) || r; + r = ((glProgramUniform1ui64vNV = (PFNGLPROGRAMUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform1ui64vNV")) == NULL) || r; + r = ((glProgramUniform2i64NV = (PFNGLPROGRAMUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64NV")) == NULL) || r; + r = ((glProgramUniform2i64vNV = (PFNGLPROGRAMUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2i64vNV")) == NULL) || r; + r = ((glProgramUniform2ui64NV = (PFNGLPROGRAMUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64NV")) == NULL) || r; + r = ((glProgramUniform2ui64vNV = (PFNGLPROGRAMUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform2ui64vNV")) == NULL) || r; + r = ((glProgramUniform3i64NV = (PFNGLPROGRAMUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64NV")) == NULL) || r; + r = ((glProgramUniform3i64vNV = (PFNGLPROGRAMUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3i64vNV")) == NULL) || r; + r = ((glProgramUniform3ui64NV = (PFNGLPROGRAMUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64NV")) == NULL) || r; + r = ((glProgramUniform3ui64vNV = (PFNGLPROGRAMUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform3ui64vNV")) == NULL) || r; + r = ((glProgramUniform4i64NV = (PFNGLPROGRAMUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64NV")) == NULL) || r; + r = ((glProgramUniform4i64vNV = (PFNGLPROGRAMUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4i64vNV")) == NULL) || r; + r = ((glProgramUniform4ui64NV = (PFNGLPROGRAMUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64NV")) == NULL) || r; + r = ((glProgramUniform4ui64vNV = (PFNGLPROGRAMUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniform4ui64vNV")) == NULL) || r; + r = ((glUniform1i64NV = (PFNGLUNIFORM1I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64NV")) == NULL) || r; + r = ((glUniform1i64vNV = (PFNGLUNIFORM1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1i64vNV")) == NULL) || r; + r = ((glUniform1ui64NV = (PFNGLUNIFORM1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64NV")) == NULL) || r; + r = ((glUniform1ui64vNV = (PFNGLUNIFORM1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform1ui64vNV")) == NULL) || r; + r = ((glUniform2i64NV = (PFNGLUNIFORM2I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64NV")) == NULL) || r; + r = ((glUniform2i64vNV = (PFNGLUNIFORM2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2i64vNV")) == NULL) || r; + r = ((glUniform2ui64NV = (PFNGLUNIFORM2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64NV")) == NULL) || r; + r = ((glUniform2ui64vNV = (PFNGLUNIFORM2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform2ui64vNV")) == NULL) || r; + r = ((glUniform3i64NV = (PFNGLUNIFORM3I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64NV")) == NULL) || r; + r = ((glUniform3i64vNV = (PFNGLUNIFORM3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3i64vNV")) == NULL) || r; + r = ((glUniform3ui64NV = (PFNGLUNIFORM3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64NV")) == NULL) || r; + r = ((glUniform3ui64vNV = (PFNGLUNIFORM3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform3ui64vNV")) == NULL) || r; + r = ((glUniform4i64NV = (PFNGLUNIFORM4I64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64NV")) == NULL) || r; + r = ((glUniform4i64vNV = (PFNGLUNIFORM4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4i64vNV")) == NULL) || r; + r = ((glUniform4ui64NV = (PFNGLUNIFORM4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64NV")) == NULL) || r; + r = ((glUniform4ui64vNV = (PFNGLUNIFORM4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniform4ui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_gpu_shader5 */ + +#ifdef GL_NV_half_float + +static GLboolean _glewInit_GL_NV_half_float (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColor3hNV = (PFNGLCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hNV")) == NULL) || r; + r = ((glColor3hvNV = (PFNGLCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor3hvNV")) == NULL) || r; + r = ((glColor4hNV = (PFNGLCOLOR4HNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hNV")) == NULL) || r; + r = ((glColor4hvNV = (PFNGLCOLOR4HVNVPROC)glewGetProcAddress((const GLubyte*)"glColor4hvNV")) == NULL) || r; + r = ((glFogCoordhNV = (PFNGLFOGCOORDHNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhNV")) == NULL) || r; + r = ((glFogCoordhvNV = (PFNGLFOGCOORDHVNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordhvNV")) == NULL) || r; + r = ((glMultiTexCoord1hNV = (PFNGLMULTITEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hNV")) == NULL) || r; + r = ((glMultiTexCoord1hvNV = (PFNGLMULTITEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord1hvNV")) == NULL) || r; + r = ((glMultiTexCoord2hNV = (PFNGLMULTITEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hNV")) == NULL) || r; + r = ((glMultiTexCoord2hvNV = (PFNGLMULTITEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord2hvNV")) == NULL) || r; + r = ((glMultiTexCoord3hNV = (PFNGLMULTITEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hNV")) == NULL) || r; + r = ((glMultiTexCoord3hvNV = (PFNGLMULTITEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord3hvNV")) == NULL) || r; + r = ((glMultiTexCoord4hNV = (PFNGLMULTITEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hNV")) == NULL) || r; + r = ((glMultiTexCoord4hvNV = (PFNGLMULTITEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glMultiTexCoord4hvNV")) == NULL) || r; + r = ((glNormal3hNV = (PFNGLNORMAL3HNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hNV")) == NULL) || r; + r = ((glNormal3hvNV = (PFNGLNORMAL3HVNVPROC)glewGetProcAddress((const GLubyte*)"glNormal3hvNV")) == NULL) || r; + r = ((glSecondaryColor3hNV = (PFNGLSECONDARYCOLOR3HNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hNV")) == NULL) || r; + r = ((glSecondaryColor3hvNV = (PFNGLSECONDARYCOLOR3HVNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColor3hvNV")) == NULL) || r; + r = ((glTexCoord1hNV = (PFNGLTEXCOORD1HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hNV")) == NULL) || r; + r = ((glTexCoord1hvNV = (PFNGLTEXCOORD1HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord1hvNV")) == NULL) || r; + r = ((glTexCoord2hNV = (PFNGLTEXCOORD2HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hNV")) == NULL) || r; + r = ((glTexCoord2hvNV = (PFNGLTEXCOORD2HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2hvNV")) == NULL) || r; + r = ((glTexCoord3hNV = (PFNGLTEXCOORD3HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hNV")) == NULL) || r; + r = ((glTexCoord3hvNV = (PFNGLTEXCOORD3HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord3hvNV")) == NULL) || r; + r = ((glTexCoord4hNV = (PFNGLTEXCOORD4HNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hNV")) == NULL) || r; + r = ((glTexCoord4hvNV = (PFNGLTEXCOORD4HVNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4hvNV")) == NULL) || r; + r = ((glVertex2hNV = (PFNGLVERTEX2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hNV")) == NULL) || r; + r = ((glVertex2hvNV = (PFNGLVERTEX2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex2hvNV")) == NULL) || r; + r = ((glVertex3hNV = (PFNGLVERTEX3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hNV")) == NULL) || r; + r = ((glVertex3hvNV = (PFNGLVERTEX3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex3hvNV")) == NULL) || r; + r = ((glVertex4hNV = (PFNGLVERTEX4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hNV")) == NULL) || r; + r = ((glVertex4hvNV = (PFNGLVERTEX4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertex4hvNV")) == NULL) || r; + r = ((glVertexAttrib1hNV = (PFNGLVERTEXATTRIB1HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hNV")) == NULL) || r; + r = ((glVertexAttrib1hvNV = (PFNGLVERTEXATTRIB1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1hvNV")) == NULL) || r; + r = ((glVertexAttrib2hNV = (PFNGLVERTEXATTRIB2HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hNV")) == NULL) || r; + r = ((glVertexAttrib2hvNV = (PFNGLVERTEXATTRIB2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2hvNV")) == NULL) || r; + r = ((glVertexAttrib3hNV = (PFNGLVERTEXATTRIB3HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hNV")) == NULL) || r; + r = ((glVertexAttrib3hvNV = (PFNGLVERTEXATTRIB3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3hvNV")) == NULL) || r; + r = ((glVertexAttrib4hNV = (PFNGLVERTEXATTRIB4HNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hNV")) == NULL) || r; + r = ((glVertexAttrib4hvNV = (PFNGLVERTEXATTRIB4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4hvNV")) == NULL) || r; + r = ((glVertexAttribs1hvNV = (PFNGLVERTEXATTRIBS1HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1hvNV")) == NULL) || r; + r = ((glVertexAttribs2hvNV = (PFNGLVERTEXATTRIBS2HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2hvNV")) == NULL) || r; + r = ((glVertexAttribs3hvNV = (PFNGLVERTEXATTRIBS3HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3hvNV")) == NULL) || r; + r = ((glVertexAttribs4hvNV = (PFNGLVERTEXATTRIBS4HVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4hvNV")) == NULL) || r; + r = ((glVertexWeighthNV = (PFNGLVERTEXWEIGHTHNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthNV")) == NULL) || r; + r = ((glVertexWeighthvNV = (PFNGLVERTEXWEIGHTHVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexWeighthvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_half_float */ + +#ifdef GL_NV_light_max_exponent + +#endif /* GL_NV_light_max_exponent */ + +#ifdef GL_NV_multisample_coverage + +#endif /* GL_NV_multisample_coverage */ + +#ifdef GL_NV_multisample_filter_hint + +#endif /* GL_NV_multisample_filter_hint */ + +#ifdef GL_NV_occlusion_query + +static GLboolean _glewInit_GL_NV_occlusion_query (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBeginOcclusionQueryNV = (PFNGLBEGINOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glBeginOcclusionQueryNV")) == NULL) || r; + r = ((glDeleteOcclusionQueriesNV = (PFNGLDELETEOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteOcclusionQueriesNV")) == NULL) || r; + r = ((glEndOcclusionQueryNV = (PFNGLENDOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glEndOcclusionQueryNV")) == NULL) || r; + r = ((glGenOcclusionQueriesNV = (PFNGLGENOCCLUSIONQUERIESNVPROC)glewGetProcAddress((const GLubyte*)"glGenOcclusionQueriesNV")) == NULL) || r; + r = ((glGetOcclusionQueryivNV = (PFNGLGETOCCLUSIONQUERYIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryivNV")) == NULL) || r; + r = ((glGetOcclusionQueryuivNV = (PFNGLGETOCCLUSIONQUERYUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetOcclusionQueryuivNV")) == NULL) || r; + r = ((glIsOcclusionQueryNV = (PFNGLISOCCLUSIONQUERYNVPROC)glewGetProcAddress((const GLubyte*)"glIsOcclusionQueryNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_occlusion_query */ + +#ifdef GL_NV_packed_depth_stencil + +#endif /* GL_NV_packed_depth_stencil */ + +#ifdef GL_NV_parameter_buffer_object + +static GLboolean _glewInit_GL_NV_parameter_buffer_object (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glProgramBufferParametersIivNV = (PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIivNV")) == NULL) || r; + r = ((glProgramBufferParametersIuivNV = (PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersIuivNV")) == NULL) || r; + r = ((glProgramBufferParametersfvNV = (PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramBufferParametersfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_parameter_buffer_object */ + +#ifdef GL_NV_parameter_buffer_object2 + +#endif /* GL_NV_parameter_buffer_object2 */ + +#ifdef GL_NV_pixel_data_range + +static GLboolean _glewInit_GL_NV_pixel_data_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushPixelDataRangeNV = (PFNGLFLUSHPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushPixelDataRangeNV")) == NULL) || r; + r = ((glPixelDataRangeNV = (PFNGLPIXELDATARANGENVPROC)glewGetProcAddress((const GLubyte*)"glPixelDataRangeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_pixel_data_range */ + +#ifdef GL_NV_point_sprite + +static GLboolean _glewInit_GL_NV_point_sprite (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPointParameteriNV = (PFNGLPOINTPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glPointParameteriNV")) == NULL) || r; + r = ((glPointParameterivNV = (PFNGLPOINTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glPointParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_point_sprite */ + +#ifdef GL_NV_present_video + +static GLboolean _glewInit_GL_NV_present_video (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVideoi64vNV = (PFNGLGETVIDEOI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoi64vNV")) == NULL) || r; + r = ((glGetVideoivNV = (PFNGLGETVIDEOIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoivNV")) == NULL) || r; + r = ((glGetVideoui64vNV = (PFNGLGETVIDEOUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideoui64vNV")) == NULL) || r; + r = ((glGetVideouivNV = (PFNGLGETVIDEOUIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVideouivNV")) == NULL) || r; + r = ((glPresentFrameDualFillNV = (PFNGLPRESENTFRAMEDUALFILLNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameDualFillNV")) == NULL) || r; + r = ((glPresentFrameKeyedNV = (PFNGLPRESENTFRAMEKEYEDNVPROC)glewGetProcAddress((const GLubyte*)"glPresentFrameKeyedNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_present_video */ + +#ifdef GL_NV_primitive_restart + +static GLboolean _glewInit_GL_NV_primitive_restart (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPrimitiveRestartIndexNV = (PFNGLPRIMITIVERESTARTINDEXNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartIndexNV")) == NULL) || r; + r = ((glPrimitiveRestartNV = (PFNGLPRIMITIVERESTARTNVPROC)glewGetProcAddress((const GLubyte*)"glPrimitiveRestartNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_primitive_restart */ + +#ifdef GL_NV_register_combiners + +static GLboolean _glewInit_GL_NV_register_combiners (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCombinerInputNV = (PFNGLCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerInputNV")) == NULL) || r; + r = ((glCombinerOutputNV = (PFNGLCOMBINEROUTPUTNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerOutputNV")) == NULL) || r; + r = ((glCombinerParameterfNV = (PFNGLCOMBINERPARAMETERFNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfNV")) == NULL) || r; + r = ((glCombinerParameterfvNV = (PFNGLCOMBINERPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterfvNV")) == NULL) || r; + r = ((glCombinerParameteriNV = (PFNGLCOMBINERPARAMETERINVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameteriNV")) == NULL) || r; + r = ((glCombinerParameterivNV = (PFNGLCOMBINERPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerParameterivNV")) == NULL) || r; + r = ((glFinalCombinerInputNV = (PFNGLFINALCOMBINERINPUTNVPROC)glewGetProcAddress((const GLubyte*)"glFinalCombinerInputNV")) == NULL) || r; + r = ((glGetCombinerInputParameterfvNV = (PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterfvNV")) == NULL) || r; + r = ((glGetCombinerInputParameterivNV = (PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerInputParameterivNV")) == NULL) || r; + r = ((glGetCombinerOutputParameterfvNV = (PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterfvNV")) == NULL) || r; + r = ((glGetCombinerOutputParameterivNV = (PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerOutputParameterivNV")) == NULL) || r; + r = ((glGetFinalCombinerInputParameterfvNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterfvNV")) == NULL) || r; + r = ((glGetFinalCombinerInputParameterivNV = (PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetFinalCombinerInputParameterivNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_register_combiners */ + +#ifdef GL_NV_register_combiners2 + +static GLboolean _glewInit_GL_NV_register_combiners2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glCombinerStageParameterfvNV = (PFNGLCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glCombinerStageParameterfvNV")) == NULL) || r; + r = ((glGetCombinerStageParameterfvNV = (PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetCombinerStageParameterfvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_register_combiners2 */ + +#ifdef GL_NV_shader_buffer_load + +static GLboolean _glewInit_GL_NV_shader_buffer_load (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetBufferParameterui64vNV = (PFNGLGETBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetBufferParameterui64vNV")) == NULL) || r; + r = ((glGetIntegerui64vNV = (PFNGLGETINTEGERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64vNV")) == NULL) || r; + r = ((glGetNamedBufferParameterui64vNV = (PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetNamedBufferParameterui64vNV")) == NULL) || r; + r = ((glIsBufferResidentNV = (PFNGLISBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsBufferResidentNV")) == NULL) || r; + r = ((glIsNamedBufferResidentNV = (PFNGLISNAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glIsNamedBufferResidentNV")) == NULL) || r; + r = ((glMakeBufferNonResidentNV = (PFNGLMAKEBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferNonResidentNV")) == NULL) || r; + r = ((glMakeBufferResidentNV = (PFNGLMAKEBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeBufferResidentNV")) == NULL) || r; + r = ((glMakeNamedBufferNonResidentNV = (PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferNonResidentNV")) == NULL) || r; + r = ((glMakeNamedBufferResidentNV = (PFNGLMAKENAMEDBUFFERRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glMakeNamedBufferResidentNV")) == NULL) || r; + r = ((glProgramUniformui64NV = (PFNGLPROGRAMUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64NV")) == NULL) || r; + r = ((glProgramUniformui64vNV = (PFNGLPROGRAMUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glProgramUniformui64vNV")) == NULL) || r; + r = ((glUniformui64NV = (PFNGLUNIFORMUI64NVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64NV")) == NULL) || r; + r = ((glUniformui64vNV = (PFNGLUNIFORMUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glUniformui64vNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_shader_buffer_load */ + +#ifdef GL_NV_tessellation_program5 + +#endif /* GL_NV_tessellation_program5 */ + +#ifdef GL_NV_texgen_emboss + +#endif /* GL_NV_texgen_emboss */ + +#ifdef GL_NV_texgen_reflection + +#endif /* GL_NV_texgen_reflection */ + +#ifdef GL_NV_texture_barrier + +static GLboolean _glewInit_GL_NV_texture_barrier (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureBarrierNV = (PFNGLTEXTUREBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glTextureBarrierNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_texture_barrier */ + +#ifdef GL_NV_texture_compression_vtc + +#endif /* GL_NV_texture_compression_vtc */ + +#ifdef GL_NV_texture_env_combine4 + +#endif /* GL_NV_texture_env_combine4 */ + +#ifdef GL_NV_texture_expand_normal + +#endif /* GL_NV_texture_expand_normal */ + +#ifdef GL_NV_texture_rectangle + +#endif /* GL_NV_texture_rectangle */ + +#ifdef GL_NV_texture_shader + +#endif /* GL_NV_texture_shader */ + +#ifdef GL_NV_texture_shader2 + +#endif /* GL_NV_texture_shader2 */ + +#ifdef GL_NV_texture_shader3 + +#endif /* GL_NV_texture_shader3 */ + +#ifdef GL_NV_transform_feedback + +static GLboolean _glewInit_GL_NV_transform_feedback (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glActiveVaryingNV = (PFNGLACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glActiveVaryingNV")) == NULL) || r; + r = ((glBeginTransformFeedbackNV = (PFNGLBEGINTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBeginTransformFeedbackNV")) == NULL) || r; + r = ((glBindBufferBaseNV = (PFNGLBINDBUFFERBASENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferBaseNV")) == NULL) || r; + r = ((glBindBufferOffsetNV = (PFNGLBINDBUFFEROFFSETNVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferOffsetNV")) == NULL) || r; + r = ((glBindBufferRangeNV = (PFNGLBINDBUFFERRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBindBufferRangeNV")) == NULL) || r; + r = ((glEndTransformFeedbackNV = (PFNGLENDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glEndTransformFeedbackNV")) == NULL) || r; + r = ((glGetActiveVaryingNV = (PFNGLGETACTIVEVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetActiveVaryingNV")) == NULL) || r; + r = ((glGetTransformFeedbackVaryingNV = (PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetTransformFeedbackVaryingNV")) == NULL) || r; + r = ((glGetVaryingLocationNV = (PFNGLGETVARYINGLOCATIONNVPROC)glewGetProcAddress((const GLubyte*)"glGetVaryingLocationNV")) == NULL) || r; + r = ((glTransformFeedbackAttribsNV = (PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackAttribsNV")) == NULL) || r; + r = ((glTransformFeedbackVaryingsNV = (PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC)glewGetProcAddress((const GLubyte*)"glTransformFeedbackVaryingsNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_transform_feedback */ + +#ifdef GL_NV_transform_feedback2 + +static GLboolean _glewInit_GL_NV_transform_feedback2 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBindTransformFeedbackNV = (PFNGLBINDTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glBindTransformFeedbackNV")) == NULL) || r; + r = ((glDeleteTransformFeedbacksNV = (PFNGLDELETETRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteTransformFeedbacksNV")) == NULL) || r; + r = ((glDrawTransformFeedbackNV = (PFNGLDRAWTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glDrawTransformFeedbackNV")) == NULL) || r; + r = ((glGenTransformFeedbacksNV = (PFNGLGENTRANSFORMFEEDBACKSNVPROC)glewGetProcAddress((const GLubyte*)"glGenTransformFeedbacksNV")) == NULL) || r; + r = ((glIsTransformFeedbackNV = (PFNGLISTRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glIsTransformFeedbackNV")) == NULL) || r; + r = ((glPauseTransformFeedbackNV = (PFNGLPAUSETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glPauseTransformFeedbackNV")) == NULL) || r; + r = ((glResumeTransformFeedbackNV = (PFNGLRESUMETRANSFORMFEEDBACKNVPROC)glewGetProcAddress((const GLubyte*)"glResumeTransformFeedbackNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_transform_feedback2 */ + +#ifdef GL_NV_vdpau_interop + +static GLboolean _glewInit_GL_NV_vdpau_interop (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glVDPAUFiniNV = (PFNGLVDPAUFININVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUFiniNV")) == NULL) || r; + r = ((glVDPAUGetSurfaceivNV = (PFNGLVDPAUGETSURFACEIVNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUGetSurfaceivNV")) == NULL) || r; + r = ((glVDPAUInitNV = (PFNGLVDPAUINITNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUInitNV")) == NULL) || r; + r = ((glVDPAUIsSurfaceNV = (PFNGLVDPAUISSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUIsSurfaceNV")) == NULL) || r; + r = ((glVDPAUMapSurfacesNV = (PFNGLVDPAUMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUMapSurfacesNV")) == NULL) || r; + r = ((glVDPAURegisterOutputSurfaceNV = (PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterOutputSurfaceNV")) == NULL) || r; + r = ((glVDPAURegisterVideoSurfaceNV = (PFNGLVDPAUREGISTERVIDEOSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAURegisterVideoSurfaceNV")) == NULL) || r; + r = ((glVDPAUSurfaceAccessNV = (PFNGLVDPAUSURFACEACCESSNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUSurfaceAccessNV")) == NULL) || r; + r = ((glVDPAUUnmapSurfacesNV = (PFNGLVDPAUUNMAPSURFACESNVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnmapSurfacesNV")) == NULL) || r; + r = ((glVDPAUUnregisterSurfaceNV = (PFNGLVDPAUUNREGISTERSURFACENVPROC)glewGetProcAddress((const GLubyte*)"glVDPAUUnregisterSurfaceNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vdpau_interop */ + +#ifdef GL_NV_vertex_array_range + +static GLboolean _glewInit_GL_NV_vertex_array_range (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushVertexArrayRangeNV = (PFNGLFLUSHVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glFlushVertexArrayRangeNV")) == NULL) || r; + r = ((glVertexArrayRangeNV = (PFNGLVERTEXARRAYRANGENVPROC)glewGetProcAddress((const GLubyte*)"glVertexArrayRangeNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_array_range */ + +#ifdef GL_NV_vertex_array_range2 + +#endif /* GL_NV_vertex_array_range2 */ + +#ifdef GL_NV_vertex_attrib_integer_64bit + +static GLboolean _glewInit_GL_NV_vertex_attrib_integer_64bit (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetVertexAttribLi64vNV = (PFNGLGETVERTEXATTRIBLI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLi64vNV")) == NULL) || r; + r = ((glGetVertexAttribLui64vNV = (PFNGLGETVERTEXATTRIBLUI64VNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribLui64vNV")) == NULL) || r; + r = ((glVertexAttribL1i64NV = (PFNGLVERTEXATTRIBL1I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64NV")) == NULL) || r; + r = ((glVertexAttribL1i64vNV = (PFNGLVERTEXATTRIBL1I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1i64vNV")) == NULL) || r; + r = ((glVertexAttribL1ui64NV = (PFNGLVERTEXATTRIBL1UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64NV")) == NULL) || r; + r = ((glVertexAttribL1ui64vNV = (PFNGLVERTEXATTRIBL1UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL1ui64vNV")) == NULL) || r; + r = ((glVertexAttribL2i64NV = (PFNGLVERTEXATTRIBL2I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64NV")) == NULL) || r; + r = ((glVertexAttribL2i64vNV = (PFNGLVERTEXATTRIBL2I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2i64vNV")) == NULL) || r; + r = ((glVertexAttribL2ui64NV = (PFNGLVERTEXATTRIBL2UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64NV")) == NULL) || r; + r = ((glVertexAttribL2ui64vNV = (PFNGLVERTEXATTRIBL2UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL2ui64vNV")) == NULL) || r; + r = ((glVertexAttribL3i64NV = (PFNGLVERTEXATTRIBL3I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64NV")) == NULL) || r; + r = ((glVertexAttribL3i64vNV = (PFNGLVERTEXATTRIBL3I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3i64vNV")) == NULL) || r; + r = ((glVertexAttribL3ui64NV = (PFNGLVERTEXATTRIBL3UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64NV")) == NULL) || r; + r = ((glVertexAttribL3ui64vNV = (PFNGLVERTEXATTRIBL3UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL3ui64vNV")) == NULL) || r; + r = ((glVertexAttribL4i64NV = (PFNGLVERTEXATTRIBL4I64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64NV")) == NULL) || r; + r = ((glVertexAttribL4i64vNV = (PFNGLVERTEXATTRIBL4I64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4i64vNV")) == NULL) || r; + r = ((glVertexAttribL4ui64NV = (PFNGLVERTEXATTRIBL4UI64NVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64NV")) == NULL) || r; + r = ((glVertexAttribL4ui64vNV = (PFNGLVERTEXATTRIBL4UI64VNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribL4ui64vNV")) == NULL) || r; + r = ((glVertexAttribLFormatNV = (PFNGLVERTEXATTRIBLFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribLFormatNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +#ifdef GL_NV_vertex_buffer_unified_memory + +static GLboolean _glewInit_GL_NV_vertex_buffer_unified_memory (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glBufferAddressRangeNV = (PFNGLBUFFERADDRESSRANGENVPROC)glewGetProcAddress((const GLubyte*)"glBufferAddressRangeNV")) == NULL) || r; + r = ((glColorFormatNV = (PFNGLCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glColorFormatNV")) == NULL) || r; + r = ((glEdgeFlagFormatNV = (PFNGLEDGEFLAGFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glEdgeFlagFormatNV")) == NULL) || r; + r = ((glFogCoordFormatNV = (PFNGLFOGCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glFogCoordFormatNV")) == NULL) || r; + r = ((glGetIntegerui64i_vNV = (PFNGLGETINTEGERUI64I_VNVPROC)glewGetProcAddress((const GLubyte*)"glGetIntegerui64i_vNV")) == NULL) || r; + r = ((glIndexFormatNV = (PFNGLINDEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glIndexFormatNV")) == NULL) || r; + r = ((glNormalFormatNV = (PFNGLNORMALFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glNormalFormatNV")) == NULL) || r; + r = ((glSecondaryColorFormatNV = (PFNGLSECONDARYCOLORFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glSecondaryColorFormatNV")) == NULL) || r; + r = ((glTexCoordFormatNV = (PFNGLTEXCOORDFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glTexCoordFormatNV")) == NULL) || r; + r = ((glVertexAttribFormatNV = (PFNGLVERTEXATTRIBFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribFormatNV")) == NULL) || r; + r = ((glVertexAttribIFormatNV = (PFNGLVERTEXATTRIBIFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribIFormatNV")) == NULL) || r; + r = ((glVertexFormatNV = (PFNGLVERTEXFORMATNVPROC)glewGetProcAddress((const GLubyte*)"glVertexFormatNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +#ifdef GL_NV_vertex_program + +static GLboolean _glewInit_GL_NV_vertex_program (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAreProgramsResidentNV = (PFNGLAREPROGRAMSRESIDENTNVPROC)glewGetProcAddress((const GLubyte*)"glAreProgramsResidentNV")) == NULL) || r; + r = ((glBindProgramNV = (PFNGLBINDPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glBindProgramNV")) == NULL) || r; + r = ((glDeleteProgramsNV = (PFNGLDELETEPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glDeleteProgramsNV")) == NULL) || r; + r = ((glExecuteProgramNV = (PFNGLEXECUTEPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glExecuteProgramNV")) == NULL) || r; + r = ((glGenProgramsNV = (PFNGLGENPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glGenProgramsNV")) == NULL) || r; + r = ((glGetProgramParameterdvNV = (PFNGLGETPROGRAMPARAMETERDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterdvNV")) == NULL) || r; + r = ((glGetProgramParameterfvNV = (PFNGLGETPROGRAMPARAMETERFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramParameterfvNV")) == NULL) || r; + r = ((glGetProgramStringNV = (PFNGLGETPROGRAMSTRINGNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramStringNV")) == NULL) || r; + r = ((glGetProgramivNV = (PFNGLGETPROGRAMIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetProgramivNV")) == NULL) || r; + r = ((glGetTrackMatrixivNV = (PFNGLGETTRACKMATRIXIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetTrackMatrixivNV")) == NULL) || r; + r = ((glGetVertexAttribPointervNV = (PFNGLGETVERTEXATTRIBPOINTERVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribPointervNV")) == NULL) || r; + r = ((glGetVertexAttribdvNV = (PFNGLGETVERTEXATTRIBDVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribdvNV")) == NULL) || r; + r = ((glGetVertexAttribfvNV = (PFNGLGETVERTEXATTRIBFVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribfvNV")) == NULL) || r; + r = ((glGetVertexAttribivNV = (PFNGLGETVERTEXATTRIBIVNVPROC)glewGetProcAddress((const GLubyte*)"glGetVertexAttribivNV")) == NULL) || r; + r = ((glIsProgramNV = (PFNGLISPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glIsProgramNV")) == NULL) || r; + r = ((glLoadProgramNV = (PFNGLLOADPROGRAMNVPROC)glewGetProcAddress((const GLubyte*)"glLoadProgramNV")) == NULL) || r; + r = ((glProgramParameter4dNV = (PFNGLPROGRAMPARAMETER4DNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dNV")) == NULL) || r; + r = ((glProgramParameter4dvNV = (PFNGLPROGRAMPARAMETER4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4dvNV")) == NULL) || r; + r = ((glProgramParameter4fNV = (PFNGLPROGRAMPARAMETER4FNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fNV")) == NULL) || r; + r = ((glProgramParameter4fvNV = (PFNGLPROGRAMPARAMETER4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameter4fvNV")) == NULL) || r; + r = ((glProgramParameters4dvNV = (PFNGLPROGRAMPARAMETERS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4dvNV")) == NULL) || r; + r = ((glProgramParameters4fvNV = (PFNGLPROGRAMPARAMETERS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glProgramParameters4fvNV")) == NULL) || r; + r = ((glRequestResidentProgramsNV = (PFNGLREQUESTRESIDENTPROGRAMSNVPROC)glewGetProcAddress((const GLubyte*)"glRequestResidentProgramsNV")) == NULL) || r; + r = ((glTrackMatrixNV = (PFNGLTRACKMATRIXNVPROC)glewGetProcAddress((const GLubyte*)"glTrackMatrixNV")) == NULL) || r; + r = ((glVertexAttrib1dNV = (PFNGLVERTEXATTRIB1DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dNV")) == NULL) || r; + r = ((glVertexAttrib1dvNV = (PFNGLVERTEXATTRIB1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1dvNV")) == NULL) || r; + r = ((glVertexAttrib1fNV = (PFNGLVERTEXATTRIB1FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fNV")) == NULL) || r; + r = ((glVertexAttrib1fvNV = (PFNGLVERTEXATTRIB1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1fvNV")) == NULL) || r; + r = ((glVertexAttrib1sNV = (PFNGLVERTEXATTRIB1SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1sNV")) == NULL) || r; + r = ((glVertexAttrib1svNV = (PFNGLVERTEXATTRIB1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib1svNV")) == NULL) || r; + r = ((glVertexAttrib2dNV = (PFNGLVERTEXATTRIB2DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dNV")) == NULL) || r; + r = ((glVertexAttrib2dvNV = (PFNGLVERTEXATTRIB2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2dvNV")) == NULL) || r; + r = ((glVertexAttrib2fNV = (PFNGLVERTEXATTRIB2FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fNV")) == NULL) || r; + r = ((glVertexAttrib2fvNV = (PFNGLVERTEXATTRIB2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2fvNV")) == NULL) || r; + r = ((glVertexAttrib2sNV = (PFNGLVERTEXATTRIB2SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2sNV")) == NULL) || r; + r = ((glVertexAttrib2svNV = (PFNGLVERTEXATTRIB2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib2svNV")) == NULL) || r; + r = ((glVertexAttrib3dNV = (PFNGLVERTEXATTRIB3DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dNV")) == NULL) || r; + r = ((glVertexAttrib3dvNV = (PFNGLVERTEXATTRIB3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3dvNV")) == NULL) || r; + r = ((glVertexAttrib3fNV = (PFNGLVERTEXATTRIB3FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fNV")) == NULL) || r; + r = ((glVertexAttrib3fvNV = (PFNGLVERTEXATTRIB3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3fvNV")) == NULL) || r; + r = ((glVertexAttrib3sNV = (PFNGLVERTEXATTRIB3SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3sNV")) == NULL) || r; + r = ((glVertexAttrib3svNV = (PFNGLVERTEXATTRIB3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib3svNV")) == NULL) || r; + r = ((glVertexAttrib4dNV = (PFNGLVERTEXATTRIB4DNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dNV")) == NULL) || r; + r = ((glVertexAttrib4dvNV = (PFNGLVERTEXATTRIB4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4dvNV")) == NULL) || r; + r = ((glVertexAttrib4fNV = (PFNGLVERTEXATTRIB4FNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fNV")) == NULL) || r; + r = ((glVertexAttrib4fvNV = (PFNGLVERTEXATTRIB4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4fvNV")) == NULL) || r; + r = ((glVertexAttrib4sNV = (PFNGLVERTEXATTRIB4SNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4sNV")) == NULL) || r; + r = ((glVertexAttrib4svNV = (PFNGLVERTEXATTRIB4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4svNV")) == NULL) || r; + r = ((glVertexAttrib4ubNV = (PFNGLVERTEXATTRIB4UBNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubNV")) == NULL) || r; + r = ((glVertexAttrib4ubvNV = (PFNGLVERTEXATTRIB4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttrib4ubvNV")) == NULL) || r; + r = ((glVertexAttribPointerNV = (PFNGLVERTEXATTRIBPOINTERNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribPointerNV")) == NULL) || r; + r = ((glVertexAttribs1dvNV = (PFNGLVERTEXATTRIBS1DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1dvNV")) == NULL) || r; + r = ((glVertexAttribs1fvNV = (PFNGLVERTEXATTRIBS1FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1fvNV")) == NULL) || r; + r = ((glVertexAttribs1svNV = (PFNGLVERTEXATTRIBS1SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs1svNV")) == NULL) || r; + r = ((glVertexAttribs2dvNV = (PFNGLVERTEXATTRIBS2DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2dvNV")) == NULL) || r; + r = ((glVertexAttribs2fvNV = (PFNGLVERTEXATTRIBS2FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2fvNV")) == NULL) || r; + r = ((glVertexAttribs2svNV = (PFNGLVERTEXATTRIBS2SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs2svNV")) == NULL) || r; + r = ((glVertexAttribs3dvNV = (PFNGLVERTEXATTRIBS3DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3dvNV")) == NULL) || r; + r = ((glVertexAttribs3fvNV = (PFNGLVERTEXATTRIBS3FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3fvNV")) == NULL) || r; + r = ((glVertexAttribs3svNV = (PFNGLVERTEXATTRIBS3SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs3svNV")) == NULL) || r; + r = ((glVertexAttribs4dvNV = (PFNGLVERTEXATTRIBS4DVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4dvNV")) == NULL) || r; + r = ((glVertexAttribs4fvNV = (PFNGLVERTEXATTRIBS4FVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4fvNV")) == NULL) || r; + r = ((glVertexAttribs4svNV = (PFNGLVERTEXATTRIBS4SVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4svNV")) == NULL) || r; + r = ((glVertexAttribs4ubvNV = (PFNGLVERTEXATTRIBS4UBVNVPROC)glewGetProcAddress((const GLubyte*)"glVertexAttribs4ubvNV")) == NULL) || r; + + return r; +} + +#endif /* GL_NV_vertex_program */ + +#ifdef GL_NV_vertex_program1_1 + +#endif /* GL_NV_vertex_program1_1 */ + +#ifdef GL_NV_vertex_program2 + +#endif /* GL_NV_vertex_program2 */ + +#ifdef GL_NV_vertex_program2_option + +#endif /* GL_NV_vertex_program2_option */ + +#ifdef GL_NV_vertex_program3 + +#endif /* GL_NV_vertex_program3 */ + +#ifdef GL_NV_vertex_program4 + +#endif /* GL_NV_vertex_program4 */ + +#ifdef GL_OES_byte_coordinates + +#endif /* GL_OES_byte_coordinates */ + +#ifdef GL_OES_compressed_paletted_texture + +#endif /* GL_OES_compressed_paletted_texture */ + +#ifdef GL_OES_read_format + +#endif /* GL_OES_read_format */ + +#ifdef GL_OES_single_precision + +static GLboolean _glewInit_GL_OES_single_precision (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glClearDepthfOES = (PFNGLCLEARDEPTHFOESPROC)glewGetProcAddress((const GLubyte*)"glClearDepthfOES")) == NULL) || r; + r = ((glClipPlanefOES = (PFNGLCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glClipPlanefOES")) == NULL) || r; + r = ((glDepthRangefOES = (PFNGLDEPTHRANGEFOESPROC)glewGetProcAddress((const GLubyte*)"glDepthRangefOES")) == NULL) || r; + r = ((glFrustumfOES = (PFNGLFRUSTUMFOESPROC)glewGetProcAddress((const GLubyte*)"glFrustumfOES")) == NULL) || r; + r = ((glGetClipPlanefOES = (PFNGLGETCLIPPLANEFOESPROC)glewGetProcAddress((const GLubyte*)"glGetClipPlanefOES")) == NULL) || r; + r = ((glOrthofOES = (PFNGLORTHOFOESPROC)glewGetProcAddress((const GLubyte*)"glOrthofOES")) == NULL) || r; + + return r; +} + +#endif /* GL_OES_single_precision */ + +#ifdef GL_OML_interlace + +#endif /* GL_OML_interlace */ + +#ifdef GL_OML_resample + +#endif /* GL_OML_resample */ + +#ifdef GL_OML_subsample + +#endif /* GL_OML_subsample */ + +#ifdef GL_PGI_misc_hints + +#endif /* GL_PGI_misc_hints */ + +#ifdef GL_PGI_vertex_hints + +#endif /* GL_PGI_vertex_hints */ + +#ifdef GL_REND_screen_coordinates + +#endif /* GL_REND_screen_coordinates */ + +#ifdef GL_S3_s3tc + +#endif /* GL_S3_s3tc */ + +#ifdef GL_SGIS_color_range + +#endif /* GL_SGIS_color_range */ + +#ifdef GL_SGIS_detail_texture + +static GLboolean _glewInit_GL_SGIS_detail_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glDetailTexFuncSGIS = (PFNGLDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glDetailTexFuncSGIS")) == NULL) || r; + r = ((glGetDetailTexFuncSGIS = (PFNGLGETDETAILTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetDetailTexFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_detail_texture */ + +#ifdef GL_SGIS_fog_function + +static GLboolean _glewInit_GL_SGIS_fog_function (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFogFuncSGIS = (PFNGLFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glFogFuncSGIS")) == NULL) || r; + r = ((glGetFogFuncSGIS = (PFNGLGETFOGFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetFogFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_fog_function */ + +#ifdef GL_SGIS_generate_mipmap + +#endif /* GL_SGIS_generate_mipmap */ + +#ifdef GL_SGIS_multisample + +static GLboolean _glewInit_GL_SGIS_multisample (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSampleMaskSGIS = (PFNGLSAMPLEMASKSGISPROC)glewGetProcAddress((const GLubyte*)"glSampleMaskSGIS")) == NULL) || r; + r = ((glSamplePatternSGIS = (PFNGLSAMPLEPATTERNSGISPROC)glewGetProcAddress((const GLubyte*)"glSamplePatternSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_multisample */ + +#ifdef GL_SGIS_pixel_texture + +#endif /* GL_SGIS_pixel_texture */ + +#ifdef GL_SGIS_point_line_texgen + +#endif /* GL_SGIS_point_line_texgen */ + +#ifdef GL_SGIS_sharpen_texture + +static GLboolean _glewInit_GL_SGIS_sharpen_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetSharpenTexFuncSGIS = (PFNGLGETSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetSharpenTexFuncSGIS")) == NULL) || r; + r = ((glSharpenTexFuncSGIS = (PFNGLSHARPENTEXFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glSharpenTexFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_sharpen_texture */ + +#ifdef GL_SGIS_texture4D + +static GLboolean _glewInit_GL_SGIS_texture4D (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTexImage4DSGIS = (PFNGLTEXIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexImage4DSGIS")) == NULL) || r; + r = ((glTexSubImage4DSGIS = (PFNGLTEXSUBIMAGE4DSGISPROC)glewGetProcAddress((const GLubyte*)"glTexSubImage4DSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_texture4D */ + +#ifdef GL_SGIS_texture_border_clamp + +#endif /* GL_SGIS_texture_border_clamp */ + +#ifdef GL_SGIS_texture_edge_clamp + +#endif /* GL_SGIS_texture_edge_clamp */ + +#ifdef GL_SGIS_texture_filter4 + +static GLboolean _glewInit_GL_SGIS_texture_filter4 (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGetTexFilterFuncSGIS = (PFNGLGETTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glGetTexFilterFuncSGIS")) == NULL) || r; + r = ((glTexFilterFuncSGIS = (PFNGLTEXFILTERFUNCSGISPROC)glewGetProcAddress((const GLubyte*)"glTexFilterFuncSGIS")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIS_texture_filter4 */ + +#ifdef GL_SGIS_texture_lod + +#endif /* GL_SGIS_texture_lod */ + +#ifdef GL_SGIS_texture_select + +#endif /* GL_SGIS_texture_select */ + +#ifdef GL_SGIX_async + +static GLboolean _glewInit_GL_SGIX_async (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAsyncMarkerSGIX = (PFNGLASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glAsyncMarkerSGIX")) == NULL) || r; + r = ((glDeleteAsyncMarkersSGIX = (PFNGLDELETEASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glDeleteAsyncMarkersSGIX")) == NULL) || r; + r = ((glFinishAsyncSGIX = (PFNGLFINISHASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glFinishAsyncSGIX")) == NULL) || r; + r = ((glGenAsyncMarkersSGIX = (PFNGLGENASYNCMARKERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glGenAsyncMarkersSGIX")) == NULL) || r; + r = ((glIsAsyncMarkerSGIX = (PFNGLISASYNCMARKERSGIXPROC)glewGetProcAddress((const GLubyte*)"glIsAsyncMarkerSGIX")) == NULL) || r; + r = ((glPollAsyncSGIX = (PFNGLPOLLASYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glPollAsyncSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_async */ + +#ifdef GL_SGIX_async_histogram + +#endif /* GL_SGIX_async_histogram */ + +#ifdef GL_SGIX_async_pixel + +#endif /* GL_SGIX_async_pixel */ + +#ifdef GL_SGIX_blend_alpha_minmax + +#endif /* GL_SGIX_blend_alpha_minmax */ + +#ifdef GL_SGIX_clipmap + +#endif /* GL_SGIX_clipmap */ + +#ifdef GL_SGIX_convolution_accuracy + +#endif /* GL_SGIX_convolution_accuracy */ + +#ifdef GL_SGIX_depth_texture + +#endif /* GL_SGIX_depth_texture */ + +#ifdef GL_SGIX_flush_raster + +static GLboolean _glewInit_GL_SGIX_flush_raster (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFlushRasterSGIX = (PFNGLFLUSHRASTERSGIXPROC)glewGetProcAddress((const GLubyte*)"glFlushRasterSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_flush_raster */ + +#ifdef GL_SGIX_fog_offset + +#endif /* GL_SGIX_fog_offset */ + +#ifdef GL_SGIX_fog_texture + +static GLboolean _glewInit_GL_SGIX_fog_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTextureFogSGIX = (PFNGLTEXTUREFOGSGIXPROC)glewGetProcAddress((const GLubyte*)"glTextureFogSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fog_texture */ + +#ifdef GL_SGIX_fragment_specular_lighting + +static GLboolean _glewInit_GL_SGIX_fragment_specular_lighting (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFragmentColorMaterialSGIX = (PFNGLFRAGMENTCOLORMATERIALSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentColorMaterialSGIX")) == NULL) || r; + r = ((glFragmentLightModelfSGIX = (PFNGLFRAGMENTLIGHTMODELFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfSGIX")) == NULL) || r; + r = ((glFragmentLightModelfvSGIX = (PFNGLFRAGMENTLIGHTMODELFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelfvSGIX")) == NULL) || r; + r = ((glFragmentLightModeliSGIX = (PFNGLFRAGMENTLIGHTMODELISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModeliSGIX")) == NULL) || r; + r = ((glFragmentLightModelivSGIX = (PFNGLFRAGMENTLIGHTMODELIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightModelivSGIX")) == NULL) || r; + r = ((glFragmentLightfSGIX = (PFNGLFRAGMENTLIGHTFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfSGIX")) == NULL) || r; + r = ((glFragmentLightfvSGIX = (PFNGLFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightfvSGIX")) == NULL) || r; + r = ((glFragmentLightiSGIX = (PFNGLFRAGMENTLIGHTISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightiSGIX")) == NULL) || r; + r = ((glFragmentLightivSGIX = (PFNGLFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentLightivSGIX")) == NULL) || r; + r = ((glFragmentMaterialfSGIX = (PFNGLFRAGMENTMATERIALFSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfSGIX")) == NULL) || r; + r = ((glFragmentMaterialfvSGIX = (PFNGLFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialfvSGIX")) == NULL) || r; + r = ((glFragmentMaterialiSGIX = (PFNGLFRAGMENTMATERIALISGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialiSGIX")) == NULL) || r; + r = ((glFragmentMaterialivSGIX = (PFNGLFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glFragmentMaterialivSGIX")) == NULL) || r; + r = ((glGetFragmentLightfvSGIX = (PFNGLGETFRAGMENTLIGHTFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightfvSGIX")) == NULL) || r; + r = ((glGetFragmentLightivSGIX = (PFNGLGETFRAGMENTLIGHTIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentLightivSGIX")) == NULL) || r; + r = ((glGetFragmentMaterialfvSGIX = (PFNGLGETFRAGMENTMATERIALFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialfvSGIX")) == NULL) || r; + r = ((glGetFragmentMaterialivSGIX = (PFNGLGETFRAGMENTMATERIALIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glGetFragmentMaterialivSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_fragment_specular_lighting */ + +#ifdef GL_SGIX_framezoom + +static GLboolean _glewInit_GL_SGIX_framezoom (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFrameZoomSGIX = (PFNGLFRAMEZOOMSGIXPROC)glewGetProcAddress((const GLubyte*)"glFrameZoomSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_framezoom */ + +#ifdef GL_SGIX_interlace + +#endif /* GL_SGIX_interlace */ + +#ifdef GL_SGIX_ir_instrument1 + +#endif /* GL_SGIX_ir_instrument1 */ + +#ifdef GL_SGIX_list_priority + +#endif /* GL_SGIX_list_priority */ + +#ifdef GL_SGIX_pixel_texture + +static GLboolean _glewInit_GL_SGIX_pixel_texture (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glPixelTexGenSGIX = (PFNGLPIXELTEXGENSGIXPROC)glewGetProcAddress((const GLubyte*)"glPixelTexGenSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_pixel_texture */ + +#ifdef GL_SGIX_pixel_texture_bits + +#endif /* GL_SGIX_pixel_texture_bits */ + +#ifdef GL_SGIX_reference_plane + +static GLboolean _glewInit_GL_SGIX_reference_plane (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReferencePlaneSGIX = (PFNGLREFERENCEPLANESGIXPROC)glewGetProcAddress((const GLubyte*)"glReferencePlaneSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_reference_plane */ + +#ifdef GL_SGIX_resample + +#endif /* GL_SGIX_resample */ + +#ifdef GL_SGIX_shadow + +#endif /* GL_SGIX_shadow */ + +#ifdef GL_SGIX_shadow_ambient + +#endif /* GL_SGIX_shadow_ambient */ + +#ifdef GL_SGIX_sprite + +static GLboolean _glewInit_GL_SGIX_sprite (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glSpriteParameterfSGIX = (PFNGLSPRITEPARAMETERFSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfSGIX")) == NULL) || r; + r = ((glSpriteParameterfvSGIX = (PFNGLSPRITEPARAMETERFVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterfvSGIX")) == NULL) || r; + r = ((glSpriteParameteriSGIX = (PFNGLSPRITEPARAMETERISGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameteriSGIX")) == NULL) || r; + r = ((glSpriteParameterivSGIX = (PFNGLSPRITEPARAMETERIVSGIXPROC)glewGetProcAddress((const GLubyte*)"glSpriteParameterivSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_sprite */ + +#ifdef GL_SGIX_tag_sample_buffer + +static GLboolean _glewInit_GL_SGIX_tag_sample_buffer (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glTagSampleBufferSGIX = (PFNGLTAGSAMPLEBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glTagSampleBufferSGIX")) == NULL) || r; + + return r; +} + +#endif /* GL_SGIX_tag_sample_buffer */ + +#ifdef GL_SGIX_texture_add_env + +#endif /* GL_SGIX_texture_add_env */ + +#ifdef GL_SGIX_texture_coordinate_clamp + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +#ifdef GL_SGIX_texture_lod_bias + +#endif /* GL_SGIX_texture_lod_bias */ + +#ifdef GL_SGIX_texture_multi_buffer + +#endif /* GL_SGIX_texture_multi_buffer */ + +#ifdef GL_SGIX_texture_range + +#endif /* GL_SGIX_texture_range */ + +#ifdef GL_SGIX_texture_scale_bias + +#endif /* GL_SGIX_texture_scale_bias */ + +#ifdef GL_SGIX_vertex_preclip + +#endif /* GL_SGIX_vertex_preclip */ + +#ifdef GL_SGIX_vertex_preclip_hint + +#endif /* GL_SGIX_vertex_preclip_hint */ + +#ifdef GL_SGIX_ycrcb + +#endif /* GL_SGIX_ycrcb */ + +#ifdef GL_SGI_color_matrix + +#endif /* GL_SGI_color_matrix */ + +#ifdef GL_SGI_color_table + +static GLboolean _glewInit_GL_SGI_color_table (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColorTableParameterfvSGI = (PFNGLCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterfvSGI")) == NULL) || r; + r = ((glColorTableParameterivSGI = (PFNGLCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableParameterivSGI")) == NULL) || r; + r = ((glColorTableSGI = (PFNGLCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glColorTableSGI")) == NULL) || r; + r = ((glCopyColorTableSGI = (PFNGLCOPYCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glCopyColorTableSGI")) == NULL) || r; + r = ((glGetColorTableParameterfvSGI = (PFNGLGETCOLORTABLEPARAMETERFVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterfvSGI")) == NULL) || r; + r = ((glGetColorTableParameterivSGI = (PFNGLGETCOLORTABLEPARAMETERIVSGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableParameterivSGI")) == NULL) || r; + r = ((glGetColorTableSGI = (PFNGLGETCOLORTABLESGIPROC)glewGetProcAddress((const GLubyte*)"glGetColorTableSGI")) == NULL) || r; + + return r; +} + +#endif /* GL_SGI_color_table */ + +#ifdef GL_SGI_texture_color_table + +#endif /* GL_SGI_texture_color_table */ + +#ifdef GL_SUNX_constant_data + +static GLboolean _glewInit_GL_SUNX_constant_data (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glFinishTextureSUNX = (PFNGLFINISHTEXTURESUNXPROC)glewGetProcAddress((const GLubyte*)"glFinishTextureSUNX")) == NULL) || r; + + return r; +} + +#endif /* GL_SUNX_constant_data */ + +#ifdef GL_SUN_convolution_border_modes + +#endif /* GL_SUN_convolution_border_modes */ + +#ifdef GL_SUN_global_alpha + +static GLboolean _glewInit_GL_SUN_global_alpha (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glGlobalAlphaFactorbSUN = (PFNGLGLOBALALPHAFACTORBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorbSUN")) == NULL) || r; + r = ((glGlobalAlphaFactordSUN = (PFNGLGLOBALALPHAFACTORDSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactordSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorfSUN = (PFNGLGLOBALALPHAFACTORFSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorfSUN")) == NULL) || r; + r = ((glGlobalAlphaFactoriSUN = (PFNGLGLOBALALPHAFACTORISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoriSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorsSUN = (PFNGLGLOBALALPHAFACTORSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorsSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorubSUN = (PFNGLGLOBALALPHAFACTORUBSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorubSUN")) == NULL) || r; + r = ((glGlobalAlphaFactoruiSUN = (PFNGLGLOBALALPHAFACTORUISUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactoruiSUN")) == NULL) || r; + r = ((glGlobalAlphaFactorusSUN = (PFNGLGLOBALALPHAFACTORUSSUNPROC)glewGetProcAddress((const GLubyte*)"glGlobalAlphaFactorusSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_global_alpha */ + +#ifdef GL_SUN_mesh_array + +#endif /* GL_SUN_mesh_array */ + +#ifdef GL_SUN_read_video_pixels + +static GLboolean _glewInit_GL_SUN_read_video_pixels (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReadVideoPixelsSUN = (PFNGLREADVIDEOPIXELSSUNPROC)glewGetProcAddress((const GLubyte*)"glReadVideoPixelsSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_read_video_pixels */ + +#ifdef GL_SUN_slice_accum + +#endif /* GL_SUN_slice_accum */ + +#ifdef GL_SUN_triangle_list + +static GLboolean _glewInit_GL_SUN_triangle_list (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glReplacementCodePointerSUN = (PFNGLREPLACEMENTCODEPOINTERSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodePointerSUN")) == NULL) || r; + r = ((glReplacementCodeubSUN = (PFNGLREPLACEMENTCODEUBSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubSUN")) == NULL) || r; + r = ((glReplacementCodeubvSUN = (PFNGLREPLACEMENTCODEUBVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeubvSUN")) == NULL) || r; + r = ((glReplacementCodeuiSUN = (PFNGLREPLACEMENTCODEUISUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiSUN")) == NULL) || r; + r = ((glReplacementCodeuivSUN = (PFNGLREPLACEMENTCODEUIVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuivSUN")) == NULL) || r; + r = ((glReplacementCodeusSUN = (PFNGLREPLACEMENTCODEUSSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusSUN")) == NULL) || r; + r = ((glReplacementCodeusvSUN = (PFNGLREPLACEMENTCODEUSVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeusvSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_triangle_list */ + +#ifdef GL_SUN_vertex + +static GLboolean _glewInit_GL_SUN_vertex (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glColor3fVertex3fSUN = (PFNGLCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fSUN")) == NULL) || r; + r = ((glColor3fVertex3fvSUN = (PFNGLCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor3fVertex3fvSUN")) == NULL) || r; + r = ((glColor4fNormal3fVertex3fSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glColor4fNormal3fVertex3fvSUN = (PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glColor4ubVertex2fSUN = (PFNGLCOLOR4UBVERTEX2FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fSUN")) == NULL) || r; + r = ((glColor4ubVertex2fvSUN = (PFNGLCOLOR4UBVERTEX2FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex2fvSUN")) == NULL) || r; + r = ((glColor4ubVertex3fSUN = (PFNGLCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fSUN")) == NULL) || r; + r = ((glColor4ubVertex3fvSUN = (PFNGLCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glNormal3fVertex3fSUN = (PFNGLNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fSUN")) == NULL) || r; + r = ((glNormal3fVertex3fvSUN = (PFNGLNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4ubVertex3fSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiColor4ubVertex3fvSUN = (PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fVertex3fSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiTexCoord2fVertex3fvSUN = (PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiTexCoord2fVertex3fvSUN")) == NULL) || r; + r = ((glReplacementCodeuiVertex3fSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fSUN")) == NULL) || r; + r = ((glReplacementCodeuiVertex3fvSUN = (PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glReplacementCodeuiVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor4fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor4fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fColor4ubVertex3fSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fColor4ubVertex3fvSUN = (PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fColor4ubVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fNormal3fVertex3fSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fNormal3fVertex3fvSUN = (PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fNormal3fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord2fVertex3fSUN = (PFNGLTEXCOORD2FVERTEX3FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fSUN")) == NULL) || r; + r = ((glTexCoord2fVertex3fvSUN = (PFNGLTEXCOORD2FVERTEX3FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord2fVertex3fvSUN")) == NULL) || r; + r = ((glTexCoord4fColor4fNormal3fVertex4fSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fSUN")) == NULL) || r; + r = ((glTexCoord4fColor4fNormal3fVertex4fvSUN = (PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fColor4fNormal3fVertex4fvSUN")) == NULL) || r; + r = ((glTexCoord4fVertex4fSUN = (PFNGLTEXCOORD4FVERTEX4FSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fSUN")) == NULL) || r; + r = ((glTexCoord4fVertex4fvSUN = (PFNGLTEXCOORD4FVERTEX4FVSUNPROC)glewGetProcAddress((const GLubyte*)"glTexCoord4fVertex4fvSUN")) == NULL) || r; + + return r; +} + +#endif /* GL_SUN_vertex */ + +#ifdef GL_WIN_phong_shading + +#endif /* GL_WIN_phong_shading */ + +#ifdef GL_WIN_specular_fog + +#endif /* GL_WIN_specular_fog */ + +#ifdef GL_WIN_swap_hint + +static GLboolean _glewInit_GL_WIN_swap_hint (GLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glAddSwapHintRectWIN = (PFNGLADDSWAPHINTRECTWINPROC)glewGetProcAddress((const GLubyte*)"glAddSwapHintRectWIN")) == NULL) || r; + + return r; +} + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +/* + * Search for name in the extensions string. Use of strstr() + * is not sufficient because extension names can be prefixes of + * other extension names. Could use strtok() but the constant + * string returned by glGetString might be in read-only memory. + */ +GLboolean glewGetExtension (const char* name) +{ + GLubyte* p; + GLubyte* end; + GLuint len = _glewStrLen((const GLubyte*)name); + p = (GLubyte*)glGetString(GL_EXTENSIONS); + if (0 == p) return GL_FALSE; + end = p + _glewStrLen(p); + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} + +/* ------------------------------------------------------------------------- */ + +#ifndef GLEW_MX +static +#endif +GLenum glewContextInit (GLEW_CONTEXT_ARG_DEF_LIST) +{ + const GLubyte* s; + GLuint dot; + GLint major, minor; + /* query opengl version */ + s = glGetString(GL_VERSION); + dot = _glewStrCLen(s, '.'); + if (dot == 0) + return GLEW_ERROR_NO_GL_VERSION; + + major = s[dot-1]-'0'; + minor = s[dot+1]-'0'; + + if (minor < 0 || minor > 9) + minor = 0; + if (major<0 || major>9) + return GLEW_ERROR_NO_GL_VERSION; + + + if (major == 1 && minor == 0) + { + return GLEW_ERROR_GL_VERSION_10_ONLY; + } + else + { + CONST_CAST(GLEW_VERSION_4_1) = ( major > 4 ) || ( major == 4 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_4_0) = GLEW_VERSION_4_1 == GL_TRUE || ( major == 4 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_3) = GLEW_VERSION_4_0 == GL_TRUE || ( major == 3 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_2) = GLEW_VERSION_3_3 == GL_TRUE || ( major == 3 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_1) = GLEW_VERSION_3_2 == GL_TRUE || ( major == 3 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_3_0) = GLEW_VERSION_3_1 == GL_TRUE || ( major == 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_2_1) = GLEW_VERSION_3_0 == GL_TRUE || ( major == 2 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_2_0) = GLEW_VERSION_2_1 == GL_TRUE || ( major == 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_5) = GLEW_VERSION_2_0 == GL_TRUE || ( major == 1 && minor >= 5 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_4) = GLEW_VERSION_1_5 == GL_TRUE || ( major == 1 && minor >= 4 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_3) = GLEW_VERSION_1_4 == GL_TRUE || ( major == 1 && minor >= 3 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_2_1) = GLEW_VERSION_1_3 == GL_TRUE ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_2) = GLEW_VERSION_1_2_1 == GL_TRUE || ( major == 1 && minor >= 2 ) ? GL_TRUE : GL_FALSE; + CONST_CAST(GLEW_VERSION_1_1) = GLEW_VERSION_1_2 == GL_TRUE || ( major == 1 && minor >= 1 ) ? GL_TRUE : GL_FALSE; + } + /* initialize extensions */ +#ifdef GL_VERSION_1_2 + if (glewExperimental || GLEW_VERSION_1_2) CONST_CAST(GLEW_VERSION_1_2) = !_glewInit_GL_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_2 */ +#ifdef GL_VERSION_1_2_1 +#endif /* GL_VERSION_1_2_1 */ +#ifdef GL_VERSION_1_3 + if (glewExperimental || GLEW_VERSION_1_3) CONST_CAST(GLEW_VERSION_1_3) = !_glewInit_GL_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_3 */ +#ifdef GL_VERSION_1_4 + if (glewExperimental || GLEW_VERSION_1_4) CONST_CAST(GLEW_VERSION_1_4) = !_glewInit_GL_VERSION_1_4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_4 */ +#ifdef GL_VERSION_1_5 + if (glewExperimental || GLEW_VERSION_1_5) CONST_CAST(GLEW_VERSION_1_5) = !_glewInit_GL_VERSION_1_5(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_1_5 */ +#ifdef GL_VERSION_2_0 + if (glewExperimental || GLEW_VERSION_2_0) CONST_CAST(GLEW_VERSION_2_0) = !_glewInit_GL_VERSION_2_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_2_0 */ +#ifdef GL_VERSION_2_1 + if (glewExperimental || GLEW_VERSION_2_1) CONST_CAST(GLEW_VERSION_2_1) = !_glewInit_GL_VERSION_2_1(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_2_1 */ +#ifdef GL_VERSION_3_0 + if (glewExperimental || GLEW_VERSION_3_0) CONST_CAST(GLEW_VERSION_3_0) = !_glewInit_GL_VERSION_3_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_0 */ +#ifdef GL_VERSION_3_1 + if (glewExperimental || GLEW_VERSION_3_1) CONST_CAST(GLEW_VERSION_3_1) = !_glewInit_GL_VERSION_3_1(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_1 */ +#ifdef GL_VERSION_3_2 + if (glewExperimental || GLEW_VERSION_3_2) CONST_CAST(GLEW_VERSION_3_2) = !_glewInit_GL_VERSION_3_2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_2 */ +#ifdef GL_VERSION_3_3 + if (glewExperimental || GLEW_VERSION_3_3) CONST_CAST(GLEW_VERSION_3_3) = !_glewInit_GL_VERSION_3_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_3_3 */ +#ifdef GL_VERSION_4_0 + if (glewExperimental || GLEW_VERSION_4_0) CONST_CAST(GLEW_VERSION_4_0) = !_glewInit_GL_VERSION_4_0(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_VERSION_4_0 */ +#ifdef GL_VERSION_4_1 +#endif /* GL_VERSION_4_1 */ +#ifdef GL_3DFX_multisample + CONST_CAST(GLEW_3DFX_multisample) = glewGetExtension("GL_3DFX_multisample"); +#endif /* GL_3DFX_multisample */ +#ifdef GL_3DFX_tbuffer + CONST_CAST(GLEW_3DFX_tbuffer) = glewGetExtension("GL_3DFX_tbuffer"); + if (glewExperimental || GLEW_3DFX_tbuffer) CONST_CAST(GLEW_3DFX_tbuffer) = !_glewInit_GL_3DFX_tbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_3DFX_tbuffer */ +#ifdef GL_3DFX_texture_compression_FXT1 + CONST_CAST(GLEW_3DFX_texture_compression_FXT1) = glewGetExtension("GL_3DFX_texture_compression_FXT1"); +#endif /* GL_3DFX_texture_compression_FXT1 */ +#ifdef GL_AMD_conservative_depth + CONST_CAST(GLEW_AMD_conservative_depth) = glewGetExtension("GL_AMD_conservative_depth"); +#endif /* GL_AMD_conservative_depth */ +#ifdef GL_AMD_debug_output + CONST_CAST(GLEW_AMD_debug_output) = glewGetExtension("GL_AMD_debug_output"); + if (glewExperimental || GLEW_AMD_debug_output) CONST_CAST(GLEW_AMD_debug_output) = !_glewInit_GL_AMD_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_debug_output */ +#ifdef GL_AMD_depth_clamp_separate + CONST_CAST(GLEW_AMD_depth_clamp_separate) = glewGetExtension("GL_AMD_depth_clamp_separate"); +#endif /* GL_AMD_depth_clamp_separate */ +#ifdef GL_AMD_draw_buffers_blend + CONST_CAST(GLEW_AMD_draw_buffers_blend) = glewGetExtension("GL_AMD_draw_buffers_blend"); + if (glewExperimental || GLEW_AMD_draw_buffers_blend) CONST_CAST(GLEW_AMD_draw_buffers_blend) = !_glewInit_GL_AMD_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_draw_buffers_blend */ +#ifdef GL_AMD_name_gen_delete + CONST_CAST(GLEW_AMD_name_gen_delete) = glewGetExtension("GL_AMD_name_gen_delete"); + if (glewExperimental || GLEW_AMD_name_gen_delete) CONST_CAST(GLEW_AMD_name_gen_delete) = !_glewInit_GL_AMD_name_gen_delete(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_name_gen_delete */ +#ifdef GL_AMD_performance_monitor + CONST_CAST(GLEW_AMD_performance_monitor) = glewGetExtension("GL_AMD_performance_monitor"); + if (glewExperimental || GLEW_AMD_performance_monitor) CONST_CAST(GLEW_AMD_performance_monitor) = !_glewInit_GL_AMD_performance_monitor(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_performance_monitor */ +#ifdef GL_AMD_seamless_cubemap_per_texture + CONST_CAST(GLEW_AMD_seamless_cubemap_per_texture) = glewGetExtension("GL_AMD_seamless_cubemap_per_texture"); +#endif /* GL_AMD_seamless_cubemap_per_texture */ +#ifdef GL_AMD_shader_stencil_export + CONST_CAST(GLEW_AMD_shader_stencil_export) = glewGetExtension("GL_AMD_shader_stencil_export"); +#endif /* GL_AMD_shader_stencil_export */ +#ifdef GL_AMD_texture_texture4 + CONST_CAST(GLEW_AMD_texture_texture4) = glewGetExtension("GL_AMD_texture_texture4"); +#endif /* GL_AMD_texture_texture4 */ +#ifdef GL_AMD_transform_feedback3_lines_triangles + CONST_CAST(GLEW_AMD_transform_feedback3_lines_triangles) = glewGetExtension("GL_AMD_transform_feedback3_lines_triangles"); +#endif /* GL_AMD_transform_feedback3_lines_triangles */ +#ifdef GL_AMD_vertex_shader_tessellator + CONST_CAST(GLEW_AMD_vertex_shader_tessellator) = glewGetExtension("GL_AMD_vertex_shader_tessellator"); + if (glewExperimental || GLEW_AMD_vertex_shader_tessellator) CONST_CAST(GLEW_AMD_vertex_shader_tessellator) = !_glewInit_GL_AMD_vertex_shader_tessellator(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_AMD_vertex_shader_tessellator */ +#ifdef GL_APPLE_aux_depth_stencil + CONST_CAST(GLEW_APPLE_aux_depth_stencil) = glewGetExtension("GL_APPLE_aux_depth_stencil"); +#endif /* GL_APPLE_aux_depth_stencil */ +#ifdef GL_APPLE_client_storage + CONST_CAST(GLEW_APPLE_client_storage) = glewGetExtension("GL_APPLE_client_storage"); +#endif /* GL_APPLE_client_storage */ +#ifdef GL_APPLE_element_array + CONST_CAST(GLEW_APPLE_element_array) = glewGetExtension("GL_APPLE_element_array"); + if (glewExperimental || GLEW_APPLE_element_array) CONST_CAST(GLEW_APPLE_element_array) = !_glewInit_GL_APPLE_element_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_element_array */ +#ifdef GL_APPLE_fence + CONST_CAST(GLEW_APPLE_fence) = glewGetExtension("GL_APPLE_fence"); + if (glewExperimental || GLEW_APPLE_fence) CONST_CAST(GLEW_APPLE_fence) = !_glewInit_GL_APPLE_fence(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_fence */ +#ifdef GL_APPLE_float_pixels + CONST_CAST(GLEW_APPLE_float_pixels) = glewGetExtension("GL_APPLE_float_pixels"); +#endif /* GL_APPLE_float_pixels */ +#ifdef GL_APPLE_flush_buffer_range + CONST_CAST(GLEW_APPLE_flush_buffer_range) = glewGetExtension("GL_APPLE_flush_buffer_range"); + if (glewExperimental || GLEW_APPLE_flush_buffer_range) CONST_CAST(GLEW_APPLE_flush_buffer_range) = !_glewInit_GL_APPLE_flush_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_flush_buffer_range */ +#ifdef GL_APPLE_object_purgeable + CONST_CAST(GLEW_APPLE_object_purgeable) = glewGetExtension("GL_APPLE_object_purgeable"); + if (glewExperimental || GLEW_APPLE_object_purgeable) CONST_CAST(GLEW_APPLE_object_purgeable) = !_glewInit_GL_APPLE_object_purgeable(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_object_purgeable */ +#ifdef GL_APPLE_pixel_buffer + CONST_CAST(GLEW_APPLE_pixel_buffer) = glewGetExtension("GL_APPLE_pixel_buffer"); +#endif /* GL_APPLE_pixel_buffer */ +#ifdef GL_APPLE_rgb_422 + CONST_CAST(GLEW_APPLE_rgb_422) = glewGetExtension("GL_APPLE_rgb_422"); +#endif /* GL_APPLE_rgb_422 */ +#ifdef GL_APPLE_row_bytes + CONST_CAST(GLEW_APPLE_row_bytes) = glewGetExtension("GL_APPLE_row_bytes"); +#endif /* GL_APPLE_row_bytes */ +#ifdef GL_APPLE_specular_vector + CONST_CAST(GLEW_APPLE_specular_vector) = glewGetExtension("GL_APPLE_specular_vector"); +#endif /* GL_APPLE_specular_vector */ +#ifdef GL_APPLE_texture_range + CONST_CAST(GLEW_APPLE_texture_range) = glewGetExtension("GL_APPLE_texture_range"); + if (glewExperimental || GLEW_APPLE_texture_range) CONST_CAST(GLEW_APPLE_texture_range) = !_glewInit_GL_APPLE_texture_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_texture_range */ +#ifdef GL_APPLE_transform_hint + CONST_CAST(GLEW_APPLE_transform_hint) = glewGetExtension("GL_APPLE_transform_hint"); +#endif /* GL_APPLE_transform_hint */ +#ifdef GL_APPLE_vertex_array_object + CONST_CAST(GLEW_APPLE_vertex_array_object) = glewGetExtension("GL_APPLE_vertex_array_object"); + if (glewExperimental || GLEW_APPLE_vertex_array_object) CONST_CAST(GLEW_APPLE_vertex_array_object) = !_glewInit_GL_APPLE_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_array_object */ +#ifdef GL_APPLE_vertex_array_range + CONST_CAST(GLEW_APPLE_vertex_array_range) = glewGetExtension("GL_APPLE_vertex_array_range"); + if (glewExperimental || GLEW_APPLE_vertex_array_range) CONST_CAST(GLEW_APPLE_vertex_array_range) = !_glewInit_GL_APPLE_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_array_range */ +#ifdef GL_APPLE_vertex_program_evaluators + CONST_CAST(GLEW_APPLE_vertex_program_evaluators) = glewGetExtension("GL_APPLE_vertex_program_evaluators"); + if (glewExperimental || GLEW_APPLE_vertex_program_evaluators) CONST_CAST(GLEW_APPLE_vertex_program_evaluators) = !_glewInit_GL_APPLE_vertex_program_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_APPLE_vertex_program_evaluators */ +#ifdef GL_APPLE_ycbcr_422 + CONST_CAST(GLEW_APPLE_ycbcr_422) = glewGetExtension("GL_APPLE_ycbcr_422"); +#endif /* GL_APPLE_ycbcr_422 */ +#ifdef GL_ARB_ES2_compatibility + CONST_CAST(GLEW_ARB_ES2_compatibility) = glewGetExtension("GL_ARB_ES2_compatibility"); + if (glewExperimental || GLEW_ARB_ES2_compatibility) CONST_CAST(GLEW_ARB_ES2_compatibility) = !_glewInit_GL_ARB_ES2_compatibility(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_ES2_compatibility */ +#ifdef GL_ARB_blend_func_extended + CONST_CAST(GLEW_ARB_blend_func_extended) = glewGetExtension("GL_ARB_blend_func_extended"); + if (glewExperimental || GLEW_ARB_blend_func_extended) CONST_CAST(GLEW_ARB_blend_func_extended) = !_glewInit_GL_ARB_blend_func_extended(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_blend_func_extended */ +#ifdef GL_ARB_cl_event + CONST_CAST(GLEW_ARB_cl_event) = glewGetExtension("GL_ARB_cl_event"); + if (glewExperimental || GLEW_ARB_cl_event) CONST_CAST(GLEW_ARB_cl_event) = !_glewInit_GL_ARB_cl_event(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_cl_event */ +#ifdef GL_ARB_color_buffer_float + CONST_CAST(GLEW_ARB_color_buffer_float) = glewGetExtension("GL_ARB_color_buffer_float"); + if (glewExperimental || GLEW_ARB_color_buffer_float) CONST_CAST(GLEW_ARB_color_buffer_float) = !_glewInit_GL_ARB_color_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_color_buffer_float */ +#ifdef GL_ARB_compatibility + CONST_CAST(GLEW_ARB_compatibility) = glewGetExtension("GL_ARB_compatibility"); +#endif /* GL_ARB_compatibility */ +#ifdef GL_ARB_copy_buffer + CONST_CAST(GLEW_ARB_copy_buffer) = glewGetExtension("GL_ARB_copy_buffer"); + if (glewExperimental || GLEW_ARB_copy_buffer) CONST_CAST(GLEW_ARB_copy_buffer) = !_glewInit_GL_ARB_copy_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_copy_buffer */ +#ifdef GL_ARB_debug_output + CONST_CAST(GLEW_ARB_debug_output) = glewGetExtension("GL_ARB_debug_output"); + if (glewExperimental || GLEW_ARB_debug_output) CONST_CAST(GLEW_ARB_debug_output) = !_glewInit_GL_ARB_debug_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_debug_output */ +#ifdef GL_ARB_depth_buffer_float + CONST_CAST(GLEW_ARB_depth_buffer_float) = glewGetExtension("GL_ARB_depth_buffer_float"); +#endif /* GL_ARB_depth_buffer_float */ +#ifdef GL_ARB_depth_clamp + CONST_CAST(GLEW_ARB_depth_clamp) = glewGetExtension("GL_ARB_depth_clamp"); +#endif /* GL_ARB_depth_clamp */ +#ifdef GL_ARB_depth_texture + CONST_CAST(GLEW_ARB_depth_texture) = glewGetExtension("GL_ARB_depth_texture"); +#endif /* GL_ARB_depth_texture */ +#ifdef GL_ARB_draw_buffers + CONST_CAST(GLEW_ARB_draw_buffers) = glewGetExtension("GL_ARB_draw_buffers"); + if (glewExperimental || GLEW_ARB_draw_buffers) CONST_CAST(GLEW_ARB_draw_buffers) = !_glewInit_GL_ARB_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_buffers */ +#ifdef GL_ARB_draw_buffers_blend + CONST_CAST(GLEW_ARB_draw_buffers_blend) = glewGetExtension("GL_ARB_draw_buffers_blend"); + if (glewExperimental || GLEW_ARB_draw_buffers_blend) CONST_CAST(GLEW_ARB_draw_buffers_blend) = !_glewInit_GL_ARB_draw_buffers_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_buffers_blend */ +#ifdef GL_ARB_draw_elements_base_vertex + CONST_CAST(GLEW_ARB_draw_elements_base_vertex) = glewGetExtension("GL_ARB_draw_elements_base_vertex"); + if (glewExperimental || GLEW_ARB_draw_elements_base_vertex) CONST_CAST(GLEW_ARB_draw_elements_base_vertex) = !_glewInit_GL_ARB_draw_elements_base_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_elements_base_vertex */ +#ifdef GL_ARB_draw_indirect + CONST_CAST(GLEW_ARB_draw_indirect) = glewGetExtension("GL_ARB_draw_indirect"); + if (glewExperimental || GLEW_ARB_draw_indirect) CONST_CAST(GLEW_ARB_draw_indirect) = !_glewInit_GL_ARB_draw_indirect(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_indirect */ +#ifdef GL_ARB_draw_instanced + CONST_CAST(GLEW_ARB_draw_instanced) = glewGetExtension("GL_ARB_draw_instanced"); + if (glewExperimental || GLEW_ARB_draw_instanced) CONST_CAST(GLEW_ARB_draw_instanced) = !_glewInit_GL_ARB_draw_instanced(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_draw_instanced */ +#ifdef GL_ARB_explicit_attrib_location + CONST_CAST(GLEW_ARB_explicit_attrib_location) = glewGetExtension("GL_ARB_explicit_attrib_location"); +#endif /* GL_ARB_explicit_attrib_location */ +#ifdef GL_ARB_fragment_coord_conventions + CONST_CAST(GLEW_ARB_fragment_coord_conventions) = glewGetExtension("GL_ARB_fragment_coord_conventions"); +#endif /* GL_ARB_fragment_coord_conventions */ +#ifdef GL_ARB_fragment_program + CONST_CAST(GLEW_ARB_fragment_program) = glewGetExtension("GL_ARB_fragment_program"); +#endif /* GL_ARB_fragment_program */ +#ifdef GL_ARB_fragment_program_shadow + CONST_CAST(GLEW_ARB_fragment_program_shadow) = glewGetExtension("GL_ARB_fragment_program_shadow"); +#endif /* GL_ARB_fragment_program_shadow */ +#ifdef GL_ARB_fragment_shader + CONST_CAST(GLEW_ARB_fragment_shader) = glewGetExtension("GL_ARB_fragment_shader"); +#endif /* GL_ARB_fragment_shader */ +#ifdef GL_ARB_framebuffer_object + CONST_CAST(GLEW_ARB_framebuffer_object) = glewGetExtension("GL_ARB_framebuffer_object"); + if (glewExperimental || GLEW_ARB_framebuffer_object) CONST_CAST(GLEW_ARB_framebuffer_object) = !_glewInit_GL_ARB_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_framebuffer_object */ +#ifdef GL_ARB_framebuffer_sRGB + CONST_CAST(GLEW_ARB_framebuffer_sRGB) = glewGetExtension("GL_ARB_framebuffer_sRGB"); +#endif /* GL_ARB_framebuffer_sRGB */ +#ifdef GL_ARB_geometry_shader4 + CONST_CAST(GLEW_ARB_geometry_shader4) = glewGetExtension("GL_ARB_geometry_shader4"); + if (glewExperimental || GLEW_ARB_geometry_shader4) CONST_CAST(GLEW_ARB_geometry_shader4) = !_glewInit_GL_ARB_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_geometry_shader4 */ +#ifdef GL_ARB_get_program_binary + CONST_CAST(GLEW_ARB_get_program_binary) = glewGetExtension("GL_ARB_get_program_binary"); + if (glewExperimental || GLEW_ARB_get_program_binary) CONST_CAST(GLEW_ARB_get_program_binary) = !_glewInit_GL_ARB_get_program_binary(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_get_program_binary */ +#ifdef GL_ARB_gpu_shader5 + CONST_CAST(GLEW_ARB_gpu_shader5) = glewGetExtension("GL_ARB_gpu_shader5"); +#endif /* GL_ARB_gpu_shader5 */ +#ifdef GL_ARB_gpu_shader_fp64 + CONST_CAST(GLEW_ARB_gpu_shader_fp64) = glewGetExtension("GL_ARB_gpu_shader_fp64"); + if (glewExperimental || GLEW_ARB_gpu_shader_fp64) CONST_CAST(GLEW_ARB_gpu_shader_fp64) = !_glewInit_GL_ARB_gpu_shader_fp64(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_gpu_shader_fp64 */ +#ifdef GL_ARB_half_float_pixel + CONST_CAST(GLEW_ARB_half_float_pixel) = glewGetExtension("GL_ARB_half_float_pixel"); +#endif /* GL_ARB_half_float_pixel */ +#ifdef GL_ARB_half_float_vertex + CONST_CAST(GLEW_ARB_half_float_vertex) = glewGetExtension("GL_ARB_half_float_vertex"); +#endif /* GL_ARB_half_float_vertex */ +#ifdef GL_ARB_imaging + CONST_CAST(GLEW_ARB_imaging) = glewGetExtension("GL_ARB_imaging"); + if (glewExperimental || GLEW_ARB_imaging) CONST_CAST(GLEW_ARB_imaging) = !_glewInit_GL_ARB_imaging(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_imaging */ +#ifdef GL_ARB_instanced_arrays + CONST_CAST(GLEW_ARB_instanced_arrays) = glewGetExtension("GL_ARB_instanced_arrays"); + if (glewExperimental || GLEW_ARB_instanced_arrays) CONST_CAST(GLEW_ARB_instanced_arrays) = !_glewInit_GL_ARB_instanced_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_instanced_arrays */ +#ifdef GL_ARB_map_buffer_range + CONST_CAST(GLEW_ARB_map_buffer_range) = glewGetExtension("GL_ARB_map_buffer_range"); + if (glewExperimental || GLEW_ARB_map_buffer_range) CONST_CAST(GLEW_ARB_map_buffer_range) = !_glewInit_GL_ARB_map_buffer_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_map_buffer_range */ +#ifdef GL_ARB_matrix_palette + CONST_CAST(GLEW_ARB_matrix_palette) = glewGetExtension("GL_ARB_matrix_palette"); + if (glewExperimental || GLEW_ARB_matrix_palette) CONST_CAST(GLEW_ARB_matrix_palette) = !_glewInit_GL_ARB_matrix_palette(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_matrix_palette */ +#ifdef GL_ARB_multisample + CONST_CAST(GLEW_ARB_multisample) = glewGetExtension("GL_ARB_multisample"); + if (glewExperimental || GLEW_ARB_multisample) CONST_CAST(GLEW_ARB_multisample) = !_glewInit_GL_ARB_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multisample */ +#ifdef GL_ARB_multitexture + CONST_CAST(GLEW_ARB_multitexture) = glewGetExtension("GL_ARB_multitexture"); + if (glewExperimental || GLEW_ARB_multitexture) CONST_CAST(GLEW_ARB_multitexture) = !_glewInit_GL_ARB_multitexture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_multitexture */ +#ifdef GL_ARB_occlusion_query + CONST_CAST(GLEW_ARB_occlusion_query) = glewGetExtension("GL_ARB_occlusion_query"); + if (glewExperimental || GLEW_ARB_occlusion_query) CONST_CAST(GLEW_ARB_occlusion_query) = !_glewInit_GL_ARB_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_occlusion_query */ +#ifdef GL_ARB_occlusion_query2 + CONST_CAST(GLEW_ARB_occlusion_query2) = glewGetExtension("GL_ARB_occlusion_query2"); +#endif /* GL_ARB_occlusion_query2 */ +#ifdef GL_ARB_pixel_buffer_object + CONST_CAST(GLEW_ARB_pixel_buffer_object) = glewGetExtension("GL_ARB_pixel_buffer_object"); +#endif /* GL_ARB_pixel_buffer_object */ +#ifdef GL_ARB_point_parameters + CONST_CAST(GLEW_ARB_point_parameters) = glewGetExtension("GL_ARB_point_parameters"); + if (glewExperimental || GLEW_ARB_point_parameters) CONST_CAST(GLEW_ARB_point_parameters) = !_glewInit_GL_ARB_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_point_parameters */ +#ifdef GL_ARB_point_sprite + CONST_CAST(GLEW_ARB_point_sprite) = glewGetExtension("GL_ARB_point_sprite"); +#endif /* GL_ARB_point_sprite */ +#ifdef GL_ARB_provoking_vertex + CONST_CAST(GLEW_ARB_provoking_vertex) = glewGetExtension("GL_ARB_provoking_vertex"); + if (glewExperimental || GLEW_ARB_provoking_vertex) CONST_CAST(GLEW_ARB_provoking_vertex) = !_glewInit_GL_ARB_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_provoking_vertex */ +#ifdef GL_ARB_robustness + CONST_CAST(GLEW_ARB_robustness) = glewGetExtension("GL_ARB_robustness"); + if (glewExperimental || GLEW_ARB_robustness) CONST_CAST(GLEW_ARB_robustness) = !_glewInit_GL_ARB_robustness(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_robustness */ +#ifdef GL_ARB_sample_shading + CONST_CAST(GLEW_ARB_sample_shading) = glewGetExtension("GL_ARB_sample_shading"); + if (glewExperimental || GLEW_ARB_sample_shading) CONST_CAST(GLEW_ARB_sample_shading) = !_glewInit_GL_ARB_sample_shading(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sample_shading */ +#ifdef GL_ARB_sampler_objects + CONST_CAST(GLEW_ARB_sampler_objects) = glewGetExtension("GL_ARB_sampler_objects"); + if (glewExperimental || GLEW_ARB_sampler_objects) CONST_CAST(GLEW_ARB_sampler_objects) = !_glewInit_GL_ARB_sampler_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sampler_objects */ +#ifdef GL_ARB_seamless_cube_map + CONST_CAST(GLEW_ARB_seamless_cube_map) = glewGetExtension("GL_ARB_seamless_cube_map"); +#endif /* GL_ARB_seamless_cube_map */ +#ifdef GL_ARB_separate_shader_objects + CONST_CAST(GLEW_ARB_separate_shader_objects) = glewGetExtension("GL_ARB_separate_shader_objects"); + if (glewExperimental || GLEW_ARB_separate_shader_objects) CONST_CAST(GLEW_ARB_separate_shader_objects) = !_glewInit_GL_ARB_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_separate_shader_objects */ +#ifdef GL_ARB_shader_bit_encoding + CONST_CAST(GLEW_ARB_shader_bit_encoding) = glewGetExtension("GL_ARB_shader_bit_encoding"); +#endif /* GL_ARB_shader_bit_encoding */ +#ifdef GL_ARB_shader_objects + CONST_CAST(GLEW_ARB_shader_objects) = glewGetExtension("GL_ARB_shader_objects"); + if (glewExperimental || GLEW_ARB_shader_objects) CONST_CAST(GLEW_ARB_shader_objects) = !_glewInit_GL_ARB_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_objects */ +#ifdef GL_ARB_shader_precision + CONST_CAST(GLEW_ARB_shader_precision) = glewGetExtension("GL_ARB_shader_precision"); +#endif /* GL_ARB_shader_precision */ +#ifdef GL_ARB_shader_stencil_export + CONST_CAST(GLEW_ARB_shader_stencil_export) = glewGetExtension("GL_ARB_shader_stencil_export"); +#endif /* GL_ARB_shader_stencil_export */ +#ifdef GL_ARB_shader_subroutine + CONST_CAST(GLEW_ARB_shader_subroutine) = glewGetExtension("GL_ARB_shader_subroutine"); + if (glewExperimental || GLEW_ARB_shader_subroutine) CONST_CAST(GLEW_ARB_shader_subroutine) = !_glewInit_GL_ARB_shader_subroutine(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shader_subroutine */ +#ifdef GL_ARB_shader_texture_lod + CONST_CAST(GLEW_ARB_shader_texture_lod) = glewGetExtension("GL_ARB_shader_texture_lod"); +#endif /* GL_ARB_shader_texture_lod */ +#ifdef GL_ARB_shading_language_100 + CONST_CAST(GLEW_ARB_shading_language_100) = glewGetExtension("GL_ARB_shading_language_100"); +#endif /* GL_ARB_shading_language_100 */ +#ifdef GL_ARB_shading_language_include + CONST_CAST(GLEW_ARB_shading_language_include) = glewGetExtension("GL_ARB_shading_language_include"); + if (glewExperimental || GLEW_ARB_shading_language_include) CONST_CAST(GLEW_ARB_shading_language_include) = !_glewInit_GL_ARB_shading_language_include(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_shading_language_include */ +#ifdef GL_ARB_shadow + CONST_CAST(GLEW_ARB_shadow) = glewGetExtension("GL_ARB_shadow"); +#endif /* GL_ARB_shadow */ +#ifdef GL_ARB_shadow_ambient + CONST_CAST(GLEW_ARB_shadow_ambient) = glewGetExtension("GL_ARB_shadow_ambient"); +#endif /* GL_ARB_shadow_ambient */ +#ifdef GL_ARB_sync + CONST_CAST(GLEW_ARB_sync) = glewGetExtension("GL_ARB_sync"); + if (glewExperimental || GLEW_ARB_sync) CONST_CAST(GLEW_ARB_sync) = !_glewInit_GL_ARB_sync(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_sync */ +#ifdef GL_ARB_tessellation_shader + CONST_CAST(GLEW_ARB_tessellation_shader) = glewGetExtension("GL_ARB_tessellation_shader"); + if (glewExperimental || GLEW_ARB_tessellation_shader) CONST_CAST(GLEW_ARB_tessellation_shader) = !_glewInit_GL_ARB_tessellation_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_tessellation_shader */ +#ifdef GL_ARB_texture_border_clamp + CONST_CAST(GLEW_ARB_texture_border_clamp) = glewGetExtension("GL_ARB_texture_border_clamp"); +#endif /* GL_ARB_texture_border_clamp */ +#ifdef GL_ARB_texture_buffer_object + CONST_CAST(GLEW_ARB_texture_buffer_object) = glewGetExtension("GL_ARB_texture_buffer_object"); + if (glewExperimental || GLEW_ARB_texture_buffer_object) CONST_CAST(GLEW_ARB_texture_buffer_object) = !_glewInit_GL_ARB_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_buffer_object */ +#ifdef GL_ARB_texture_buffer_object_rgb32 + CONST_CAST(GLEW_ARB_texture_buffer_object_rgb32) = glewGetExtension("GL_ARB_texture_buffer_object_rgb32"); +#endif /* GL_ARB_texture_buffer_object_rgb32 */ +#ifdef GL_ARB_texture_compression + CONST_CAST(GLEW_ARB_texture_compression) = glewGetExtension("GL_ARB_texture_compression"); + if (glewExperimental || GLEW_ARB_texture_compression) CONST_CAST(GLEW_ARB_texture_compression) = !_glewInit_GL_ARB_texture_compression(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_compression */ +#ifdef GL_ARB_texture_compression_bptc + CONST_CAST(GLEW_ARB_texture_compression_bptc) = glewGetExtension("GL_ARB_texture_compression_bptc"); +#endif /* GL_ARB_texture_compression_bptc */ +#ifdef GL_ARB_texture_compression_rgtc + CONST_CAST(GLEW_ARB_texture_compression_rgtc) = glewGetExtension("GL_ARB_texture_compression_rgtc"); +#endif /* GL_ARB_texture_compression_rgtc */ +#ifdef GL_ARB_texture_cube_map + CONST_CAST(GLEW_ARB_texture_cube_map) = glewGetExtension("GL_ARB_texture_cube_map"); +#endif /* GL_ARB_texture_cube_map */ +#ifdef GL_ARB_texture_cube_map_array + CONST_CAST(GLEW_ARB_texture_cube_map_array) = glewGetExtension("GL_ARB_texture_cube_map_array"); +#endif /* GL_ARB_texture_cube_map_array */ +#ifdef GL_ARB_texture_env_add + CONST_CAST(GLEW_ARB_texture_env_add) = glewGetExtension("GL_ARB_texture_env_add"); +#endif /* GL_ARB_texture_env_add */ +#ifdef GL_ARB_texture_env_combine + CONST_CAST(GLEW_ARB_texture_env_combine) = glewGetExtension("GL_ARB_texture_env_combine"); +#endif /* GL_ARB_texture_env_combine */ +#ifdef GL_ARB_texture_env_crossbar + CONST_CAST(GLEW_ARB_texture_env_crossbar) = glewGetExtension("GL_ARB_texture_env_crossbar"); +#endif /* GL_ARB_texture_env_crossbar */ +#ifdef GL_ARB_texture_env_dot3 + CONST_CAST(GLEW_ARB_texture_env_dot3) = glewGetExtension("GL_ARB_texture_env_dot3"); +#endif /* GL_ARB_texture_env_dot3 */ +#ifdef GL_ARB_texture_float + CONST_CAST(GLEW_ARB_texture_float) = glewGetExtension("GL_ARB_texture_float"); +#endif /* GL_ARB_texture_float */ +#ifdef GL_ARB_texture_gather + CONST_CAST(GLEW_ARB_texture_gather) = glewGetExtension("GL_ARB_texture_gather"); +#endif /* GL_ARB_texture_gather */ +#ifdef GL_ARB_texture_mirrored_repeat + CONST_CAST(GLEW_ARB_texture_mirrored_repeat) = glewGetExtension("GL_ARB_texture_mirrored_repeat"); +#endif /* GL_ARB_texture_mirrored_repeat */ +#ifdef GL_ARB_texture_multisample + CONST_CAST(GLEW_ARB_texture_multisample) = glewGetExtension("GL_ARB_texture_multisample"); + if (glewExperimental || GLEW_ARB_texture_multisample) CONST_CAST(GLEW_ARB_texture_multisample) = !_glewInit_GL_ARB_texture_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_texture_multisample */ +#ifdef GL_ARB_texture_non_power_of_two + CONST_CAST(GLEW_ARB_texture_non_power_of_two) = glewGetExtension("GL_ARB_texture_non_power_of_two"); +#endif /* GL_ARB_texture_non_power_of_two */ +#ifdef GL_ARB_texture_query_lod + CONST_CAST(GLEW_ARB_texture_query_lod) = glewGetExtension("GL_ARB_texture_query_lod"); +#endif /* GL_ARB_texture_query_lod */ +#ifdef GL_ARB_texture_rectangle + CONST_CAST(GLEW_ARB_texture_rectangle) = glewGetExtension("GL_ARB_texture_rectangle"); +#endif /* GL_ARB_texture_rectangle */ +#ifdef GL_ARB_texture_rg + CONST_CAST(GLEW_ARB_texture_rg) = glewGetExtension("GL_ARB_texture_rg"); +#endif /* GL_ARB_texture_rg */ +#ifdef GL_ARB_texture_rgb10_a2ui + CONST_CAST(GLEW_ARB_texture_rgb10_a2ui) = glewGetExtension("GL_ARB_texture_rgb10_a2ui"); +#endif /* GL_ARB_texture_rgb10_a2ui */ +#ifdef GL_ARB_texture_swizzle + CONST_CAST(GLEW_ARB_texture_swizzle) = glewGetExtension("GL_ARB_texture_swizzle"); +#endif /* GL_ARB_texture_swizzle */ +#ifdef GL_ARB_timer_query + CONST_CAST(GLEW_ARB_timer_query) = glewGetExtension("GL_ARB_timer_query"); + if (glewExperimental || GLEW_ARB_timer_query) CONST_CAST(GLEW_ARB_timer_query) = !_glewInit_GL_ARB_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_timer_query */ +#ifdef GL_ARB_transform_feedback2 + CONST_CAST(GLEW_ARB_transform_feedback2) = glewGetExtension("GL_ARB_transform_feedback2"); + if (glewExperimental || GLEW_ARB_transform_feedback2) CONST_CAST(GLEW_ARB_transform_feedback2) = !_glewInit_GL_ARB_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transform_feedback2 */ +#ifdef GL_ARB_transform_feedback3 + CONST_CAST(GLEW_ARB_transform_feedback3) = glewGetExtension("GL_ARB_transform_feedback3"); + if (glewExperimental || GLEW_ARB_transform_feedback3) CONST_CAST(GLEW_ARB_transform_feedback3) = !_glewInit_GL_ARB_transform_feedback3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transform_feedback3 */ +#ifdef GL_ARB_transpose_matrix + CONST_CAST(GLEW_ARB_transpose_matrix) = glewGetExtension("GL_ARB_transpose_matrix"); + if (glewExperimental || GLEW_ARB_transpose_matrix) CONST_CAST(GLEW_ARB_transpose_matrix) = !_glewInit_GL_ARB_transpose_matrix(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_transpose_matrix */ +#ifdef GL_ARB_uniform_buffer_object + CONST_CAST(GLEW_ARB_uniform_buffer_object) = glewGetExtension("GL_ARB_uniform_buffer_object"); + if (glewExperimental || GLEW_ARB_uniform_buffer_object) CONST_CAST(GLEW_ARB_uniform_buffer_object) = !_glewInit_GL_ARB_uniform_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_uniform_buffer_object */ +#ifdef GL_ARB_vertex_array_bgra + CONST_CAST(GLEW_ARB_vertex_array_bgra) = glewGetExtension("GL_ARB_vertex_array_bgra"); +#endif /* GL_ARB_vertex_array_bgra */ +#ifdef GL_ARB_vertex_array_object + CONST_CAST(GLEW_ARB_vertex_array_object) = glewGetExtension("GL_ARB_vertex_array_object"); + if (glewExperimental || GLEW_ARB_vertex_array_object) CONST_CAST(GLEW_ARB_vertex_array_object) = !_glewInit_GL_ARB_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_array_object */ +#ifdef GL_ARB_vertex_attrib_64bit + CONST_CAST(GLEW_ARB_vertex_attrib_64bit) = glewGetExtension("GL_ARB_vertex_attrib_64bit"); + if (glewExperimental || GLEW_ARB_vertex_attrib_64bit) CONST_CAST(GLEW_ARB_vertex_attrib_64bit) = !_glewInit_GL_ARB_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_attrib_64bit */ +#ifdef GL_ARB_vertex_blend + CONST_CAST(GLEW_ARB_vertex_blend) = glewGetExtension("GL_ARB_vertex_blend"); + if (glewExperimental || GLEW_ARB_vertex_blend) CONST_CAST(GLEW_ARB_vertex_blend) = !_glewInit_GL_ARB_vertex_blend(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_blend */ +#ifdef GL_ARB_vertex_buffer_object + CONST_CAST(GLEW_ARB_vertex_buffer_object) = glewGetExtension("GL_ARB_vertex_buffer_object"); + if (glewExperimental || GLEW_ARB_vertex_buffer_object) CONST_CAST(GLEW_ARB_vertex_buffer_object) = !_glewInit_GL_ARB_vertex_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_buffer_object */ +#ifdef GL_ARB_vertex_program + CONST_CAST(GLEW_ARB_vertex_program) = glewGetExtension("GL_ARB_vertex_program"); + if (glewExperimental || GLEW_ARB_vertex_program) CONST_CAST(GLEW_ARB_vertex_program) = !_glewInit_GL_ARB_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_program */ +#ifdef GL_ARB_vertex_shader + CONST_CAST(GLEW_ARB_vertex_shader) = glewGetExtension("GL_ARB_vertex_shader"); + if (glewExperimental || GLEW_ARB_vertex_shader) CONST_CAST(GLEW_ARB_vertex_shader) = !_glewInit_GL_ARB_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_shader */ +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + CONST_CAST(GLEW_ARB_vertex_type_2_10_10_10_rev) = glewGetExtension("GL_ARB_vertex_type_2_10_10_10_rev"); + if (glewExperimental || GLEW_ARB_vertex_type_2_10_10_10_rev) CONST_CAST(GLEW_ARB_vertex_type_2_10_10_10_rev) = !_glewInit_GL_ARB_vertex_type_2_10_10_10_rev(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ +#ifdef GL_ARB_viewport_array + CONST_CAST(GLEW_ARB_viewport_array) = glewGetExtension("GL_ARB_viewport_array"); + if (glewExperimental || GLEW_ARB_viewport_array) CONST_CAST(GLEW_ARB_viewport_array) = !_glewInit_GL_ARB_viewport_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_viewport_array */ +#ifdef GL_ARB_window_pos + CONST_CAST(GLEW_ARB_window_pos) = glewGetExtension("GL_ARB_window_pos"); + if (glewExperimental || GLEW_ARB_window_pos) CONST_CAST(GLEW_ARB_window_pos) = !_glewInit_GL_ARB_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ARB_window_pos */ +#ifdef GL_ATIX_point_sprites + CONST_CAST(GLEW_ATIX_point_sprites) = glewGetExtension("GL_ATIX_point_sprites"); +#endif /* GL_ATIX_point_sprites */ +#ifdef GL_ATIX_texture_env_combine3 + CONST_CAST(GLEW_ATIX_texture_env_combine3) = glewGetExtension("GL_ATIX_texture_env_combine3"); +#endif /* GL_ATIX_texture_env_combine3 */ +#ifdef GL_ATIX_texture_env_route + CONST_CAST(GLEW_ATIX_texture_env_route) = glewGetExtension("GL_ATIX_texture_env_route"); +#endif /* GL_ATIX_texture_env_route */ +#ifdef GL_ATIX_vertex_shader_output_point_size + CONST_CAST(GLEW_ATIX_vertex_shader_output_point_size) = glewGetExtension("GL_ATIX_vertex_shader_output_point_size"); +#endif /* GL_ATIX_vertex_shader_output_point_size */ +#ifdef GL_ATI_draw_buffers + CONST_CAST(GLEW_ATI_draw_buffers) = glewGetExtension("GL_ATI_draw_buffers"); + if (glewExperimental || GLEW_ATI_draw_buffers) CONST_CAST(GLEW_ATI_draw_buffers) = !_glewInit_GL_ATI_draw_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_draw_buffers */ +#ifdef GL_ATI_element_array + CONST_CAST(GLEW_ATI_element_array) = glewGetExtension("GL_ATI_element_array"); + if (glewExperimental || GLEW_ATI_element_array) CONST_CAST(GLEW_ATI_element_array) = !_glewInit_GL_ATI_element_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_element_array */ +#ifdef GL_ATI_envmap_bumpmap + CONST_CAST(GLEW_ATI_envmap_bumpmap) = glewGetExtension("GL_ATI_envmap_bumpmap"); + if (glewExperimental || GLEW_ATI_envmap_bumpmap) CONST_CAST(GLEW_ATI_envmap_bumpmap) = !_glewInit_GL_ATI_envmap_bumpmap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_envmap_bumpmap */ +#ifdef GL_ATI_fragment_shader + CONST_CAST(GLEW_ATI_fragment_shader) = glewGetExtension("GL_ATI_fragment_shader"); + if (glewExperimental || GLEW_ATI_fragment_shader) CONST_CAST(GLEW_ATI_fragment_shader) = !_glewInit_GL_ATI_fragment_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_fragment_shader */ +#ifdef GL_ATI_map_object_buffer + CONST_CAST(GLEW_ATI_map_object_buffer) = glewGetExtension("GL_ATI_map_object_buffer"); + if (glewExperimental || GLEW_ATI_map_object_buffer) CONST_CAST(GLEW_ATI_map_object_buffer) = !_glewInit_GL_ATI_map_object_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_map_object_buffer */ +#ifdef GL_ATI_meminfo + CONST_CAST(GLEW_ATI_meminfo) = glewGetExtension("GL_ATI_meminfo"); +#endif /* GL_ATI_meminfo */ +#ifdef GL_ATI_pn_triangles + CONST_CAST(GLEW_ATI_pn_triangles) = glewGetExtension("GL_ATI_pn_triangles"); + if (glewExperimental || GLEW_ATI_pn_triangles) CONST_CAST(GLEW_ATI_pn_triangles) = !_glewInit_GL_ATI_pn_triangles(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_pn_triangles */ +#ifdef GL_ATI_separate_stencil + CONST_CAST(GLEW_ATI_separate_stencil) = glewGetExtension("GL_ATI_separate_stencil"); + if (glewExperimental || GLEW_ATI_separate_stencil) CONST_CAST(GLEW_ATI_separate_stencil) = !_glewInit_GL_ATI_separate_stencil(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_separate_stencil */ +#ifdef GL_ATI_shader_texture_lod + CONST_CAST(GLEW_ATI_shader_texture_lod) = glewGetExtension("GL_ATI_shader_texture_lod"); +#endif /* GL_ATI_shader_texture_lod */ +#ifdef GL_ATI_text_fragment_shader + CONST_CAST(GLEW_ATI_text_fragment_shader) = glewGetExtension("GL_ATI_text_fragment_shader"); +#endif /* GL_ATI_text_fragment_shader */ +#ifdef GL_ATI_texture_compression_3dc + CONST_CAST(GLEW_ATI_texture_compression_3dc) = glewGetExtension("GL_ATI_texture_compression_3dc"); +#endif /* GL_ATI_texture_compression_3dc */ +#ifdef GL_ATI_texture_env_combine3 + CONST_CAST(GLEW_ATI_texture_env_combine3) = glewGetExtension("GL_ATI_texture_env_combine3"); +#endif /* GL_ATI_texture_env_combine3 */ +#ifdef GL_ATI_texture_float + CONST_CAST(GLEW_ATI_texture_float) = glewGetExtension("GL_ATI_texture_float"); +#endif /* GL_ATI_texture_float */ +#ifdef GL_ATI_texture_mirror_once + CONST_CAST(GLEW_ATI_texture_mirror_once) = glewGetExtension("GL_ATI_texture_mirror_once"); +#endif /* GL_ATI_texture_mirror_once */ +#ifdef GL_ATI_vertex_array_object + CONST_CAST(GLEW_ATI_vertex_array_object) = glewGetExtension("GL_ATI_vertex_array_object"); + if (glewExperimental || GLEW_ATI_vertex_array_object) CONST_CAST(GLEW_ATI_vertex_array_object) = !_glewInit_GL_ATI_vertex_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_array_object */ +#ifdef GL_ATI_vertex_attrib_array_object + CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = glewGetExtension("GL_ATI_vertex_attrib_array_object"); + if (glewExperimental || GLEW_ATI_vertex_attrib_array_object) CONST_CAST(GLEW_ATI_vertex_attrib_array_object) = !_glewInit_GL_ATI_vertex_attrib_array_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_attrib_array_object */ +#ifdef GL_ATI_vertex_streams + CONST_CAST(GLEW_ATI_vertex_streams) = glewGetExtension("GL_ATI_vertex_streams"); + if (glewExperimental || GLEW_ATI_vertex_streams) CONST_CAST(GLEW_ATI_vertex_streams) = !_glewInit_GL_ATI_vertex_streams(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_ATI_vertex_streams */ +#ifdef GL_EXT_422_pixels + CONST_CAST(GLEW_EXT_422_pixels) = glewGetExtension("GL_EXT_422_pixels"); +#endif /* GL_EXT_422_pixels */ +#ifdef GL_EXT_Cg_shader + CONST_CAST(GLEW_EXT_Cg_shader) = glewGetExtension("GL_EXT_Cg_shader"); +#endif /* GL_EXT_Cg_shader */ +#ifdef GL_EXT_abgr + CONST_CAST(GLEW_EXT_abgr) = glewGetExtension("GL_EXT_abgr"); +#endif /* GL_EXT_abgr */ +#ifdef GL_EXT_bgra + CONST_CAST(GLEW_EXT_bgra) = glewGetExtension("GL_EXT_bgra"); +#endif /* GL_EXT_bgra */ +#ifdef GL_EXT_bindable_uniform + CONST_CAST(GLEW_EXT_bindable_uniform) = glewGetExtension("GL_EXT_bindable_uniform"); + if (glewExperimental || GLEW_EXT_bindable_uniform) CONST_CAST(GLEW_EXT_bindable_uniform) = !_glewInit_GL_EXT_bindable_uniform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_bindable_uniform */ +#ifdef GL_EXT_blend_color + CONST_CAST(GLEW_EXT_blend_color) = glewGetExtension("GL_EXT_blend_color"); + if (glewExperimental || GLEW_EXT_blend_color) CONST_CAST(GLEW_EXT_blend_color) = !_glewInit_GL_EXT_blend_color(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_color */ +#ifdef GL_EXT_blend_equation_separate + CONST_CAST(GLEW_EXT_blend_equation_separate) = glewGetExtension("GL_EXT_blend_equation_separate"); + if (glewExperimental || GLEW_EXT_blend_equation_separate) CONST_CAST(GLEW_EXT_blend_equation_separate) = !_glewInit_GL_EXT_blend_equation_separate(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_equation_separate */ +#ifdef GL_EXT_blend_func_separate + CONST_CAST(GLEW_EXT_blend_func_separate) = glewGetExtension("GL_EXT_blend_func_separate"); + if (glewExperimental || GLEW_EXT_blend_func_separate) CONST_CAST(GLEW_EXT_blend_func_separate) = !_glewInit_GL_EXT_blend_func_separate(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_func_separate */ +#ifdef GL_EXT_blend_logic_op + CONST_CAST(GLEW_EXT_blend_logic_op) = glewGetExtension("GL_EXT_blend_logic_op"); +#endif /* GL_EXT_blend_logic_op */ +#ifdef GL_EXT_blend_minmax + CONST_CAST(GLEW_EXT_blend_minmax) = glewGetExtension("GL_EXT_blend_minmax"); + if (glewExperimental || GLEW_EXT_blend_minmax) CONST_CAST(GLEW_EXT_blend_minmax) = !_glewInit_GL_EXT_blend_minmax(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_blend_minmax */ +#ifdef GL_EXT_blend_subtract + CONST_CAST(GLEW_EXT_blend_subtract) = glewGetExtension("GL_EXT_blend_subtract"); +#endif /* GL_EXT_blend_subtract */ +#ifdef GL_EXT_clip_volume_hint + CONST_CAST(GLEW_EXT_clip_volume_hint) = glewGetExtension("GL_EXT_clip_volume_hint"); +#endif /* GL_EXT_clip_volume_hint */ +#ifdef GL_EXT_cmyka + CONST_CAST(GLEW_EXT_cmyka) = glewGetExtension("GL_EXT_cmyka"); +#endif /* GL_EXT_cmyka */ +#ifdef GL_EXT_color_subtable + CONST_CAST(GLEW_EXT_color_subtable) = glewGetExtension("GL_EXT_color_subtable"); + if (glewExperimental || GLEW_EXT_color_subtable) CONST_CAST(GLEW_EXT_color_subtable) = !_glewInit_GL_EXT_color_subtable(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_color_subtable */ +#ifdef GL_EXT_compiled_vertex_array + CONST_CAST(GLEW_EXT_compiled_vertex_array) = glewGetExtension("GL_EXT_compiled_vertex_array"); + if (glewExperimental || GLEW_EXT_compiled_vertex_array) CONST_CAST(GLEW_EXT_compiled_vertex_array) = !_glewInit_GL_EXT_compiled_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_compiled_vertex_array */ +#ifdef GL_EXT_convolution + CONST_CAST(GLEW_EXT_convolution) = glewGetExtension("GL_EXT_convolution"); + if (glewExperimental || GLEW_EXT_convolution) CONST_CAST(GLEW_EXT_convolution) = !_glewInit_GL_EXT_convolution(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_convolution */ +#ifdef GL_EXT_coordinate_frame + CONST_CAST(GLEW_EXT_coordinate_frame) = glewGetExtension("GL_EXT_coordinate_frame"); + if (glewExperimental || GLEW_EXT_coordinate_frame) CONST_CAST(GLEW_EXT_coordinate_frame) = !_glewInit_GL_EXT_coordinate_frame(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_coordinate_frame */ +#ifdef GL_EXT_copy_texture + CONST_CAST(GLEW_EXT_copy_texture) = glewGetExtension("GL_EXT_copy_texture"); + if (glewExperimental || GLEW_EXT_copy_texture) CONST_CAST(GLEW_EXT_copy_texture) = !_glewInit_GL_EXT_copy_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_copy_texture */ +#ifdef GL_EXT_cull_vertex + CONST_CAST(GLEW_EXT_cull_vertex) = glewGetExtension("GL_EXT_cull_vertex"); + if (glewExperimental || GLEW_EXT_cull_vertex) CONST_CAST(GLEW_EXT_cull_vertex) = !_glewInit_GL_EXT_cull_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_cull_vertex */ +#ifdef GL_EXT_depth_bounds_test + CONST_CAST(GLEW_EXT_depth_bounds_test) = glewGetExtension("GL_EXT_depth_bounds_test"); + if (glewExperimental || GLEW_EXT_depth_bounds_test) CONST_CAST(GLEW_EXT_depth_bounds_test) = !_glewInit_GL_EXT_depth_bounds_test(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_depth_bounds_test */ +#ifdef GL_EXT_direct_state_access + CONST_CAST(GLEW_EXT_direct_state_access) = glewGetExtension("GL_EXT_direct_state_access"); + if (glewExperimental || GLEW_EXT_direct_state_access) CONST_CAST(GLEW_EXT_direct_state_access) = !_glewInit_GL_EXT_direct_state_access(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_direct_state_access */ +#ifdef GL_EXT_draw_buffers2 + CONST_CAST(GLEW_EXT_draw_buffers2) = glewGetExtension("GL_EXT_draw_buffers2"); + if (glewExperimental || GLEW_EXT_draw_buffers2) CONST_CAST(GLEW_EXT_draw_buffers2) = !_glewInit_GL_EXT_draw_buffers2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_buffers2 */ +#ifdef GL_EXT_draw_instanced + CONST_CAST(GLEW_EXT_draw_instanced) = glewGetExtension("GL_EXT_draw_instanced"); + if (glewExperimental || GLEW_EXT_draw_instanced) CONST_CAST(GLEW_EXT_draw_instanced) = !_glewInit_GL_EXT_draw_instanced(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_instanced */ +#ifdef GL_EXT_draw_range_elements + CONST_CAST(GLEW_EXT_draw_range_elements) = glewGetExtension("GL_EXT_draw_range_elements"); + if (glewExperimental || GLEW_EXT_draw_range_elements) CONST_CAST(GLEW_EXT_draw_range_elements) = !_glewInit_GL_EXT_draw_range_elements(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_draw_range_elements */ +#ifdef GL_EXT_fog_coord + CONST_CAST(GLEW_EXT_fog_coord) = glewGetExtension("GL_EXT_fog_coord"); + if (glewExperimental || GLEW_EXT_fog_coord) CONST_CAST(GLEW_EXT_fog_coord) = !_glewInit_GL_EXT_fog_coord(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_fog_coord */ +#ifdef GL_EXT_fragment_lighting + CONST_CAST(GLEW_EXT_fragment_lighting) = glewGetExtension("GL_EXT_fragment_lighting"); + if (glewExperimental || GLEW_EXT_fragment_lighting) CONST_CAST(GLEW_EXT_fragment_lighting) = !_glewInit_GL_EXT_fragment_lighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_fragment_lighting */ +#ifdef GL_EXT_framebuffer_blit + CONST_CAST(GLEW_EXT_framebuffer_blit) = glewGetExtension("GL_EXT_framebuffer_blit"); + if (glewExperimental || GLEW_EXT_framebuffer_blit) CONST_CAST(GLEW_EXT_framebuffer_blit) = !_glewInit_GL_EXT_framebuffer_blit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_blit */ +#ifdef GL_EXT_framebuffer_multisample + CONST_CAST(GLEW_EXT_framebuffer_multisample) = glewGetExtension("GL_EXT_framebuffer_multisample"); + if (glewExperimental || GLEW_EXT_framebuffer_multisample) CONST_CAST(GLEW_EXT_framebuffer_multisample) = !_glewInit_GL_EXT_framebuffer_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_multisample */ +#ifdef GL_EXT_framebuffer_object + CONST_CAST(GLEW_EXT_framebuffer_object) = glewGetExtension("GL_EXT_framebuffer_object"); + if (glewExperimental || GLEW_EXT_framebuffer_object) CONST_CAST(GLEW_EXT_framebuffer_object) = !_glewInit_GL_EXT_framebuffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_framebuffer_object */ +#ifdef GL_EXT_framebuffer_sRGB + CONST_CAST(GLEW_EXT_framebuffer_sRGB) = glewGetExtension("GL_EXT_framebuffer_sRGB"); +#endif /* GL_EXT_framebuffer_sRGB */ +#ifdef GL_EXT_geometry_shader4 + CONST_CAST(GLEW_EXT_geometry_shader4) = glewGetExtension("GL_EXT_geometry_shader4"); + if (glewExperimental || GLEW_EXT_geometry_shader4) CONST_CAST(GLEW_EXT_geometry_shader4) = !_glewInit_GL_EXT_geometry_shader4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_geometry_shader4 */ +#ifdef GL_EXT_gpu_program_parameters + CONST_CAST(GLEW_EXT_gpu_program_parameters) = glewGetExtension("GL_EXT_gpu_program_parameters"); + if (glewExperimental || GLEW_EXT_gpu_program_parameters) CONST_CAST(GLEW_EXT_gpu_program_parameters) = !_glewInit_GL_EXT_gpu_program_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_gpu_program_parameters */ +#ifdef GL_EXT_gpu_shader4 + CONST_CAST(GLEW_EXT_gpu_shader4) = glewGetExtension("GL_EXT_gpu_shader4"); + if (glewExperimental || GLEW_EXT_gpu_shader4) CONST_CAST(GLEW_EXT_gpu_shader4) = !_glewInit_GL_EXT_gpu_shader4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_gpu_shader4 */ +#ifdef GL_EXT_histogram + CONST_CAST(GLEW_EXT_histogram) = glewGetExtension("GL_EXT_histogram"); + if (glewExperimental || GLEW_EXT_histogram) CONST_CAST(GLEW_EXT_histogram) = !_glewInit_GL_EXT_histogram(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_histogram */ +#ifdef GL_EXT_index_array_formats + CONST_CAST(GLEW_EXT_index_array_formats) = glewGetExtension("GL_EXT_index_array_formats"); +#endif /* GL_EXT_index_array_formats */ +#ifdef GL_EXT_index_func + CONST_CAST(GLEW_EXT_index_func) = glewGetExtension("GL_EXT_index_func"); + if (glewExperimental || GLEW_EXT_index_func) CONST_CAST(GLEW_EXT_index_func) = !_glewInit_GL_EXT_index_func(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_index_func */ +#ifdef GL_EXT_index_material + CONST_CAST(GLEW_EXT_index_material) = glewGetExtension("GL_EXT_index_material"); + if (glewExperimental || GLEW_EXT_index_material) CONST_CAST(GLEW_EXT_index_material) = !_glewInit_GL_EXT_index_material(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_index_material */ +#ifdef GL_EXT_index_texture + CONST_CAST(GLEW_EXT_index_texture) = glewGetExtension("GL_EXT_index_texture"); +#endif /* GL_EXT_index_texture */ +#ifdef GL_EXT_light_texture + CONST_CAST(GLEW_EXT_light_texture) = glewGetExtension("GL_EXT_light_texture"); + if (glewExperimental || GLEW_EXT_light_texture) CONST_CAST(GLEW_EXT_light_texture) = !_glewInit_GL_EXT_light_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_light_texture */ +#ifdef GL_EXT_misc_attribute + CONST_CAST(GLEW_EXT_misc_attribute) = glewGetExtension("GL_EXT_misc_attribute"); +#endif /* GL_EXT_misc_attribute */ +#ifdef GL_EXT_multi_draw_arrays + CONST_CAST(GLEW_EXT_multi_draw_arrays) = glewGetExtension("GL_EXT_multi_draw_arrays"); + if (glewExperimental || GLEW_EXT_multi_draw_arrays) CONST_CAST(GLEW_EXT_multi_draw_arrays) = !_glewInit_GL_EXT_multi_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_multi_draw_arrays */ +#ifdef GL_EXT_multisample + CONST_CAST(GLEW_EXT_multisample) = glewGetExtension("GL_EXT_multisample"); + if (glewExperimental || GLEW_EXT_multisample) CONST_CAST(GLEW_EXT_multisample) = !_glewInit_GL_EXT_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_multisample */ +#ifdef GL_EXT_packed_depth_stencil + CONST_CAST(GLEW_EXT_packed_depth_stencil) = glewGetExtension("GL_EXT_packed_depth_stencil"); +#endif /* GL_EXT_packed_depth_stencil */ +#ifdef GL_EXT_packed_float + CONST_CAST(GLEW_EXT_packed_float) = glewGetExtension("GL_EXT_packed_float"); +#endif /* GL_EXT_packed_float */ +#ifdef GL_EXT_packed_pixels + CONST_CAST(GLEW_EXT_packed_pixels) = glewGetExtension("GL_EXT_packed_pixels"); +#endif /* GL_EXT_packed_pixels */ +#ifdef GL_EXT_paletted_texture + CONST_CAST(GLEW_EXT_paletted_texture) = glewGetExtension("GL_EXT_paletted_texture"); + if (glewExperimental || GLEW_EXT_paletted_texture) CONST_CAST(GLEW_EXT_paletted_texture) = !_glewInit_GL_EXT_paletted_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_paletted_texture */ +#ifdef GL_EXT_pixel_buffer_object + CONST_CAST(GLEW_EXT_pixel_buffer_object) = glewGetExtension("GL_EXT_pixel_buffer_object"); +#endif /* GL_EXT_pixel_buffer_object */ +#ifdef GL_EXT_pixel_transform + CONST_CAST(GLEW_EXT_pixel_transform) = glewGetExtension("GL_EXT_pixel_transform"); + if (glewExperimental || GLEW_EXT_pixel_transform) CONST_CAST(GLEW_EXT_pixel_transform) = !_glewInit_GL_EXT_pixel_transform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_pixel_transform */ +#ifdef GL_EXT_pixel_transform_color_table + CONST_CAST(GLEW_EXT_pixel_transform_color_table) = glewGetExtension("GL_EXT_pixel_transform_color_table"); +#endif /* GL_EXT_pixel_transform_color_table */ +#ifdef GL_EXT_point_parameters + CONST_CAST(GLEW_EXT_point_parameters) = glewGetExtension("GL_EXT_point_parameters"); + if (glewExperimental || GLEW_EXT_point_parameters) CONST_CAST(GLEW_EXT_point_parameters) = !_glewInit_GL_EXT_point_parameters(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_point_parameters */ +#ifdef GL_EXT_polygon_offset + CONST_CAST(GLEW_EXT_polygon_offset) = glewGetExtension("GL_EXT_polygon_offset"); + if (glewExperimental || GLEW_EXT_polygon_offset) CONST_CAST(GLEW_EXT_polygon_offset) = !_glewInit_GL_EXT_polygon_offset(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_polygon_offset */ +#ifdef GL_EXT_provoking_vertex + CONST_CAST(GLEW_EXT_provoking_vertex) = glewGetExtension("GL_EXT_provoking_vertex"); + if (glewExperimental || GLEW_EXT_provoking_vertex) CONST_CAST(GLEW_EXT_provoking_vertex) = !_glewInit_GL_EXT_provoking_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_provoking_vertex */ +#ifdef GL_EXT_rescale_normal + CONST_CAST(GLEW_EXT_rescale_normal) = glewGetExtension("GL_EXT_rescale_normal"); +#endif /* GL_EXT_rescale_normal */ +#ifdef GL_EXT_scene_marker + CONST_CAST(GLEW_EXT_scene_marker) = glewGetExtension("GL_EXT_scene_marker"); + if (glewExperimental || GLEW_EXT_scene_marker) CONST_CAST(GLEW_EXT_scene_marker) = !_glewInit_GL_EXT_scene_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_scene_marker */ +#ifdef GL_EXT_secondary_color + CONST_CAST(GLEW_EXT_secondary_color) = glewGetExtension("GL_EXT_secondary_color"); + if (glewExperimental || GLEW_EXT_secondary_color) CONST_CAST(GLEW_EXT_secondary_color) = !_glewInit_GL_EXT_secondary_color(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_secondary_color */ +#ifdef GL_EXT_separate_shader_objects + CONST_CAST(GLEW_EXT_separate_shader_objects) = glewGetExtension("GL_EXT_separate_shader_objects"); + if (glewExperimental || GLEW_EXT_separate_shader_objects) CONST_CAST(GLEW_EXT_separate_shader_objects) = !_glewInit_GL_EXT_separate_shader_objects(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_separate_shader_objects */ +#ifdef GL_EXT_separate_specular_color + CONST_CAST(GLEW_EXT_separate_specular_color) = glewGetExtension("GL_EXT_separate_specular_color"); +#endif /* GL_EXT_separate_specular_color */ +#ifdef GL_EXT_shader_image_load_store + CONST_CAST(GLEW_EXT_shader_image_load_store) = glewGetExtension("GL_EXT_shader_image_load_store"); + if (glewExperimental || GLEW_EXT_shader_image_load_store) CONST_CAST(GLEW_EXT_shader_image_load_store) = !_glewInit_GL_EXT_shader_image_load_store(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_shader_image_load_store */ +#ifdef GL_EXT_shadow_funcs + CONST_CAST(GLEW_EXT_shadow_funcs) = glewGetExtension("GL_EXT_shadow_funcs"); +#endif /* GL_EXT_shadow_funcs */ +#ifdef GL_EXT_shared_texture_palette + CONST_CAST(GLEW_EXT_shared_texture_palette) = glewGetExtension("GL_EXT_shared_texture_palette"); +#endif /* GL_EXT_shared_texture_palette */ +#ifdef GL_EXT_stencil_clear_tag + CONST_CAST(GLEW_EXT_stencil_clear_tag) = glewGetExtension("GL_EXT_stencil_clear_tag"); +#endif /* GL_EXT_stencil_clear_tag */ +#ifdef GL_EXT_stencil_two_side + CONST_CAST(GLEW_EXT_stencil_two_side) = glewGetExtension("GL_EXT_stencil_two_side"); + if (glewExperimental || GLEW_EXT_stencil_two_side) CONST_CAST(GLEW_EXT_stencil_two_side) = !_glewInit_GL_EXT_stencil_two_side(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_stencil_two_side */ +#ifdef GL_EXT_stencil_wrap + CONST_CAST(GLEW_EXT_stencil_wrap) = glewGetExtension("GL_EXT_stencil_wrap"); +#endif /* GL_EXT_stencil_wrap */ +#ifdef GL_EXT_subtexture + CONST_CAST(GLEW_EXT_subtexture) = glewGetExtension("GL_EXT_subtexture"); + if (glewExperimental || GLEW_EXT_subtexture) CONST_CAST(GLEW_EXT_subtexture) = !_glewInit_GL_EXT_subtexture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_subtexture */ +#ifdef GL_EXT_texture + CONST_CAST(GLEW_EXT_texture) = glewGetExtension("GL_EXT_texture"); +#endif /* GL_EXT_texture */ +#ifdef GL_EXT_texture3D + CONST_CAST(GLEW_EXT_texture3D) = glewGetExtension("GL_EXT_texture3D"); + if (glewExperimental || GLEW_EXT_texture3D) CONST_CAST(GLEW_EXT_texture3D) = !_glewInit_GL_EXT_texture3D(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture3D */ +#ifdef GL_EXT_texture_array + CONST_CAST(GLEW_EXT_texture_array) = glewGetExtension("GL_EXT_texture_array"); +#endif /* GL_EXT_texture_array */ +#ifdef GL_EXT_texture_buffer_object + CONST_CAST(GLEW_EXT_texture_buffer_object) = glewGetExtension("GL_EXT_texture_buffer_object"); + if (glewExperimental || GLEW_EXT_texture_buffer_object) CONST_CAST(GLEW_EXT_texture_buffer_object) = !_glewInit_GL_EXT_texture_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_buffer_object */ +#ifdef GL_EXT_texture_compression_dxt1 + CONST_CAST(GLEW_EXT_texture_compression_dxt1) = glewGetExtension("GL_EXT_texture_compression_dxt1"); +#endif /* GL_EXT_texture_compression_dxt1 */ +#ifdef GL_EXT_texture_compression_latc + CONST_CAST(GLEW_EXT_texture_compression_latc) = glewGetExtension("GL_EXT_texture_compression_latc"); +#endif /* GL_EXT_texture_compression_latc */ +#ifdef GL_EXT_texture_compression_rgtc + CONST_CAST(GLEW_EXT_texture_compression_rgtc) = glewGetExtension("GL_EXT_texture_compression_rgtc"); +#endif /* GL_EXT_texture_compression_rgtc */ +#ifdef GL_EXT_texture_compression_s3tc + CONST_CAST(GLEW_EXT_texture_compression_s3tc) = glewGetExtension("GL_EXT_texture_compression_s3tc"); +#endif /* GL_EXT_texture_compression_s3tc */ +#ifdef GL_EXT_texture_cube_map + CONST_CAST(GLEW_EXT_texture_cube_map) = glewGetExtension("GL_EXT_texture_cube_map"); +#endif /* GL_EXT_texture_cube_map */ +#ifdef GL_EXT_texture_edge_clamp + CONST_CAST(GLEW_EXT_texture_edge_clamp) = glewGetExtension("GL_EXT_texture_edge_clamp"); +#endif /* GL_EXT_texture_edge_clamp */ +#ifdef GL_EXT_texture_env + CONST_CAST(GLEW_EXT_texture_env) = glewGetExtension("GL_EXT_texture_env"); +#endif /* GL_EXT_texture_env */ +#ifdef GL_EXT_texture_env_add + CONST_CAST(GLEW_EXT_texture_env_add) = glewGetExtension("GL_EXT_texture_env_add"); +#endif /* GL_EXT_texture_env_add */ +#ifdef GL_EXT_texture_env_combine + CONST_CAST(GLEW_EXT_texture_env_combine) = glewGetExtension("GL_EXT_texture_env_combine"); +#endif /* GL_EXT_texture_env_combine */ +#ifdef GL_EXT_texture_env_dot3 + CONST_CAST(GLEW_EXT_texture_env_dot3) = glewGetExtension("GL_EXT_texture_env_dot3"); +#endif /* GL_EXT_texture_env_dot3 */ +#ifdef GL_EXT_texture_filter_anisotropic + CONST_CAST(GLEW_EXT_texture_filter_anisotropic) = glewGetExtension("GL_EXT_texture_filter_anisotropic"); +#endif /* GL_EXT_texture_filter_anisotropic */ +#ifdef GL_EXT_texture_integer + CONST_CAST(GLEW_EXT_texture_integer) = glewGetExtension("GL_EXT_texture_integer"); + if (glewExperimental || GLEW_EXT_texture_integer) CONST_CAST(GLEW_EXT_texture_integer) = !_glewInit_GL_EXT_texture_integer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_integer */ +#ifdef GL_EXT_texture_lod_bias + CONST_CAST(GLEW_EXT_texture_lod_bias) = glewGetExtension("GL_EXT_texture_lod_bias"); +#endif /* GL_EXT_texture_lod_bias */ +#ifdef GL_EXT_texture_mirror_clamp + CONST_CAST(GLEW_EXT_texture_mirror_clamp) = glewGetExtension("GL_EXT_texture_mirror_clamp"); +#endif /* GL_EXT_texture_mirror_clamp */ +#ifdef GL_EXT_texture_object + CONST_CAST(GLEW_EXT_texture_object) = glewGetExtension("GL_EXT_texture_object"); + if (glewExperimental || GLEW_EXT_texture_object) CONST_CAST(GLEW_EXT_texture_object) = !_glewInit_GL_EXT_texture_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_object */ +#ifdef GL_EXT_texture_perturb_normal + CONST_CAST(GLEW_EXT_texture_perturb_normal) = glewGetExtension("GL_EXT_texture_perturb_normal"); + if (glewExperimental || GLEW_EXT_texture_perturb_normal) CONST_CAST(GLEW_EXT_texture_perturb_normal) = !_glewInit_GL_EXT_texture_perturb_normal(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_texture_perturb_normal */ +#ifdef GL_EXT_texture_rectangle + CONST_CAST(GLEW_EXT_texture_rectangle) = glewGetExtension("GL_EXT_texture_rectangle"); +#endif /* GL_EXT_texture_rectangle */ +#ifdef GL_EXT_texture_sRGB + CONST_CAST(GLEW_EXT_texture_sRGB) = glewGetExtension("GL_EXT_texture_sRGB"); +#endif /* GL_EXT_texture_sRGB */ +#ifdef GL_EXT_texture_sRGB_decode + CONST_CAST(GLEW_EXT_texture_sRGB_decode) = glewGetExtension("GL_EXT_texture_sRGB_decode"); +#endif /* GL_EXT_texture_sRGB_decode */ +#ifdef GL_EXT_texture_shared_exponent + CONST_CAST(GLEW_EXT_texture_shared_exponent) = glewGetExtension("GL_EXT_texture_shared_exponent"); +#endif /* GL_EXT_texture_shared_exponent */ +#ifdef GL_EXT_texture_snorm + CONST_CAST(GLEW_EXT_texture_snorm) = glewGetExtension("GL_EXT_texture_snorm"); +#endif /* GL_EXT_texture_snorm */ +#ifdef GL_EXT_texture_swizzle + CONST_CAST(GLEW_EXT_texture_swizzle) = glewGetExtension("GL_EXT_texture_swizzle"); +#endif /* GL_EXT_texture_swizzle */ +#ifdef GL_EXT_timer_query + CONST_CAST(GLEW_EXT_timer_query) = glewGetExtension("GL_EXT_timer_query"); + if (glewExperimental || GLEW_EXT_timer_query) CONST_CAST(GLEW_EXT_timer_query) = !_glewInit_GL_EXT_timer_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_timer_query */ +#ifdef GL_EXT_transform_feedback + CONST_CAST(GLEW_EXT_transform_feedback) = glewGetExtension("GL_EXT_transform_feedback"); + if (glewExperimental || GLEW_EXT_transform_feedback) CONST_CAST(GLEW_EXT_transform_feedback) = !_glewInit_GL_EXT_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_transform_feedback */ +#ifdef GL_EXT_vertex_array + CONST_CAST(GLEW_EXT_vertex_array) = glewGetExtension("GL_EXT_vertex_array"); + if (glewExperimental || GLEW_EXT_vertex_array) CONST_CAST(GLEW_EXT_vertex_array) = !_glewInit_GL_EXT_vertex_array(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_array */ +#ifdef GL_EXT_vertex_array_bgra + CONST_CAST(GLEW_EXT_vertex_array_bgra) = glewGetExtension("GL_EXT_vertex_array_bgra"); +#endif /* GL_EXT_vertex_array_bgra */ +#ifdef GL_EXT_vertex_attrib_64bit + CONST_CAST(GLEW_EXT_vertex_attrib_64bit) = glewGetExtension("GL_EXT_vertex_attrib_64bit"); + if (glewExperimental || GLEW_EXT_vertex_attrib_64bit) CONST_CAST(GLEW_EXT_vertex_attrib_64bit) = !_glewInit_GL_EXT_vertex_attrib_64bit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_attrib_64bit */ +#ifdef GL_EXT_vertex_shader + CONST_CAST(GLEW_EXT_vertex_shader) = glewGetExtension("GL_EXT_vertex_shader"); + if (glewExperimental || GLEW_EXT_vertex_shader) CONST_CAST(GLEW_EXT_vertex_shader) = !_glewInit_GL_EXT_vertex_shader(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_shader */ +#ifdef GL_EXT_vertex_weighting + CONST_CAST(GLEW_EXT_vertex_weighting) = glewGetExtension("GL_EXT_vertex_weighting"); + if (glewExperimental || GLEW_EXT_vertex_weighting) CONST_CAST(GLEW_EXT_vertex_weighting) = !_glewInit_GL_EXT_vertex_weighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_EXT_vertex_weighting */ +#ifdef GL_GREMEDY_frame_terminator + CONST_CAST(GLEW_GREMEDY_frame_terminator) = glewGetExtension("GL_GREMEDY_frame_terminator"); + if (glewExperimental || GLEW_GREMEDY_frame_terminator) CONST_CAST(GLEW_GREMEDY_frame_terminator) = !_glewInit_GL_GREMEDY_frame_terminator(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_GREMEDY_frame_terminator */ +#ifdef GL_GREMEDY_string_marker + CONST_CAST(GLEW_GREMEDY_string_marker) = glewGetExtension("GL_GREMEDY_string_marker"); + if (glewExperimental || GLEW_GREMEDY_string_marker) CONST_CAST(GLEW_GREMEDY_string_marker) = !_glewInit_GL_GREMEDY_string_marker(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_GREMEDY_string_marker */ +#ifdef GL_HP_convolution_border_modes + CONST_CAST(GLEW_HP_convolution_border_modes) = glewGetExtension("GL_HP_convolution_border_modes"); +#endif /* GL_HP_convolution_border_modes */ +#ifdef GL_HP_image_transform + CONST_CAST(GLEW_HP_image_transform) = glewGetExtension("GL_HP_image_transform"); + if (glewExperimental || GLEW_HP_image_transform) CONST_CAST(GLEW_HP_image_transform) = !_glewInit_GL_HP_image_transform(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_HP_image_transform */ +#ifdef GL_HP_occlusion_test + CONST_CAST(GLEW_HP_occlusion_test) = glewGetExtension("GL_HP_occlusion_test"); +#endif /* GL_HP_occlusion_test */ +#ifdef GL_HP_texture_lighting + CONST_CAST(GLEW_HP_texture_lighting) = glewGetExtension("GL_HP_texture_lighting"); +#endif /* GL_HP_texture_lighting */ +#ifdef GL_IBM_cull_vertex + CONST_CAST(GLEW_IBM_cull_vertex) = glewGetExtension("GL_IBM_cull_vertex"); +#endif /* GL_IBM_cull_vertex */ +#ifdef GL_IBM_multimode_draw_arrays + CONST_CAST(GLEW_IBM_multimode_draw_arrays) = glewGetExtension("GL_IBM_multimode_draw_arrays"); + if (glewExperimental || GLEW_IBM_multimode_draw_arrays) CONST_CAST(GLEW_IBM_multimode_draw_arrays) = !_glewInit_GL_IBM_multimode_draw_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_IBM_multimode_draw_arrays */ +#ifdef GL_IBM_rasterpos_clip + CONST_CAST(GLEW_IBM_rasterpos_clip) = glewGetExtension("GL_IBM_rasterpos_clip"); +#endif /* GL_IBM_rasterpos_clip */ +#ifdef GL_IBM_static_data + CONST_CAST(GLEW_IBM_static_data) = glewGetExtension("GL_IBM_static_data"); +#endif /* GL_IBM_static_data */ +#ifdef GL_IBM_texture_mirrored_repeat + CONST_CAST(GLEW_IBM_texture_mirrored_repeat) = glewGetExtension("GL_IBM_texture_mirrored_repeat"); +#endif /* GL_IBM_texture_mirrored_repeat */ +#ifdef GL_IBM_vertex_array_lists + CONST_CAST(GLEW_IBM_vertex_array_lists) = glewGetExtension("GL_IBM_vertex_array_lists"); + if (glewExperimental || GLEW_IBM_vertex_array_lists) CONST_CAST(GLEW_IBM_vertex_array_lists) = !_glewInit_GL_IBM_vertex_array_lists(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_IBM_vertex_array_lists */ +#ifdef GL_INGR_color_clamp + CONST_CAST(GLEW_INGR_color_clamp) = glewGetExtension("GL_INGR_color_clamp"); +#endif /* GL_INGR_color_clamp */ +#ifdef GL_INGR_interlace_read + CONST_CAST(GLEW_INGR_interlace_read) = glewGetExtension("GL_INGR_interlace_read"); +#endif /* GL_INGR_interlace_read */ +#ifdef GL_INTEL_parallel_arrays + CONST_CAST(GLEW_INTEL_parallel_arrays) = glewGetExtension("GL_INTEL_parallel_arrays"); + if (glewExperimental || GLEW_INTEL_parallel_arrays) CONST_CAST(GLEW_INTEL_parallel_arrays) = !_glewInit_GL_INTEL_parallel_arrays(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_INTEL_parallel_arrays */ +#ifdef GL_INTEL_texture_scissor + CONST_CAST(GLEW_INTEL_texture_scissor) = glewGetExtension("GL_INTEL_texture_scissor"); + if (glewExperimental || GLEW_INTEL_texture_scissor) CONST_CAST(GLEW_INTEL_texture_scissor) = !_glewInit_GL_INTEL_texture_scissor(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_INTEL_texture_scissor */ +#ifdef GL_KTX_buffer_region + CONST_CAST(GLEW_KTX_buffer_region) = glewGetExtension("GL_KTX_buffer_region"); + if (glewExperimental || GLEW_KTX_buffer_region) CONST_CAST(GLEW_KTX_buffer_region) = !_glewInit_GL_KTX_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_KTX_buffer_region */ +#ifdef GL_MESAX_texture_stack + CONST_CAST(GLEW_MESAX_texture_stack) = glewGetExtension("GL_MESAX_texture_stack"); +#endif /* GL_MESAX_texture_stack */ +#ifdef GL_MESA_pack_invert + CONST_CAST(GLEW_MESA_pack_invert) = glewGetExtension("GL_MESA_pack_invert"); +#endif /* GL_MESA_pack_invert */ +#ifdef GL_MESA_resize_buffers + CONST_CAST(GLEW_MESA_resize_buffers) = glewGetExtension("GL_MESA_resize_buffers"); + if (glewExperimental || GLEW_MESA_resize_buffers) CONST_CAST(GLEW_MESA_resize_buffers) = !_glewInit_GL_MESA_resize_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_MESA_resize_buffers */ +#ifdef GL_MESA_window_pos + CONST_CAST(GLEW_MESA_window_pos) = glewGetExtension("GL_MESA_window_pos"); + if (glewExperimental || GLEW_MESA_window_pos) CONST_CAST(GLEW_MESA_window_pos) = !_glewInit_GL_MESA_window_pos(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_MESA_window_pos */ +#ifdef GL_MESA_ycbcr_texture + CONST_CAST(GLEW_MESA_ycbcr_texture) = glewGetExtension("GL_MESA_ycbcr_texture"); +#endif /* GL_MESA_ycbcr_texture */ +#ifdef GL_NVX_gpu_memory_info + CONST_CAST(GLEW_NVX_gpu_memory_info) = glewGetExtension("GL_NVX_gpu_memory_info"); +#endif /* GL_NVX_gpu_memory_info */ +#ifdef GL_NV_blend_square + CONST_CAST(GLEW_NV_blend_square) = glewGetExtension("GL_NV_blend_square"); +#endif /* GL_NV_blend_square */ +#ifdef GL_NV_conditional_render + CONST_CAST(GLEW_NV_conditional_render) = glewGetExtension("GL_NV_conditional_render"); + if (glewExperimental || GLEW_NV_conditional_render) CONST_CAST(GLEW_NV_conditional_render) = !_glewInit_GL_NV_conditional_render(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_conditional_render */ +#ifdef GL_NV_copy_depth_to_color + CONST_CAST(GLEW_NV_copy_depth_to_color) = glewGetExtension("GL_NV_copy_depth_to_color"); +#endif /* GL_NV_copy_depth_to_color */ +#ifdef GL_NV_copy_image + CONST_CAST(GLEW_NV_copy_image) = glewGetExtension("GL_NV_copy_image"); + if (glewExperimental || GLEW_NV_copy_image) CONST_CAST(GLEW_NV_copy_image) = !_glewInit_GL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_copy_image */ +#ifdef GL_NV_depth_buffer_float + CONST_CAST(GLEW_NV_depth_buffer_float) = glewGetExtension("GL_NV_depth_buffer_float"); + if (glewExperimental || GLEW_NV_depth_buffer_float) CONST_CAST(GLEW_NV_depth_buffer_float) = !_glewInit_GL_NV_depth_buffer_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_depth_buffer_float */ +#ifdef GL_NV_depth_clamp + CONST_CAST(GLEW_NV_depth_clamp) = glewGetExtension("GL_NV_depth_clamp"); +#endif /* GL_NV_depth_clamp */ +#ifdef GL_NV_depth_range_unclamped + CONST_CAST(GLEW_NV_depth_range_unclamped) = glewGetExtension("GL_NV_depth_range_unclamped"); +#endif /* GL_NV_depth_range_unclamped */ +#ifdef GL_NV_evaluators + CONST_CAST(GLEW_NV_evaluators) = glewGetExtension("GL_NV_evaluators"); + if (glewExperimental || GLEW_NV_evaluators) CONST_CAST(GLEW_NV_evaluators) = !_glewInit_GL_NV_evaluators(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_evaluators */ +#ifdef GL_NV_explicit_multisample + CONST_CAST(GLEW_NV_explicit_multisample) = glewGetExtension("GL_NV_explicit_multisample"); + if (glewExperimental || GLEW_NV_explicit_multisample) CONST_CAST(GLEW_NV_explicit_multisample) = !_glewInit_GL_NV_explicit_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_explicit_multisample */ +#ifdef GL_NV_fence + CONST_CAST(GLEW_NV_fence) = glewGetExtension("GL_NV_fence"); + if (glewExperimental || GLEW_NV_fence) CONST_CAST(GLEW_NV_fence) = !_glewInit_GL_NV_fence(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_fence */ +#ifdef GL_NV_float_buffer + CONST_CAST(GLEW_NV_float_buffer) = glewGetExtension("GL_NV_float_buffer"); +#endif /* GL_NV_float_buffer */ +#ifdef GL_NV_fog_distance + CONST_CAST(GLEW_NV_fog_distance) = glewGetExtension("GL_NV_fog_distance"); +#endif /* GL_NV_fog_distance */ +#ifdef GL_NV_fragment_program + CONST_CAST(GLEW_NV_fragment_program) = glewGetExtension("GL_NV_fragment_program"); + if (glewExperimental || GLEW_NV_fragment_program) CONST_CAST(GLEW_NV_fragment_program) = !_glewInit_GL_NV_fragment_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_fragment_program */ +#ifdef GL_NV_fragment_program2 + CONST_CAST(GLEW_NV_fragment_program2) = glewGetExtension("GL_NV_fragment_program2"); +#endif /* GL_NV_fragment_program2 */ +#ifdef GL_NV_fragment_program4 + CONST_CAST(GLEW_NV_fragment_program4) = glewGetExtension("GL_NV_gpu_program4"); +#endif /* GL_NV_fragment_program4 */ +#ifdef GL_NV_fragment_program_option + CONST_CAST(GLEW_NV_fragment_program_option) = glewGetExtension("GL_NV_fragment_program_option"); +#endif /* GL_NV_fragment_program_option */ +#ifdef GL_NV_framebuffer_multisample_coverage + CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = glewGetExtension("GL_NV_framebuffer_multisample_coverage"); + if (glewExperimental || GLEW_NV_framebuffer_multisample_coverage) CONST_CAST(GLEW_NV_framebuffer_multisample_coverage) = !_glewInit_GL_NV_framebuffer_multisample_coverage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_framebuffer_multisample_coverage */ +#ifdef GL_NV_geometry_program4 + CONST_CAST(GLEW_NV_geometry_program4) = glewGetExtension("GL_NV_gpu_program4"); + if (glewExperimental || GLEW_NV_geometry_program4) CONST_CAST(GLEW_NV_geometry_program4) = !_glewInit_GL_NV_geometry_program4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_geometry_program4 */ +#ifdef GL_NV_geometry_shader4 + CONST_CAST(GLEW_NV_geometry_shader4) = glewGetExtension("GL_NV_geometry_shader4"); +#endif /* GL_NV_geometry_shader4 */ +#ifdef GL_NV_gpu_program4 + CONST_CAST(GLEW_NV_gpu_program4) = glewGetExtension("GL_NV_gpu_program4"); + if (glewExperimental || GLEW_NV_gpu_program4) CONST_CAST(GLEW_NV_gpu_program4) = !_glewInit_GL_NV_gpu_program4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_gpu_program4 */ +#ifdef GL_NV_gpu_program5 + CONST_CAST(GLEW_NV_gpu_program5) = glewGetExtension("GL_NV_gpu_program5"); +#endif /* GL_NV_gpu_program5 */ +#ifdef GL_NV_gpu_program_fp64 + CONST_CAST(GLEW_NV_gpu_program_fp64) = glewGetExtension("GL_NV_gpu_program_fp64"); +#endif /* GL_NV_gpu_program_fp64 */ +#ifdef GL_NV_gpu_shader5 + CONST_CAST(GLEW_NV_gpu_shader5) = glewGetExtension("GL_NV_gpu_shader5"); + if (glewExperimental || GLEW_NV_gpu_shader5) CONST_CAST(GLEW_NV_gpu_shader5) = !_glewInit_GL_NV_gpu_shader5(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_gpu_shader5 */ +#ifdef GL_NV_half_float + CONST_CAST(GLEW_NV_half_float) = glewGetExtension("GL_NV_half_float"); + if (glewExperimental || GLEW_NV_half_float) CONST_CAST(GLEW_NV_half_float) = !_glewInit_GL_NV_half_float(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_half_float */ +#ifdef GL_NV_light_max_exponent + CONST_CAST(GLEW_NV_light_max_exponent) = glewGetExtension("GL_NV_light_max_exponent"); +#endif /* GL_NV_light_max_exponent */ +#ifdef GL_NV_multisample_coverage + CONST_CAST(GLEW_NV_multisample_coverage) = glewGetExtension("GL_NV_multisample_coverage"); +#endif /* GL_NV_multisample_coverage */ +#ifdef GL_NV_multisample_filter_hint + CONST_CAST(GLEW_NV_multisample_filter_hint) = glewGetExtension("GL_NV_multisample_filter_hint"); +#endif /* GL_NV_multisample_filter_hint */ +#ifdef GL_NV_occlusion_query + CONST_CAST(GLEW_NV_occlusion_query) = glewGetExtension("GL_NV_occlusion_query"); + if (glewExperimental || GLEW_NV_occlusion_query) CONST_CAST(GLEW_NV_occlusion_query) = !_glewInit_GL_NV_occlusion_query(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_occlusion_query */ +#ifdef GL_NV_packed_depth_stencil + CONST_CAST(GLEW_NV_packed_depth_stencil) = glewGetExtension("GL_NV_packed_depth_stencil"); +#endif /* GL_NV_packed_depth_stencil */ +#ifdef GL_NV_parameter_buffer_object + CONST_CAST(GLEW_NV_parameter_buffer_object) = glewGetExtension("GL_NV_parameter_buffer_object"); + if (glewExperimental || GLEW_NV_parameter_buffer_object) CONST_CAST(GLEW_NV_parameter_buffer_object) = !_glewInit_GL_NV_parameter_buffer_object(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_parameter_buffer_object */ +#ifdef GL_NV_parameter_buffer_object2 + CONST_CAST(GLEW_NV_parameter_buffer_object2) = glewGetExtension("GL_NV_parameter_buffer_object2"); +#endif /* GL_NV_parameter_buffer_object2 */ +#ifdef GL_NV_pixel_data_range + CONST_CAST(GLEW_NV_pixel_data_range) = glewGetExtension("GL_NV_pixel_data_range"); + if (glewExperimental || GLEW_NV_pixel_data_range) CONST_CAST(GLEW_NV_pixel_data_range) = !_glewInit_GL_NV_pixel_data_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_pixel_data_range */ +#ifdef GL_NV_point_sprite + CONST_CAST(GLEW_NV_point_sprite) = glewGetExtension("GL_NV_point_sprite"); + if (glewExperimental || GLEW_NV_point_sprite) CONST_CAST(GLEW_NV_point_sprite) = !_glewInit_GL_NV_point_sprite(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_point_sprite */ +#ifdef GL_NV_present_video + CONST_CAST(GLEW_NV_present_video) = glewGetExtension("GL_NV_present_video"); + if (glewExperimental || GLEW_NV_present_video) CONST_CAST(GLEW_NV_present_video) = !_glewInit_GL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_present_video */ +#ifdef GL_NV_primitive_restart + CONST_CAST(GLEW_NV_primitive_restart) = glewGetExtension("GL_NV_primitive_restart"); + if (glewExperimental || GLEW_NV_primitive_restart) CONST_CAST(GLEW_NV_primitive_restart) = !_glewInit_GL_NV_primitive_restart(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_primitive_restart */ +#ifdef GL_NV_register_combiners + CONST_CAST(GLEW_NV_register_combiners) = glewGetExtension("GL_NV_register_combiners"); + if (glewExperimental || GLEW_NV_register_combiners) CONST_CAST(GLEW_NV_register_combiners) = !_glewInit_GL_NV_register_combiners(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_register_combiners */ +#ifdef GL_NV_register_combiners2 + CONST_CAST(GLEW_NV_register_combiners2) = glewGetExtension("GL_NV_register_combiners2"); + if (glewExperimental || GLEW_NV_register_combiners2) CONST_CAST(GLEW_NV_register_combiners2) = !_glewInit_GL_NV_register_combiners2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_register_combiners2 */ +#ifdef GL_NV_shader_buffer_load + CONST_CAST(GLEW_NV_shader_buffer_load) = glewGetExtension("GL_NV_shader_buffer_load"); + if (glewExperimental || GLEW_NV_shader_buffer_load) CONST_CAST(GLEW_NV_shader_buffer_load) = !_glewInit_GL_NV_shader_buffer_load(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_shader_buffer_load */ +#ifdef GL_NV_tessellation_program5 + CONST_CAST(GLEW_NV_tessellation_program5) = glewGetExtension("GL_NV_gpu_program5"); +#endif /* GL_NV_tessellation_program5 */ +#ifdef GL_NV_texgen_emboss + CONST_CAST(GLEW_NV_texgen_emboss) = glewGetExtension("GL_NV_texgen_emboss"); +#endif /* GL_NV_texgen_emboss */ +#ifdef GL_NV_texgen_reflection + CONST_CAST(GLEW_NV_texgen_reflection) = glewGetExtension("GL_NV_texgen_reflection"); +#endif /* GL_NV_texgen_reflection */ +#ifdef GL_NV_texture_barrier + CONST_CAST(GLEW_NV_texture_barrier) = glewGetExtension("GL_NV_texture_barrier"); + if (glewExperimental || GLEW_NV_texture_barrier) CONST_CAST(GLEW_NV_texture_barrier) = !_glewInit_GL_NV_texture_barrier(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_texture_barrier */ +#ifdef GL_NV_texture_compression_vtc + CONST_CAST(GLEW_NV_texture_compression_vtc) = glewGetExtension("GL_NV_texture_compression_vtc"); +#endif /* GL_NV_texture_compression_vtc */ +#ifdef GL_NV_texture_env_combine4 + CONST_CAST(GLEW_NV_texture_env_combine4) = glewGetExtension("GL_NV_texture_env_combine4"); +#endif /* GL_NV_texture_env_combine4 */ +#ifdef GL_NV_texture_expand_normal + CONST_CAST(GLEW_NV_texture_expand_normal) = glewGetExtension("GL_NV_texture_expand_normal"); +#endif /* GL_NV_texture_expand_normal */ +#ifdef GL_NV_texture_rectangle + CONST_CAST(GLEW_NV_texture_rectangle) = glewGetExtension("GL_NV_texture_rectangle"); +#endif /* GL_NV_texture_rectangle */ +#ifdef GL_NV_texture_shader + CONST_CAST(GLEW_NV_texture_shader) = glewGetExtension("GL_NV_texture_shader"); +#endif /* GL_NV_texture_shader */ +#ifdef GL_NV_texture_shader2 + CONST_CAST(GLEW_NV_texture_shader2) = glewGetExtension("GL_NV_texture_shader2"); +#endif /* GL_NV_texture_shader2 */ +#ifdef GL_NV_texture_shader3 + CONST_CAST(GLEW_NV_texture_shader3) = glewGetExtension("GL_NV_texture_shader3"); +#endif /* GL_NV_texture_shader3 */ +#ifdef GL_NV_transform_feedback + CONST_CAST(GLEW_NV_transform_feedback) = glewGetExtension("GL_NV_transform_feedback"); + if (glewExperimental || GLEW_NV_transform_feedback) CONST_CAST(GLEW_NV_transform_feedback) = !_glewInit_GL_NV_transform_feedback(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_transform_feedback */ +#ifdef GL_NV_transform_feedback2 + CONST_CAST(GLEW_NV_transform_feedback2) = glewGetExtension("GL_NV_transform_feedback2"); + if (glewExperimental || GLEW_NV_transform_feedback2) CONST_CAST(GLEW_NV_transform_feedback2) = !_glewInit_GL_NV_transform_feedback2(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_transform_feedback2 */ +#ifdef GL_NV_vdpau_interop + CONST_CAST(GLEW_NV_vdpau_interop) = glewGetExtension("GL_NV_vdpau_interop"); + if (glewExperimental || GLEW_NV_vdpau_interop) CONST_CAST(GLEW_NV_vdpau_interop) = !_glewInit_GL_NV_vdpau_interop(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vdpau_interop */ +#ifdef GL_NV_vertex_array_range + CONST_CAST(GLEW_NV_vertex_array_range) = glewGetExtension("GL_NV_vertex_array_range"); + if (glewExperimental || GLEW_NV_vertex_array_range) CONST_CAST(GLEW_NV_vertex_array_range) = !_glewInit_GL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_array_range */ +#ifdef GL_NV_vertex_array_range2 + CONST_CAST(GLEW_NV_vertex_array_range2) = glewGetExtension("GL_NV_vertex_array_range2"); +#endif /* GL_NV_vertex_array_range2 */ +#ifdef GL_NV_vertex_attrib_integer_64bit + CONST_CAST(GLEW_NV_vertex_attrib_integer_64bit) = glewGetExtension("GL_NV_vertex_attrib_integer_64bit"); + if (glewExperimental || GLEW_NV_vertex_attrib_integer_64bit) CONST_CAST(GLEW_NV_vertex_attrib_integer_64bit) = !_glewInit_GL_NV_vertex_attrib_integer_64bit(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_attrib_integer_64bit */ +#ifdef GL_NV_vertex_buffer_unified_memory + CONST_CAST(GLEW_NV_vertex_buffer_unified_memory) = glewGetExtension("GL_NV_vertex_buffer_unified_memory"); + if (glewExperimental || GLEW_NV_vertex_buffer_unified_memory) CONST_CAST(GLEW_NV_vertex_buffer_unified_memory) = !_glewInit_GL_NV_vertex_buffer_unified_memory(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_buffer_unified_memory */ +#ifdef GL_NV_vertex_program + CONST_CAST(GLEW_NV_vertex_program) = glewGetExtension("GL_NV_vertex_program"); + if (glewExperimental || GLEW_NV_vertex_program) CONST_CAST(GLEW_NV_vertex_program) = !_glewInit_GL_NV_vertex_program(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_NV_vertex_program */ +#ifdef GL_NV_vertex_program1_1 + CONST_CAST(GLEW_NV_vertex_program1_1) = glewGetExtension("GL_NV_vertex_program1_1"); +#endif /* GL_NV_vertex_program1_1 */ +#ifdef GL_NV_vertex_program2 + CONST_CAST(GLEW_NV_vertex_program2) = glewGetExtension("GL_NV_vertex_program2"); +#endif /* GL_NV_vertex_program2 */ +#ifdef GL_NV_vertex_program2_option + CONST_CAST(GLEW_NV_vertex_program2_option) = glewGetExtension("GL_NV_vertex_program2_option"); +#endif /* GL_NV_vertex_program2_option */ +#ifdef GL_NV_vertex_program3 + CONST_CAST(GLEW_NV_vertex_program3) = glewGetExtension("GL_NV_vertex_program3"); +#endif /* GL_NV_vertex_program3 */ +#ifdef GL_NV_vertex_program4 + CONST_CAST(GLEW_NV_vertex_program4) = glewGetExtension("GL_NV_gpu_program4"); +#endif /* GL_NV_vertex_program4 */ +#ifdef GL_OES_byte_coordinates + CONST_CAST(GLEW_OES_byte_coordinates) = glewGetExtension("GL_OES_byte_coordinates"); +#endif /* GL_OES_byte_coordinates */ +#ifdef GL_OES_compressed_paletted_texture + CONST_CAST(GLEW_OES_compressed_paletted_texture) = glewGetExtension("GL_OES_compressed_paletted_texture"); +#endif /* GL_OES_compressed_paletted_texture */ +#ifdef GL_OES_read_format + CONST_CAST(GLEW_OES_read_format) = glewGetExtension("GL_OES_read_format"); +#endif /* GL_OES_read_format */ +#ifdef GL_OES_single_precision + CONST_CAST(GLEW_OES_single_precision) = glewGetExtension("GL_OES_single_precision"); + if (glewExperimental || GLEW_OES_single_precision) CONST_CAST(GLEW_OES_single_precision) = !_glewInit_GL_OES_single_precision(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_OES_single_precision */ +#ifdef GL_OML_interlace + CONST_CAST(GLEW_OML_interlace) = glewGetExtension("GL_OML_interlace"); +#endif /* GL_OML_interlace */ +#ifdef GL_OML_resample + CONST_CAST(GLEW_OML_resample) = glewGetExtension("GL_OML_resample"); +#endif /* GL_OML_resample */ +#ifdef GL_OML_subsample + CONST_CAST(GLEW_OML_subsample) = glewGetExtension("GL_OML_subsample"); +#endif /* GL_OML_subsample */ +#ifdef GL_PGI_misc_hints + CONST_CAST(GLEW_PGI_misc_hints) = glewGetExtension("GL_PGI_misc_hints"); +#endif /* GL_PGI_misc_hints */ +#ifdef GL_PGI_vertex_hints + CONST_CAST(GLEW_PGI_vertex_hints) = glewGetExtension("GL_PGI_vertex_hints"); +#endif /* GL_PGI_vertex_hints */ +#ifdef GL_REND_screen_coordinates + CONST_CAST(GLEW_REND_screen_coordinates) = glewGetExtension("GL_REND_screen_coordinates"); +#endif /* GL_REND_screen_coordinates */ +#ifdef GL_S3_s3tc + CONST_CAST(GLEW_S3_s3tc) = glewGetExtension("GL_S3_s3tc"); +#endif /* GL_S3_s3tc */ +#ifdef GL_SGIS_color_range + CONST_CAST(GLEW_SGIS_color_range) = glewGetExtension("GL_SGIS_color_range"); +#endif /* GL_SGIS_color_range */ +#ifdef GL_SGIS_detail_texture + CONST_CAST(GLEW_SGIS_detail_texture) = glewGetExtension("GL_SGIS_detail_texture"); + if (glewExperimental || GLEW_SGIS_detail_texture) CONST_CAST(GLEW_SGIS_detail_texture) = !_glewInit_GL_SGIS_detail_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_detail_texture */ +#ifdef GL_SGIS_fog_function + CONST_CAST(GLEW_SGIS_fog_function) = glewGetExtension("GL_SGIS_fog_function"); + if (glewExperimental || GLEW_SGIS_fog_function) CONST_CAST(GLEW_SGIS_fog_function) = !_glewInit_GL_SGIS_fog_function(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_fog_function */ +#ifdef GL_SGIS_generate_mipmap + CONST_CAST(GLEW_SGIS_generate_mipmap) = glewGetExtension("GL_SGIS_generate_mipmap"); +#endif /* GL_SGIS_generate_mipmap */ +#ifdef GL_SGIS_multisample + CONST_CAST(GLEW_SGIS_multisample) = glewGetExtension("GL_SGIS_multisample"); + if (glewExperimental || GLEW_SGIS_multisample) CONST_CAST(GLEW_SGIS_multisample) = !_glewInit_GL_SGIS_multisample(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_multisample */ +#ifdef GL_SGIS_pixel_texture + CONST_CAST(GLEW_SGIS_pixel_texture) = glewGetExtension("GL_SGIS_pixel_texture"); +#endif /* GL_SGIS_pixel_texture */ +#ifdef GL_SGIS_point_line_texgen + CONST_CAST(GLEW_SGIS_point_line_texgen) = glewGetExtension("GL_SGIS_point_line_texgen"); +#endif /* GL_SGIS_point_line_texgen */ +#ifdef GL_SGIS_sharpen_texture + CONST_CAST(GLEW_SGIS_sharpen_texture) = glewGetExtension("GL_SGIS_sharpen_texture"); + if (glewExperimental || GLEW_SGIS_sharpen_texture) CONST_CAST(GLEW_SGIS_sharpen_texture) = !_glewInit_GL_SGIS_sharpen_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_sharpen_texture */ +#ifdef GL_SGIS_texture4D + CONST_CAST(GLEW_SGIS_texture4D) = glewGetExtension("GL_SGIS_texture4D"); + if (glewExperimental || GLEW_SGIS_texture4D) CONST_CAST(GLEW_SGIS_texture4D) = !_glewInit_GL_SGIS_texture4D(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_texture4D */ +#ifdef GL_SGIS_texture_border_clamp + CONST_CAST(GLEW_SGIS_texture_border_clamp) = glewGetExtension("GL_SGIS_texture_border_clamp"); +#endif /* GL_SGIS_texture_border_clamp */ +#ifdef GL_SGIS_texture_edge_clamp + CONST_CAST(GLEW_SGIS_texture_edge_clamp) = glewGetExtension("GL_SGIS_texture_edge_clamp"); +#endif /* GL_SGIS_texture_edge_clamp */ +#ifdef GL_SGIS_texture_filter4 + CONST_CAST(GLEW_SGIS_texture_filter4) = glewGetExtension("GL_SGIS_texture_filter4"); + if (glewExperimental || GLEW_SGIS_texture_filter4) CONST_CAST(GLEW_SGIS_texture_filter4) = !_glewInit_GL_SGIS_texture_filter4(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIS_texture_filter4 */ +#ifdef GL_SGIS_texture_lod + CONST_CAST(GLEW_SGIS_texture_lod) = glewGetExtension("GL_SGIS_texture_lod"); +#endif /* GL_SGIS_texture_lod */ +#ifdef GL_SGIS_texture_select + CONST_CAST(GLEW_SGIS_texture_select) = glewGetExtension("GL_SGIS_texture_select"); +#endif /* GL_SGIS_texture_select */ +#ifdef GL_SGIX_async + CONST_CAST(GLEW_SGIX_async) = glewGetExtension("GL_SGIX_async"); + if (glewExperimental || GLEW_SGIX_async) CONST_CAST(GLEW_SGIX_async) = !_glewInit_GL_SGIX_async(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_async */ +#ifdef GL_SGIX_async_histogram + CONST_CAST(GLEW_SGIX_async_histogram) = glewGetExtension("GL_SGIX_async_histogram"); +#endif /* GL_SGIX_async_histogram */ +#ifdef GL_SGIX_async_pixel + CONST_CAST(GLEW_SGIX_async_pixel) = glewGetExtension("GL_SGIX_async_pixel"); +#endif /* GL_SGIX_async_pixel */ +#ifdef GL_SGIX_blend_alpha_minmax + CONST_CAST(GLEW_SGIX_blend_alpha_minmax) = glewGetExtension("GL_SGIX_blend_alpha_minmax"); +#endif /* GL_SGIX_blend_alpha_minmax */ +#ifdef GL_SGIX_clipmap + CONST_CAST(GLEW_SGIX_clipmap) = glewGetExtension("GL_SGIX_clipmap"); +#endif /* GL_SGIX_clipmap */ +#ifdef GL_SGIX_convolution_accuracy + CONST_CAST(GLEW_SGIX_convolution_accuracy) = glewGetExtension("GL_SGIX_convolution_accuracy"); +#endif /* GL_SGIX_convolution_accuracy */ +#ifdef GL_SGIX_depth_texture + CONST_CAST(GLEW_SGIX_depth_texture) = glewGetExtension("GL_SGIX_depth_texture"); +#endif /* GL_SGIX_depth_texture */ +#ifdef GL_SGIX_flush_raster + CONST_CAST(GLEW_SGIX_flush_raster) = glewGetExtension("GL_SGIX_flush_raster"); + if (glewExperimental || GLEW_SGIX_flush_raster) CONST_CAST(GLEW_SGIX_flush_raster) = !_glewInit_GL_SGIX_flush_raster(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_flush_raster */ +#ifdef GL_SGIX_fog_offset + CONST_CAST(GLEW_SGIX_fog_offset) = glewGetExtension("GL_SGIX_fog_offset"); +#endif /* GL_SGIX_fog_offset */ +#ifdef GL_SGIX_fog_texture + CONST_CAST(GLEW_SGIX_fog_texture) = glewGetExtension("GL_SGIX_fog_texture"); + if (glewExperimental || GLEW_SGIX_fog_texture) CONST_CAST(GLEW_SGIX_fog_texture) = !_glewInit_GL_SGIX_fog_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_fog_texture */ +#ifdef GL_SGIX_fragment_specular_lighting + CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = glewGetExtension("GL_SGIX_fragment_specular_lighting"); + if (glewExperimental || GLEW_SGIX_fragment_specular_lighting) CONST_CAST(GLEW_SGIX_fragment_specular_lighting) = !_glewInit_GL_SGIX_fragment_specular_lighting(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_fragment_specular_lighting */ +#ifdef GL_SGIX_framezoom + CONST_CAST(GLEW_SGIX_framezoom) = glewGetExtension("GL_SGIX_framezoom"); + if (glewExperimental || GLEW_SGIX_framezoom) CONST_CAST(GLEW_SGIX_framezoom) = !_glewInit_GL_SGIX_framezoom(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_framezoom */ +#ifdef GL_SGIX_interlace + CONST_CAST(GLEW_SGIX_interlace) = glewGetExtension("GL_SGIX_interlace"); +#endif /* GL_SGIX_interlace */ +#ifdef GL_SGIX_ir_instrument1 + CONST_CAST(GLEW_SGIX_ir_instrument1) = glewGetExtension("GL_SGIX_ir_instrument1"); +#endif /* GL_SGIX_ir_instrument1 */ +#ifdef GL_SGIX_list_priority + CONST_CAST(GLEW_SGIX_list_priority) = glewGetExtension("GL_SGIX_list_priority"); +#endif /* GL_SGIX_list_priority */ +#ifdef GL_SGIX_pixel_texture + CONST_CAST(GLEW_SGIX_pixel_texture) = glewGetExtension("GL_SGIX_pixel_texture"); + if (glewExperimental || GLEW_SGIX_pixel_texture) CONST_CAST(GLEW_SGIX_pixel_texture) = !_glewInit_GL_SGIX_pixel_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_pixel_texture */ +#ifdef GL_SGIX_pixel_texture_bits + CONST_CAST(GLEW_SGIX_pixel_texture_bits) = glewGetExtension("GL_SGIX_pixel_texture_bits"); +#endif /* GL_SGIX_pixel_texture_bits */ +#ifdef GL_SGIX_reference_plane + CONST_CAST(GLEW_SGIX_reference_plane) = glewGetExtension("GL_SGIX_reference_plane"); + if (glewExperimental || GLEW_SGIX_reference_plane) CONST_CAST(GLEW_SGIX_reference_plane) = !_glewInit_GL_SGIX_reference_plane(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_reference_plane */ +#ifdef GL_SGIX_resample + CONST_CAST(GLEW_SGIX_resample) = glewGetExtension("GL_SGIX_resample"); +#endif /* GL_SGIX_resample */ +#ifdef GL_SGIX_shadow + CONST_CAST(GLEW_SGIX_shadow) = glewGetExtension("GL_SGIX_shadow"); +#endif /* GL_SGIX_shadow */ +#ifdef GL_SGIX_shadow_ambient + CONST_CAST(GLEW_SGIX_shadow_ambient) = glewGetExtension("GL_SGIX_shadow_ambient"); +#endif /* GL_SGIX_shadow_ambient */ +#ifdef GL_SGIX_sprite + CONST_CAST(GLEW_SGIX_sprite) = glewGetExtension("GL_SGIX_sprite"); + if (glewExperimental || GLEW_SGIX_sprite) CONST_CAST(GLEW_SGIX_sprite) = !_glewInit_GL_SGIX_sprite(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_sprite */ +#ifdef GL_SGIX_tag_sample_buffer + CONST_CAST(GLEW_SGIX_tag_sample_buffer) = glewGetExtension("GL_SGIX_tag_sample_buffer"); + if (glewExperimental || GLEW_SGIX_tag_sample_buffer) CONST_CAST(GLEW_SGIX_tag_sample_buffer) = !_glewInit_GL_SGIX_tag_sample_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGIX_tag_sample_buffer */ +#ifdef GL_SGIX_texture_add_env + CONST_CAST(GLEW_SGIX_texture_add_env) = glewGetExtension("GL_SGIX_texture_add_env"); +#endif /* GL_SGIX_texture_add_env */ +#ifdef GL_SGIX_texture_coordinate_clamp + CONST_CAST(GLEW_SGIX_texture_coordinate_clamp) = glewGetExtension("GL_SGIX_texture_coordinate_clamp"); +#endif /* GL_SGIX_texture_coordinate_clamp */ +#ifdef GL_SGIX_texture_lod_bias + CONST_CAST(GLEW_SGIX_texture_lod_bias) = glewGetExtension("GL_SGIX_texture_lod_bias"); +#endif /* GL_SGIX_texture_lod_bias */ +#ifdef GL_SGIX_texture_multi_buffer + CONST_CAST(GLEW_SGIX_texture_multi_buffer) = glewGetExtension("GL_SGIX_texture_multi_buffer"); +#endif /* GL_SGIX_texture_multi_buffer */ +#ifdef GL_SGIX_texture_range + CONST_CAST(GLEW_SGIX_texture_range) = glewGetExtension("GL_SGIX_texture_range"); +#endif /* GL_SGIX_texture_range */ +#ifdef GL_SGIX_texture_scale_bias + CONST_CAST(GLEW_SGIX_texture_scale_bias) = glewGetExtension("GL_SGIX_texture_scale_bias"); +#endif /* GL_SGIX_texture_scale_bias */ +#ifdef GL_SGIX_vertex_preclip + CONST_CAST(GLEW_SGIX_vertex_preclip) = glewGetExtension("GL_SGIX_vertex_preclip"); +#endif /* GL_SGIX_vertex_preclip */ +#ifdef GL_SGIX_vertex_preclip_hint + CONST_CAST(GLEW_SGIX_vertex_preclip_hint) = glewGetExtension("GL_SGIX_vertex_preclip_hint"); +#endif /* GL_SGIX_vertex_preclip_hint */ +#ifdef GL_SGIX_ycrcb + CONST_CAST(GLEW_SGIX_ycrcb) = glewGetExtension("GL_SGIX_ycrcb"); +#endif /* GL_SGIX_ycrcb */ +#ifdef GL_SGI_color_matrix + CONST_CAST(GLEW_SGI_color_matrix) = glewGetExtension("GL_SGI_color_matrix"); +#endif /* GL_SGI_color_matrix */ +#ifdef GL_SGI_color_table + CONST_CAST(GLEW_SGI_color_table) = glewGetExtension("GL_SGI_color_table"); + if (glewExperimental || GLEW_SGI_color_table) CONST_CAST(GLEW_SGI_color_table) = !_glewInit_GL_SGI_color_table(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SGI_color_table */ +#ifdef GL_SGI_texture_color_table + CONST_CAST(GLEW_SGI_texture_color_table) = glewGetExtension("GL_SGI_texture_color_table"); +#endif /* GL_SGI_texture_color_table */ +#ifdef GL_SUNX_constant_data + CONST_CAST(GLEW_SUNX_constant_data) = glewGetExtension("GL_SUNX_constant_data"); + if (glewExperimental || GLEW_SUNX_constant_data) CONST_CAST(GLEW_SUNX_constant_data) = !_glewInit_GL_SUNX_constant_data(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUNX_constant_data */ +#ifdef GL_SUN_convolution_border_modes + CONST_CAST(GLEW_SUN_convolution_border_modes) = glewGetExtension("GL_SUN_convolution_border_modes"); +#endif /* GL_SUN_convolution_border_modes */ +#ifdef GL_SUN_global_alpha + CONST_CAST(GLEW_SUN_global_alpha) = glewGetExtension("GL_SUN_global_alpha"); + if (glewExperimental || GLEW_SUN_global_alpha) CONST_CAST(GLEW_SUN_global_alpha) = !_glewInit_GL_SUN_global_alpha(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_global_alpha */ +#ifdef GL_SUN_mesh_array + CONST_CAST(GLEW_SUN_mesh_array) = glewGetExtension("GL_SUN_mesh_array"); +#endif /* GL_SUN_mesh_array */ +#ifdef GL_SUN_read_video_pixels + CONST_CAST(GLEW_SUN_read_video_pixels) = glewGetExtension("GL_SUN_read_video_pixels"); + if (glewExperimental || GLEW_SUN_read_video_pixels) CONST_CAST(GLEW_SUN_read_video_pixels) = !_glewInit_GL_SUN_read_video_pixels(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_read_video_pixels */ +#ifdef GL_SUN_slice_accum + CONST_CAST(GLEW_SUN_slice_accum) = glewGetExtension("GL_SUN_slice_accum"); +#endif /* GL_SUN_slice_accum */ +#ifdef GL_SUN_triangle_list + CONST_CAST(GLEW_SUN_triangle_list) = glewGetExtension("GL_SUN_triangle_list"); + if (glewExperimental || GLEW_SUN_triangle_list) CONST_CAST(GLEW_SUN_triangle_list) = !_glewInit_GL_SUN_triangle_list(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_triangle_list */ +#ifdef GL_SUN_vertex + CONST_CAST(GLEW_SUN_vertex) = glewGetExtension("GL_SUN_vertex"); + if (glewExperimental || GLEW_SUN_vertex) CONST_CAST(GLEW_SUN_vertex) = !_glewInit_GL_SUN_vertex(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_SUN_vertex */ +#ifdef GL_WIN_phong_shading + CONST_CAST(GLEW_WIN_phong_shading) = glewGetExtension("GL_WIN_phong_shading"); +#endif /* GL_WIN_phong_shading */ +#ifdef GL_WIN_specular_fog + CONST_CAST(GLEW_WIN_specular_fog) = glewGetExtension("GL_WIN_specular_fog"); +#endif /* GL_WIN_specular_fog */ +#ifdef GL_WIN_swap_hint + CONST_CAST(GLEW_WIN_swap_hint) = glewGetExtension("GL_WIN_swap_hint"); + if (glewExperimental || GLEW_WIN_swap_hint) CONST_CAST(GLEW_WIN_swap_hint) = !_glewInit_GL_WIN_swap_hint(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GL_WIN_swap_hint */ + + return GLEW_OK; +} + + +#if defined(_WIN32) + +#if !defined(GLEW_MX) + +PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL = NULL; + +PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD = NULL; +PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD = NULL; +PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD = NULL; +PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD = NULL; +PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD = NULL; +PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD = NULL; +PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD = NULL; +PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD = NULL; +PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD = NULL; + +PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB = NULL; +PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB = NULL; +PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB = NULL; +PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB = NULL; + +PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB = NULL; + +PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB = NULL; + +PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB = NULL; +PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB = NULL; + +PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB = NULL; +PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB = NULL; +PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB = NULL; +PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB = NULL; +PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB = NULL; + +PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB = NULL; +PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB = NULL; +PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB = NULL; + +PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB = NULL; +PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB = NULL; +PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB = NULL; + +PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT = NULL; +PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT = NULL; +PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT = NULL; +PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT = NULL; + +PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT = NULL; + +PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT = NULL; +PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT = NULL; + +PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT = NULL; +PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT = NULL; +PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT = NULL; +PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT = NULL; +PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT = NULL; + +PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT = NULL; +PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT = NULL; +PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT = NULL; + +PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT = NULL; +PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT = NULL; + +PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D = NULL; +PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D = NULL; + +PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D = NULL; +PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D = NULL; +PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D = NULL; +PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D = NULL; + +PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D = NULL; +PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D = NULL; +PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D = NULL; +PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D = NULL; +PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D = NULL; +PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D = NULL; +PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D = NULL; +PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D = NULL; +PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D = NULL; +PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D = NULL; +PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D = NULL; +PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D = NULL; + +PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D = NULL; +PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D = NULL; +PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D = NULL; +PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D = NULL; + +PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D = NULL; +PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D = NULL; +PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D = NULL; +PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D = NULL; + +PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D = NULL; +PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D = NULL; +PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D = NULL; +PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D = NULL; + +PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV = NULL; + +PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV = NULL; +PFNWGLDELETEDCNVPROC __wglewDeleteDCNV = NULL; +PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV = NULL; +PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV = NULL; +PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV = NULL; + +PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV = NULL; +PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV = NULL; +PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV = NULL; + +PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV = NULL; +PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV = NULL; +PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV = NULL; +PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV = NULL; +PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV = NULL; +PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV = NULL; + +PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV = NULL; +PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV = NULL; + +PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV = NULL; +PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV = NULL; +PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV = NULL; +PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV = NULL; +PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV = NULL; +PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV = NULL; + +PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML = NULL; +PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML = NULL; +PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML = NULL; +PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML = NULL; +PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML = NULL; +PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML = NULL; +GLboolean __WGLEW_3DFX_multisample = GL_FALSE; +GLboolean __WGLEW_3DL_stereo_control = GL_FALSE; +GLboolean __WGLEW_AMD_gpu_association = GL_FALSE; +GLboolean __WGLEW_ARB_buffer_region = GL_FALSE; +GLboolean __WGLEW_ARB_create_context = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_profile = GL_FALSE; +GLboolean __WGLEW_ARB_create_context_robustness = GL_FALSE; +GLboolean __WGLEW_ARB_extensions_string = GL_FALSE; +GLboolean __WGLEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __WGLEW_ARB_make_current_read = GL_FALSE; +GLboolean __WGLEW_ARB_multisample = GL_FALSE; +GLboolean __WGLEW_ARB_pbuffer = GL_FALSE; +GLboolean __WGLEW_ARB_pixel_format = GL_FALSE; +GLboolean __WGLEW_ARB_pixel_format_float = GL_FALSE; +GLboolean __WGLEW_ARB_render_texture = GL_FALSE; +GLboolean __WGLEW_ATI_pixel_format_float = GL_FALSE; +GLboolean __WGLEW_ATI_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_EXT_create_context_es2_profile = GL_FALSE; +GLboolean __WGLEW_EXT_depth_float = GL_FALSE; +GLboolean __WGLEW_EXT_display_color_table = GL_FALSE; +GLboolean __WGLEW_EXT_extensions_string = GL_FALSE; +GLboolean __WGLEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __WGLEW_EXT_make_current_read = GL_FALSE; +GLboolean __WGLEW_EXT_multisample = GL_FALSE; +GLboolean __WGLEW_EXT_pbuffer = GL_FALSE; +GLboolean __WGLEW_EXT_pixel_format = GL_FALSE; +GLboolean __WGLEW_EXT_pixel_format_packed_float = GL_FALSE; +GLboolean __WGLEW_EXT_swap_control = GL_FALSE; +GLboolean __WGLEW_I3D_digital_video_control = GL_FALSE; +GLboolean __WGLEW_I3D_gamma = GL_FALSE; +GLboolean __WGLEW_I3D_genlock = GL_FALSE; +GLboolean __WGLEW_I3D_image_buffer = GL_FALSE; +GLboolean __WGLEW_I3D_swap_frame_lock = GL_FALSE; +GLboolean __WGLEW_I3D_swap_frame_usage = GL_FALSE; +GLboolean __WGLEW_NV_copy_image = GL_FALSE; +GLboolean __WGLEW_NV_float_buffer = GL_FALSE; +GLboolean __WGLEW_NV_gpu_affinity = GL_FALSE; +GLboolean __WGLEW_NV_multisample_coverage = GL_FALSE; +GLboolean __WGLEW_NV_present_video = GL_FALSE; +GLboolean __WGLEW_NV_render_depth_texture = GL_FALSE; +GLboolean __WGLEW_NV_render_texture_rectangle = GL_FALSE; +GLboolean __WGLEW_NV_swap_group = GL_FALSE; +GLboolean __WGLEW_NV_vertex_array_range = GL_FALSE; +GLboolean __WGLEW_NV_video_output = GL_FALSE; +GLboolean __WGLEW_OML_sync_control = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef WGL_3DFX_multisample + +#endif /* WGL_3DFX_multisample */ + +#ifdef WGL_3DL_stereo_control + +static GLboolean _glewInit_WGL_3DL_stereo_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglSetStereoEmitterState3DL = (PFNWGLSETSTEREOEMITTERSTATE3DLPROC)glewGetProcAddress((const GLubyte*)"wglSetStereoEmitterState3DL")) == NULL) || r; + + return r; +} + +#endif /* WGL_3DL_stereo_control */ + +#ifdef WGL_AMD_gpu_association + +static GLboolean _glewInit_WGL_AMD_gpu_association (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBlitContextFramebufferAMD = (PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC)glewGetProcAddress((const GLubyte*)"wglBlitContextFramebufferAMD")) == NULL) || r; + r = ((wglCreateAssociatedContextAMD = (PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAMD")) == NULL) || r; + r = ((wglCreateAssociatedContextAttribsAMD = (PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC)glewGetProcAddress((const GLubyte*)"wglCreateAssociatedContextAttribsAMD")) == NULL) || r; + r = ((wglDeleteAssociatedContextAMD = (PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglDeleteAssociatedContextAMD")) == NULL) || r; + r = ((wglGetContextGPUIDAMD = (PFNWGLGETCONTEXTGPUIDAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetContextGPUIDAMD")) == NULL) || r; + r = ((wglGetCurrentAssociatedContextAMD = (PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentAssociatedContextAMD")) == NULL) || r; + r = ((wglGetGPUIDsAMD = (PFNWGLGETGPUIDSAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUIDsAMD")) == NULL) || r; + r = ((wglGetGPUInfoAMD = (PFNWGLGETGPUINFOAMDPROC)glewGetProcAddress((const GLubyte*)"wglGetGPUInfoAMD")) == NULL) || r; + r = ((wglMakeAssociatedContextCurrentAMD = (PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC)glewGetProcAddress((const GLubyte*)"wglMakeAssociatedContextCurrentAMD")) == NULL) || r; + + return r; +} + +#endif /* WGL_AMD_gpu_association */ + +#ifdef WGL_ARB_buffer_region + +static GLboolean _glewInit_WGL_ARB_buffer_region (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateBufferRegionARB = (PFNWGLCREATEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateBufferRegionARB")) == NULL) || r; + r = ((wglDeleteBufferRegionARB = (PFNWGLDELETEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglDeleteBufferRegionARB")) == NULL) || r; + r = ((wglRestoreBufferRegionARB = (PFNWGLRESTOREBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglRestoreBufferRegionARB")) == NULL) || r; + r = ((wglSaveBufferRegionARB = (PFNWGLSAVEBUFFERREGIONARBPROC)glewGetProcAddress((const GLubyte*)"wglSaveBufferRegionARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_buffer_region */ + +#ifdef WGL_ARB_create_context + +static GLboolean _glewInit_WGL_ARB_create_context (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateContextAttribsARB = (PFNWGLCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"wglCreateContextAttribsARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_create_context */ + +#ifdef WGL_ARB_create_context_profile + +#endif /* WGL_ARB_create_context_profile */ + +#ifdef WGL_ARB_create_context_robustness + +#endif /* WGL_ARB_create_context_robustness */ + +#ifdef WGL_ARB_extensions_string + +static GLboolean _glewInit_WGL_ARB_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_extensions_string */ + +#ifdef WGL_ARB_framebuffer_sRGB + +#endif /* WGL_ARB_framebuffer_sRGB */ + +#ifdef WGL_ARB_make_current_read + +static GLboolean _glewInit_WGL_ARB_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetCurrentReadDCARB = (PFNWGLGETCURRENTREADDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCARB")) == NULL) || r; + r = ((wglMakeContextCurrentARB = (PFNWGLMAKECONTEXTCURRENTARBPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_make_current_read */ + +#ifdef WGL_ARB_multisample + +#endif /* WGL_ARB_multisample */ + +#ifdef WGL_ARB_pbuffer + +static GLboolean _glewInit_WGL_ARB_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreatePbufferARB = (PFNWGLCREATEPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferARB")) == NULL) || r; + r = ((wglDestroyPbufferARB = (PFNWGLDESTROYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferARB")) == NULL) || r; + r = ((wglGetPbufferDCARB = (PFNWGLGETPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCARB")) == NULL) || r; + r = ((wglQueryPbufferARB = (PFNWGLQUERYPBUFFERARBPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferARB")) == NULL) || r; + r = ((wglReleasePbufferDCARB = (PFNWGLRELEASEPBUFFERDCARBPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_pbuffer */ + +#ifdef WGL_ARB_pixel_format + +static GLboolean _glewInit_WGL_ARB_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglChoosePixelFormatARB = (PFNWGLCHOOSEPIXELFORMATARBPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatARB")) == NULL) || r; + r = ((wglGetPixelFormatAttribfvARB = (PFNWGLGETPIXELFORMATATTRIBFVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvARB")) == NULL) || r; + r = ((wglGetPixelFormatAttribivARB = (PFNWGLGETPIXELFORMATATTRIBIVARBPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_pixel_format */ + +#ifdef WGL_ARB_pixel_format_float + +#endif /* WGL_ARB_pixel_format_float */ + +#ifdef WGL_ARB_render_texture + +static GLboolean _glewInit_WGL_ARB_render_texture (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindTexImageARB = (PFNWGLBINDTEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglBindTexImageARB")) == NULL) || r; + r = ((wglReleaseTexImageARB = (PFNWGLRELEASETEXIMAGEARBPROC)glewGetProcAddress((const GLubyte*)"wglReleaseTexImageARB")) == NULL) || r; + r = ((wglSetPbufferAttribARB = (PFNWGLSETPBUFFERATTRIBARBPROC)glewGetProcAddress((const GLubyte*)"wglSetPbufferAttribARB")) == NULL) || r; + + return r; +} + +#endif /* WGL_ARB_render_texture */ + +#ifdef WGL_ATI_pixel_format_float + +#endif /* WGL_ATI_pixel_format_float */ + +#ifdef WGL_ATI_render_texture_rectangle + +#endif /* WGL_ATI_render_texture_rectangle */ + +#ifdef WGL_EXT_create_context_es2_profile + +#endif /* WGL_EXT_create_context_es2_profile */ + +#ifdef WGL_EXT_depth_float + +#endif /* WGL_EXT_depth_float */ + +#ifdef WGL_EXT_display_color_table + +static GLboolean _glewInit_WGL_EXT_display_color_table (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindDisplayColorTableEXT = (PFNWGLBINDDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglBindDisplayColorTableEXT")) == NULL) || r; + r = ((wglCreateDisplayColorTableEXT = (PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglCreateDisplayColorTableEXT")) == NULL) || r; + r = ((wglDestroyDisplayColorTableEXT = (PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyDisplayColorTableEXT")) == NULL) || r; + r = ((wglLoadDisplayColorTableEXT = (PFNWGLLOADDISPLAYCOLORTABLEEXTPROC)glewGetProcAddress((const GLubyte*)"wglLoadDisplayColorTableEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_display_color_table */ + +#ifdef WGL_EXT_extensions_string + +static GLboolean _glewInit_WGL_EXT_extensions_string (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_extensions_string */ + +#ifdef WGL_EXT_framebuffer_sRGB + +#endif /* WGL_EXT_framebuffer_sRGB */ + +#ifdef WGL_EXT_make_current_read + +static GLboolean _glewInit_WGL_EXT_make_current_read (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetCurrentReadDCEXT = (PFNWGLGETCURRENTREADDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetCurrentReadDCEXT")) == NULL) || r; + r = ((wglMakeContextCurrentEXT = (PFNWGLMAKECONTEXTCURRENTEXTPROC)glewGetProcAddress((const GLubyte*)"wglMakeContextCurrentEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_make_current_read */ + +#ifdef WGL_EXT_multisample + +#endif /* WGL_EXT_multisample */ + +#ifdef WGL_EXT_pbuffer + +static GLboolean _glewInit_WGL_EXT_pbuffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreatePbufferEXT = (PFNWGLCREATEPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglCreatePbufferEXT")) == NULL) || r; + r = ((wglDestroyPbufferEXT = (PFNWGLDESTROYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglDestroyPbufferEXT")) == NULL) || r; + r = ((wglGetPbufferDCEXT = (PFNWGLGETPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPbufferDCEXT")) == NULL) || r; + r = ((wglQueryPbufferEXT = (PFNWGLQUERYPBUFFEREXTPROC)glewGetProcAddress((const GLubyte*)"wglQueryPbufferEXT")) == NULL) || r; + r = ((wglReleasePbufferDCEXT = (PFNWGLRELEASEPBUFFERDCEXTPROC)glewGetProcAddress((const GLubyte*)"wglReleasePbufferDCEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_pbuffer */ + +#ifdef WGL_EXT_pixel_format + +static GLboolean _glewInit_WGL_EXT_pixel_format (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglChoosePixelFormatEXT = (PFNWGLCHOOSEPIXELFORMATEXTPROC)glewGetProcAddress((const GLubyte*)"wglChoosePixelFormatEXT")) == NULL) || r; + r = ((wglGetPixelFormatAttribfvEXT = (PFNWGLGETPIXELFORMATATTRIBFVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribfvEXT")) == NULL) || r; + r = ((wglGetPixelFormatAttribivEXT = (PFNWGLGETPIXELFORMATATTRIBIVEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetPixelFormatAttribivEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_pixel_format */ + +#ifdef WGL_EXT_pixel_format_packed_float + +#endif /* WGL_EXT_pixel_format_packed_float */ + +#ifdef WGL_EXT_swap_control + +static GLboolean _glewInit_WGL_EXT_swap_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetSwapIntervalEXT = (PFNWGLGETSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetSwapIntervalEXT")) == NULL) || r; + r = ((wglSwapIntervalEXT = (PFNWGLSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"wglSwapIntervalEXT")) == NULL) || r; + + return r; +} + +#endif /* WGL_EXT_swap_control */ + +#ifdef WGL_I3D_digital_video_control + +static GLboolean _glewInit_WGL_I3D_digital_video_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetDigitalVideoParametersI3D = (PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetDigitalVideoParametersI3D")) == NULL) || r; + r = ((wglSetDigitalVideoParametersI3D = (PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetDigitalVideoParametersI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_digital_video_control */ + +#ifdef WGL_I3D_gamma + +static GLboolean _glewInit_WGL_I3D_gamma (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetGammaTableI3D = (PFNWGLGETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableI3D")) == NULL) || r; + r = ((wglGetGammaTableParametersI3D = (PFNWGLGETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGammaTableParametersI3D")) == NULL) || r; + r = ((wglSetGammaTableI3D = (PFNWGLSETGAMMATABLEI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableI3D")) == NULL) || r; + r = ((wglSetGammaTableParametersI3D = (PFNWGLSETGAMMATABLEPARAMETERSI3DPROC)glewGetProcAddress((const GLubyte*)"wglSetGammaTableParametersI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_gamma */ + +#ifdef WGL_I3D_genlock + +static GLboolean _glewInit_WGL_I3D_genlock (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDisableGenlockI3D = (PFNWGLDISABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableGenlockI3D")) == NULL) || r; + r = ((wglEnableGenlockI3D = (PFNWGLENABLEGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableGenlockI3D")) == NULL) || r; + r = ((wglGenlockSampleRateI3D = (PFNWGLGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSampleRateI3D")) == NULL) || r; + r = ((wglGenlockSourceDelayI3D = (PFNWGLGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceDelayI3D")) == NULL) || r; + r = ((wglGenlockSourceEdgeI3D = (PFNWGLGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceEdgeI3D")) == NULL) || r; + r = ((wglGenlockSourceI3D = (PFNWGLGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGenlockSourceI3D")) == NULL) || r; + r = ((wglGetGenlockSampleRateI3D = (PFNWGLGETGENLOCKSAMPLERATEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSampleRateI3D")) == NULL) || r; + r = ((wglGetGenlockSourceDelayI3D = (PFNWGLGETGENLOCKSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceDelayI3D")) == NULL) || r; + r = ((wglGetGenlockSourceEdgeI3D = (PFNWGLGETGENLOCKSOURCEEDGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceEdgeI3D")) == NULL) || r; + r = ((wglGetGenlockSourceI3D = (PFNWGLGETGENLOCKSOURCEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetGenlockSourceI3D")) == NULL) || r; + r = ((wglIsEnabledGenlockI3D = (PFNWGLISENABLEDGENLOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledGenlockI3D")) == NULL) || r; + r = ((wglQueryGenlockMaxSourceDelayI3D = (PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryGenlockMaxSourceDelayI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_genlock */ + +#ifdef WGL_I3D_image_buffer + +static GLboolean _glewInit_WGL_I3D_image_buffer (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglAssociateImageBufferEventsI3D = (PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglAssociateImageBufferEventsI3D")) == NULL) || r; + r = ((wglCreateImageBufferI3D = (PFNWGLCREATEIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglCreateImageBufferI3D")) == NULL) || r; + r = ((wglDestroyImageBufferI3D = (PFNWGLDESTROYIMAGEBUFFERI3DPROC)glewGetProcAddress((const GLubyte*)"wglDestroyImageBufferI3D")) == NULL) || r; + r = ((wglReleaseImageBufferEventsI3D = (PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC)glewGetProcAddress((const GLubyte*)"wglReleaseImageBufferEventsI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_image_buffer */ + +#ifdef WGL_I3D_swap_frame_lock + +static GLboolean _glewInit_WGL_I3D_swap_frame_lock (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglDisableFrameLockI3D = (PFNWGLDISABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglDisableFrameLockI3D")) == NULL) || r; + r = ((wglEnableFrameLockI3D = (PFNWGLENABLEFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglEnableFrameLockI3D")) == NULL) || r; + r = ((wglIsEnabledFrameLockI3D = (PFNWGLISENABLEDFRAMELOCKI3DPROC)glewGetProcAddress((const GLubyte*)"wglIsEnabledFrameLockI3D")) == NULL) || r; + r = ((wglQueryFrameLockMasterI3D = (PFNWGLQUERYFRAMELOCKMASTERI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameLockMasterI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_swap_frame_lock */ + +#ifdef WGL_I3D_swap_frame_usage + +static GLboolean _glewInit_WGL_I3D_swap_frame_usage (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBeginFrameTrackingI3D = (PFNWGLBEGINFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglBeginFrameTrackingI3D")) == NULL) || r; + r = ((wglEndFrameTrackingI3D = (PFNWGLENDFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglEndFrameTrackingI3D")) == NULL) || r; + r = ((wglGetFrameUsageI3D = (PFNWGLGETFRAMEUSAGEI3DPROC)glewGetProcAddress((const GLubyte*)"wglGetFrameUsageI3D")) == NULL) || r; + r = ((wglQueryFrameTrackingI3D = (PFNWGLQUERYFRAMETRACKINGI3DPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameTrackingI3D")) == NULL) || r; + + return r; +} + +#endif /* WGL_I3D_swap_frame_usage */ + +#ifdef WGL_NV_copy_image + +static GLboolean _glewInit_WGL_NV_copy_image (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCopyImageSubDataNV = (PFNWGLCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"wglCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_copy_image */ + +#ifdef WGL_NV_float_buffer + +#endif /* WGL_NV_float_buffer */ + +#ifdef WGL_NV_gpu_affinity + +static GLboolean _glewInit_WGL_NV_gpu_affinity (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglCreateAffinityDCNV = (PFNWGLCREATEAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglCreateAffinityDCNV")) == NULL) || r; + r = ((wglDeleteDCNV = (PFNWGLDELETEDCNVPROC)glewGetProcAddress((const GLubyte*)"wglDeleteDCNV")) == NULL) || r; + r = ((wglEnumGpuDevicesNV = (PFNWGLENUMGPUDEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpuDevicesNV")) == NULL) || r; + r = ((wglEnumGpusFromAffinityDCNV = (PFNWGLENUMGPUSFROMAFFINITYDCNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusFromAffinityDCNV")) == NULL) || r; + r = ((wglEnumGpusNV = (PFNWGLENUMGPUSNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumGpusNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_gpu_affinity */ + +#ifdef WGL_NV_multisample_coverage + +#endif /* WGL_NV_multisample_coverage */ + +#ifdef WGL_NV_present_video + +static GLboolean _glewInit_WGL_NV_present_video (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoDeviceNV = (PFNWGLBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoDeviceNV")) == NULL) || r; + r = ((wglEnumerateVideoDevicesNV = (PFNWGLENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"wglEnumerateVideoDevicesNV")) == NULL) || r; + r = ((wglQueryCurrentContextNV = (PFNWGLQUERYCURRENTCONTEXTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryCurrentContextNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_present_video */ + +#ifdef WGL_NV_render_depth_texture + +#endif /* WGL_NV_render_depth_texture */ + +#ifdef WGL_NV_render_texture_rectangle + +#endif /* WGL_NV_render_texture_rectangle */ + +#ifdef WGL_NV_swap_group + +static GLboolean _glewInit_WGL_NV_swap_group (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindSwapBarrierNV = (PFNWGLBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"wglBindSwapBarrierNV")) == NULL) || r; + r = ((wglJoinSwapGroupNV = (PFNWGLJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglJoinSwapGroupNV")) == NULL) || r; + r = ((wglQueryFrameCountNV = (PFNWGLQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryFrameCountNV")) == NULL) || r; + r = ((wglQueryMaxSwapGroupsNV = (PFNWGLQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"wglQueryMaxSwapGroupsNV")) == NULL) || r; + r = ((wglQuerySwapGroupNV = (PFNWGLQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"wglQuerySwapGroupNV")) == NULL) || r; + r = ((wglResetFrameCountNV = (PFNWGLRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"wglResetFrameCountNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_swap_group */ + +#ifdef WGL_NV_vertex_array_range + +static GLboolean _glewInit_WGL_NV_vertex_array_range (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglAllocateMemoryNV = (PFNWGLALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglAllocateMemoryNV")) == NULL) || r; + r = ((wglFreeMemoryNV = (PFNWGLFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"wglFreeMemoryNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_vertex_array_range */ + +#ifdef WGL_NV_video_output + +static GLboolean _glewInit_WGL_NV_video_output (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglBindVideoImageNV = (PFNWGLBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglBindVideoImageNV")) == NULL) || r; + r = ((wglGetVideoDeviceNV = (PFNWGLGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoDeviceNV")) == NULL) || r; + r = ((wglGetVideoInfoNV = (PFNWGLGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"wglGetVideoInfoNV")) == NULL) || r; + r = ((wglReleaseVideoDeviceNV = (PFNWGLRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoDeviceNV")) == NULL) || r; + r = ((wglReleaseVideoImageNV = (PFNWGLRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"wglReleaseVideoImageNV")) == NULL) || r; + r = ((wglSendPbufferToVideoNV = (PFNWGLSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"wglSendPbufferToVideoNV")) == NULL) || r; + + return r; +} + +#endif /* WGL_NV_video_output */ + +#ifdef WGL_OML_sync_control + +static GLboolean _glewInit_WGL_OML_sync_control (WGLEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((wglGetMscRateOML = (PFNWGLGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetMscRateOML")) == NULL) || r; + r = ((wglGetSyncValuesOML = (PFNWGLGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"wglGetSyncValuesOML")) == NULL) || r; + r = ((wglSwapBuffersMscOML = (PFNWGLSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapBuffersMscOML")) == NULL) || r; + r = ((wglSwapLayerBuffersMscOML = (PFNWGLSWAPLAYERBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglSwapLayerBuffersMscOML")) == NULL) || r; + r = ((wglWaitForMscOML = (PFNWGLWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForMscOML")) == NULL) || r; + r = ((wglWaitForSbcOML = (PFNWGLWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"wglWaitForSbcOML")) == NULL) || r; + + return r; +} + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +static PFNWGLGETEXTENSIONSSTRINGARBPROC _wglewGetExtensionsStringARB = NULL; +static PFNWGLGETEXTENSIONSSTRINGEXTPROC _wglewGetExtensionsStringEXT = NULL; + +GLboolean wglewGetExtension (const char* name) +{ + GLubyte* p; + GLubyte* end; + GLuint len = _glewStrLen((const GLubyte*)name); + if (_wglewGetExtensionsStringARB == NULL) + if (_wglewGetExtensionsStringEXT == NULL) + return GL_FALSE; + else + p = (GLubyte*)_wglewGetExtensionsStringEXT(); + else + p = (GLubyte*)_wglewGetExtensionsStringARB(wglGetCurrentDC()); + if (0 == p) return GL_FALSE; + end = p + _glewStrLen(p); + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} + +GLenum wglewContextInit (WGLEW_CONTEXT_ARG_DEF_LIST) +{ + GLboolean crippled; + /* find wgl extension string query functions */ + _wglewGetExtensionsStringARB = (PFNWGLGETEXTENSIONSSTRINGARBPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringARB"); + _wglewGetExtensionsStringEXT = (PFNWGLGETEXTENSIONSSTRINGEXTPROC)glewGetProcAddress((const GLubyte*)"wglGetExtensionsStringEXT"); + /* initialize extensions */ + crippled = _wglewGetExtensionsStringARB == NULL && _wglewGetExtensionsStringEXT == NULL; +#ifdef WGL_3DFX_multisample + CONST_CAST(WGLEW_3DFX_multisample) = wglewGetExtension("WGL_3DFX_multisample"); +#endif /* WGL_3DFX_multisample */ +#ifdef WGL_3DL_stereo_control + CONST_CAST(WGLEW_3DL_stereo_control) = wglewGetExtension("WGL_3DL_stereo_control"); + if (glewExperimental || WGLEW_3DL_stereo_control|| crippled) CONST_CAST(WGLEW_3DL_stereo_control)= !_glewInit_WGL_3DL_stereo_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_3DL_stereo_control */ +#ifdef WGL_AMD_gpu_association + CONST_CAST(WGLEW_AMD_gpu_association) = wglewGetExtension("WGL_AMD_gpu_association"); + if (glewExperimental || WGLEW_AMD_gpu_association|| crippled) CONST_CAST(WGLEW_AMD_gpu_association)= !_glewInit_WGL_AMD_gpu_association(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_AMD_gpu_association */ +#ifdef WGL_ARB_buffer_region + CONST_CAST(WGLEW_ARB_buffer_region) = wglewGetExtension("WGL_ARB_buffer_region"); + if (glewExperimental || WGLEW_ARB_buffer_region|| crippled) CONST_CAST(WGLEW_ARB_buffer_region)= !_glewInit_WGL_ARB_buffer_region(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_buffer_region */ +#ifdef WGL_ARB_create_context + CONST_CAST(WGLEW_ARB_create_context) = wglewGetExtension("WGL_ARB_create_context"); + if (glewExperimental || WGLEW_ARB_create_context|| crippled) CONST_CAST(WGLEW_ARB_create_context)= !_glewInit_WGL_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_create_context */ +#ifdef WGL_ARB_create_context_profile + CONST_CAST(WGLEW_ARB_create_context_profile) = wglewGetExtension("WGL_ARB_create_context_profile"); +#endif /* WGL_ARB_create_context_profile */ +#ifdef WGL_ARB_create_context_robustness + CONST_CAST(WGLEW_ARB_create_context_robustness) = wglewGetExtension("WGL_ARB_create_context_robustness"); +#endif /* WGL_ARB_create_context_robustness */ +#ifdef WGL_ARB_extensions_string + CONST_CAST(WGLEW_ARB_extensions_string) = wglewGetExtension("WGL_ARB_extensions_string"); + if (glewExperimental || WGLEW_ARB_extensions_string|| crippled) CONST_CAST(WGLEW_ARB_extensions_string)= !_glewInit_WGL_ARB_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_extensions_string */ +#ifdef WGL_ARB_framebuffer_sRGB + CONST_CAST(WGLEW_ARB_framebuffer_sRGB) = wglewGetExtension("WGL_ARB_framebuffer_sRGB"); +#endif /* WGL_ARB_framebuffer_sRGB */ +#ifdef WGL_ARB_make_current_read + CONST_CAST(WGLEW_ARB_make_current_read) = wglewGetExtension("WGL_ARB_make_current_read"); + if (glewExperimental || WGLEW_ARB_make_current_read|| crippled) CONST_CAST(WGLEW_ARB_make_current_read)= !_glewInit_WGL_ARB_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_make_current_read */ +#ifdef WGL_ARB_multisample + CONST_CAST(WGLEW_ARB_multisample) = wglewGetExtension("WGL_ARB_multisample"); +#endif /* WGL_ARB_multisample */ +#ifdef WGL_ARB_pbuffer + CONST_CAST(WGLEW_ARB_pbuffer) = wglewGetExtension("WGL_ARB_pbuffer"); + if (glewExperimental || WGLEW_ARB_pbuffer|| crippled) CONST_CAST(WGLEW_ARB_pbuffer)= !_glewInit_WGL_ARB_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_pbuffer */ +#ifdef WGL_ARB_pixel_format + CONST_CAST(WGLEW_ARB_pixel_format) = wglewGetExtension("WGL_ARB_pixel_format"); + if (glewExperimental || WGLEW_ARB_pixel_format|| crippled) CONST_CAST(WGLEW_ARB_pixel_format)= !_glewInit_WGL_ARB_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_pixel_format */ +#ifdef WGL_ARB_pixel_format_float + CONST_CAST(WGLEW_ARB_pixel_format_float) = wglewGetExtension("WGL_ARB_pixel_format_float"); +#endif /* WGL_ARB_pixel_format_float */ +#ifdef WGL_ARB_render_texture + CONST_CAST(WGLEW_ARB_render_texture) = wglewGetExtension("WGL_ARB_render_texture"); + if (glewExperimental || WGLEW_ARB_render_texture|| crippled) CONST_CAST(WGLEW_ARB_render_texture)= !_glewInit_WGL_ARB_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_ARB_render_texture */ +#ifdef WGL_ATI_pixel_format_float + CONST_CAST(WGLEW_ATI_pixel_format_float) = wglewGetExtension("WGL_ATI_pixel_format_float"); +#endif /* WGL_ATI_pixel_format_float */ +#ifdef WGL_ATI_render_texture_rectangle + CONST_CAST(WGLEW_ATI_render_texture_rectangle) = wglewGetExtension("WGL_ATI_render_texture_rectangle"); +#endif /* WGL_ATI_render_texture_rectangle */ +#ifdef WGL_EXT_create_context_es2_profile + CONST_CAST(WGLEW_EXT_create_context_es2_profile) = wglewGetExtension("WGL_EXT_create_context_es2_profile"); +#endif /* WGL_EXT_create_context_es2_profile */ +#ifdef WGL_EXT_depth_float + CONST_CAST(WGLEW_EXT_depth_float) = wglewGetExtension("WGL_EXT_depth_float"); +#endif /* WGL_EXT_depth_float */ +#ifdef WGL_EXT_display_color_table + CONST_CAST(WGLEW_EXT_display_color_table) = wglewGetExtension("WGL_EXT_display_color_table"); + if (glewExperimental || WGLEW_EXT_display_color_table|| crippled) CONST_CAST(WGLEW_EXT_display_color_table)= !_glewInit_WGL_EXT_display_color_table(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_display_color_table */ +#ifdef WGL_EXT_extensions_string + CONST_CAST(WGLEW_EXT_extensions_string) = wglewGetExtension("WGL_EXT_extensions_string"); + if (glewExperimental || WGLEW_EXT_extensions_string|| crippled) CONST_CAST(WGLEW_EXT_extensions_string)= !_glewInit_WGL_EXT_extensions_string(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_extensions_string */ +#ifdef WGL_EXT_framebuffer_sRGB + CONST_CAST(WGLEW_EXT_framebuffer_sRGB) = wglewGetExtension("WGL_EXT_framebuffer_sRGB"); +#endif /* WGL_EXT_framebuffer_sRGB */ +#ifdef WGL_EXT_make_current_read + CONST_CAST(WGLEW_EXT_make_current_read) = wglewGetExtension("WGL_EXT_make_current_read"); + if (glewExperimental || WGLEW_EXT_make_current_read|| crippled) CONST_CAST(WGLEW_EXT_make_current_read)= !_glewInit_WGL_EXT_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_make_current_read */ +#ifdef WGL_EXT_multisample + CONST_CAST(WGLEW_EXT_multisample) = wglewGetExtension("WGL_EXT_multisample"); +#endif /* WGL_EXT_multisample */ +#ifdef WGL_EXT_pbuffer + CONST_CAST(WGLEW_EXT_pbuffer) = wglewGetExtension("WGL_EXT_pbuffer"); + if (glewExperimental || WGLEW_EXT_pbuffer|| crippled) CONST_CAST(WGLEW_EXT_pbuffer)= !_glewInit_WGL_EXT_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_pbuffer */ +#ifdef WGL_EXT_pixel_format + CONST_CAST(WGLEW_EXT_pixel_format) = wglewGetExtension("WGL_EXT_pixel_format"); + if (glewExperimental || WGLEW_EXT_pixel_format|| crippled) CONST_CAST(WGLEW_EXT_pixel_format)= !_glewInit_WGL_EXT_pixel_format(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_pixel_format */ +#ifdef WGL_EXT_pixel_format_packed_float + CONST_CAST(WGLEW_EXT_pixel_format_packed_float) = wglewGetExtension("WGL_EXT_pixel_format_packed_float"); +#endif /* WGL_EXT_pixel_format_packed_float */ +#ifdef WGL_EXT_swap_control + CONST_CAST(WGLEW_EXT_swap_control) = wglewGetExtension("WGL_EXT_swap_control"); + if (glewExperimental || WGLEW_EXT_swap_control|| crippled) CONST_CAST(WGLEW_EXT_swap_control)= !_glewInit_WGL_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_EXT_swap_control */ +#ifdef WGL_I3D_digital_video_control + CONST_CAST(WGLEW_I3D_digital_video_control) = wglewGetExtension("WGL_I3D_digital_video_control"); + if (glewExperimental || WGLEW_I3D_digital_video_control|| crippled) CONST_CAST(WGLEW_I3D_digital_video_control)= !_glewInit_WGL_I3D_digital_video_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_digital_video_control */ +#ifdef WGL_I3D_gamma + CONST_CAST(WGLEW_I3D_gamma) = wglewGetExtension("WGL_I3D_gamma"); + if (glewExperimental || WGLEW_I3D_gamma|| crippled) CONST_CAST(WGLEW_I3D_gamma)= !_glewInit_WGL_I3D_gamma(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_gamma */ +#ifdef WGL_I3D_genlock + CONST_CAST(WGLEW_I3D_genlock) = wglewGetExtension("WGL_I3D_genlock"); + if (glewExperimental || WGLEW_I3D_genlock|| crippled) CONST_CAST(WGLEW_I3D_genlock)= !_glewInit_WGL_I3D_genlock(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_genlock */ +#ifdef WGL_I3D_image_buffer + CONST_CAST(WGLEW_I3D_image_buffer) = wglewGetExtension("WGL_I3D_image_buffer"); + if (glewExperimental || WGLEW_I3D_image_buffer|| crippled) CONST_CAST(WGLEW_I3D_image_buffer)= !_glewInit_WGL_I3D_image_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_image_buffer */ +#ifdef WGL_I3D_swap_frame_lock + CONST_CAST(WGLEW_I3D_swap_frame_lock) = wglewGetExtension("WGL_I3D_swap_frame_lock"); + if (glewExperimental || WGLEW_I3D_swap_frame_lock|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_lock)= !_glewInit_WGL_I3D_swap_frame_lock(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_swap_frame_lock */ +#ifdef WGL_I3D_swap_frame_usage + CONST_CAST(WGLEW_I3D_swap_frame_usage) = wglewGetExtension("WGL_I3D_swap_frame_usage"); + if (glewExperimental || WGLEW_I3D_swap_frame_usage|| crippled) CONST_CAST(WGLEW_I3D_swap_frame_usage)= !_glewInit_WGL_I3D_swap_frame_usage(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_I3D_swap_frame_usage */ +#ifdef WGL_NV_copy_image + CONST_CAST(WGLEW_NV_copy_image) = wglewGetExtension("WGL_NV_copy_image"); + if (glewExperimental || WGLEW_NV_copy_image|| crippled) CONST_CAST(WGLEW_NV_copy_image)= !_glewInit_WGL_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_copy_image */ +#ifdef WGL_NV_float_buffer + CONST_CAST(WGLEW_NV_float_buffer) = wglewGetExtension("WGL_NV_float_buffer"); +#endif /* WGL_NV_float_buffer */ +#ifdef WGL_NV_gpu_affinity + CONST_CAST(WGLEW_NV_gpu_affinity) = wglewGetExtension("WGL_NV_gpu_affinity"); + if (glewExperimental || WGLEW_NV_gpu_affinity|| crippled) CONST_CAST(WGLEW_NV_gpu_affinity)= !_glewInit_WGL_NV_gpu_affinity(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_gpu_affinity */ +#ifdef WGL_NV_multisample_coverage + CONST_CAST(WGLEW_NV_multisample_coverage) = wglewGetExtension("WGL_NV_multisample_coverage"); +#endif /* WGL_NV_multisample_coverage */ +#ifdef WGL_NV_present_video + CONST_CAST(WGLEW_NV_present_video) = wglewGetExtension("WGL_NV_present_video"); + if (glewExperimental || WGLEW_NV_present_video|| crippled) CONST_CAST(WGLEW_NV_present_video)= !_glewInit_WGL_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_present_video */ +#ifdef WGL_NV_render_depth_texture + CONST_CAST(WGLEW_NV_render_depth_texture) = wglewGetExtension("WGL_NV_render_depth_texture"); +#endif /* WGL_NV_render_depth_texture */ +#ifdef WGL_NV_render_texture_rectangle + CONST_CAST(WGLEW_NV_render_texture_rectangle) = wglewGetExtension("WGL_NV_render_texture_rectangle"); +#endif /* WGL_NV_render_texture_rectangle */ +#ifdef WGL_NV_swap_group + CONST_CAST(WGLEW_NV_swap_group) = wglewGetExtension("WGL_NV_swap_group"); + if (glewExperimental || WGLEW_NV_swap_group|| crippled) CONST_CAST(WGLEW_NV_swap_group)= !_glewInit_WGL_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_swap_group */ +#ifdef WGL_NV_vertex_array_range + CONST_CAST(WGLEW_NV_vertex_array_range) = wglewGetExtension("WGL_NV_vertex_array_range"); + if (glewExperimental || WGLEW_NV_vertex_array_range|| crippled) CONST_CAST(WGLEW_NV_vertex_array_range)= !_glewInit_WGL_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_vertex_array_range */ +#ifdef WGL_NV_video_output + CONST_CAST(WGLEW_NV_video_output) = wglewGetExtension("WGL_NV_video_output"); + if (glewExperimental || WGLEW_NV_video_output|| crippled) CONST_CAST(WGLEW_NV_video_output)= !_glewInit_WGL_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_NV_video_output */ +#ifdef WGL_OML_sync_control + CONST_CAST(WGLEW_OML_sync_control) = wglewGetExtension("WGL_OML_sync_control"); + if (glewExperimental || WGLEW_OML_sync_control|| crippled) CONST_CAST(WGLEW_OML_sync_control)= !_glewInit_WGL_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* WGL_OML_sync_control */ + + return GLEW_OK; +} + +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + +PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay = NULL; + +PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig = NULL; +PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext = NULL; +PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer = NULL; +PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap = NULL; +PFNGLXCREATEWINDOWPROC __glewXCreateWindow = NULL; +PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer = NULL; +PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap = NULL; +PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow = NULL; +PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable = NULL; +PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib = NULL; +PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs = NULL; +PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent = NULL; +PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig = NULL; +PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent = NULL; +PFNGLXQUERYCONTEXTPROC __glewXQueryContext = NULL; +PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable = NULL; +PFNGLXSELECTEVENTPROC __glewXSelectEvent = NULL; + +PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB = NULL; + +PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI = NULL; +PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI = NULL; +PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI = NULL; + +PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT = NULL; +PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT = NULL; +PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT = NULL; +PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT = NULL; + +PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT = NULL; + +PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT = NULL; +PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT = NULL; + +PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA = NULL; + +PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA = NULL; + +PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA = NULL; + +PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA = NULL; + +PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA = NULL; + +PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV = NULL; + +PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV = NULL; +PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV = NULL; + +PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV = NULL; +PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV = NULL; +PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV = NULL; +PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV = NULL; +PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV = NULL; +PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV = NULL; + +PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV = NULL; +PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV = NULL; + +PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV = NULL; +PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV = NULL; +PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV = NULL; +PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV = NULL; +PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV = NULL; +PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV = NULL; + +#ifdef GLX_OML_sync_control +PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML = NULL; +PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML = NULL; +PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML = NULL; +PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML = NULL; +PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML = NULL; +#endif + +PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX = NULL; +PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX = NULL; +PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX = NULL; +PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX = NULL; +PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX = NULL; +PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX = NULL; + +PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX = NULL; +PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX = NULL; +PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX = NULL; +PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX = NULL; +PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX = NULL; +PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX = NULL; +PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX = NULL; +PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX = NULL; + +PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX = NULL; +PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX = NULL; +PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX = NULL; +PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX = NULL; +PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX = NULL; + +PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX = NULL; +PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX = NULL; + +PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX = NULL; + +PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX = NULL; +PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX = NULL; +PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX = NULL; +PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX = NULL; +PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX = NULL; + +PFNGLXCUSHIONSGIPROC __glewXCushionSGI = NULL; + +PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI = NULL; +PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI = NULL; + +PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI = NULL; + +PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI = NULL; +PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI = NULL; + +PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN = NULL; + +PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN = NULL; +PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN = NULL; + +#if !defined(GLEW_MX) + +GLboolean __GLXEW_VERSION_1_0 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_1 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_2 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_3 = GL_FALSE; +GLboolean __GLXEW_VERSION_1_4 = GL_FALSE; +GLboolean __GLXEW_3DFX_multisample = GL_FALSE; +GLboolean __GLXEW_AMD_gpu_association = GL_FALSE; +GLboolean __GLXEW_ARB_create_context = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_profile = GL_FALSE; +GLboolean __GLXEW_ARB_create_context_robustness = GL_FALSE; +GLboolean __GLXEW_ARB_fbconfig_float = GL_FALSE; +GLboolean __GLXEW_ARB_framebuffer_sRGB = GL_FALSE; +GLboolean __GLXEW_ARB_get_proc_address = GL_FALSE; +GLboolean __GLXEW_ARB_multisample = GL_FALSE; +GLboolean __GLXEW_ARB_vertex_buffer_object = GL_FALSE; +GLboolean __GLXEW_ATI_pixel_format_float = GL_FALSE; +GLboolean __GLXEW_ATI_render_texture = GL_FALSE; +GLboolean __GLXEW_EXT_create_context_es2_profile = GL_FALSE; +GLboolean __GLXEW_EXT_fbconfig_packed_float = GL_FALSE; +GLboolean __GLXEW_EXT_framebuffer_sRGB = GL_FALSE; +GLboolean __GLXEW_EXT_import_context = GL_FALSE; +GLboolean __GLXEW_EXT_scene_marker = GL_FALSE; +GLboolean __GLXEW_EXT_swap_control = GL_FALSE; +GLboolean __GLXEW_EXT_texture_from_pixmap = GL_FALSE; +GLboolean __GLXEW_EXT_visual_info = GL_FALSE; +GLboolean __GLXEW_EXT_visual_rating = GL_FALSE; +GLboolean __GLXEW_INTEL_swap_event = GL_FALSE; +GLboolean __GLXEW_MESA_agp_offset = GL_FALSE; +GLboolean __GLXEW_MESA_copy_sub_buffer = GL_FALSE; +GLboolean __GLXEW_MESA_pixmap_colormap = GL_FALSE; +GLboolean __GLXEW_MESA_release_buffers = GL_FALSE; +GLboolean __GLXEW_MESA_set_3dfx_mode = GL_FALSE; +GLboolean __GLXEW_NV_copy_image = GL_FALSE; +GLboolean __GLXEW_NV_float_buffer = GL_FALSE; +GLboolean __GLXEW_NV_multisample_coverage = GL_FALSE; +GLboolean __GLXEW_NV_present_video = GL_FALSE; +GLboolean __GLXEW_NV_swap_group = GL_FALSE; +GLboolean __GLXEW_NV_vertex_array_range = GL_FALSE; +GLboolean __GLXEW_NV_video_output = GL_FALSE; +GLboolean __GLXEW_OML_swap_method = GL_FALSE; +#ifdef GLX_OML_sync_control +GLboolean __GLXEW_OML_sync_control = GL_FALSE; +#endif +GLboolean __GLXEW_SGIS_blended_overlay = GL_FALSE; +GLboolean __GLXEW_SGIS_color_range = GL_FALSE; +GLboolean __GLXEW_SGIS_multisample = GL_FALSE; +GLboolean __GLXEW_SGIS_shared_multisample = GL_FALSE; +GLboolean __GLXEW_SGIX_fbconfig = GL_FALSE; +GLboolean __GLXEW_SGIX_hyperpipe = GL_FALSE; +GLboolean __GLXEW_SGIX_pbuffer = GL_FALSE; +GLboolean __GLXEW_SGIX_swap_barrier = GL_FALSE; +GLboolean __GLXEW_SGIX_swap_group = GL_FALSE; +GLboolean __GLXEW_SGIX_video_resize = GL_FALSE; +GLboolean __GLXEW_SGIX_visual_select_group = GL_FALSE; +GLboolean __GLXEW_SGI_cushion = GL_FALSE; +GLboolean __GLXEW_SGI_make_current_read = GL_FALSE; +GLboolean __GLXEW_SGI_swap_control = GL_FALSE; +GLboolean __GLXEW_SGI_video_sync = GL_FALSE; +GLboolean __GLXEW_SUN_get_transparent_index = GL_FALSE; +GLboolean __GLXEW_SUN_video_resize = GL_FALSE; + +#endif /* !GLEW_MX */ + +#ifdef GLX_VERSION_1_2 + +static GLboolean _glewInit_GLX_VERSION_1_2 (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetCurrentDisplay = (PFNGLXGETCURRENTDISPLAYPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentDisplay")) == NULL) || r; + + return r; +} + +#endif /* GLX_VERSION_1_2 */ + +#ifdef GLX_VERSION_1_3 + +static GLboolean _glewInit_GLX_VERSION_1_3 (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXChooseFBConfig = (PFNGLXCHOOSEFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfig")) == NULL) || r; + r = ((glXCreateNewContext = (PFNGLXCREATENEWCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXCreateNewContext")) == NULL) || r; + r = ((glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXCreatePbuffer")) == NULL) || r; + r = ((glXCreatePixmap = (PFNGLXCREATEPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXCreatePixmap")) == NULL) || r; + r = ((glXCreateWindow = (PFNGLXCREATEWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXCreateWindow")) == NULL) || r; + r = ((glXDestroyPbuffer = (PFNGLXDESTROYPBUFFERPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPbuffer")) == NULL) || r; + r = ((glXDestroyPixmap = (PFNGLXDESTROYPIXMAPPROC)glewGetProcAddress((const GLubyte*)"glXDestroyPixmap")) == NULL) || r; + r = ((glXDestroyWindow = (PFNGLXDESTROYWINDOWPROC)glewGetProcAddress((const GLubyte*)"glXDestroyWindow")) == NULL) || r; + r = ((glXGetCurrentReadDrawable = (PFNGLXGETCURRENTREADDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawable")) == NULL) || r; + r = ((glXGetFBConfigAttrib = (PFNGLXGETFBCONFIGATTRIBPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttrib")) == NULL) || r; + r = ((glXGetFBConfigs = (PFNGLXGETFBCONFIGSPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigs")) == NULL) || r; + r = ((glXGetSelectedEvent = (PFNGLXGETSELECTEDEVENTPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEvent")) == NULL) || r; + r = ((glXGetVisualFromFBConfig = (PFNGLXGETVISUALFROMFBCONFIGPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfig")) == NULL) || r; + r = ((glXMakeContextCurrent = (PFNGLXMAKECONTEXTCURRENTPROC)glewGetProcAddress((const GLubyte*)"glXMakeContextCurrent")) == NULL) || r; + r = ((glXQueryContext = (PFNGLXQUERYCONTEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContext")) == NULL) || r; + r = ((glXQueryDrawable = (PFNGLXQUERYDRAWABLEPROC)glewGetProcAddress((const GLubyte*)"glXQueryDrawable")) == NULL) || r; + r = ((glXSelectEvent = (PFNGLXSELECTEVENTPROC)glewGetProcAddress((const GLubyte*)"glXSelectEvent")) == NULL) || r; + + return r; +} + +#endif /* GLX_VERSION_1_3 */ + +#ifdef GLX_VERSION_1_4 + +#endif /* GLX_VERSION_1_4 */ + +#ifdef GLX_3DFX_multisample + +#endif /* GLX_3DFX_multisample */ + +#ifdef GLX_AMD_gpu_association + +#endif /* GLX_AMD_gpu_association */ + +#ifdef GLX_ARB_create_context + +static GLboolean _glewInit_GLX_ARB_create_context (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextAttribsARB")) == NULL) || r; + + return r; +} + +#endif /* GLX_ARB_create_context */ + +#ifdef GLX_ARB_create_context_profile + +#endif /* GLX_ARB_create_context_profile */ + +#ifdef GLX_ARB_create_context_robustness + +#endif /* GLX_ARB_create_context_robustness */ + +#ifdef GLX_ARB_fbconfig_float + +#endif /* GLX_ARB_fbconfig_float */ + +#ifdef GLX_ARB_framebuffer_sRGB + +#endif /* GLX_ARB_framebuffer_sRGB */ + +#ifdef GLX_ARB_get_proc_address + +#endif /* GLX_ARB_get_proc_address */ + +#ifdef GLX_ARB_multisample + +#endif /* GLX_ARB_multisample */ + +#ifdef GLX_ARB_vertex_buffer_object + +#endif /* GLX_ARB_vertex_buffer_object */ + +#ifdef GLX_ATI_pixel_format_float + +#endif /* GLX_ATI_pixel_format_float */ + +#ifdef GLX_ATI_render_texture + +static GLboolean _glewInit_GLX_ATI_render_texture (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindTexImageATI = (PFNGLXBINDTEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageATI")) == NULL) || r; + r = ((glXDrawableAttribATI = (PFNGLXDRAWABLEATTRIBATIPROC)glewGetProcAddress((const GLubyte*)"glXDrawableAttribATI")) == NULL) || r; + r = ((glXReleaseTexImageATI = (PFNGLXRELEASETEXIMAGEATIPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageATI")) == NULL) || r; + + return r; +} + +#endif /* GLX_ATI_render_texture */ + +#ifdef GLX_EXT_create_context_es2_profile + +#endif /* GLX_EXT_create_context_es2_profile */ + +#ifdef GLX_EXT_fbconfig_packed_float + +#endif /* GLX_EXT_fbconfig_packed_float */ + +#ifdef GLX_EXT_framebuffer_sRGB + +#endif /* GLX_EXT_framebuffer_sRGB */ + +#ifdef GLX_EXT_import_context + +static GLboolean _glewInit_GLX_EXT_import_context (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXFreeContextEXT = (PFNGLXFREECONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXFreeContextEXT")) == NULL) || r; + r = ((glXGetContextIDEXT = (PFNGLXGETCONTEXTIDEXTPROC)glewGetProcAddress((const GLubyte*)"glXGetContextIDEXT")) == NULL) || r; + r = ((glXImportContextEXT = (PFNGLXIMPORTCONTEXTEXTPROC)glewGetProcAddress((const GLubyte*)"glXImportContextEXT")) == NULL) || r; + r = ((glXQueryContextInfoEXT = (PFNGLXQUERYCONTEXTINFOEXTPROC)glewGetProcAddress((const GLubyte*)"glXQueryContextInfoEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_import_context */ + +#ifdef GLX_EXT_scene_marker + +#endif /* GLX_EXT_scene_marker */ + +#ifdef GLX_EXT_swap_control + +static GLboolean _glewInit_GLX_EXT_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSwapIntervalEXT = (PFNGLXSWAPINTERVALEXTPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_swap_control */ + +#ifdef GLX_EXT_texture_from_pixmap + +static GLboolean _glewInit_GLX_EXT_texture_from_pixmap (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindTexImageEXT = (PFNGLXBINDTEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXBindTexImageEXT")) == NULL) || r; + r = ((glXReleaseTexImageEXT = (PFNGLXRELEASETEXIMAGEEXTPROC)glewGetProcAddress((const GLubyte*)"glXReleaseTexImageEXT")) == NULL) || r; + + return r; +} + +#endif /* GLX_EXT_texture_from_pixmap */ + +#ifdef GLX_EXT_visual_info + +#endif /* GLX_EXT_visual_info */ + +#ifdef GLX_EXT_visual_rating + +#endif /* GLX_EXT_visual_rating */ + +#ifdef GLX_INTEL_swap_event + +#endif /* GLX_INTEL_swap_event */ + +#ifdef GLX_MESA_agp_offset + +static GLboolean _glewInit_GLX_MESA_agp_offset (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetAGPOffsetMESA = (PFNGLXGETAGPOFFSETMESAPROC)glewGetProcAddress((const GLubyte*)"glXGetAGPOffsetMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_agp_offset */ + +#ifdef GLX_MESA_copy_sub_buffer + +static GLboolean _glewInit_GLX_MESA_copy_sub_buffer (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCopySubBufferMESA = (PFNGLXCOPYSUBBUFFERMESAPROC)glewGetProcAddress((const GLubyte*)"glXCopySubBufferMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_copy_sub_buffer */ + +#ifdef GLX_MESA_pixmap_colormap + +static GLboolean _glewInit_GLX_MESA_pixmap_colormap (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateGLXPixmapMESA = (PFNGLXCREATEGLXPIXMAPMESAPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_pixmap_colormap */ + +#ifdef GLX_MESA_release_buffers + +static GLboolean _glewInit_GLX_MESA_release_buffers (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXReleaseBuffersMESA = (PFNGLXRELEASEBUFFERSMESAPROC)glewGetProcAddress((const GLubyte*)"glXReleaseBuffersMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_release_buffers */ + +#ifdef GLX_MESA_set_3dfx_mode + +static GLboolean _glewInit_GLX_MESA_set_3dfx_mode (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSet3DfxModeMESA = (PFNGLXSET3DFXMODEMESAPROC)glewGetProcAddress((const GLubyte*)"glXSet3DfxModeMESA")) == NULL) || r; + + return r; +} + +#endif /* GLX_MESA_set_3dfx_mode */ + +#ifdef GLX_NV_copy_image + +static GLboolean _glewInit_GLX_NV_copy_image (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCopyImageSubDataNV = (PFNGLXCOPYIMAGESUBDATANVPROC)glewGetProcAddress((const GLubyte*)"glXCopyImageSubDataNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_copy_image */ + +#ifdef GLX_NV_float_buffer + +#endif /* GLX_NV_float_buffer */ + +#ifdef GLX_NV_multisample_coverage + +#endif /* GLX_NV_multisample_coverage */ + +#ifdef GLX_NV_present_video + +static GLboolean _glewInit_GLX_NV_present_video (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoDeviceNV = (PFNGLXBINDVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoDeviceNV")) == NULL) || r; + r = ((glXEnumerateVideoDevicesNV = (PFNGLXENUMERATEVIDEODEVICESNVPROC)glewGetProcAddress((const GLubyte*)"glXEnumerateVideoDevicesNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_present_video */ + +#ifdef GLX_NV_swap_group + +static GLboolean _glewInit_GLX_NV_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindSwapBarrierNV = (PFNGLXBINDSWAPBARRIERNVPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierNV")) == NULL) || r; + r = ((glXJoinSwapGroupNV = (PFNGLXJOINSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupNV")) == NULL) || r; + r = ((glXQueryFrameCountNV = (PFNGLXQUERYFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryFrameCountNV")) == NULL) || r; + r = ((glXQueryMaxSwapGroupsNV = (PFNGLXQUERYMAXSWAPGROUPSNVPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapGroupsNV")) == NULL) || r; + r = ((glXQuerySwapGroupNV = (PFNGLXQUERYSWAPGROUPNVPROC)glewGetProcAddress((const GLubyte*)"glXQuerySwapGroupNV")) == NULL) || r; + r = ((glXResetFrameCountNV = (PFNGLXRESETFRAMECOUNTNVPROC)glewGetProcAddress((const GLubyte*)"glXResetFrameCountNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_swap_group */ + +#ifdef GLX_NV_vertex_array_range + +static GLboolean _glewInit_GLX_NV_vertex_array_range (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXAllocateMemoryNV = (PFNGLXALLOCATEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXAllocateMemoryNV")) == NULL) || r; + r = ((glXFreeMemoryNV = (PFNGLXFREEMEMORYNVPROC)glewGetProcAddress((const GLubyte*)"glXFreeMemoryNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_vertex_array_range */ + +#ifdef GLX_NV_video_output + +static GLboolean _glewInit_GLX_NV_video_output (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindVideoImageNV = (PFNGLXBINDVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXBindVideoImageNV")) == NULL) || r; + r = ((glXGetVideoDeviceNV = (PFNGLXGETVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoDeviceNV")) == NULL) || r; + r = ((glXGetVideoInfoNV = (PFNGLXGETVIDEOINFONVPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoInfoNV")) == NULL) || r; + r = ((glXReleaseVideoDeviceNV = (PFNGLXRELEASEVIDEODEVICENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoDeviceNV")) == NULL) || r; + r = ((glXReleaseVideoImageNV = (PFNGLXRELEASEVIDEOIMAGENVPROC)glewGetProcAddress((const GLubyte*)"glXReleaseVideoImageNV")) == NULL) || r; + r = ((glXSendPbufferToVideoNV = (PFNGLXSENDPBUFFERTOVIDEONVPROC)glewGetProcAddress((const GLubyte*)"glXSendPbufferToVideoNV")) == NULL) || r; + + return r; +} + +#endif /* GLX_NV_video_output */ + +#ifdef GLX_OML_swap_method + +#endif /* GLX_OML_swap_method */ + +#if defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +#include + +static GLboolean _glewInit_GLX_OML_sync_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetMscRateOML = (PFNGLXGETMSCRATEOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetMscRateOML")) == NULL) || r; + r = ((glXGetSyncValuesOML = (PFNGLXGETSYNCVALUESOMLPROC)glewGetProcAddress((const GLubyte*)"glXGetSyncValuesOML")) == NULL) || r; + r = ((glXSwapBuffersMscOML = (PFNGLXSWAPBUFFERSMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXSwapBuffersMscOML")) == NULL) || r; + r = ((glXWaitForMscOML = (PFNGLXWAITFORMSCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForMscOML")) == NULL) || r; + r = ((glXWaitForSbcOML = (PFNGLXWAITFORSBCOMLPROC)glewGetProcAddress((const GLubyte*)"glXWaitForSbcOML")) == NULL) || r; + + return r; +} + +#endif /* GLX_OML_sync_control */ + +#ifdef GLX_SGIS_blended_overlay + +#endif /* GLX_SGIS_blended_overlay */ + +#ifdef GLX_SGIS_color_range + +#endif /* GLX_SGIS_color_range */ + +#ifdef GLX_SGIS_multisample + +#endif /* GLX_SGIS_multisample */ + +#ifdef GLX_SGIS_shared_multisample + +#endif /* GLX_SGIS_shared_multisample */ + +#ifdef GLX_SGIX_fbconfig + +static GLboolean _glewInit_GLX_SGIX_fbconfig (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXChooseFBConfigSGIX = (PFNGLXCHOOSEFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChooseFBConfigSGIX")) == NULL) || r; + r = ((glXCreateContextWithConfigSGIX = (PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateContextWithConfigSGIX")) == NULL) || r; + r = ((glXCreateGLXPixmapWithConfigSGIX = (PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPixmapWithConfigSGIX")) == NULL) || r; + r = ((glXGetFBConfigAttribSGIX = (PFNGLXGETFBCONFIGATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigAttribSGIX")) == NULL) || r; + r = ((glXGetFBConfigFromVisualSGIX = (PFNGLXGETFBCONFIGFROMVISUALSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetFBConfigFromVisualSGIX")) == NULL) || r; + r = ((glXGetVisualFromFBConfigSGIX = (PFNGLXGETVISUALFROMFBCONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetVisualFromFBConfigSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_fbconfig */ + +#ifdef GLX_SGIX_hyperpipe + +static GLboolean _glewInit_GLX_SGIX_hyperpipe (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindHyperpipeSGIX = (PFNGLXBINDHYPERPIPESGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindHyperpipeSGIX")) == NULL) || r; + r = ((glXDestroyHyperpipeConfigSGIX = (PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXHyperpipeAttribSGIX = (PFNGLXHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeAttribSGIX")) == NULL) || r; + r = ((glXHyperpipeConfigSGIX = (PFNGLXHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeAttribSGIX = (PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeAttribSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeBestAttribSGIX = (PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeBestAttribSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeConfigSGIX = (PFNGLXQUERYHYPERPIPECONFIGSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeConfigSGIX")) == NULL) || r; + r = ((glXQueryHyperpipeNetworkSGIX = (PFNGLXQUERYHYPERPIPENETWORKSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryHyperpipeNetworkSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_hyperpipe */ + +#ifdef GLX_SGIX_pbuffer + +static GLboolean _glewInit_GLX_SGIX_pbuffer (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCreateGLXPbufferSGIX = (PFNGLXCREATEGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXCreateGLXPbufferSGIX")) == NULL) || r; + r = ((glXDestroyGLXPbufferSGIX = (PFNGLXDESTROYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXDestroyGLXPbufferSGIX")) == NULL) || r; + r = ((glXGetSelectedEventSGIX = (PFNGLXGETSELECTEDEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXGetSelectedEventSGIX")) == NULL) || r; + r = ((glXQueryGLXPbufferSGIX = (PFNGLXQUERYGLXPBUFFERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryGLXPbufferSGIX")) == NULL) || r; + r = ((glXSelectEventSGIX = (PFNGLXSELECTEVENTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXSelectEventSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_pbuffer */ + +#ifdef GLX_SGIX_swap_barrier + +static GLboolean _glewInit_GLX_SGIX_swap_barrier (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindSwapBarrierSGIX = (PFNGLXBINDSWAPBARRIERSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindSwapBarrierSGIX")) == NULL) || r; + r = ((glXQueryMaxSwapBarriersSGIX = (PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryMaxSwapBarriersSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_swap_barrier */ + +#ifdef GLX_SGIX_swap_group + +static GLboolean _glewInit_GLX_SGIX_swap_group (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXJoinSwapGroupSGIX = (PFNGLXJOINSWAPGROUPSGIXPROC)glewGetProcAddress((const GLubyte*)"glXJoinSwapGroupSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_swap_group */ + +#ifdef GLX_SGIX_video_resize + +static GLboolean _glewInit_GLX_SGIX_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXBindChannelToWindowSGIX = (PFNGLXBINDCHANNELTOWINDOWSGIXPROC)glewGetProcAddress((const GLubyte*)"glXBindChannelToWindowSGIX")) == NULL) || r; + r = ((glXChannelRectSGIX = (PFNGLXCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSGIX")) == NULL) || r; + r = ((glXChannelRectSyncSGIX = (PFNGLXCHANNELRECTSYNCSGIXPROC)glewGetProcAddress((const GLubyte*)"glXChannelRectSyncSGIX")) == NULL) || r; + r = ((glXQueryChannelDeltasSGIX = (PFNGLXQUERYCHANNELDELTASSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelDeltasSGIX")) == NULL) || r; + r = ((glXQueryChannelRectSGIX = (PFNGLXQUERYCHANNELRECTSGIXPROC)glewGetProcAddress((const GLubyte*)"glXQueryChannelRectSGIX")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGIX_video_resize */ + +#ifdef GLX_SGIX_visual_select_group + +#endif /* GLX_SGIX_visual_select_group */ + +#ifdef GLX_SGI_cushion + +static GLboolean _glewInit_GLX_SGI_cushion (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXCushionSGI = (PFNGLXCUSHIONSGIPROC)glewGetProcAddress((const GLubyte*)"glXCushionSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_cushion */ + +#ifdef GLX_SGI_make_current_read + +static GLboolean _glewInit_GLX_SGI_make_current_read (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetCurrentReadDrawableSGI = (PFNGLXGETCURRENTREADDRAWABLESGIPROC)glewGetProcAddress((const GLubyte*)"glXGetCurrentReadDrawableSGI")) == NULL) || r; + r = ((glXMakeCurrentReadSGI = (PFNGLXMAKECURRENTREADSGIPROC)glewGetProcAddress((const GLubyte*)"glXMakeCurrentReadSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_make_current_read */ + +#ifdef GLX_SGI_swap_control + +static GLboolean _glewInit_GLX_SGI_swap_control (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXSwapIntervalSGI = (PFNGLXSWAPINTERVALSGIPROC)glewGetProcAddress((const GLubyte*)"glXSwapIntervalSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_swap_control */ + +#ifdef GLX_SGI_video_sync + +static GLboolean _glewInit_GLX_SGI_video_sync (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetVideoSyncSGI = (PFNGLXGETVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoSyncSGI")) == NULL) || r; + r = ((glXWaitVideoSyncSGI = (PFNGLXWAITVIDEOSYNCSGIPROC)glewGetProcAddress((const GLubyte*)"glXWaitVideoSyncSGI")) == NULL) || r; + + return r; +} + +#endif /* GLX_SGI_video_sync */ + +#ifdef GLX_SUN_get_transparent_index + +static GLboolean _glewInit_GLX_SUN_get_transparent_index (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetTransparentIndexSUN = (PFNGLXGETTRANSPARENTINDEXSUNPROC)glewGetProcAddress((const GLubyte*)"glXGetTransparentIndexSUN")) == NULL) || r; + + return r; +} + +#endif /* GLX_SUN_get_transparent_index */ + +#ifdef GLX_SUN_video_resize + +static GLboolean _glewInit_GLX_SUN_video_resize (GLXEW_CONTEXT_ARG_DEF_INIT) +{ + GLboolean r = GL_FALSE; + + r = ((glXGetVideoResizeSUN = (PFNGLXGETVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXGetVideoResizeSUN")) == NULL) || r; + r = ((glXVideoResizeSUN = (PFNGLXVIDEORESIZESUNPROC)glewGetProcAddress((const GLubyte*)"glXVideoResizeSUN")) == NULL) || r; + + return r; +} + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------ */ + +GLboolean glxewGetExtension (const char* name) +{ + GLubyte* p; + GLubyte* end; + GLuint len; + + if (glXGetCurrentDisplay == NULL) return GL_FALSE; + len = _glewStrLen((const GLubyte*)name); + p = (GLubyte*)glXGetClientString(glXGetCurrentDisplay(), GLX_EXTENSIONS); + if (0 == p) return GL_FALSE; + end = p + _glewStrLen(p); + while (p < end) + { + GLuint n = _glewStrCLen(p, ' '); + if (len == n && _glewStrSame((const GLubyte*)name, p, n)) return GL_TRUE; + p += n+1; + } + return GL_FALSE; +} + +GLenum glxewContextInit (GLXEW_CONTEXT_ARG_DEF_LIST) +{ + int major, minor; + /* initialize core GLX 1.2 */ + if (_glewInit_GLX_VERSION_1_2(GLEW_CONTEXT_ARG_VAR_INIT)) return GLEW_ERROR_GLX_VERSION_11_ONLY; + /* initialize flags */ + CONST_CAST(GLXEW_VERSION_1_0) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_1) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_2) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_3) = GL_TRUE; + CONST_CAST(GLXEW_VERSION_1_4) = GL_TRUE; + /* query GLX version */ + glXQueryVersion(glXGetCurrentDisplay(), &major, &minor); + if (major == 1 && minor <= 3) + { + switch (minor) + { + case 3: + CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; + break; + case 2: + CONST_CAST(GLXEW_VERSION_1_4) = GL_FALSE; + CONST_CAST(GLXEW_VERSION_1_3) = GL_FALSE; + break; + default: + return GLEW_ERROR_GLX_VERSION_11_ONLY; + break; + } + } + /* initialize extensions */ +#ifdef GLX_VERSION_1_3 + if (glewExperimental || GLXEW_VERSION_1_3) CONST_CAST(GLXEW_VERSION_1_3) = !_glewInit_GLX_VERSION_1_3(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_VERSION_1_3 */ +#ifdef GLX_3DFX_multisample + CONST_CAST(GLXEW_3DFX_multisample) = glxewGetExtension("GLX_3DFX_multisample"); +#endif /* GLX_3DFX_multisample */ +#ifdef GLX_AMD_gpu_association + CONST_CAST(GLXEW_AMD_gpu_association) = glxewGetExtension("GLX_AMD_gpu_association"); +#endif /* GLX_AMD_gpu_association */ +#ifdef GLX_ARB_create_context + CONST_CAST(GLXEW_ARB_create_context) = glxewGetExtension("GLX_ARB_create_context"); + if (glewExperimental || GLXEW_ARB_create_context) CONST_CAST(GLXEW_ARB_create_context) = !_glewInit_GLX_ARB_create_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_ARB_create_context */ +#ifdef GLX_ARB_create_context_profile + CONST_CAST(GLXEW_ARB_create_context_profile) = glxewGetExtension("GLX_ARB_create_context_profile"); +#endif /* GLX_ARB_create_context_profile */ +#ifdef GLX_ARB_create_context_robustness + CONST_CAST(GLXEW_ARB_create_context_robustness) = glxewGetExtension("GLX_ARB_create_context_robustness"); +#endif /* GLX_ARB_create_context_robustness */ +#ifdef GLX_ARB_fbconfig_float + CONST_CAST(GLXEW_ARB_fbconfig_float) = glxewGetExtension("GLX_ARB_fbconfig_float"); +#endif /* GLX_ARB_fbconfig_float */ +#ifdef GLX_ARB_framebuffer_sRGB + CONST_CAST(GLXEW_ARB_framebuffer_sRGB) = glxewGetExtension("GLX_ARB_framebuffer_sRGB"); +#endif /* GLX_ARB_framebuffer_sRGB */ +#ifdef GLX_ARB_get_proc_address + CONST_CAST(GLXEW_ARB_get_proc_address) = glxewGetExtension("GLX_ARB_get_proc_address"); +#endif /* GLX_ARB_get_proc_address */ +#ifdef GLX_ARB_multisample + CONST_CAST(GLXEW_ARB_multisample) = glxewGetExtension("GLX_ARB_multisample"); +#endif /* GLX_ARB_multisample */ +#ifdef GLX_ARB_vertex_buffer_object + CONST_CAST(GLXEW_ARB_vertex_buffer_object) = glxewGetExtension("GLX_ARB_vertex_buffer_object"); +#endif /* GLX_ARB_vertex_buffer_object */ +#ifdef GLX_ATI_pixel_format_float + CONST_CAST(GLXEW_ATI_pixel_format_float) = glxewGetExtension("GLX_ATI_pixel_format_float"); +#endif /* GLX_ATI_pixel_format_float */ +#ifdef GLX_ATI_render_texture + CONST_CAST(GLXEW_ATI_render_texture) = glxewGetExtension("GLX_ATI_render_texture"); + if (glewExperimental || GLXEW_ATI_render_texture) CONST_CAST(GLXEW_ATI_render_texture) = !_glewInit_GLX_ATI_render_texture(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_ATI_render_texture */ +#ifdef GLX_EXT_create_context_es2_profile + CONST_CAST(GLXEW_EXT_create_context_es2_profile) = glxewGetExtension("GLX_EXT_create_context_es2_profile"); +#endif /* GLX_EXT_create_context_es2_profile */ +#ifdef GLX_EXT_fbconfig_packed_float + CONST_CAST(GLXEW_EXT_fbconfig_packed_float) = glxewGetExtension("GLX_EXT_fbconfig_packed_float"); +#endif /* GLX_EXT_fbconfig_packed_float */ +#ifdef GLX_EXT_framebuffer_sRGB + CONST_CAST(GLXEW_EXT_framebuffer_sRGB) = glxewGetExtension("GLX_EXT_framebuffer_sRGB"); +#endif /* GLX_EXT_framebuffer_sRGB */ +#ifdef GLX_EXT_import_context + CONST_CAST(GLXEW_EXT_import_context) = glxewGetExtension("GLX_EXT_import_context"); + if (glewExperimental || GLXEW_EXT_import_context) CONST_CAST(GLXEW_EXT_import_context) = !_glewInit_GLX_EXT_import_context(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_import_context */ +#ifdef GLX_EXT_scene_marker + CONST_CAST(GLXEW_EXT_scene_marker) = glxewGetExtension("GLX_EXT_scene_marker"); +#endif /* GLX_EXT_scene_marker */ +#ifdef GLX_EXT_swap_control + CONST_CAST(GLXEW_EXT_swap_control) = glxewGetExtension("GLX_EXT_swap_control"); + if (glewExperimental || GLXEW_EXT_swap_control) CONST_CAST(GLXEW_EXT_swap_control) = !_glewInit_GLX_EXT_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_swap_control */ +#ifdef GLX_EXT_texture_from_pixmap + CONST_CAST(GLXEW_EXT_texture_from_pixmap) = glxewGetExtension("GLX_EXT_texture_from_pixmap"); + if (glewExperimental || GLXEW_EXT_texture_from_pixmap) CONST_CAST(GLXEW_EXT_texture_from_pixmap) = !_glewInit_GLX_EXT_texture_from_pixmap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_EXT_texture_from_pixmap */ +#ifdef GLX_EXT_visual_info + CONST_CAST(GLXEW_EXT_visual_info) = glxewGetExtension("GLX_EXT_visual_info"); +#endif /* GLX_EXT_visual_info */ +#ifdef GLX_EXT_visual_rating + CONST_CAST(GLXEW_EXT_visual_rating) = glxewGetExtension("GLX_EXT_visual_rating"); +#endif /* GLX_EXT_visual_rating */ +#ifdef GLX_INTEL_swap_event + CONST_CAST(GLXEW_INTEL_swap_event) = glxewGetExtension("GLX_INTEL_swap_event"); +#endif /* GLX_INTEL_swap_event */ +#ifdef GLX_MESA_agp_offset + CONST_CAST(GLXEW_MESA_agp_offset) = glxewGetExtension("GLX_MESA_agp_offset"); + if (glewExperimental || GLXEW_MESA_agp_offset) CONST_CAST(GLXEW_MESA_agp_offset) = !_glewInit_GLX_MESA_agp_offset(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_agp_offset */ +#ifdef GLX_MESA_copy_sub_buffer + CONST_CAST(GLXEW_MESA_copy_sub_buffer) = glxewGetExtension("GLX_MESA_copy_sub_buffer"); + if (glewExperimental || GLXEW_MESA_copy_sub_buffer) CONST_CAST(GLXEW_MESA_copy_sub_buffer) = !_glewInit_GLX_MESA_copy_sub_buffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_copy_sub_buffer */ +#ifdef GLX_MESA_pixmap_colormap + CONST_CAST(GLXEW_MESA_pixmap_colormap) = glxewGetExtension("GLX_MESA_pixmap_colormap"); + if (glewExperimental || GLXEW_MESA_pixmap_colormap) CONST_CAST(GLXEW_MESA_pixmap_colormap) = !_glewInit_GLX_MESA_pixmap_colormap(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_pixmap_colormap */ +#ifdef GLX_MESA_release_buffers + CONST_CAST(GLXEW_MESA_release_buffers) = glxewGetExtension("GLX_MESA_release_buffers"); + if (glewExperimental || GLXEW_MESA_release_buffers) CONST_CAST(GLXEW_MESA_release_buffers) = !_glewInit_GLX_MESA_release_buffers(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_release_buffers */ +#ifdef GLX_MESA_set_3dfx_mode + CONST_CAST(GLXEW_MESA_set_3dfx_mode) = glxewGetExtension("GLX_MESA_set_3dfx_mode"); + if (glewExperimental || GLXEW_MESA_set_3dfx_mode) CONST_CAST(GLXEW_MESA_set_3dfx_mode) = !_glewInit_GLX_MESA_set_3dfx_mode(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_MESA_set_3dfx_mode */ +#ifdef GLX_NV_copy_image + CONST_CAST(GLXEW_NV_copy_image) = glxewGetExtension("GLX_NV_copy_image"); + if (glewExperimental || GLXEW_NV_copy_image) CONST_CAST(GLXEW_NV_copy_image) = !_glewInit_GLX_NV_copy_image(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_copy_image */ +#ifdef GLX_NV_float_buffer + CONST_CAST(GLXEW_NV_float_buffer) = glxewGetExtension("GLX_NV_float_buffer"); +#endif /* GLX_NV_float_buffer */ +#ifdef GLX_NV_multisample_coverage + CONST_CAST(GLXEW_NV_multisample_coverage) = glxewGetExtension("GLX_NV_multisample_coverage"); +#endif /* GLX_NV_multisample_coverage */ +#ifdef GLX_NV_present_video + CONST_CAST(GLXEW_NV_present_video) = glxewGetExtension("GLX_NV_present_video"); + if (glewExperimental || GLXEW_NV_present_video) CONST_CAST(GLXEW_NV_present_video) = !_glewInit_GLX_NV_present_video(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_present_video */ +#ifdef GLX_NV_swap_group + CONST_CAST(GLXEW_NV_swap_group) = glxewGetExtension("GLX_NV_swap_group"); + if (glewExperimental || GLXEW_NV_swap_group) CONST_CAST(GLXEW_NV_swap_group) = !_glewInit_GLX_NV_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_swap_group */ +#ifdef GLX_NV_vertex_array_range + CONST_CAST(GLXEW_NV_vertex_array_range) = glxewGetExtension("GLX_NV_vertex_array_range"); + if (glewExperimental || GLXEW_NV_vertex_array_range) CONST_CAST(GLXEW_NV_vertex_array_range) = !_glewInit_GLX_NV_vertex_array_range(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_vertex_array_range */ +#ifdef GLX_NV_video_output + CONST_CAST(GLXEW_NV_video_output) = glxewGetExtension("GLX_NV_video_output"); + if (glewExperimental || GLXEW_NV_video_output) CONST_CAST(GLXEW_NV_video_output) = !_glewInit_GLX_NV_video_output(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_NV_video_output */ +#ifdef GLX_OML_swap_method + CONST_CAST(GLXEW_OML_swap_method) = glxewGetExtension("GLX_OML_swap_method"); +#endif /* GLX_OML_swap_method */ +#if defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +#include + CONST_CAST(GLXEW_OML_sync_control) = glxewGetExtension("GLX_OML_sync_control"); + if (glewExperimental || GLXEW_OML_sync_control) CONST_CAST(GLXEW_OML_sync_control) = !_glewInit_GLX_OML_sync_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_OML_sync_control */ +#ifdef GLX_SGIS_blended_overlay + CONST_CAST(GLXEW_SGIS_blended_overlay) = glxewGetExtension("GLX_SGIS_blended_overlay"); +#endif /* GLX_SGIS_blended_overlay */ +#ifdef GLX_SGIS_color_range + CONST_CAST(GLXEW_SGIS_color_range) = glxewGetExtension("GLX_SGIS_color_range"); +#endif /* GLX_SGIS_color_range */ +#ifdef GLX_SGIS_multisample + CONST_CAST(GLXEW_SGIS_multisample) = glxewGetExtension("GLX_SGIS_multisample"); +#endif /* GLX_SGIS_multisample */ +#ifdef GLX_SGIS_shared_multisample + CONST_CAST(GLXEW_SGIS_shared_multisample) = glxewGetExtension("GLX_SGIS_shared_multisample"); +#endif /* GLX_SGIS_shared_multisample */ +#ifdef GLX_SGIX_fbconfig + CONST_CAST(GLXEW_SGIX_fbconfig) = glxewGetExtension("GLX_SGIX_fbconfig"); + if (glewExperimental || GLXEW_SGIX_fbconfig) CONST_CAST(GLXEW_SGIX_fbconfig) = !_glewInit_GLX_SGIX_fbconfig(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_fbconfig */ +#ifdef GLX_SGIX_hyperpipe + CONST_CAST(GLXEW_SGIX_hyperpipe) = glxewGetExtension("GLX_SGIX_hyperpipe"); + if (glewExperimental || GLXEW_SGIX_hyperpipe) CONST_CAST(GLXEW_SGIX_hyperpipe) = !_glewInit_GLX_SGIX_hyperpipe(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_hyperpipe */ +#ifdef GLX_SGIX_pbuffer + CONST_CAST(GLXEW_SGIX_pbuffer) = glxewGetExtension("GLX_SGIX_pbuffer"); + if (glewExperimental || GLXEW_SGIX_pbuffer) CONST_CAST(GLXEW_SGIX_pbuffer) = !_glewInit_GLX_SGIX_pbuffer(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_pbuffer */ +#ifdef GLX_SGIX_swap_barrier + CONST_CAST(GLXEW_SGIX_swap_barrier) = glxewGetExtension("GLX_SGIX_swap_barrier"); + if (glewExperimental || GLXEW_SGIX_swap_barrier) CONST_CAST(GLXEW_SGIX_swap_barrier) = !_glewInit_GLX_SGIX_swap_barrier(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_swap_barrier */ +#ifdef GLX_SGIX_swap_group + CONST_CAST(GLXEW_SGIX_swap_group) = glxewGetExtension("GLX_SGIX_swap_group"); + if (glewExperimental || GLXEW_SGIX_swap_group) CONST_CAST(GLXEW_SGIX_swap_group) = !_glewInit_GLX_SGIX_swap_group(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_swap_group */ +#ifdef GLX_SGIX_video_resize + CONST_CAST(GLXEW_SGIX_video_resize) = glxewGetExtension("GLX_SGIX_video_resize"); + if (glewExperimental || GLXEW_SGIX_video_resize) CONST_CAST(GLXEW_SGIX_video_resize) = !_glewInit_GLX_SGIX_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGIX_video_resize */ +#ifdef GLX_SGIX_visual_select_group + CONST_CAST(GLXEW_SGIX_visual_select_group) = glxewGetExtension("GLX_SGIX_visual_select_group"); +#endif /* GLX_SGIX_visual_select_group */ +#ifdef GLX_SGI_cushion + CONST_CAST(GLXEW_SGI_cushion) = glxewGetExtension("GLX_SGI_cushion"); + if (glewExperimental || GLXEW_SGI_cushion) CONST_CAST(GLXEW_SGI_cushion) = !_glewInit_GLX_SGI_cushion(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_cushion */ +#ifdef GLX_SGI_make_current_read + CONST_CAST(GLXEW_SGI_make_current_read) = glxewGetExtension("GLX_SGI_make_current_read"); + if (glewExperimental || GLXEW_SGI_make_current_read) CONST_CAST(GLXEW_SGI_make_current_read) = !_glewInit_GLX_SGI_make_current_read(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_make_current_read */ +#ifdef GLX_SGI_swap_control + CONST_CAST(GLXEW_SGI_swap_control) = glxewGetExtension("GLX_SGI_swap_control"); + if (glewExperimental || GLXEW_SGI_swap_control) CONST_CAST(GLXEW_SGI_swap_control) = !_glewInit_GLX_SGI_swap_control(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_swap_control */ +#ifdef GLX_SGI_video_sync + CONST_CAST(GLXEW_SGI_video_sync) = glxewGetExtension("GLX_SGI_video_sync"); + if (glewExperimental || GLXEW_SGI_video_sync) CONST_CAST(GLXEW_SGI_video_sync) = !_glewInit_GLX_SGI_video_sync(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SGI_video_sync */ +#ifdef GLX_SUN_get_transparent_index + CONST_CAST(GLXEW_SUN_get_transparent_index) = glxewGetExtension("GLX_SUN_get_transparent_index"); + if (glewExperimental || GLXEW_SUN_get_transparent_index) CONST_CAST(GLXEW_SUN_get_transparent_index) = !_glewInit_GLX_SUN_get_transparent_index(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SUN_get_transparent_index */ +#ifdef GLX_SUN_video_resize + CONST_CAST(GLXEW_SUN_video_resize) = glxewGetExtension("GLX_SUN_video_resize"); + if (glewExperimental || GLXEW_SUN_video_resize) CONST_CAST(GLXEW_SUN_video_resize) = !_glewInit_GLX_SUN_video_resize(GLEW_CONTEXT_ARG_VAR_INIT); +#endif /* GLX_SUN_video_resize */ + + return GLEW_OK; +} + +#endif /* !__APPLE__ || GLEW_APPLE_GLX */ + +/* ------------------------------------------------------------------------ */ + +const GLubyte* glewGetErrorString (GLenum error) +{ + static const GLubyte* _glewErrorString[] = + { + (const GLubyte*)"No error", + (const GLubyte*)"Missing GL version", + (const GLubyte*)"GL 1.1 and up are not supported", + (const GLubyte*)"GLX 1.2 and up are not supported", + (const GLubyte*)"Unknown error" + }; + const int max_error = sizeof(_glewErrorString)/sizeof(*_glewErrorString) - 1; + return _glewErrorString[(int)error > max_error ? max_error : (int)error]; +} + +const GLubyte* glewGetString (GLenum name) +{ + static const GLubyte* _glewString[] = + { + (const GLubyte*)NULL, + (const GLubyte*)"1.5.8", + (const GLubyte*)"1", + (const GLubyte*)"5", + (const GLubyte*)"8" + }; + const int max_string = sizeof(_glewString)/sizeof(*_glewString) - 1; + return _glewString[(int)name > max_string ? 0 : (int)name]; +} + +/* ------------------------------------------------------------------------ */ + +GLboolean glewExperimental = GL_FALSE; + +#if !defined(GLEW_MX) + +#if defined(_WIN32) +extern GLenum wglewContextInit (void); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ +extern GLenum glxewContextInit (void); +#endif /* _WIN32 */ + +GLenum glewInit () +{ + GLenum r; + if ( (r = glewContextInit()) ) return r; +#if defined(_WIN32) + return wglewContextInit(); +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) /* _UNIX */ + return glxewContextInit(); +#else + return r; +#endif /* _WIN32 */ +} + +#endif /* !GLEW_MX */ +#ifdef GLEW_MX +GLboolean glewContextIsSupported (const GLEWContext* ctx, const char* name) +#else +GLboolean glewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"GL_", 3)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef GL_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = GLEW_VERSION_1_2; + continue; + } +#endif +#ifdef GL_VERSION_1_2_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2_1", 5)) + { + ret = GLEW_VERSION_1_2_1; + continue; + } +#endif +#ifdef GL_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = GLEW_VERSION_1_3; + continue; + } +#endif +#ifdef GL_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = GLEW_VERSION_1_4; + continue; + } +#endif +#ifdef GL_VERSION_1_5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_5", 3)) + { + ret = GLEW_VERSION_1_5; + continue; + } +#endif +#ifdef GL_VERSION_2_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_0", 3)) + { + ret = GLEW_VERSION_2_0; + continue; + } +#endif +#ifdef GL_VERSION_2_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"2_1", 3)) + { + ret = GLEW_VERSION_2_1; + continue; + } +#endif +#ifdef GL_VERSION_3_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_0", 3)) + { + ret = GLEW_VERSION_3_0; + continue; + } +#endif +#ifdef GL_VERSION_3_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_1", 3)) + { + ret = GLEW_VERSION_3_1; + continue; + } +#endif +#ifdef GL_VERSION_3_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_2", 3)) + { + ret = GLEW_VERSION_3_2; + continue; + } +#endif +#ifdef GL_VERSION_3_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"3_3", 3)) + { + ret = GLEW_VERSION_3_3; + continue; + } +#endif +#ifdef GL_VERSION_4_0 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_0", 3)) + { + ret = GLEW_VERSION_4_0; + continue; + } +#endif +#ifdef GL_VERSION_4_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"4_1", 3)) + { + ret = GLEW_VERSION_4_1; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef GL_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_3DFX_multisample; + continue; + } +#endif +#ifdef GL_3DFX_tbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tbuffer", 7)) + { + ret = GLEW_3DFX_tbuffer; + continue; + } +#endif +#ifdef GL_3DFX_texture_compression_FXT1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_FXT1", 24)) + { + ret = GLEW_3DFX_texture_compression_FXT1; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef GL_AMD_conservative_depth + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conservative_depth", 18)) + { + ret = GLEW_AMD_conservative_depth; + continue; + } +#endif +#ifdef GL_AMD_debug_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) + { + ret = GLEW_AMD_debug_output; + continue; + } +#endif +#ifdef GL_AMD_depth_clamp_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp_separate", 20)) + { + ret = GLEW_AMD_depth_clamp_separate; + continue; + } +#endif +#ifdef GL_AMD_draw_buffers_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) + { + ret = GLEW_AMD_draw_buffers_blend; + continue; + } +#endif +#ifdef GL_AMD_name_gen_delete + if (_glewStrSame3(&pos, &len, (const GLubyte*)"name_gen_delete", 15)) + { + ret = GLEW_AMD_name_gen_delete; + continue; + } +#endif +#ifdef GL_AMD_performance_monitor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"performance_monitor", 19)) + { + ret = GLEW_AMD_performance_monitor; + continue; + } +#endif +#ifdef GL_AMD_seamless_cubemap_per_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cubemap_per_texture", 28)) + { + ret = GLEW_AMD_seamless_cubemap_per_texture; + continue; + } +#endif +#ifdef GL_AMD_shader_stencil_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) + { + ret = GLEW_AMD_shader_stencil_export; + continue; + } +#endif +#ifdef GL_AMD_texture_texture4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_texture4", 16)) + { + ret = GLEW_AMD_texture_texture4; + continue; + } +#endif +#ifdef GL_AMD_transform_feedback3_lines_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3_lines_triangles", 35)) + { + ret = GLEW_AMD_transform_feedback3_lines_triangles; + continue; + } +#endif +#ifdef GL_AMD_vertex_shader_tessellator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_tessellator", 25)) + { + ret = GLEW_AMD_vertex_shader_tessellator; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"APPLE_", 6)) + { +#ifdef GL_APPLE_aux_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"aux_depth_stencil", 17)) + { + ret = GLEW_APPLE_aux_depth_stencil; + continue; + } +#endif +#ifdef GL_APPLE_client_storage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"client_storage", 14)) + { + ret = GLEW_APPLE_client_storage; + continue; + } +#endif +#ifdef GL_APPLE_element_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) + { + ret = GLEW_APPLE_element_array; + continue; + } +#endif +#ifdef GL_APPLE_fence + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) + { + ret = GLEW_APPLE_fence; + continue; + } +#endif +#ifdef GL_APPLE_float_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_pixels", 12)) + { + ret = GLEW_APPLE_float_pixels; + continue; + } +#endif +#ifdef GL_APPLE_flush_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_buffer_range", 18)) + { + ret = GLEW_APPLE_flush_buffer_range; + continue; + } +#endif +#ifdef GL_APPLE_object_purgeable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"object_purgeable", 16)) + { + ret = GLEW_APPLE_object_purgeable; + continue; + } +#endif +#ifdef GL_APPLE_pixel_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer", 12)) + { + ret = GLEW_APPLE_pixel_buffer; + continue; + } +#endif +#ifdef GL_APPLE_rgb_422 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rgb_422", 7)) + { + ret = GLEW_APPLE_rgb_422; + continue; + } +#endif +#ifdef GL_APPLE_row_bytes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"row_bytes", 9)) + { + ret = GLEW_APPLE_row_bytes; + continue; + } +#endif +#ifdef GL_APPLE_specular_vector + if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_vector", 15)) + { + ret = GLEW_APPLE_specular_vector; + continue; + } +#endif +#ifdef GL_APPLE_texture_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) + { + ret = GLEW_APPLE_texture_range; + continue; + } +#endif +#ifdef GL_APPLE_transform_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_hint", 14)) + { + ret = GLEW_APPLE_transform_hint; + continue; + } +#endif +#ifdef GL_APPLE_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_APPLE_vertex_array_object; + continue; + } +#endif +#ifdef GL_APPLE_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLEW_APPLE_vertex_array_range; + continue; + } +#endif +#ifdef GL_APPLE_vertex_program_evaluators + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program_evaluators", 25)) + { + ret = GLEW_APPLE_vertex_program_evaluators; + continue; + } +#endif +#ifdef GL_APPLE_ycbcr_422 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_422", 9)) + { + ret = GLEW_APPLE_ycbcr_422; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef GL_ARB_ES2_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ES2_compatibility", 17)) + { + ret = GLEW_ARB_ES2_compatibility; + continue; + } +#endif +#ifdef GL_ARB_blend_func_extended + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_extended", 19)) + { + ret = GLEW_ARB_blend_func_extended; + continue; + } +#endif +#ifdef GL_ARB_cl_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cl_event", 8)) + { + ret = GLEW_ARB_cl_event; + continue; + } +#endif +#ifdef GL_ARB_color_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_buffer_float", 18)) + { + ret = GLEW_ARB_color_buffer_float; + continue; + } +#endif +#ifdef GL_ARB_compatibility + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compatibility", 13)) + { + ret = GLEW_ARB_compatibility; + continue; + } +#endif +#ifdef GL_ARB_copy_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_buffer", 11)) + { + ret = GLEW_ARB_copy_buffer; + continue; + } +#endif +#ifdef GL_ARB_debug_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"debug_output", 12)) + { + ret = GLEW_ARB_debug_output; + continue; + } +#endif +#ifdef GL_ARB_depth_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) + { + ret = GLEW_ARB_depth_buffer_float; + continue; + } +#endif +#ifdef GL_ARB_depth_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) + { + ret = GLEW_ARB_depth_clamp; + continue; + } +#endif +#ifdef GL_ARB_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_ARB_depth_texture; + continue; + } +#endif +#ifdef GL_ARB_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_ARB_draw_buffers; + continue; + } +#endif +#ifdef GL_ARB_draw_buffers_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers_blend", 18)) + { + ret = GLEW_ARB_draw_buffers_blend; + continue; + } +#endif +#ifdef GL_ARB_draw_elements_base_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_elements_base_vertex", 25)) + { + ret = GLEW_ARB_draw_elements_base_vertex; + continue; + } +#endif +#ifdef GL_ARB_draw_indirect + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_indirect", 13)) + { + ret = GLEW_ARB_draw_indirect; + continue; + } +#endif +#ifdef GL_ARB_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_ARB_draw_instanced; + continue; + } +#endif +#ifdef GL_ARB_explicit_attrib_location + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_attrib_location", 24)) + { + ret = GLEW_ARB_explicit_attrib_location; + continue; + } +#endif +#ifdef GL_ARB_fragment_coord_conventions + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_coord_conventions", 26)) + { + ret = GLEW_ARB_fragment_coord_conventions; + continue; + } +#endif +#ifdef GL_ARB_fragment_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) + { + ret = GLEW_ARB_fragment_program; + continue; + } +#endif +#ifdef GL_ARB_fragment_program_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_shadow", 23)) + { + ret = GLEW_ARB_fragment_program_shadow; + continue; + } +#endif +#ifdef GL_ARB_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) + { + ret = GLEW_ARB_fragment_shader; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) + { + ret = GLEW_ARB_framebuffer_object; + continue; + } +#endif +#ifdef GL_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef GL_ARB_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_ARB_geometry_shader4; + continue; + } +#endif +#ifdef GL_ARB_get_program_binary + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_program_binary", 18)) + { + ret = GLEW_ARB_get_program_binary; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_ARB_gpu_shader5; + continue; + } +#endif +#ifdef GL_ARB_gpu_shader_fp64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader_fp64", 15)) + { + ret = GLEW_ARB_gpu_shader_fp64; + continue; + } +#endif +#ifdef GL_ARB_half_float_pixel + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_pixel", 16)) + { + ret = GLEW_ARB_half_float_pixel; + continue; + } +#endif +#ifdef GL_ARB_half_float_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float_vertex", 17)) + { + ret = GLEW_ARB_half_float_vertex; + continue; + } +#endif +#ifdef GL_ARB_imaging + if (_glewStrSame3(&pos, &len, (const GLubyte*)"imaging", 7)) + { + ret = GLEW_ARB_imaging; + continue; + } +#endif +#ifdef GL_ARB_instanced_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"instanced_arrays", 16)) + { + ret = GLEW_ARB_instanced_arrays; + continue; + } +#endif +#ifdef GL_ARB_map_buffer_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_buffer_range", 16)) + { + ret = GLEW_ARB_map_buffer_range; + continue; + } +#endif +#ifdef GL_ARB_matrix_palette + if (_glewStrSame3(&pos, &len, (const GLubyte*)"matrix_palette", 14)) + { + ret = GLEW_ARB_matrix_palette; + continue; + } +#endif +#ifdef GL_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_ARB_multisample; + continue; + } +#endif +#ifdef GL_ARB_multitexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multitexture", 12)) + { + ret = GLEW_ARB_multitexture; + continue; + } +#endif +#ifdef GL_ARB_occlusion_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) + { + ret = GLEW_ARB_occlusion_query; + continue; + } +#endif +#ifdef GL_ARB_occlusion_query2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query2", 16)) + { + ret = GLEW_ARB_occlusion_query2; + continue; + } +#endif +#ifdef GL_ARB_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_ARB_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_point_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) + { + ret = GLEW_ARB_point_parameters; + continue; + } +#endif +#ifdef GL_ARB_point_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) + { + ret = GLEW_ARB_point_sprite; + continue; + } +#endif +#ifdef GL_ARB_provoking_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) + { + ret = GLEW_ARB_provoking_vertex; + continue; + } +#endif +#ifdef GL_ARB_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"robustness", 10)) + { + ret = GLEW_ARB_robustness; + continue; + } +#endif +#ifdef GL_ARB_sample_shading + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sample_shading", 14)) + { + ret = GLEW_ARB_sample_shading; + continue; + } +#endif +#ifdef GL_ARB_sampler_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sampler_objects", 15)) + { + ret = GLEW_ARB_sampler_objects; + continue; + } +#endif +#ifdef GL_ARB_seamless_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"seamless_cube_map", 17)) + { + ret = GLEW_ARB_seamless_cube_map; + continue; + } +#endif +#ifdef GL_ARB_separate_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) + { + ret = GLEW_ARB_separate_shader_objects; + continue; + } +#endif +#ifdef GL_ARB_shader_bit_encoding + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_bit_encoding", 19)) + { + ret = GLEW_ARB_shader_bit_encoding; + continue; + } +#endif +#ifdef GL_ARB_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_objects", 14)) + { + ret = GLEW_ARB_shader_objects; + continue; + } +#endif +#ifdef GL_ARB_shader_precision + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_precision", 16)) + { + ret = GLEW_ARB_shader_precision; + continue; + } +#endif +#ifdef GL_ARB_shader_stencil_export + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_stencil_export", 21)) + { + ret = GLEW_ARB_shader_stencil_export; + continue; + } +#endif +#ifdef GL_ARB_shader_subroutine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_subroutine", 17)) + { + ret = GLEW_ARB_shader_subroutine; + continue; + } +#endif +#ifdef GL_ARB_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_ARB_shader_texture_lod; + continue; + } +#endif +#ifdef GL_ARB_shading_language_100 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_100", 20)) + { + ret = GLEW_ARB_shading_language_100; + continue; + } +#endif +#ifdef GL_ARB_shading_language_include + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shading_language_include", 24)) + { + ret = GLEW_ARB_shading_language_include; + continue; + } +#endif +#ifdef GL_ARB_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) + { + ret = GLEW_ARB_shadow; + continue; + } +#endif +#ifdef GL_ARB_shadow_ambient + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) + { + ret = GLEW_ARB_shadow_ambient; + continue; + } +#endif +#ifdef GL_ARB_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync", 4)) + { + ret = GLEW_ARB_sync; + continue; + } +#endif +#ifdef GL_ARB_tessellation_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_shader", 19)) + { + ret = GLEW_ARB_tessellation_shader; + continue; + } +#endif +#ifdef GL_ARB_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_ARB_texture_border_clamp; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) + { + ret = GLEW_ARB_texture_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_texture_buffer_object_rgb32 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object_rgb32", 27)) + { + ret = GLEW_ARB_texture_buffer_object_rgb32; + continue; + } +#endif +#ifdef GL_ARB_texture_compression + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression", 19)) + { + ret = GLEW_ARB_texture_compression; + continue; + } +#endif +#ifdef GL_ARB_texture_compression_bptc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_bptc", 24)) + { + ret = GLEW_ARB_texture_compression_bptc; + continue; + } +#endif +#ifdef GL_ARB_texture_compression_rgtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) + { + ret = GLEW_ARB_texture_compression_rgtc; + continue; + } +#endif +#ifdef GL_ARB_texture_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) + { + ret = GLEW_ARB_texture_cube_map; + continue; + } +#endif +#ifdef GL_ARB_texture_cube_map_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map_array", 22)) + { + ret = GLEW_ARB_texture_cube_map_array; + continue; + } +#endif +#ifdef GL_ARB_texture_env_add + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) + { + ret = GLEW_ARB_texture_env_add; + continue; + } +#endif +#ifdef GL_ARB_texture_env_combine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) + { + ret = GLEW_ARB_texture_env_combine; + continue; + } +#endif +#ifdef GL_ARB_texture_env_crossbar + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_crossbar", 20)) + { + ret = GLEW_ARB_texture_env_crossbar; + continue; + } +#endif +#ifdef GL_ARB_texture_env_dot3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) + { + ret = GLEW_ARB_texture_env_dot3; + continue; + } +#endif +#ifdef GL_ARB_texture_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) + { + ret = GLEW_ARB_texture_float; + continue; + } +#endif +#ifdef GL_ARB_texture_gather + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_gather", 14)) + { + ret = GLEW_ARB_texture_gather; + continue; + } +#endif +#ifdef GL_ARB_texture_mirrored_repeat + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) + { + ret = GLEW_ARB_texture_mirrored_repeat; + continue; + } +#endif +#ifdef GL_ARB_texture_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multisample", 19)) + { + ret = GLEW_ARB_texture_multisample; + continue; + } +#endif +#ifdef GL_ARB_texture_non_power_of_two + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_non_power_of_two", 24)) + { + ret = GLEW_ARB_texture_non_power_of_two; + continue; + } +#endif +#ifdef GL_ARB_texture_query_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_query_lod", 17)) + { + ret = GLEW_ARB_texture_query_lod; + continue; + } +#endif +#ifdef GL_ARB_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_ARB_texture_rectangle; + continue; + } +#endif +#ifdef GL_ARB_texture_rg + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rg", 10)) + { + ret = GLEW_ARB_texture_rg; + continue; + } +#endif +#ifdef GL_ARB_texture_rgb10_a2ui + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rgb10_a2ui", 18)) + { + ret = GLEW_ARB_texture_rgb10_a2ui; + continue; + } +#endif +#ifdef GL_ARB_texture_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) + { + ret = GLEW_ARB_texture_swizzle; + continue; + } +#endif +#ifdef GL_ARB_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_ARB_timer_query; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) + { + ret = GLEW_ARB_transform_feedback2; + continue; + } +#endif +#ifdef GL_ARB_transform_feedback3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback3", 19)) + { + ret = GLEW_ARB_transform_feedback3; + continue; + } +#endif +#ifdef GL_ARB_transpose_matrix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transpose_matrix", 16)) + { + ret = GLEW_ARB_transpose_matrix; + continue; + } +#endif +#ifdef GL_ARB_uniform_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"uniform_buffer_object", 21)) + { + ret = GLEW_ARB_uniform_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_array_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) + { + ret = GLEW_ARB_vertex_array_bgra; + continue; + } +#endif +#ifdef GL_ARB_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_ARB_vertex_array_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_attrib_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) + { + ret = GLEW_ARB_vertex_attrib_64bit; + continue; + } +#endif +#ifdef GL_ARB_vertex_blend + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_blend", 12)) + { + ret = GLEW_ARB_vertex_blend; + continue; + } +#endif +#ifdef GL_ARB_vertex_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) + { + ret = GLEW_ARB_vertex_buffer_object; + continue; + } +#endif +#ifdef GL_ARB_vertex_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) + { + ret = GLEW_ARB_vertex_program; + continue; + } +#endif +#ifdef GL_ARB_vertex_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) + { + ret = GLEW_ARB_vertex_shader; + continue; + } +#endif +#ifdef GL_ARB_vertex_type_2_10_10_10_rev + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_type_2_10_10_10_rev", 26)) + { + ret = GLEW_ARB_vertex_type_2_10_10_10_rev; + continue; + } +#endif +#ifdef GL_ARB_viewport_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"viewport_array", 14)) + { + ret = GLEW_ARB_viewport_array; + continue; + } +#endif +#ifdef GL_ARB_window_pos + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) + { + ret = GLEW_ARB_window_pos; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATIX_", 5)) + { +#ifdef GL_ATIX_point_sprites + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprites", 13)) + { + ret = GLEW_ATIX_point_sprites; + continue; + } +#endif +#ifdef GL_ATIX_texture_env_combine3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) + { + ret = GLEW_ATIX_texture_env_combine3; + continue; + } +#endif +#ifdef GL_ATIX_texture_env_route + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_route", 17)) + { + ret = GLEW_ATIX_texture_env_route; + continue; + } +#endif +#ifdef GL_ATIX_vertex_shader_output_point_size + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader_output_point_size", 31)) + { + ret = GLEW_ATIX_vertex_shader_output_point_size; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef GL_ATI_draw_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers", 12)) + { + ret = GLEW_ATI_draw_buffers; + continue; + } +#endif +#ifdef GL_ATI_element_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"element_array", 13)) + { + ret = GLEW_ATI_element_array; + continue; + } +#endif +#ifdef GL_ATI_envmap_bumpmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"envmap_bumpmap", 14)) + { + ret = GLEW_ATI_envmap_bumpmap; + continue; + } +#endif +#ifdef GL_ATI_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_shader", 15)) + { + ret = GLEW_ATI_fragment_shader; + continue; + } +#endif +#ifdef GL_ATI_map_object_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"map_object_buffer", 17)) + { + ret = GLEW_ATI_map_object_buffer; + continue; + } +#endif +#ifdef GL_ATI_meminfo + if (_glewStrSame3(&pos, &len, (const GLubyte*)"meminfo", 7)) + { + ret = GLEW_ATI_meminfo; + continue; + } +#endif +#ifdef GL_ATI_pn_triangles + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pn_triangles", 12)) + { + ret = GLEW_ATI_pn_triangles; + continue; + } +#endif +#ifdef GL_ATI_separate_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_stencil", 16)) + { + ret = GLEW_ATI_separate_stencil; + continue; + } +#endif +#ifdef GL_ATI_shader_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_texture_lod", 18)) + { + ret = GLEW_ATI_shader_texture_lod; + continue; + } +#endif +#ifdef GL_ATI_text_fragment_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"text_fragment_shader", 20)) + { + ret = GLEW_ATI_text_fragment_shader; + continue; + } +#endif +#ifdef GL_ATI_texture_compression_3dc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_3dc", 23)) + { + ret = GLEW_ATI_texture_compression_3dc; + continue; + } +#endif +#ifdef GL_ATI_texture_env_combine3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine3", 20)) + { + ret = GLEW_ATI_texture_env_combine3; + continue; + } +#endif +#ifdef GL_ATI_texture_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_float", 13)) + { + ret = GLEW_ATI_texture_float; + continue; + } +#endif +#ifdef GL_ATI_texture_mirror_once + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_once", 19)) + { + ret = GLEW_ATI_texture_mirror_once; + continue; + } +#endif +#ifdef GL_ATI_vertex_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_object", 19)) + { + ret = GLEW_ATI_vertex_array_object; + continue; + } +#endif +#ifdef GL_ATI_vertex_attrib_array_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_array_object", 26)) + { + ret = GLEW_ATI_vertex_attrib_array_object; + continue; + } +#endif +#ifdef GL_ATI_vertex_streams + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_streams", 14)) + { + ret = GLEW_ATI_vertex_streams; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef GL_EXT_422_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"422_pixels", 10)) + { + ret = GLEW_EXT_422_pixels; + continue; + } +#endif +#ifdef GL_EXT_Cg_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"Cg_shader", 9)) + { + ret = GLEW_EXT_Cg_shader; + continue; + } +#endif +#ifdef GL_EXT_abgr + if (_glewStrSame3(&pos, &len, (const GLubyte*)"abgr", 4)) + { + ret = GLEW_EXT_abgr; + continue; + } +#endif +#ifdef GL_EXT_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bgra", 4)) + { + ret = GLEW_EXT_bgra; + continue; + } +#endif +#ifdef GL_EXT_bindable_uniform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"bindable_uniform", 16)) + { + ret = GLEW_EXT_bindable_uniform; + continue; + } +#endif +#ifdef GL_EXT_blend_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_color", 11)) + { + ret = GLEW_EXT_blend_color; + continue; + } +#endif +#ifdef GL_EXT_blend_equation_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_equation_separate", 23)) + { + ret = GLEW_EXT_blend_equation_separate; + continue; + } +#endif +#ifdef GL_EXT_blend_func_separate + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_func_separate", 19)) + { + ret = GLEW_EXT_blend_func_separate; + continue; + } +#endif +#ifdef GL_EXT_blend_logic_op + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_logic_op", 14)) + { + ret = GLEW_EXT_blend_logic_op; + continue; + } +#endif +#ifdef GL_EXT_blend_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_minmax", 12)) + { + ret = GLEW_EXT_blend_minmax; + continue; + } +#endif +#ifdef GL_EXT_blend_subtract + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_subtract", 14)) + { + ret = GLEW_EXT_blend_subtract; + continue; + } +#endif +#ifdef GL_EXT_clip_volume_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clip_volume_hint", 16)) + { + ret = GLEW_EXT_clip_volume_hint; + continue; + } +#endif +#ifdef GL_EXT_cmyka + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cmyka", 5)) + { + ret = GLEW_EXT_cmyka; + continue; + } +#endif +#ifdef GL_EXT_color_subtable + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_subtable", 14)) + { + ret = GLEW_EXT_color_subtable; + continue; + } +#endif +#ifdef GL_EXT_compiled_vertex_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compiled_vertex_array", 21)) + { + ret = GLEW_EXT_compiled_vertex_array; + continue; + } +#endif +#ifdef GL_EXT_convolution + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution", 11)) + { + ret = GLEW_EXT_convolution; + continue; + } +#endif +#ifdef GL_EXT_coordinate_frame + if (_glewStrSame3(&pos, &len, (const GLubyte*)"coordinate_frame", 16)) + { + ret = GLEW_EXT_coordinate_frame; + continue; + } +#endif +#ifdef GL_EXT_copy_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_texture", 12)) + { + ret = GLEW_EXT_copy_texture; + continue; + } +#endif +#ifdef GL_EXT_cull_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) + { + ret = GLEW_EXT_cull_vertex; + continue; + } +#endif +#ifdef GL_EXT_depth_bounds_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_bounds_test", 17)) + { + ret = GLEW_EXT_depth_bounds_test; + continue; + } +#endif +#ifdef GL_EXT_direct_state_access + if (_glewStrSame3(&pos, &len, (const GLubyte*)"direct_state_access", 19)) + { + ret = GLEW_EXT_direct_state_access; + continue; + } +#endif +#ifdef GL_EXT_draw_buffers2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_buffers2", 13)) + { + ret = GLEW_EXT_draw_buffers2; + continue; + } +#endif +#ifdef GL_EXT_draw_instanced + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_instanced", 14)) + { + ret = GLEW_EXT_draw_instanced; + continue; + } +#endif +#ifdef GL_EXT_draw_range_elements + if (_glewStrSame3(&pos, &len, (const GLubyte*)"draw_range_elements", 19)) + { + ret = GLEW_EXT_draw_range_elements; + continue; + } +#endif +#ifdef GL_EXT_fog_coord + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_coord", 9)) + { + ret = GLEW_EXT_fog_coord; + continue; + } +#endif +#ifdef GL_EXT_fragment_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_lighting", 17)) + { + ret = GLEW_EXT_fragment_lighting; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_blit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_blit", 16)) + { + ret = GLEW_EXT_framebuffer_blit; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample", 23)) + { + ret = GLEW_EXT_framebuffer_multisample; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_object", 18)) + { + ret = GLEW_EXT_framebuffer_object; + continue; + } +#endif +#ifdef GL_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef GL_EXT_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_EXT_geometry_shader4; + continue; + } +#endif +#ifdef GL_EXT_gpu_program_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_parameters", 22)) + { + ret = GLEW_EXT_gpu_program_parameters; + continue; + } +#endif +#ifdef GL_EXT_gpu_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader4", 11)) + { + ret = GLEW_EXT_gpu_shader4; + continue; + } +#endif +#ifdef GL_EXT_histogram + if (_glewStrSame3(&pos, &len, (const GLubyte*)"histogram", 9)) + { + ret = GLEW_EXT_histogram; + continue; + } +#endif +#ifdef GL_EXT_index_array_formats + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_array_formats", 19)) + { + ret = GLEW_EXT_index_array_formats; + continue; + } +#endif +#ifdef GL_EXT_index_func + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_func", 10)) + { + ret = GLEW_EXT_index_func; + continue; + } +#endif +#ifdef GL_EXT_index_material + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_material", 14)) + { + ret = GLEW_EXT_index_material; + continue; + } +#endif +#ifdef GL_EXT_index_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"index_texture", 13)) + { + ret = GLEW_EXT_index_texture; + continue; + } +#endif +#ifdef GL_EXT_light_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_texture", 13)) + { + ret = GLEW_EXT_light_texture; + continue; + } +#endif +#ifdef GL_EXT_misc_attribute + if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_attribute", 14)) + { + ret = GLEW_EXT_misc_attribute; + continue; + } +#endif +#ifdef GL_EXT_multi_draw_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multi_draw_arrays", 17)) + { + ret = GLEW_EXT_multi_draw_arrays; + continue; + } +#endif +#ifdef GL_EXT_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_EXT_multisample; + continue; + } +#endif +#ifdef GL_EXT_packed_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) + { + ret = GLEW_EXT_packed_depth_stencil; + continue; + } +#endif +#ifdef GL_EXT_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_float", 12)) + { + ret = GLEW_EXT_packed_float; + continue; + } +#endif +#ifdef GL_EXT_packed_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_pixels", 13)) + { + ret = GLEW_EXT_packed_pixels; + continue; + } +#endif +#ifdef GL_EXT_paletted_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"paletted_texture", 16)) + { + ret = GLEW_EXT_paletted_texture; + continue; + } +#endif +#ifdef GL_EXT_pixel_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_buffer_object", 19)) + { + ret = GLEW_EXT_pixel_buffer_object; + continue; + } +#endif +#ifdef GL_EXT_pixel_transform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform", 15)) + { + ret = GLEW_EXT_pixel_transform; + continue; + } +#endif +#ifdef GL_EXT_pixel_transform_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_transform_color_table", 27)) + { + ret = GLEW_EXT_pixel_transform_color_table; + continue; + } +#endif +#ifdef GL_EXT_point_parameters + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_parameters", 16)) + { + ret = GLEW_EXT_point_parameters; + continue; + } +#endif +#ifdef GL_EXT_polygon_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"polygon_offset", 14)) + { + ret = GLEW_EXT_polygon_offset; + continue; + } +#endif +#ifdef GL_EXT_provoking_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"provoking_vertex", 16)) + { + ret = GLEW_EXT_provoking_vertex; + continue; + } +#endif +#ifdef GL_EXT_rescale_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rescale_normal", 14)) + { + ret = GLEW_EXT_rescale_normal; + continue; + } +#endif +#ifdef GL_EXT_scene_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) + { + ret = GLEW_EXT_scene_marker; + continue; + } +#endif +#ifdef GL_EXT_secondary_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"secondary_color", 15)) + { + ret = GLEW_EXT_secondary_color; + continue; + } +#endif +#ifdef GL_EXT_separate_shader_objects + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_shader_objects", 23)) + { + ret = GLEW_EXT_separate_shader_objects; + continue; + } +#endif +#ifdef GL_EXT_separate_specular_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"separate_specular_color", 23)) + { + ret = GLEW_EXT_separate_specular_color; + continue; + } +#endif +#ifdef GL_EXT_shader_image_load_store + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_image_load_store", 23)) + { + ret = GLEW_EXT_shader_image_load_store; + continue; + } +#endif +#ifdef GL_EXT_shadow_funcs + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_funcs", 12)) + { + ret = GLEW_EXT_shadow_funcs; + continue; + } +#endif +#ifdef GL_EXT_shared_texture_palette + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_texture_palette", 22)) + { + ret = GLEW_EXT_shared_texture_palette; + continue; + } +#endif +#ifdef GL_EXT_stencil_clear_tag + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_clear_tag", 17)) + { + ret = GLEW_EXT_stencil_clear_tag; + continue; + } +#endif +#ifdef GL_EXT_stencil_two_side + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_two_side", 16)) + { + ret = GLEW_EXT_stencil_two_side; + continue; + } +#endif +#ifdef GL_EXT_stencil_wrap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stencil_wrap", 12)) + { + ret = GLEW_EXT_stencil_wrap; + continue; + } +#endif +#ifdef GL_EXT_subtexture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subtexture", 10)) + { + ret = GLEW_EXT_subtexture; + continue; + } +#endif +#ifdef GL_EXT_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture", 7)) + { + ret = GLEW_EXT_texture; + continue; + } +#endif +#ifdef GL_EXT_texture3D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture3D", 9)) + { + ret = GLEW_EXT_texture3D; + continue; + } +#endif +#ifdef GL_EXT_texture_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_array", 13)) + { + ret = GLEW_EXT_texture_array; + continue; + } +#endif +#ifdef GL_EXT_texture_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_buffer_object", 21)) + { + ret = GLEW_EXT_texture_buffer_object; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_dxt1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_dxt1", 24)) + { + ret = GLEW_EXT_texture_compression_dxt1; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_latc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_latc", 24)) + { + ret = GLEW_EXT_texture_compression_latc; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_rgtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_rgtc", 24)) + { + ret = GLEW_EXT_texture_compression_rgtc; + continue; + } +#endif +#ifdef GL_EXT_texture_compression_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_s3tc", 24)) + { + ret = GLEW_EXT_texture_compression_s3tc; + continue; + } +#endif +#ifdef GL_EXT_texture_cube_map + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_cube_map", 16)) + { + ret = GLEW_EXT_texture_cube_map; + continue; + } +#endif +#ifdef GL_EXT_texture_edge_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) + { + ret = GLEW_EXT_texture_edge_clamp; + continue; + } +#endif +#ifdef GL_EXT_texture_env + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env", 11)) + { + ret = GLEW_EXT_texture_env; + continue; + } +#endif +#ifdef GL_EXT_texture_env_add + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_add", 15)) + { + ret = GLEW_EXT_texture_env_add; + continue; + } +#endif +#ifdef GL_EXT_texture_env_combine + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine", 19)) + { + ret = GLEW_EXT_texture_env_combine; + continue; + } +#endif +#ifdef GL_EXT_texture_env_dot3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_dot3", 16)) + { + ret = GLEW_EXT_texture_env_dot3; + continue; + } +#endif +#ifdef GL_EXT_texture_filter_anisotropic + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter_anisotropic", 26)) + { + ret = GLEW_EXT_texture_filter_anisotropic; + continue; + } +#endif +#ifdef GL_EXT_texture_integer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_integer", 15)) + { + ret = GLEW_EXT_texture_integer; + continue; + } +#endif +#ifdef GL_EXT_texture_lod_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) + { + ret = GLEW_EXT_texture_lod_bias; + continue; + } +#endif +#ifdef GL_EXT_texture_mirror_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirror_clamp", 20)) + { + ret = GLEW_EXT_texture_mirror_clamp; + continue; + } +#endif +#ifdef GL_EXT_texture_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_object", 14)) + { + ret = GLEW_EXT_texture_object; + continue; + } +#endif +#ifdef GL_EXT_texture_perturb_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_perturb_normal", 22)) + { + ret = GLEW_EXT_texture_perturb_normal; + continue; + } +#endif +#ifdef GL_EXT_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_EXT_texture_rectangle; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB", 12)) + { + ret = GLEW_EXT_texture_sRGB; + continue; + } +#endif +#ifdef GL_EXT_texture_sRGB_decode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_sRGB_decode", 19)) + { + ret = GLEW_EXT_texture_sRGB_decode; + continue; + } +#endif +#ifdef GL_EXT_texture_shared_exponent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shared_exponent", 23)) + { + ret = GLEW_EXT_texture_shared_exponent; + continue; + } +#endif +#ifdef GL_EXT_texture_snorm + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_snorm", 13)) + { + ret = GLEW_EXT_texture_snorm; + continue; + } +#endif +#ifdef GL_EXT_texture_swizzle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_swizzle", 15)) + { + ret = GLEW_EXT_texture_swizzle; + continue; + } +#endif +#ifdef GL_EXT_timer_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"timer_query", 11)) + { + ret = GLEW_EXT_timer_query; + continue; + } +#endif +#ifdef GL_EXT_transform_feedback + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) + { + ret = GLEW_EXT_transform_feedback; + continue; + } +#endif +#ifdef GL_EXT_vertex_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array", 12)) + { + ret = GLEW_EXT_vertex_array; + continue; + } +#endif +#ifdef GL_EXT_vertex_array_bgra + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_bgra", 17)) + { + ret = GLEW_EXT_vertex_array_bgra; + continue; + } +#endif +#ifdef GL_EXT_vertex_attrib_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_64bit", 19)) + { + ret = GLEW_EXT_vertex_attrib_64bit; + continue; + } +#endif +#ifdef GL_EXT_vertex_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_shader", 13)) + { + ret = GLEW_EXT_vertex_shader; + continue; + } +#endif +#ifdef GL_EXT_vertex_weighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_weighting", 16)) + { + ret = GLEW_EXT_vertex_weighting; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"GREMEDY_", 8)) + { +#ifdef GL_GREMEDY_frame_terminator + if (_glewStrSame3(&pos, &len, (const GLubyte*)"frame_terminator", 16)) + { + ret = GLEW_GREMEDY_frame_terminator; + continue; + } +#endif +#ifdef GL_GREMEDY_string_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"string_marker", 13)) + { + ret = GLEW_GREMEDY_string_marker; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"HP_", 3)) + { +#ifdef GL_HP_convolution_border_modes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) + { + ret = GLEW_HP_convolution_border_modes; + continue; + } +#endif +#ifdef GL_HP_image_transform + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_transform", 15)) + { + ret = GLEW_HP_image_transform; + continue; + } +#endif +#ifdef GL_HP_occlusion_test + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_test", 14)) + { + ret = GLEW_HP_occlusion_test; + continue; + } +#endif +#ifdef GL_HP_texture_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lighting", 16)) + { + ret = GLEW_HP_texture_lighting; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"IBM_", 4)) + { +#ifdef GL_IBM_cull_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cull_vertex", 11)) + { + ret = GLEW_IBM_cull_vertex; + continue; + } +#endif +#ifdef GL_IBM_multimode_draw_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multimode_draw_arrays", 21)) + { + ret = GLEW_IBM_multimode_draw_arrays; + continue; + } +#endif +#ifdef GL_IBM_rasterpos_clip + if (_glewStrSame3(&pos, &len, (const GLubyte*)"rasterpos_clip", 14)) + { + ret = GLEW_IBM_rasterpos_clip; + continue; + } +#endif +#ifdef GL_IBM_static_data + if (_glewStrSame3(&pos, &len, (const GLubyte*)"static_data", 11)) + { + ret = GLEW_IBM_static_data; + continue; + } +#endif +#ifdef GL_IBM_texture_mirrored_repeat + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_mirrored_repeat", 23)) + { + ret = GLEW_IBM_texture_mirrored_repeat; + continue; + } +#endif +#ifdef GL_IBM_vertex_array_lists + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_lists", 18)) + { + ret = GLEW_IBM_vertex_array_lists; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INGR_", 5)) + { +#ifdef GL_INGR_color_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_clamp", 11)) + { + ret = GLEW_INGR_color_clamp; + continue; + } +#endif +#ifdef GL_INGR_interlace_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace_read", 14)) + { + ret = GLEW_INGR_interlace_read; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) + { +#ifdef GL_INTEL_parallel_arrays + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parallel_arrays", 15)) + { + ret = GLEW_INTEL_parallel_arrays; + continue; + } +#endif +#ifdef GL_INTEL_texture_scissor + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scissor", 15)) + { + ret = GLEW_INTEL_texture_scissor; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"KTX_", 4)) + { +#ifdef GL_KTX_buffer_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) + { + ret = GLEW_KTX_buffer_region; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESAX_", 6)) + { +#ifdef GL_MESAX_texture_stack + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_stack", 13)) + { + ret = GLEW_MESAX_texture_stack; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef GL_MESA_pack_invert + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pack_invert", 11)) + { + ret = GLEW_MESA_pack_invert; + continue; + } +#endif +#ifdef GL_MESA_resize_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resize_buffers", 14)) + { + ret = GLEW_MESA_resize_buffers; + continue; + } +#endif +#ifdef GL_MESA_window_pos + if (_glewStrSame3(&pos, &len, (const GLubyte*)"window_pos", 10)) + { + ret = GLEW_MESA_window_pos; + continue; + } +#endif +#ifdef GL_MESA_ycbcr_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycbcr_texture", 13)) + { + ret = GLEW_MESA_ycbcr_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NVX_", 4)) + { +#ifdef GL_NVX_gpu_memory_info + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_memory_info", 15)) + { + ret = GLEW_NVX_gpu_memory_info; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef GL_NV_blend_square + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_square", 12)) + { + ret = GLEW_NV_blend_square; + continue; + } +#endif +#ifdef GL_NV_conditional_render + if (_glewStrSame3(&pos, &len, (const GLubyte*)"conditional_render", 18)) + { + ret = GLEW_NV_conditional_render; + continue; + } +#endif +#ifdef GL_NV_copy_depth_to_color + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_depth_to_color", 19)) + { + ret = GLEW_NV_copy_depth_to_color; + continue; + } +#endif +#ifdef GL_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLEW_NV_copy_image; + continue; + } +#endif +#ifdef GL_NV_depth_buffer_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_buffer_float", 18)) + { + ret = GLEW_NV_depth_buffer_float; + continue; + } +#endif +#ifdef GL_NV_depth_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_clamp", 11)) + { + ret = GLEW_NV_depth_clamp; + continue; + } +#endif +#ifdef GL_NV_depth_range_unclamped + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_range_unclamped", 21)) + { + ret = GLEW_NV_depth_range_unclamped; + continue; + } +#endif +#ifdef GL_NV_evaluators + if (_glewStrSame3(&pos, &len, (const GLubyte*)"evaluators", 10)) + { + ret = GLEW_NV_evaluators; + continue; + } +#endif +#ifdef GL_NV_explicit_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"explicit_multisample", 20)) + { + ret = GLEW_NV_explicit_multisample; + continue; + } +#endif +#ifdef GL_NV_fence + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fence", 5)) + { + ret = GLEW_NV_fence; + continue; + } +#endif +#ifdef GL_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = GLEW_NV_float_buffer; + continue; + } +#endif +#ifdef GL_NV_fog_distance + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_distance", 12)) + { + ret = GLEW_NV_fog_distance; + continue; + } +#endif +#ifdef GL_NV_fragment_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program", 16)) + { + ret = GLEW_NV_fragment_program; + continue; + } +#endif +#ifdef GL_NV_fragment_program2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program2", 17)) + { + ret = GLEW_NV_fragment_program2; + continue; + } +#endif +#ifdef GL_NV_fragment_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program4", 17)) + { + ret = GLEW_NV_fragment_program4; + continue; + } +#endif +#ifdef GL_NV_fragment_program_option + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_program_option", 23)) + { + ret = GLEW_NV_fragment_program_option; + continue; + } +#endif +#ifdef GL_NV_framebuffer_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_multisample_coverage", 32)) + { + ret = GLEW_NV_framebuffer_multisample_coverage; + continue; + } +#endif +#ifdef GL_NV_geometry_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_program4", 17)) + { + ret = GLEW_NV_geometry_program4; + continue; + } +#endif +#ifdef GL_NV_geometry_shader4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"geometry_shader4", 16)) + { + ret = GLEW_NV_geometry_shader4; + continue; + } +#endif +#ifdef GL_NV_gpu_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program4", 12)) + { + ret = GLEW_NV_gpu_program4; + continue; + } +#endif +#ifdef GL_NV_gpu_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program5", 12)) + { + ret = GLEW_NV_gpu_program5; + continue; + } +#endif +#ifdef GL_NV_gpu_program_fp64 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_program_fp64", 16)) + { + ret = GLEW_NV_gpu_program_fp64; + continue; + } +#endif +#ifdef GL_NV_gpu_shader5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_shader5", 11)) + { + ret = GLEW_NV_gpu_shader5; + continue; + } +#endif +#ifdef GL_NV_half_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"half_float", 10)) + { + ret = GLEW_NV_half_float; + continue; + } +#endif +#ifdef GL_NV_light_max_exponent + if (_glewStrSame3(&pos, &len, (const GLubyte*)"light_max_exponent", 18)) + { + ret = GLEW_NV_light_max_exponent; + continue; + } +#endif +#ifdef GL_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = GLEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef GL_NV_multisample_filter_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_filter_hint", 23)) + { + ret = GLEW_NV_multisample_filter_hint; + continue; + } +#endif +#ifdef GL_NV_occlusion_query + if (_glewStrSame3(&pos, &len, (const GLubyte*)"occlusion_query", 15)) + { + ret = GLEW_NV_occlusion_query; + continue; + } +#endif +#ifdef GL_NV_packed_depth_stencil + if (_glewStrSame3(&pos, &len, (const GLubyte*)"packed_depth_stencil", 20)) + { + ret = GLEW_NV_packed_depth_stencil; + continue; + } +#endif +#ifdef GL_NV_parameter_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object", 23)) + { + ret = GLEW_NV_parameter_buffer_object; + continue; + } +#endif +#ifdef GL_NV_parameter_buffer_object2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"parameter_buffer_object2", 24)) + { + ret = GLEW_NV_parameter_buffer_object2; + continue; + } +#endif +#ifdef GL_NV_pixel_data_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_data_range", 16)) + { + ret = GLEW_NV_pixel_data_range; + continue; + } +#endif +#ifdef GL_NV_point_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_sprite", 12)) + { + ret = GLEW_NV_point_sprite; + continue; + } +#endif +#ifdef GL_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = GLEW_NV_present_video; + continue; + } +#endif +#ifdef GL_NV_primitive_restart + if (_glewStrSame3(&pos, &len, (const GLubyte*)"primitive_restart", 17)) + { + ret = GLEW_NV_primitive_restart; + continue; + } +#endif +#ifdef GL_NV_register_combiners + if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners", 18)) + { + ret = GLEW_NV_register_combiners; + continue; + } +#endif +#ifdef GL_NV_register_combiners2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"register_combiners2", 19)) + { + ret = GLEW_NV_register_combiners2; + continue; + } +#endif +#ifdef GL_NV_shader_buffer_load + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shader_buffer_load", 18)) + { + ret = GLEW_NV_shader_buffer_load; + continue; + } +#endif +#ifdef GL_NV_tessellation_program5 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tessellation_program5", 21)) + { + ret = GLEW_NV_tessellation_program5; + continue; + } +#endif +#ifdef GL_NV_texgen_emboss + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_emboss", 13)) + { + ret = GLEW_NV_texgen_emboss; + continue; + } +#endif +#ifdef GL_NV_texgen_reflection + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texgen_reflection", 17)) + { + ret = GLEW_NV_texgen_reflection; + continue; + } +#endif +#ifdef GL_NV_texture_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_barrier", 15)) + { + ret = GLEW_NV_texture_barrier; + continue; + } +#endif +#ifdef GL_NV_texture_compression_vtc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_compression_vtc", 23)) + { + ret = GLEW_NV_texture_compression_vtc; + continue; + } +#endif +#ifdef GL_NV_texture_env_combine4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_env_combine4", 20)) + { + ret = GLEW_NV_texture_env_combine4; + continue; + } +#endif +#ifdef GL_NV_texture_expand_normal + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_expand_normal", 21)) + { + ret = GLEW_NV_texture_expand_normal; + continue; + } +#endif +#ifdef GL_NV_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_rectangle", 17)) + { + ret = GLEW_NV_texture_rectangle; + continue; + } +#endif +#ifdef GL_NV_texture_shader + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader", 14)) + { + ret = GLEW_NV_texture_shader; + continue; + } +#endif +#ifdef GL_NV_texture_shader2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader2", 15)) + { + ret = GLEW_NV_texture_shader2; + continue; + } +#endif +#ifdef GL_NV_texture_shader3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_shader3", 15)) + { + ret = GLEW_NV_texture_shader3; + continue; + } +#endif +#ifdef GL_NV_transform_feedback + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback", 18)) + { + ret = GLEW_NV_transform_feedback; + continue; + } +#endif +#ifdef GL_NV_transform_feedback2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"transform_feedback2", 19)) + { + ret = GLEW_NV_transform_feedback2; + continue; + } +#endif +#ifdef GL_NV_vdpau_interop + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vdpau_interop", 13)) + { + ret = GLEW_NV_vdpau_interop; + continue; + } +#endif +#ifdef GL_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef GL_NV_vertex_array_range2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range2", 19)) + { + ret = GLEW_NV_vertex_array_range2; + continue; + } +#endif +#ifdef GL_NV_vertex_attrib_integer_64bit + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_attrib_integer_64bit", 27)) + { + ret = GLEW_NV_vertex_attrib_integer_64bit; + continue; + } +#endif +#ifdef GL_NV_vertex_buffer_unified_memory + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_unified_memory", 28)) + { + ret = GLEW_NV_vertex_buffer_unified_memory; + continue; + } +#endif +#ifdef GL_NV_vertex_program + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program", 14)) + { + ret = GLEW_NV_vertex_program; + continue; + } +#endif +#ifdef GL_NV_vertex_program1_1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program1_1", 17)) + { + ret = GLEW_NV_vertex_program1_1; + continue; + } +#endif +#ifdef GL_NV_vertex_program2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2", 15)) + { + ret = GLEW_NV_vertex_program2; + continue; + } +#endif +#ifdef GL_NV_vertex_program2_option + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program2_option", 22)) + { + ret = GLEW_NV_vertex_program2_option; + continue; + } +#endif +#ifdef GL_NV_vertex_program3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program3", 15)) + { + ret = GLEW_NV_vertex_program3; + continue; + } +#endif +#ifdef GL_NV_vertex_program4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_program4", 15)) + { + ret = GLEW_NV_vertex_program4; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OES_", 4)) + { +#ifdef GL_OES_byte_coordinates + if (_glewStrSame3(&pos, &len, (const GLubyte*)"byte_coordinates", 16)) + { + ret = GLEW_OES_byte_coordinates; + continue; + } +#endif +#ifdef GL_OES_compressed_paletted_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"compressed_paletted_texture", 27)) + { + ret = GLEW_OES_compressed_paletted_texture; + continue; + } +#endif +#ifdef GL_OES_read_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_format", 11)) + { + ret = GLEW_OES_read_format; + continue; + } +#endif +#ifdef GL_OES_single_precision + if (_glewStrSame3(&pos, &len, (const GLubyte*)"single_precision", 16)) + { + ret = GLEW_OES_single_precision; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef GL_OML_interlace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) + { + ret = GLEW_OML_interlace; + continue; + } +#endif +#ifdef GL_OML_resample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) + { + ret = GLEW_OML_resample; + continue; + } +#endif +#ifdef GL_OML_subsample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"subsample", 9)) + { + ret = GLEW_OML_subsample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"PGI_", 4)) + { +#ifdef GL_PGI_misc_hints + if (_glewStrSame3(&pos, &len, (const GLubyte*)"misc_hints", 10)) + { + ret = GLEW_PGI_misc_hints; + continue; + } +#endif +#ifdef GL_PGI_vertex_hints + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_hints", 12)) + { + ret = GLEW_PGI_vertex_hints; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"REND_", 5)) + { +#ifdef GL_REND_screen_coordinates + if (_glewStrSame3(&pos, &len, (const GLubyte*)"screen_coordinates", 18)) + { + ret = GLEW_REND_screen_coordinates; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"S3_", 3)) + { +#ifdef GL_S3_s3tc + if (_glewStrSame3(&pos, &len, (const GLubyte*)"s3tc", 4)) + { + ret = GLEW_S3_s3tc; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) + { +#ifdef GL_SGIS_color_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) + { + ret = GLEW_SGIS_color_range; + continue; + } +#endif +#ifdef GL_SGIS_detail_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"detail_texture", 14)) + { + ret = GLEW_SGIS_detail_texture; + continue; + } +#endif +#ifdef GL_SGIS_fog_function + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_function", 12)) + { + ret = GLEW_SGIS_fog_function; + continue; + } +#endif +#ifdef GL_SGIS_generate_mipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"generate_mipmap", 15)) + { + ret = GLEW_SGIS_generate_mipmap; + continue; + } +#endif +#ifdef GL_SGIS_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLEW_SGIS_multisample; + continue; + } +#endif +#ifdef GL_SGIS_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) + { + ret = GLEW_SGIS_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIS_point_line_texgen + if (_glewStrSame3(&pos, &len, (const GLubyte*)"point_line_texgen", 17)) + { + ret = GLEW_SGIS_point_line_texgen; + continue; + } +#endif +#ifdef GL_SGIS_sharpen_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sharpen_texture", 15)) + { + ret = GLEW_SGIS_sharpen_texture; + continue; + } +#endif +#ifdef GL_SGIS_texture4D + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture4D", 9)) + { + ret = GLEW_SGIS_texture4D; + continue; + } +#endif +#ifdef GL_SGIS_texture_border_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_border_clamp", 20)) + { + ret = GLEW_SGIS_texture_border_clamp; + continue; + } +#endif +#ifdef GL_SGIS_texture_edge_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_edge_clamp", 18)) + { + ret = GLEW_SGIS_texture_edge_clamp; + continue; + } +#endif +#ifdef GL_SGIS_texture_filter4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_filter4", 15)) + { + ret = GLEW_SGIS_texture_filter4; + continue; + } +#endif +#ifdef GL_SGIS_texture_lod + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod", 11)) + { + ret = GLEW_SGIS_texture_lod; + continue; + } +#endif +#ifdef GL_SGIS_texture_select + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_select", 14)) + { + ret = GLEW_SGIS_texture_select; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) + { +#ifdef GL_SGIX_async + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async", 5)) + { + ret = GLEW_SGIX_async; + continue; + } +#endif +#ifdef GL_SGIX_async_histogram + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_histogram", 15)) + { + ret = GLEW_SGIX_async_histogram; + continue; + } +#endif +#ifdef GL_SGIX_async_pixel + if (_glewStrSame3(&pos, &len, (const GLubyte*)"async_pixel", 11)) + { + ret = GLEW_SGIX_async_pixel; + continue; + } +#endif +#ifdef GL_SGIX_blend_alpha_minmax + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blend_alpha_minmax", 18)) + { + ret = GLEW_SGIX_blend_alpha_minmax; + continue; + } +#endif +#ifdef GL_SGIX_clipmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"clipmap", 7)) + { + ret = GLEW_SGIX_clipmap; + continue; + } +#endif +#ifdef GL_SGIX_convolution_accuracy + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_accuracy", 20)) + { + ret = GLEW_SGIX_convolution_accuracy; + continue; + } +#endif +#ifdef GL_SGIX_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_texture", 13)) + { + ret = GLEW_SGIX_depth_texture; + continue; + } +#endif +#ifdef GL_SGIX_flush_raster + if (_glewStrSame3(&pos, &len, (const GLubyte*)"flush_raster", 12)) + { + ret = GLEW_SGIX_flush_raster; + continue; + } +#endif +#ifdef GL_SGIX_fog_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_offset", 10)) + { + ret = GLEW_SGIX_fog_offset; + continue; + } +#endif +#ifdef GL_SGIX_fog_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fog_texture", 11)) + { + ret = GLEW_SGIX_fog_texture; + continue; + } +#endif +#ifdef GL_SGIX_fragment_specular_lighting + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fragment_specular_lighting", 26)) + { + ret = GLEW_SGIX_fragment_specular_lighting; + continue; + } +#endif +#ifdef GL_SGIX_framezoom + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framezoom", 9)) + { + ret = GLEW_SGIX_framezoom; + continue; + } +#endif +#ifdef GL_SGIX_interlace + if (_glewStrSame3(&pos, &len, (const GLubyte*)"interlace", 9)) + { + ret = GLEW_SGIX_interlace; + continue; + } +#endif +#ifdef GL_SGIX_ir_instrument1 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ir_instrument1", 14)) + { + ret = GLEW_SGIX_ir_instrument1; + continue; + } +#endif +#ifdef GL_SGIX_list_priority + if (_glewStrSame3(&pos, &len, (const GLubyte*)"list_priority", 13)) + { + ret = GLEW_SGIX_list_priority; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture", 13)) + { + ret = GLEW_SGIX_pixel_texture; + continue; + } +#endif +#ifdef GL_SGIX_pixel_texture_bits + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_texture_bits", 18)) + { + ret = GLEW_SGIX_pixel_texture_bits; + continue; + } +#endif +#ifdef GL_SGIX_reference_plane + if (_glewStrSame3(&pos, &len, (const GLubyte*)"reference_plane", 15)) + { + ret = GLEW_SGIX_reference_plane; + continue; + } +#endif +#ifdef GL_SGIX_resample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"resample", 8)) + { + ret = GLEW_SGIX_resample; + continue; + } +#endif +#ifdef GL_SGIX_shadow + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow", 6)) + { + ret = GLEW_SGIX_shadow; + continue; + } +#endif +#ifdef GL_SGIX_shadow_ambient + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shadow_ambient", 14)) + { + ret = GLEW_SGIX_shadow_ambient; + continue; + } +#endif +#ifdef GL_SGIX_sprite + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sprite", 6)) + { + ret = GLEW_SGIX_sprite; + continue; + } +#endif +#ifdef GL_SGIX_tag_sample_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"tag_sample_buffer", 17)) + { + ret = GLEW_SGIX_tag_sample_buffer; + continue; + } +#endif +#ifdef GL_SGIX_texture_add_env + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_add_env", 15)) + { + ret = GLEW_SGIX_texture_add_env; + continue; + } +#endif +#ifdef GL_SGIX_texture_coordinate_clamp + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_coordinate_clamp", 24)) + { + ret = GLEW_SGIX_texture_coordinate_clamp; + continue; + } +#endif +#ifdef GL_SGIX_texture_lod_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_lod_bias", 16)) + { + ret = GLEW_SGIX_texture_lod_bias; + continue; + } +#endif +#ifdef GL_SGIX_texture_multi_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_multi_buffer", 20)) + { + ret = GLEW_SGIX_texture_multi_buffer; + continue; + } +#endif +#ifdef GL_SGIX_texture_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_range", 13)) + { + ret = GLEW_SGIX_texture_range; + continue; + } +#endif +#ifdef GL_SGIX_texture_scale_bias + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_scale_bias", 18)) + { + ret = GLEW_SGIX_texture_scale_bias; + continue; + } +#endif +#ifdef GL_SGIX_vertex_preclip + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip", 14)) + { + ret = GLEW_SGIX_vertex_preclip; + continue; + } +#endif +#ifdef GL_SGIX_vertex_preclip_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_preclip_hint", 19)) + { + ret = GLEW_SGIX_vertex_preclip_hint; + continue; + } +#endif +#ifdef GL_SGIX_ycrcb + if (_glewStrSame3(&pos, &len, (const GLubyte*)"ycrcb", 5)) + { + ret = GLEW_SGIX_ycrcb; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) + { +#ifdef GL_SGI_color_matrix + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_matrix", 12)) + { + ret = GLEW_SGI_color_matrix; + continue; + } +#endif +#ifdef GL_SGI_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_table", 11)) + { + ret = GLEW_SGI_color_table; + continue; + } +#endif +#ifdef GL_SGI_texture_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_color_table", 19)) + { + ret = GLEW_SGI_texture_color_table; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUNX_", 5)) + { +#ifdef GL_SUNX_constant_data + if (_glewStrSame3(&pos, &len, (const GLubyte*)"constant_data", 13)) + { + ret = GLEW_SUNX_constant_data; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) + { +#ifdef GL_SUN_convolution_border_modes + if (_glewStrSame3(&pos, &len, (const GLubyte*)"convolution_border_modes", 24)) + { + ret = GLEW_SUN_convolution_border_modes; + continue; + } +#endif +#ifdef GL_SUN_global_alpha + if (_glewStrSame3(&pos, &len, (const GLubyte*)"global_alpha", 12)) + { + ret = GLEW_SUN_global_alpha; + continue; + } +#endif +#ifdef GL_SUN_mesh_array + if (_glewStrSame3(&pos, &len, (const GLubyte*)"mesh_array", 10)) + { + ret = GLEW_SUN_mesh_array; + continue; + } +#endif +#ifdef GL_SUN_read_video_pixels + if (_glewStrSame3(&pos, &len, (const GLubyte*)"read_video_pixels", 17)) + { + ret = GLEW_SUN_read_video_pixels; + continue; + } +#endif +#ifdef GL_SUN_slice_accum + if (_glewStrSame3(&pos, &len, (const GLubyte*)"slice_accum", 11)) + { + ret = GLEW_SUN_slice_accum; + continue; + } +#endif +#ifdef GL_SUN_triangle_list + if (_glewStrSame3(&pos, &len, (const GLubyte*)"triangle_list", 13)) + { + ret = GLEW_SUN_triangle_list; + continue; + } +#endif +#ifdef GL_SUN_vertex + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex", 6)) + { + ret = GLEW_SUN_vertex; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"WIN_", 4)) + { +#ifdef GL_WIN_phong_shading + if (_glewStrSame3(&pos, &len, (const GLubyte*)"phong_shading", 13)) + { + ret = GLEW_WIN_phong_shading; + continue; + } +#endif +#ifdef GL_WIN_specular_fog + if (_glewStrSame3(&pos, &len, (const GLubyte*)"specular_fog", 12)) + { + ret = GLEW_WIN_specular_fog; + continue; + } +#endif +#ifdef GL_WIN_swap_hint + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_hint", 9)) + { + ret = GLEW_WIN_swap_hint; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#if defined(_WIN32) + +#if defined(GLEW_MX) +GLboolean wglewContextIsSupported (const WGLEWContext* ctx, const char* name) +#else +GLboolean wglewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if (_glewStrSame1(&pos, &len, (const GLubyte*)"WGL_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef WGL_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_3DFX_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DL_", 4)) + { +#ifdef WGL_3DL_stereo_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"stereo_control", 14)) + { + ret = WGLEW_3DL_stereo_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef WGL_AMD_gpu_association + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) + { + ret = WGLEW_AMD_gpu_association; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef WGL_ARB_buffer_region + if (_glewStrSame3(&pos, &len, (const GLubyte*)"buffer_region", 13)) + { + ret = WGLEW_ARB_buffer_region; + continue; + } +#endif +#ifdef WGL_ARB_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = WGLEW_ARB_create_context; + continue; + } +#endif +#ifdef WGL_ARB_create_context_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) + { + ret = WGLEW_ARB_create_context_profile; + continue; + } +#endif +#ifdef WGL_ARB_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = WGLEW_ARB_create_context_robustness; + continue; + } +#endif +#ifdef WGL_ARB_extensions_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) + { + ret = WGLEW_ARB_extensions_string; + continue; + } +#endif +#ifdef WGL_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = WGLEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef WGL_ARB_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = WGLEW_ARB_make_current_read; + continue; + } +#endif +#ifdef WGL_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_ARB_multisample; + continue; + } +#endif +#ifdef WGL_ARB_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = WGLEW_ARB_pbuffer; + continue; + } +#endif +#ifdef WGL_ARB_pixel_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) + { + ret = WGLEW_ARB_pixel_format; + continue; + } +#endif +#ifdef WGL_ARB_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = WGLEW_ARB_pixel_format_float; + continue; + } +#endif +#ifdef WGL_ARB_render_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) + { + ret = WGLEW_ARB_render_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef WGL_ATI_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = WGLEW_ATI_pixel_format_float; + continue; + } +#endif +#ifdef WGL_ATI_render_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) + { + ret = WGLEW_ATI_render_texture_rectangle; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef WGL_EXT_create_context_es2_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) + { + ret = WGLEW_EXT_create_context_es2_profile; + continue; + } +#endif +#ifdef WGL_EXT_depth_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"depth_float", 11)) + { + ret = WGLEW_EXT_depth_float; + continue; + } +#endif +#ifdef WGL_EXT_display_color_table + if (_glewStrSame3(&pos, &len, (const GLubyte*)"display_color_table", 19)) + { + ret = WGLEW_EXT_display_color_table; + continue; + } +#endif +#ifdef WGL_EXT_extensions_string + if (_glewStrSame3(&pos, &len, (const GLubyte*)"extensions_string", 17)) + { + ret = WGLEW_EXT_extensions_string; + continue; + } +#endif +#ifdef WGL_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = WGLEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef WGL_EXT_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = WGLEW_EXT_make_current_read; + continue; + } +#endif +#ifdef WGL_EXT_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = WGLEW_EXT_multisample; + continue; + } +#endif +#ifdef WGL_EXT_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = WGLEW_EXT_pbuffer; + continue; + } +#endif +#ifdef WGL_EXT_pixel_format + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format", 12)) + { + ret = WGLEW_EXT_pixel_format; + continue; + } +#endif +#ifdef WGL_EXT_pixel_format_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_packed_float", 25)) + { + ret = WGLEW_EXT_pixel_format_packed_float; + continue; + } +#endif +#ifdef WGL_EXT_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = WGLEW_EXT_swap_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"I3D_", 4)) + { +#ifdef WGL_I3D_digital_video_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"digital_video_control", 21)) + { + ret = WGLEW_I3D_digital_video_control; + continue; + } +#endif +#ifdef WGL_I3D_gamma + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gamma", 5)) + { + ret = WGLEW_I3D_gamma; + continue; + } +#endif +#ifdef WGL_I3D_genlock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"genlock", 7)) + { + ret = WGLEW_I3D_genlock; + continue; + } +#endif +#ifdef WGL_I3D_image_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"image_buffer", 12)) + { + ret = WGLEW_I3D_image_buffer; + continue; + } +#endif +#ifdef WGL_I3D_swap_frame_lock + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_lock", 15)) + { + ret = WGLEW_I3D_swap_frame_lock; + continue; + } +#endif +#ifdef WGL_I3D_swap_frame_usage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_frame_usage", 16)) + { + ret = WGLEW_I3D_swap_frame_usage; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef WGL_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = WGLEW_NV_copy_image; + continue; + } +#endif +#ifdef WGL_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = WGLEW_NV_float_buffer; + continue; + } +#endif +#ifdef WGL_NV_gpu_affinity + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_affinity", 12)) + { + ret = WGLEW_NV_gpu_affinity; + continue; + } +#endif +#ifdef WGL_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = WGLEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef WGL_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = WGLEW_NV_present_video; + continue; + } +#endif +#ifdef WGL_NV_render_depth_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_depth_texture", 20)) + { + ret = WGLEW_NV_render_depth_texture; + continue; + } +#endif +#ifdef WGL_NV_render_texture_rectangle + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture_rectangle", 24)) + { + ret = WGLEW_NV_render_texture_rectangle; + continue; + } +#endif +#ifdef WGL_NV_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = WGLEW_NV_swap_group; + continue; + } +#endif +#ifdef WGL_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = WGLEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef WGL_NV_video_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12)) + { + ret = WGLEW_NV_video_output; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef WGL_OML_sync_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) + { + ret = WGLEW_OML_sync_control; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#elif !defined(__APPLE__) || defined(GLEW_APPLE_GLX) + +#if defined(GLEW_MX) +GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name) +#else +GLboolean glxewIsSupported (const char* name) +#endif +{ + GLubyte* pos = (GLubyte*)name; + GLuint len = _glewStrLen(pos); + GLboolean ret = GL_TRUE; + while (ret && len > 0) + { + if(_glewStrSame1(&pos, &len, (const GLubyte*)"GLX_", 4)) + { + if (_glewStrSame2(&pos, &len, (const GLubyte*)"VERSION_", 8)) + { +#ifdef GLX_VERSION_1_2 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_2", 3)) + { + ret = GLXEW_VERSION_1_2; + continue; + } +#endif +#ifdef GLX_VERSION_1_3 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_3", 3)) + { + ret = GLXEW_VERSION_1_3; + continue; + } +#endif +#ifdef GLX_VERSION_1_4 + if (_glewStrSame3(&pos, &len, (const GLubyte*)"1_4", 3)) + { + ret = GLXEW_VERSION_1_4; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"3DFX_", 5)) + { +#ifdef GLX_3DFX_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_3DFX_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"AMD_", 4)) + { +#ifdef GLX_AMD_gpu_association + if (_glewStrSame3(&pos, &len, (const GLubyte*)"gpu_association", 15)) + { + ret = GLXEW_AMD_gpu_association; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ARB_", 4)) + { +#ifdef GLX_ARB_create_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context", 14)) + { + ret = GLXEW_ARB_create_context; + continue; + } +#endif +#ifdef GLX_ARB_create_context_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_profile", 22)) + { + ret = GLXEW_ARB_create_context_profile; + continue; + } +#endif +#ifdef GLX_ARB_create_context_robustness + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_robustness", 25)) + { + ret = GLXEW_ARB_create_context_robustness; + continue; + } +#endif +#ifdef GLX_ARB_fbconfig_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_float", 14)) + { + ret = GLXEW_ARB_fbconfig_float; + continue; + } +#endif +#ifdef GLX_ARB_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLXEW_ARB_framebuffer_sRGB; + continue; + } +#endif +#ifdef GLX_ARB_get_proc_address + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_proc_address", 16)) + { + ret = GLXEW_ARB_get_proc_address; + continue; + } +#endif +#ifdef GLX_ARB_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_ARB_multisample; + continue; + } +#endif +#ifdef GLX_ARB_vertex_buffer_object + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_buffer_object", 20)) + { + ret = GLXEW_ARB_vertex_buffer_object; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"ATI_", 4)) + { +#ifdef GLX_ATI_pixel_format_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixel_format_float", 18)) + { + ret = GLXEW_ATI_pixel_format_float; + continue; + } +#endif +#ifdef GLX_ATI_render_texture + if (_glewStrSame3(&pos, &len, (const GLubyte*)"render_texture", 14)) + { + ret = GLXEW_ATI_render_texture; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"EXT_", 4)) + { +#ifdef GLX_EXT_create_context_es2_profile + if (_glewStrSame3(&pos, &len, (const GLubyte*)"create_context_es2_profile", 26)) + { + ret = GLXEW_EXT_create_context_es2_profile; + continue; + } +#endif +#ifdef GLX_EXT_fbconfig_packed_float + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig_packed_float", 21)) + { + ret = GLXEW_EXT_fbconfig_packed_float; + continue; + } +#endif +#ifdef GLX_EXT_framebuffer_sRGB + if (_glewStrSame3(&pos, &len, (const GLubyte*)"framebuffer_sRGB", 16)) + { + ret = GLXEW_EXT_framebuffer_sRGB; + continue; + } +#endif +#ifdef GLX_EXT_import_context + if (_glewStrSame3(&pos, &len, (const GLubyte*)"import_context", 14)) + { + ret = GLXEW_EXT_import_context; + continue; + } +#endif +#ifdef GLX_EXT_scene_marker + if (_glewStrSame3(&pos, &len, (const GLubyte*)"scene_marker", 12)) + { + ret = GLXEW_EXT_scene_marker; + continue; + } +#endif +#ifdef GLX_EXT_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_EXT_swap_control; + continue; + } +#endif +#ifdef GLX_EXT_texture_from_pixmap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"texture_from_pixmap", 19)) + { + ret = GLXEW_EXT_texture_from_pixmap; + continue; + } +#endif +#ifdef GLX_EXT_visual_info + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_info", 11)) + { + ret = GLXEW_EXT_visual_info; + continue; + } +#endif +#ifdef GLX_EXT_visual_rating + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_rating", 13)) + { + ret = GLXEW_EXT_visual_rating; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"INTEL_", 6)) + { +#ifdef GLX_INTEL_swap_event + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_event", 10)) + { + ret = GLXEW_INTEL_swap_event; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"MESA_", 5)) + { +#ifdef GLX_MESA_agp_offset + if (_glewStrSame3(&pos, &len, (const GLubyte*)"agp_offset", 10)) + { + ret = GLXEW_MESA_agp_offset; + continue; + } +#endif +#ifdef GLX_MESA_copy_sub_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_sub_buffer", 15)) + { + ret = GLXEW_MESA_copy_sub_buffer; + continue; + } +#endif +#ifdef GLX_MESA_pixmap_colormap + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pixmap_colormap", 15)) + { + ret = GLXEW_MESA_pixmap_colormap; + continue; + } +#endif +#ifdef GLX_MESA_release_buffers + if (_glewStrSame3(&pos, &len, (const GLubyte*)"release_buffers", 15)) + { + ret = GLXEW_MESA_release_buffers; + continue; + } +#endif +#ifdef GLX_MESA_set_3dfx_mode + if (_glewStrSame3(&pos, &len, (const GLubyte*)"set_3dfx_mode", 13)) + { + ret = GLXEW_MESA_set_3dfx_mode; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"NV_", 3)) + { +#ifdef GLX_NV_copy_image + if (_glewStrSame3(&pos, &len, (const GLubyte*)"copy_image", 10)) + { + ret = GLXEW_NV_copy_image; + continue; + } +#endif +#ifdef GLX_NV_float_buffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"float_buffer", 12)) + { + ret = GLXEW_NV_float_buffer; + continue; + } +#endif +#ifdef GLX_NV_multisample_coverage + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample_coverage", 20)) + { + ret = GLXEW_NV_multisample_coverage; + continue; + } +#endif +#ifdef GLX_NV_present_video + if (_glewStrSame3(&pos, &len, (const GLubyte*)"present_video", 13)) + { + ret = GLXEW_NV_present_video; + continue; + } +#endif +#ifdef GLX_NV_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = GLXEW_NV_swap_group; + continue; + } +#endif +#ifdef GLX_NV_vertex_array_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"vertex_array_range", 18)) + { + ret = GLXEW_NV_vertex_array_range; + continue; + } +#endif +#ifdef GLX_NV_video_output + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_output", 12)) + { + ret = GLXEW_NV_video_output; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"OML_", 4)) + { +#ifdef GLX_OML_swap_method + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_method", 11)) + { + ret = GLXEW_OML_swap_method; + continue; + } +#endif +#if defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +#include + if (_glewStrSame3(&pos, &len, (const GLubyte*)"sync_control", 12)) + { + ret = GLXEW_OML_sync_control; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIS_", 5)) + { +#ifdef GLX_SGIS_blended_overlay + if (_glewStrSame3(&pos, &len, (const GLubyte*)"blended_overlay", 15)) + { + ret = GLXEW_SGIS_blended_overlay; + continue; + } +#endif +#ifdef GLX_SGIS_color_range + if (_glewStrSame3(&pos, &len, (const GLubyte*)"color_range", 11)) + { + ret = GLXEW_SGIS_color_range; + continue; + } +#endif +#ifdef GLX_SGIS_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"multisample", 11)) + { + ret = GLXEW_SGIS_multisample; + continue; + } +#endif +#ifdef GLX_SGIS_shared_multisample + if (_glewStrSame3(&pos, &len, (const GLubyte*)"shared_multisample", 18)) + { + ret = GLXEW_SGIS_shared_multisample; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGIX_", 5)) + { +#ifdef GLX_SGIX_fbconfig + if (_glewStrSame3(&pos, &len, (const GLubyte*)"fbconfig", 8)) + { + ret = GLXEW_SGIX_fbconfig; + continue; + } +#endif +#ifdef GLX_SGIX_hyperpipe + if (_glewStrSame3(&pos, &len, (const GLubyte*)"hyperpipe", 9)) + { + ret = GLXEW_SGIX_hyperpipe; + continue; + } +#endif +#ifdef GLX_SGIX_pbuffer + if (_glewStrSame3(&pos, &len, (const GLubyte*)"pbuffer", 7)) + { + ret = GLXEW_SGIX_pbuffer; + continue; + } +#endif +#ifdef GLX_SGIX_swap_barrier + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_barrier", 12)) + { + ret = GLXEW_SGIX_swap_barrier; + continue; + } +#endif +#ifdef GLX_SGIX_swap_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_group", 10)) + { + ret = GLXEW_SGIX_swap_group; + continue; + } +#endif +#ifdef GLX_SGIX_video_resize + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) + { + ret = GLXEW_SGIX_video_resize; + continue; + } +#endif +#ifdef GLX_SGIX_visual_select_group + if (_glewStrSame3(&pos, &len, (const GLubyte*)"visual_select_group", 19)) + { + ret = GLXEW_SGIX_visual_select_group; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SGI_", 4)) + { +#ifdef GLX_SGI_cushion + if (_glewStrSame3(&pos, &len, (const GLubyte*)"cushion", 7)) + { + ret = GLXEW_SGI_cushion; + continue; + } +#endif +#ifdef GLX_SGI_make_current_read + if (_glewStrSame3(&pos, &len, (const GLubyte*)"make_current_read", 17)) + { + ret = GLXEW_SGI_make_current_read; + continue; + } +#endif +#ifdef GLX_SGI_swap_control + if (_glewStrSame3(&pos, &len, (const GLubyte*)"swap_control", 12)) + { + ret = GLXEW_SGI_swap_control; + continue; + } +#endif +#ifdef GLX_SGI_video_sync + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_sync", 10)) + { + ret = GLXEW_SGI_video_sync; + continue; + } +#endif + } + if (_glewStrSame2(&pos, &len, (const GLubyte*)"SUN_", 4)) + { +#ifdef GLX_SUN_get_transparent_index + if (_glewStrSame3(&pos, &len, (const GLubyte*)"get_transparent_index", 21)) + { + ret = GLXEW_SUN_get_transparent_index; + continue; + } +#endif +#ifdef GLX_SUN_video_resize + if (_glewStrSame3(&pos, &len, (const GLubyte*)"video_resize", 12)) + { + ret = GLXEW_SUN_video_resize; + continue; + } +#endif + } + } + ret = (len == 0); + } + return ret; +} + +#endif /* _WIN32 */ diff --git a/Pkgs/glew.h b/Pkgs/glew.h new file mode 100644 index 0000000..f27513e --- /dev/null +++ b/Pkgs/glew.h @@ -0,0 +1,15343 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** 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. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** 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 OWNER 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. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul 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 and this permission notice 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 + * BRIAN PAUL 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. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE 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 THE AUTHORS OR COPYRIGHT HOLDERS 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 +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glew_h__ +#define __glew_h__ +#define __GLEW_H__ + +#if defined(__gl_h_) || defined(__GL_H__) || defined(__X_GL_H) +#error gl.h included before glew.h +#endif +#if defined(__glext_h_) || defined(__GLEXT_H_) +#error glext.h included before glew.h +#endif +#if defined(__gl_ATI_h_) +#error glATI.h included before glew.h +#endif + +#define __gl_h_ +#define __GL_H__ +#define __X_GL_H +#define __glext_h_ +#define __GLEXT_H_ +#define __gl_ATI_h_ + +#if defined(_WIN32) + +/* + * GLEW does not include to avoid name space pollution. + * GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t + * defined properly. + */ +/* */ +#ifndef APIENTRY +#define GLEW_APIENTRY_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define APIENTRY __stdcall +# elif (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) +# define APIENTRY __stdcall +# else +# define APIENTRY +# endif +#endif +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# endif +#endif +/* */ +#ifndef CALLBACK +#define GLEW_CALLBACK_DEFINED +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define CALLBACK __attribute__ ((__stdcall__)) +# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS) +# define CALLBACK __stdcall +# else +# define CALLBACK +# endif +#endif +/* and */ +#ifndef WINGDIAPI +#define GLEW_WINGDIAPI_DEFINED +#define WINGDIAPI __declspec(dllimport) +#endif +/* */ +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED) +typedef unsigned short wchar_t; +# define _WCHAR_T_DEFINED +#endif +/* */ +#if !defined(_W64) +# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300 +# define _W64 __w64 +# else +# define _W64 +# endif +#endif +#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__) +# ifdef _WIN64 +typedef __int64 ptrdiff_t; +# else +typedef _W64 int ptrdiff_t; +# endif +# define _PTRDIFF_T_DEFINED +# define _PTRDIFF_T_ +#endif + +#ifndef GLAPI +# if defined(__MINGW32__) || defined(__CYGWIN__) +# define GLAPI extern +# else +# define GLAPI WINGDIAPI +# endif +#endif + +#ifndef GLAPIENTRY +#define GLAPIENTRY APIENTRY +#endif + +/* + * GLEW_STATIC is defined for static library. + * GLEW_BUILD is defined for building the DLL library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#else /* _UNIX */ + +/* + * Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO + * C. On my system, this amounts to _3 lines_ of included code, all of + * them pretty much harmless. If you know of a way of detecting 32 vs + * 64 _targets_ at compile time you are free to replace this with + * something that's portable. For now, _this_ is the portable solution. + * (mem, 2004-01-04) + */ + +#include + +/* SGI MIPSPro doesn't like stdint.h in C++ mode */ + +#if defined(__sgi) && !defined(__GNUC__) +#include +#else +#include +#endif + +#define GLEW_APIENTRY_DEFINED +#define APIENTRY + +/* + * GLEW_STATIC is defined for static library. + */ + +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# if defined(__GNUC__) && __GNUC__>=4 +# define GLEWAPI extern __attribute__ ((visibility("default"))) +# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC) +# define GLEWAPI extern __global +# else +# define GLEWAPI extern +# endif +#endif + +/* */ +#ifndef GLAPI +#define GLAPI extern +#endif +#ifndef GLAPIENTRY +#define GLAPIENTRY +#endif + +#endif /* _WIN32 */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* ----------------------------- GL_VERSION_1_1 ---------------------------- */ + +#ifndef GL_VERSION_1_1 +#define GL_VERSION_1_1 1 + +typedef unsigned int GLenum; +typedef unsigned int GLbitfield; +typedef unsigned int GLuint; +typedef int GLint; +typedef int GLsizei; +typedef unsigned char GLboolean; +typedef signed char GLbyte; +typedef short GLshort; +typedef unsigned char GLubyte; +typedef unsigned short GLushort; +typedef unsigned long GLulong; +typedef float GLfloat; +typedef float GLclampf; +typedef double GLdouble; +typedef double GLclampd; +typedef void GLvoid; +#if defined(_MSC_VER) && _MSC_VER < 1400 +typedef __int64 GLint64EXT; +typedef unsigned __int64 GLuint64EXT; +#elif defined(_MSC_VER) || defined(__BORLANDC__) +typedef signed long long GLint64EXT; +typedef unsigned long long GLuint64EXT; +#else +# if defined(__MINGW32__) || defined(__CYGWIN__) +#include +# endif +typedef int64_t GLint64EXT; +typedef uint64_t GLuint64EXT; +#endif +typedef GLint64EXT GLint64; +typedef GLuint64EXT GLuint64; +typedef struct __GLsync *GLsync; + +typedef char GLchar; + +#define GL_ZERO 0 +#define GL_FALSE 0 +#define GL_LOGIC_OP 0x0BF1 +#define GL_NONE 0 +#define GL_TEXTURE_COMPONENTS 0x1003 +#define GL_NO_ERROR 0 +#define GL_POINTS 0x0000 +#define GL_CURRENT_BIT 0x00000001 +#define GL_TRUE 1 +#define GL_ONE 1 +#define GL_CLIENT_PIXEL_STORE_BIT 0x00000001 +#define GL_LINES 0x0001 +#define GL_LINE_LOOP 0x0002 +#define GL_POINT_BIT 0x00000002 +#define GL_CLIENT_VERTEX_ARRAY_BIT 0x00000002 +#define GL_LINE_STRIP 0x0003 +#define GL_LINE_BIT 0x00000004 +#define GL_TRIANGLES 0x0004 +#define GL_TRIANGLE_STRIP 0x0005 +#define GL_TRIANGLE_FAN 0x0006 +#define GL_QUADS 0x0007 +#define GL_QUAD_STRIP 0x0008 +#define GL_POLYGON_BIT 0x00000008 +#define GL_POLYGON 0x0009 +#define GL_POLYGON_STIPPLE_BIT 0x00000010 +#define GL_PIXEL_MODE_BIT 0x00000020 +#define GL_LIGHTING_BIT 0x00000040 +#define GL_FOG_BIT 0x00000080 +#define GL_DEPTH_BUFFER_BIT 0x00000100 +#define GL_ACCUM 0x0100 +#define GL_LOAD 0x0101 +#define GL_RETURN 0x0102 +#define GL_MULT 0x0103 +#define GL_ADD 0x0104 +#define GL_NEVER 0x0200 +#define GL_ACCUM_BUFFER_BIT 0x00000200 +#define GL_LESS 0x0201 +#define GL_EQUAL 0x0202 +#define GL_LEQUAL 0x0203 +#define GL_GREATER 0x0204 +#define GL_NOTEQUAL 0x0205 +#define GL_GEQUAL 0x0206 +#define GL_ALWAYS 0x0207 +#define GL_SRC_COLOR 0x0300 +#define GL_ONE_MINUS_SRC_COLOR 0x0301 +#define GL_SRC_ALPHA 0x0302 +#define GL_ONE_MINUS_SRC_ALPHA 0x0303 +#define GL_DST_ALPHA 0x0304 +#define GL_ONE_MINUS_DST_ALPHA 0x0305 +#define GL_DST_COLOR 0x0306 +#define GL_ONE_MINUS_DST_COLOR 0x0307 +#define GL_SRC_ALPHA_SATURATE 0x0308 +#define GL_STENCIL_BUFFER_BIT 0x00000400 +#define GL_FRONT_LEFT 0x0400 +#define GL_FRONT_RIGHT 0x0401 +#define GL_BACK_LEFT 0x0402 +#define GL_BACK_RIGHT 0x0403 +#define GL_FRONT 0x0404 +#define GL_BACK 0x0405 +#define GL_LEFT 0x0406 +#define GL_RIGHT 0x0407 +#define GL_FRONT_AND_BACK 0x0408 +#define GL_AUX0 0x0409 +#define GL_AUX1 0x040A +#define GL_AUX2 0x040B +#define GL_AUX3 0x040C +#define GL_INVALID_ENUM 0x0500 +#define GL_INVALID_VALUE 0x0501 +#define GL_INVALID_OPERATION 0x0502 +#define GL_STACK_OVERFLOW 0x0503 +#define GL_STACK_UNDERFLOW 0x0504 +#define GL_OUT_OF_MEMORY 0x0505 +#define GL_2D 0x0600 +#define GL_3D 0x0601 +#define GL_3D_COLOR 0x0602 +#define GL_3D_COLOR_TEXTURE 0x0603 +#define GL_4D_COLOR_TEXTURE 0x0604 +#define GL_PASS_THROUGH_TOKEN 0x0700 +#define GL_POINT_TOKEN 0x0701 +#define GL_LINE_TOKEN 0x0702 +#define GL_POLYGON_TOKEN 0x0703 +#define GL_BITMAP_TOKEN 0x0704 +#define GL_DRAW_PIXEL_TOKEN 0x0705 +#define GL_COPY_PIXEL_TOKEN 0x0706 +#define GL_LINE_RESET_TOKEN 0x0707 +#define GL_EXP 0x0800 +#define GL_VIEWPORT_BIT 0x00000800 +#define GL_EXP2 0x0801 +#define GL_CW 0x0900 +#define GL_CCW 0x0901 +#define GL_COEFF 0x0A00 +#define GL_ORDER 0x0A01 +#define GL_DOMAIN 0x0A02 +#define GL_CURRENT_COLOR 0x0B00 +#define GL_CURRENT_INDEX 0x0B01 +#define GL_CURRENT_NORMAL 0x0B02 +#define GL_CURRENT_TEXTURE_COORDS 0x0B03 +#define GL_CURRENT_RASTER_COLOR 0x0B04 +#define GL_CURRENT_RASTER_INDEX 0x0B05 +#define GL_CURRENT_RASTER_TEXTURE_COORDS 0x0B06 +#define GL_CURRENT_RASTER_POSITION 0x0B07 +#define GL_CURRENT_RASTER_POSITION_VALID 0x0B08 +#define GL_CURRENT_RASTER_DISTANCE 0x0B09 +#define GL_POINT_SMOOTH 0x0B10 +#define GL_POINT_SIZE 0x0B11 +#define GL_POINT_SIZE_RANGE 0x0B12 +#define GL_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_LINE_SMOOTH 0x0B20 +#define GL_LINE_WIDTH 0x0B21 +#define GL_LINE_WIDTH_RANGE 0x0B22 +#define GL_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_LINE_STIPPLE 0x0B24 +#define GL_LINE_STIPPLE_PATTERN 0x0B25 +#define GL_LINE_STIPPLE_REPEAT 0x0B26 +#define GL_LIST_MODE 0x0B30 +#define GL_MAX_LIST_NESTING 0x0B31 +#define GL_LIST_BASE 0x0B32 +#define GL_LIST_INDEX 0x0B33 +#define GL_POLYGON_MODE 0x0B40 +#define GL_POLYGON_SMOOTH 0x0B41 +#define GL_POLYGON_STIPPLE 0x0B42 +#define GL_EDGE_FLAG 0x0B43 +#define GL_CULL_FACE 0x0B44 +#define GL_CULL_FACE_MODE 0x0B45 +#define GL_FRONT_FACE 0x0B46 +#define GL_LIGHTING 0x0B50 +#define GL_LIGHT_MODEL_LOCAL_VIEWER 0x0B51 +#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52 +#define GL_LIGHT_MODEL_AMBIENT 0x0B53 +#define GL_SHADE_MODEL 0x0B54 +#define GL_COLOR_MATERIAL_FACE 0x0B55 +#define GL_COLOR_MATERIAL_PARAMETER 0x0B56 +#define GL_COLOR_MATERIAL 0x0B57 +#define GL_FOG 0x0B60 +#define GL_FOG_INDEX 0x0B61 +#define GL_FOG_DENSITY 0x0B62 +#define GL_FOG_START 0x0B63 +#define GL_FOG_END 0x0B64 +#define GL_FOG_MODE 0x0B65 +#define GL_FOG_COLOR 0x0B66 +#define GL_DEPTH_RANGE 0x0B70 +#define GL_DEPTH_TEST 0x0B71 +#define GL_DEPTH_WRITEMASK 0x0B72 +#define GL_DEPTH_CLEAR_VALUE 0x0B73 +#define GL_DEPTH_FUNC 0x0B74 +#define GL_ACCUM_CLEAR_VALUE 0x0B80 +#define GL_STENCIL_TEST 0x0B90 +#define GL_STENCIL_CLEAR_VALUE 0x0B91 +#define GL_STENCIL_FUNC 0x0B92 +#define GL_STENCIL_VALUE_MASK 0x0B93 +#define GL_STENCIL_FAIL 0x0B94 +#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95 +#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96 +#define GL_STENCIL_REF 0x0B97 +#define GL_STENCIL_WRITEMASK 0x0B98 +#define GL_MATRIX_MODE 0x0BA0 +#define GL_NORMALIZE 0x0BA1 +#define GL_VIEWPORT 0x0BA2 +#define GL_MODELVIEW_STACK_DEPTH 0x0BA3 +#define GL_PROJECTION_STACK_DEPTH 0x0BA4 +#define GL_TEXTURE_STACK_DEPTH 0x0BA5 +#define GL_MODELVIEW_MATRIX 0x0BA6 +#define GL_PROJECTION_MATRIX 0x0BA7 +#define GL_TEXTURE_MATRIX 0x0BA8 +#define GL_ATTRIB_STACK_DEPTH 0x0BB0 +#define GL_CLIENT_ATTRIB_STACK_DEPTH 0x0BB1 +#define GL_ALPHA_TEST 0x0BC0 +#define GL_ALPHA_TEST_FUNC 0x0BC1 +#define GL_ALPHA_TEST_REF 0x0BC2 +#define GL_DITHER 0x0BD0 +#define GL_BLEND_DST 0x0BE0 +#define GL_BLEND_SRC 0x0BE1 +#define GL_BLEND 0x0BE2 +#define GL_LOGIC_OP_MODE 0x0BF0 +#define GL_INDEX_LOGIC_OP 0x0BF1 +#define GL_COLOR_LOGIC_OP 0x0BF2 +#define GL_AUX_BUFFERS 0x0C00 +#define GL_DRAW_BUFFER 0x0C01 +#define GL_READ_BUFFER 0x0C02 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_INDEX_CLEAR_VALUE 0x0C20 +#define GL_INDEX_WRITEMASK 0x0C21 +#define GL_COLOR_CLEAR_VALUE 0x0C22 +#define GL_COLOR_WRITEMASK 0x0C23 +#define GL_INDEX_MODE 0x0C30 +#define GL_RGBA_MODE 0x0C31 +#define GL_DOUBLEBUFFER 0x0C32 +#define GL_STEREO 0x0C33 +#define GL_RENDER_MODE 0x0C40 +#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50 +#define GL_POINT_SMOOTH_HINT 0x0C51 +#define GL_LINE_SMOOTH_HINT 0x0C52 +#define GL_POLYGON_SMOOTH_HINT 0x0C53 +#define GL_FOG_HINT 0x0C54 +#define GL_TEXTURE_GEN_S 0x0C60 +#define GL_TEXTURE_GEN_T 0x0C61 +#define GL_TEXTURE_GEN_R 0x0C62 +#define GL_TEXTURE_GEN_Q 0x0C63 +#define GL_PIXEL_MAP_I_TO_I 0x0C70 +#define GL_PIXEL_MAP_S_TO_S 0x0C71 +#define GL_PIXEL_MAP_I_TO_R 0x0C72 +#define GL_PIXEL_MAP_I_TO_G 0x0C73 +#define GL_PIXEL_MAP_I_TO_B 0x0C74 +#define GL_PIXEL_MAP_I_TO_A 0x0C75 +#define GL_PIXEL_MAP_R_TO_R 0x0C76 +#define GL_PIXEL_MAP_G_TO_G 0x0C77 +#define GL_PIXEL_MAP_B_TO_B 0x0C78 +#define GL_PIXEL_MAP_A_TO_A 0x0C79 +#define GL_PIXEL_MAP_I_TO_I_SIZE 0x0CB0 +#define GL_PIXEL_MAP_S_TO_S_SIZE 0x0CB1 +#define GL_PIXEL_MAP_I_TO_R_SIZE 0x0CB2 +#define GL_PIXEL_MAP_I_TO_G_SIZE 0x0CB3 +#define GL_PIXEL_MAP_I_TO_B_SIZE 0x0CB4 +#define GL_PIXEL_MAP_I_TO_A_SIZE 0x0CB5 +#define GL_PIXEL_MAP_R_TO_R_SIZE 0x0CB6 +#define GL_PIXEL_MAP_G_TO_G_SIZE 0x0CB7 +#define GL_PIXEL_MAP_B_TO_B_SIZE 0x0CB8 +#define GL_PIXEL_MAP_A_TO_A_SIZE 0x0CB9 +#define GL_UNPACK_SWAP_BYTES 0x0CF0 +#define GL_UNPACK_LSB_FIRST 0x0CF1 +#define GL_UNPACK_ROW_LENGTH 0x0CF2 +#define GL_UNPACK_SKIP_ROWS 0x0CF3 +#define GL_UNPACK_SKIP_PIXELS 0x0CF4 +#define GL_UNPACK_ALIGNMENT 0x0CF5 +#define GL_PACK_SWAP_BYTES 0x0D00 +#define GL_PACK_LSB_FIRST 0x0D01 +#define GL_PACK_ROW_LENGTH 0x0D02 +#define GL_PACK_SKIP_ROWS 0x0D03 +#define GL_PACK_SKIP_PIXELS 0x0D04 +#define GL_PACK_ALIGNMENT 0x0D05 +#define GL_MAP_COLOR 0x0D10 +#define GL_MAP_STENCIL 0x0D11 +#define GL_INDEX_SHIFT 0x0D12 +#define GL_INDEX_OFFSET 0x0D13 +#define GL_RED_SCALE 0x0D14 +#define GL_RED_BIAS 0x0D15 +#define GL_ZOOM_X 0x0D16 +#define GL_ZOOM_Y 0x0D17 +#define GL_GREEN_SCALE 0x0D18 +#define GL_GREEN_BIAS 0x0D19 +#define GL_BLUE_SCALE 0x0D1A +#define GL_BLUE_BIAS 0x0D1B +#define GL_ALPHA_SCALE 0x0D1C +#define GL_ALPHA_BIAS 0x0D1D +#define GL_DEPTH_SCALE 0x0D1E +#define GL_DEPTH_BIAS 0x0D1F +#define GL_MAX_EVAL_ORDER 0x0D30 +#define GL_MAX_LIGHTS 0x0D31 +#define GL_MAX_CLIP_PLANES 0x0D32 +#define GL_MAX_TEXTURE_SIZE 0x0D33 +#define GL_MAX_PIXEL_MAP_TABLE 0x0D34 +#define GL_MAX_ATTRIB_STACK_DEPTH 0x0D35 +#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36 +#define GL_MAX_NAME_STACK_DEPTH 0x0D37 +#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38 +#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39 +#define GL_MAX_VIEWPORT_DIMS 0x0D3A +#define GL_MAX_CLIENT_ATTRIB_STACK_DEPTH 0x0D3B +#define GL_SUBPIXEL_BITS 0x0D50 +#define GL_INDEX_BITS 0x0D51 +#define GL_RED_BITS 0x0D52 +#define GL_GREEN_BITS 0x0D53 +#define GL_BLUE_BITS 0x0D54 +#define GL_ALPHA_BITS 0x0D55 +#define GL_DEPTH_BITS 0x0D56 +#define GL_STENCIL_BITS 0x0D57 +#define GL_ACCUM_RED_BITS 0x0D58 +#define GL_ACCUM_GREEN_BITS 0x0D59 +#define GL_ACCUM_BLUE_BITS 0x0D5A +#define GL_ACCUM_ALPHA_BITS 0x0D5B +#define GL_NAME_STACK_DEPTH 0x0D70 +#define GL_AUTO_NORMAL 0x0D80 +#define GL_MAP1_COLOR_4 0x0D90 +#define GL_MAP1_INDEX 0x0D91 +#define GL_MAP1_NORMAL 0x0D92 +#define GL_MAP1_TEXTURE_COORD_1 0x0D93 +#define GL_MAP1_TEXTURE_COORD_2 0x0D94 +#define GL_MAP1_TEXTURE_COORD_3 0x0D95 +#define GL_MAP1_TEXTURE_COORD_4 0x0D96 +#define GL_MAP1_VERTEX_3 0x0D97 +#define GL_MAP1_VERTEX_4 0x0D98 +#define GL_MAP2_COLOR_4 0x0DB0 +#define GL_MAP2_INDEX 0x0DB1 +#define GL_MAP2_NORMAL 0x0DB2 +#define GL_MAP2_TEXTURE_COORD_1 0x0DB3 +#define GL_MAP2_TEXTURE_COORD_2 0x0DB4 +#define GL_MAP2_TEXTURE_COORD_3 0x0DB5 +#define GL_MAP2_TEXTURE_COORD_4 0x0DB6 +#define GL_MAP2_VERTEX_3 0x0DB7 +#define GL_MAP2_VERTEX_4 0x0DB8 +#define GL_MAP1_GRID_DOMAIN 0x0DD0 +#define GL_MAP1_GRID_SEGMENTS 0x0DD1 +#define GL_MAP2_GRID_DOMAIN 0x0DD2 +#define GL_MAP2_GRID_SEGMENTS 0x0DD3 +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_FEEDBACK_BUFFER_POINTER 0x0DF0 +#define GL_FEEDBACK_BUFFER_SIZE 0x0DF1 +#define GL_FEEDBACK_BUFFER_TYPE 0x0DF2 +#define GL_SELECTION_BUFFER_POINTER 0x0DF3 +#define GL_SELECTION_BUFFER_SIZE 0x0DF4 +#define GL_TEXTURE_WIDTH 0x1000 +#define GL_TRANSFORM_BIT 0x00001000 +#define GL_TEXTURE_HEIGHT 0x1001 +#define GL_TEXTURE_INTERNAL_FORMAT 0x1003 +#define GL_TEXTURE_BORDER_COLOR 0x1004 +#define GL_TEXTURE_BORDER 0x1005 +#define GL_DONT_CARE 0x1100 +#define GL_FASTEST 0x1101 +#define GL_NICEST 0x1102 +#define GL_AMBIENT 0x1200 +#define GL_DIFFUSE 0x1201 +#define GL_SPECULAR 0x1202 +#define GL_POSITION 0x1203 +#define GL_SPOT_DIRECTION 0x1204 +#define GL_SPOT_EXPONENT 0x1205 +#define GL_SPOT_CUTOFF 0x1206 +#define GL_CONSTANT_ATTENUATION 0x1207 +#define GL_LINEAR_ATTENUATION 0x1208 +#define GL_QUADRATIC_ATTENUATION 0x1209 +#define GL_COMPILE 0x1300 +#define GL_COMPILE_AND_EXECUTE 0x1301 +#define GL_BYTE 0x1400 +#define GL_UNSIGNED_BYTE 0x1401 +#define GL_SHORT 0x1402 +#define GL_UNSIGNED_SHORT 0x1403 +#define GL_INT 0x1404 +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_2_BYTES 0x1407 +#define GL_3_BYTES 0x1408 +#define GL_4_BYTES 0x1409 +#define GL_DOUBLE 0x140A +#define GL_CLEAR 0x1500 +#define GL_AND 0x1501 +#define GL_AND_REVERSE 0x1502 +#define GL_COPY 0x1503 +#define GL_AND_INVERTED 0x1504 +#define GL_NOOP 0x1505 +#define GL_XOR 0x1506 +#define GL_OR 0x1507 +#define GL_NOR 0x1508 +#define GL_EQUIV 0x1509 +#define GL_INVERT 0x150A +#define GL_OR_REVERSE 0x150B +#define GL_COPY_INVERTED 0x150C +#define GL_OR_INVERTED 0x150D +#define GL_NAND 0x150E +#define GL_SET 0x150F +#define GL_EMISSION 0x1600 +#define GL_SHININESS 0x1601 +#define GL_AMBIENT_AND_DIFFUSE 0x1602 +#define GL_COLOR_INDEXES 0x1603 +#define GL_MODELVIEW 0x1700 +#define GL_PROJECTION 0x1701 +#define GL_TEXTURE 0x1702 +#define GL_COLOR 0x1800 +#define GL_DEPTH 0x1801 +#define GL_STENCIL 0x1802 +#define GL_COLOR_INDEX 0x1900 +#define GL_STENCIL_INDEX 0x1901 +#define GL_DEPTH_COMPONENT 0x1902 +#define GL_RED 0x1903 +#define GL_GREEN 0x1904 +#define GL_BLUE 0x1905 +#define GL_ALPHA 0x1906 +#define GL_RGB 0x1907 +#define GL_RGBA 0x1908 +#define GL_LUMINANCE 0x1909 +#define GL_LUMINANCE_ALPHA 0x190A +#define GL_BITMAP 0x1A00 +#define GL_POINT 0x1B00 +#define GL_LINE 0x1B01 +#define GL_FILL 0x1B02 +#define GL_RENDER 0x1C00 +#define GL_FEEDBACK 0x1C01 +#define GL_SELECT 0x1C02 +#define GL_FLAT 0x1D00 +#define GL_SMOOTH 0x1D01 +#define GL_KEEP 0x1E00 +#define GL_REPLACE 0x1E01 +#define GL_INCR 0x1E02 +#define GL_DECR 0x1E03 +#define GL_VENDOR 0x1F00 +#define GL_RENDERER 0x1F01 +#define GL_VERSION 0x1F02 +#define GL_EXTENSIONS 0x1F03 +#define GL_S 0x2000 +#define GL_ENABLE_BIT 0x00002000 +#define GL_T 0x2001 +#define GL_R 0x2002 +#define GL_Q 0x2003 +#define GL_MODULATE 0x2100 +#define GL_DECAL 0x2101 +#define GL_TEXTURE_ENV_MODE 0x2200 +#define GL_TEXTURE_ENV_COLOR 0x2201 +#define GL_TEXTURE_ENV 0x2300 +#define GL_EYE_LINEAR 0x2400 +#define GL_OBJECT_LINEAR 0x2401 +#define GL_SPHERE_MAP 0x2402 +#define GL_TEXTURE_GEN_MODE 0x2500 +#define GL_OBJECT_PLANE 0x2501 +#define GL_EYE_PLANE 0x2502 +#define GL_NEAREST 0x2600 +#define GL_LINEAR 0x2601 +#define GL_NEAREST_MIPMAP_NEAREST 0x2700 +#define GL_LINEAR_MIPMAP_NEAREST 0x2701 +#define GL_NEAREST_MIPMAP_LINEAR 0x2702 +#define GL_LINEAR_MIPMAP_LINEAR 0x2703 +#define GL_TEXTURE_MAG_FILTER 0x2800 +#define GL_TEXTURE_MIN_FILTER 0x2801 +#define GL_TEXTURE_WRAP_S 0x2802 +#define GL_TEXTURE_WRAP_T 0x2803 +#define GL_CLAMP 0x2900 +#define GL_REPEAT 0x2901 +#define GL_POLYGON_OFFSET_UNITS 0x2A00 +#define GL_POLYGON_OFFSET_POINT 0x2A01 +#define GL_POLYGON_OFFSET_LINE 0x2A02 +#define GL_R3_G3_B2 0x2A10 +#define GL_V2F 0x2A20 +#define GL_V3F 0x2A21 +#define GL_C4UB_V2F 0x2A22 +#define GL_C4UB_V3F 0x2A23 +#define GL_C3F_V3F 0x2A24 +#define GL_N3F_V3F 0x2A25 +#define GL_C4F_N3F_V3F 0x2A26 +#define GL_T2F_V3F 0x2A27 +#define GL_T4F_V4F 0x2A28 +#define GL_T2F_C4UB_V3F 0x2A29 +#define GL_T2F_C3F_V3F 0x2A2A +#define GL_T2F_N3F_V3F 0x2A2B +#define GL_T2F_C4F_N3F_V3F 0x2A2C +#define GL_T4F_C4F_N3F_V4F 0x2A2D +#define GL_CLIP_PLANE0 0x3000 +#define GL_CLIP_PLANE1 0x3001 +#define GL_CLIP_PLANE2 0x3002 +#define GL_CLIP_PLANE3 0x3003 +#define GL_CLIP_PLANE4 0x3004 +#define GL_CLIP_PLANE5 0x3005 +#define GL_LIGHT0 0x4000 +#define GL_COLOR_BUFFER_BIT 0x00004000 +#define GL_LIGHT1 0x4001 +#define GL_LIGHT2 0x4002 +#define GL_LIGHT3 0x4003 +#define GL_LIGHT4 0x4004 +#define GL_LIGHT5 0x4005 +#define GL_LIGHT6 0x4006 +#define GL_LIGHT7 0x4007 +#define GL_HINT_BIT 0x00008000 +#define GL_POLYGON_OFFSET_FILL 0x8037 +#define GL_POLYGON_OFFSET_FACTOR 0x8038 +#define GL_ALPHA4 0x803B +#define GL_ALPHA8 0x803C +#define GL_ALPHA12 0x803D +#define GL_ALPHA16 0x803E +#define GL_LUMINANCE4 0x803F +#define GL_LUMINANCE8 0x8040 +#define GL_LUMINANCE12 0x8041 +#define GL_LUMINANCE16 0x8042 +#define GL_LUMINANCE4_ALPHA4 0x8043 +#define GL_LUMINANCE6_ALPHA2 0x8044 +#define GL_LUMINANCE8_ALPHA8 0x8045 +#define GL_LUMINANCE12_ALPHA4 0x8046 +#define GL_LUMINANCE12_ALPHA12 0x8047 +#define GL_LUMINANCE16_ALPHA16 0x8048 +#define GL_INTENSITY 0x8049 +#define GL_INTENSITY4 0x804A +#define GL_INTENSITY8 0x804B +#define GL_INTENSITY12 0x804C +#define GL_INTENSITY16 0x804D +#define GL_RGB4 0x804F +#define GL_RGB5 0x8050 +#define GL_RGB8 0x8051 +#define GL_RGB10 0x8052 +#define GL_RGB12 0x8053 +#define GL_RGB16 0x8054 +#define GL_RGBA2 0x8055 +#define GL_RGBA4 0x8056 +#define GL_RGB5_A1 0x8057 +#define GL_RGBA8 0x8058 +#define GL_RGB10_A2 0x8059 +#define GL_RGBA12 0x805A +#define GL_RGBA16 0x805B +#define GL_TEXTURE_RED_SIZE 0x805C +#define GL_TEXTURE_GREEN_SIZE 0x805D +#define GL_TEXTURE_BLUE_SIZE 0x805E +#define GL_TEXTURE_ALPHA_SIZE 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE 0x8061 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_PRIORITY 0x8066 +#define GL_TEXTURE_RESIDENT 0x8067 +#define GL_TEXTURE_BINDING_1D 0x8068 +#define GL_TEXTURE_BINDING_2D 0x8069 +#define GL_VERTEX_ARRAY 0x8074 +#define GL_NORMAL_ARRAY 0x8075 +#define GL_COLOR_ARRAY 0x8076 +#define GL_INDEX_ARRAY 0x8077 +#define GL_TEXTURE_COORD_ARRAY 0x8078 +#define GL_EDGE_FLAG_ARRAY 0x8079 +#define GL_VERTEX_ARRAY_SIZE 0x807A +#define GL_VERTEX_ARRAY_TYPE 0x807B +#define GL_VERTEX_ARRAY_STRIDE 0x807C +#define GL_NORMAL_ARRAY_TYPE 0x807E +#define GL_NORMAL_ARRAY_STRIDE 0x807F +#define GL_COLOR_ARRAY_SIZE 0x8081 +#define GL_COLOR_ARRAY_TYPE 0x8082 +#define GL_COLOR_ARRAY_STRIDE 0x8083 +#define GL_INDEX_ARRAY_TYPE 0x8085 +#define GL_INDEX_ARRAY_STRIDE 0x8086 +#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A +#define GL_EDGE_FLAG_ARRAY_STRIDE 0x808C +#define GL_VERTEX_ARRAY_POINTER 0x808E +#define GL_NORMAL_ARRAY_POINTER 0x808F +#define GL_COLOR_ARRAY_POINTER 0x8090 +#define GL_INDEX_ARRAY_POINTER 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER 0x8093 +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_EVAL_BIT 0x00010000 +#define GL_LIST_BIT 0x00020000 +#define GL_TEXTURE_BIT 0x00040000 +#define GL_SCISSOR_BIT 0x00080000 +#define GL_ALL_ATTRIB_BITS 0x000fffff +#define GL_CLIENT_ALL_ATTRIB_BITS 0xffffffff + +GLAPI void GLAPIENTRY glAccum (GLenum op, GLfloat value); +GLAPI void GLAPIENTRY glAlphaFunc (GLenum func, GLclampf ref); +GLAPI GLboolean GLAPIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences); +GLAPI void GLAPIENTRY glArrayElement (GLint i); +GLAPI void GLAPIENTRY glBegin (GLenum mode); +GLAPI void GLAPIENTRY glBindTexture (GLenum target, GLuint texture); +GLAPI void GLAPIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap); +GLAPI void GLAPIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor); +GLAPI void GLAPIENTRY glCallList (GLuint list); +GLAPI void GLAPIENTRY glCallLists (GLsizei n, GLenum type, const GLvoid *lists); +GLAPI void GLAPIENTRY glClear (GLbitfield mask); +GLAPI void GLAPIENTRY glClearAccum (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +GLAPI void GLAPIENTRY glClearDepth (GLclampd depth); +GLAPI void GLAPIENTRY glClearIndex (GLfloat c); +GLAPI void GLAPIENTRY glClearStencil (GLint s); +GLAPI void GLAPIENTRY glClipPlane (GLenum plane, const GLdouble *equation); +GLAPI void GLAPIENTRY glColor3b (GLbyte red, GLbyte green, GLbyte blue); +GLAPI void GLAPIENTRY glColor3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor3d (GLdouble red, GLdouble green, GLdouble blue); +GLAPI void GLAPIENTRY glColor3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor3f (GLfloat red, GLfloat green, GLfloat blue); +GLAPI void GLAPIENTRY glColor3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor3i (GLint red, GLint green, GLint blue); +GLAPI void GLAPIENTRY glColor3iv (const GLint *v); +GLAPI void GLAPIENTRY glColor3s (GLshort red, GLshort green, GLshort blue); +GLAPI void GLAPIENTRY glColor3sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor3ub (GLubyte red, GLubyte green, GLubyte blue); +GLAPI void GLAPIENTRY glColor3ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor3ui (GLuint red, GLuint green, GLuint blue); +GLAPI void GLAPIENTRY glColor3uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor3us (GLushort red, GLushort green, GLushort blue); +GLAPI void GLAPIENTRY glColor3usv (const GLushort *v); +GLAPI void GLAPIENTRY glColor4b (GLbyte red, GLbyte green, GLbyte blue, GLbyte alpha); +GLAPI void GLAPIENTRY glColor4bv (const GLbyte *v); +GLAPI void GLAPIENTRY glColor4d (GLdouble red, GLdouble green, GLdouble blue, GLdouble alpha); +GLAPI void GLAPIENTRY glColor4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha); +GLAPI void GLAPIENTRY glColor4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glColor4i (GLint red, GLint green, GLint blue, GLint alpha); +GLAPI void GLAPIENTRY glColor4iv (const GLint *v); +GLAPI void GLAPIENTRY glColor4s (GLshort red, GLshort green, GLshort blue, GLshort alpha); +GLAPI void GLAPIENTRY glColor4sv (const GLshort *v); +GLAPI void GLAPIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha); +GLAPI void GLAPIENTRY glColor4ubv (const GLubyte *v); +GLAPI void GLAPIENTRY glColor4ui (GLuint red, GLuint green, GLuint blue, GLuint alpha); +GLAPI void GLAPIENTRY glColor4uiv (const GLuint *v); +GLAPI void GLAPIENTRY glColor4us (GLushort red, GLushort green, GLushort blue, GLushort alpha); +GLAPI void GLAPIENTRY glColor4usv (const GLushort *v); +GLAPI void GLAPIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); +GLAPI void GLAPIENTRY glColorMaterial (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glCopyPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum type); +GLAPI void GLAPIENTRY glCopyTexImage1D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLint border); +GLAPI void GLAPIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalFormat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +GLAPI void GLAPIENTRY glCopyTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +GLAPI void GLAPIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glCullFace (GLenum mode); +GLAPI void GLAPIENTRY glDeleteLists (GLuint list, GLsizei range); +GLAPI void GLAPIENTRY glDeleteTextures (GLsizei n, const GLuint *textures); +GLAPI void GLAPIENTRY glDepthFunc (GLenum func); +GLAPI void GLAPIENTRY glDepthMask (GLboolean flag); +GLAPI void GLAPIENTRY glDepthRange (GLclampd zNear, GLclampd zFar); +GLAPI void GLAPIENTRY glDisable (GLenum cap); +GLAPI void GLAPIENTRY glDisableClientState (GLenum array); +GLAPI void GLAPIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count); +GLAPI void GLAPIENTRY glDrawBuffer (GLenum mode); +GLAPI void GLAPIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices); +GLAPI void GLAPIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glEdgeFlag (GLboolean flag); +GLAPI void GLAPIENTRY glEdgeFlagPointer (GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glEdgeFlagv (const GLboolean *flag); +GLAPI void GLAPIENTRY glEnable (GLenum cap); +GLAPI void GLAPIENTRY glEnableClientState (GLenum array); +GLAPI void GLAPIENTRY glEnd (void); +GLAPI void GLAPIENTRY glEndList (void); +GLAPI void GLAPIENTRY glEvalCoord1d (GLdouble u); +GLAPI void GLAPIENTRY glEvalCoord1dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord1f (GLfloat u); +GLAPI void GLAPIENTRY glEvalCoord1fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalCoord2d (GLdouble u, GLdouble v); +GLAPI void GLAPIENTRY glEvalCoord2dv (const GLdouble *u); +GLAPI void GLAPIENTRY glEvalCoord2f (GLfloat u, GLfloat v); +GLAPI void GLAPIENTRY glEvalCoord2fv (const GLfloat *u); +GLAPI void GLAPIENTRY glEvalMesh1 (GLenum mode, GLint i1, GLint i2); +GLAPI void GLAPIENTRY glEvalMesh2 (GLenum mode, GLint i1, GLint i2, GLint j1, GLint j2); +GLAPI void GLAPIENTRY glEvalPoint1 (GLint i); +GLAPI void GLAPIENTRY glEvalPoint2 (GLint i, GLint j); +GLAPI void GLAPIENTRY glFeedbackBuffer (GLsizei size, GLenum type, GLfloat *buffer); +GLAPI void GLAPIENTRY glFinish (void); +GLAPI void GLAPIENTRY glFlush (void); +GLAPI void GLAPIENTRY glFogf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glFogfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glFogi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glFogiv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glFrontFace (GLenum mode); +GLAPI void GLAPIENTRY glFrustum (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI GLuint GLAPIENTRY glGenLists (GLsizei range); +GLAPI void GLAPIENTRY glGenTextures (GLsizei n, GLuint *textures); +GLAPI void GLAPIENTRY glGetBooleanv (GLenum pname, GLboolean *params); +GLAPI void GLAPIENTRY glGetClipPlane (GLenum plane, GLdouble *equation); +GLAPI void GLAPIENTRY glGetDoublev (GLenum pname, GLdouble *params); +GLAPI GLenum GLAPIENTRY glGetError (void); +GLAPI void GLAPIENTRY glGetFloatv (GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetIntegerv (GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetMapdv (GLenum target, GLenum query, GLdouble *v); +GLAPI void GLAPIENTRY glGetMapfv (GLenum target, GLenum query, GLfloat *v); +GLAPI void GLAPIENTRY glGetMapiv (GLenum target, GLenum query, GLint *v); +GLAPI void GLAPIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetPixelMapfv (GLenum map, GLfloat *values); +GLAPI void GLAPIENTRY glGetPixelMapuiv (GLenum map, GLuint *values); +GLAPI void GLAPIENTRY glGetPixelMapusv (GLenum map, GLushort *values); +GLAPI void GLAPIENTRY glGetPointerv (GLenum pname, GLvoid* *params); +GLAPI void GLAPIENTRY glGetPolygonStipple (GLubyte *mask); +GLAPI const GLubyte * GLAPIENTRY glGetString (GLenum name); +GLAPI void GLAPIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params); +GLAPI void GLAPIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params); +GLAPI void GLAPIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params); +GLAPI void GLAPIENTRY glHint (GLenum target, GLenum mode); +GLAPI void GLAPIENTRY glIndexMask (GLuint mask); +GLAPI void GLAPIENTRY glIndexPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glIndexd (GLdouble c); +GLAPI void GLAPIENTRY glIndexdv (const GLdouble *c); +GLAPI void GLAPIENTRY glIndexf (GLfloat c); +GLAPI void GLAPIENTRY glIndexfv (const GLfloat *c); +GLAPI void GLAPIENTRY glIndexi (GLint c); +GLAPI void GLAPIENTRY glIndexiv (const GLint *c); +GLAPI void GLAPIENTRY glIndexs (GLshort c); +GLAPI void GLAPIENTRY glIndexsv (const GLshort *c); +GLAPI void GLAPIENTRY glIndexub (GLubyte c); +GLAPI void GLAPIENTRY glIndexubv (const GLubyte *c); +GLAPI void GLAPIENTRY glInitNames (void); +GLAPI void GLAPIENTRY glInterleavedArrays (GLenum format, GLsizei stride, const GLvoid *pointer); +GLAPI GLboolean GLAPIENTRY glIsEnabled (GLenum cap); +GLAPI GLboolean GLAPIENTRY glIsList (GLuint list); +GLAPI GLboolean GLAPIENTRY glIsTexture (GLuint texture); +GLAPI void GLAPIENTRY glLightModelf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightModelfv (GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLightModeli (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightModeliv (GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLightf (GLenum light, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glLighti (GLenum light, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glLightiv (GLenum light, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glLineStipple (GLint factor, GLushort pattern); +GLAPI void GLAPIENTRY glLineWidth (GLfloat width); +GLAPI void GLAPIENTRY glListBase (GLuint base); +GLAPI void GLAPIENTRY glLoadIdentity (void); +GLAPI void GLAPIENTRY glLoadMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glLoadMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glLoadName (GLuint name); +GLAPI void GLAPIENTRY glLogicOp (GLenum opcode); +GLAPI void GLAPIENTRY glMap1d (GLenum target, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble *points); +GLAPI void GLAPIENTRY glMap1f (GLenum target, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat *points); +GLAPI void GLAPIENTRY glMap2d (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble *points); +GLAPI void GLAPIENTRY glMap2f (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat *points); +GLAPI void GLAPIENTRY glMapGrid1d (GLint un, GLdouble u1, GLdouble u2); +GLAPI void GLAPIENTRY glMapGrid1f (GLint un, GLfloat u1, GLfloat u2); +GLAPI void GLAPIENTRY glMapGrid2d (GLint un, GLdouble u1, GLdouble u2, GLint vn, GLdouble v1, GLdouble v2); +GLAPI void GLAPIENTRY glMapGrid2f (GLint un, GLfloat u1, GLfloat u2, GLint vn, GLfloat v1, GLfloat v2); +GLAPI void GLAPIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glMateriali (GLenum face, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glMaterialiv (GLenum face, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glMatrixMode (GLenum mode); +GLAPI void GLAPIENTRY glMultMatrixd (const GLdouble *m); +GLAPI void GLAPIENTRY glMultMatrixf (const GLfloat *m); +GLAPI void GLAPIENTRY glNewList (GLuint list, GLenum mode); +GLAPI void GLAPIENTRY glNormal3b (GLbyte nx, GLbyte ny, GLbyte nz); +GLAPI void GLAPIENTRY glNormal3bv (const GLbyte *v); +GLAPI void GLAPIENTRY glNormal3d (GLdouble nx, GLdouble ny, GLdouble nz); +GLAPI void GLAPIENTRY glNormal3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz); +GLAPI void GLAPIENTRY glNormal3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glNormal3i (GLint nx, GLint ny, GLint nz); +GLAPI void GLAPIENTRY glNormal3iv (const GLint *v); +GLAPI void GLAPIENTRY glNormal3s (GLshort nx, GLshort ny, GLshort nz); +GLAPI void GLAPIENTRY glNormal3sv (const GLshort *v); +GLAPI void GLAPIENTRY glNormalPointer (GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glOrtho (GLdouble left, GLdouble right, GLdouble bottom, GLdouble top, GLdouble zNear, GLdouble zFar); +GLAPI void GLAPIENTRY glPassThrough (GLfloat token); +GLAPI void GLAPIENTRY glPixelMapfv (GLenum map, GLsizei mapsize, const GLfloat *values); +GLAPI void GLAPIENTRY glPixelMapuiv (GLenum map, GLsizei mapsize, const GLuint *values); +GLAPI void GLAPIENTRY glPixelMapusv (GLenum map, GLsizei mapsize, const GLushort *values); +GLAPI void GLAPIENTRY glPixelStoref (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelStorei (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelTransferf (GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glPixelTransferi (GLenum pname, GLint param); +GLAPI void GLAPIENTRY glPixelZoom (GLfloat xfactor, GLfloat yfactor); +GLAPI void GLAPIENTRY glPointSize (GLfloat size); +GLAPI void GLAPIENTRY glPolygonMode (GLenum face, GLenum mode); +GLAPI void GLAPIENTRY glPolygonOffset (GLfloat factor, GLfloat units); +GLAPI void GLAPIENTRY glPolygonStipple (const GLubyte *mask); +GLAPI void GLAPIENTRY glPopAttrib (void); +GLAPI void GLAPIENTRY glPopClientAttrib (void); +GLAPI void GLAPIENTRY glPopMatrix (void); +GLAPI void GLAPIENTRY glPopName (void); +GLAPI void GLAPIENTRY glPrioritizeTextures (GLsizei n, const GLuint *textures, const GLclampf *priorities); +GLAPI void GLAPIENTRY glPushAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushClientAttrib (GLbitfield mask); +GLAPI void GLAPIENTRY glPushMatrix (void); +GLAPI void GLAPIENTRY glPushName (GLuint name); +GLAPI void GLAPIENTRY glRasterPos2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glRasterPos2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glRasterPos2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glRasterPos2iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glRasterPos2sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRasterPos3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glRasterPos3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glRasterPos3iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glRasterPos3sv (const GLshort *v); +GLAPI void GLAPIENTRY glRasterPos4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glRasterPos4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glRasterPos4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glRasterPos4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glRasterPos4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glRasterPos4iv (const GLint *v); +GLAPI void GLAPIENTRY glRasterPos4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glRasterPos4sv (const GLshort *v); +GLAPI void GLAPIENTRY glReadBuffer (GLenum mode); +GLAPI void GLAPIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels); +GLAPI void GLAPIENTRY glRectd (GLdouble x1, GLdouble y1, GLdouble x2, GLdouble y2); +GLAPI void GLAPIENTRY glRectdv (const GLdouble *v1, const GLdouble *v2); +GLAPI void GLAPIENTRY glRectf (GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2); +GLAPI void GLAPIENTRY glRectfv (const GLfloat *v1, const GLfloat *v2); +GLAPI void GLAPIENTRY glRecti (GLint x1, GLint y1, GLint x2, GLint y2); +GLAPI void GLAPIENTRY glRectiv (const GLint *v1, const GLint *v2); +GLAPI void GLAPIENTRY glRects (GLshort x1, GLshort y1, GLshort x2, GLshort y2); +GLAPI void GLAPIENTRY glRectsv (const GLshort *v1, const GLshort *v2); +GLAPI GLint GLAPIENTRY glRenderMode (GLenum mode); +GLAPI void GLAPIENTRY glRotated (GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScaled (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height); +GLAPI void GLAPIENTRY glSelectBuffer (GLsizei size, GLuint *buffer); +GLAPI void GLAPIENTRY glShadeModel (GLenum mode); +GLAPI void GLAPIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask); +GLAPI void GLAPIENTRY glStencilMask (GLuint mask); +GLAPI void GLAPIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass); +GLAPI void GLAPIENTRY glTexCoord1d (GLdouble s); +GLAPI void GLAPIENTRY glTexCoord1dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord1f (GLfloat s); +GLAPI void GLAPIENTRY glTexCoord1fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord1i (GLint s); +GLAPI void GLAPIENTRY glTexCoord1iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord1s (GLshort s); +GLAPI void GLAPIENTRY glTexCoord1sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord2d (GLdouble s, GLdouble t); +GLAPI void GLAPIENTRY glTexCoord2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord2f (GLfloat s, GLfloat t); +GLAPI void GLAPIENTRY glTexCoord2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord2i (GLint s, GLint t); +GLAPI void GLAPIENTRY glTexCoord2iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord2s (GLshort s, GLshort t); +GLAPI void GLAPIENTRY glTexCoord2sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord3d (GLdouble s, GLdouble t, GLdouble r); +GLAPI void GLAPIENTRY glTexCoord3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord3f (GLfloat s, GLfloat t, GLfloat r); +GLAPI void GLAPIENTRY glTexCoord3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord3i (GLint s, GLint t, GLint r); +GLAPI void GLAPIENTRY glTexCoord3iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord3s (GLshort s, GLshort t, GLshort r); +GLAPI void GLAPIENTRY glTexCoord3sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoord4d (GLdouble s, GLdouble t, GLdouble r, GLdouble q); +GLAPI void GLAPIENTRY glTexCoord4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glTexCoord4f (GLfloat s, GLfloat t, GLfloat r, GLfloat q); +GLAPI void GLAPIENTRY glTexCoord4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glTexCoord4i (GLint s, GLint t, GLint r, GLint q); +GLAPI void GLAPIENTRY glTexCoord4iv (const GLint *v); +GLAPI void GLAPIENTRY glTexCoord4s (GLshort s, GLshort t, GLshort r, GLshort q); +GLAPI void GLAPIENTRY glTexCoord4sv (const GLshort *v); +GLAPI void GLAPIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexGend (GLenum coord, GLenum pname, GLdouble param); +GLAPI void GLAPIENTRY glTexGendv (GLenum coord, GLenum pname, const GLdouble *params); +GLAPI void GLAPIENTRY glTexGenf (GLenum coord, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexGenfv (GLenum coord, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexGeni (GLenum coord, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexGeniv (GLenum coord, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexImage1D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param); +GLAPI void GLAPIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params); +GLAPI void GLAPIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param); +GLAPI void GLAPIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params); +GLAPI void GLAPIENTRY glTexSubImage1D (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); +GLAPI void GLAPIENTRY glTranslated (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex2d (GLdouble x, GLdouble y); +GLAPI void GLAPIENTRY glVertex2dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex2f (GLfloat x, GLfloat y); +GLAPI void GLAPIENTRY glVertex2fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex2i (GLint x, GLint y); +GLAPI void GLAPIENTRY glVertex2iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex2s (GLshort x, GLshort y); +GLAPI void GLAPIENTRY glVertex2sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex3d (GLdouble x, GLdouble y, GLdouble z); +GLAPI void GLAPIENTRY glVertex3dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex3f (GLfloat x, GLfloat y, GLfloat z); +GLAPI void GLAPIENTRY glVertex3fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex3i (GLint x, GLint y, GLint z); +GLAPI void GLAPIENTRY glVertex3iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex3s (GLshort x, GLshort y, GLshort z); +GLAPI void GLAPIENTRY glVertex3sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertex4d (GLdouble x, GLdouble y, GLdouble z, GLdouble w); +GLAPI void GLAPIENTRY glVertex4dv (const GLdouble *v); +GLAPI void GLAPIENTRY glVertex4f (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +GLAPI void GLAPIENTRY glVertex4fv (const GLfloat *v); +GLAPI void GLAPIENTRY glVertex4i (GLint x, GLint y, GLint z, GLint w); +GLAPI void GLAPIENTRY glVertex4iv (const GLint *v); +GLAPI void GLAPIENTRY glVertex4s (GLshort x, GLshort y, GLshort z, GLshort w); +GLAPI void GLAPIENTRY glVertex4sv (const GLshort *v); +GLAPI void GLAPIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +GLAPI void GLAPIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height); + +#define GLEW_VERSION_1_1 GLEW_GET_VAR(__GLEW_VERSION_1_1) + +#endif /* GL_VERSION_1_1 */ + +/* ---------------------------------- GLU ---------------------------------- */ + +/* this is where we can safely include GLU */ +#if defined(__APPLE__) && defined(__MACH__) +#include +#else +#include +#endif + +/* ----------------------------- GL_VERSION_1_2 ---------------------------- */ + +#ifndef GL_VERSION_1_2 +#define GL_VERSION_1_2 1 + +#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 +#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 +#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 +#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 +#define GL_UNSIGNED_BYTE_3_3_2 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2 0x8036 +#define GL_RESCALE_NORMAL 0x803A +#define GL_TEXTURE_BINDING_3D 0x806A +#define GL_PACK_SKIP_IMAGES 0x806B +#define GL_PACK_IMAGE_HEIGHT 0x806C +#define GL_UNPACK_SKIP_IMAGES 0x806D +#define GL_UNPACK_IMAGE_HEIGHT 0x806E +#define GL_TEXTURE_3D 0x806F +#define GL_PROXY_TEXTURE_3D 0x8070 +#define GL_TEXTURE_DEPTH 0x8071 +#define GL_TEXTURE_WRAP_R 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE 0x8073 +#define GL_BGR 0x80E0 +#define GL_BGRA 0x80E1 +#define GL_MAX_ELEMENTS_VERTICES 0x80E8 +#define GL_MAX_ELEMENTS_INDICES 0x80E9 +#define GL_CLAMP_TO_EDGE 0x812F +#define GL_TEXTURE_MIN_LOD 0x813A +#define GL_TEXTURE_MAX_LOD 0x813B +#define GL_TEXTURE_BASE_LEVEL 0x813C +#define GL_TEXTURE_MAX_LEVEL 0x813D +#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 +#define GL_SINGLE_COLOR 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR 0x81FA +#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 +#define GL_UNSIGNED_SHORT_5_6_5 0x8363 +#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 +#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 +#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 +#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_ALIASED_POINT_SIZE_RANGE 0x846D +#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E + +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); + +#define glCopyTexSubImage3D GLEW_GET_FUN(__glewCopyTexSubImage3D) +#define glDrawRangeElements GLEW_GET_FUN(__glewDrawRangeElements) +#define glTexImage3D GLEW_GET_FUN(__glewTexImage3D) +#define glTexSubImage3D GLEW_GET_FUN(__glewTexSubImage3D) + +#define GLEW_VERSION_1_2 GLEW_GET_VAR(__GLEW_VERSION_1_2) + +#endif /* GL_VERSION_1_2 */ + +/* ---------------------------- GL_VERSION_1_2_1 --------------------------- */ + +#ifndef GL_VERSION_1_2_1 +#define GL_VERSION_1_2_1 1 + +#define GLEW_VERSION_1_2_1 GLEW_GET_VAR(__GLEW_VERSION_1_2_1) + +#endif /* GL_VERSION_1_2_1 */ + +/* ----------------------------- GL_VERSION_1_3 ---------------------------- */ + +#ifndef GL_VERSION_1_3 +#define GL_VERSION_1_3 1 + +#define GL_MULTISAMPLE 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE 0x809F +#define GL_SAMPLE_COVERAGE 0x80A0 +#define GL_SAMPLE_BUFFERS 0x80A8 +#define GL_SAMPLES 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT 0x80AB +#define GL_CLAMP_TO_BORDER 0x812D +#define GL_TEXTURE0 0x84C0 +#define GL_TEXTURE1 0x84C1 +#define GL_TEXTURE2 0x84C2 +#define GL_TEXTURE3 0x84C3 +#define GL_TEXTURE4 0x84C4 +#define GL_TEXTURE5 0x84C5 +#define GL_TEXTURE6 0x84C6 +#define GL_TEXTURE7 0x84C7 +#define GL_TEXTURE8 0x84C8 +#define GL_TEXTURE9 0x84C9 +#define GL_TEXTURE10 0x84CA +#define GL_TEXTURE11 0x84CB +#define GL_TEXTURE12 0x84CC +#define GL_TEXTURE13 0x84CD +#define GL_TEXTURE14 0x84CE +#define GL_TEXTURE15 0x84CF +#define GL_TEXTURE16 0x84D0 +#define GL_TEXTURE17 0x84D1 +#define GL_TEXTURE18 0x84D2 +#define GL_TEXTURE19 0x84D3 +#define GL_TEXTURE20 0x84D4 +#define GL_TEXTURE21 0x84D5 +#define GL_TEXTURE22 0x84D6 +#define GL_TEXTURE23 0x84D7 +#define GL_TEXTURE24 0x84D8 +#define GL_TEXTURE25 0x84D9 +#define GL_TEXTURE26 0x84DA +#define GL_TEXTURE27 0x84DB +#define GL_TEXTURE28 0x84DC +#define GL_TEXTURE29 0x84DD +#define GL_TEXTURE30 0x84DE +#define GL_TEXTURE31 0x84DF +#define GL_ACTIVE_TEXTURE 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 +#define GL_MAX_TEXTURE_UNITS 0x84E2 +#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 +#define GL_SUBTRACT 0x84E7 +#define GL_COMPRESSED_ALPHA 0x84E9 +#define GL_COMPRESSED_LUMINANCE 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB +#define GL_COMPRESSED_INTENSITY 0x84EC +#define GL_COMPRESSED_RGB 0x84ED +#define GL_COMPRESSED_RGBA 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT 0x84EF +#define GL_NORMAL_MAP 0x8511 +#define GL_REFLECTION_MAP 0x8512 +#define GL_TEXTURE_CUBE_MAP 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C +#define GL_COMBINE 0x8570 +#define GL_COMBINE_RGB 0x8571 +#define GL_COMBINE_ALPHA 0x8572 +#define GL_RGB_SCALE 0x8573 +#define GL_ADD_SIGNED 0x8574 +#define GL_INTERPOLATE 0x8575 +#define GL_CONSTANT 0x8576 +#define GL_PRIMARY_COLOR 0x8577 +#define GL_PREVIOUS 0x8578 +#define GL_SOURCE0_RGB 0x8580 +#define GL_SOURCE1_RGB 0x8581 +#define GL_SOURCE2_RGB 0x8582 +#define GL_SOURCE0_ALPHA 0x8588 +#define GL_SOURCE1_ALPHA 0x8589 +#define GL_SOURCE2_ALPHA 0x858A +#define GL_OPERAND0_RGB 0x8590 +#define GL_OPERAND1_RGB 0x8591 +#define GL_OPERAND2_RGB 0x8592 +#define GL_OPERAND0_ALPHA 0x8598 +#define GL_OPERAND1_ALPHA 0x8599 +#define GL_OPERAND2_ALPHA 0x859A +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 +#define GL_TEXTURE_COMPRESSED 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 +#define GL_DOT3_RGB 0x86AE +#define GL_DOT3_RGBA 0x86AF +#define GL_MULTISAMPLE_BIT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint lod, GLvoid *img); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); + +#define glActiveTexture GLEW_GET_FUN(__glewActiveTexture) +#define glClientActiveTexture GLEW_GET_FUN(__glewClientActiveTexture) +#define glCompressedTexImage1D GLEW_GET_FUN(__glewCompressedTexImage1D) +#define glCompressedTexImage2D GLEW_GET_FUN(__glewCompressedTexImage2D) +#define glCompressedTexImage3D GLEW_GET_FUN(__glewCompressedTexImage3D) +#define glCompressedTexSubImage1D GLEW_GET_FUN(__glewCompressedTexSubImage1D) +#define glCompressedTexSubImage2D GLEW_GET_FUN(__glewCompressedTexSubImage2D) +#define glCompressedTexSubImage3D GLEW_GET_FUN(__glewCompressedTexSubImage3D) +#define glGetCompressedTexImage GLEW_GET_FUN(__glewGetCompressedTexImage) +#define glLoadTransposeMatrixd GLEW_GET_FUN(__glewLoadTransposeMatrixd) +#define glLoadTransposeMatrixf GLEW_GET_FUN(__glewLoadTransposeMatrixf) +#define glMultTransposeMatrixd GLEW_GET_FUN(__glewMultTransposeMatrixd) +#define glMultTransposeMatrixf GLEW_GET_FUN(__glewMultTransposeMatrixf) +#define glMultiTexCoord1d GLEW_GET_FUN(__glewMultiTexCoord1d) +#define glMultiTexCoord1dv GLEW_GET_FUN(__glewMultiTexCoord1dv) +#define glMultiTexCoord1f GLEW_GET_FUN(__glewMultiTexCoord1f) +#define glMultiTexCoord1fv GLEW_GET_FUN(__glewMultiTexCoord1fv) +#define glMultiTexCoord1i GLEW_GET_FUN(__glewMultiTexCoord1i) +#define glMultiTexCoord1iv GLEW_GET_FUN(__glewMultiTexCoord1iv) +#define glMultiTexCoord1s GLEW_GET_FUN(__glewMultiTexCoord1s) +#define glMultiTexCoord1sv GLEW_GET_FUN(__glewMultiTexCoord1sv) +#define glMultiTexCoord2d GLEW_GET_FUN(__glewMultiTexCoord2d) +#define glMultiTexCoord2dv GLEW_GET_FUN(__glewMultiTexCoord2dv) +#define glMultiTexCoord2f GLEW_GET_FUN(__glewMultiTexCoord2f) +#define glMultiTexCoord2fv GLEW_GET_FUN(__glewMultiTexCoord2fv) +#define glMultiTexCoord2i GLEW_GET_FUN(__glewMultiTexCoord2i) +#define glMultiTexCoord2iv GLEW_GET_FUN(__glewMultiTexCoord2iv) +#define glMultiTexCoord2s GLEW_GET_FUN(__glewMultiTexCoord2s) +#define glMultiTexCoord2sv GLEW_GET_FUN(__glewMultiTexCoord2sv) +#define glMultiTexCoord3d GLEW_GET_FUN(__glewMultiTexCoord3d) +#define glMultiTexCoord3dv GLEW_GET_FUN(__glewMultiTexCoord3dv) +#define glMultiTexCoord3f GLEW_GET_FUN(__glewMultiTexCoord3f) +#define glMultiTexCoord3fv GLEW_GET_FUN(__glewMultiTexCoord3fv) +#define glMultiTexCoord3i GLEW_GET_FUN(__glewMultiTexCoord3i) +#define glMultiTexCoord3iv GLEW_GET_FUN(__glewMultiTexCoord3iv) +#define glMultiTexCoord3s GLEW_GET_FUN(__glewMultiTexCoord3s) +#define glMultiTexCoord3sv GLEW_GET_FUN(__glewMultiTexCoord3sv) +#define glMultiTexCoord4d GLEW_GET_FUN(__glewMultiTexCoord4d) +#define glMultiTexCoord4dv GLEW_GET_FUN(__glewMultiTexCoord4dv) +#define glMultiTexCoord4f GLEW_GET_FUN(__glewMultiTexCoord4f) +#define glMultiTexCoord4fv GLEW_GET_FUN(__glewMultiTexCoord4fv) +#define glMultiTexCoord4i GLEW_GET_FUN(__glewMultiTexCoord4i) +#define glMultiTexCoord4iv GLEW_GET_FUN(__glewMultiTexCoord4iv) +#define glMultiTexCoord4s GLEW_GET_FUN(__glewMultiTexCoord4s) +#define glMultiTexCoord4sv GLEW_GET_FUN(__glewMultiTexCoord4sv) +#define glSampleCoverage GLEW_GET_FUN(__glewSampleCoverage) + +#define GLEW_VERSION_1_3 GLEW_GET_VAR(__GLEW_VERSION_1_3) + +#endif /* GL_VERSION_1_3 */ + +/* ----------------------------- GL_VERSION_1_4 ---------------------------- */ + +#ifndef GL_VERSION_1_4 +#define GL_VERSION_1_4 1 + +#define GL_BLEND_DST_RGB 0x80C8 +#define GL_BLEND_SRC_RGB 0x80C9 +#define GL_BLEND_DST_ALPHA 0x80CA +#define GL_BLEND_SRC_ALPHA 0x80CB +#define GL_POINT_SIZE_MIN 0x8126 +#define GL_POINT_SIZE_MAX 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION 0x8129 +#define GL_GENERATE_MIPMAP 0x8191 +#define GL_GENERATE_MIPMAP_HINT 0x8192 +#define GL_DEPTH_COMPONENT16 0x81A5 +#define GL_DEPTH_COMPONENT24 0x81A6 +#define GL_DEPTH_COMPONENT32 0x81A7 +#define GL_MIRRORED_REPEAT 0x8370 +#define GL_FOG_COORDINATE_SOURCE 0x8450 +#define GL_FOG_COORDINATE 0x8451 +#define GL_FRAGMENT_DEPTH 0x8452 +#define GL_CURRENT_FOG_COORDINATE 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 +#define GL_FOG_COORDINATE_ARRAY 0x8457 +#define GL_COLOR_SUM 0x8458 +#define GL_CURRENT_SECONDARY_COLOR 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D +#define GL_SECONDARY_COLOR_ARRAY 0x845E +#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD +#define GL_TEXTURE_FILTER_CONTROL 0x8500 +#define GL_TEXTURE_LOD_BIAS 0x8501 +#define GL_INCR_WRAP 0x8507 +#define GL_DECR_WRAP 0x8508 +#define GL_TEXTURE_DEPTH_SIZE 0x884A +#define GL_DEPTH_TEXTURE_MODE 0x884B +#define GL_TEXTURE_COMPARE_MODE 0x884C +#define GL_TEXTURE_COMPARE_FUNC 0x884D +#define GL_COMPARE_R_TO_TEXTURE 0x884E + +typedef void (GLAPIENTRY * PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVPROC) (const GLfloat *coord); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVPROC) (const GLshort *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVPROC) (const GLdouble *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVPROC) (const GLfloat *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVPROC) (const GLint *p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVPROC) (const GLshort *p); + +#define glBlendColor GLEW_GET_FUN(__glewBlendColor) +#define glBlendEquation GLEW_GET_FUN(__glewBlendEquation) +#define glBlendFuncSeparate GLEW_GET_FUN(__glewBlendFuncSeparate) +#define glFogCoordPointer GLEW_GET_FUN(__glewFogCoordPointer) +#define glFogCoordd GLEW_GET_FUN(__glewFogCoordd) +#define glFogCoorddv GLEW_GET_FUN(__glewFogCoorddv) +#define glFogCoordf GLEW_GET_FUN(__glewFogCoordf) +#define glFogCoordfv GLEW_GET_FUN(__glewFogCoordfv) +#define glMultiDrawArrays GLEW_GET_FUN(__glewMultiDrawArrays) +#define glMultiDrawElements GLEW_GET_FUN(__glewMultiDrawElements) +#define glPointParameterf GLEW_GET_FUN(__glewPointParameterf) +#define glPointParameterfv GLEW_GET_FUN(__glewPointParameterfv) +#define glPointParameteri GLEW_GET_FUN(__glewPointParameteri) +#define glPointParameteriv GLEW_GET_FUN(__glewPointParameteriv) +#define glSecondaryColor3b GLEW_GET_FUN(__glewSecondaryColor3b) +#define glSecondaryColor3bv GLEW_GET_FUN(__glewSecondaryColor3bv) +#define glSecondaryColor3d GLEW_GET_FUN(__glewSecondaryColor3d) +#define glSecondaryColor3dv GLEW_GET_FUN(__glewSecondaryColor3dv) +#define glSecondaryColor3f GLEW_GET_FUN(__glewSecondaryColor3f) +#define glSecondaryColor3fv GLEW_GET_FUN(__glewSecondaryColor3fv) +#define glSecondaryColor3i GLEW_GET_FUN(__glewSecondaryColor3i) +#define glSecondaryColor3iv GLEW_GET_FUN(__glewSecondaryColor3iv) +#define glSecondaryColor3s GLEW_GET_FUN(__glewSecondaryColor3s) +#define glSecondaryColor3sv GLEW_GET_FUN(__glewSecondaryColor3sv) +#define glSecondaryColor3ub GLEW_GET_FUN(__glewSecondaryColor3ub) +#define glSecondaryColor3ubv GLEW_GET_FUN(__glewSecondaryColor3ubv) +#define glSecondaryColor3ui GLEW_GET_FUN(__glewSecondaryColor3ui) +#define glSecondaryColor3uiv GLEW_GET_FUN(__glewSecondaryColor3uiv) +#define glSecondaryColor3us GLEW_GET_FUN(__glewSecondaryColor3us) +#define glSecondaryColor3usv GLEW_GET_FUN(__glewSecondaryColor3usv) +#define glSecondaryColorPointer GLEW_GET_FUN(__glewSecondaryColorPointer) +#define glWindowPos2d GLEW_GET_FUN(__glewWindowPos2d) +#define glWindowPos2dv GLEW_GET_FUN(__glewWindowPos2dv) +#define glWindowPos2f GLEW_GET_FUN(__glewWindowPos2f) +#define glWindowPos2fv GLEW_GET_FUN(__glewWindowPos2fv) +#define glWindowPos2i GLEW_GET_FUN(__glewWindowPos2i) +#define glWindowPos2iv GLEW_GET_FUN(__glewWindowPos2iv) +#define glWindowPos2s GLEW_GET_FUN(__glewWindowPos2s) +#define glWindowPos2sv GLEW_GET_FUN(__glewWindowPos2sv) +#define glWindowPos3d GLEW_GET_FUN(__glewWindowPos3d) +#define glWindowPos3dv GLEW_GET_FUN(__glewWindowPos3dv) +#define glWindowPos3f GLEW_GET_FUN(__glewWindowPos3f) +#define glWindowPos3fv GLEW_GET_FUN(__glewWindowPos3fv) +#define glWindowPos3i GLEW_GET_FUN(__glewWindowPos3i) +#define glWindowPos3iv GLEW_GET_FUN(__glewWindowPos3iv) +#define glWindowPos3s GLEW_GET_FUN(__glewWindowPos3s) +#define glWindowPos3sv GLEW_GET_FUN(__glewWindowPos3sv) + +#define GLEW_VERSION_1_4 GLEW_GET_VAR(__GLEW_VERSION_1_4) + +#endif /* GL_VERSION_1_4 */ + +/* ----------------------------- GL_VERSION_1_5 ---------------------------- */ + +#ifndef GL_VERSION_1_5 +#define GL_VERSION_1_5 1 + +#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE +#define GL_FOG_COORD GL_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY +#define GL_SRC0_RGB GL_SOURCE0_RGB +#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER +#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE +#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA +#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE +#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE +#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA +#define GL_SRC1_RGB GL_SOURCE1_RGB +#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING +#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA +#define GL_SRC2_RGB GL_SOURCE2_RGB +#define GL_BUFFER_SIZE 0x8764 +#define GL_BUFFER_USAGE 0x8765 +#define GL_QUERY_COUNTER_BITS 0x8864 +#define GL_CURRENT_QUERY 0x8865 +#define GL_QUERY_RESULT 0x8866 +#define GL_QUERY_RESULT_AVAILABLE 0x8867 +#define GL_ARRAY_BUFFER 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER 0x8893 +#define GL_ARRAY_BUFFER_BINDING 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F +#define GL_READ_ONLY 0x88B8 +#define GL_WRITE_ONLY 0x88B9 +#define GL_READ_WRITE 0x88BA +#define GL_BUFFER_ACCESS 0x88BB +#define GL_BUFFER_MAPPED 0x88BC +#define GL_BUFFER_MAP_POINTER 0x88BD +#define GL_STREAM_DRAW 0x88E0 +#define GL_STREAM_READ 0x88E1 +#define GL_STREAM_COPY 0x88E2 +#define GL_STATIC_DRAW 0x88E4 +#define GL_STATIC_READ 0x88E5 +#define GL_STATIC_COPY 0x88E6 +#define GL_DYNAMIC_DRAW 0x88E8 +#define GL_DYNAMIC_READ 0x88E9 +#define GL_DYNAMIC_COPY 0x88EA +#define GL_SAMPLES_PASSED 0x8914 + +typedef ptrdiff_t GLintptr; +typedef ptrdiff_t GLsizeiptr; + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENQUERIESPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid* data); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERPROC) (GLuint buffer); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYPROC) (GLuint id); +typedef GLvoid* (GLAPIENTRY * PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERPROC) (GLenum target); + +#define glBeginQuery GLEW_GET_FUN(__glewBeginQuery) +#define glBindBuffer GLEW_GET_FUN(__glewBindBuffer) +#define glBufferData GLEW_GET_FUN(__glewBufferData) +#define glBufferSubData GLEW_GET_FUN(__glewBufferSubData) +#define glDeleteBuffers GLEW_GET_FUN(__glewDeleteBuffers) +#define glDeleteQueries GLEW_GET_FUN(__glewDeleteQueries) +#define glEndQuery GLEW_GET_FUN(__glewEndQuery) +#define glGenBuffers GLEW_GET_FUN(__glewGenBuffers) +#define glGenQueries GLEW_GET_FUN(__glewGenQueries) +#define glGetBufferParameteriv GLEW_GET_FUN(__glewGetBufferParameteriv) +#define glGetBufferPointerv GLEW_GET_FUN(__glewGetBufferPointerv) +#define glGetBufferSubData GLEW_GET_FUN(__glewGetBufferSubData) +#define glGetQueryObjectiv GLEW_GET_FUN(__glewGetQueryObjectiv) +#define glGetQueryObjectuiv GLEW_GET_FUN(__glewGetQueryObjectuiv) +#define glGetQueryiv GLEW_GET_FUN(__glewGetQueryiv) +#define glIsBuffer GLEW_GET_FUN(__glewIsBuffer) +#define glIsQuery GLEW_GET_FUN(__glewIsQuery) +#define glMapBuffer GLEW_GET_FUN(__glewMapBuffer) +#define glUnmapBuffer GLEW_GET_FUN(__glewUnmapBuffer) + +#define GLEW_VERSION_1_5 GLEW_GET_VAR(__GLEW_VERSION_1_5) + +#endif /* GL_VERSION_1_5 */ + +/* ----------------------------- GL_VERSION_2_0 ---------------------------- */ + +#ifndef GL_VERSION_2_0 +#define GL_VERSION_2_0 1 + +#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB 0x8626 +#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 +#define GL_STENCIL_BACK_FUNC 0x8800 +#define GL_STENCIL_BACK_FAIL 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 +#define GL_MAX_DRAW_BUFFERS 0x8824 +#define GL_DRAW_BUFFER0 0x8825 +#define GL_DRAW_BUFFER1 0x8826 +#define GL_DRAW_BUFFER2 0x8827 +#define GL_DRAW_BUFFER3 0x8828 +#define GL_DRAW_BUFFER4 0x8829 +#define GL_DRAW_BUFFER5 0x882A +#define GL_DRAW_BUFFER6 0x882B +#define GL_DRAW_BUFFER7 0x882C +#define GL_DRAW_BUFFER8 0x882D +#define GL_DRAW_BUFFER9 0x882E +#define GL_DRAW_BUFFER10 0x882F +#define GL_DRAW_BUFFER11 0x8830 +#define GL_DRAW_BUFFER12 0x8831 +#define GL_DRAW_BUFFER13 0x8832 +#define GL_DRAW_BUFFER14 0x8833 +#define GL_DRAW_BUFFER15 0x8834 +#define GL_BLEND_EQUATION_ALPHA 0x883D +#define GL_POINT_SPRITE 0x8861 +#define GL_COORD_REPLACE 0x8862 +#define GL_MAX_VERTEX_ATTRIBS 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A +#define GL_MAX_TEXTURE_COORDS 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 +#define GL_FRAGMENT_SHADER 0x8B30 +#define GL_VERTEX_SHADER 0x8B31 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A +#define GL_MAX_VARYING_FLOATS 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D +#define GL_SHADER_TYPE 0x8B4F +#define GL_FLOAT_VEC2 0x8B50 +#define GL_FLOAT_VEC3 0x8B51 +#define GL_FLOAT_VEC4 0x8B52 +#define GL_INT_VEC2 0x8B53 +#define GL_INT_VEC3 0x8B54 +#define GL_INT_VEC4 0x8B55 +#define GL_BOOL 0x8B56 +#define GL_BOOL_VEC2 0x8B57 +#define GL_BOOL_VEC3 0x8B58 +#define GL_BOOL_VEC4 0x8B59 +#define GL_FLOAT_MAT2 0x8B5A +#define GL_FLOAT_MAT3 0x8B5B +#define GL_FLOAT_MAT4 0x8B5C +#define GL_SAMPLER_1D 0x8B5D +#define GL_SAMPLER_2D 0x8B5E +#define GL_SAMPLER_3D 0x8B5F +#define GL_SAMPLER_CUBE 0x8B60 +#define GL_SAMPLER_1D_SHADOW 0x8B61 +#define GL_SAMPLER_2D_SHADOW 0x8B62 +#define GL_DELETE_STATUS 0x8B80 +#define GL_COMPILE_STATUS 0x8B81 +#define GL_LINK_STATUS 0x8B82 +#define GL_VALIDATE_STATUS 0x8B83 +#define GL_INFO_LOG_LENGTH 0x8B84 +#define GL_ATTACHED_SHADERS 0x8B85 +#define GL_ACTIVE_UNIFORMS 0x8B86 +#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 +#define GL_SHADER_SOURCE_LENGTH 0x8B88 +#define GL_ACTIVE_ATTRIBUTES 0x8B89 +#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B +#define GL_SHADING_LANGUAGE_VERSION 0x8B8C +#define GL_CURRENT_PROGRAM 0x8B8D +#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 +#define GL_LOWER_LEFT 0x8CA1 +#define GL_UPPER_LEFT 0x8CA2 +#define GL_STENCIL_BACK_REF 0x8CA3 +#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 +#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 + +typedef void (GLAPIENTRY * PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERPROC) (GLuint shader); +typedef GLuint (GLAPIENTRY * PFNGLCREATEPROGRAMPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROC) (GLenum type); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETESHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei maxLength, GLsizei* length, GLint* size, GLenum* type, GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei* count, GLuint* shaders); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei* length, GLchar* infoLog); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEPROC) (GLuint obj, GLsizei maxLength, GLsizei* length, GLchar* source); +typedef void (GLAPIENTRY * PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint* param); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint, GLenum, GLvoid**); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVPROC) (GLuint, GLenum, GLdouble*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVPROC) (GLuint, GLenum, GLfloat*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVPROC) (GLuint, GLenum, GLint*); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPROC) (GLuint program); +typedef GLboolean (GLAPIENTRY * PFNGLISSHADERPROC) (GLuint shader); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar** strings, const GLint* lengths); +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILMASKSEPARATEPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid* pointer); + +#define glAttachShader GLEW_GET_FUN(__glewAttachShader) +#define glBindAttribLocation GLEW_GET_FUN(__glewBindAttribLocation) +#define glBlendEquationSeparate GLEW_GET_FUN(__glewBlendEquationSeparate) +#define glCompileShader GLEW_GET_FUN(__glewCompileShader) +#define glCreateProgram GLEW_GET_FUN(__glewCreateProgram) +#define glCreateShader GLEW_GET_FUN(__glewCreateShader) +#define glDeleteProgram GLEW_GET_FUN(__glewDeleteProgram) +#define glDeleteShader GLEW_GET_FUN(__glewDeleteShader) +#define glDetachShader GLEW_GET_FUN(__glewDetachShader) +#define glDisableVertexAttribArray GLEW_GET_FUN(__glewDisableVertexAttribArray) +#define glDrawBuffers GLEW_GET_FUN(__glewDrawBuffers) +#define glEnableVertexAttribArray GLEW_GET_FUN(__glewEnableVertexAttribArray) +#define glGetActiveAttrib GLEW_GET_FUN(__glewGetActiveAttrib) +#define glGetActiveUniform GLEW_GET_FUN(__glewGetActiveUniform) +#define glGetAttachedShaders GLEW_GET_FUN(__glewGetAttachedShaders) +#define glGetAttribLocation GLEW_GET_FUN(__glewGetAttribLocation) +#define glGetProgramInfoLog GLEW_GET_FUN(__glewGetProgramInfoLog) +#define glGetProgramiv GLEW_GET_FUN(__glewGetProgramiv) +#define glGetShaderInfoLog GLEW_GET_FUN(__glewGetShaderInfoLog) +#define glGetShaderSource GLEW_GET_FUN(__glewGetShaderSource) +#define glGetShaderiv GLEW_GET_FUN(__glewGetShaderiv) +#define glGetUniformLocation GLEW_GET_FUN(__glewGetUniformLocation) +#define glGetUniformfv GLEW_GET_FUN(__glewGetUniformfv) +#define glGetUniformiv GLEW_GET_FUN(__glewGetUniformiv) +#define glGetVertexAttribPointerv GLEW_GET_FUN(__glewGetVertexAttribPointerv) +#define glGetVertexAttribdv GLEW_GET_FUN(__glewGetVertexAttribdv) +#define glGetVertexAttribfv GLEW_GET_FUN(__glewGetVertexAttribfv) +#define glGetVertexAttribiv GLEW_GET_FUN(__glewGetVertexAttribiv) +#define glIsProgram GLEW_GET_FUN(__glewIsProgram) +#define glIsShader GLEW_GET_FUN(__glewIsShader) +#define glLinkProgram GLEW_GET_FUN(__glewLinkProgram) +#define glShaderSource GLEW_GET_FUN(__glewShaderSource) +#define glStencilFuncSeparate GLEW_GET_FUN(__glewStencilFuncSeparate) +#define glStencilMaskSeparate GLEW_GET_FUN(__glewStencilMaskSeparate) +#define glStencilOpSeparate GLEW_GET_FUN(__glewStencilOpSeparate) +#define glUniform1f GLEW_GET_FUN(__glewUniform1f) +#define glUniform1fv GLEW_GET_FUN(__glewUniform1fv) +#define glUniform1i GLEW_GET_FUN(__glewUniform1i) +#define glUniform1iv GLEW_GET_FUN(__glewUniform1iv) +#define glUniform2f GLEW_GET_FUN(__glewUniform2f) +#define glUniform2fv GLEW_GET_FUN(__glewUniform2fv) +#define glUniform2i GLEW_GET_FUN(__glewUniform2i) +#define glUniform2iv GLEW_GET_FUN(__glewUniform2iv) +#define glUniform3f GLEW_GET_FUN(__glewUniform3f) +#define glUniform3fv GLEW_GET_FUN(__glewUniform3fv) +#define glUniform3i GLEW_GET_FUN(__glewUniform3i) +#define glUniform3iv GLEW_GET_FUN(__glewUniform3iv) +#define glUniform4f GLEW_GET_FUN(__glewUniform4f) +#define glUniform4fv GLEW_GET_FUN(__glewUniform4fv) +#define glUniform4i GLEW_GET_FUN(__glewUniform4i) +#define glUniform4iv GLEW_GET_FUN(__glewUniform4iv) +#define glUniformMatrix2fv GLEW_GET_FUN(__glewUniformMatrix2fv) +#define glUniformMatrix3fv GLEW_GET_FUN(__glewUniformMatrix3fv) +#define glUniformMatrix4fv GLEW_GET_FUN(__glewUniformMatrix4fv) +#define glUseProgram GLEW_GET_FUN(__glewUseProgram) +#define glValidateProgram GLEW_GET_FUN(__glewValidateProgram) +#define glVertexAttrib1d GLEW_GET_FUN(__glewVertexAttrib1d) +#define glVertexAttrib1dv GLEW_GET_FUN(__glewVertexAttrib1dv) +#define glVertexAttrib1f GLEW_GET_FUN(__glewVertexAttrib1f) +#define glVertexAttrib1fv GLEW_GET_FUN(__glewVertexAttrib1fv) +#define glVertexAttrib1s GLEW_GET_FUN(__glewVertexAttrib1s) +#define glVertexAttrib1sv GLEW_GET_FUN(__glewVertexAttrib1sv) +#define glVertexAttrib2d GLEW_GET_FUN(__glewVertexAttrib2d) +#define glVertexAttrib2dv GLEW_GET_FUN(__glewVertexAttrib2dv) +#define glVertexAttrib2f GLEW_GET_FUN(__glewVertexAttrib2f) +#define glVertexAttrib2fv GLEW_GET_FUN(__glewVertexAttrib2fv) +#define glVertexAttrib2s GLEW_GET_FUN(__glewVertexAttrib2s) +#define glVertexAttrib2sv GLEW_GET_FUN(__glewVertexAttrib2sv) +#define glVertexAttrib3d GLEW_GET_FUN(__glewVertexAttrib3d) +#define glVertexAttrib3dv GLEW_GET_FUN(__glewVertexAttrib3dv) +#define glVertexAttrib3f GLEW_GET_FUN(__glewVertexAttrib3f) +#define glVertexAttrib3fv GLEW_GET_FUN(__glewVertexAttrib3fv) +#define glVertexAttrib3s GLEW_GET_FUN(__glewVertexAttrib3s) +#define glVertexAttrib3sv GLEW_GET_FUN(__glewVertexAttrib3sv) +#define glVertexAttrib4Nbv GLEW_GET_FUN(__glewVertexAttrib4Nbv) +#define glVertexAttrib4Niv GLEW_GET_FUN(__glewVertexAttrib4Niv) +#define glVertexAttrib4Nsv GLEW_GET_FUN(__glewVertexAttrib4Nsv) +#define glVertexAttrib4Nub GLEW_GET_FUN(__glewVertexAttrib4Nub) +#define glVertexAttrib4Nubv GLEW_GET_FUN(__glewVertexAttrib4Nubv) +#define glVertexAttrib4Nuiv GLEW_GET_FUN(__glewVertexAttrib4Nuiv) +#define glVertexAttrib4Nusv GLEW_GET_FUN(__glewVertexAttrib4Nusv) +#define glVertexAttrib4bv GLEW_GET_FUN(__glewVertexAttrib4bv) +#define glVertexAttrib4d GLEW_GET_FUN(__glewVertexAttrib4d) +#define glVertexAttrib4dv GLEW_GET_FUN(__glewVertexAttrib4dv) +#define glVertexAttrib4f GLEW_GET_FUN(__glewVertexAttrib4f) +#define glVertexAttrib4fv GLEW_GET_FUN(__glewVertexAttrib4fv) +#define glVertexAttrib4iv GLEW_GET_FUN(__glewVertexAttrib4iv) +#define glVertexAttrib4s GLEW_GET_FUN(__glewVertexAttrib4s) +#define glVertexAttrib4sv GLEW_GET_FUN(__glewVertexAttrib4sv) +#define glVertexAttrib4ubv GLEW_GET_FUN(__glewVertexAttrib4ubv) +#define glVertexAttrib4uiv GLEW_GET_FUN(__glewVertexAttrib4uiv) +#define glVertexAttrib4usv GLEW_GET_FUN(__glewVertexAttrib4usv) +#define glVertexAttribPointer GLEW_GET_FUN(__glewVertexAttribPointer) + +#define GLEW_VERSION_2_0 GLEW_GET_VAR(__GLEW_VERSION_2_0) + +#endif /* GL_VERSION_2_0 */ + +/* ----------------------------- GL_VERSION_2_1 ---------------------------- */ + +#ifndef GL_VERSION_2_1 +#define GL_VERSION_2_1 1 + +#define GL_CURRENT_RASTER_SECONDARY_COLOR 0x845F +#define GL_PIXEL_PACK_BUFFER 0x88EB +#define GL_PIXEL_UNPACK_BUFFER 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING 0x88EF +#define GL_FLOAT_MAT2x3 0x8B65 +#define GL_FLOAT_MAT2x4 0x8B66 +#define GL_FLOAT_MAT3x2 0x8B67 +#define GL_FLOAT_MAT3x4 0x8B68 +#define GL_FLOAT_MAT4x2 0x8B69 +#define GL_FLOAT_MAT4x3 0x8B6A +#define GL_SRGB 0x8C40 +#define GL_SRGB8 0x8C41 +#define GL_SRGB_ALPHA 0x8C42 +#define GL_SRGB8_ALPHA8 0x8C43 +#define GL_SLUMINANCE_ALPHA 0x8C44 +#define GL_SLUMINANCE8_ALPHA8 0x8C45 +#define GL_SLUMINANCE 0x8C46 +#define GL_SLUMINANCE8 0x8C47 +#define GL_COMPRESSED_SRGB 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA 0x8C49 +#define GL_COMPRESSED_SLUMINANCE 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA 0x8C4B + +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); + +#define glUniformMatrix2x3fv GLEW_GET_FUN(__glewUniformMatrix2x3fv) +#define glUniformMatrix2x4fv GLEW_GET_FUN(__glewUniformMatrix2x4fv) +#define glUniformMatrix3x2fv GLEW_GET_FUN(__glewUniformMatrix3x2fv) +#define glUniformMatrix3x4fv GLEW_GET_FUN(__glewUniformMatrix3x4fv) +#define glUniformMatrix4x2fv GLEW_GET_FUN(__glewUniformMatrix4x2fv) +#define glUniformMatrix4x3fv GLEW_GET_FUN(__glewUniformMatrix4x3fv) + +#define GLEW_VERSION_2_1 GLEW_GET_VAR(__GLEW_VERSION_2_1) + +#endif /* GL_VERSION_2_1 */ + +/* ----------------------------- GL_VERSION_3_0 ---------------------------- */ + +#ifndef GL_VERSION_3_0 +#define GL_VERSION_3_0 1 + +#define GL_MAX_CLIP_DISTANCES GL_MAX_CLIP_PLANES +#define GL_CLIP_DISTANCE5 GL_CLIP_PLANE5 +#define GL_CLIP_DISTANCE1 GL_CLIP_PLANE1 +#define GL_CLIP_DISTANCE3 GL_CLIP_PLANE3 +#define GL_COMPARE_REF_TO_TEXTURE GL_COMPARE_R_TO_TEXTURE_ARB +#define GL_CLIP_DISTANCE0 GL_CLIP_PLANE0 +#define GL_CLIP_DISTANCE4 GL_CLIP_PLANE4 +#define GL_CLIP_DISTANCE2 GL_CLIP_PLANE2 +#define GL_MAX_VARYING_COMPONENTS GL_MAX_VARYING_FLOATS +#define GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT 0x0001 +#define GL_MAJOR_VERSION 0x821B +#define GL_MINOR_VERSION 0x821C +#define GL_NUM_EXTENSIONS 0x821D +#define GL_CONTEXT_FLAGS 0x821E +#define GL_DEPTH_BUFFER 0x8223 +#define GL_STENCIL_BUFFER 0x8224 +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_RGBA32F 0x8814 +#define GL_RGB32F 0x8815 +#define GL_RGBA16F 0x881A +#define GL_RGB16F 0x881B +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER 0x88FD +#define GL_MAX_ARRAY_TEXTURE_LAYERS 0x88FF +#define GL_MIN_PROGRAM_TEXEL_OFFSET 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET 0x8905 +#define GL_CLAMP_VERTEX_COLOR 0x891A +#define GL_CLAMP_FRAGMENT_COLOR 0x891B +#define GL_CLAMP_READ_COLOR 0x891C +#define GL_FIXED_ONLY 0x891D +#define GL_TEXTURE_RED_TYPE 0x8C10 +#define GL_TEXTURE_GREEN_TYPE 0x8C11 +#define GL_TEXTURE_BLUE_TYPE 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE 0x8C16 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_TEXTURE_1D_ARRAY 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY 0x8C19 +#define GL_TEXTURE_2D_ARRAY 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY 0x8C1D +#define GL_R11F_G11F_B10F 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV 0x8C3B +#define GL_RGB9_E5 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV 0x8C3E +#define GL_TEXTURE_SHARED_SIZE 0x8C3F +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE 0x8C85 +#define GL_PRIMITIVES_GENERATED 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN 0x8C88 +#define GL_RASTERIZER_DISCARD 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS 0x8C8B +#define GL_INTERLEAVED_ATTRIBS 0x8C8C +#define GL_SEPARATE_ATTRIBS 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING 0x8C8F +#define GL_RGBA32UI 0x8D70 +#define GL_RGB32UI 0x8D71 +#define GL_RGBA16UI 0x8D76 +#define GL_RGB16UI 0x8D77 +#define GL_RGBA8UI 0x8D7C +#define GL_RGB8UI 0x8D7D +#define GL_RGBA32I 0x8D82 +#define GL_RGB32I 0x8D83 +#define GL_RGBA16I 0x8D88 +#define GL_RGB16I 0x8D89 +#define GL_RGBA8I 0x8D8E +#define GL_RGB8I 0x8D8F +#define GL_RED_INTEGER 0x8D94 +#define GL_GREEN_INTEGER 0x8D95 +#define GL_BLUE_INTEGER 0x8D96 +#define GL_ALPHA_INTEGER 0x8D97 +#define GL_RGB_INTEGER 0x8D98 +#define GL_RGBA_INTEGER 0x8D99 +#define GL_BGR_INTEGER 0x8D9A +#define GL_BGRA_INTEGER 0x8D9B +#define GL_SAMPLER_1D_ARRAY 0x8DC0 +#define GL_SAMPLER_2D_ARRAY 0x8DC1 +#define GL_SAMPLER_1D_ARRAY_SHADOW 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW 0x8DC5 +#define GL_UNSIGNED_INT_VEC2 0x8DC6 +#define GL_UNSIGNED_INT_VEC3 0x8DC7 +#define GL_UNSIGNED_INT_VEC4 0x8DC8 +#define GL_INT_SAMPLER_1D 0x8DC9 +#define GL_INT_SAMPLER_2D 0x8DCA +#define GL_INT_SAMPLER_3D 0x8DCB +#define GL_INT_SAMPLER_CUBE 0x8DCC +#define GL_INT_SAMPLER_1D_ARRAY 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY 0x8DCF +#define GL_UNSIGNED_INT_SAMPLER_1D 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY 0x8DD7 +#define GL_QUERY_WAIT 0x8E13 +#define GL_QUERY_NO_WAIT 0x8E14 +#define GL_QUERY_BY_REGION_WAIT 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERPROC) (GLuint, GLenum); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKPROC) (GLenum); +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONPROC) (GLuint, GLuint, const GLchar*); +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORPROC) (GLenum, GLenum); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFIPROC) (GLenum, GLint, GLfloat, GLint); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERFVPROC) (GLenum, GLint, const GLfloat*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERIVPROC) (GLenum, GLint, const GLint*); +typedef void (GLAPIENTRY * PFNGLCLEARBUFFERUIVPROC) (GLenum, GLint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLCOLORMASKIPROC) (GLuint, GLboolean, GLboolean, GLboolean, GLboolean); +typedef void (GLAPIENTRY * PFNGLDISABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENABLEIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANI_VPROC) (GLenum, GLuint, GLboolean*); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONPROC) (GLuint, const GLchar*); +typedef const GLubyte* (GLAPIENTRY * PFNGLGETSTRINGIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVPROC) (GLenum, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVPROC) (GLenum, GLenum, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGPROC) (GLuint, GLuint, GLsizei, GLsizei *, GLsizei *, GLenum *, GLchar *); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVPROC) (GLuint, GLint, GLuint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVPROC) (GLuint, GLenum, GLint*); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVPROC) (GLuint, GLenum, GLuint*); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDIPROC) (GLenum, GLuint); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVPROC) (GLenum, GLenum, const GLint*); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVPROC) (GLenum, GLenum, const GLuint*); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSPROC) (GLuint, GLsizei, const GLchar **, GLenum); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIPROC) (GLint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIPROC) (GLint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIPROC) (GLint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIPROC) (GLint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVPROC) (GLint, GLsizei, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IPROC) (GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIPROC) (GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IPROC) (GLuint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIPROC) (GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IPROC) (GLuint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIPROC) (GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVPROC) (GLuint, const GLbyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IPROC) (GLuint, GLint, GLint, GLint, GLint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVPROC) (GLuint, const GLint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVPROC) (GLuint, const GLshort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVPROC) (GLuint, const GLubyte*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIPROC) (GLuint, GLuint, GLuint, GLuint, GLuint); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVPROC) (GLuint, const GLuint*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVPROC) (GLuint, const GLushort*); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTERPROC) (GLuint, GLint, GLenum, GLsizei, const GLvoid*); + +#define glBeginConditionalRender GLEW_GET_FUN(__glewBeginConditionalRender) +#define glBeginTransformFeedback GLEW_GET_FUN(__glewBeginTransformFeedback) +#define glBindFragDataLocation GLEW_GET_FUN(__glewBindFragDataLocation) +#define glClampColor GLEW_GET_FUN(__glewClampColor) +#define glClearBufferfi GLEW_GET_FUN(__glewClearBufferfi) +#define glClearBufferfv GLEW_GET_FUN(__glewClearBufferfv) +#define glClearBufferiv GLEW_GET_FUN(__glewClearBufferiv) +#define glClearBufferuiv GLEW_GET_FUN(__glewClearBufferuiv) +#define glColorMaski GLEW_GET_FUN(__glewColorMaski) +#define glDisablei GLEW_GET_FUN(__glewDisablei) +#define glEnablei GLEW_GET_FUN(__glewEnablei) +#define glEndConditionalRender GLEW_GET_FUN(__glewEndConditionalRender) +#define glEndTransformFeedback GLEW_GET_FUN(__glewEndTransformFeedback) +#define glGetBooleani_v GLEW_GET_FUN(__glewGetBooleani_v) +#define glGetFragDataLocation GLEW_GET_FUN(__glewGetFragDataLocation) +#define glGetStringi GLEW_GET_FUN(__glewGetStringi) +#define glGetTexParameterIiv GLEW_GET_FUN(__glewGetTexParameterIiv) +#define glGetTexParameterIuiv GLEW_GET_FUN(__glewGetTexParameterIuiv) +#define glGetTransformFeedbackVarying GLEW_GET_FUN(__glewGetTransformFeedbackVarying) +#define glGetUniformuiv GLEW_GET_FUN(__glewGetUniformuiv) +#define glGetVertexAttribIiv GLEW_GET_FUN(__glewGetVertexAttribIiv) +#define glGetVertexAttribIuiv GLEW_GET_FUN(__glewGetVertexAttribIuiv) +#define glIsEnabledi GLEW_GET_FUN(__glewIsEnabledi) +#define glTexParameterIiv GLEW_GET_FUN(__glewTexParameterIiv) +#define glTexParameterIuiv GLEW_GET_FUN(__glewTexParameterIuiv) +#define glTransformFeedbackVaryings GLEW_GET_FUN(__glewTransformFeedbackVaryings) +#define glUniform1ui GLEW_GET_FUN(__glewUniform1ui) +#define glUniform1uiv GLEW_GET_FUN(__glewUniform1uiv) +#define glUniform2ui GLEW_GET_FUN(__glewUniform2ui) +#define glUniform2uiv GLEW_GET_FUN(__glewUniform2uiv) +#define glUniform3ui GLEW_GET_FUN(__glewUniform3ui) +#define glUniform3uiv GLEW_GET_FUN(__glewUniform3uiv) +#define glUniform4ui GLEW_GET_FUN(__glewUniform4ui) +#define glUniform4uiv GLEW_GET_FUN(__glewUniform4uiv) +#define glVertexAttribI1i GLEW_GET_FUN(__glewVertexAttribI1i) +#define glVertexAttribI1iv GLEW_GET_FUN(__glewVertexAttribI1iv) +#define glVertexAttribI1ui GLEW_GET_FUN(__glewVertexAttribI1ui) +#define glVertexAttribI1uiv GLEW_GET_FUN(__glewVertexAttribI1uiv) +#define glVertexAttribI2i GLEW_GET_FUN(__glewVertexAttribI2i) +#define glVertexAttribI2iv GLEW_GET_FUN(__glewVertexAttribI2iv) +#define glVertexAttribI2ui GLEW_GET_FUN(__glewVertexAttribI2ui) +#define glVertexAttribI2uiv GLEW_GET_FUN(__glewVertexAttribI2uiv) +#define glVertexAttribI3i GLEW_GET_FUN(__glewVertexAttribI3i) +#define glVertexAttribI3iv GLEW_GET_FUN(__glewVertexAttribI3iv) +#define glVertexAttribI3ui GLEW_GET_FUN(__glewVertexAttribI3ui) +#define glVertexAttribI3uiv GLEW_GET_FUN(__glewVertexAttribI3uiv) +#define glVertexAttribI4bv GLEW_GET_FUN(__glewVertexAttribI4bv) +#define glVertexAttribI4i GLEW_GET_FUN(__glewVertexAttribI4i) +#define glVertexAttribI4iv GLEW_GET_FUN(__glewVertexAttribI4iv) +#define glVertexAttribI4sv GLEW_GET_FUN(__glewVertexAttribI4sv) +#define glVertexAttribI4ubv GLEW_GET_FUN(__glewVertexAttribI4ubv) +#define glVertexAttribI4ui GLEW_GET_FUN(__glewVertexAttribI4ui) +#define glVertexAttribI4uiv GLEW_GET_FUN(__glewVertexAttribI4uiv) +#define glVertexAttribI4usv GLEW_GET_FUN(__glewVertexAttribI4usv) +#define glVertexAttribIPointer GLEW_GET_FUN(__glewVertexAttribIPointer) + +#define GLEW_VERSION_3_0 GLEW_GET_VAR(__GLEW_VERSION_3_0) + +#endif /* GL_VERSION_3_0 */ + +/* ----------------------------- GL_VERSION_3_1 ---------------------------- */ + +#ifndef GL_VERSION_3_1 +#define GL_VERSION_3_1 1 + +#define GL_TEXTURE_RECTANGLE 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE 0x84F8 +#define GL_SAMPLER_2D_RECT 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW 0x8B64 +#define GL_TEXTURE_BUFFER 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT 0x8C2E +#define GL_SAMPLER_BUFFER 0x8DC2 +#define GL_INT_SAMPLER_2D_RECT 0x8DCD +#define GL_INT_SAMPLER_BUFFER 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER 0x8DD8 +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_PRIMITIVE_RESTART 0x8F9D +#define GL_PRIMITIVE_RESTART_INDEX 0x8F9E +#define GL_BUFFER_ACCESS_FLAGS 0x911F +#define GL_BUFFER_MAP_LENGTH 0x9120 +#define GL_BUFFER_MAP_OFFSET 0x9121 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDPROC) (GLenum, GLint, GLsizei, GLsizei); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDPROC) (GLenum, GLsizei, GLenum, const GLvoid*, GLsizei); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXPROC) (GLuint); +typedef void (GLAPIENTRY * PFNGLTEXBUFFERPROC) (GLenum, GLenum, GLuint); + +#define glDrawArraysInstanced GLEW_GET_FUN(__glewDrawArraysInstanced) +#define glDrawElementsInstanced GLEW_GET_FUN(__glewDrawElementsInstanced) +#define glPrimitiveRestartIndex GLEW_GET_FUN(__glewPrimitiveRestartIndex) +#define glTexBuffer GLEW_GET_FUN(__glewTexBuffer) + +#define GLEW_VERSION_3_1 GLEW_GET_VAR(__GLEW_VERSION_3_1) + +#endif /* GL_VERSION_3_1 */ + +/* ----------------------------- GL_VERSION_3_2 ---------------------------- */ + +#ifndef GL_VERSION_3_2 +#define GL_VERSION_3_2 1 + +#define GL_CONTEXT_CORE_PROFILE_BIT 0x00000001 +#define GL_CONTEXT_COMPATIBILITY_PROFILE_BIT 0x00000002 +#define GL_LINES_ADJACENCY 0x000A +#define GL_LINE_STRIP_ADJACENCY 0x000B +#define GL_TRIANGLES_ADJACENCY 0x000C +#define GL_TRIANGLE_STRIP_ADJACENCY 0x000D +#define GL_PROGRAM_POINT_SIZE 0x8642 +#define GL_GEOMETRY_VERTICES_OUT 0x8916 +#define GL_GEOMETRY_INPUT_TYPE 0x8917 +#define GL_GEOMETRY_OUTPUT_TYPE 0x8918 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS 0x8DA8 +#define GL_GEOMETRY_SHADER 0x8DD9 +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS 0x8DE1 +#define GL_MAX_VERTEX_OUTPUT_COMPONENTS 0x9122 +#define GL_MAX_GEOMETRY_INPUT_COMPONENTS 0x9123 +#define GL_MAX_GEOMETRY_OUTPUT_COMPONENTS 0x9124 +#define GL_MAX_FRAGMENT_INPUT_COMPONENTS 0x9125 +#define GL_CONTEXT_PROFILE_MASK 0x9126 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREPROC) (GLenum, GLenum, GLuint, GLint); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERI64VPROC) (GLenum, GLenum, GLint64 *); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64I_VPROC) (GLenum, GLuint, GLint64 *); + +#define glFramebufferTexture GLEW_GET_FUN(__glewFramebufferTexture) +#define glGetBufferParameteri64v GLEW_GET_FUN(__glewGetBufferParameteri64v) +#define glGetInteger64i_v GLEW_GET_FUN(__glewGetInteger64i_v) + +#define GLEW_VERSION_3_2 GLEW_GET_VAR(__GLEW_VERSION_3_2) + +#endif /* GL_VERSION_3_2 */ + +/* ----------------------------- GL_VERSION_3_3 ---------------------------- */ + +#ifndef GL_VERSION_3_3 +#define GL_VERSION_3_3 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR 0x88FE +#define GL_ANY_SAMPLES_PASSED 0x8C2F +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 +#define GL_RGB10_A2UI 0x906F + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisor GLEW_GET_FUN(__glewVertexAttribDivisor) + +#define GLEW_VERSION_3_3 GLEW_GET_VAR(__GLEW_VERSION_3_3) + +#endif /* GL_VERSION_3_3 */ + +/* ----------------------------- GL_VERSION_4_0 ---------------------------- */ + +#ifndef GL_VERSION_4_0 +#define GL_VERSION_4_0 1 + +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_SAMPLE_SHADING 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE 0x8C37 +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS 0x8F9F +#define GL_TEXTURE_CUBE_MAP_ARRAY 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY 0x900F + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGPROC) (GLclampf value); + +#define glBlendEquationSeparatei GLEW_GET_FUN(__glewBlendEquationSeparatei) +#define glBlendEquationi GLEW_GET_FUN(__glewBlendEquationi) +#define glBlendFuncSeparatei GLEW_GET_FUN(__glewBlendFuncSeparatei) +#define glBlendFunci GLEW_GET_FUN(__glewBlendFunci) +#define glMinSampleShading GLEW_GET_FUN(__glewMinSampleShading) + +#define GLEW_VERSION_4_0 GLEW_GET_VAR(__GLEW_VERSION_4_0) + +#endif /* GL_VERSION_4_0 */ + +/* ----------------------------- GL_VERSION_4_1 ---------------------------- */ + +#ifndef GL_VERSION_4_1 +#define GL_VERSION_4_1 1 + +#define GLEW_VERSION_4_1 GLEW_GET_VAR(__GLEW_VERSION_4_1) + +#endif /* GL_VERSION_4_1 */ + +/* -------------------------- GL_3DFX_multisample -------------------------- */ + +#ifndef GL_3DFX_multisample +#define GL_3DFX_multisample 1 + +#define GL_MULTISAMPLE_3DFX 0x86B2 +#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 +#define GL_SAMPLES_3DFX 0x86B4 +#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 + +#define GLEW_3DFX_multisample GLEW_GET_VAR(__GLEW_3DFX_multisample) + +#endif /* GL_3DFX_multisample */ + +/* ---------------------------- GL_3DFX_tbuffer ---------------------------- */ + +#ifndef GL_3DFX_tbuffer +#define GL_3DFX_tbuffer 1 + +typedef void (GLAPIENTRY * PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); + +#define glTbufferMask3DFX GLEW_GET_FUN(__glewTbufferMask3DFX) + +#define GLEW_3DFX_tbuffer GLEW_GET_VAR(__GLEW_3DFX_tbuffer) + +#endif /* GL_3DFX_tbuffer */ + +/* -------------------- GL_3DFX_texture_compression_FXT1 ------------------- */ + +#ifndef GL_3DFX_texture_compression_FXT1 +#define GL_3DFX_texture_compression_FXT1 1 + +#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 +#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 + +#define GLEW_3DFX_texture_compression_FXT1 GLEW_GET_VAR(__GLEW_3DFX_texture_compression_FXT1) + +#endif /* GL_3DFX_texture_compression_FXT1 */ + +/* ----------------------- GL_AMD_conservative_depth ----------------------- */ + +#ifndef GL_AMD_conservative_depth +#define GL_AMD_conservative_depth 1 + +#define GLEW_AMD_conservative_depth GLEW_GET_VAR(__GLEW_AMD_conservative_depth) + +#endif /* GL_AMD_conservative_depth */ + +/* -------------------------- GL_AMD_debug_output -------------------------- */ + +#ifndef GL_AMD_debug_output +#define GL_AMD_debug_output 1 + +#define GL_MAX_DEBUG_MESSAGE_LENGTH_AMD 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_AMD 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_AMD 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_AMD 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_AMD 0x9147 +#define GL_DEBUG_SEVERITY_LOW_AMD 0x9148 +#define GL_DEBUG_CATEGORY_API_ERROR_AMD 0x9149 +#define GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD 0x914A +#define GL_DEBUG_CATEGORY_DEPRECATION_AMD 0x914B +#define GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD 0x914C +#define GL_DEBUG_CATEGORY_PERFORMANCE_AMD 0x914D +#define GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD 0x914E +#define GL_DEBUG_CATEGORY_APPLICATION_AMD 0x914F +#define GL_DEBUG_CATEGORY_OTHER_AMD 0x9150 + +typedef void (APIENTRY *GLDEBUGPROCAMD)(GLuint id, GLenum category, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKAMDPROC) (GLDEBUGPROCAMD callback, void* userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEENABLEAMDPROC) (GLenum category, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTAMDPROC) (GLenum category, GLenum severity, GLuint id, GLsizei length, const char* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGAMDPROC) (GLuint count, GLsizei bufsize, GLenum* categories, GLuint* severities, GLuint* ids, GLsizei* lengths, char* message); + +#define glDebugMessageCallbackAMD GLEW_GET_FUN(__glewDebugMessageCallbackAMD) +#define glDebugMessageEnableAMD GLEW_GET_FUN(__glewDebugMessageEnableAMD) +#define glDebugMessageInsertAMD GLEW_GET_FUN(__glewDebugMessageInsertAMD) +#define glGetDebugMessageLogAMD GLEW_GET_FUN(__glewGetDebugMessageLogAMD) + +#define GLEW_AMD_debug_output GLEW_GET_VAR(__GLEW_AMD_debug_output) + +#endif /* GL_AMD_debug_output */ + +/* ---------------------- GL_AMD_depth_clamp_separate ---------------------- */ + +#ifndef GL_AMD_depth_clamp_separate +#define GL_AMD_depth_clamp_separate 1 + +#define GL_DEPTH_CLAMP_NEAR_AMD 0x901E +#define GL_DEPTH_CLAMP_FAR_AMD 0x901F + +#define GLEW_AMD_depth_clamp_separate GLEW_GET_VAR(__GLEW_AMD_depth_clamp_separate) + +#endif /* GL_AMD_depth_clamp_separate */ + +/* ----------------------- GL_AMD_draw_buffers_blend ----------------------- */ + +#ifndef GL_AMD_draw_buffers_blend +#define GL_AMD_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONINDEXEDAMDPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCINDEXEDAMDPROC) (GLuint buf, GLenum src, GLenum dst); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); + +#define glBlendEquationIndexedAMD GLEW_GET_FUN(__glewBlendEquationIndexedAMD) +#define glBlendEquationSeparateIndexedAMD GLEW_GET_FUN(__glewBlendEquationSeparateIndexedAMD) +#define glBlendFuncIndexedAMD GLEW_GET_FUN(__glewBlendFuncIndexedAMD) +#define glBlendFuncSeparateIndexedAMD GLEW_GET_FUN(__glewBlendFuncSeparateIndexedAMD) + +#define GLEW_AMD_draw_buffers_blend GLEW_GET_VAR(__GLEW_AMD_draw_buffers_blend) + +#endif /* GL_AMD_draw_buffers_blend */ + +/* ------------------------- GL_AMD_name_gen_delete ------------------------ */ + +#ifndef GL_AMD_name_gen_delete +#define GL_AMD_name_gen_delete 1 + +#define GL_DATA_BUFFER_AMD 0x9151 +#define GL_PERFORMANCE_MONITOR_AMD 0x9152 +#define GL_QUERY_OBJECT_AMD 0x9153 +#define GL_VERTEX_ARRAY_OBJECT_AMD 0x9154 +#define GL_SAMPLER_OBJECT_AMD 0x9155 + +typedef void (GLAPIENTRY * PFNGLDELETENAMESAMDPROC) (GLenum identifier, GLuint num, const GLuint* names); +typedef void (GLAPIENTRY * PFNGLGENNAMESAMDPROC) (GLenum identifier, GLuint num, GLuint* names); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEAMDPROC) (GLenum identifier, GLuint name); + +#define glDeleteNamesAMD GLEW_GET_FUN(__glewDeleteNamesAMD) +#define glGenNamesAMD GLEW_GET_FUN(__glewGenNamesAMD) +#define glIsNameAMD GLEW_GET_FUN(__glewIsNameAMD) + +#define GLEW_AMD_name_gen_delete GLEW_GET_VAR(__GLEW_AMD_name_gen_delete) + +#endif /* GL_AMD_name_gen_delete */ + +/* ----------------------- GL_AMD_performance_monitor ---------------------- */ + +#ifndef GL_AMD_performance_monitor +#define GL_AMD_performance_monitor 1 + +#define GL_UNSIGNED_INT 0x1405 +#define GL_FLOAT 0x1406 +#define GL_COUNTER_TYPE_AMD 0x8BC0 +#define GL_COUNTER_RANGE_AMD 0x8BC1 +#define GL_UNSIGNED_INT64_AMD 0x8BC2 +#define GL_PERCENTAGE_AMD 0x8BC3 +#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4 +#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5 +#define GL_PERFMON_RESULT_AMD 0x8BC6 + +typedef void (GLAPIENTRY * PFNGLBEGINPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLDELETEPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLENDPERFMONITORAMDPROC) (GLuint monitor); +typedef void (GLAPIENTRY * PFNGLGENPERFMONITORSAMDPROC) (GLsizei n, GLuint* monitors); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERDATAAMDPROC) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint *bytesWritten); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERINFOAMDPROC) (GLuint group, GLuint counter, GLenum pname, void* data); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, char *counterString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORCOUNTERSAMDPROC) (GLuint group, GLint* numCounters, GLint *maxActiveCounters, GLsizei countersSize, GLuint *counters); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSTRINGAMDPROC) (GLuint group, GLsizei bufSize, GLsizei* length, char *groupString); +typedef void (GLAPIENTRY * PFNGLGETPERFMONITORGROUPSAMDPROC) (GLint* numGroups, GLsizei groupsSize, GLuint *groups); +typedef void (GLAPIENTRY * PFNGLSELECTPERFMONITORCOUNTERSAMDPROC) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* counterList); + +#define glBeginPerfMonitorAMD GLEW_GET_FUN(__glewBeginPerfMonitorAMD) +#define glDeletePerfMonitorsAMD GLEW_GET_FUN(__glewDeletePerfMonitorsAMD) +#define glEndPerfMonitorAMD GLEW_GET_FUN(__glewEndPerfMonitorAMD) +#define glGenPerfMonitorsAMD GLEW_GET_FUN(__glewGenPerfMonitorsAMD) +#define glGetPerfMonitorCounterDataAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterDataAMD) +#define glGetPerfMonitorCounterInfoAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterInfoAMD) +#define glGetPerfMonitorCounterStringAMD GLEW_GET_FUN(__glewGetPerfMonitorCounterStringAMD) +#define glGetPerfMonitorCountersAMD GLEW_GET_FUN(__glewGetPerfMonitorCountersAMD) +#define glGetPerfMonitorGroupStringAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupStringAMD) +#define glGetPerfMonitorGroupsAMD GLEW_GET_FUN(__glewGetPerfMonitorGroupsAMD) +#define glSelectPerfMonitorCountersAMD GLEW_GET_FUN(__glewSelectPerfMonitorCountersAMD) + +#define GLEW_AMD_performance_monitor GLEW_GET_VAR(__GLEW_AMD_performance_monitor) + +#endif /* GL_AMD_performance_monitor */ + +/* ------------------ GL_AMD_seamless_cubemap_per_texture ------------------ */ + +#ifndef GL_AMD_seamless_cubemap_per_texture +#define GL_AMD_seamless_cubemap_per_texture 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS_ARB 0x884F + +#define GLEW_AMD_seamless_cubemap_per_texture GLEW_GET_VAR(__GLEW_AMD_seamless_cubemap_per_texture) + +#endif /* GL_AMD_seamless_cubemap_per_texture */ + +/* ---------------------- GL_AMD_shader_stencil_export --------------------- */ + +#ifndef GL_AMD_shader_stencil_export +#define GL_AMD_shader_stencil_export 1 + +#define GLEW_AMD_shader_stencil_export GLEW_GET_VAR(__GLEW_AMD_shader_stencil_export) + +#endif /* GL_AMD_shader_stencil_export */ + +/* ------------------------ GL_AMD_texture_texture4 ------------------------ */ + +#ifndef GL_AMD_texture_texture4 +#define GL_AMD_texture_texture4 1 + +#define GLEW_AMD_texture_texture4 GLEW_GET_VAR(__GLEW_AMD_texture_texture4) + +#endif /* GL_AMD_texture_texture4 */ + +/* --------------- GL_AMD_transform_feedback3_lines_triangles -------------- */ + +#ifndef GL_AMD_transform_feedback3_lines_triangles +#define GL_AMD_transform_feedback3_lines_triangles 1 + +#define GLEW_AMD_transform_feedback3_lines_triangles GLEW_GET_VAR(__GLEW_AMD_transform_feedback3_lines_triangles) + +#endif /* GL_AMD_transform_feedback3_lines_triangles */ + +/* -------------------- GL_AMD_vertex_shader_tessellator ------------------- */ + +#ifndef GL_AMD_vertex_shader_tessellator +#define GL_AMD_vertex_shader_tessellator 1 + +#define GL_SAMPLER_BUFFER_AMD 0x9001 +#define GL_INT_SAMPLER_BUFFER_AMD 0x9002 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD 0x9003 +#define GL_TESSELLATION_MODE_AMD 0x9004 +#define GL_TESSELLATION_FACTOR_AMD 0x9005 +#define GL_DISCRETE_AMD 0x9006 +#define GL_CONTINUOUS_AMD 0x9007 + +typedef void (GLAPIENTRY * PFNGLTESSELLATIONFACTORAMDPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLTESSELLATIONMODEAMDPROC) (GLenum mode); + +#define glTessellationFactorAMD GLEW_GET_FUN(__glewTessellationFactorAMD) +#define glTessellationModeAMD GLEW_GET_FUN(__glewTessellationModeAMD) + +#define GLEW_AMD_vertex_shader_tessellator GLEW_GET_VAR(__GLEW_AMD_vertex_shader_tessellator) + +#endif /* GL_AMD_vertex_shader_tessellator */ + +/* ----------------------- GL_APPLE_aux_depth_stencil ---------------------- */ + +#ifndef GL_APPLE_aux_depth_stencil +#define GL_APPLE_aux_depth_stencil 1 + +#define GL_AUX_DEPTH_STENCIL_APPLE 0x8A14 + +#define GLEW_APPLE_aux_depth_stencil GLEW_GET_VAR(__GLEW_APPLE_aux_depth_stencil) + +#endif /* GL_APPLE_aux_depth_stencil */ + +/* ------------------------ GL_APPLE_client_storage ------------------------ */ + +#ifndef GL_APPLE_client_storage +#define GL_APPLE_client_storage 1 + +#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 + +#define GLEW_APPLE_client_storage GLEW_GET_VAR(__GLEW_APPLE_client_storage) + +#endif /* GL_APPLE_client_storage */ + +/* ------------------------- GL_APPLE_element_array ------------------------ */ + +#ifndef GL_APPLE_element_array +#define GL_APPLE_element_array 1 + +#define GL_ELEMENT_ARRAY_APPLE 0x8A0C +#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8A0D +#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x8A0E + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const void* pointer); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint* first, const GLsizei *count, GLsizei primcount); + +#define glDrawElementArrayAPPLE GLEW_GET_FUN(__glewDrawElementArrayAPPLE) +#define glDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewDrawRangeElementArrayAPPLE) +#define glElementPointerAPPLE GLEW_GET_FUN(__glewElementPointerAPPLE) +#define glMultiDrawElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawElementArrayAPPLE) +#define glMultiDrawRangeElementArrayAPPLE GLEW_GET_FUN(__glewMultiDrawRangeElementArrayAPPLE) + +#define GLEW_APPLE_element_array GLEW_GET_VAR(__GLEW_APPLE_element_array) + +#endif /* GL_APPLE_element_array */ + +/* ----------------------------- GL_APPLE_fence ---------------------------- */ + +#ifndef GL_APPLE_fence +#define GL_APPLE_fence 1 + +#define GL_DRAW_PIXELS_APPLE 0x8A0A +#define GL_FENCE_APPLE 0x8A0B + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); +typedef void (GLAPIENTRY * PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint* fences); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCEAPPLEPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCEAPPLEPROC) (GLuint fence); +typedef GLboolean (GLAPIENTRY * PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); + +#define glDeleteFencesAPPLE GLEW_GET_FUN(__glewDeleteFencesAPPLE) +#define glFinishFenceAPPLE GLEW_GET_FUN(__glewFinishFenceAPPLE) +#define glFinishObjectAPPLE GLEW_GET_FUN(__glewFinishObjectAPPLE) +#define glGenFencesAPPLE GLEW_GET_FUN(__glewGenFencesAPPLE) +#define glIsFenceAPPLE GLEW_GET_FUN(__glewIsFenceAPPLE) +#define glSetFenceAPPLE GLEW_GET_FUN(__glewSetFenceAPPLE) +#define glTestFenceAPPLE GLEW_GET_FUN(__glewTestFenceAPPLE) +#define glTestObjectAPPLE GLEW_GET_FUN(__glewTestObjectAPPLE) + +#define GLEW_APPLE_fence GLEW_GET_VAR(__GLEW_APPLE_fence) + +#endif /* GL_APPLE_fence */ + +/* ------------------------- GL_APPLE_float_pixels ------------------------- */ + +#ifndef GL_APPLE_float_pixels +#define GL_APPLE_float_pixels 1 + +#define GL_HALF_APPLE 0x140B +#define GL_RGBA_FLOAT32_APPLE 0x8814 +#define GL_RGB_FLOAT32_APPLE 0x8815 +#define GL_ALPHA_FLOAT32_APPLE 0x8816 +#define GL_INTENSITY_FLOAT32_APPLE 0x8817 +#define GL_LUMINANCE_FLOAT32_APPLE 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_APPLE 0x8819 +#define GL_RGBA_FLOAT16_APPLE 0x881A +#define GL_RGB_FLOAT16_APPLE 0x881B +#define GL_ALPHA_FLOAT16_APPLE 0x881C +#define GL_INTENSITY_FLOAT16_APPLE 0x881D +#define GL_LUMINANCE_FLOAT16_APPLE 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_APPLE 0x881F +#define GL_COLOR_FLOAT_APPLE 0x8A0F + +#define GLEW_APPLE_float_pixels GLEW_GET_VAR(__GLEW_APPLE_float_pixels) + +#endif /* GL_APPLE_float_pixels */ + +/* ---------------------- GL_APPLE_flush_buffer_range ---------------------- */ + +#ifndef GL_APPLE_flush_buffer_range +#define GL_APPLE_flush_buffer_range 1 + +#define GL_BUFFER_SERIALIZED_MODIFY_APPLE 0x8A12 +#define GL_BUFFER_FLUSHING_UNMAP_APPLE 0x8A13 + +typedef void (GLAPIENTRY * PFNGLBUFFERPARAMETERIAPPLEPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC) (GLenum target, GLintptr offset, GLsizeiptr size); + +#define glBufferParameteriAPPLE GLEW_GET_FUN(__glewBufferParameteriAPPLE) +#define glFlushMappedBufferRangeAPPLE GLEW_GET_FUN(__glewFlushMappedBufferRangeAPPLE) + +#define GLEW_APPLE_flush_buffer_range GLEW_GET_VAR(__GLEW_APPLE_flush_buffer_range) + +#endif /* GL_APPLE_flush_buffer_range */ + +/* ----------------------- GL_APPLE_object_purgeable ----------------------- */ + +#ifndef GL_APPLE_object_purgeable +#define GL_APPLE_object_purgeable 1 + +#define GL_BUFFER_OBJECT_APPLE 0x85B3 +#define GL_RELEASED_APPLE 0x8A19 +#define GL_VOLATILE_APPLE 0x8A1A +#define GL_RETAINED_APPLE 0x8A1B +#define GL_UNDEFINED_APPLE 0x8A1C +#define GL_PURGEABLE_APPLE 0x8A1D + +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVAPPLEPROC) (GLenum objectType, GLuint name, GLenum pname, GLint* params); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); +typedef GLenum (GLAPIENTRY * PFNGLOBJECTUNPURGEABLEAPPLEPROC) (GLenum objectType, GLuint name, GLenum option); + +#define glGetObjectParameterivAPPLE GLEW_GET_FUN(__glewGetObjectParameterivAPPLE) +#define glObjectPurgeableAPPLE GLEW_GET_FUN(__glewObjectPurgeableAPPLE) +#define glObjectUnpurgeableAPPLE GLEW_GET_FUN(__glewObjectUnpurgeableAPPLE) + +#define GLEW_APPLE_object_purgeable GLEW_GET_VAR(__GLEW_APPLE_object_purgeable) + +#endif /* GL_APPLE_object_purgeable */ + +/* ------------------------- GL_APPLE_pixel_buffer ------------------------- */ + +#ifndef GL_APPLE_pixel_buffer +#define GL_APPLE_pixel_buffer 1 + +#define GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE 0x8A10 + +#define GLEW_APPLE_pixel_buffer GLEW_GET_VAR(__GLEW_APPLE_pixel_buffer) + +#endif /* GL_APPLE_pixel_buffer */ + +/* ---------------------------- GL_APPLE_rgb_422 --------------------------- */ + +#ifndef GL_APPLE_rgb_422 +#define GL_APPLE_rgb_422 1 + +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB +#define GL_RGB_422_APPLE 0x8A1F + +#define GLEW_APPLE_rgb_422 GLEW_GET_VAR(__GLEW_APPLE_rgb_422) + +#endif /* GL_APPLE_rgb_422 */ + +/* --------------------------- GL_APPLE_row_bytes -------------------------- */ + +#ifndef GL_APPLE_row_bytes +#define GL_APPLE_row_bytes 1 + +#define GL_PACK_ROW_BYTES_APPLE 0x8A15 +#define GL_UNPACK_ROW_BYTES_APPLE 0x8A16 + +#define GLEW_APPLE_row_bytes GLEW_GET_VAR(__GLEW_APPLE_row_bytes) + +#endif /* GL_APPLE_row_bytes */ + +/* ------------------------ GL_APPLE_specular_vector ----------------------- */ + +#ifndef GL_APPLE_specular_vector +#define GL_APPLE_specular_vector 1 + +#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 + +#define GLEW_APPLE_specular_vector GLEW_GET_VAR(__GLEW_APPLE_specular_vector) + +#endif /* GL_APPLE_specular_vector */ + +/* ------------------------- GL_APPLE_texture_range ------------------------ */ + +#ifndef GL_APPLE_texture_range +#define GL_APPLE_texture_range 1 + +#define GL_TEXTURE_RANGE_LENGTH_APPLE 0x85B7 +#define GL_TEXTURE_RANGE_POINTER_APPLE 0x85B8 +#define GL_TEXTURE_STORAGE_HINT_APPLE 0x85BC +#define GL_STORAGE_PRIVATE_APPLE 0x85BD +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC) (GLenum target, GLenum pname, GLvoid **params); +typedef void (GLAPIENTRY * PFNGLTEXTURERANGEAPPLEPROC) (GLenum target, GLsizei length, GLvoid *pointer); + +#define glGetTexParameterPointervAPPLE GLEW_GET_FUN(__glewGetTexParameterPointervAPPLE) +#define glTextureRangeAPPLE GLEW_GET_FUN(__glewTextureRangeAPPLE) + +#define GLEW_APPLE_texture_range GLEW_GET_VAR(__GLEW_APPLE_texture_range) + +#endif /* GL_APPLE_texture_range */ + +/* ------------------------ GL_APPLE_transform_hint ------------------------ */ + +#ifndef GL_APPLE_transform_hint +#define GL_APPLE_transform_hint 1 + +#define GL_TRANSFORM_HINT_APPLE 0x85B1 + +#define GLEW_APPLE_transform_hint GLEW_GET_VAR(__GLEW_APPLE_transform_hint) + +#endif /* GL_APPLE_transform_hint */ + +/* ---------------------- GL_APPLE_vertex_array_object --------------------- */ + +#ifndef GL_APPLE_vertex_array_object +#define GL_APPLE_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); + +#define glBindVertexArrayAPPLE GLEW_GET_FUN(__glewBindVertexArrayAPPLE) +#define glDeleteVertexArraysAPPLE GLEW_GET_FUN(__glewDeleteVertexArraysAPPLE) +#define glGenVertexArraysAPPLE GLEW_GET_FUN(__glewGenVertexArraysAPPLE) +#define glIsVertexArrayAPPLE GLEW_GET_FUN(__glewIsVertexArrayAPPLE) + +#define GLEW_APPLE_vertex_array_object GLEW_GET_VAR(__GLEW_APPLE_vertex_array_object) + +#endif /* GL_APPLE_vertex_array_object */ + +/* ---------------------- GL_APPLE_vertex_array_range ---------------------- */ + +#ifndef GL_APPLE_vertex_array_range +#define GL_APPLE_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E +#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_APPLE 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 +#define GL_STORAGE_CLIENT_APPLE 0x85B4 +#define GL_STORAGE_CACHED_APPLE 0x85BE +#define GL_STORAGE_SHARED_APPLE 0x85BF + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, void* pointer); + +#define glFlushVertexArrayRangeAPPLE GLEW_GET_FUN(__glewFlushVertexArrayRangeAPPLE) +#define glVertexArrayParameteriAPPLE GLEW_GET_FUN(__glewVertexArrayParameteriAPPLE) +#define glVertexArrayRangeAPPLE GLEW_GET_FUN(__glewVertexArrayRangeAPPLE) + +#define GLEW_APPLE_vertex_array_range GLEW_GET_VAR(__GLEW_APPLE_vertex_array_range) + +#endif /* GL_APPLE_vertex_array_range */ + +/* ------------------- GL_APPLE_vertex_program_evaluators ------------------ */ + +#ifndef GL_APPLE_vertex_program_evaluators +#define GL_APPLE_vertex_program_evaluators 1 + +#define GL_VERTEX_ATTRIB_MAP1_APPLE 0x8A00 +#define GL_VERTEX_ATTRIB_MAP2_APPLE 0x8A01 +#define GL_VERTEX_ATTRIB_MAP1_SIZE_APPLE 0x8A02 +#define GL_VERTEX_ATTRIB_MAP1_COEFF_APPLE 0x8A03 +#define GL_VERTEX_ATTRIB_MAP1_ORDER_APPLE 0x8A04 +#define GL_VERTEX_ATTRIB_MAP1_DOMAIN_APPLE 0x8A05 +#define GL_VERTEX_ATTRIB_MAP2_SIZE_APPLE 0x8A06 +#define GL_VERTEX_ATTRIB_MAP2_COEFF_APPLE 0x8A07 +#define GL_VERTEX_ATTRIB_MAP2_ORDER_APPLE 0x8A08 +#define GL_VERTEX_ATTRIB_MAP2_DOMAIN_APPLE 0x8A09 + +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBAPPLEPROC) (GLuint index, GLenum pname); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXATTRIBENABLEDAPPLEPROC) (GLuint index, GLenum pname); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint stride, GLint order, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB1FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint stride, GLint order, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2DAPPLEPROC) (GLuint index, GLuint size, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, const GLdouble* points); +typedef void (GLAPIENTRY * PFNGLMAPVERTEXATTRIB2FAPPLEPROC) (GLuint index, GLuint size, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, const GLfloat* points); + +#define glDisableVertexAttribAPPLE GLEW_GET_FUN(__glewDisableVertexAttribAPPLE) +#define glEnableVertexAttribAPPLE GLEW_GET_FUN(__glewEnableVertexAttribAPPLE) +#define glIsVertexAttribEnabledAPPLE GLEW_GET_FUN(__glewIsVertexAttribEnabledAPPLE) +#define glMapVertexAttrib1dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1dAPPLE) +#define glMapVertexAttrib1fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib1fAPPLE) +#define glMapVertexAttrib2dAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2dAPPLE) +#define glMapVertexAttrib2fAPPLE GLEW_GET_FUN(__glewMapVertexAttrib2fAPPLE) + +#define GLEW_APPLE_vertex_program_evaluators GLEW_GET_VAR(__GLEW_APPLE_vertex_program_evaluators) + +#endif /* GL_APPLE_vertex_program_evaluators */ + +/* --------------------------- GL_APPLE_ycbcr_422 -------------------------- */ + +#ifndef GL_APPLE_ycbcr_422 +#define GL_APPLE_ycbcr_422 1 + +#define GL_YCBCR_422_APPLE 0x85B9 +#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB + +#define GLEW_APPLE_ycbcr_422 GLEW_GET_VAR(__GLEW_APPLE_ycbcr_422) + +#endif /* GL_APPLE_ycbcr_422 */ + +/* ------------------------ GL_ARB_ES2_compatibility ----------------------- */ + +#ifndef GL_ARB_ES2_compatibility +#define GL_ARB_ES2_compatibility 1 + +#define GL_FIXED 0x140C +#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B +#define GL_LOW_FLOAT 0x8DF0 +#define GL_MEDIUM_FLOAT 0x8DF1 +#define GL_HIGH_FLOAT 0x8DF2 +#define GL_LOW_INT 0x8DF3 +#define GL_MEDIUM_INT 0x8DF4 +#define GL_HIGH_INT 0x8DF5 +#define GL_SHADER_BINARY_FORMATS 0x8DF8 +#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9 +#define GL_SHADER_COMPILER 0x8DFA +#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB +#define GL_MAX_VARYING_VECTORS 0x8DFC +#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFPROC) (GLclampf d); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint *precision); +typedef void (GLAPIENTRY * PFNGLRELEASESHADERCOMPILERPROC) (void); +typedef void (GLAPIENTRY * PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint* shaders, GLenum binaryformat, const GLvoid*binary, GLsizei length); + +#define glClearDepthf GLEW_GET_FUN(__glewClearDepthf) +#define glDepthRangef GLEW_GET_FUN(__glewDepthRangef) +#define glGetShaderPrecisionFormat GLEW_GET_FUN(__glewGetShaderPrecisionFormat) +#define glReleaseShaderCompiler GLEW_GET_FUN(__glewReleaseShaderCompiler) +#define glShaderBinary GLEW_GET_FUN(__glewShaderBinary) + +#define GLEW_ARB_ES2_compatibility GLEW_GET_VAR(__GLEW_ARB_ES2_compatibility) + +#endif /* GL_ARB_ES2_compatibility */ + +/* ----------------------- GL_ARB_blend_func_extended ---------------------- */ + +#ifndef GL_ARB_blend_func_extended +#define GL_ARB_blend_func_extended 1 + +#define GL_SRC1_COLOR 0x88F9 +#define GL_ONE_MINUS_SRC1_COLOR 0x88FA +#define GL_ONE_MINUS_SRC1_ALPHA 0x88FB +#define GL_MAX_DUAL_SOURCE_DRAW_BUFFERS 0x88FC + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONINDEXEDPROC) (GLuint program, GLuint colorNumber, GLuint index, const char * name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATAINDEXPROC) (GLuint program, const char * name); + +#define glBindFragDataLocationIndexed GLEW_GET_FUN(__glewBindFragDataLocationIndexed) +#define glGetFragDataIndex GLEW_GET_FUN(__glewGetFragDataIndex) + +#define GLEW_ARB_blend_func_extended GLEW_GET_VAR(__GLEW_ARB_blend_func_extended) + +#endif /* GL_ARB_blend_func_extended */ + +/* ---------------------------- GL_ARB_cl_event ---------------------------- */ + +#ifndef GL_ARB_cl_event +#define GL_ARB_cl_event 1 + +#define GL_SYNC_CL_EVENT_ARB 0x8240 +#define GL_SYNC_CL_EVENT_COMPLETE_ARB 0x8241 + +typedef struct _cl_context *cl_context; +typedef struct _cl_event *cl_event; + +typedef GLsync (GLAPIENTRY * PFNGLCREATESYNCFROMCLEVENTARBPROC) (cl_context context, cl_event event, GLbitfield flags); + +#define glCreateSyncFromCLeventARB GLEW_GET_FUN(__glewCreateSyncFromCLeventARB) + +#define GLEW_ARB_cl_event GLEW_GET_VAR(__GLEW_ARB_cl_event) + +#endif /* GL_ARB_cl_event */ + +/* ----------------------- GL_ARB_color_buffer_float ----------------------- */ + +#ifndef GL_ARB_color_buffer_float +#define GL_ARB_color_buffer_float 1 + +#define GL_RGBA_FLOAT_MODE_ARB 0x8820 +#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A +#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B +#define GL_CLAMP_READ_COLOR_ARB 0x891C +#define GL_FIXED_ONLY_ARB 0x891D + +typedef void (GLAPIENTRY * PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); + +#define glClampColorARB GLEW_GET_FUN(__glewClampColorARB) + +#define GLEW_ARB_color_buffer_float GLEW_GET_VAR(__GLEW_ARB_color_buffer_float) + +#endif /* GL_ARB_color_buffer_float */ + +/* -------------------------- GL_ARB_compatibility ------------------------- */ + +#ifndef GL_ARB_compatibility +#define GL_ARB_compatibility 1 + +#define GLEW_ARB_compatibility GLEW_GET_VAR(__GLEW_ARB_compatibility) + +#endif /* GL_ARB_compatibility */ + +/* --------------------------- GL_ARB_copy_buffer -------------------------- */ + +#ifndef GL_ARB_copy_buffer +#define GL_ARB_copy_buffer 1 + +#define GL_COPY_READ_BUFFER 0x8F36 +#define GL_COPY_WRITE_BUFFER 0x8F37 + +typedef void (GLAPIENTRY * PFNGLCOPYBUFFERSUBDATAPROC) (GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size); + +#define glCopyBufferSubData GLEW_GET_FUN(__glewCopyBufferSubData) + +#define GLEW_ARB_copy_buffer GLEW_GET_VAR(__GLEW_ARB_copy_buffer) + +#endif /* GL_ARB_copy_buffer */ + +/* -------------------------- GL_ARB_debug_output -------------------------- */ + +#ifndef GL_ARB_debug_output +#define GL_ARB_debug_output 1 + +#define GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB 0x8242 +#define GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB 0x8243 +#define GL_DEBUG_CALLBACK_FUNCTION_ARB 0x8244 +#define GL_DEBUG_CALLBACK_USER_PARAM_ARB 0x8245 +#define GL_DEBUG_SOURCE_API_ARB 0x8246 +#define GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB 0x8247 +#define GL_DEBUG_SOURCE_SHADER_COMPILER_ARB 0x8248 +#define GL_DEBUG_SOURCE_THIRD_PARTY_ARB 0x8249 +#define GL_DEBUG_SOURCE_APPLICATION_ARB 0x824A +#define GL_DEBUG_SOURCE_OTHER_ARB 0x824B +#define GL_DEBUG_TYPE_ERROR_ARB 0x824C +#define GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB 0x824D +#define GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB 0x824E +#define GL_DEBUG_TYPE_PORTABILITY_ARB 0x824F +#define GL_DEBUG_TYPE_PERFORMANCE_ARB 0x8250 +#define GL_DEBUG_TYPE_OTHER_ARB 0x8251 +#define GL_MAX_DEBUG_MESSAGE_LENGTH_ARB 0x9143 +#define GL_MAX_DEBUG_LOGGED_MESSAGES_ARB 0x9144 +#define GL_DEBUG_LOGGED_MESSAGES_ARB 0x9145 +#define GL_DEBUG_SEVERITY_HIGH_ARB 0x9146 +#define GL_DEBUG_SEVERITY_MEDIUM_ARB 0x9147 +#define GL_DEBUG_SEVERITY_LOW_ARB 0x9148 + +typedef void (APIENTRY *GLDEBUGPROCARB)(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar* message, GLvoid* userParam); + +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECALLBACKARBPROC) (GLDEBUGPROCARB callback, void* userParam); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGECONTROLARBPROC) (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint* ids, GLboolean enabled); +typedef void (GLAPIENTRY * PFNGLDEBUGMESSAGEINSERTARBPROC) (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const char* buf); +typedef GLuint (GLAPIENTRY * PFNGLGETDEBUGMESSAGELOGARBPROC) (GLuint count, GLsizei bufsize, GLenum* sources, GLenum* types, GLuint* ids, GLenum* severities, GLsizei* lengths, char* messageLog); + +#define glDebugMessageCallbackARB GLEW_GET_FUN(__glewDebugMessageCallbackARB) +#define glDebugMessageControlARB GLEW_GET_FUN(__glewDebugMessageControlARB) +#define glDebugMessageInsertARB GLEW_GET_FUN(__glewDebugMessageInsertARB) +#define glGetDebugMessageLogARB GLEW_GET_FUN(__glewGetDebugMessageLogARB) + +#define GLEW_ARB_debug_output GLEW_GET_VAR(__GLEW_ARB_debug_output) + +#endif /* GL_ARB_debug_output */ + +/* ----------------------- GL_ARB_depth_buffer_float ----------------------- */ + +#ifndef GL_ARB_depth_buffer_float +#define GL_ARB_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F 0x8CAC +#define GL_DEPTH32F_STENCIL8 0x8CAD +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV 0x8DAD + +#define GLEW_ARB_depth_buffer_float GLEW_GET_VAR(__GLEW_ARB_depth_buffer_float) + +#endif /* GL_ARB_depth_buffer_float */ + +/* --------------------------- GL_ARB_depth_clamp -------------------------- */ + +#ifndef GL_ARB_depth_clamp +#define GL_ARB_depth_clamp 1 + +#define GL_DEPTH_CLAMP 0x864F + +#define GLEW_ARB_depth_clamp GLEW_GET_VAR(__GLEW_ARB_depth_clamp) + +#endif /* GL_ARB_depth_clamp */ + +/* -------------------------- GL_ARB_depth_texture ------------------------- */ + +#ifndef GL_ARB_depth_texture +#define GL_ARB_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_ARB 0x81A5 +#define GL_DEPTH_COMPONENT24_ARB 0x81A6 +#define GL_DEPTH_COMPONENT32_ARB 0x81A7 +#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A +#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B + +#define GLEW_ARB_depth_texture GLEW_GET_VAR(__GLEW_ARB_depth_texture) + +#endif /* GL_ARB_depth_texture */ + +/* -------------------------- GL_ARB_draw_buffers -------------------------- */ + +#ifndef GL_ARB_draw_buffers +#define GL_ARB_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 +#define GL_DRAW_BUFFER0_ARB 0x8825 +#define GL_DRAW_BUFFER1_ARB 0x8826 +#define GL_DRAW_BUFFER2_ARB 0x8827 +#define GL_DRAW_BUFFER3_ARB 0x8828 +#define GL_DRAW_BUFFER4_ARB 0x8829 +#define GL_DRAW_BUFFER5_ARB 0x882A +#define GL_DRAW_BUFFER6_ARB 0x882B +#define GL_DRAW_BUFFER7_ARB 0x882C +#define GL_DRAW_BUFFER8_ARB 0x882D +#define GL_DRAW_BUFFER9_ARB 0x882E +#define GL_DRAW_BUFFER10_ARB 0x882F +#define GL_DRAW_BUFFER11_ARB 0x8830 +#define GL_DRAW_BUFFER12_ARB 0x8831 +#define GL_DRAW_BUFFER13_ARB 0x8832 +#define GL_DRAW_BUFFER14_ARB 0x8833 +#define GL_DRAW_BUFFER15_ARB 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersARB GLEW_GET_FUN(__glewDrawBuffersARB) + +#define GLEW_ARB_draw_buffers GLEW_GET_VAR(__GLEW_ARB_draw_buffers) + +#endif /* GL_ARB_draw_buffers */ + +/* ----------------------- GL_ARB_draw_buffers_blend ----------------------- */ + +#ifndef GL_ARB_draw_buffers_blend +#define GL_ARB_draw_buffers_blend 1 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEIARBPROC) (GLuint buf, GLenum modeRGB, GLenum modeAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONIARBPROC) (GLuint buf, GLenum mode); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEIARBPROC) (GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha); +typedef void (GLAPIENTRY * PFNGLBLENDFUNCIARBPROC) (GLuint buf, GLenum src, GLenum dst); + +#define glBlendEquationSeparateiARB GLEW_GET_FUN(__glewBlendEquationSeparateiARB) +#define glBlendEquationiARB GLEW_GET_FUN(__glewBlendEquationiARB) +#define glBlendFuncSeparateiARB GLEW_GET_FUN(__glewBlendFuncSeparateiARB) +#define glBlendFunciARB GLEW_GET_FUN(__glewBlendFunciARB) + +#define GLEW_ARB_draw_buffers_blend GLEW_GET_VAR(__GLEW_ARB_draw_buffers_blend) + +#endif /* GL_ARB_draw_buffers_blend */ + +/* -------------------- GL_ARB_draw_elements_base_vertex ------------------- */ + +#ifndef GL_ARB_draw_elements_base_vertex +#define GL_ARB_draw_elements_base_vertex 1 + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, void* indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, void* indices, GLint basevertex); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC) (GLenum mode, GLsizei* count, GLenum type, GLvoid**indices, GLsizei primcount, GLint *basevertex); + +#define glDrawElementsBaseVertex GLEW_GET_FUN(__glewDrawElementsBaseVertex) +#define glDrawElementsInstancedBaseVertex GLEW_GET_FUN(__glewDrawElementsInstancedBaseVertex) +#define glDrawRangeElementsBaseVertex GLEW_GET_FUN(__glewDrawRangeElementsBaseVertex) +#define glMultiDrawElementsBaseVertex GLEW_GET_FUN(__glewMultiDrawElementsBaseVertex) + +#define GLEW_ARB_draw_elements_base_vertex GLEW_GET_VAR(__GLEW_ARB_draw_elements_base_vertex) + +#endif /* GL_ARB_draw_elements_base_vertex */ + +/* -------------------------- GL_ARB_draw_indirect ------------------------- */ + +#ifndef GL_ARB_draw_indirect +#define GL_ARB_draw_indirect 1 + +#define GL_DRAW_INDIRECT_BUFFER 0x8F3F +#define GL_DRAW_INDIRECT_BUFFER_BINDING 0x8F43 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINDIRECTPROC) (GLenum mode, const void* indirect); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINDIRECTPROC) (GLenum mode, GLenum type, const void* indirect); + +#define glDrawArraysIndirect GLEW_GET_FUN(__glewDrawArraysIndirect) +#define glDrawElementsIndirect GLEW_GET_FUN(__glewDrawElementsIndirect) + +#define GLEW_ARB_draw_indirect GLEW_GET_VAR(__GLEW_ARB_draw_indirect) + +#endif /* GL_ARB_draw_indirect */ + +/* ------------------------- GL_ARB_draw_instanced ------------------------- */ + +#ifndef GL_ARB_draw_instanced +#define GL_ARB_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDARBPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDARBPROC) (GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount); + +#define glDrawArraysInstancedARB GLEW_GET_FUN(__glewDrawArraysInstancedARB) +#define glDrawElementsInstancedARB GLEW_GET_FUN(__glewDrawElementsInstancedARB) + +#define GLEW_ARB_draw_instanced GLEW_GET_VAR(__GLEW_ARB_draw_instanced) + +#endif /* GL_ARB_draw_instanced */ + +/* -------------------- GL_ARB_explicit_attrib_location -------------------- */ + +#ifndef GL_ARB_explicit_attrib_location +#define GL_ARB_explicit_attrib_location 1 + +#define GLEW_ARB_explicit_attrib_location GLEW_GET_VAR(__GLEW_ARB_explicit_attrib_location) + +#endif /* GL_ARB_explicit_attrib_location */ + +/* ------------------- GL_ARB_fragment_coord_conventions ------------------- */ + +#ifndef GL_ARB_fragment_coord_conventions +#define GL_ARB_fragment_coord_conventions 1 + +#define GLEW_ARB_fragment_coord_conventions GLEW_GET_VAR(__GLEW_ARB_fragment_coord_conventions) + +#endif /* GL_ARB_fragment_coord_conventions */ + +/* ------------------------ GL_ARB_fragment_program ------------------------ */ + +#ifndef GL_ARB_fragment_program +#define GL_ARB_fragment_program 1 + +#define GL_FRAGMENT_PROGRAM_ARB 0x8804 +#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 +#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 +#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 +#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 +#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 +#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A +#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B +#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C +#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D +#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E +#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F +#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 +#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 + +#define GLEW_ARB_fragment_program GLEW_GET_VAR(__GLEW_ARB_fragment_program) + +#endif /* GL_ARB_fragment_program */ + +/* --------------------- GL_ARB_fragment_program_shadow -------------------- */ + +#ifndef GL_ARB_fragment_program_shadow +#define GL_ARB_fragment_program_shadow 1 + +#define GLEW_ARB_fragment_program_shadow GLEW_GET_VAR(__GLEW_ARB_fragment_program_shadow) + +#endif /* GL_ARB_fragment_program_shadow */ + +/* ------------------------- GL_ARB_fragment_shader ------------------------ */ + +#ifndef GL_ARB_fragment_shader +#define GL_ARB_fragment_shader 1 + +#define GL_FRAGMENT_SHADER_ARB 0x8B30 +#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 +#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B + +#define GLEW_ARB_fragment_shader GLEW_GET_VAR(__GLEW_ARB_fragment_shader) + +#endif /* GL_ARB_fragment_shader */ + +/* ----------------------- GL_ARB_framebuffer_object ----------------------- */ + +#ifndef GL_ARB_framebuffer_object +#define GL_ARB_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506 +#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING 0x8210 +#define GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE 0x8211 +#define GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE 0x8212 +#define GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE 0x8213 +#define GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE 0x8214 +#define GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE 0x8215 +#define GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE 0x8216 +#define GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE 0x8217 +#define GL_FRAMEBUFFER_DEFAULT 0x8218 +#define GL_FRAMEBUFFER_UNDEFINED 0x8219 +#define GL_DEPTH_STENCIL_ATTACHMENT 0x821A +#define GL_INDEX 0x8222 +#define GL_MAX_RENDERBUFFER_SIZE 0x84E8 +#define GL_DEPTH_STENCIL 0x84F9 +#define GL_UNSIGNED_INT_24_8 0x84FA +#define GL_DEPTH24_STENCIL8 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE 0x88F1 +#define GL_UNSIGNED_NORMALIZED 0x8C17 +#define GL_SRGB 0x8C40 +#define GL_DRAW_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_FRAMEBUFFER_BINDING 0x8CA6 +#define GL_RENDERBUFFER_BINDING 0x8CA7 +#define GL_READ_FRAMEBUFFER 0x8CA8 +#define GL_DRAW_FRAMEBUFFER 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING 0x8CAA +#define GL_RENDERBUFFER_SAMPLES 0x8CAB +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS 0x8CDF +#define GL_COLOR_ATTACHMENT0 0x8CE0 +#define GL_COLOR_ATTACHMENT1 0x8CE1 +#define GL_COLOR_ATTACHMENT2 0x8CE2 +#define GL_COLOR_ATTACHMENT3 0x8CE3 +#define GL_COLOR_ATTACHMENT4 0x8CE4 +#define GL_COLOR_ATTACHMENT5 0x8CE5 +#define GL_COLOR_ATTACHMENT6 0x8CE6 +#define GL_COLOR_ATTACHMENT7 0x8CE7 +#define GL_COLOR_ATTACHMENT8 0x8CE8 +#define GL_COLOR_ATTACHMENT9 0x8CE9 +#define GL_COLOR_ATTACHMENT10 0x8CEA +#define GL_COLOR_ATTACHMENT11 0x8CEB +#define GL_COLOR_ATTACHMENT12 0x8CEC +#define GL_COLOR_ATTACHMENT13 0x8CED +#define GL_COLOR_ATTACHMENT14 0x8CEE +#define GL_COLOR_ATTACHMENT15 0x8CEF +#define GL_DEPTH_ATTACHMENT 0x8D00 +#define GL_STENCIL_ATTACHMENT 0x8D20 +#define GL_FRAMEBUFFER 0x8D40 +#define GL_RENDERBUFFER 0x8D41 +#define GL_RENDERBUFFER_WIDTH 0x8D42 +#define GL_RENDERBUFFER_HEIGHT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44 +#define GL_STENCIL_INDEX1 0x8D46 +#define GL_STENCIL_INDEX4 0x8D47 +#define GL_STENCIL_INDEX8 0x8D48 +#define GL_STENCIL_INDEX16 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55 +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE 0x8D56 +#define GL_MAX_SAMPLES 0x8D57 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFERPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERPROC) (GLenum target,GLenum attachment, GLuint texture,GLint level,GLint layer); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebuffer GLEW_GET_FUN(__glewBindFramebuffer) +#define glBindRenderbuffer GLEW_GET_FUN(__glewBindRenderbuffer) +#define glBlitFramebuffer GLEW_GET_FUN(__glewBlitFramebuffer) +#define glCheckFramebufferStatus GLEW_GET_FUN(__glewCheckFramebufferStatus) +#define glDeleteFramebuffers GLEW_GET_FUN(__glewDeleteFramebuffers) +#define glDeleteRenderbuffers GLEW_GET_FUN(__glewDeleteRenderbuffers) +#define glFramebufferRenderbuffer GLEW_GET_FUN(__glewFramebufferRenderbuffer) +#define glFramebufferTexture1D GLEW_GET_FUN(__glewFramebufferTexture1D) +#define glFramebufferTexture2D GLEW_GET_FUN(__glewFramebufferTexture2D) +#define glFramebufferTexture3D GLEW_GET_FUN(__glewFramebufferTexture3D) +#define glFramebufferTextureLayer GLEW_GET_FUN(__glewFramebufferTextureLayer) +#define glGenFramebuffers GLEW_GET_FUN(__glewGenFramebuffers) +#define glGenRenderbuffers GLEW_GET_FUN(__glewGenRenderbuffers) +#define glGenerateMipmap GLEW_GET_FUN(__glewGenerateMipmap) +#define glGetFramebufferAttachmentParameteriv GLEW_GET_FUN(__glewGetFramebufferAttachmentParameteriv) +#define glGetRenderbufferParameteriv GLEW_GET_FUN(__glewGetRenderbufferParameteriv) +#define glIsFramebuffer GLEW_GET_FUN(__glewIsFramebuffer) +#define glIsRenderbuffer GLEW_GET_FUN(__glewIsRenderbuffer) +#define glRenderbufferStorage GLEW_GET_FUN(__glewRenderbufferStorage) +#define glRenderbufferStorageMultisample GLEW_GET_FUN(__glewRenderbufferStorageMultisample) + +#define GLEW_ARB_framebuffer_object GLEW_GET_VAR(__GLEW_ARB_framebuffer_object) + +#endif /* GL_ARB_framebuffer_object */ + +/* ------------------------ GL_ARB_framebuffer_sRGB ------------------------ */ + +#ifndef GL_ARB_framebuffer_sRGB +#define GL_ARB_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB 0x8DB9 + +#define GLEW_ARB_framebuffer_sRGB GLEW_GET_VAR(__GLEW_ARB_framebuffer_sRGB) + +#endif /* GL_ARB_framebuffer_sRGB */ + +/* ------------------------ GL_ARB_geometry_shader4 ------------------------ */ + +#ifndef GL_ARB_geometry_shader4 +#define GL_ARB_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_ARB 0xA +#define GL_LINE_STRIP_ADJACENCY_ARB 0xB +#define GL_TRIANGLES_ADJACENCY_ARB 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_ARB 0xD +#define GL_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB 0x8DA9 +#define GL_GEOMETRY_SHADER_ARB 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_ARB 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_ARB 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_ARB 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_ARB 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYERARBPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIARBPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureARB GLEW_GET_FUN(__glewFramebufferTextureARB) +#define glFramebufferTextureFaceARB GLEW_GET_FUN(__glewFramebufferTextureFaceARB) +#define glFramebufferTextureLayerARB GLEW_GET_FUN(__glewFramebufferTextureLayerARB) +#define glProgramParameteriARB GLEW_GET_FUN(__glewProgramParameteriARB) + +#define GLEW_ARB_geometry_shader4 GLEW_GET_VAR(__GLEW_ARB_geometry_shader4) + +#endif /* GL_ARB_geometry_shader4 */ + +/* ----------------------- GL_ARB_get_program_binary ----------------------- */ + +#ifndef GL_ARB_get_program_binary +#define GL_ARB_get_program_binary 1 + +#define GL_PROGRAM_BINARY_RETRIEVABLE_HINT 0x8257 +#define GL_PROGRAM_BINARY_LENGTH 0x8741 +#define GL_NUM_PROGRAM_BINARY_FORMATS 0x87FE +#define GL_PROGRAM_BINARY_FORMATS 0x87FF + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMBINARYPROC) (GLuint program, GLsizei bufSize, GLsizei* length, GLenum *binaryFormat, GLvoid*binary); +typedef void (GLAPIENTRY * PFNGLPROGRAMBINARYPROC) (GLuint program, GLenum binaryFormat, const void* binary, GLsizei length); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIPROC) (GLuint program, GLenum pname, GLint value); + +#define glGetProgramBinary GLEW_GET_FUN(__glewGetProgramBinary) +#define glProgramBinary GLEW_GET_FUN(__glewProgramBinary) +#define glProgramParameteri GLEW_GET_FUN(__glewProgramParameteri) + +#define GLEW_ARB_get_program_binary GLEW_GET_VAR(__GLEW_ARB_get_program_binary) + +#endif /* GL_ARB_get_program_binary */ + +/* --------------------------- GL_ARB_gpu_shader5 -------------------------- */ + +#ifndef GL_ARB_gpu_shader5 +#define GL_ARB_gpu_shader5 1 + +#define GL_GEOMETRY_SHADER_INVOCATIONS 0x887F +#define GL_MAX_GEOMETRY_SHADER_INVOCATIONS 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET 0x8E5C +#define GL_FRAGMENT_INTERPOLATION_OFFSET_BITS 0x8E5D +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +#define GLEW_ARB_gpu_shader5 GLEW_GET_VAR(__GLEW_ARB_gpu_shader5) + +#endif /* GL_ARB_gpu_shader5 */ + +/* ------------------------- GL_ARB_gpu_shader_fp64 ------------------------ */ + +#ifndef GL_ARB_gpu_shader_fp64 +#define GL_ARB_gpu_shader_fp64 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_MAT2x3 0x8F49 +#define GL_DOUBLE_MAT2x4 0x8F4A +#define GL_DOUBLE_MAT3x2 0x8F4B +#define GL_DOUBLE_MAT3x4 0x8F4C +#define GL_DOUBLE_MAT4x2 0x8F4D +#define GL_DOUBLE_MAT4x3 0x8F4E +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMDVPROC) (GLuint program, GLint location, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DEXTPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DEXTPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DPROC) (GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DPROC) (GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DPROC) (GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4DVPROC) (GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3X4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X2DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4X3DVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); + +#define glGetUniformdv GLEW_GET_FUN(__glewGetUniformdv) +#define glProgramUniform1dEXT GLEW_GET_FUN(__glewProgramUniform1dEXT) +#define glProgramUniform1dvEXT GLEW_GET_FUN(__glewProgramUniform1dvEXT) +#define glProgramUniform2dEXT GLEW_GET_FUN(__glewProgramUniform2dEXT) +#define glProgramUniform2dvEXT GLEW_GET_FUN(__glewProgramUniform2dvEXT) +#define glProgramUniform3dEXT GLEW_GET_FUN(__glewProgramUniform3dEXT) +#define glProgramUniform3dvEXT GLEW_GET_FUN(__glewProgramUniform3dvEXT) +#define glProgramUniform4dEXT GLEW_GET_FUN(__glewProgramUniform4dEXT) +#define glProgramUniform4dvEXT GLEW_GET_FUN(__glewProgramUniform4dvEXT) +#define glProgramUniformMatrix2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2dvEXT) +#define glProgramUniformMatrix2x3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3dvEXT) +#define glProgramUniformMatrix2x4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4dvEXT) +#define glProgramUniformMatrix3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3dvEXT) +#define glProgramUniformMatrix3x2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2dvEXT) +#define glProgramUniformMatrix3x4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4dvEXT) +#define glProgramUniformMatrix4dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4dvEXT) +#define glProgramUniformMatrix4x2dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2dvEXT) +#define glProgramUniformMatrix4x3dvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3dvEXT) +#define glUniform1d GLEW_GET_FUN(__glewUniform1d) +#define glUniform1dv GLEW_GET_FUN(__glewUniform1dv) +#define glUniform2d GLEW_GET_FUN(__glewUniform2d) +#define glUniform2dv GLEW_GET_FUN(__glewUniform2dv) +#define glUniform3d GLEW_GET_FUN(__glewUniform3d) +#define glUniform3dv GLEW_GET_FUN(__glewUniform3dv) +#define glUniform4d GLEW_GET_FUN(__glewUniform4d) +#define glUniform4dv GLEW_GET_FUN(__glewUniform4dv) +#define glUniformMatrix2dv GLEW_GET_FUN(__glewUniformMatrix2dv) +#define glUniformMatrix2x3dv GLEW_GET_FUN(__glewUniformMatrix2x3dv) +#define glUniformMatrix2x4dv GLEW_GET_FUN(__glewUniformMatrix2x4dv) +#define glUniformMatrix3dv GLEW_GET_FUN(__glewUniformMatrix3dv) +#define glUniformMatrix3x2dv GLEW_GET_FUN(__glewUniformMatrix3x2dv) +#define glUniformMatrix3x4dv GLEW_GET_FUN(__glewUniformMatrix3x4dv) +#define glUniformMatrix4dv GLEW_GET_FUN(__glewUniformMatrix4dv) +#define glUniformMatrix4x2dv GLEW_GET_FUN(__glewUniformMatrix4x2dv) +#define glUniformMatrix4x3dv GLEW_GET_FUN(__glewUniformMatrix4x3dv) + +#define GLEW_ARB_gpu_shader_fp64 GLEW_GET_VAR(__GLEW_ARB_gpu_shader_fp64) + +#endif /* GL_ARB_gpu_shader_fp64 */ + +/* ------------------------ GL_ARB_half_float_pixel ------------------------ */ + +#ifndef GL_ARB_half_float_pixel +#define GL_ARB_half_float_pixel 1 + +#define GL_HALF_FLOAT_ARB 0x140B + +#define GLEW_ARB_half_float_pixel GLEW_GET_VAR(__GLEW_ARB_half_float_pixel) + +#endif /* GL_ARB_half_float_pixel */ + +/* ------------------------ GL_ARB_half_float_vertex ----------------------- */ + +#ifndef GL_ARB_half_float_vertex +#define GL_ARB_half_float_vertex 1 + +#define GL_HALF_FLOAT 0x140B + +#define GLEW_ARB_half_float_vertex GLEW_GET_VAR(__GLEW_ARB_half_float_vertex) + +#endif /* GL_ARB_half_float_vertex */ + +/* ----------------------------- GL_ARB_imaging ---------------------------- */ + +#ifndef GL_ARB_imaging +#define GL_ARB_imaging 1 + +#define GL_CONSTANT_COLOR 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 +#define GL_CONSTANT_ALPHA 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 +#define GL_BLEND_COLOR 0x8005 +#define GL_FUNC_ADD 0x8006 +#define GL_MIN 0x8007 +#define GL_MAX 0x8008 +#define GL_BLEND_EQUATION 0x8009 +#define GL_FUNC_SUBTRACT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT 0x800B +#define GL_CONVOLUTION_1D 0x8010 +#define GL_CONVOLUTION_2D 0x8011 +#define GL_SEPARABLE_2D 0x8012 +#define GL_CONVOLUTION_BORDER_MODE 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS 0x8015 +#define GL_REDUCE 0x8016 +#define GL_CONVOLUTION_FORMAT 0x8017 +#define GL_CONVOLUTION_WIDTH 0x8018 +#define GL_CONVOLUTION_HEIGHT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 +#define GL_HISTOGRAM 0x8024 +#define GL_PROXY_HISTOGRAM 0x8025 +#define GL_HISTOGRAM_WIDTH 0x8026 +#define GL_HISTOGRAM_FORMAT 0x8027 +#define GL_HISTOGRAM_RED_SIZE 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C +#define GL_HISTOGRAM_SINK 0x802D +#define GL_MINMAX 0x802E +#define GL_MINMAX_FORMAT 0x802F +#define GL_MINMAX_SINK 0x8030 +#define GL_TABLE_TOO_LARGE 0x8031 +#define GL_COLOR_MATRIX 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB +#define GL_COLOR_TABLE 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 +#define GL_PROXY_COLOR_TABLE 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 +#define GL_COLOR_TABLE_SCALE 0x80D6 +#define GL_COLOR_TABLE_BIAS 0x80D7 +#define GL_COLOR_TABLE_FORMAT 0x80D8 +#define GL_COLOR_TABLE_WIDTH 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF +#define GL_IGNORE_BORDER 0x8150 +#define GL_CONSTANT_BORDER 0x8151 +#define GL_WRAP_BORDER 0x8152 +#define GL_REPLICATE_BORDER 0x8153 +#define GL_CONVOLUTION_BORDER_COLOR 0x8154 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum types, GLvoid *values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); + +#define glColorSubTable GLEW_GET_FUN(__glewColorSubTable) +#define glColorTable GLEW_GET_FUN(__glewColorTable) +#define glColorTableParameterfv GLEW_GET_FUN(__glewColorTableParameterfv) +#define glColorTableParameteriv GLEW_GET_FUN(__glewColorTableParameteriv) +#define glConvolutionFilter1D GLEW_GET_FUN(__glewConvolutionFilter1D) +#define glConvolutionFilter2D GLEW_GET_FUN(__glewConvolutionFilter2D) +#define glConvolutionParameterf GLEW_GET_FUN(__glewConvolutionParameterf) +#define glConvolutionParameterfv GLEW_GET_FUN(__glewConvolutionParameterfv) +#define glConvolutionParameteri GLEW_GET_FUN(__glewConvolutionParameteri) +#define glConvolutionParameteriv GLEW_GET_FUN(__glewConvolutionParameteriv) +#define glCopyColorSubTable GLEW_GET_FUN(__glewCopyColorSubTable) +#define glCopyColorTable GLEW_GET_FUN(__glewCopyColorTable) +#define glCopyConvolutionFilter1D GLEW_GET_FUN(__glewCopyConvolutionFilter1D) +#define glCopyConvolutionFilter2D GLEW_GET_FUN(__glewCopyConvolutionFilter2D) +#define glGetColorTable GLEW_GET_FUN(__glewGetColorTable) +#define glGetColorTableParameterfv GLEW_GET_FUN(__glewGetColorTableParameterfv) +#define glGetColorTableParameteriv GLEW_GET_FUN(__glewGetColorTableParameteriv) +#define glGetConvolutionFilter GLEW_GET_FUN(__glewGetConvolutionFilter) +#define glGetConvolutionParameterfv GLEW_GET_FUN(__glewGetConvolutionParameterfv) +#define glGetConvolutionParameteriv GLEW_GET_FUN(__glewGetConvolutionParameteriv) +#define glGetHistogram GLEW_GET_FUN(__glewGetHistogram) +#define glGetHistogramParameterfv GLEW_GET_FUN(__glewGetHistogramParameterfv) +#define glGetHistogramParameteriv GLEW_GET_FUN(__glewGetHistogramParameteriv) +#define glGetMinmax GLEW_GET_FUN(__glewGetMinmax) +#define glGetMinmaxParameterfv GLEW_GET_FUN(__glewGetMinmaxParameterfv) +#define glGetMinmaxParameteriv GLEW_GET_FUN(__glewGetMinmaxParameteriv) +#define glGetSeparableFilter GLEW_GET_FUN(__glewGetSeparableFilter) +#define glHistogram GLEW_GET_FUN(__glewHistogram) +#define glMinmax GLEW_GET_FUN(__glewMinmax) +#define glResetHistogram GLEW_GET_FUN(__glewResetHistogram) +#define glResetMinmax GLEW_GET_FUN(__glewResetMinmax) +#define glSeparableFilter2D GLEW_GET_FUN(__glewSeparableFilter2D) + +#define GLEW_ARB_imaging GLEW_GET_VAR(__GLEW_ARB_imaging) + +#endif /* GL_ARB_imaging */ + +/* ------------------------ GL_ARB_instanced_arrays ------------------------ */ + +#ifndef GL_ARB_instanced_arrays +#define GL_ARB_instanced_arrays 1 + +#define GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB 0x88FE + +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBDIVISORARBPROC) (GLuint index, GLuint divisor); + +#define glVertexAttribDivisorARB GLEW_GET_FUN(__glewVertexAttribDivisorARB) + +#define GLEW_ARB_instanced_arrays GLEW_GET_VAR(__GLEW_ARB_instanced_arrays) + +#endif /* GL_ARB_instanced_arrays */ + +/* ------------------------ GL_ARB_map_buffer_range ------------------------ */ + +#ifndef GL_ARB_map_buffer_range +#define GL_ARB_map_buffer_range 1 + +#define GL_MAP_READ_BIT 0x0001 +#define GL_MAP_WRITE_BIT 0x0002 +#define GL_MAP_INVALIDATE_RANGE_BIT 0x0004 +#define GL_MAP_INVALIDATE_BUFFER_BIT 0x0008 +#define GL_MAP_FLUSH_EXPLICIT_BIT 0x0010 +#define GL_MAP_UNSYNCHRONIZED_BIT 0x0020 + +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERRANGEPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access); + +#define glFlushMappedBufferRange GLEW_GET_FUN(__glewFlushMappedBufferRange) +#define glMapBufferRange GLEW_GET_FUN(__glewMapBufferRange) + +#define GLEW_ARB_map_buffer_range GLEW_GET_VAR(__GLEW_ARB_map_buffer_range) + +#endif /* GL_ARB_map_buffer_range */ + +/* ------------------------- GL_ARB_matrix_palette ------------------------- */ + +#ifndef GL_ARB_matrix_palette +#define GL_ARB_matrix_palette 1 + +#define GL_MATRIX_PALETTE_ARB 0x8840 +#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 +#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 +#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 +#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 +#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 +#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 +#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 +#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 +#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 + +typedef void (GLAPIENTRY * PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUBVARBPROC) (GLint size, GLubyte *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUIVARBPROC) (GLint size, GLuint *indices); +typedef void (GLAPIENTRY * PFNGLMATRIXINDEXUSVARBPROC) (GLint size, GLushort *indices); + +#define glCurrentPaletteMatrixARB GLEW_GET_FUN(__glewCurrentPaletteMatrixARB) +#define glMatrixIndexPointerARB GLEW_GET_FUN(__glewMatrixIndexPointerARB) +#define glMatrixIndexubvARB GLEW_GET_FUN(__glewMatrixIndexubvARB) +#define glMatrixIndexuivARB GLEW_GET_FUN(__glewMatrixIndexuivARB) +#define glMatrixIndexusvARB GLEW_GET_FUN(__glewMatrixIndexusvARB) + +#define GLEW_ARB_matrix_palette GLEW_GET_VAR(__GLEW_ARB_matrix_palette) + +#endif /* GL_ARB_matrix_palette */ + +/* --------------------------- GL_ARB_multisample -------------------------- */ + +#ifndef GL_ARB_multisample +#define GL_ARB_multisample 1 + +#define GL_MULTISAMPLE_ARB 0x809D +#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F +#define GL_SAMPLE_COVERAGE_ARB 0x80A0 +#define GL_SAMPLE_BUFFERS_ARB 0x80A8 +#define GL_SAMPLES_ARB 0x80A9 +#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA +#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB +#define GL_MULTISAMPLE_BIT_ARB 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); + +#define glSampleCoverageARB GLEW_GET_FUN(__glewSampleCoverageARB) + +#define GLEW_ARB_multisample GLEW_GET_VAR(__GLEW_ARB_multisample) + +#endif /* GL_ARB_multisample */ + +/* -------------------------- GL_ARB_multitexture -------------------------- */ + +#ifndef GL_ARB_multitexture +#define GL_ARB_multitexture 1 + +#define GL_TEXTURE0_ARB 0x84C0 +#define GL_TEXTURE1_ARB 0x84C1 +#define GL_TEXTURE2_ARB 0x84C2 +#define GL_TEXTURE3_ARB 0x84C3 +#define GL_TEXTURE4_ARB 0x84C4 +#define GL_TEXTURE5_ARB 0x84C5 +#define GL_TEXTURE6_ARB 0x84C6 +#define GL_TEXTURE7_ARB 0x84C7 +#define GL_TEXTURE8_ARB 0x84C8 +#define GL_TEXTURE9_ARB 0x84C9 +#define GL_TEXTURE10_ARB 0x84CA +#define GL_TEXTURE11_ARB 0x84CB +#define GL_TEXTURE12_ARB 0x84CC +#define GL_TEXTURE13_ARB 0x84CD +#define GL_TEXTURE14_ARB 0x84CE +#define GL_TEXTURE15_ARB 0x84CF +#define GL_TEXTURE16_ARB 0x84D0 +#define GL_TEXTURE17_ARB 0x84D1 +#define GL_TEXTURE18_ARB 0x84D2 +#define GL_TEXTURE19_ARB 0x84D3 +#define GL_TEXTURE20_ARB 0x84D4 +#define GL_TEXTURE21_ARB 0x84D5 +#define GL_TEXTURE22_ARB 0x84D6 +#define GL_TEXTURE23_ARB 0x84D7 +#define GL_TEXTURE24_ARB 0x84D8 +#define GL_TEXTURE25_ARB 0x84D9 +#define GL_TEXTURE26_ARB 0x84DA +#define GL_TEXTURE27_ARB 0x84DB +#define GL_TEXTURE28_ARB 0x84DC +#define GL_TEXTURE29_ARB 0x84DD +#define GL_TEXTURE30_ARB 0x84DE +#define GL_TEXTURE31_ARB 0x84DF +#define GL_ACTIVE_TEXTURE_ARB 0x84E0 +#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 +#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 + +typedef void (GLAPIENTRY * PFNGLACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); + +#define glActiveTextureARB GLEW_GET_FUN(__glewActiveTextureARB) +#define glClientActiveTextureARB GLEW_GET_FUN(__glewClientActiveTextureARB) +#define glMultiTexCoord1dARB GLEW_GET_FUN(__glewMultiTexCoord1dARB) +#define glMultiTexCoord1dvARB GLEW_GET_FUN(__glewMultiTexCoord1dvARB) +#define glMultiTexCoord1fARB GLEW_GET_FUN(__glewMultiTexCoord1fARB) +#define glMultiTexCoord1fvARB GLEW_GET_FUN(__glewMultiTexCoord1fvARB) +#define glMultiTexCoord1iARB GLEW_GET_FUN(__glewMultiTexCoord1iARB) +#define glMultiTexCoord1ivARB GLEW_GET_FUN(__glewMultiTexCoord1ivARB) +#define glMultiTexCoord1sARB GLEW_GET_FUN(__glewMultiTexCoord1sARB) +#define glMultiTexCoord1svARB GLEW_GET_FUN(__glewMultiTexCoord1svARB) +#define glMultiTexCoord2dARB GLEW_GET_FUN(__glewMultiTexCoord2dARB) +#define glMultiTexCoord2dvARB GLEW_GET_FUN(__glewMultiTexCoord2dvARB) +#define glMultiTexCoord2fARB GLEW_GET_FUN(__glewMultiTexCoord2fARB) +#define glMultiTexCoord2fvARB GLEW_GET_FUN(__glewMultiTexCoord2fvARB) +#define glMultiTexCoord2iARB GLEW_GET_FUN(__glewMultiTexCoord2iARB) +#define glMultiTexCoord2ivARB GLEW_GET_FUN(__glewMultiTexCoord2ivARB) +#define glMultiTexCoord2sARB GLEW_GET_FUN(__glewMultiTexCoord2sARB) +#define glMultiTexCoord2svARB GLEW_GET_FUN(__glewMultiTexCoord2svARB) +#define glMultiTexCoord3dARB GLEW_GET_FUN(__glewMultiTexCoord3dARB) +#define glMultiTexCoord3dvARB GLEW_GET_FUN(__glewMultiTexCoord3dvARB) +#define glMultiTexCoord3fARB GLEW_GET_FUN(__glewMultiTexCoord3fARB) +#define glMultiTexCoord3fvARB GLEW_GET_FUN(__glewMultiTexCoord3fvARB) +#define glMultiTexCoord3iARB GLEW_GET_FUN(__glewMultiTexCoord3iARB) +#define glMultiTexCoord3ivARB GLEW_GET_FUN(__glewMultiTexCoord3ivARB) +#define glMultiTexCoord3sARB GLEW_GET_FUN(__glewMultiTexCoord3sARB) +#define glMultiTexCoord3svARB GLEW_GET_FUN(__glewMultiTexCoord3svARB) +#define glMultiTexCoord4dARB GLEW_GET_FUN(__glewMultiTexCoord4dARB) +#define glMultiTexCoord4dvARB GLEW_GET_FUN(__glewMultiTexCoord4dvARB) +#define glMultiTexCoord4fARB GLEW_GET_FUN(__glewMultiTexCoord4fARB) +#define glMultiTexCoord4fvARB GLEW_GET_FUN(__glewMultiTexCoord4fvARB) +#define glMultiTexCoord4iARB GLEW_GET_FUN(__glewMultiTexCoord4iARB) +#define glMultiTexCoord4ivARB GLEW_GET_FUN(__glewMultiTexCoord4ivARB) +#define glMultiTexCoord4sARB GLEW_GET_FUN(__glewMultiTexCoord4sARB) +#define glMultiTexCoord4svARB GLEW_GET_FUN(__glewMultiTexCoord4svARB) + +#define GLEW_ARB_multitexture GLEW_GET_VAR(__GLEW_ARB_multitexture) + +#endif /* GL_ARB_multitexture */ + +/* ------------------------- GL_ARB_occlusion_query ------------------------ */ + +#ifndef GL_ARB_occlusion_query +#define GL_ARB_occlusion_query 1 + +#define GL_QUERY_COUNTER_BITS_ARB 0x8864 +#define GL_CURRENT_QUERY_ARB 0x8865 +#define GL_QUERY_RESULT_ARB 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 +#define GL_SAMPLES_PASSED_ARB 0x8914 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDQUERYARBPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISQUERYARBPROC) (GLuint id); + +#define glBeginQueryARB GLEW_GET_FUN(__glewBeginQueryARB) +#define glDeleteQueriesARB GLEW_GET_FUN(__glewDeleteQueriesARB) +#define glEndQueryARB GLEW_GET_FUN(__glewEndQueryARB) +#define glGenQueriesARB GLEW_GET_FUN(__glewGenQueriesARB) +#define glGetQueryObjectivARB GLEW_GET_FUN(__glewGetQueryObjectivARB) +#define glGetQueryObjectuivARB GLEW_GET_FUN(__glewGetQueryObjectuivARB) +#define glGetQueryivARB GLEW_GET_FUN(__glewGetQueryivARB) +#define glIsQueryARB GLEW_GET_FUN(__glewIsQueryARB) + +#define GLEW_ARB_occlusion_query GLEW_GET_VAR(__GLEW_ARB_occlusion_query) + +#endif /* GL_ARB_occlusion_query */ + +/* ------------------------ GL_ARB_occlusion_query2 ------------------------ */ + +#ifndef GL_ARB_occlusion_query2 +#define GL_ARB_occlusion_query2 1 + +#define GL_ANY_SAMPLES_PASSED 0x8C2F + +#define GLEW_ARB_occlusion_query2 GLEW_GET_VAR(__GLEW_ARB_occlusion_query2) + +#endif /* GL_ARB_occlusion_query2 */ + +/* ----------------------- GL_ARB_pixel_buffer_object ---------------------- */ + +#ifndef GL_ARB_pixel_buffer_object +#define GL_ARB_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF + +#define GLEW_ARB_pixel_buffer_object GLEW_GET_VAR(__GLEW_ARB_pixel_buffer_object) + +#endif /* GL_ARB_pixel_buffer_object */ + +/* ------------------------ GL_ARB_point_parameters ------------------------ */ + +#ifndef GL_ARB_point_parameters +#define GL_ARB_point_parameters 1 + +#define GL_POINT_SIZE_MIN_ARB 0x8126 +#define GL_POINT_SIZE_MAX_ARB 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 +#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfARB GLEW_GET_FUN(__glewPointParameterfARB) +#define glPointParameterfvARB GLEW_GET_FUN(__glewPointParameterfvARB) + +#define GLEW_ARB_point_parameters GLEW_GET_VAR(__GLEW_ARB_point_parameters) + +#endif /* GL_ARB_point_parameters */ + +/* -------------------------- GL_ARB_point_sprite -------------------------- */ + +#ifndef GL_ARB_point_sprite +#define GL_ARB_point_sprite 1 + +#define GL_POINT_SPRITE_ARB 0x8861 +#define GL_COORD_REPLACE_ARB 0x8862 + +#define GLEW_ARB_point_sprite GLEW_GET_VAR(__GLEW_ARB_point_sprite) + +#endif /* GL_ARB_point_sprite */ + +/* ------------------------ GL_ARB_provoking_vertex ------------------------ */ + +#ifndef GL_ARB_provoking_vertex +#define GL_ARB_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXPROC) (GLenum mode); + +#define glProvokingVertex GLEW_GET_FUN(__glewProvokingVertex) + +#define GLEW_ARB_provoking_vertex GLEW_GET_VAR(__GLEW_ARB_provoking_vertex) + +#endif /* GL_ARB_provoking_vertex */ + +/* --------------------------- GL_ARB_robustness --------------------------- */ + +#ifndef GL_ARB_robustness +#define GL_ARB_robustness 1 + +#define GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GL_GUILTY_CONTEXT_RESET_ARB 0x8253 +#define GL_INNOCENT_CONTEXT_RESET_ARB 0x8254 +#define GL_UNKNOWN_CONTEXT_RESET_ARB 0x8255 +#define GL_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GL_NO_RESET_NOTIFICATION_ARB 0x8261 + +typedef void (GLAPIENTRY * PFNGLGETNCOLORTABLEARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* table); +typedef void (GLAPIENTRY * PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNCONVOLUTIONFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei bufSize, void* image); +typedef void (GLAPIENTRY * PFNGLGETNHISTOGRAMARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNMAPDVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLdouble* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPFVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLfloat* v); +typedef void (GLAPIENTRY * PFNGLGETNMAPIVARBPROC) (GLenum target, GLenum query, GLsizei bufSize, GLint* v); +typedef void (GLAPIENTRY * PFNGLGETNMINMAXARBPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLsizei bufSize, void* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPFVARBPROC) (GLenum map, GLsizei bufSize, GLfloat* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUIVARBPROC) (GLenum map, GLsizei bufSize, GLuint* values); +typedef void (GLAPIENTRY * PFNGLGETNPIXELMAPUSVARBPROC) (GLenum map, GLsizei bufSize, GLushort* values); +typedef void (GLAPIENTRY * PFNGLGETNPOLYGONSTIPPLEARBPROC) (GLsizei bufSize, GLubyte* pattern); +typedef void (GLAPIENTRY * PFNGLGETNSEPARABLEFILTERARBPROC) (GLenum target, GLenum format, GLenum type, GLsizei rowBufSize, void* row, GLsizei columnBufSize, GLvoid*column, GLvoid*span); +typedef void (GLAPIENTRY * PFNGLGETNTEXIMAGEARBPROC) (GLenum target, GLint level, GLenum format, GLenum type, GLsizei bufSize, void* img); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMFVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNUNIFORMUIVARBPROC) (GLuint program, GLint location, GLsizei bufSize, GLuint* params); +typedef void (GLAPIENTRY * PFNGLREADNPIXELSARBPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void* data); + +#define glGetnColorTableARB GLEW_GET_FUN(__glewGetnColorTableARB) +#define glGetnCompressedTexImageARB GLEW_GET_FUN(__glewGetnCompressedTexImageARB) +#define glGetnConvolutionFilterARB GLEW_GET_FUN(__glewGetnConvolutionFilterARB) +#define glGetnHistogramARB GLEW_GET_FUN(__glewGetnHistogramARB) +#define glGetnMapdvARB GLEW_GET_FUN(__glewGetnMapdvARB) +#define glGetnMapfvARB GLEW_GET_FUN(__glewGetnMapfvARB) +#define glGetnMapivARB GLEW_GET_FUN(__glewGetnMapivARB) +#define glGetnMinmaxARB GLEW_GET_FUN(__glewGetnMinmaxARB) +#define glGetnPixelMapfvARB GLEW_GET_FUN(__glewGetnPixelMapfvARB) +#define glGetnPixelMapuivARB GLEW_GET_FUN(__glewGetnPixelMapuivARB) +#define glGetnPixelMapusvARB GLEW_GET_FUN(__glewGetnPixelMapusvARB) +#define glGetnPolygonStippleARB GLEW_GET_FUN(__glewGetnPolygonStippleARB) +#define glGetnSeparableFilterARB GLEW_GET_FUN(__glewGetnSeparableFilterARB) +#define glGetnTexImageARB GLEW_GET_FUN(__glewGetnTexImageARB) +#define glGetnUniformdvARB GLEW_GET_FUN(__glewGetnUniformdvARB) +#define glGetnUniformfvARB GLEW_GET_FUN(__glewGetnUniformfvARB) +#define glGetnUniformivARB GLEW_GET_FUN(__glewGetnUniformivARB) +#define glGetnUniformuivARB GLEW_GET_FUN(__glewGetnUniformuivARB) +#define glReadnPixelsARB GLEW_GET_FUN(__glewReadnPixelsARB) + +#define GLEW_ARB_robustness GLEW_GET_VAR(__GLEW_ARB_robustness) + +#endif /* GL_ARB_robustness */ + +/* ------------------------- GL_ARB_sample_shading ------------------------- */ + +#ifndef GL_ARB_sample_shading +#define GL_ARB_sample_shading 1 + +#define GL_SAMPLE_SHADING_ARB 0x8C36 +#define GL_MIN_SAMPLE_SHADING_VALUE_ARB 0x8C37 + +typedef void (GLAPIENTRY * PFNGLMINSAMPLESHADINGARBPROC) (GLclampf value); + +#define glMinSampleShadingARB GLEW_GET_FUN(__glewMinSampleShadingARB) + +#define GLEW_ARB_sample_shading GLEW_GET_VAR(__GLEW_ARB_sample_shading) + +#endif /* GL_ARB_sample_shading */ + +/* ------------------------- GL_ARB_sampler_objects ------------------------ */ + +#ifndef GL_ARB_sampler_objects +#define GL_ARB_sampler_objects 1 + +#define GL_SAMPLER_BINDING 0x8919 + +typedef void (GLAPIENTRY * PFNGLBINDSAMPLERPROC) (GLuint unit, GLuint sampler); +typedef void (GLAPIENTRY * PFNGLDELETESAMPLERSPROC) (GLsizei count, const GLuint * samplers); +typedef void (GLAPIENTRY * PFNGLGENSAMPLERSPROC) (GLsizei count, GLuint* samplers); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISSAMPLERPROC) (GLuint sampler); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIIVPROC) (GLuint sampler, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFPROC) (GLuint sampler, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIPROC) (GLuint sampler, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSAMPLERPARAMETERIVPROC) (GLuint sampler, GLenum pname, const GLint* params); + +#define glBindSampler GLEW_GET_FUN(__glewBindSampler) +#define glDeleteSamplers GLEW_GET_FUN(__glewDeleteSamplers) +#define glGenSamplers GLEW_GET_FUN(__glewGenSamplers) +#define glGetSamplerParameterIiv GLEW_GET_FUN(__glewGetSamplerParameterIiv) +#define glGetSamplerParameterIuiv GLEW_GET_FUN(__glewGetSamplerParameterIuiv) +#define glGetSamplerParameterfv GLEW_GET_FUN(__glewGetSamplerParameterfv) +#define glGetSamplerParameteriv GLEW_GET_FUN(__glewGetSamplerParameteriv) +#define glIsSampler GLEW_GET_FUN(__glewIsSampler) +#define glSamplerParameterIiv GLEW_GET_FUN(__glewSamplerParameterIiv) +#define glSamplerParameterIuiv GLEW_GET_FUN(__glewSamplerParameterIuiv) +#define glSamplerParameterf GLEW_GET_FUN(__glewSamplerParameterf) +#define glSamplerParameterfv GLEW_GET_FUN(__glewSamplerParameterfv) +#define glSamplerParameteri GLEW_GET_FUN(__glewSamplerParameteri) +#define glSamplerParameteriv GLEW_GET_FUN(__glewSamplerParameteriv) + +#define GLEW_ARB_sampler_objects GLEW_GET_VAR(__GLEW_ARB_sampler_objects) + +#endif /* GL_ARB_sampler_objects */ + +/* ------------------------ GL_ARB_seamless_cube_map ----------------------- */ + +#ifndef GL_ARB_seamless_cube_map +#define GL_ARB_seamless_cube_map 1 + +#define GL_TEXTURE_CUBE_MAP_SEAMLESS 0x884F + +#define GLEW_ARB_seamless_cube_map GLEW_GET_VAR(__GLEW_ARB_seamless_cube_map) + +#endif /* GL_ARB_seamless_cube_map */ + +/* --------------------- GL_ARB_separate_shader_objects -------------------- */ + +#ifndef GL_ARB_separate_shader_objects +#define GL_ARB_separate_shader_objects 1 + +#define GL_VERTEX_SHADER_BIT 0x00000001 +#define GL_FRAGMENT_SHADER_BIT 0x00000002 +#define GL_GEOMETRY_SHADER_BIT 0x00000004 +#define GL_TESS_CONTROL_SHADER_BIT 0x00000008 +#define GL_TESS_EVALUATION_SHADER_BIT 0x00000010 +#define GL_PROGRAM_SEPARABLE 0x8258 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_ALL_SHADER_BITS 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLACTIVESHADERPROGRAMPROC) (GLuint pipeline, GLuint program); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMVPROC) (GLenum type, GLsizei count, const char ** strings); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMPIPELINESPROC) (GLsizei n, const GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMPIPELINESPROC) (GLsizei n, GLuint* pipelines); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEINFOLOGPROC) (GLuint pipeline, GLsizei bufSize, GLsizei* length, char *infoLog); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPIPELINEIVPROC) (GLuint pipeline, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMPIPELINEPROC) (GLuint pipeline); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DPROC) (GLuint program, GLint location, GLdouble x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FPROC) (GLuint program, GLint location, GLfloat x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IPROC) (GLuint program, GLint location, GLint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIPROC) (GLuint program, GLint location, GLuint x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IPROC) (GLuint program, GLint location, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIPROC) (GLuint program, GLint location, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DPROC) (GLuint program, GLint location, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4DVPROC) (GLuint program, GLint location, GLsizei count, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FPROC) (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IPROC) (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIPROC) (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLdouble* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMSTAGESPROC) (GLuint pipeline, GLbitfield stages, GLuint program); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMPIPELINEPROC) (GLuint pipeline); + +#define glActiveShaderProgram GLEW_GET_FUN(__glewActiveShaderProgram) +#define glBindProgramPipeline GLEW_GET_FUN(__glewBindProgramPipeline) +#define glCreateShaderProgramv GLEW_GET_FUN(__glewCreateShaderProgramv) +#define glDeleteProgramPipelines GLEW_GET_FUN(__glewDeleteProgramPipelines) +#define glGenProgramPipelines GLEW_GET_FUN(__glewGenProgramPipelines) +#define glGetProgramPipelineInfoLog GLEW_GET_FUN(__glewGetProgramPipelineInfoLog) +#define glGetProgramPipelineiv GLEW_GET_FUN(__glewGetProgramPipelineiv) +#define glIsProgramPipeline GLEW_GET_FUN(__glewIsProgramPipeline) +#define glProgramUniform1d GLEW_GET_FUN(__glewProgramUniform1d) +#define glProgramUniform1dv GLEW_GET_FUN(__glewProgramUniform1dv) +#define glProgramUniform1f GLEW_GET_FUN(__glewProgramUniform1f) +#define glProgramUniform1fv GLEW_GET_FUN(__glewProgramUniform1fv) +#define glProgramUniform1i GLEW_GET_FUN(__glewProgramUniform1i) +#define glProgramUniform1iv GLEW_GET_FUN(__glewProgramUniform1iv) +#define glProgramUniform1ui GLEW_GET_FUN(__glewProgramUniform1ui) +#define glProgramUniform1uiv GLEW_GET_FUN(__glewProgramUniform1uiv) +#define glProgramUniform2d GLEW_GET_FUN(__glewProgramUniform2d) +#define glProgramUniform2dv GLEW_GET_FUN(__glewProgramUniform2dv) +#define glProgramUniform2f GLEW_GET_FUN(__glewProgramUniform2f) +#define glProgramUniform2fv GLEW_GET_FUN(__glewProgramUniform2fv) +#define glProgramUniform2i GLEW_GET_FUN(__glewProgramUniform2i) +#define glProgramUniform2iv GLEW_GET_FUN(__glewProgramUniform2iv) +#define glProgramUniform2ui GLEW_GET_FUN(__glewProgramUniform2ui) +#define glProgramUniform2uiv GLEW_GET_FUN(__glewProgramUniform2uiv) +#define glProgramUniform3d GLEW_GET_FUN(__glewProgramUniform3d) +#define glProgramUniform3dv GLEW_GET_FUN(__glewProgramUniform3dv) +#define glProgramUniform3f GLEW_GET_FUN(__glewProgramUniform3f) +#define glProgramUniform3fv GLEW_GET_FUN(__glewProgramUniform3fv) +#define glProgramUniform3i GLEW_GET_FUN(__glewProgramUniform3i) +#define glProgramUniform3iv GLEW_GET_FUN(__glewProgramUniform3iv) +#define glProgramUniform3ui GLEW_GET_FUN(__glewProgramUniform3ui) +#define glProgramUniform3uiv GLEW_GET_FUN(__glewProgramUniform3uiv) +#define glProgramUniform4d GLEW_GET_FUN(__glewProgramUniform4d) +#define glProgramUniform4dv GLEW_GET_FUN(__glewProgramUniform4dv) +#define glProgramUniform4f GLEW_GET_FUN(__glewProgramUniform4f) +#define glProgramUniform4fv GLEW_GET_FUN(__glewProgramUniform4fv) +#define glProgramUniform4i GLEW_GET_FUN(__glewProgramUniform4i) +#define glProgramUniform4iv GLEW_GET_FUN(__glewProgramUniform4iv) +#define glProgramUniform4ui GLEW_GET_FUN(__glewProgramUniform4ui) +#define glProgramUniform4uiv GLEW_GET_FUN(__glewProgramUniform4uiv) +#define glProgramUniformMatrix2dv GLEW_GET_FUN(__glewProgramUniformMatrix2dv) +#define glProgramUniformMatrix2fv GLEW_GET_FUN(__glewProgramUniformMatrix2fv) +#define glProgramUniformMatrix2x3dv GLEW_GET_FUN(__glewProgramUniformMatrix2x3dv) +#define glProgramUniformMatrix2x3fv GLEW_GET_FUN(__glewProgramUniformMatrix2x3fv) +#define glProgramUniformMatrix2x4dv GLEW_GET_FUN(__glewProgramUniformMatrix2x4dv) +#define glProgramUniformMatrix2x4fv GLEW_GET_FUN(__glewProgramUniformMatrix2x4fv) +#define glProgramUniformMatrix3dv GLEW_GET_FUN(__glewProgramUniformMatrix3dv) +#define glProgramUniformMatrix3fv GLEW_GET_FUN(__glewProgramUniformMatrix3fv) +#define glProgramUniformMatrix3x2dv GLEW_GET_FUN(__glewProgramUniformMatrix3x2dv) +#define glProgramUniformMatrix3x2fv GLEW_GET_FUN(__glewProgramUniformMatrix3x2fv) +#define glProgramUniformMatrix3x4dv GLEW_GET_FUN(__glewProgramUniformMatrix3x4dv) +#define glProgramUniformMatrix3x4fv GLEW_GET_FUN(__glewProgramUniformMatrix3x4fv) +#define glProgramUniformMatrix4dv GLEW_GET_FUN(__glewProgramUniformMatrix4dv) +#define glProgramUniformMatrix4fv GLEW_GET_FUN(__glewProgramUniformMatrix4fv) +#define glProgramUniformMatrix4x2dv GLEW_GET_FUN(__glewProgramUniformMatrix4x2dv) +#define glProgramUniformMatrix4x2fv GLEW_GET_FUN(__glewProgramUniformMatrix4x2fv) +#define glProgramUniformMatrix4x3dv GLEW_GET_FUN(__glewProgramUniformMatrix4x3dv) +#define glProgramUniformMatrix4x3fv GLEW_GET_FUN(__glewProgramUniformMatrix4x3fv) +#define glUseProgramStages GLEW_GET_FUN(__glewUseProgramStages) +#define glValidateProgramPipeline GLEW_GET_FUN(__glewValidateProgramPipeline) + +#define GLEW_ARB_separate_shader_objects GLEW_GET_VAR(__GLEW_ARB_separate_shader_objects) + +#endif /* GL_ARB_separate_shader_objects */ + +/* ----------------------- GL_ARB_shader_bit_encoding ---------------------- */ + +#ifndef GL_ARB_shader_bit_encoding +#define GL_ARB_shader_bit_encoding 1 + +#define GLEW_ARB_shader_bit_encoding GLEW_GET_VAR(__GLEW_ARB_shader_bit_encoding) + +#endif /* GL_ARB_shader_bit_encoding */ + +/* ------------------------- GL_ARB_shader_objects ------------------------- */ + +#ifndef GL_ARB_shader_objects +#define GL_ARB_shader_objects 1 + +#define GL_PROGRAM_OBJECT_ARB 0x8B40 +#define GL_SHADER_OBJECT_ARB 0x8B48 +#define GL_OBJECT_TYPE_ARB 0x8B4E +#define GL_OBJECT_SUBTYPE_ARB 0x8B4F +#define GL_FLOAT_VEC2_ARB 0x8B50 +#define GL_FLOAT_VEC3_ARB 0x8B51 +#define GL_FLOAT_VEC4_ARB 0x8B52 +#define GL_INT_VEC2_ARB 0x8B53 +#define GL_INT_VEC3_ARB 0x8B54 +#define GL_INT_VEC4_ARB 0x8B55 +#define GL_BOOL_ARB 0x8B56 +#define GL_BOOL_VEC2_ARB 0x8B57 +#define GL_BOOL_VEC3_ARB 0x8B58 +#define GL_BOOL_VEC4_ARB 0x8B59 +#define GL_FLOAT_MAT2_ARB 0x8B5A +#define GL_FLOAT_MAT3_ARB 0x8B5B +#define GL_FLOAT_MAT4_ARB 0x8B5C +#define GL_SAMPLER_1D_ARB 0x8B5D +#define GL_SAMPLER_2D_ARB 0x8B5E +#define GL_SAMPLER_3D_ARB 0x8B5F +#define GL_SAMPLER_CUBE_ARB 0x8B60 +#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 +#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 +#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 +#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 +#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 +#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 +#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 +#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 +#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 +#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 +#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 + +typedef char GLcharARB; +typedef unsigned int GLhandleARB; + +typedef void (GLAPIENTRY * PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATEPROGRAMOBJECTARBPROC) (void); +typedef GLhandleARB (GLAPIENTRY * PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); +typedef void (GLAPIENTRY * PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); +typedef void (GLAPIENTRY * PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef void (GLAPIENTRY * PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei* count, GLhandleARB *obj); +typedef GLhandleARB (GLAPIENTRY * PFNGLGETHANDLEARBPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *infoLog); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei* length, GLcharARB *source); +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint* params); +typedef void (GLAPIENTRY * PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB ** string, const GLint *length); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); +typedef void (GLAPIENTRY * PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); + +#define glAttachObjectARB GLEW_GET_FUN(__glewAttachObjectARB) +#define glCompileShaderARB GLEW_GET_FUN(__glewCompileShaderARB) +#define glCreateProgramObjectARB GLEW_GET_FUN(__glewCreateProgramObjectARB) +#define glCreateShaderObjectARB GLEW_GET_FUN(__glewCreateShaderObjectARB) +#define glDeleteObjectARB GLEW_GET_FUN(__glewDeleteObjectARB) +#define glDetachObjectARB GLEW_GET_FUN(__glewDetachObjectARB) +#define glGetActiveUniformARB GLEW_GET_FUN(__glewGetActiveUniformARB) +#define glGetAttachedObjectsARB GLEW_GET_FUN(__glewGetAttachedObjectsARB) +#define glGetHandleARB GLEW_GET_FUN(__glewGetHandleARB) +#define glGetInfoLogARB GLEW_GET_FUN(__glewGetInfoLogARB) +#define glGetObjectParameterfvARB GLEW_GET_FUN(__glewGetObjectParameterfvARB) +#define glGetObjectParameterivARB GLEW_GET_FUN(__glewGetObjectParameterivARB) +#define glGetShaderSourceARB GLEW_GET_FUN(__glewGetShaderSourceARB) +#define glGetUniformLocationARB GLEW_GET_FUN(__glewGetUniformLocationARB) +#define glGetUniformfvARB GLEW_GET_FUN(__glewGetUniformfvARB) +#define glGetUniformivARB GLEW_GET_FUN(__glewGetUniformivARB) +#define glLinkProgramARB GLEW_GET_FUN(__glewLinkProgramARB) +#define glShaderSourceARB GLEW_GET_FUN(__glewShaderSourceARB) +#define glUniform1fARB GLEW_GET_FUN(__glewUniform1fARB) +#define glUniform1fvARB GLEW_GET_FUN(__glewUniform1fvARB) +#define glUniform1iARB GLEW_GET_FUN(__glewUniform1iARB) +#define glUniform1ivARB GLEW_GET_FUN(__glewUniform1ivARB) +#define glUniform2fARB GLEW_GET_FUN(__glewUniform2fARB) +#define glUniform2fvARB GLEW_GET_FUN(__glewUniform2fvARB) +#define glUniform2iARB GLEW_GET_FUN(__glewUniform2iARB) +#define glUniform2ivARB GLEW_GET_FUN(__glewUniform2ivARB) +#define glUniform3fARB GLEW_GET_FUN(__glewUniform3fARB) +#define glUniform3fvARB GLEW_GET_FUN(__glewUniform3fvARB) +#define glUniform3iARB GLEW_GET_FUN(__glewUniform3iARB) +#define glUniform3ivARB GLEW_GET_FUN(__glewUniform3ivARB) +#define glUniform4fARB GLEW_GET_FUN(__glewUniform4fARB) +#define glUniform4fvARB GLEW_GET_FUN(__glewUniform4fvARB) +#define glUniform4iARB GLEW_GET_FUN(__glewUniform4iARB) +#define glUniform4ivARB GLEW_GET_FUN(__glewUniform4ivARB) +#define glUniformMatrix2fvARB GLEW_GET_FUN(__glewUniformMatrix2fvARB) +#define glUniformMatrix3fvARB GLEW_GET_FUN(__glewUniformMatrix3fvARB) +#define glUniformMatrix4fvARB GLEW_GET_FUN(__glewUniformMatrix4fvARB) +#define glUseProgramObjectARB GLEW_GET_FUN(__glewUseProgramObjectARB) +#define glValidateProgramARB GLEW_GET_FUN(__glewValidateProgramARB) + +#define GLEW_ARB_shader_objects GLEW_GET_VAR(__GLEW_ARB_shader_objects) + +#endif /* GL_ARB_shader_objects */ + +/* ------------------------ GL_ARB_shader_precision ------------------------ */ + +#ifndef GL_ARB_shader_precision +#define GL_ARB_shader_precision 1 + +#define GLEW_ARB_shader_precision GLEW_GET_VAR(__GLEW_ARB_shader_precision) + +#endif /* GL_ARB_shader_precision */ + +/* ---------------------- GL_ARB_shader_stencil_export --------------------- */ + +#ifndef GL_ARB_shader_stencil_export +#define GL_ARB_shader_stencil_export 1 + +#define GLEW_ARB_shader_stencil_export GLEW_GET_VAR(__GLEW_ARB_shader_stencil_export) + +#endif /* GL_ARB_shader_stencil_export */ + +/* ------------------------ GL_ARB_shader_subroutine ----------------------- */ + +#ifndef GL_ARB_shader_subroutine +#define GL_ARB_shader_subroutine 1 + +#define GL_ACTIVE_SUBROUTINES 0x8DE5 +#define GL_ACTIVE_SUBROUTINE_UNIFORMS 0x8DE6 +#define GL_MAX_SUBROUTINES 0x8DE7 +#define GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS 0x8DE8 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS 0x8E47 +#define GL_ACTIVE_SUBROUTINE_MAX_LENGTH 0x8E48 +#define GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH 0x8E49 +#define GL_NUM_COMPATIBLE_SUBROUTINES 0x8E4A +#define GL_COMPATIBLE_SUBROUTINES 0x8E4B + +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINENAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, char *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC) (GLuint program, GLenum shadertype, GLuint index, GLsizei bufsize, GLsizei* length, char *name); +typedef void (GLAPIENTRY * PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC) (GLuint program, GLenum shadertype, GLuint index, GLenum pname, GLint* values); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTAGEIVPROC) (GLuint program, GLenum shadertype, GLenum pname, GLint* values); +typedef GLuint (GLAPIENTRY * PFNGLGETSUBROUTINEINDEXPROC) (GLuint program, GLenum shadertype, const char* name); +typedef GLint (GLAPIENTRY * PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC) (GLuint program, GLenum shadertype, const char* name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMSUBROUTINEUIVPROC) (GLenum shadertype, GLint location, GLuint* params); +typedef void (GLAPIENTRY * PFNGLUNIFORMSUBROUTINESUIVPROC) (GLenum shadertype, GLsizei count, const GLuint* indices); + +#define glGetActiveSubroutineName GLEW_GET_FUN(__glewGetActiveSubroutineName) +#define glGetActiveSubroutineUniformName GLEW_GET_FUN(__glewGetActiveSubroutineUniformName) +#define glGetActiveSubroutineUniformiv GLEW_GET_FUN(__glewGetActiveSubroutineUniformiv) +#define glGetProgramStageiv GLEW_GET_FUN(__glewGetProgramStageiv) +#define glGetSubroutineIndex GLEW_GET_FUN(__glewGetSubroutineIndex) +#define glGetSubroutineUniformLocation GLEW_GET_FUN(__glewGetSubroutineUniformLocation) +#define glGetUniformSubroutineuiv GLEW_GET_FUN(__glewGetUniformSubroutineuiv) +#define glUniformSubroutinesuiv GLEW_GET_FUN(__glewUniformSubroutinesuiv) + +#define GLEW_ARB_shader_subroutine GLEW_GET_VAR(__GLEW_ARB_shader_subroutine) + +#endif /* GL_ARB_shader_subroutine */ + +/* ----------------------- GL_ARB_shader_texture_lod ----------------------- */ + +#ifndef GL_ARB_shader_texture_lod +#define GL_ARB_shader_texture_lod 1 + +#define GLEW_ARB_shader_texture_lod GLEW_GET_VAR(__GLEW_ARB_shader_texture_lod) + +#endif /* GL_ARB_shader_texture_lod */ + +/* ---------------------- GL_ARB_shading_language_100 ---------------------- */ + +#ifndef GL_ARB_shading_language_100 +#define GL_ARB_shading_language_100 1 + +#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C + +#define GLEW_ARB_shading_language_100 GLEW_GET_VAR(__GLEW_ARB_shading_language_100) + +#endif /* GL_ARB_shading_language_100 */ + +/* -------------------- GL_ARB_shading_language_include -------------------- */ + +#ifndef GL_ARB_shading_language_include +#define GL_ARB_shading_language_include 1 + +#define GL_SHADER_INCLUDE_ARB 0x8DAE +#define GL_NAMED_STRING_LENGTH_ARB 0x8DE9 +#define GL_NAMED_STRING_TYPE_ARB 0x8DEA + +typedef void (GLAPIENTRY * PFNGLCOMPILESHADERINCLUDEARBPROC) (GLuint shader, GLsizei count, const char ** path, const GLint *length); +typedef void (GLAPIENTRY * PFNGLDELETENAMEDSTRINGARBPROC) (GLint namelen, const char* name); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGARBPROC) (GLint namelen, const char* name, GLsizei bufSize, GLint *stringlen, char *string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDSTRINGIVARBPROC) (GLint namelen, const char* name, GLenum pname, GLint *params); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDSTRINGARBPROC) (GLint namelen, const char* name); +typedef void (GLAPIENTRY * PFNGLNAMEDSTRINGARBPROC) (GLenum type, GLint namelen, const char* name, GLint stringlen, const char *string); + +#define glCompileShaderIncludeARB GLEW_GET_FUN(__glewCompileShaderIncludeARB) +#define glDeleteNamedStringARB GLEW_GET_FUN(__glewDeleteNamedStringARB) +#define glGetNamedStringARB GLEW_GET_FUN(__glewGetNamedStringARB) +#define glGetNamedStringivARB GLEW_GET_FUN(__glewGetNamedStringivARB) +#define glIsNamedStringARB GLEW_GET_FUN(__glewIsNamedStringARB) +#define glNamedStringARB GLEW_GET_FUN(__glewNamedStringARB) + +#define GLEW_ARB_shading_language_include GLEW_GET_VAR(__GLEW_ARB_shading_language_include) + +#endif /* GL_ARB_shading_language_include */ + +/* ----------------------------- GL_ARB_shadow ----------------------------- */ + +#ifndef GL_ARB_shadow +#define GL_ARB_shadow 1 + +#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C +#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D +#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E + +#define GLEW_ARB_shadow GLEW_GET_VAR(__GLEW_ARB_shadow) + +#endif /* GL_ARB_shadow */ + +/* ------------------------- GL_ARB_shadow_ambient ------------------------- */ + +#ifndef GL_ARB_shadow_ambient +#define GL_ARB_shadow_ambient 1 + +#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF + +#define GLEW_ARB_shadow_ambient GLEW_GET_VAR(__GLEW_ARB_shadow_ambient) + +#endif /* GL_ARB_shadow_ambient */ + +/* ------------------------------ GL_ARB_sync ------------------------------ */ + +#ifndef GL_ARB_sync +#define GL_ARB_sync 1 + +#define GL_SYNC_FLUSH_COMMANDS_BIT 0x00000001 +#define GL_MAX_SERVER_WAIT_TIMEOUT 0x9111 +#define GL_OBJECT_TYPE 0x9112 +#define GL_SYNC_CONDITION 0x9113 +#define GL_SYNC_STATUS 0x9114 +#define GL_SYNC_FLAGS 0x9115 +#define GL_SYNC_FENCE 0x9116 +#define GL_SYNC_GPU_COMMANDS_COMPLETE 0x9117 +#define GL_UNSIGNALED 0x9118 +#define GL_SIGNALED 0x9119 +#define GL_ALREADY_SIGNALED 0x911A +#define GL_TIMEOUT_EXPIRED 0x911B +#define GL_CONDITION_SATISFIED 0x911C +#define GL_WAIT_FAILED 0x911D +#define GL_TIMEOUT_IGNORED 0xFFFFFFFFFFFFFFFF + +typedef GLenum (GLAPIENTRY * PFNGLCLIENTWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); +typedef void (GLAPIENTRY * PFNGLDELETESYNCPROC) (GLsync GLsync); +typedef GLsync (GLAPIENTRY * PFNGLFENCESYNCPROC) (GLenum condition,GLbitfield flags); +typedef void (GLAPIENTRY * PFNGLGETINTEGER64VPROC) (GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETSYNCIVPROC) (GLsync GLsync,GLenum pname,GLsizei bufSize,GLsizei* length, GLint *values); +typedef GLboolean (GLAPIENTRY * PFNGLISSYNCPROC) (GLsync GLsync); +typedef void (GLAPIENTRY * PFNGLWAITSYNCPROC) (GLsync GLsync,GLbitfield flags,GLuint64 timeout); + +#define glClientWaitSync GLEW_GET_FUN(__glewClientWaitSync) +#define glDeleteSync GLEW_GET_FUN(__glewDeleteSync) +#define glFenceSync GLEW_GET_FUN(__glewFenceSync) +#define glGetInteger64v GLEW_GET_FUN(__glewGetInteger64v) +#define glGetSynciv GLEW_GET_FUN(__glewGetSynciv) +#define glIsSync GLEW_GET_FUN(__glewIsSync) +#define glWaitSync GLEW_GET_FUN(__glewWaitSync) + +#define GLEW_ARB_sync GLEW_GET_VAR(__GLEW_ARB_sync) + +#endif /* GL_ARB_sync */ + +/* ----------------------- GL_ARB_tessellation_shader ---------------------- */ + +#ifndef GL_ARB_tessellation_shader +#define GL_ARB_tessellation_shader 1 + +#define GL_PATCHES 0xE +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER 0x84F0 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER 0x84F1 +#define GL_MAX_TESS_CONTROL_INPUT_COMPONENTS 0x886C +#define GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS 0x886D +#define GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E1E +#define GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E1F +#define GL_PATCH_VERTICES 0x8E72 +#define GL_PATCH_DEFAULT_INNER_LEVEL 0x8E73 +#define GL_PATCH_DEFAULT_OUTER_LEVEL 0x8E74 +#define GL_TESS_CONTROL_OUTPUT_VERTICES 0x8E75 +#define GL_TESS_GEN_MODE 0x8E76 +#define GL_TESS_GEN_SPACING 0x8E77 +#define GL_TESS_GEN_VERTEX_ORDER 0x8E78 +#define GL_TESS_GEN_POINT_MODE 0x8E79 +#define GL_ISOLINES 0x8E7A +#define GL_FRACTIONAL_ODD 0x8E7B +#define GL_FRACTIONAL_EVEN 0x8E7C +#define GL_MAX_PATCH_VERTICES 0x8E7D +#define GL_MAX_TESS_GEN_LEVEL 0x8E7E +#define GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS 0x8E7F +#define GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS 0x8E80 +#define GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS 0x8E81 +#define GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS 0x8E82 +#define GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS 0x8E83 +#define GL_MAX_TESS_PATCH_COMPONENTS 0x8E84 +#define GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS 0x8E85 +#define GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS 0x8E86 +#define GL_TESS_EVALUATION_SHADER 0x8E87 +#define GL_TESS_CONTROL_SHADER 0x8E88 +#define GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS 0x8E89 +#define GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS 0x8E8A + +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERFVPROC) (GLenum pname, const GLfloat* values); +typedef void (GLAPIENTRY * PFNGLPATCHPARAMETERIPROC) (GLenum pname, GLint value); + +#define glPatchParameterfv GLEW_GET_FUN(__glewPatchParameterfv) +#define glPatchParameteri GLEW_GET_FUN(__glewPatchParameteri) + +#define GLEW_ARB_tessellation_shader GLEW_GET_VAR(__GLEW_ARB_tessellation_shader) + +#endif /* GL_ARB_tessellation_shader */ + +/* ---------------------- GL_ARB_texture_border_clamp ---------------------- */ + +#ifndef GL_ARB_texture_border_clamp +#define GL_ARB_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_ARB 0x812D + +#define GLEW_ARB_texture_border_clamp GLEW_GET_VAR(__GLEW_ARB_texture_border_clamp) + +#endif /* GL_ARB_texture_border_clamp */ + +/* ---------------------- GL_ARB_texture_buffer_object --------------------- */ + +#ifndef GL_ARB_texture_buffer_object +#define GL_ARB_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_ARB 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_ARB 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_ARB 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_ARB 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFERARBPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferARB GLEW_GET_FUN(__glewTexBufferARB) + +#define GLEW_ARB_texture_buffer_object GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object) + +#endif /* GL_ARB_texture_buffer_object */ + +/* ------------------- GL_ARB_texture_buffer_object_rgb32 ------------------ */ + +#ifndef GL_ARB_texture_buffer_object_rgb32 +#define GL_ARB_texture_buffer_object_rgb32 1 + +#define GLEW_ARB_texture_buffer_object_rgb32 GLEW_GET_VAR(__GLEW_ARB_texture_buffer_object_rgb32) + +#endif /* GL_ARB_texture_buffer_object_rgb32 */ + +/* ----------------------- GL_ARB_texture_compression ---------------------- */ + +#ifndef GL_ARB_texture_compression +#define GL_ARB_texture_compression 1 + +#define GL_COMPRESSED_ALPHA_ARB 0x84E9 +#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA +#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB +#define GL_COMPRESSED_INTENSITY_ARB 0x84EC +#define GL_COMPRESSED_RGB_ARB 0x84ED +#define GL_COMPRESSED_RGBA_ARB 0x84EE +#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF +#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 +#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 +#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 +#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 + +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint lod, void* img); + +#define glCompressedTexImage1DARB GLEW_GET_FUN(__glewCompressedTexImage1DARB) +#define glCompressedTexImage2DARB GLEW_GET_FUN(__glewCompressedTexImage2DARB) +#define glCompressedTexImage3DARB GLEW_GET_FUN(__glewCompressedTexImage3DARB) +#define glCompressedTexSubImage1DARB GLEW_GET_FUN(__glewCompressedTexSubImage1DARB) +#define glCompressedTexSubImage2DARB GLEW_GET_FUN(__glewCompressedTexSubImage2DARB) +#define glCompressedTexSubImage3DARB GLEW_GET_FUN(__glewCompressedTexSubImage3DARB) +#define glGetCompressedTexImageARB GLEW_GET_FUN(__glewGetCompressedTexImageARB) + +#define GLEW_ARB_texture_compression GLEW_GET_VAR(__GLEW_ARB_texture_compression) + +#endif /* GL_ARB_texture_compression */ + +/* -------------------- GL_ARB_texture_compression_bptc -------------------- */ + +#ifndef GL_ARB_texture_compression_bptc +#define GL_ARB_texture_compression_bptc 1 + +#define GL_COMPRESSED_RGBA_BPTC_UNORM_ARB 0x8E8C +#define GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB 0x8E8D +#define GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB 0x8E8E +#define GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB 0x8E8F + +#define GLEW_ARB_texture_compression_bptc GLEW_GET_VAR(__GLEW_ARB_texture_compression_bptc) + +#endif /* GL_ARB_texture_compression_bptc */ + +/* -------------------- GL_ARB_texture_compression_rgtc -------------------- */ + +#ifndef GL_ARB_texture_compression_rgtc +#define GL_ARB_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1 0x8DBC +#define GL_COMPRESSED_RG_RGTC2 0x8DBD +#define GL_COMPRESSED_SIGNED_RG_RGTC2 0x8DBE + +#define GLEW_ARB_texture_compression_rgtc GLEW_GET_VAR(__GLEW_ARB_texture_compression_rgtc) + +#endif /* GL_ARB_texture_compression_rgtc */ + +/* ------------------------ GL_ARB_texture_cube_map ------------------------ */ + +#ifndef GL_ARB_texture_cube_map +#define GL_ARB_texture_cube_map 1 + +#define GL_NORMAL_MAP_ARB 0x8511 +#define GL_REFLECTION_MAP_ARB 0x8512 +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C + +#define GLEW_ARB_texture_cube_map GLEW_GET_VAR(__GLEW_ARB_texture_cube_map) + +#endif /* GL_ARB_texture_cube_map */ + +/* --------------------- GL_ARB_texture_cube_map_array --------------------- */ + +#ifndef GL_ARB_texture_cube_map_array +#define GL_ARB_texture_cube_map_array 1 + +#define GL_TEXTURE_CUBE_MAP_ARRAY_ARB 0x9009 +#define GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB 0x900A +#define GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB 0x900B +#define GL_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900C +#define GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB 0x900D +#define GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900E +#define GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB 0x900F + +#define GLEW_ARB_texture_cube_map_array GLEW_GET_VAR(__GLEW_ARB_texture_cube_map_array) + +#endif /* GL_ARB_texture_cube_map_array */ + +/* ------------------------- GL_ARB_texture_env_add ------------------------ */ + +#ifndef GL_ARB_texture_env_add +#define GL_ARB_texture_env_add 1 + +#define GLEW_ARB_texture_env_add GLEW_GET_VAR(__GLEW_ARB_texture_env_add) + +#endif /* GL_ARB_texture_env_add */ + +/* ----------------------- GL_ARB_texture_env_combine ---------------------- */ + +#ifndef GL_ARB_texture_env_combine +#define GL_ARB_texture_env_combine 1 + +#define GL_SUBTRACT_ARB 0x84E7 +#define GL_COMBINE_ARB 0x8570 +#define GL_COMBINE_RGB_ARB 0x8571 +#define GL_COMBINE_ALPHA_ARB 0x8572 +#define GL_RGB_SCALE_ARB 0x8573 +#define GL_ADD_SIGNED_ARB 0x8574 +#define GL_INTERPOLATE_ARB 0x8575 +#define GL_CONSTANT_ARB 0x8576 +#define GL_PRIMARY_COLOR_ARB 0x8577 +#define GL_PREVIOUS_ARB 0x8578 +#define GL_SOURCE0_RGB_ARB 0x8580 +#define GL_SOURCE1_RGB_ARB 0x8581 +#define GL_SOURCE2_RGB_ARB 0x8582 +#define GL_SOURCE0_ALPHA_ARB 0x8588 +#define GL_SOURCE1_ALPHA_ARB 0x8589 +#define GL_SOURCE2_ALPHA_ARB 0x858A +#define GL_OPERAND0_RGB_ARB 0x8590 +#define GL_OPERAND1_RGB_ARB 0x8591 +#define GL_OPERAND2_RGB_ARB 0x8592 +#define GL_OPERAND0_ALPHA_ARB 0x8598 +#define GL_OPERAND1_ALPHA_ARB 0x8599 +#define GL_OPERAND2_ALPHA_ARB 0x859A + +#define GLEW_ARB_texture_env_combine GLEW_GET_VAR(__GLEW_ARB_texture_env_combine) + +#endif /* GL_ARB_texture_env_combine */ + +/* ---------------------- GL_ARB_texture_env_crossbar ---------------------- */ + +#ifndef GL_ARB_texture_env_crossbar +#define GL_ARB_texture_env_crossbar 1 + +#define GLEW_ARB_texture_env_crossbar GLEW_GET_VAR(__GLEW_ARB_texture_env_crossbar) + +#endif /* GL_ARB_texture_env_crossbar */ + +/* ------------------------ GL_ARB_texture_env_dot3 ------------------------ */ + +#ifndef GL_ARB_texture_env_dot3 +#define GL_ARB_texture_env_dot3 1 + +#define GL_DOT3_RGB_ARB 0x86AE +#define GL_DOT3_RGBA_ARB 0x86AF + +#define GLEW_ARB_texture_env_dot3 GLEW_GET_VAR(__GLEW_ARB_texture_env_dot3) + +#endif /* GL_ARB_texture_env_dot3 */ + +/* -------------------------- GL_ARB_texture_float ------------------------- */ + +#ifndef GL_ARB_texture_float +#define GL_ARB_texture_float 1 + +#define GL_RGBA32F_ARB 0x8814 +#define GL_RGB32F_ARB 0x8815 +#define GL_ALPHA32F_ARB 0x8816 +#define GL_INTENSITY32F_ARB 0x8817 +#define GL_LUMINANCE32F_ARB 0x8818 +#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 +#define GL_RGBA16F_ARB 0x881A +#define GL_RGB16F_ARB 0x881B +#define GL_ALPHA16F_ARB 0x881C +#define GL_INTENSITY16F_ARB 0x881D +#define GL_LUMINANCE16F_ARB 0x881E +#define GL_LUMINANCE_ALPHA16F_ARB 0x881F +#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 +#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 +#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 +#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 +#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 +#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 +#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 +#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 + +#define GLEW_ARB_texture_float GLEW_GET_VAR(__GLEW_ARB_texture_float) + +#endif /* GL_ARB_texture_float */ + +/* ------------------------- GL_ARB_texture_gather ------------------------- */ + +#ifndef GL_ARB_texture_gather +#define GL_ARB_texture_gather 1 + +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB 0x8E5F +#define GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB 0x8F9F + +#define GLEW_ARB_texture_gather GLEW_GET_VAR(__GLEW_ARB_texture_gather) + +#endif /* GL_ARB_texture_gather */ + +/* --------------------- GL_ARB_texture_mirrored_repeat -------------------- */ + +#ifndef GL_ARB_texture_mirrored_repeat +#define GL_ARB_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_ARB 0x8370 + +#define GLEW_ARB_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_ARB_texture_mirrored_repeat) + +#endif /* GL_ARB_texture_mirrored_repeat */ + +/* ----------------------- GL_ARB_texture_multisample ---------------------- */ + +#ifndef GL_ARB_texture_multisample +#define GL_ARB_texture_multisample 1 + +#define GL_SAMPLE_POSITION 0x8E50 +#define GL_SAMPLE_MASK 0x8E51 +#define GL_SAMPLE_MASK_VALUE 0x8E52 +#define GL_MAX_SAMPLE_MASK_WORDS 0x8E59 +#define GL_TEXTURE_2D_MULTISAMPLE 0x9100 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE 0x9101 +#define GL_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9102 +#define GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY 0x9103 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE 0x9104 +#define GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY 0x9105 +#define GL_TEXTURE_SAMPLES 0x9106 +#define GL_TEXTURE_FIXED_SAMPLE_LOCATIONS 0x9107 +#define GL_SAMPLER_2D_MULTISAMPLE 0x9108 +#define GL_INT_SAMPLER_2D_MULTISAMPLE 0x9109 +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE 0x910A +#define GL_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910B +#define GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910C +#define GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY 0x910D +#define GL_MAX_COLOR_TEXTURE_SAMPLES 0x910E +#define GL_MAX_DEPTH_TEXTURE_SAMPLES 0x910F +#define GL_MAX_INTEGER_SAMPLES 0x9110 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKIPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE2DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations); +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DMULTISAMPLEPROC) (GLenum target, GLsizei samples, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations); + +#define glGetMultisamplefv GLEW_GET_FUN(__glewGetMultisamplefv) +#define glSampleMaski GLEW_GET_FUN(__glewSampleMaski) +#define glTexImage2DMultisample GLEW_GET_FUN(__glewTexImage2DMultisample) +#define glTexImage3DMultisample GLEW_GET_FUN(__glewTexImage3DMultisample) + +#define GLEW_ARB_texture_multisample GLEW_GET_VAR(__GLEW_ARB_texture_multisample) + +#endif /* GL_ARB_texture_multisample */ + +/* -------------------- GL_ARB_texture_non_power_of_two -------------------- */ + +#ifndef GL_ARB_texture_non_power_of_two +#define GL_ARB_texture_non_power_of_two 1 + +#define GLEW_ARB_texture_non_power_of_two GLEW_GET_VAR(__GLEW_ARB_texture_non_power_of_two) + +#endif /* GL_ARB_texture_non_power_of_two */ + +/* ------------------------ GL_ARB_texture_query_lod ----------------------- */ + +#ifndef GL_ARB_texture_query_lod +#define GL_ARB_texture_query_lod 1 + +#define GLEW_ARB_texture_query_lod GLEW_GET_VAR(__GLEW_ARB_texture_query_lod) + +#endif /* GL_ARB_texture_query_lod */ + +/* ------------------------ GL_ARB_texture_rectangle ----------------------- */ + +#ifndef GL_ARB_texture_rectangle +#define GL_ARB_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 +#define GL_SAMPLER_2D_RECT_ARB 0x8B63 +#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 + +#define GLEW_ARB_texture_rectangle GLEW_GET_VAR(__GLEW_ARB_texture_rectangle) + +#endif /* GL_ARB_texture_rectangle */ + +/* --------------------------- GL_ARB_texture_rg --------------------------- */ + +#ifndef GL_ARB_texture_rg +#define GL_ARB_texture_rg 1 + +#define GL_RED 0x1903 +#define GL_COMPRESSED_RED 0x8225 +#define GL_COMPRESSED_RG 0x8226 +#define GL_RG 0x8227 +#define GL_RG_INTEGER 0x8228 +#define GL_R8 0x8229 +#define GL_R16 0x822A +#define GL_RG8 0x822B +#define GL_RG16 0x822C +#define GL_R16F 0x822D +#define GL_R32F 0x822E +#define GL_RG16F 0x822F +#define GL_RG32F 0x8230 +#define GL_R8I 0x8231 +#define GL_R8UI 0x8232 +#define GL_R16I 0x8233 +#define GL_R16UI 0x8234 +#define GL_R32I 0x8235 +#define GL_R32UI 0x8236 +#define GL_RG8I 0x8237 +#define GL_RG8UI 0x8238 +#define GL_RG16I 0x8239 +#define GL_RG16UI 0x823A +#define GL_RG32I 0x823B +#define GL_RG32UI 0x823C + +#define GLEW_ARB_texture_rg GLEW_GET_VAR(__GLEW_ARB_texture_rg) + +#endif /* GL_ARB_texture_rg */ + +/* ----------------------- GL_ARB_texture_rgb10_a2ui ----------------------- */ + +#ifndef GL_ARB_texture_rgb10_a2ui +#define GL_ARB_texture_rgb10_a2ui 1 + +#define GL_RGB10_A2UI 0x906F + +#define GLEW_ARB_texture_rgb10_a2ui GLEW_GET_VAR(__GLEW_ARB_texture_rgb10_a2ui) + +#endif /* GL_ARB_texture_rgb10_a2ui */ + +/* ------------------------- GL_ARB_texture_swizzle ------------------------ */ + +#ifndef GL_ARB_texture_swizzle +#define GL_ARB_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R 0x8E42 +#define GL_TEXTURE_SWIZZLE_G 0x8E43 +#define GL_TEXTURE_SWIZZLE_B 0x8E44 +#define GL_TEXTURE_SWIZZLE_A 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA 0x8E46 + +#define GLEW_ARB_texture_swizzle GLEW_GET_VAR(__GLEW_ARB_texture_swizzle) + +#endif /* GL_ARB_texture_swizzle */ + +/* --------------------------- GL_ARB_timer_query -------------------------- */ + +#ifndef GL_ARB_timer_query +#define GL_ARB_timer_query 1 + +#define GL_TIME_ELAPSED 0x88BF +#define GL_TIMESTAMP 0x8E28 + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VPROC) (GLuint id, GLenum pname, GLint64* params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VPROC) (GLuint id, GLenum pname, GLuint64* params); +typedef void (GLAPIENTRY * PFNGLQUERYCOUNTERPROC) (GLuint id, GLenum target); + +#define glGetQueryObjecti64v GLEW_GET_FUN(__glewGetQueryObjecti64v) +#define glGetQueryObjectui64v GLEW_GET_FUN(__glewGetQueryObjectui64v) +#define glQueryCounter GLEW_GET_FUN(__glewQueryCounter) + +#define GLEW_ARB_timer_query GLEW_GET_VAR(__GLEW_ARB_timer_query) + +#endif /* GL_ARB_timer_query */ + +/* ----------------------- GL_ARB_transform_feedback2 ---------------------- */ + +#ifndef GL_ARB_transform_feedback2 +#define GL_ARB_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKPROC) (void); + +#define glBindTransformFeedback GLEW_GET_FUN(__glewBindTransformFeedback) +#define glDeleteTransformFeedbacks GLEW_GET_FUN(__glewDeleteTransformFeedbacks) +#define glDrawTransformFeedback GLEW_GET_FUN(__glewDrawTransformFeedback) +#define glGenTransformFeedbacks GLEW_GET_FUN(__glewGenTransformFeedbacks) +#define glIsTransformFeedback GLEW_GET_FUN(__glewIsTransformFeedback) +#define glPauseTransformFeedback GLEW_GET_FUN(__glewPauseTransformFeedback) +#define glResumeTransformFeedback GLEW_GET_FUN(__glewResumeTransformFeedback) + +#define GLEW_ARB_transform_feedback2 GLEW_GET_VAR(__GLEW_ARB_transform_feedback2) + +#endif /* GL_ARB_transform_feedback2 */ + +/* ----------------------- GL_ARB_transform_feedback3 ---------------------- */ + +#ifndef GL_ARB_transform_feedback3 +#define GL_ARB_transform_feedback3 1 + +#define GL_MAX_TRANSFORM_FEEDBACK_BUFFERS 0x8E70 +#define GL_MAX_VERTEX_STREAMS 0x8E71 + +typedef void (GLAPIENTRY * PFNGLBEGINQUERYINDEXEDPROC) (GLenum target, GLuint index, GLuint id); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC) (GLenum mode, GLuint id, GLuint stream); +typedef void (GLAPIENTRY * PFNGLENDQUERYINDEXEDPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETQUERYINDEXEDIVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); + +#define glBeginQueryIndexed GLEW_GET_FUN(__glewBeginQueryIndexed) +#define glDrawTransformFeedbackStream GLEW_GET_FUN(__glewDrawTransformFeedbackStream) +#define glEndQueryIndexed GLEW_GET_FUN(__glewEndQueryIndexed) +#define glGetQueryIndexediv GLEW_GET_FUN(__glewGetQueryIndexediv) + +#define GLEW_ARB_transform_feedback3 GLEW_GET_VAR(__GLEW_ARB_transform_feedback3) + +#endif /* GL_ARB_transform_feedback3 */ + +/* ------------------------ GL_ARB_transpose_matrix ------------------------ */ + +#ifndef GL_ARB_transpose_matrix +#define GL_ARB_transpose_matrix 1 + +#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 +#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 +#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 +#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 + +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLLOADTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXDARBPROC) (GLdouble m[16]); +typedef void (GLAPIENTRY * PFNGLMULTTRANSPOSEMATRIXFARBPROC) (GLfloat m[16]); + +#define glLoadTransposeMatrixdARB GLEW_GET_FUN(__glewLoadTransposeMatrixdARB) +#define glLoadTransposeMatrixfARB GLEW_GET_FUN(__glewLoadTransposeMatrixfARB) +#define glMultTransposeMatrixdARB GLEW_GET_FUN(__glewMultTransposeMatrixdARB) +#define glMultTransposeMatrixfARB GLEW_GET_FUN(__glewMultTransposeMatrixfARB) + +#define GLEW_ARB_transpose_matrix GLEW_GET_VAR(__GLEW_ARB_transpose_matrix) + +#endif /* GL_ARB_transpose_matrix */ + +/* ---------------------- GL_ARB_uniform_buffer_object --------------------- */ + +#ifndef GL_ARB_uniform_buffer_object +#define GL_ARB_uniform_buffer_object 1 + +#define GL_UNIFORM_BUFFER 0x8A11 +#define GL_UNIFORM_BUFFER_BINDING 0x8A28 +#define GL_UNIFORM_BUFFER_START 0x8A29 +#define GL_UNIFORM_BUFFER_SIZE 0x8A2A +#define GL_MAX_VERTEX_UNIFORM_BLOCKS 0x8A2B +#define GL_MAX_GEOMETRY_UNIFORM_BLOCKS 0x8A2C +#define GL_MAX_FRAGMENT_UNIFORM_BLOCKS 0x8A2D +#define GL_MAX_COMBINED_UNIFORM_BLOCKS 0x8A2E +#define GL_MAX_UNIFORM_BUFFER_BINDINGS 0x8A2F +#define GL_MAX_UNIFORM_BLOCK_SIZE 0x8A30 +#define GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS 0x8A31 +#define GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS 0x8A32 +#define GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS 0x8A33 +#define GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT 0x8A34 +#define GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH 0x8A35 +#define GL_ACTIVE_UNIFORM_BLOCKS 0x8A36 +#define GL_UNIFORM_TYPE 0x8A37 +#define GL_UNIFORM_SIZE 0x8A38 +#define GL_UNIFORM_NAME_LENGTH 0x8A39 +#define GL_UNIFORM_BLOCK_INDEX 0x8A3A +#define GL_UNIFORM_OFFSET 0x8A3B +#define GL_UNIFORM_ARRAY_STRIDE 0x8A3C +#define GL_UNIFORM_MATRIX_STRIDE 0x8A3D +#define GL_UNIFORM_IS_ROW_MAJOR 0x8A3E +#define GL_UNIFORM_BLOCK_BINDING 0x8A3F +#define GL_UNIFORM_BLOCK_DATA_SIZE 0x8A40 +#define GL_UNIFORM_BLOCK_NAME_LENGTH 0x8A41 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS 0x8A42 +#define GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES 0x8A43 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER 0x8A44 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER 0x8A45 +#define GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER 0x8A46 +#define GL_INVALID_INDEX 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC) (GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, char* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMBLOCKIVPROC) (GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMNAMEPROC) (GLuint program, GLuint uniformIndex, GLsizei bufSize, GLsizei* length, char* uniformName); +typedef void (GLAPIENTRY * PFNGLGETACTIVEUNIFORMSIVPROC) (GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERI_VPROC) (GLenum target, GLuint index, GLint* data); +typedef GLuint (GLAPIENTRY * PFNGLGETUNIFORMBLOCKINDEXPROC) (GLuint program, const char* uniformBlockName); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMINDICESPROC) (GLuint program, GLsizei uniformCount, const char** uniformNames, GLuint* uniformIndices); +typedef void (GLAPIENTRY * PFNGLUNIFORMBLOCKBINDINGPROC) (GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding); + +#define glBindBufferBase GLEW_GET_FUN(__glewBindBufferBase) +#define glBindBufferRange GLEW_GET_FUN(__glewBindBufferRange) +#define glGetActiveUniformBlockName GLEW_GET_FUN(__glewGetActiveUniformBlockName) +#define glGetActiveUniformBlockiv GLEW_GET_FUN(__glewGetActiveUniformBlockiv) +#define glGetActiveUniformName GLEW_GET_FUN(__glewGetActiveUniformName) +#define glGetActiveUniformsiv GLEW_GET_FUN(__glewGetActiveUniformsiv) +#define glGetIntegeri_v GLEW_GET_FUN(__glewGetIntegeri_v) +#define glGetUniformBlockIndex GLEW_GET_FUN(__glewGetUniformBlockIndex) +#define glGetUniformIndices GLEW_GET_FUN(__glewGetUniformIndices) +#define glUniformBlockBinding GLEW_GET_FUN(__glewUniformBlockBinding) + +#define GLEW_ARB_uniform_buffer_object GLEW_GET_VAR(__GLEW_ARB_uniform_buffer_object) + +#endif /* GL_ARB_uniform_buffer_object */ + +/* ------------------------ GL_ARB_vertex_array_bgra ----------------------- */ + +#ifndef GL_ARB_vertex_array_bgra +#define GL_ARB_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_ARB_vertex_array_bgra GLEW_GET_VAR(__GLEW_ARB_vertex_array_bgra) + +#endif /* GL_ARB_vertex_array_bgra */ + +/* ----------------------- GL_ARB_vertex_array_object ---------------------- */ + +#ifndef GL_ARB_vertex_array_object +#define GL_ARB_vertex_array_object 1 + +#define GL_VERTEX_ARRAY_BINDING 0x85B5 + +typedef void (GLAPIENTRY * PFNGLBINDVERTEXARRAYPROC) (GLuint array); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXARRAYSPROC) (GLsizei n, const GLuint* arrays); +typedef void (GLAPIENTRY * PFNGLGENVERTEXARRAYSPROC) (GLsizei n, GLuint* arrays); +typedef GLboolean (GLAPIENTRY * PFNGLISVERTEXARRAYPROC) (GLuint array); + +#define glBindVertexArray GLEW_GET_FUN(__glewBindVertexArray) +#define glDeleteVertexArrays GLEW_GET_FUN(__glewDeleteVertexArrays) +#define glGenVertexArrays GLEW_GET_FUN(__glewGenVertexArrays) +#define glIsVertexArray GLEW_GET_FUN(__glewIsVertexArray) + +#define GLEW_ARB_vertex_array_object GLEW_GET_VAR(__GLEW_ARB_vertex_array_object) + +#endif /* GL_ARB_vertex_array_object */ + +/* ----------------------- GL_ARB_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_ARB_vertex_attrib_64bit +#define GL_ARB_vertex_attrib_64bit 1 + +#define GL_DOUBLE_MAT2 0x8F46 +#define GL_DOUBLE_MAT3 0x8F47 +#define GL_DOUBLE_MAT4 0x8F48 +#define GL_DOUBLE_VEC2 0x8FFC +#define GL_DOUBLE_VEC3 0x8FFD +#define GL_DOUBLE_VEC4 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTERPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdv GLEW_GET_FUN(__glewGetVertexAttribLdv) +#define glVertexAttribL1d GLEW_GET_FUN(__glewVertexAttribL1d) +#define glVertexAttribL1dv GLEW_GET_FUN(__glewVertexAttribL1dv) +#define glVertexAttribL2d GLEW_GET_FUN(__glewVertexAttribL2d) +#define glVertexAttribL2dv GLEW_GET_FUN(__glewVertexAttribL2dv) +#define glVertexAttribL3d GLEW_GET_FUN(__glewVertexAttribL3d) +#define glVertexAttribL3dv GLEW_GET_FUN(__glewVertexAttribL3dv) +#define glVertexAttribL4d GLEW_GET_FUN(__glewVertexAttribL4d) +#define glVertexAttribL4dv GLEW_GET_FUN(__glewVertexAttribL4dv) +#define glVertexAttribLPointer GLEW_GET_FUN(__glewVertexAttribLPointer) + +#define GLEW_ARB_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_ARB_vertex_attrib_64bit) + +#endif /* GL_ARB_vertex_attrib_64bit */ + +/* -------------------------- GL_ARB_vertex_blend -------------------------- */ + +#ifndef GL_ARB_vertex_blend +#define GL_ARB_vertex_blend 1 + +#define GL_MODELVIEW0_ARB 0x1700 +#define GL_MODELVIEW1_ARB 0x850A +#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 +#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 +#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 +#define GL_VERTEX_BLEND_ARB 0x86A7 +#define GL_CURRENT_WEIGHT_ARB 0x86A8 +#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 +#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA +#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB +#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC +#define GL_WEIGHT_ARRAY_ARB 0x86AD +#define GL_MODELVIEW2_ARB 0x8722 +#define GL_MODELVIEW3_ARB 0x8723 +#define GL_MODELVIEW4_ARB 0x8724 +#define GL_MODELVIEW5_ARB 0x8725 +#define GL_MODELVIEW6_ARB 0x8726 +#define GL_MODELVIEW7_ARB 0x8727 +#define GL_MODELVIEW8_ARB 0x8728 +#define GL_MODELVIEW9_ARB 0x8729 +#define GL_MODELVIEW10_ARB 0x872A +#define GL_MODELVIEW11_ARB 0x872B +#define GL_MODELVIEW12_ARB 0x872C +#define GL_MODELVIEW13_ARB 0x872D +#define GL_MODELVIEW14_ARB 0x872E +#define GL_MODELVIEW15_ARB 0x872F +#define GL_MODELVIEW16_ARB 0x8730 +#define GL_MODELVIEW17_ARB 0x8731 +#define GL_MODELVIEW18_ARB 0x8732 +#define GL_MODELVIEW19_ARB 0x8733 +#define GL_MODELVIEW20_ARB 0x8734 +#define GL_MODELVIEW21_ARB 0x8735 +#define GL_MODELVIEW22_ARB 0x8736 +#define GL_MODELVIEW23_ARB 0x8737 +#define GL_MODELVIEW24_ARB 0x8738 +#define GL_MODELVIEW25_ARB 0x8739 +#define GL_MODELVIEW26_ARB 0x873A +#define GL_MODELVIEW27_ARB 0x873B +#define GL_MODELVIEW28_ARB 0x873C +#define GL_MODELVIEW29_ARB 0x873D +#define GL_MODELVIEW30_ARB 0x873E +#define GL_MODELVIEW31_ARB 0x873F + +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDARBPROC) (GLint count); +typedef void (GLAPIENTRY * PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLWEIGHTBVARBPROC) (GLint size, GLbyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTDVARBPROC) (GLint size, GLdouble *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTFVARBPROC) (GLint size, GLfloat *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTIVARBPROC) (GLint size, GLint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTSVARBPROC) (GLint size, GLshort *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUBVARBPROC) (GLint size, GLubyte *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUIVARBPROC) (GLint size, GLuint *weights); +typedef void (GLAPIENTRY * PFNGLWEIGHTUSVARBPROC) (GLint size, GLushort *weights); + +#define glVertexBlendARB GLEW_GET_FUN(__glewVertexBlendARB) +#define glWeightPointerARB GLEW_GET_FUN(__glewWeightPointerARB) +#define glWeightbvARB GLEW_GET_FUN(__glewWeightbvARB) +#define glWeightdvARB GLEW_GET_FUN(__glewWeightdvARB) +#define glWeightfvARB GLEW_GET_FUN(__glewWeightfvARB) +#define glWeightivARB GLEW_GET_FUN(__glewWeightivARB) +#define glWeightsvARB GLEW_GET_FUN(__glewWeightsvARB) +#define glWeightubvARB GLEW_GET_FUN(__glewWeightubvARB) +#define glWeightuivARB GLEW_GET_FUN(__glewWeightuivARB) +#define glWeightusvARB GLEW_GET_FUN(__glewWeightusvARB) + +#define GLEW_ARB_vertex_blend GLEW_GET_VAR(__GLEW_ARB_vertex_blend) + +#endif /* GL_ARB_vertex_blend */ + +/* ---------------------- GL_ARB_vertex_buffer_object ---------------------- */ + +#ifndef GL_ARB_vertex_buffer_object +#define GL_ARB_vertex_buffer_object 1 + +#define GL_BUFFER_SIZE_ARB 0x8764 +#define GL_BUFFER_USAGE_ARB 0x8765 +#define GL_ARRAY_BUFFER_ARB 0x8892 +#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 +#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 +#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 +#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 +#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 +#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 +#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 +#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A +#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B +#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C +#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D +#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E +#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F +#define GL_READ_ONLY_ARB 0x88B8 +#define GL_WRITE_ONLY_ARB 0x88B9 +#define GL_READ_WRITE_ARB 0x88BA +#define GL_BUFFER_ACCESS_ARB 0x88BB +#define GL_BUFFER_MAPPED_ARB 0x88BC +#define GL_BUFFER_MAP_POINTER_ARB 0x88BD +#define GL_STREAM_DRAW_ARB 0x88E0 +#define GL_STREAM_READ_ARB 0x88E1 +#define GL_STREAM_COPY_ARB 0x88E2 +#define GL_STATIC_DRAW_ARB 0x88E4 +#define GL_STATIC_READ_ARB 0x88E5 +#define GL_STATIC_COPY_ARB 0x88E6 +#define GL_DYNAMIC_DRAW_ARB 0x88E8 +#define GL_DYNAMIC_READ_ARB 0x88E9 +#define GL_DYNAMIC_COPY_ARB 0x88EA + +typedef ptrdiff_t GLintptrARB; +typedef ptrdiff_t GLsizeiptrARB; + +typedef void (GLAPIENTRY * PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid* data); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint* buffers); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid* data); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERARBPROC) (GLuint buffer); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPBUFFERARBPROC) (GLenum target); + +#define glBindBufferARB GLEW_GET_FUN(__glewBindBufferARB) +#define glBufferDataARB GLEW_GET_FUN(__glewBufferDataARB) +#define glBufferSubDataARB GLEW_GET_FUN(__glewBufferSubDataARB) +#define glDeleteBuffersARB GLEW_GET_FUN(__glewDeleteBuffersARB) +#define glGenBuffersARB GLEW_GET_FUN(__glewGenBuffersARB) +#define glGetBufferParameterivARB GLEW_GET_FUN(__glewGetBufferParameterivARB) +#define glGetBufferPointervARB GLEW_GET_FUN(__glewGetBufferPointervARB) +#define glGetBufferSubDataARB GLEW_GET_FUN(__glewGetBufferSubDataARB) +#define glIsBufferARB GLEW_GET_FUN(__glewIsBufferARB) +#define glMapBufferARB GLEW_GET_FUN(__glewMapBufferARB) +#define glUnmapBufferARB GLEW_GET_FUN(__glewUnmapBufferARB) + +#define GLEW_ARB_vertex_buffer_object GLEW_GET_VAR(__GLEW_ARB_vertex_buffer_object) + +#endif /* GL_ARB_vertex_buffer_object */ + +/* ------------------------- GL_ARB_vertex_program ------------------------- */ + +#ifndef GL_ARB_vertex_program +#define GL_ARB_vertex_program 1 + +#define GL_COLOR_SUM_ARB 0x8458 +#define GL_VERTEX_PROGRAM_ARB 0x8620 +#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 +#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 +#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 +#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 +#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 +#define GL_PROGRAM_LENGTH_ARB 0x8627 +#define GL_PROGRAM_STRING_ARB 0x8628 +#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E +#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F +#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 +#define GL_CURRENT_MATRIX_ARB 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 +#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 +#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B +#define GL_PROGRAM_BINDING_ARB 0x8677 +#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 +#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A +#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 +#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 +#define GL_PROGRAM_FORMAT_ARB 0x8876 +#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 +#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 +#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 +#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 +#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 +#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 +#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 +#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 +#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 +#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 +#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA +#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB +#define GL_PROGRAM_ATTRIBS_ARB 0x88AC +#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD +#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE +#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF +#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 +#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 +#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 +#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 +#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 +#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 +#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 +#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 +#define GL_MATRIX0_ARB 0x88C0 +#define GL_MATRIX1_ARB 0x88C1 +#define GL_MATRIX2_ARB 0x88C2 +#define GL_MATRIX3_ARB 0x88C3 +#define GL_MATRIX4_ARB 0x88C4 +#define GL_MATRIX5_ARB 0x88C5 +#define GL_MATRIX6_ARB 0x88C6 +#define GL_MATRIX7_ARB 0x88C7 +#define GL_MATRIX8_ARB 0x88C8 +#define GL_MATRIX9_ARB 0x88C9 +#define GL_MATRIX10_ARB 0x88CA +#define GL_MATRIX11_ARB 0x88CB +#define GL_MATRIX12_ARB 0x88CC +#define GL_MATRIX13_ARB 0x88CD +#define GL_MATRIX14_ARB 0x88CE +#define GL_MATRIX15_ARB 0x88CF +#define GL_MATRIX16_ARB 0x88D0 +#define GL_MATRIX17_ARB 0x88D1 +#define GL_MATRIX18_ARB 0x88D2 +#define GL_MATRIX19_ARB 0x88D3 +#define GL_MATRIX20_ARB 0x88D4 +#define GL_MATRIX21_ARB 0x88D5 +#define GL_MATRIX22_ARB 0x88D6 +#define GL_MATRIX23_ARB 0x88D7 +#define GL_MATRIX24_ARB 0x88D8 +#define GL_MATRIX25_ARB 0x88D9 +#define GL_MATRIX26_ARB 0x88DA +#define GL_MATRIX27_ARB 0x88DB +#define GL_MATRIX28_ARB 0x88DC +#define GL_MATRIX29_ARB 0x88DD +#define GL_MATRIX30_ARB 0x88DE +#define GL_MATRIX31_ARB 0x88DF + +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint* programs); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint* programs); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, void* string); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMARBPROC) (GLuint program); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const void* string); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer); + +#define glBindProgramARB GLEW_GET_FUN(__glewBindProgramARB) +#define glDeleteProgramsARB GLEW_GET_FUN(__glewDeleteProgramsARB) +#define glDisableVertexAttribArrayARB GLEW_GET_FUN(__glewDisableVertexAttribArrayARB) +#define glEnableVertexAttribArrayARB GLEW_GET_FUN(__glewEnableVertexAttribArrayARB) +#define glGenProgramsARB GLEW_GET_FUN(__glewGenProgramsARB) +#define glGetProgramEnvParameterdvARB GLEW_GET_FUN(__glewGetProgramEnvParameterdvARB) +#define glGetProgramEnvParameterfvARB GLEW_GET_FUN(__glewGetProgramEnvParameterfvARB) +#define glGetProgramLocalParameterdvARB GLEW_GET_FUN(__glewGetProgramLocalParameterdvARB) +#define glGetProgramLocalParameterfvARB GLEW_GET_FUN(__glewGetProgramLocalParameterfvARB) +#define glGetProgramStringARB GLEW_GET_FUN(__glewGetProgramStringARB) +#define glGetProgramivARB GLEW_GET_FUN(__glewGetProgramivARB) +#define glGetVertexAttribPointervARB GLEW_GET_FUN(__glewGetVertexAttribPointervARB) +#define glGetVertexAttribdvARB GLEW_GET_FUN(__glewGetVertexAttribdvARB) +#define glGetVertexAttribfvARB GLEW_GET_FUN(__glewGetVertexAttribfvARB) +#define glGetVertexAttribivARB GLEW_GET_FUN(__glewGetVertexAttribivARB) +#define glIsProgramARB GLEW_GET_FUN(__glewIsProgramARB) +#define glProgramEnvParameter4dARB GLEW_GET_FUN(__glewProgramEnvParameter4dARB) +#define glProgramEnvParameter4dvARB GLEW_GET_FUN(__glewProgramEnvParameter4dvARB) +#define glProgramEnvParameter4fARB GLEW_GET_FUN(__glewProgramEnvParameter4fARB) +#define glProgramEnvParameter4fvARB GLEW_GET_FUN(__glewProgramEnvParameter4fvARB) +#define glProgramLocalParameter4dARB GLEW_GET_FUN(__glewProgramLocalParameter4dARB) +#define glProgramLocalParameter4dvARB GLEW_GET_FUN(__glewProgramLocalParameter4dvARB) +#define glProgramLocalParameter4fARB GLEW_GET_FUN(__glewProgramLocalParameter4fARB) +#define glProgramLocalParameter4fvARB GLEW_GET_FUN(__glewProgramLocalParameter4fvARB) +#define glProgramStringARB GLEW_GET_FUN(__glewProgramStringARB) +#define glVertexAttrib1dARB GLEW_GET_FUN(__glewVertexAttrib1dARB) +#define glVertexAttrib1dvARB GLEW_GET_FUN(__glewVertexAttrib1dvARB) +#define glVertexAttrib1fARB GLEW_GET_FUN(__glewVertexAttrib1fARB) +#define glVertexAttrib1fvARB GLEW_GET_FUN(__glewVertexAttrib1fvARB) +#define glVertexAttrib1sARB GLEW_GET_FUN(__glewVertexAttrib1sARB) +#define glVertexAttrib1svARB GLEW_GET_FUN(__glewVertexAttrib1svARB) +#define glVertexAttrib2dARB GLEW_GET_FUN(__glewVertexAttrib2dARB) +#define glVertexAttrib2dvARB GLEW_GET_FUN(__glewVertexAttrib2dvARB) +#define glVertexAttrib2fARB GLEW_GET_FUN(__glewVertexAttrib2fARB) +#define glVertexAttrib2fvARB GLEW_GET_FUN(__glewVertexAttrib2fvARB) +#define glVertexAttrib2sARB GLEW_GET_FUN(__glewVertexAttrib2sARB) +#define glVertexAttrib2svARB GLEW_GET_FUN(__glewVertexAttrib2svARB) +#define glVertexAttrib3dARB GLEW_GET_FUN(__glewVertexAttrib3dARB) +#define glVertexAttrib3dvARB GLEW_GET_FUN(__glewVertexAttrib3dvARB) +#define glVertexAttrib3fARB GLEW_GET_FUN(__glewVertexAttrib3fARB) +#define glVertexAttrib3fvARB GLEW_GET_FUN(__glewVertexAttrib3fvARB) +#define glVertexAttrib3sARB GLEW_GET_FUN(__glewVertexAttrib3sARB) +#define glVertexAttrib3svARB GLEW_GET_FUN(__glewVertexAttrib3svARB) +#define glVertexAttrib4NbvARB GLEW_GET_FUN(__glewVertexAttrib4NbvARB) +#define glVertexAttrib4NivARB GLEW_GET_FUN(__glewVertexAttrib4NivARB) +#define glVertexAttrib4NsvARB GLEW_GET_FUN(__glewVertexAttrib4NsvARB) +#define glVertexAttrib4NubARB GLEW_GET_FUN(__glewVertexAttrib4NubARB) +#define glVertexAttrib4NubvARB GLEW_GET_FUN(__glewVertexAttrib4NubvARB) +#define glVertexAttrib4NuivARB GLEW_GET_FUN(__glewVertexAttrib4NuivARB) +#define glVertexAttrib4NusvARB GLEW_GET_FUN(__glewVertexAttrib4NusvARB) +#define glVertexAttrib4bvARB GLEW_GET_FUN(__glewVertexAttrib4bvARB) +#define glVertexAttrib4dARB GLEW_GET_FUN(__glewVertexAttrib4dARB) +#define glVertexAttrib4dvARB GLEW_GET_FUN(__glewVertexAttrib4dvARB) +#define glVertexAttrib4fARB GLEW_GET_FUN(__glewVertexAttrib4fARB) +#define glVertexAttrib4fvARB GLEW_GET_FUN(__glewVertexAttrib4fvARB) +#define glVertexAttrib4ivARB GLEW_GET_FUN(__glewVertexAttrib4ivARB) +#define glVertexAttrib4sARB GLEW_GET_FUN(__glewVertexAttrib4sARB) +#define glVertexAttrib4svARB GLEW_GET_FUN(__glewVertexAttrib4svARB) +#define glVertexAttrib4ubvARB GLEW_GET_FUN(__glewVertexAttrib4ubvARB) +#define glVertexAttrib4uivARB GLEW_GET_FUN(__glewVertexAttrib4uivARB) +#define glVertexAttrib4usvARB GLEW_GET_FUN(__glewVertexAttrib4usvARB) +#define glVertexAttribPointerARB GLEW_GET_FUN(__glewVertexAttribPointerARB) + +#define GLEW_ARB_vertex_program GLEW_GET_VAR(__GLEW_ARB_vertex_program) + +#endif /* GL_ARB_vertex_program */ + +/* -------------------------- GL_ARB_vertex_shader ------------------------- */ + +#ifndef GL_ARB_vertex_shader +#define GL_ARB_vertex_shader 1 + +#define GL_VERTEX_SHADER_ARB 0x8B31 +#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A +#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B +#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C +#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D +#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 +#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A + +typedef void (GLAPIENTRY * PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB* name); +typedef void (GLAPIENTRY * PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei* length, GLint *size, GLenum *type, GLcharARB *name); +typedef GLint (GLAPIENTRY * PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB* name); + +#define glBindAttribLocationARB GLEW_GET_FUN(__glewBindAttribLocationARB) +#define glGetActiveAttribARB GLEW_GET_FUN(__glewGetActiveAttribARB) +#define glGetAttribLocationARB GLEW_GET_FUN(__glewGetAttribLocationARB) + +#define GLEW_ARB_vertex_shader GLEW_GET_VAR(__GLEW_ARB_vertex_shader) + +#endif /* GL_ARB_vertex_shader */ + +/* ------------------- GL_ARB_vertex_type_2_10_10_10_rev ------------------- */ + +#ifndef GL_ARB_vertex_type_2_10_10_10_rev +#define GL_ARB_vertex_type_2_10_10_10_rev 1 + +#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 +#define GL_INT_2_10_10_10_REV 0x8D9F + +typedef void (GLAPIENTRY * PFNGLCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLCOLORP4UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP1UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP2UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP3UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIPROC) (GLenum texture, GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDP4UIVPROC) (GLenum texture, GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLNORMALP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIPROC) (GLenum type, GLuint color); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORP3UIVPROC) (GLenum type, const GLuint* color); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP1UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP2UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP3UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIPROC) (GLenum type, GLuint coords); +typedef void (GLAPIENTRY * PFNGLTEXCOORDP4UIVPROC) (GLenum type, const GLuint* coords); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP1UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP2UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP3UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIPROC) (GLuint index, GLenum type, GLboolean normalized, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBP4UIVPROC) (GLuint index, GLenum type, GLboolean normalized, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP2UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP3UIVPROC) (GLenum type, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIPROC) (GLenum type, GLuint value); +typedef void (GLAPIENTRY * PFNGLVERTEXP4UIVPROC) (GLenum type, const GLuint* value); + +#define glColorP3ui GLEW_GET_FUN(__glewColorP3ui) +#define glColorP3uiv GLEW_GET_FUN(__glewColorP3uiv) +#define glColorP4ui GLEW_GET_FUN(__glewColorP4ui) +#define glColorP4uiv GLEW_GET_FUN(__glewColorP4uiv) +#define glMultiTexCoordP1ui GLEW_GET_FUN(__glewMultiTexCoordP1ui) +#define glMultiTexCoordP1uiv GLEW_GET_FUN(__glewMultiTexCoordP1uiv) +#define glMultiTexCoordP2ui GLEW_GET_FUN(__glewMultiTexCoordP2ui) +#define glMultiTexCoordP2uiv GLEW_GET_FUN(__glewMultiTexCoordP2uiv) +#define glMultiTexCoordP3ui GLEW_GET_FUN(__glewMultiTexCoordP3ui) +#define glMultiTexCoordP3uiv GLEW_GET_FUN(__glewMultiTexCoordP3uiv) +#define glMultiTexCoordP4ui GLEW_GET_FUN(__glewMultiTexCoordP4ui) +#define glMultiTexCoordP4uiv GLEW_GET_FUN(__glewMultiTexCoordP4uiv) +#define glNormalP3ui GLEW_GET_FUN(__glewNormalP3ui) +#define glNormalP3uiv GLEW_GET_FUN(__glewNormalP3uiv) +#define glSecondaryColorP3ui GLEW_GET_FUN(__glewSecondaryColorP3ui) +#define glSecondaryColorP3uiv GLEW_GET_FUN(__glewSecondaryColorP3uiv) +#define glTexCoordP1ui GLEW_GET_FUN(__glewTexCoordP1ui) +#define glTexCoordP1uiv GLEW_GET_FUN(__glewTexCoordP1uiv) +#define glTexCoordP2ui GLEW_GET_FUN(__glewTexCoordP2ui) +#define glTexCoordP2uiv GLEW_GET_FUN(__glewTexCoordP2uiv) +#define glTexCoordP3ui GLEW_GET_FUN(__glewTexCoordP3ui) +#define glTexCoordP3uiv GLEW_GET_FUN(__glewTexCoordP3uiv) +#define glTexCoordP4ui GLEW_GET_FUN(__glewTexCoordP4ui) +#define glTexCoordP4uiv GLEW_GET_FUN(__glewTexCoordP4uiv) +#define glVertexAttribP1ui GLEW_GET_FUN(__glewVertexAttribP1ui) +#define glVertexAttribP1uiv GLEW_GET_FUN(__glewVertexAttribP1uiv) +#define glVertexAttribP2ui GLEW_GET_FUN(__glewVertexAttribP2ui) +#define glVertexAttribP2uiv GLEW_GET_FUN(__glewVertexAttribP2uiv) +#define glVertexAttribP3ui GLEW_GET_FUN(__glewVertexAttribP3ui) +#define glVertexAttribP3uiv GLEW_GET_FUN(__glewVertexAttribP3uiv) +#define glVertexAttribP4ui GLEW_GET_FUN(__glewVertexAttribP4ui) +#define glVertexAttribP4uiv GLEW_GET_FUN(__glewVertexAttribP4uiv) +#define glVertexP2ui GLEW_GET_FUN(__glewVertexP2ui) +#define glVertexP2uiv GLEW_GET_FUN(__glewVertexP2uiv) +#define glVertexP3ui GLEW_GET_FUN(__glewVertexP3ui) +#define glVertexP3uiv GLEW_GET_FUN(__glewVertexP3uiv) +#define glVertexP4ui GLEW_GET_FUN(__glewVertexP4ui) +#define glVertexP4uiv GLEW_GET_FUN(__glewVertexP4uiv) + +#define GLEW_ARB_vertex_type_2_10_10_10_rev GLEW_GET_VAR(__GLEW_ARB_vertex_type_2_10_10_10_rev) + +#endif /* GL_ARB_vertex_type_2_10_10_10_rev */ + +/* ------------------------- GL_ARB_viewport_array ------------------------- */ + +#ifndef GL_ARB_viewport_array +#define GL_ARB_viewport_array 1 + +#define GL_DEPTH_RANGE 0x0B70 +#define GL_VIEWPORT 0x0BA2 +#define GL_SCISSOR_BOX 0x0C10 +#define GL_SCISSOR_TEST 0x0C11 +#define GL_MAX_VIEWPORTS 0x825B +#define GL_VIEWPORT_SUBPIXEL_BITS 0x825C +#define GL_VIEWPORT_BOUNDS_RANGE 0x825D +#define GL_LAYER_PROVOKING_VERTEX 0x825E +#define GL_VIEWPORT_INDEX_PROVOKING_VERTEX 0x825F +#define GL_UNDEFINED_VERTEX 0x8260 +#define GL_FIRST_VERTEX_CONVENTION 0x8E4D +#define GL_LAST_VERTEX_CONVENTION 0x8E4E +#define GL_PROVOKING_VERTEX 0x8E4F + +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEARRAYVPROC) (GLuint first, GLsizei count, const GLclampd * v); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEINDEXEDPROC) (GLuint index, GLclampd n, GLclampd f); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VPROC) (GLenum target, GLuint index, GLdouble* data); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VPROC) (GLenum target, GLuint index, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLSCISSORARRAYVPROC) (GLuint first, GLsizei count, const GLint * v); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDPROC) (GLuint index, GLint left, GLint bottom, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLSCISSORINDEXEDVPROC) (GLuint index, const GLint * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTARRAYVPROC) (GLuint first, GLsizei count, const GLfloat * v); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat w, GLfloat h); +typedef void (GLAPIENTRY * PFNGLVIEWPORTINDEXEDFVPROC) (GLuint index, const GLfloat * v); + +#define glDepthRangeArrayv GLEW_GET_FUN(__glewDepthRangeArrayv) +#define glDepthRangeIndexed GLEW_GET_FUN(__glewDepthRangeIndexed) +#define glGetDoublei_v GLEW_GET_FUN(__glewGetDoublei_v) +#define glGetFloati_v GLEW_GET_FUN(__glewGetFloati_v) +#define glScissorArrayv GLEW_GET_FUN(__glewScissorArrayv) +#define glScissorIndexed GLEW_GET_FUN(__glewScissorIndexed) +#define glScissorIndexedv GLEW_GET_FUN(__glewScissorIndexedv) +#define glViewportArrayv GLEW_GET_FUN(__glewViewportArrayv) +#define glViewportIndexedf GLEW_GET_FUN(__glewViewportIndexedf) +#define glViewportIndexedfv GLEW_GET_FUN(__glewViewportIndexedfv) + +#define GLEW_ARB_viewport_array GLEW_GET_VAR(__GLEW_ARB_viewport_array) + +#endif /* GL_ARB_viewport_array */ + +/* --------------------------- GL_ARB_window_pos --------------------------- */ + +#ifndef GL_ARB_window_pos +#define GL_ARB_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVARBPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVARBPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVARBPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVARBPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVARBPROC) (const GLshort* p); + +#define glWindowPos2dARB GLEW_GET_FUN(__glewWindowPos2dARB) +#define glWindowPos2dvARB GLEW_GET_FUN(__glewWindowPos2dvARB) +#define glWindowPos2fARB GLEW_GET_FUN(__glewWindowPos2fARB) +#define glWindowPos2fvARB GLEW_GET_FUN(__glewWindowPos2fvARB) +#define glWindowPos2iARB GLEW_GET_FUN(__glewWindowPos2iARB) +#define glWindowPos2ivARB GLEW_GET_FUN(__glewWindowPos2ivARB) +#define glWindowPos2sARB GLEW_GET_FUN(__glewWindowPos2sARB) +#define glWindowPos2svARB GLEW_GET_FUN(__glewWindowPos2svARB) +#define glWindowPos3dARB GLEW_GET_FUN(__glewWindowPos3dARB) +#define glWindowPos3dvARB GLEW_GET_FUN(__glewWindowPos3dvARB) +#define glWindowPos3fARB GLEW_GET_FUN(__glewWindowPos3fARB) +#define glWindowPos3fvARB GLEW_GET_FUN(__glewWindowPos3fvARB) +#define glWindowPos3iARB GLEW_GET_FUN(__glewWindowPos3iARB) +#define glWindowPos3ivARB GLEW_GET_FUN(__glewWindowPos3ivARB) +#define glWindowPos3sARB GLEW_GET_FUN(__glewWindowPos3sARB) +#define glWindowPos3svARB GLEW_GET_FUN(__glewWindowPos3svARB) + +#define GLEW_ARB_window_pos GLEW_GET_VAR(__GLEW_ARB_window_pos) + +#endif /* GL_ARB_window_pos */ + +/* ------------------------- GL_ATIX_point_sprites ------------------------- */ + +#ifndef GL_ATIX_point_sprites +#define GL_ATIX_point_sprites 1 + +#define GL_TEXTURE_POINT_MODE_ATIX 0x60B0 +#define GL_TEXTURE_POINT_ONE_COORD_ATIX 0x60B1 +#define GL_TEXTURE_POINT_SPRITE_ATIX 0x60B2 +#define GL_POINT_SPRITE_CULL_MODE_ATIX 0x60B3 +#define GL_POINT_SPRITE_CULL_CENTER_ATIX 0x60B4 +#define GL_POINT_SPRITE_CULL_CLIP_ATIX 0x60B5 + +#define GLEW_ATIX_point_sprites GLEW_GET_VAR(__GLEW_ATIX_point_sprites) + +#endif /* GL_ATIX_point_sprites */ + +/* ---------------------- GL_ATIX_texture_env_combine3 --------------------- */ + +#ifndef GL_ATIX_texture_env_combine3 +#define GL_ATIX_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATIX 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATIX 0x8745 +#define GL_MODULATE_SUBTRACT_ATIX 0x8746 + +#define GLEW_ATIX_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATIX_texture_env_combine3) + +#endif /* GL_ATIX_texture_env_combine3 */ + +/* ----------------------- GL_ATIX_texture_env_route ----------------------- */ + +#ifndef GL_ATIX_texture_env_route +#define GL_ATIX_texture_env_route 1 + +#define GL_SECONDARY_COLOR_ATIX 0x8747 +#define GL_TEXTURE_OUTPUT_RGB_ATIX 0x8748 +#define GL_TEXTURE_OUTPUT_ALPHA_ATIX 0x8749 + +#define GLEW_ATIX_texture_env_route GLEW_GET_VAR(__GLEW_ATIX_texture_env_route) + +#endif /* GL_ATIX_texture_env_route */ + +/* ---------------- GL_ATIX_vertex_shader_output_point_size ---------------- */ + +#ifndef GL_ATIX_vertex_shader_output_point_size +#define GL_ATIX_vertex_shader_output_point_size 1 + +#define GL_OUTPUT_POINT_SIZE_ATIX 0x610E + +#define GLEW_ATIX_vertex_shader_output_point_size GLEW_GET_VAR(__GLEW_ATIX_vertex_shader_output_point_size) + +#endif /* GL_ATIX_vertex_shader_output_point_size */ + +/* -------------------------- GL_ATI_draw_buffers -------------------------- */ + +#ifndef GL_ATI_draw_buffers +#define GL_ATI_draw_buffers 1 + +#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 +#define GL_DRAW_BUFFER0_ATI 0x8825 +#define GL_DRAW_BUFFER1_ATI 0x8826 +#define GL_DRAW_BUFFER2_ATI 0x8827 +#define GL_DRAW_BUFFER3_ATI 0x8828 +#define GL_DRAW_BUFFER4_ATI 0x8829 +#define GL_DRAW_BUFFER5_ATI 0x882A +#define GL_DRAW_BUFFER6_ATI 0x882B +#define GL_DRAW_BUFFER7_ATI 0x882C +#define GL_DRAW_BUFFER8_ATI 0x882D +#define GL_DRAW_BUFFER9_ATI 0x882E +#define GL_DRAW_BUFFER10_ATI 0x882F +#define GL_DRAW_BUFFER11_ATI 0x8830 +#define GL_DRAW_BUFFER12_ATI 0x8831 +#define GL_DRAW_BUFFER13_ATI 0x8832 +#define GL_DRAW_BUFFER14_ATI 0x8833 +#define GL_DRAW_BUFFER15_ATI 0x8834 + +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum* bufs); + +#define glDrawBuffersATI GLEW_GET_FUN(__glewDrawBuffersATI) + +#define GLEW_ATI_draw_buffers GLEW_GET_VAR(__GLEW_ATI_draw_buffers) + +#endif /* GL_ATI_draw_buffers */ + +/* -------------------------- GL_ATI_element_array ------------------------- */ + +#ifndef GL_ATI_element_array +#define GL_ATI_element_array 1 + +#define GL_ELEMENT_ARRAY_ATI 0x8768 +#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 +#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A + +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); +typedef void (GLAPIENTRY * PFNGLELEMENTPOINTERATIPROC) (GLenum type, const void* pointer); + +#define glDrawElementArrayATI GLEW_GET_FUN(__glewDrawElementArrayATI) +#define glDrawRangeElementArrayATI GLEW_GET_FUN(__glewDrawRangeElementArrayATI) +#define glElementPointerATI GLEW_GET_FUN(__glewElementPointerATI) + +#define GLEW_ATI_element_array GLEW_GET_VAR(__GLEW_ATI_element_array) + +#endif /* GL_ATI_element_array */ + +/* ------------------------- GL_ATI_envmap_bumpmap ------------------------- */ + +#ifndef GL_ATI_envmap_bumpmap +#define GL_ATI_envmap_bumpmap 1 + +#define GL_BUMP_ROT_MATRIX_ATI 0x8775 +#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 +#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 +#define GL_BUMP_TEX_UNITS_ATI 0x8778 +#define GL_DUDV_ATI 0x8779 +#define GL_DU8DV8_ATI 0x877A +#define GL_BUMP_ENVMAP_ATI 0x877B +#define GL_BUMP_TARGET_ATI 0x877C + +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); +typedef void (GLAPIENTRY * PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); + +#define glGetTexBumpParameterfvATI GLEW_GET_FUN(__glewGetTexBumpParameterfvATI) +#define glGetTexBumpParameterivATI GLEW_GET_FUN(__glewGetTexBumpParameterivATI) +#define glTexBumpParameterfvATI GLEW_GET_FUN(__glewTexBumpParameterfvATI) +#define glTexBumpParameterivATI GLEW_GET_FUN(__glewTexBumpParameterivATI) + +#define GLEW_ATI_envmap_bumpmap GLEW_GET_VAR(__GLEW_ATI_envmap_bumpmap) + +#endif /* GL_ATI_envmap_bumpmap */ + +/* ------------------------- GL_ATI_fragment_shader ------------------------ */ + +#ifndef GL_ATI_fragment_shader +#define GL_ATI_fragment_shader 1 + +#define GL_RED_BIT_ATI 0x00000001 +#define GL_2X_BIT_ATI 0x00000001 +#define GL_4X_BIT_ATI 0x00000002 +#define GL_GREEN_BIT_ATI 0x00000002 +#define GL_COMP_BIT_ATI 0x00000002 +#define GL_BLUE_BIT_ATI 0x00000004 +#define GL_8X_BIT_ATI 0x00000004 +#define GL_NEGATE_BIT_ATI 0x00000004 +#define GL_BIAS_BIT_ATI 0x00000008 +#define GL_HALF_BIT_ATI 0x00000008 +#define GL_QUARTER_BIT_ATI 0x00000010 +#define GL_EIGHTH_BIT_ATI 0x00000020 +#define GL_SATURATE_BIT_ATI 0x00000040 +#define GL_FRAGMENT_SHADER_ATI 0x8920 +#define GL_REG_0_ATI 0x8921 +#define GL_REG_1_ATI 0x8922 +#define GL_REG_2_ATI 0x8923 +#define GL_REG_3_ATI 0x8924 +#define GL_REG_4_ATI 0x8925 +#define GL_REG_5_ATI 0x8926 +#define GL_CON_0_ATI 0x8941 +#define GL_CON_1_ATI 0x8942 +#define GL_CON_2_ATI 0x8943 +#define GL_CON_3_ATI 0x8944 +#define GL_CON_4_ATI 0x8945 +#define GL_CON_5_ATI 0x8946 +#define GL_CON_6_ATI 0x8947 +#define GL_CON_7_ATI 0x8948 +#define GL_MOV_ATI 0x8961 +#define GL_ADD_ATI 0x8963 +#define GL_MUL_ATI 0x8964 +#define GL_SUB_ATI 0x8965 +#define GL_DOT3_ATI 0x8966 +#define GL_DOT4_ATI 0x8967 +#define GL_MAD_ATI 0x8968 +#define GL_LERP_ATI 0x8969 +#define GL_CND_ATI 0x896A +#define GL_CND0_ATI 0x896B +#define GL_DOT2_ADD_ATI 0x896C +#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D +#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E +#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F +#define GL_NUM_PASSES_ATI 0x8970 +#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 +#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 +#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 +#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 +#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 +#define GL_SWIZZLE_STR_ATI 0x8976 +#define GL_SWIZZLE_STQ_ATI 0x8977 +#define GL_SWIZZLE_STR_DR_ATI 0x8978 +#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 +#define GL_SWIZZLE_STRQ_ATI 0x897A +#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B + +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLBEGINFRAGMENTSHADERATIPROC) (void); +typedef void (GLAPIENTRY * PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); +typedef void (GLAPIENTRY * PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); +typedef void (GLAPIENTRY * PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDFRAGMENTSHADERATIPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); +typedef void (GLAPIENTRY * PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat* value); + +#define glAlphaFragmentOp1ATI GLEW_GET_FUN(__glewAlphaFragmentOp1ATI) +#define glAlphaFragmentOp2ATI GLEW_GET_FUN(__glewAlphaFragmentOp2ATI) +#define glAlphaFragmentOp3ATI GLEW_GET_FUN(__glewAlphaFragmentOp3ATI) +#define glBeginFragmentShaderATI GLEW_GET_FUN(__glewBeginFragmentShaderATI) +#define glBindFragmentShaderATI GLEW_GET_FUN(__glewBindFragmentShaderATI) +#define glColorFragmentOp1ATI GLEW_GET_FUN(__glewColorFragmentOp1ATI) +#define glColorFragmentOp2ATI GLEW_GET_FUN(__glewColorFragmentOp2ATI) +#define glColorFragmentOp3ATI GLEW_GET_FUN(__glewColorFragmentOp3ATI) +#define glDeleteFragmentShaderATI GLEW_GET_FUN(__glewDeleteFragmentShaderATI) +#define glEndFragmentShaderATI GLEW_GET_FUN(__glewEndFragmentShaderATI) +#define glGenFragmentShadersATI GLEW_GET_FUN(__glewGenFragmentShadersATI) +#define glPassTexCoordATI GLEW_GET_FUN(__glewPassTexCoordATI) +#define glSampleMapATI GLEW_GET_FUN(__glewSampleMapATI) +#define glSetFragmentShaderConstantATI GLEW_GET_FUN(__glewSetFragmentShaderConstantATI) + +#define GLEW_ATI_fragment_shader GLEW_GET_VAR(__GLEW_ATI_fragment_shader) + +#endif /* GL_ATI_fragment_shader */ + +/* ------------------------ GL_ATI_map_object_buffer ----------------------- */ + +#ifndef GL_ATI_map_object_buffer +#define GL_ATI_map_object_buffer 1 + +typedef void* (GLAPIENTRY * PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); + +#define glMapObjectBufferATI GLEW_GET_FUN(__glewMapObjectBufferATI) +#define glUnmapObjectBufferATI GLEW_GET_FUN(__glewUnmapObjectBufferATI) + +#define GLEW_ATI_map_object_buffer GLEW_GET_VAR(__GLEW_ATI_map_object_buffer) + +#endif /* GL_ATI_map_object_buffer */ + +/* ----------------------------- GL_ATI_meminfo ---------------------------- */ + +#ifndef GL_ATI_meminfo +#define GL_ATI_meminfo 1 + +#define GL_VBO_FREE_MEMORY_ATI 0x87FB +#define GL_TEXTURE_FREE_MEMORY_ATI 0x87FC +#define GL_RENDERBUFFER_FREE_MEMORY_ATI 0x87FD + +#define GLEW_ATI_meminfo GLEW_GET_VAR(__GLEW_ATI_meminfo) + +#endif /* GL_ATI_meminfo */ + +/* -------------------------- GL_ATI_pn_triangles -------------------------- */ + +#ifndef GL_ATI_pn_triangles +#define GL_ATI_pn_triangles 1 + +#define GL_PN_TRIANGLES_ATI 0x87F0 +#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 +#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 +#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 +#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 +#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 +#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 +#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 +#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 + +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); + +#define glPNTrianglesfATI GLEW_GET_FUN(__glPNTrianglewesfATI) +#define glPNTrianglesiATI GLEW_GET_FUN(__glPNTrianglewesiATI) + +#define GLEW_ATI_pn_triangles GLEW_GET_VAR(__GLEW_ATI_pn_triangles) + +#endif /* GL_ATI_pn_triangles */ + +/* ------------------------ GL_ATI_separate_stencil ------------------------ */ + +#ifndef GL_ATI_separate_stencil +#define GL_ATI_separate_stencil 1 + +#define GL_STENCIL_BACK_FUNC_ATI 0x8800 +#define GL_STENCIL_BACK_FAIL_ATI 0x8801 +#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 +#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 + +typedef void (GLAPIENTRY * PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); +typedef void (GLAPIENTRY * PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); + +#define glStencilFuncSeparateATI GLEW_GET_FUN(__glewStencilFuncSeparateATI) +#define glStencilOpSeparateATI GLEW_GET_FUN(__glewStencilOpSeparateATI) + +#define GLEW_ATI_separate_stencil GLEW_GET_VAR(__GLEW_ATI_separate_stencil) + +#endif /* GL_ATI_separate_stencil */ + +/* ----------------------- GL_ATI_shader_texture_lod ----------------------- */ + +#ifndef GL_ATI_shader_texture_lod +#define GL_ATI_shader_texture_lod 1 + +#define GLEW_ATI_shader_texture_lod GLEW_GET_VAR(__GLEW_ATI_shader_texture_lod) + +#endif /* GL_ATI_shader_texture_lod */ + +/* ---------------------- GL_ATI_text_fragment_shader ---------------------- */ + +#ifndef GL_ATI_text_fragment_shader +#define GL_ATI_text_fragment_shader 1 + +#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 + +#define GLEW_ATI_text_fragment_shader GLEW_GET_VAR(__GLEW_ATI_text_fragment_shader) + +#endif /* GL_ATI_text_fragment_shader */ + +/* --------------------- GL_ATI_texture_compression_3dc -------------------- */ + +#ifndef GL_ATI_texture_compression_3dc +#define GL_ATI_texture_compression_3dc 1 + +#define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 + +#define GLEW_ATI_texture_compression_3dc GLEW_GET_VAR(__GLEW_ATI_texture_compression_3dc) + +#endif /* GL_ATI_texture_compression_3dc */ + +/* ---------------------- GL_ATI_texture_env_combine3 ---------------------- */ + +#ifndef GL_ATI_texture_env_combine3 +#define GL_ATI_texture_env_combine3 1 + +#define GL_MODULATE_ADD_ATI 0x8744 +#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 +#define GL_MODULATE_SUBTRACT_ATI 0x8746 + +#define GLEW_ATI_texture_env_combine3 GLEW_GET_VAR(__GLEW_ATI_texture_env_combine3) + +#endif /* GL_ATI_texture_env_combine3 */ + +/* -------------------------- GL_ATI_texture_float ------------------------- */ + +#ifndef GL_ATI_texture_float +#define GL_ATI_texture_float 1 + +#define GL_RGBA_FLOAT32_ATI 0x8814 +#define GL_RGB_FLOAT32_ATI 0x8815 +#define GL_ALPHA_FLOAT32_ATI 0x8816 +#define GL_INTENSITY_FLOAT32_ATI 0x8817 +#define GL_LUMINANCE_FLOAT32_ATI 0x8818 +#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 +#define GL_RGBA_FLOAT16_ATI 0x881A +#define GL_RGB_FLOAT16_ATI 0x881B +#define GL_ALPHA_FLOAT16_ATI 0x881C +#define GL_INTENSITY_FLOAT16_ATI 0x881D +#define GL_LUMINANCE_FLOAT16_ATI 0x881E +#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F + +#define GLEW_ATI_texture_float GLEW_GET_VAR(__GLEW_ATI_texture_float) + +#endif /* GL_ATI_texture_float */ + +/* ----------------------- GL_ATI_texture_mirror_once ---------------------- */ + +#ifndef GL_ATI_texture_mirror_once +#define GL_ATI_texture_mirror_once 1 + +#define GL_MIRROR_CLAMP_ATI 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 + +#define GLEW_ATI_texture_mirror_once GLEW_GET_VAR(__GLEW_ATI_texture_mirror_once) + +#endif /* GL_ATI_texture_mirror_once */ + +/* ----------------------- GL_ATI_vertex_array_object ---------------------- */ + +#ifndef GL_ATI_vertex_array_object +#define GL_ATI_vertex_array_object 1 + +#define GL_STATIC_ATI 0x8760 +#define GL_DYNAMIC_ATI 0x8761 +#define GL_PRESERVE_ATI 0x8762 +#define GL_DISCARD_ATI 0x8763 +#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 +#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 +#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 +#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 + +typedef void (GLAPIENTRY * PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); +typedef void (GLAPIENTRY * PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); +typedef GLuint (GLAPIENTRY * PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const void* pointer, GLenum usage); +typedef void (GLAPIENTRY * PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const void* pointer, GLenum preserve); +typedef void (GLAPIENTRY * PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); + +#define glArrayObjectATI GLEW_GET_FUN(__glewArrayObjectATI) +#define glFreeObjectBufferATI GLEW_GET_FUN(__glewFreeObjectBufferATI) +#define glGetArrayObjectfvATI GLEW_GET_FUN(__glewGetArrayObjectfvATI) +#define glGetArrayObjectivATI GLEW_GET_FUN(__glewGetArrayObjectivATI) +#define glGetObjectBufferfvATI GLEW_GET_FUN(__glewGetObjectBufferfvATI) +#define glGetObjectBufferivATI GLEW_GET_FUN(__glewGetObjectBufferivATI) +#define glGetVariantArrayObjectfvATI GLEW_GET_FUN(__glewGetVariantArrayObjectfvATI) +#define glGetVariantArrayObjectivATI GLEW_GET_FUN(__glewGetVariantArrayObjectivATI) +#define glIsObjectBufferATI GLEW_GET_FUN(__glewIsObjectBufferATI) +#define glNewObjectBufferATI GLEW_GET_FUN(__glewNewObjectBufferATI) +#define glUpdateObjectBufferATI GLEW_GET_FUN(__glewUpdateObjectBufferATI) +#define glVariantArrayObjectATI GLEW_GET_FUN(__glewVariantArrayObjectATI) + +#define GLEW_ATI_vertex_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_array_object) + +#endif /* GL_ATI_vertex_array_object */ + +/* ------------------- GL_ATI_vertex_attrib_array_object ------------------- */ + +#ifndef GL_ATI_vertex_attrib_array_object +#define GL_ATI_vertex_attrib_array_object 1 + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); + +#define glGetVertexAttribArrayObjectfvATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectfvATI) +#define glGetVertexAttribArrayObjectivATI GLEW_GET_FUN(__glewGetVertexAttribArrayObjectivATI) +#define glVertexAttribArrayObjectATI GLEW_GET_FUN(__glewVertexAttribArrayObjectATI) + +#define GLEW_ATI_vertex_attrib_array_object GLEW_GET_VAR(__GLEW_ATI_vertex_attrib_array_object) + +#endif /* GL_ATI_vertex_attrib_array_object */ + +/* ------------------------- GL_ATI_vertex_streams ------------------------- */ + +#ifndef GL_ATI_vertex_streams +#define GL_ATI_vertex_streams 1 + +#define GL_MAX_VERTEX_STREAMS_ATI 0x876B +#define GL_VERTEX_SOURCE_ATI 0x876C +#define GL_VERTEX_STREAM0_ATI 0x876D +#define GL_VERTEX_STREAM1_ATI 0x876E +#define GL_VERTEX_STREAM2_ATI 0x876F +#define GL_VERTEX_STREAM3_ATI 0x8770 +#define GL_VERTEX_STREAM4_ATI 0x8771 +#define GL_VERTEX_STREAM5_ATI 0x8772 +#define GL_VERTEX_STREAM6_ATI 0x8773 +#define GL_VERTEX_STREAM7_ATI 0x8774 + +typedef void (GLAPIENTRY * PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte x, GLbyte y, GLbyte z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *v); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *v); + +#define glClientActiveVertexStreamATI GLEW_GET_FUN(__glewClientActiveVertexStreamATI) +#define glNormalStream3bATI GLEW_GET_FUN(__glewNormalStream3bATI) +#define glNormalStream3bvATI GLEW_GET_FUN(__glewNormalStream3bvATI) +#define glNormalStream3dATI GLEW_GET_FUN(__glewNormalStream3dATI) +#define glNormalStream3dvATI GLEW_GET_FUN(__glewNormalStream3dvATI) +#define glNormalStream3fATI GLEW_GET_FUN(__glewNormalStream3fATI) +#define glNormalStream3fvATI GLEW_GET_FUN(__glewNormalStream3fvATI) +#define glNormalStream3iATI GLEW_GET_FUN(__glewNormalStream3iATI) +#define glNormalStream3ivATI GLEW_GET_FUN(__glewNormalStream3ivATI) +#define glNormalStream3sATI GLEW_GET_FUN(__glewNormalStream3sATI) +#define glNormalStream3svATI GLEW_GET_FUN(__glewNormalStream3svATI) +#define glVertexBlendEnvfATI GLEW_GET_FUN(__glewVertexBlendEnvfATI) +#define glVertexBlendEnviATI GLEW_GET_FUN(__glewVertexBlendEnviATI) +#define glVertexStream2dATI GLEW_GET_FUN(__glewVertexStream2dATI) +#define glVertexStream2dvATI GLEW_GET_FUN(__glewVertexStream2dvATI) +#define glVertexStream2fATI GLEW_GET_FUN(__glewVertexStream2fATI) +#define glVertexStream2fvATI GLEW_GET_FUN(__glewVertexStream2fvATI) +#define glVertexStream2iATI GLEW_GET_FUN(__glewVertexStream2iATI) +#define glVertexStream2ivATI GLEW_GET_FUN(__glewVertexStream2ivATI) +#define glVertexStream2sATI GLEW_GET_FUN(__glewVertexStream2sATI) +#define glVertexStream2svATI GLEW_GET_FUN(__glewVertexStream2svATI) +#define glVertexStream3dATI GLEW_GET_FUN(__glewVertexStream3dATI) +#define glVertexStream3dvATI GLEW_GET_FUN(__glewVertexStream3dvATI) +#define glVertexStream3fATI GLEW_GET_FUN(__glewVertexStream3fATI) +#define glVertexStream3fvATI GLEW_GET_FUN(__glewVertexStream3fvATI) +#define glVertexStream3iATI GLEW_GET_FUN(__glewVertexStream3iATI) +#define glVertexStream3ivATI GLEW_GET_FUN(__glewVertexStream3ivATI) +#define glVertexStream3sATI GLEW_GET_FUN(__glewVertexStream3sATI) +#define glVertexStream3svATI GLEW_GET_FUN(__glewVertexStream3svATI) +#define glVertexStream4dATI GLEW_GET_FUN(__glewVertexStream4dATI) +#define glVertexStream4dvATI GLEW_GET_FUN(__glewVertexStream4dvATI) +#define glVertexStream4fATI GLEW_GET_FUN(__glewVertexStream4fATI) +#define glVertexStream4fvATI GLEW_GET_FUN(__glewVertexStream4fvATI) +#define glVertexStream4iATI GLEW_GET_FUN(__glewVertexStream4iATI) +#define glVertexStream4ivATI GLEW_GET_FUN(__glewVertexStream4ivATI) +#define glVertexStream4sATI GLEW_GET_FUN(__glewVertexStream4sATI) +#define glVertexStream4svATI GLEW_GET_FUN(__glewVertexStream4svATI) + +#define GLEW_ATI_vertex_streams GLEW_GET_VAR(__GLEW_ATI_vertex_streams) + +#endif /* GL_ATI_vertex_streams */ + +/* --------------------------- GL_EXT_422_pixels --------------------------- */ + +#ifndef GL_EXT_422_pixels +#define GL_EXT_422_pixels 1 + +#define GL_422_EXT 0x80CC +#define GL_422_REV_EXT 0x80CD +#define GL_422_AVERAGE_EXT 0x80CE +#define GL_422_REV_AVERAGE_EXT 0x80CF + +#define GLEW_EXT_422_pixels GLEW_GET_VAR(__GLEW_EXT_422_pixels) + +#endif /* GL_EXT_422_pixels */ + +/* ---------------------------- GL_EXT_Cg_shader --------------------------- */ + +#ifndef GL_EXT_Cg_shader +#define GL_EXT_Cg_shader 1 + +#define GL_CG_VERTEX_SHADER_EXT 0x890E +#define GL_CG_FRAGMENT_SHADER_EXT 0x890F + +#define GLEW_EXT_Cg_shader GLEW_GET_VAR(__GLEW_EXT_Cg_shader) + +#endif /* GL_EXT_Cg_shader */ + +/* ------------------------------ GL_EXT_abgr ------------------------------ */ + +#ifndef GL_EXT_abgr +#define GL_EXT_abgr 1 + +#define GL_ABGR_EXT 0x8000 + +#define GLEW_EXT_abgr GLEW_GET_VAR(__GLEW_EXT_abgr) + +#endif /* GL_EXT_abgr */ + +/* ------------------------------ GL_EXT_bgra ------------------------------ */ + +#ifndef GL_EXT_bgra +#define GL_EXT_bgra 1 + +#define GL_BGR_EXT 0x80E0 +#define GL_BGRA_EXT 0x80E1 + +#define GLEW_EXT_bgra GLEW_GET_VAR(__GLEW_EXT_bgra) + +#endif /* GL_EXT_bgra */ + +/* ------------------------ GL_EXT_bindable_uniform ------------------------ */ + +#ifndef GL_EXT_bindable_uniform +#define GL_EXT_bindable_uniform 1 + +#define GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT 0x8DE2 +#define GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT 0x8DE3 +#define GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT 0x8DE4 +#define GL_MAX_BINDABLE_UNIFORM_SIZE_EXT 0x8DED +#define GL_UNIFORM_BUFFER_EXT 0x8DEE +#define GL_UNIFORM_BUFFER_BINDING_EXT 0x8DEF + +typedef GLint (GLAPIENTRY * PFNGLGETUNIFORMBUFFERSIZEEXTPROC) (GLuint program, GLint location); +typedef GLintptr (GLAPIENTRY * PFNGLGETUNIFORMOFFSETEXTPROC) (GLuint program, GLint location); +typedef void (GLAPIENTRY * PFNGLUNIFORMBUFFEREXTPROC) (GLuint program, GLint location, GLuint buffer); + +#define glGetUniformBufferSizeEXT GLEW_GET_FUN(__glewGetUniformBufferSizeEXT) +#define glGetUniformOffsetEXT GLEW_GET_FUN(__glewGetUniformOffsetEXT) +#define glUniformBufferEXT GLEW_GET_FUN(__glewUniformBufferEXT) + +#define GLEW_EXT_bindable_uniform GLEW_GET_VAR(__GLEW_EXT_bindable_uniform) + +#endif /* GL_EXT_bindable_uniform */ + +/* --------------------------- GL_EXT_blend_color -------------------------- */ + +#ifndef GL_EXT_blend_color +#define GL_EXT_blend_color 1 + +#define GL_CONSTANT_COLOR_EXT 0x8001 +#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 +#define GL_CONSTANT_ALPHA_EXT 0x8003 +#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 +#define GL_BLEND_COLOR_EXT 0x8005 + +typedef void (GLAPIENTRY * PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); + +#define glBlendColorEXT GLEW_GET_FUN(__glewBlendColorEXT) + +#define GLEW_EXT_blend_color GLEW_GET_VAR(__GLEW_EXT_blend_color) + +#endif /* GL_EXT_blend_color */ + +/* --------------------- GL_EXT_blend_equation_separate -------------------- */ + +#ifndef GL_EXT_blend_equation_separate +#define GL_EXT_blend_equation_separate 1 + +#define GL_BLEND_EQUATION_RGB_EXT 0x8009 +#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); + +#define glBlendEquationSeparateEXT GLEW_GET_FUN(__glewBlendEquationSeparateEXT) + +#define GLEW_EXT_blend_equation_separate GLEW_GET_VAR(__GLEW_EXT_blend_equation_separate) + +#endif /* GL_EXT_blend_equation_separate */ + +/* ----------------------- GL_EXT_blend_func_separate ---------------------- */ + +#ifndef GL_EXT_blend_func_separate +#define GL_EXT_blend_func_separate 1 + +#define GL_BLEND_DST_RGB_EXT 0x80C8 +#define GL_BLEND_SRC_RGB_EXT 0x80C9 +#define GL_BLEND_DST_ALPHA_EXT 0x80CA +#define GL_BLEND_SRC_ALPHA_EXT 0x80CB + +typedef void (GLAPIENTRY * PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); + +#define glBlendFuncSeparateEXT GLEW_GET_FUN(__glewBlendFuncSeparateEXT) + +#define GLEW_EXT_blend_func_separate GLEW_GET_VAR(__GLEW_EXT_blend_func_separate) + +#endif /* GL_EXT_blend_func_separate */ + +/* ------------------------- GL_EXT_blend_logic_op ------------------------- */ + +#ifndef GL_EXT_blend_logic_op +#define GL_EXT_blend_logic_op 1 + +#define GLEW_EXT_blend_logic_op GLEW_GET_VAR(__GLEW_EXT_blend_logic_op) + +#endif /* GL_EXT_blend_logic_op */ + +/* -------------------------- GL_EXT_blend_minmax -------------------------- */ + +#ifndef GL_EXT_blend_minmax +#define GL_EXT_blend_minmax 1 + +#define GL_FUNC_ADD_EXT 0x8006 +#define GL_MIN_EXT 0x8007 +#define GL_MAX_EXT 0x8008 +#define GL_BLEND_EQUATION_EXT 0x8009 + +typedef void (GLAPIENTRY * PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); + +#define glBlendEquationEXT GLEW_GET_FUN(__glewBlendEquationEXT) + +#define GLEW_EXT_blend_minmax GLEW_GET_VAR(__GLEW_EXT_blend_minmax) + +#endif /* GL_EXT_blend_minmax */ + +/* ------------------------- GL_EXT_blend_subtract ------------------------- */ + +#ifndef GL_EXT_blend_subtract +#define GL_EXT_blend_subtract 1 + +#define GL_FUNC_SUBTRACT_EXT 0x800A +#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B + +#define GLEW_EXT_blend_subtract GLEW_GET_VAR(__GLEW_EXT_blend_subtract) + +#endif /* GL_EXT_blend_subtract */ + +/* ------------------------ GL_EXT_clip_volume_hint ------------------------ */ + +#ifndef GL_EXT_clip_volume_hint +#define GL_EXT_clip_volume_hint 1 + +#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 + +#define GLEW_EXT_clip_volume_hint GLEW_GET_VAR(__GLEW_EXT_clip_volume_hint) + +#endif /* GL_EXT_clip_volume_hint */ + +/* ------------------------------ GL_EXT_cmyka ----------------------------- */ + +#ifndef GL_EXT_cmyka +#define GL_EXT_cmyka 1 + +#define GL_CMYK_EXT 0x800C +#define GL_CMYKA_EXT 0x800D +#define GL_PACK_CMYK_HINT_EXT 0x800E +#define GL_UNPACK_CMYK_HINT_EXT 0x800F + +#define GLEW_EXT_cmyka GLEW_GET_VAR(__GLEW_EXT_cmyka) + +#endif /* GL_EXT_cmyka */ + +/* ------------------------- GL_EXT_color_subtable ------------------------- */ + +#ifndef GL_EXT_color_subtable +#define GL_EXT_color_subtable 1 + +typedef void (GLAPIENTRY * PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const void* data); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); + +#define glColorSubTableEXT GLEW_GET_FUN(__glewColorSubTableEXT) +#define glCopyColorSubTableEXT GLEW_GET_FUN(__glewCopyColorSubTableEXT) + +#define GLEW_EXT_color_subtable GLEW_GET_VAR(__GLEW_EXT_color_subtable) + +#endif /* GL_EXT_color_subtable */ + +/* ---------------------- GL_EXT_compiled_vertex_array --------------------- */ + +#ifndef GL_EXT_compiled_vertex_array +#define GL_EXT_compiled_vertex_array 1 + +#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 +#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 + +typedef void (GLAPIENTRY * PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLUNLOCKARRAYSEXTPROC) (void); + +#define glLockArraysEXT GLEW_GET_FUN(__glewLockArraysEXT) +#define glUnlockArraysEXT GLEW_GET_FUN(__glewUnlockArraysEXT) + +#define GLEW_EXT_compiled_vertex_array GLEW_GET_VAR(__GLEW_EXT_compiled_vertex_array) + +#endif /* GL_EXT_compiled_vertex_array */ + +/* --------------------------- GL_EXT_convolution -------------------------- */ + +#ifndef GL_EXT_convolution +#define GL_EXT_convolution 1 + +#define GL_CONVOLUTION_1D_EXT 0x8010 +#define GL_CONVOLUTION_2D_EXT 0x8011 +#define GL_SEPARABLE_2D_EXT 0x8012 +#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 +#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 +#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 +#define GL_REDUCE_EXT 0x8016 +#define GL_CONVOLUTION_FORMAT_EXT 0x8017 +#define GL_CONVOLUTION_WIDTH_EXT 0x8018 +#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 +#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A +#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B +#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C +#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D +#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E +#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F +#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 +#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 +#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 +#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 + +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* image); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* image); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, void* row, void* column, void* span); +typedef void (GLAPIENTRY * PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* row, const void* column); + +#define glConvolutionFilter1DEXT GLEW_GET_FUN(__glewConvolutionFilter1DEXT) +#define glConvolutionFilter2DEXT GLEW_GET_FUN(__glewConvolutionFilter2DEXT) +#define glConvolutionParameterfEXT GLEW_GET_FUN(__glewConvolutionParameterfEXT) +#define glConvolutionParameterfvEXT GLEW_GET_FUN(__glewConvolutionParameterfvEXT) +#define glConvolutionParameteriEXT GLEW_GET_FUN(__glewConvolutionParameteriEXT) +#define glConvolutionParameterivEXT GLEW_GET_FUN(__glewConvolutionParameterivEXT) +#define glCopyConvolutionFilter1DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter1DEXT) +#define glCopyConvolutionFilter2DEXT GLEW_GET_FUN(__glewCopyConvolutionFilter2DEXT) +#define glGetConvolutionFilterEXT GLEW_GET_FUN(__glewGetConvolutionFilterEXT) +#define glGetConvolutionParameterfvEXT GLEW_GET_FUN(__glewGetConvolutionParameterfvEXT) +#define glGetConvolutionParameterivEXT GLEW_GET_FUN(__glewGetConvolutionParameterivEXT) +#define glGetSeparableFilterEXT GLEW_GET_FUN(__glewGetSeparableFilterEXT) +#define glSeparableFilter2DEXT GLEW_GET_FUN(__glewSeparableFilter2DEXT) + +#define GLEW_EXT_convolution GLEW_GET_VAR(__GLEW_EXT_convolution) + +#endif /* GL_EXT_convolution */ + +/* ------------------------ GL_EXT_coordinate_frame ------------------------ */ + +#ifndef GL_EXT_coordinate_frame +#define GL_EXT_coordinate_frame 1 + +#define GL_TANGENT_ARRAY_EXT 0x8439 +#define GL_BINORMAL_ARRAY_EXT 0x843A +#define GL_CURRENT_TANGENT_EXT 0x843B +#define GL_CURRENT_BINORMAL_EXT 0x843C +#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E +#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F +#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 +#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 +#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 +#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 +#define GL_MAP1_TANGENT_EXT 0x8444 +#define GL_MAP2_TANGENT_EXT 0x8445 +#define GL_MAP1_BINORMAL_EXT 0x8446 +#define GL_MAP2_BINORMAL_EXT 0x8447 + +typedef void (GLAPIENTRY * PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer); +typedef void (GLAPIENTRY * PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, void* pointer); + +#define glBinormalPointerEXT GLEW_GET_FUN(__glewBinormalPointerEXT) +#define glTangentPointerEXT GLEW_GET_FUN(__glewTangentPointerEXT) + +#define GLEW_EXT_coordinate_frame GLEW_GET_VAR(__GLEW_EXT_coordinate_frame) + +#endif /* GL_EXT_coordinate_frame */ + +/* -------------------------- GL_EXT_copy_texture -------------------------- */ + +#ifndef GL_EXT_copy_texture +#define GL_EXT_copy_texture 1 + +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glCopyTexImage1DEXT GLEW_GET_FUN(__glewCopyTexImage1DEXT) +#define glCopyTexImage2DEXT GLEW_GET_FUN(__glewCopyTexImage2DEXT) +#define glCopyTexSubImage1DEXT GLEW_GET_FUN(__glewCopyTexSubImage1DEXT) +#define glCopyTexSubImage2DEXT GLEW_GET_FUN(__glewCopyTexSubImage2DEXT) +#define glCopyTexSubImage3DEXT GLEW_GET_FUN(__glewCopyTexSubImage3DEXT) + +#define GLEW_EXT_copy_texture GLEW_GET_VAR(__GLEW_EXT_copy_texture) + +#endif /* GL_EXT_copy_texture */ + +/* --------------------------- GL_EXT_cull_vertex -------------------------- */ + +#ifndef GL_EXT_cull_vertex +#define GL_EXT_cull_vertex 1 + +#define GL_CULL_VERTEX_EXT 0x81AA +#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB +#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC + +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat* params); + +#define glCullParameterdvEXT GLEW_GET_FUN(__glewCullParameterdvEXT) +#define glCullParameterfvEXT GLEW_GET_FUN(__glewCullParameterfvEXT) + +#define GLEW_EXT_cull_vertex GLEW_GET_VAR(__GLEW_EXT_cull_vertex) + +#endif /* GL_EXT_cull_vertex */ + +/* ------------------------ GL_EXT_depth_bounds_test ----------------------- */ + +#ifndef GL_EXT_depth_bounds_test +#define GL_EXT_depth_bounds_test 1 + +#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 +#define GL_DEPTH_BOUNDS_EXT 0x8891 + +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); + +#define glDepthBoundsEXT GLEW_GET_FUN(__glewDepthBoundsEXT) + +#define GLEW_EXT_depth_bounds_test GLEW_GET_VAR(__GLEW_EXT_depth_bounds_test) + +#endif /* GL_EXT_depth_bounds_test */ + +/* ----------------------- GL_EXT_direct_state_access ---------------------- */ + +#ifndef GL_EXT_direct_state_access +#define GL_EXT_direct_state_access 1 + +#define GL_PROGRAM_MATRIX_EXT 0x8E2D +#define GL_TRANSPOSE_PROGRAM_MATRIX_EXT 0x8E2E +#define GL_PROGRAM_MATRIX_STACK_DEPTH_EXT 0x8E2F + +typedef void (GLAPIENTRY * PFNGLBINDMULTITEXTUREEXTPROC) (GLenum texunit, GLenum target, GLuint texture); +typedef GLenum (GLAPIENTRY * PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC) (GLuint framebuffer, GLenum target); +typedef void (GLAPIENTRY * PFNGLCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLDISABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEINDEXEDEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLECLIENTSTATEIEXTPROC) (GLenum array, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYATTRIBEXTPROC) (GLuint vaobj, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEVERTEXARRAYEXTPROC) (GLuint vaobj, GLenum array); +typedef void (GLAPIENTRY * PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC) (GLuint framebuffer, GLsizei n, const GLenum* bufs); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERREADBUFFEREXTPROC) (GLuint framebuffer, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGENERATEMULTITEXMIPMAPEXTPROC) (GLenum texunit, GLenum target); +typedef void (GLAPIENTRY * PFNGLGENERATETEXTUREMIPMAPEXTPROC) (GLuint texture, GLenum target); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, void* img); +typedef void (GLAPIENTRY * PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, void* img); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEINDEXEDVEXTPROC) (GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETDOUBLEI_VEXTPROC) (GLenum pname, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATINDEXEDVEXTPROC) (GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFLOATI_VEXTPROC) (GLenum pname, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXIMAGEEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC) (GLuint buffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPOINTERVEXTPROC) (GLuint buffer, GLenum pname, void** params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, void* data); +typedef void (GLAPIENTRY * PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum pname, void* string); +typedef void (GLAPIENTRY * PFNGLGETNAMEDPROGRAMIVEXTPROC) (GLuint program, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC) (GLuint renderbuffer, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERINDEXEDVEXTPROC) (GLenum target, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETPOINTERI_VEXTPROC) (GLenum pname, GLuint index, GLvoid** params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREIMAGEEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum format, GLenum type, void* pixels); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLint level, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYINTEGERVEXTPROC) (GLuint vaobj, GLenum pname, GLint* param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC) (GLuint vaobj, GLuint index, GLenum pname, GLvoid** param); +typedef void (GLAPIENTRY * PFNGLGETVERTEXARRAYPOINTERVEXTPROC) (GLuint vaobj, GLenum pname, GLvoid** param); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFEREXTPROC) (GLuint buffer, GLenum access); +typedef GLvoid * (GLAPIENTRY * PFNGLMAPNAMEDBUFFERRANGEEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr length, GLbitfield access); +typedef void (GLAPIENTRY * PFNGLMATRIXFRUSTUMEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADIDENTITYEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXLOADFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTTRANSPOSEFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTDEXTPROC) (GLenum matrixMode, const GLdouble* m); +typedef void (GLAPIENTRY * PFNGLMATRIXMULTFEXTPROC) (GLenum matrixMode, const GLfloat* m); +typedef void (GLAPIENTRY * PFNGLMATRIXORTHOEXTPROC) (GLenum matrixMode, GLdouble l, GLdouble r, GLdouble b, GLdouble t, GLdouble n, GLdouble f); +typedef void (GLAPIENTRY * PFNGLMATRIXPOPEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXPUSHEXTPROC) (GLenum matrixMode); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEDEXTPROC) (GLenum matrixMode, GLdouble angle, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXROTATEFEXTPROC) (GLenum matrixMode, GLfloat angle, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXSCALEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEDEXTPROC) (GLenum matrixMode, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLMATRIXTRANSLATEFEXTPROC) (GLenum matrixMode, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLMULTITEXBUFFEREXTPROC) (GLenum texunit, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORDPOINTEREXTPROC) (GLenum texunit, GLint size, GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXENVIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLdouble param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENDVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENFVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXGENIVEXTPROC) (GLenum texunit, GLenum coord, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIUIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERFVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIEXTPROC) (GLenum texunit, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLMULTITEXPARAMETERIVEXTPROC) (GLenum texunit, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLMULTITEXRENDERBUFFEREXTPROC) (GLenum texunit, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE1DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE2DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLMULTITEXSUBIMAGE3DEXTPROC) (GLenum texunit, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERDATAEXTPROC) (GLuint buffer, GLsizeiptr size, const void* data, GLenum usage); +typedef void (GLAPIENTRY * PFNGLNAMEDBUFFERSUBDATAEXTPROC) (GLuint buffer, GLintptr offset, GLsizeiptr size, const void* data); +typedef void (GLAPIENTRY * PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC) (GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC) (GLuint framebuffer, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC) (GLuint framebuffer, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC) (GLuint framebuffer, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC) (GLuint program, GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC) (GLuint program, GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC) (GLuint program, GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC) (GLuint program, GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC) (GLuint program, GLenum target, GLuint index, GLsizei count, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLNAMEDPROGRAMSTRINGEXTPROC) (GLuint program, GLenum target, GLenum format, GLsizei len, const void* string); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC) (GLuint renderbuffer, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC) (GLuint renderbuffer, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLuint renderbuffer, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FEXTPROC) (GLuint program, GLint location, GLfloat v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IEXTPROC) (GLuint program, GLint location, GLint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIEXTPROC) (GLuint program, GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FEXTPROC) (GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4FVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IEXTPROC) (GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4IVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIEXTPROC) (GLuint program, GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UIVEXTPROC) (GLuint program, GLint location, GLsizei count, const GLuint* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC) (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value); +typedef void (GLAPIENTRY * PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC) (GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXTUREBUFFEREXTPROC) (GLuint texture, GLenum target, GLenum internalformat, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIUIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLuint* params); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERFVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLfloat* param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIEXTPROC) (GLuint texture, GLenum target, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLTEXTUREPARAMETERIVEXTPROC) (GLuint texture, GLenum target, GLenum pname, const GLint* param); +typedef void (GLAPIENTRY * PFNGLTEXTURERENDERBUFFEREXTPROC) (GLuint texture, GLenum target, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE1DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE2DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXTURESUBIMAGE3DEXTPROC) (GLuint texture, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); +typedef GLboolean (GLAPIENTRY * PFNGLUNMAPNAMEDBUFFEREXTPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYINDEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum texunit, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYNORMALOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLint size, GLenum type, GLsizei stride, GLintptr offset); + +#define glBindMultiTextureEXT GLEW_GET_FUN(__glewBindMultiTextureEXT) +#define glCheckNamedFramebufferStatusEXT GLEW_GET_FUN(__glewCheckNamedFramebufferStatusEXT) +#define glClientAttribDefaultEXT GLEW_GET_FUN(__glewClientAttribDefaultEXT) +#define glCompressedMultiTexImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage1DEXT) +#define glCompressedMultiTexImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage2DEXT) +#define glCompressedMultiTexImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexImage3DEXT) +#define glCompressedMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage1DEXT) +#define glCompressedMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage2DEXT) +#define glCompressedMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCompressedMultiTexSubImage3DEXT) +#define glCompressedTextureImage1DEXT GLEW_GET_FUN(__glewCompressedTextureImage1DEXT) +#define glCompressedTextureImage2DEXT GLEW_GET_FUN(__glewCompressedTextureImage2DEXT) +#define glCompressedTextureImage3DEXT GLEW_GET_FUN(__glewCompressedTextureImage3DEXT) +#define glCompressedTextureSubImage1DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage1DEXT) +#define glCompressedTextureSubImage2DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage2DEXT) +#define glCompressedTextureSubImage3DEXT GLEW_GET_FUN(__glewCompressedTextureSubImage3DEXT) +#define glCopyMultiTexImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexImage1DEXT) +#define glCopyMultiTexImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexImage2DEXT) +#define glCopyMultiTexSubImage1DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage1DEXT) +#define glCopyMultiTexSubImage2DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage2DEXT) +#define glCopyMultiTexSubImage3DEXT GLEW_GET_FUN(__glewCopyMultiTexSubImage3DEXT) +#define glCopyTextureImage1DEXT GLEW_GET_FUN(__glewCopyTextureImage1DEXT) +#define glCopyTextureImage2DEXT GLEW_GET_FUN(__glewCopyTextureImage2DEXT) +#define glCopyTextureSubImage1DEXT GLEW_GET_FUN(__glewCopyTextureSubImage1DEXT) +#define glCopyTextureSubImage2DEXT GLEW_GET_FUN(__glewCopyTextureSubImage2DEXT) +#define glCopyTextureSubImage3DEXT GLEW_GET_FUN(__glewCopyTextureSubImage3DEXT) +#define glDisableClientStateIndexedEXT GLEW_GET_FUN(__glewDisableClientStateIndexedEXT) +#define glDisableClientStateiEXT GLEW_GET_FUN(__glewDisableClientStateiEXT) +#define glDisableVertexArrayAttribEXT GLEW_GET_FUN(__glewDisableVertexArrayAttribEXT) +#define glDisableVertexArrayEXT GLEW_GET_FUN(__glewDisableVertexArrayEXT) +#define glEnableClientStateIndexedEXT GLEW_GET_FUN(__glewEnableClientStateIndexedEXT) +#define glEnableClientStateiEXT GLEW_GET_FUN(__glewEnableClientStateiEXT) +#define glEnableVertexArrayAttribEXT GLEW_GET_FUN(__glewEnableVertexArrayAttribEXT) +#define glEnableVertexArrayEXT GLEW_GET_FUN(__glewEnableVertexArrayEXT) +#define glFlushMappedNamedBufferRangeEXT GLEW_GET_FUN(__glewFlushMappedNamedBufferRangeEXT) +#define glFramebufferDrawBufferEXT GLEW_GET_FUN(__glewFramebufferDrawBufferEXT) +#define glFramebufferDrawBuffersEXT GLEW_GET_FUN(__glewFramebufferDrawBuffersEXT) +#define glFramebufferReadBufferEXT GLEW_GET_FUN(__glewFramebufferReadBufferEXT) +#define glGenerateMultiTexMipmapEXT GLEW_GET_FUN(__glewGenerateMultiTexMipmapEXT) +#define glGenerateTextureMipmapEXT GLEW_GET_FUN(__glewGenerateTextureMipmapEXT) +#define glGetCompressedMultiTexImageEXT GLEW_GET_FUN(__glewGetCompressedMultiTexImageEXT) +#define glGetCompressedTextureImageEXT GLEW_GET_FUN(__glewGetCompressedTextureImageEXT) +#define glGetDoubleIndexedvEXT GLEW_GET_FUN(__glewGetDoubleIndexedvEXT) +#define glGetDoublei_vEXT GLEW_GET_FUN(__glewGetDoublei_vEXT) +#define glGetFloatIndexedvEXT GLEW_GET_FUN(__glewGetFloatIndexedvEXT) +#define glGetFloati_vEXT GLEW_GET_FUN(__glewGetFloati_vEXT) +#define glGetFramebufferParameterivEXT GLEW_GET_FUN(__glewGetFramebufferParameterivEXT) +#define glGetMultiTexEnvfvEXT GLEW_GET_FUN(__glewGetMultiTexEnvfvEXT) +#define glGetMultiTexEnvivEXT GLEW_GET_FUN(__glewGetMultiTexEnvivEXT) +#define glGetMultiTexGendvEXT GLEW_GET_FUN(__glewGetMultiTexGendvEXT) +#define glGetMultiTexGenfvEXT GLEW_GET_FUN(__glewGetMultiTexGenfvEXT) +#define glGetMultiTexGenivEXT GLEW_GET_FUN(__glewGetMultiTexGenivEXT) +#define glGetMultiTexImageEXT GLEW_GET_FUN(__glewGetMultiTexImageEXT) +#define glGetMultiTexLevelParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterfvEXT) +#define glGetMultiTexLevelParameterivEXT GLEW_GET_FUN(__glewGetMultiTexLevelParameterivEXT) +#define glGetMultiTexParameterIivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIivEXT) +#define glGetMultiTexParameterIuivEXT GLEW_GET_FUN(__glewGetMultiTexParameterIuivEXT) +#define glGetMultiTexParameterfvEXT GLEW_GET_FUN(__glewGetMultiTexParameterfvEXT) +#define glGetMultiTexParameterivEXT GLEW_GET_FUN(__glewGetMultiTexParameterivEXT) +#define glGetNamedBufferParameterivEXT GLEW_GET_FUN(__glewGetNamedBufferParameterivEXT) +#define glGetNamedBufferPointervEXT GLEW_GET_FUN(__glewGetNamedBufferPointervEXT) +#define glGetNamedBufferSubDataEXT GLEW_GET_FUN(__glewGetNamedBufferSubDataEXT) +#define glGetNamedFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetNamedFramebufferAttachmentParameterivEXT) +#define glGetNamedProgramLocalParameterIivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIivEXT) +#define glGetNamedProgramLocalParameterIuivEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterIuivEXT) +#define glGetNamedProgramLocalParameterdvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterdvEXT) +#define glGetNamedProgramLocalParameterfvEXT GLEW_GET_FUN(__glewGetNamedProgramLocalParameterfvEXT) +#define glGetNamedProgramStringEXT GLEW_GET_FUN(__glewGetNamedProgramStringEXT) +#define glGetNamedProgramivEXT GLEW_GET_FUN(__glewGetNamedProgramivEXT) +#define glGetNamedRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetNamedRenderbufferParameterivEXT) +#define glGetPointerIndexedvEXT GLEW_GET_FUN(__glewGetPointerIndexedvEXT) +#define glGetPointeri_vEXT GLEW_GET_FUN(__glewGetPointeri_vEXT) +#define glGetTextureImageEXT GLEW_GET_FUN(__glewGetTextureImageEXT) +#define glGetTextureLevelParameterfvEXT GLEW_GET_FUN(__glewGetTextureLevelParameterfvEXT) +#define glGetTextureLevelParameterivEXT GLEW_GET_FUN(__glewGetTextureLevelParameterivEXT) +#define glGetTextureParameterIivEXT GLEW_GET_FUN(__glewGetTextureParameterIivEXT) +#define glGetTextureParameterIuivEXT GLEW_GET_FUN(__glewGetTextureParameterIuivEXT) +#define glGetTextureParameterfvEXT GLEW_GET_FUN(__glewGetTextureParameterfvEXT) +#define glGetTextureParameterivEXT GLEW_GET_FUN(__glewGetTextureParameterivEXT) +#define glGetVertexArrayIntegeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayIntegeri_vEXT) +#define glGetVertexArrayIntegervEXT GLEW_GET_FUN(__glewGetVertexArrayIntegervEXT) +#define glGetVertexArrayPointeri_vEXT GLEW_GET_FUN(__glewGetVertexArrayPointeri_vEXT) +#define glGetVertexArrayPointervEXT GLEW_GET_FUN(__glewGetVertexArrayPointervEXT) +#define glMapNamedBufferEXT GLEW_GET_FUN(__glewMapNamedBufferEXT) +#define glMapNamedBufferRangeEXT GLEW_GET_FUN(__glewMapNamedBufferRangeEXT) +#define glMatrixFrustumEXT GLEW_GET_FUN(__glewMatrixFrustumEXT) +#define glMatrixLoadIdentityEXT GLEW_GET_FUN(__glewMatrixLoadIdentityEXT) +#define glMatrixLoadTransposedEXT GLEW_GET_FUN(__glewMatrixLoadTransposedEXT) +#define glMatrixLoadTransposefEXT GLEW_GET_FUN(__glewMatrixLoadTransposefEXT) +#define glMatrixLoaddEXT GLEW_GET_FUN(__glewMatrixLoaddEXT) +#define glMatrixLoadfEXT GLEW_GET_FUN(__glewMatrixLoadfEXT) +#define glMatrixMultTransposedEXT GLEW_GET_FUN(__glewMatrixMultTransposedEXT) +#define glMatrixMultTransposefEXT GLEW_GET_FUN(__glewMatrixMultTransposefEXT) +#define glMatrixMultdEXT GLEW_GET_FUN(__glewMatrixMultdEXT) +#define glMatrixMultfEXT GLEW_GET_FUN(__glewMatrixMultfEXT) +#define glMatrixOrthoEXT GLEW_GET_FUN(__glewMatrixOrthoEXT) +#define glMatrixPopEXT GLEW_GET_FUN(__glewMatrixPopEXT) +#define glMatrixPushEXT GLEW_GET_FUN(__glewMatrixPushEXT) +#define glMatrixRotatedEXT GLEW_GET_FUN(__glewMatrixRotatedEXT) +#define glMatrixRotatefEXT GLEW_GET_FUN(__glewMatrixRotatefEXT) +#define glMatrixScaledEXT GLEW_GET_FUN(__glewMatrixScaledEXT) +#define glMatrixScalefEXT GLEW_GET_FUN(__glewMatrixScalefEXT) +#define glMatrixTranslatedEXT GLEW_GET_FUN(__glewMatrixTranslatedEXT) +#define glMatrixTranslatefEXT GLEW_GET_FUN(__glewMatrixTranslatefEXT) +#define glMultiTexBufferEXT GLEW_GET_FUN(__glewMultiTexBufferEXT) +#define glMultiTexCoordPointerEXT GLEW_GET_FUN(__glewMultiTexCoordPointerEXT) +#define glMultiTexEnvfEXT GLEW_GET_FUN(__glewMultiTexEnvfEXT) +#define glMultiTexEnvfvEXT GLEW_GET_FUN(__glewMultiTexEnvfvEXT) +#define glMultiTexEnviEXT GLEW_GET_FUN(__glewMultiTexEnviEXT) +#define glMultiTexEnvivEXT GLEW_GET_FUN(__glewMultiTexEnvivEXT) +#define glMultiTexGendEXT GLEW_GET_FUN(__glewMultiTexGendEXT) +#define glMultiTexGendvEXT GLEW_GET_FUN(__glewMultiTexGendvEXT) +#define glMultiTexGenfEXT GLEW_GET_FUN(__glewMultiTexGenfEXT) +#define glMultiTexGenfvEXT GLEW_GET_FUN(__glewMultiTexGenfvEXT) +#define glMultiTexGeniEXT GLEW_GET_FUN(__glewMultiTexGeniEXT) +#define glMultiTexGenivEXT GLEW_GET_FUN(__glewMultiTexGenivEXT) +#define glMultiTexImage1DEXT GLEW_GET_FUN(__glewMultiTexImage1DEXT) +#define glMultiTexImage2DEXT GLEW_GET_FUN(__glewMultiTexImage2DEXT) +#define glMultiTexImage3DEXT GLEW_GET_FUN(__glewMultiTexImage3DEXT) +#define glMultiTexParameterIivEXT GLEW_GET_FUN(__glewMultiTexParameterIivEXT) +#define glMultiTexParameterIuivEXT GLEW_GET_FUN(__glewMultiTexParameterIuivEXT) +#define glMultiTexParameterfEXT GLEW_GET_FUN(__glewMultiTexParameterfEXT) +#define glMultiTexParameterfvEXT GLEW_GET_FUN(__glewMultiTexParameterfvEXT) +#define glMultiTexParameteriEXT GLEW_GET_FUN(__glewMultiTexParameteriEXT) +#define glMultiTexParameterivEXT GLEW_GET_FUN(__glewMultiTexParameterivEXT) +#define glMultiTexRenderbufferEXT GLEW_GET_FUN(__glewMultiTexRenderbufferEXT) +#define glMultiTexSubImage1DEXT GLEW_GET_FUN(__glewMultiTexSubImage1DEXT) +#define glMultiTexSubImage2DEXT GLEW_GET_FUN(__glewMultiTexSubImage2DEXT) +#define glMultiTexSubImage3DEXT GLEW_GET_FUN(__glewMultiTexSubImage3DEXT) +#define glNamedBufferDataEXT GLEW_GET_FUN(__glewNamedBufferDataEXT) +#define glNamedBufferSubDataEXT GLEW_GET_FUN(__glewNamedBufferSubDataEXT) +#define glNamedCopyBufferSubDataEXT GLEW_GET_FUN(__glewNamedCopyBufferSubDataEXT) +#define glNamedFramebufferRenderbufferEXT GLEW_GET_FUN(__glewNamedFramebufferRenderbufferEXT) +#define glNamedFramebufferTexture1DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture1DEXT) +#define glNamedFramebufferTexture2DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture2DEXT) +#define glNamedFramebufferTexture3DEXT GLEW_GET_FUN(__glewNamedFramebufferTexture3DEXT) +#define glNamedFramebufferTextureEXT GLEW_GET_FUN(__glewNamedFramebufferTextureEXT) +#define glNamedFramebufferTextureFaceEXT GLEW_GET_FUN(__glewNamedFramebufferTextureFaceEXT) +#define glNamedFramebufferTextureLayerEXT GLEW_GET_FUN(__glewNamedFramebufferTextureLayerEXT) +#define glNamedProgramLocalParameter4dEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dEXT) +#define glNamedProgramLocalParameter4dvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4dvEXT) +#define glNamedProgramLocalParameter4fEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fEXT) +#define glNamedProgramLocalParameter4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameter4fvEXT) +#define glNamedProgramLocalParameterI4iEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4iEXT) +#define glNamedProgramLocalParameterI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4ivEXT) +#define glNamedProgramLocalParameterI4uiEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uiEXT) +#define glNamedProgramLocalParameterI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParameterI4uivEXT) +#define glNamedProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewNamedProgramLocalParameters4fvEXT) +#define glNamedProgramLocalParametersI4ivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4ivEXT) +#define glNamedProgramLocalParametersI4uivEXT GLEW_GET_FUN(__glewNamedProgramLocalParametersI4uivEXT) +#define glNamedProgramStringEXT GLEW_GET_FUN(__glewNamedProgramStringEXT) +#define glNamedRenderbufferStorageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageEXT) +#define glNamedRenderbufferStorageMultisampleCoverageEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleCoverageEXT) +#define glNamedRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewNamedRenderbufferStorageMultisampleEXT) +#define glProgramUniform1fEXT GLEW_GET_FUN(__glewProgramUniform1fEXT) +#define glProgramUniform1fvEXT GLEW_GET_FUN(__glewProgramUniform1fvEXT) +#define glProgramUniform1iEXT GLEW_GET_FUN(__glewProgramUniform1iEXT) +#define glProgramUniform1ivEXT GLEW_GET_FUN(__glewProgramUniform1ivEXT) +#define glProgramUniform1uiEXT GLEW_GET_FUN(__glewProgramUniform1uiEXT) +#define glProgramUniform1uivEXT GLEW_GET_FUN(__glewProgramUniform1uivEXT) +#define glProgramUniform2fEXT GLEW_GET_FUN(__glewProgramUniform2fEXT) +#define glProgramUniform2fvEXT GLEW_GET_FUN(__glewProgramUniform2fvEXT) +#define glProgramUniform2iEXT GLEW_GET_FUN(__glewProgramUniform2iEXT) +#define glProgramUniform2ivEXT GLEW_GET_FUN(__glewProgramUniform2ivEXT) +#define glProgramUniform2uiEXT GLEW_GET_FUN(__glewProgramUniform2uiEXT) +#define glProgramUniform2uivEXT GLEW_GET_FUN(__glewProgramUniform2uivEXT) +#define glProgramUniform3fEXT GLEW_GET_FUN(__glewProgramUniform3fEXT) +#define glProgramUniform3fvEXT GLEW_GET_FUN(__glewProgramUniform3fvEXT) +#define glProgramUniform3iEXT GLEW_GET_FUN(__glewProgramUniform3iEXT) +#define glProgramUniform3ivEXT GLEW_GET_FUN(__glewProgramUniform3ivEXT) +#define glProgramUniform3uiEXT GLEW_GET_FUN(__glewProgramUniform3uiEXT) +#define glProgramUniform3uivEXT GLEW_GET_FUN(__glewProgramUniform3uivEXT) +#define glProgramUniform4fEXT GLEW_GET_FUN(__glewProgramUniform4fEXT) +#define glProgramUniform4fvEXT GLEW_GET_FUN(__glewProgramUniform4fvEXT) +#define glProgramUniform4iEXT GLEW_GET_FUN(__glewProgramUniform4iEXT) +#define glProgramUniform4ivEXT GLEW_GET_FUN(__glewProgramUniform4ivEXT) +#define glProgramUniform4uiEXT GLEW_GET_FUN(__glewProgramUniform4uiEXT) +#define glProgramUniform4uivEXT GLEW_GET_FUN(__glewProgramUniform4uivEXT) +#define glProgramUniformMatrix2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2fvEXT) +#define glProgramUniformMatrix2x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x3fvEXT) +#define glProgramUniformMatrix2x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix2x4fvEXT) +#define glProgramUniformMatrix3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3fvEXT) +#define glProgramUniformMatrix3x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x2fvEXT) +#define glProgramUniformMatrix3x4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix3x4fvEXT) +#define glProgramUniformMatrix4fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4fvEXT) +#define glProgramUniformMatrix4x2fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x2fvEXT) +#define glProgramUniformMatrix4x3fvEXT GLEW_GET_FUN(__glewProgramUniformMatrix4x3fvEXT) +#define glPushClientAttribDefaultEXT GLEW_GET_FUN(__glewPushClientAttribDefaultEXT) +#define glTextureBufferEXT GLEW_GET_FUN(__glewTextureBufferEXT) +#define glTextureImage1DEXT GLEW_GET_FUN(__glewTextureImage1DEXT) +#define glTextureImage2DEXT GLEW_GET_FUN(__glewTextureImage2DEXT) +#define glTextureImage3DEXT GLEW_GET_FUN(__glewTextureImage3DEXT) +#define glTextureParameterIivEXT GLEW_GET_FUN(__glewTextureParameterIivEXT) +#define glTextureParameterIuivEXT GLEW_GET_FUN(__glewTextureParameterIuivEXT) +#define glTextureParameterfEXT GLEW_GET_FUN(__glewTextureParameterfEXT) +#define glTextureParameterfvEXT GLEW_GET_FUN(__glewTextureParameterfvEXT) +#define glTextureParameteriEXT GLEW_GET_FUN(__glewTextureParameteriEXT) +#define glTextureParameterivEXT GLEW_GET_FUN(__glewTextureParameterivEXT) +#define glTextureRenderbufferEXT GLEW_GET_FUN(__glewTextureRenderbufferEXT) +#define glTextureSubImage1DEXT GLEW_GET_FUN(__glewTextureSubImage1DEXT) +#define glTextureSubImage2DEXT GLEW_GET_FUN(__glewTextureSubImage2DEXT) +#define glTextureSubImage3DEXT GLEW_GET_FUN(__glewTextureSubImage3DEXT) +#define glUnmapNamedBufferEXT GLEW_GET_FUN(__glewUnmapNamedBufferEXT) +#define glVertexArrayColorOffsetEXT GLEW_GET_FUN(__glewVertexArrayColorOffsetEXT) +#define glVertexArrayEdgeFlagOffsetEXT GLEW_GET_FUN(__glewVertexArrayEdgeFlagOffsetEXT) +#define glVertexArrayFogCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayFogCoordOffsetEXT) +#define glVertexArrayIndexOffsetEXT GLEW_GET_FUN(__glewVertexArrayIndexOffsetEXT) +#define glVertexArrayMultiTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayMultiTexCoordOffsetEXT) +#define glVertexArrayNormalOffsetEXT GLEW_GET_FUN(__glewVertexArrayNormalOffsetEXT) +#define glVertexArraySecondaryColorOffsetEXT GLEW_GET_FUN(__glewVertexArraySecondaryColorOffsetEXT) +#define glVertexArrayTexCoordOffsetEXT GLEW_GET_FUN(__glewVertexArrayTexCoordOffsetEXT) +#define glVertexArrayVertexAttribIOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribIOffsetEXT) +#define glVertexArrayVertexAttribOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribOffsetEXT) +#define glVertexArrayVertexOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexOffsetEXT) + +#define GLEW_EXT_direct_state_access GLEW_GET_VAR(__GLEW_EXT_direct_state_access) + +#endif /* GL_EXT_direct_state_access */ + +/* -------------------------- GL_EXT_draw_buffers2 ------------------------- */ + +#ifndef GL_EXT_draw_buffers2 +#define GL_EXT_draw_buffers2 1 + +typedef void (GLAPIENTRY * PFNGLCOLORMASKINDEXEDEXTPROC) (GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); +typedef void (GLAPIENTRY * PFNGLDISABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLENABLEINDEXEDEXTPROC) (GLenum target, GLuint index); +typedef void (GLAPIENTRY * PFNGLGETBOOLEANINDEXEDVEXTPROC) (GLenum value, GLuint index, GLboolean* data); +typedef void (GLAPIENTRY * PFNGLGETINTEGERINDEXEDVEXTPROC) (GLenum value, GLuint index, GLint* data); +typedef GLboolean (GLAPIENTRY * PFNGLISENABLEDINDEXEDEXTPROC) (GLenum target, GLuint index); + +#define glColorMaskIndexedEXT GLEW_GET_FUN(__glewColorMaskIndexedEXT) +#define glDisableIndexedEXT GLEW_GET_FUN(__glewDisableIndexedEXT) +#define glEnableIndexedEXT GLEW_GET_FUN(__glewEnableIndexedEXT) +#define glGetBooleanIndexedvEXT GLEW_GET_FUN(__glewGetBooleanIndexedvEXT) +#define glGetIntegerIndexedvEXT GLEW_GET_FUN(__glewGetIntegerIndexedvEXT) +#define glIsEnabledIndexedEXT GLEW_GET_FUN(__glewIsEnabledIndexedEXT) + +#define GLEW_EXT_draw_buffers2 GLEW_GET_VAR(__GLEW_EXT_draw_buffers2) + +#endif /* GL_EXT_draw_buffers2 */ + +/* ------------------------- GL_EXT_draw_instanced ------------------------- */ + +#ifndef GL_EXT_draw_instanced +#define GL_EXT_draw_instanced 1 + +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSINSTANCEDEXTPROC) (GLenum mode, GLint start, GLsizei count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLDRAWELEMENTSINSTANCEDEXTPROC) (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); + +#define glDrawArraysInstancedEXT GLEW_GET_FUN(__glewDrawArraysInstancedEXT) +#define glDrawElementsInstancedEXT GLEW_GET_FUN(__glewDrawElementsInstancedEXT) + +#define GLEW_EXT_draw_instanced GLEW_GET_VAR(__GLEW_EXT_draw_instanced) + +#endif /* GL_EXT_draw_instanced */ + +/* ----------------------- GL_EXT_draw_range_elements ---------------------- */ + +#ifndef GL_EXT_draw_range_elements +#define GL_EXT_draw_range_elements 1 + +#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 +#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 + +typedef void (GLAPIENTRY * PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); + +#define glDrawRangeElementsEXT GLEW_GET_FUN(__glewDrawRangeElementsEXT) + +#define GLEW_EXT_draw_range_elements GLEW_GET_VAR(__GLEW_EXT_draw_range_elements) + +#endif /* GL_EXT_draw_range_elements */ + +/* ---------------------------- GL_EXT_fog_coord --------------------------- */ + +#ifndef GL_EXT_fog_coord +#define GL_EXT_fog_coord 1 + +#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 +#define GL_FOG_COORDINATE_EXT 0x8451 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 +#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 +#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 +#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 +#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 +#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 + +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDEXTPROC) (GLdouble coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFEXTPROC) (GLfloat coord); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); + +#define glFogCoordPointerEXT GLEW_GET_FUN(__glewFogCoordPointerEXT) +#define glFogCoorddEXT GLEW_GET_FUN(__glewFogCoorddEXT) +#define glFogCoorddvEXT GLEW_GET_FUN(__glewFogCoorddvEXT) +#define glFogCoordfEXT GLEW_GET_FUN(__glewFogCoordfEXT) +#define glFogCoordfvEXT GLEW_GET_FUN(__glewFogCoordfvEXT) + +#define GLEW_EXT_fog_coord GLEW_GET_VAR(__GLEW_EXT_fog_coord) + +#endif /* GL_EXT_fog_coord */ + +/* ------------------------ GL_EXT_fragment_lighting ----------------------- */ + +#ifndef GL_EXT_fragment_lighting +#define GL_EXT_fragment_lighting 1 + +#define GL_FRAGMENT_LIGHTING_EXT 0x8400 +#define GL_FRAGMENT_COLOR_MATERIAL_EXT 0x8401 +#define GL_FRAGMENT_COLOR_MATERIAL_FACE_EXT 0x8402 +#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_EXT 0x8403 +#define GL_MAX_FRAGMENT_LIGHTS_EXT 0x8404 +#define GL_MAX_ACTIVE_LIGHTS_EXT 0x8405 +#define GL_CURRENT_RASTER_NORMAL_EXT 0x8406 +#define GL_LIGHT_ENV_MODE_EXT 0x8407 +#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_EXT 0x8408 +#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_EXT 0x8409 +#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_EXT 0x840A +#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_EXT 0x840B +#define GL_FRAGMENT_LIGHT0_EXT 0x840C +#define GL_FRAGMENT_LIGHT7_EXT 0x8413 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALEXTPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVEXTPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIEXTPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVEXTPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFEXTPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIEXTPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFEXTPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIEXTPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVEXTPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVEXTPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVEXTPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVEXTPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLLIGHTENVIEXTPROC) (GLenum pname, GLint param); + +#define glFragmentColorMaterialEXT GLEW_GET_FUN(__glewFragmentColorMaterialEXT) +#define glFragmentLightModelfEXT GLEW_GET_FUN(__glewFragmentLightModelfEXT) +#define glFragmentLightModelfvEXT GLEW_GET_FUN(__glewFragmentLightModelfvEXT) +#define glFragmentLightModeliEXT GLEW_GET_FUN(__glewFragmentLightModeliEXT) +#define glFragmentLightModelivEXT GLEW_GET_FUN(__glewFragmentLightModelivEXT) +#define glFragmentLightfEXT GLEW_GET_FUN(__glewFragmentLightfEXT) +#define glFragmentLightfvEXT GLEW_GET_FUN(__glewFragmentLightfvEXT) +#define glFragmentLightiEXT GLEW_GET_FUN(__glewFragmentLightiEXT) +#define glFragmentLightivEXT GLEW_GET_FUN(__glewFragmentLightivEXT) +#define glFragmentMaterialfEXT GLEW_GET_FUN(__glewFragmentMaterialfEXT) +#define glFragmentMaterialfvEXT GLEW_GET_FUN(__glewFragmentMaterialfvEXT) +#define glFragmentMaterialiEXT GLEW_GET_FUN(__glewFragmentMaterialiEXT) +#define glFragmentMaterialivEXT GLEW_GET_FUN(__glewFragmentMaterialivEXT) +#define glGetFragmentLightfvEXT GLEW_GET_FUN(__glewGetFragmentLightfvEXT) +#define glGetFragmentLightivEXT GLEW_GET_FUN(__glewGetFragmentLightivEXT) +#define glGetFragmentMaterialfvEXT GLEW_GET_FUN(__glewGetFragmentMaterialfvEXT) +#define glGetFragmentMaterialivEXT GLEW_GET_FUN(__glewGetFragmentMaterialivEXT) +#define glLightEnviEXT GLEW_GET_FUN(__glewLightEnviEXT) + +#define GLEW_EXT_fragment_lighting GLEW_GET_VAR(__GLEW_EXT_fragment_lighting) + +#endif /* GL_EXT_fragment_lighting */ + +/* ------------------------ GL_EXT_framebuffer_blit ------------------------ */ + +#ifndef GL_EXT_framebuffer_blit +#define GL_EXT_framebuffer_blit 1 + +#define GL_DRAW_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_READ_FRAMEBUFFER_EXT 0x8CA8 +#define GL_DRAW_FRAMEBUFFER_EXT 0x8CA9 +#define GL_READ_FRAMEBUFFER_BINDING_EXT 0x8CAA + +typedef void (GLAPIENTRY * PFNGLBLITFRAMEBUFFEREXTPROC) (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); + +#define glBlitFramebufferEXT GLEW_GET_FUN(__glewBlitFramebufferEXT) + +#define GLEW_EXT_framebuffer_blit GLEW_GET_VAR(__GLEW_EXT_framebuffer_blit) + +#endif /* GL_EXT_framebuffer_blit */ + +/* --------------------- GL_EXT_framebuffer_multisample -------------------- */ + +#ifndef GL_EXT_framebuffer_multisample +#define GL_EXT_framebuffer_multisample 1 + +#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB +#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56 +#define GL_MAX_SAMPLES_EXT 0x8D57 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleEXT GLEW_GET_FUN(__glewRenderbufferStorageMultisampleEXT) + +#define GLEW_EXT_framebuffer_multisample GLEW_GET_VAR(__GLEW_EXT_framebuffer_multisample) + +#endif /* GL_EXT_framebuffer_multisample */ + +/* ----------------------- GL_EXT_framebuffer_object ----------------------- */ + +#ifndef GL_EXT_framebuffer_object +#define GL_EXT_framebuffer_object 1 + +#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 +#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 +#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 +#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 +#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 +#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 +#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 +#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 +#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 +#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA +#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB +#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC +#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD +#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF +#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 +#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 +#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 +#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 +#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 +#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 +#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 +#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 +#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 +#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 +#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA +#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB +#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC +#define GL_COLOR_ATTACHMENT13_EXT 0x8CED +#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE +#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF +#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 +#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 +#define GL_FRAMEBUFFER_EXT 0x8D40 +#define GL_RENDERBUFFER_EXT 0x8D41 +#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 +#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 +#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 +#define GL_STENCIL_INDEX1_EXT 0x8D46 +#define GL_STENCIL_INDEX4_EXT 0x8D47 +#define GL_STENCIL_INDEX8_EXT 0x8D48 +#define GL_STENCIL_INDEX16_EXT 0x8D49 +#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 +#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 +#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 +#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 +#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 +#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 + +typedef void (GLAPIENTRY * PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); +typedef void (GLAPIENTRY * PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); +typedef GLenum (GLAPIENTRY * PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); +typedef void (GLAPIENTRY * PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint* framebuffers); +typedef void (GLAPIENTRY * PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint* renderbuffers); +typedef void (GLAPIENTRY * PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); +typedef GLboolean (GLAPIENTRY * PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); + +#define glBindFramebufferEXT GLEW_GET_FUN(__glewBindFramebufferEXT) +#define glBindRenderbufferEXT GLEW_GET_FUN(__glewBindRenderbufferEXT) +#define glCheckFramebufferStatusEXT GLEW_GET_FUN(__glewCheckFramebufferStatusEXT) +#define glDeleteFramebuffersEXT GLEW_GET_FUN(__glewDeleteFramebuffersEXT) +#define glDeleteRenderbuffersEXT GLEW_GET_FUN(__glewDeleteRenderbuffersEXT) +#define glFramebufferRenderbufferEXT GLEW_GET_FUN(__glewFramebufferRenderbufferEXT) +#define glFramebufferTexture1DEXT GLEW_GET_FUN(__glewFramebufferTexture1DEXT) +#define glFramebufferTexture2DEXT GLEW_GET_FUN(__glewFramebufferTexture2DEXT) +#define glFramebufferTexture3DEXT GLEW_GET_FUN(__glewFramebufferTexture3DEXT) +#define glGenFramebuffersEXT GLEW_GET_FUN(__glewGenFramebuffersEXT) +#define glGenRenderbuffersEXT GLEW_GET_FUN(__glewGenRenderbuffersEXT) +#define glGenerateMipmapEXT GLEW_GET_FUN(__glewGenerateMipmapEXT) +#define glGetFramebufferAttachmentParameterivEXT GLEW_GET_FUN(__glewGetFramebufferAttachmentParameterivEXT) +#define glGetRenderbufferParameterivEXT GLEW_GET_FUN(__glewGetRenderbufferParameterivEXT) +#define glIsFramebufferEXT GLEW_GET_FUN(__glewIsFramebufferEXT) +#define glIsRenderbufferEXT GLEW_GET_FUN(__glewIsRenderbufferEXT) +#define glRenderbufferStorageEXT GLEW_GET_FUN(__glewRenderbufferStorageEXT) + +#define GLEW_EXT_framebuffer_object GLEW_GET_VAR(__GLEW_EXT_framebuffer_object) + +#endif /* GL_EXT_framebuffer_object */ + +/* ------------------------ GL_EXT_framebuffer_sRGB ------------------------ */ + +#ifndef GL_EXT_framebuffer_sRGB +#define GL_EXT_framebuffer_sRGB 1 + +#define GL_FRAMEBUFFER_SRGB_EXT 0x8DB9 +#define GL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x8DBA + +#define GLEW_EXT_framebuffer_sRGB GLEW_GET_VAR(__GLEW_EXT_framebuffer_sRGB) + +#endif /* GL_EXT_framebuffer_sRGB */ + +/* ------------------------ GL_EXT_geometry_shader4 ------------------------ */ + +#ifndef GL_EXT_geometry_shader4 +#define GL_EXT_geometry_shader4 1 + +#define GL_LINES_ADJACENCY_EXT 0xA +#define GL_LINE_STRIP_ADJACENCY_EXT 0xB +#define GL_TRIANGLES_ADJACENCY_EXT 0xC +#define GL_TRIANGLE_STRIP_ADJACENCY_EXT 0xD +#define GL_PROGRAM_POINT_SIZE_EXT 0x8642 +#define GL_MAX_VARYING_COMPONENTS_EXT 0x8B4B +#define GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT 0x8C29 +#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT 0x8CD4 +#define GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT 0x8DA7 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT 0x8DA8 +#define GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT 0x8DA9 +#define GL_GEOMETRY_SHADER_EXT 0x8DD9 +#define GL_GEOMETRY_VERTICES_OUT_EXT 0x8DDA +#define GL_GEOMETRY_INPUT_TYPE_EXT 0x8DDB +#define GL_GEOMETRY_OUTPUT_TYPE_EXT 0x8DDC +#define GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT 0x8DDD +#define GL_MAX_VERTEX_VARYING_COMPONENTS_EXT 0x8DDE +#define GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT 0x8DDF +#define GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT 0x8DE0 +#define GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT 0x8DE1 + +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLenum face); +typedef void (GLAPIENTRY * PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC) (GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERIEXTPROC) (GLuint program, GLenum pname, GLint value); + +#define glFramebufferTextureEXT GLEW_GET_FUN(__glewFramebufferTextureEXT) +#define glFramebufferTextureFaceEXT GLEW_GET_FUN(__glewFramebufferTextureFaceEXT) +#define glFramebufferTextureLayerEXT GLEW_GET_FUN(__glewFramebufferTextureLayerEXT) +#define glProgramParameteriEXT GLEW_GET_FUN(__glewProgramParameteriEXT) + +#define GLEW_EXT_geometry_shader4 GLEW_GET_VAR(__GLEW_EXT_geometry_shader4) + +#endif /* GL_EXT_geometry_shader4 */ + +/* --------------------- GL_EXT_gpu_program_parameters --------------------- */ + +#ifndef GL_EXT_gpu_program_parameters +#define GL_EXT_gpu_program_parameters 1 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) (GLenum target, GLuint index, GLsizei count, const GLfloat* params); + +#define glProgramEnvParameters4fvEXT GLEW_GET_FUN(__glewProgramEnvParameters4fvEXT) +#define glProgramLocalParameters4fvEXT GLEW_GET_FUN(__glewProgramLocalParameters4fvEXT) + +#define GLEW_EXT_gpu_program_parameters GLEW_GET_VAR(__GLEW_EXT_gpu_program_parameters) + +#endif /* GL_EXT_gpu_program_parameters */ + +/* --------------------------- GL_EXT_gpu_shader4 -------------------------- */ + +#ifndef GL_EXT_gpu_shader4 +#define GL_EXT_gpu_shader4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT 0x88FD +#define GL_SAMPLER_1D_ARRAY_EXT 0x8DC0 +#define GL_SAMPLER_2D_ARRAY_EXT 0x8DC1 +#define GL_SAMPLER_BUFFER_EXT 0x8DC2 +#define GL_SAMPLER_1D_ARRAY_SHADOW_EXT 0x8DC3 +#define GL_SAMPLER_2D_ARRAY_SHADOW_EXT 0x8DC4 +#define GL_SAMPLER_CUBE_SHADOW_EXT 0x8DC5 +#define GL_UNSIGNED_INT_VEC2_EXT 0x8DC6 +#define GL_UNSIGNED_INT_VEC3_EXT 0x8DC7 +#define GL_UNSIGNED_INT_VEC4_EXT 0x8DC8 +#define GL_INT_SAMPLER_1D_EXT 0x8DC9 +#define GL_INT_SAMPLER_2D_EXT 0x8DCA +#define GL_INT_SAMPLER_3D_EXT 0x8DCB +#define GL_INT_SAMPLER_CUBE_EXT 0x8DCC +#define GL_INT_SAMPLER_2D_RECT_EXT 0x8DCD +#define GL_INT_SAMPLER_1D_ARRAY_EXT 0x8DCE +#define GL_INT_SAMPLER_2D_ARRAY_EXT 0x8DCF +#define GL_INT_SAMPLER_BUFFER_EXT 0x8DD0 +#define GL_UNSIGNED_INT_SAMPLER_1D_EXT 0x8DD1 +#define GL_UNSIGNED_INT_SAMPLER_2D_EXT 0x8DD2 +#define GL_UNSIGNED_INT_SAMPLER_3D_EXT 0x8DD3 +#define GL_UNSIGNED_INT_SAMPLER_CUBE_EXT 0x8DD4 +#define GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT 0x8DD5 +#define GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT 0x8DD6 +#define GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT 0x8DD7 +#define GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT 0x8DD8 + +typedef void (GLAPIENTRY * PFNGLBINDFRAGDATALOCATIONEXTPROC) (GLuint program, GLuint color, const GLchar *name); +typedef GLint (GLAPIENTRY * PFNGLGETFRAGDATALOCATIONEXTPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUIVEXTPROC) (GLuint program, GLint location, GLuint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIIVEXTPROC) (GLuint index, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIUIVEXTPROC) (GLuint index, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIEXTPROC) (GLint location, GLuint v0); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIEXTPROC) (GLint location, GLuint v0, GLuint v1); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIEXTPROC) (GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UIVEXTPROC) (GLint location, GLsizei count, const GLuint *value); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IEXTPROC) (GLuint index, GLint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIEXTPROC) (GLuint index, GLuint x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI1UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IEXTPROC) (GLuint index, GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIEXTPROC) (GLuint index, GLuint x, GLuint y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI2UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IEXTPROC) (GLuint index, GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI3UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4BVEXTPROC) (GLuint index, const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IEXTPROC) (GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4IVEXTPROC) (GLuint index, const GLint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4SVEXTPROC) (GLuint index, const GLshort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UBVEXTPROC) (GLuint index, const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIEXTPROC) (GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4UIVEXTPROC) (GLuint index, const GLuint *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBI4USVEXTPROC) (GLuint index, const GLushort *v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glBindFragDataLocationEXT GLEW_GET_FUN(__glewBindFragDataLocationEXT) +#define glGetFragDataLocationEXT GLEW_GET_FUN(__glewGetFragDataLocationEXT) +#define glGetUniformuivEXT GLEW_GET_FUN(__glewGetUniformuivEXT) +#define glGetVertexAttribIivEXT GLEW_GET_FUN(__glewGetVertexAttribIivEXT) +#define glGetVertexAttribIuivEXT GLEW_GET_FUN(__glewGetVertexAttribIuivEXT) +#define glUniform1uiEXT GLEW_GET_FUN(__glewUniform1uiEXT) +#define glUniform1uivEXT GLEW_GET_FUN(__glewUniform1uivEXT) +#define glUniform2uiEXT GLEW_GET_FUN(__glewUniform2uiEXT) +#define glUniform2uivEXT GLEW_GET_FUN(__glewUniform2uivEXT) +#define glUniform3uiEXT GLEW_GET_FUN(__glewUniform3uiEXT) +#define glUniform3uivEXT GLEW_GET_FUN(__glewUniform3uivEXT) +#define glUniform4uiEXT GLEW_GET_FUN(__glewUniform4uiEXT) +#define glUniform4uivEXT GLEW_GET_FUN(__glewUniform4uivEXT) +#define glVertexAttribI1iEXT GLEW_GET_FUN(__glewVertexAttribI1iEXT) +#define glVertexAttribI1ivEXT GLEW_GET_FUN(__glewVertexAttribI1ivEXT) +#define glVertexAttribI1uiEXT GLEW_GET_FUN(__glewVertexAttribI1uiEXT) +#define glVertexAttribI1uivEXT GLEW_GET_FUN(__glewVertexAttribI1uivEXT) +#define glVertexAttribI2iEXT GLEW_GET_FUN(__glewVertexAttribI2iEXT) +#define glVertexAttribI2ivEXT GLEW_GET_FUN(__glewVertexAttribI2ivEXT) +#define glVertexAttribI2uiEXT GLEW_GET_FUN(__glewVertexAttribI2uiEXT) +#define glVertexAttribI2uivEXT GLEW_GET_FUN(__glewVertexAttribI2uivEXT) +#define glVertexAttribI3iEXT GLEW_GET_FUN(__glewVertexAttribI3iEXT) +#define glVertexAttribI3ivEXT GLEW_GET_FUN(__glewVertexAttribI3ivEXT) +#define glVertexAttribI3uiEXT GLEW_GET_FUN(__glewVertexAttribI3uiEXT) +#define glVertexAttribI3uivEXT GLEW_GET_FUN(__glewVertexAttribI3uivEXT) +#define glVertexAttribI4bvEXT GLEW_GET_FUN(__glewVertexAttribI4bvEXT) +#define glVertexAttribI4iEXT GLEW_GET_FUN(__glewVertexAttribI4iEXT) +#define glVertexAttribI4ivEXT GLEW_GET_FUN(__glewVertexAttribI4ivEXT) +#define glVertexAttribI4svEXT GLEW_GET_FUN(__glewVertexAttribI4svEXT) +#define glVertexAttribI4ubvEXT GLEW_GET_FUN(__glewVertexAttribI4ubvEXT) +#define glVertexAttribI4uiEXT GLEW_GET_FUN(__glewVertexAttribI4uiEXT) +#define glVertexAttribI4uivEXT GLEW_GET_FUN(__glewVertexAttribI4uivEXT) +#define glVertexAttribI4usvEXT GLEW_GET_FUN(__glewVertexAttribI4usvEXT) +#define glVertexAttribIPointerEXT GLEW_GET_FUN(__glewVertexAttribIPointerEXT) + +#define GLEW_EXT_gpu_shader4 GLEW_GET_VAR(__GLEW_EXT_gpu_shader4) + +#endif /* GL_EXT_gpu_shader4 */ + +/* ---------------------------- GL_EXT_histogram --------------------------- */ + +#ifndef GL_EXT_histogram +#define GL_EXT_histogram 1 + +#define GL_HISTOGRAM_EXT 0x8024 +#define GL_PROXY_HISTOGRAM_EXT 0x8025 +#define GL_HISTOGRAM_WIDTH_EXT 0x8026 +#define GL_HISTOGRAM_FORMAT_EXT 0x8027 +#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 +#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 +#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A +#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B +#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C +#define GL_HISTOGRAM_SINK_EXT 0x802D +#define GL_MINMAX_EXT 0x802E +#define GL_MINMAX_FORMAT_EXT 0x802F +#define GL_MINMAX_SINK_EXT 0x8030 + +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, void* values); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); +typedef void (GLAPIENTRY * PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLRESETMINMAXEXTPROC) (GLenum target); + +#define glGetHistogramEXT GLEW_GET_FUN(__glewGetHistogramEXT) +#define glGetHistogramParameterfvEXT GLEW_GET_FUN(__glewGetHistogramParameterfvEXT) +#define glGetHistogramParameterivEXT GLEW_GET_FUN(__glewGetHistogramParameterivEXT) +#define glGetMinmaxEXT GLEW_GET_FUN(__glewGetMinmaxEXT) +#define glGetMinmaxParameterfvEXT GLEW_GET_FUN(__glewGetMinmaxParameterfvEXT) +#define glGetMinmaxParameterivEXT GLEW_GET_FUN(__glewGetMinmaxParameterivEXT) +#define glHistogramEXT GLEW_GET_FUN(__glewHistogramEXT) +#define glMinmaxEXT GLEW_GET_FUN(__glewMinmaxEXT) +#define glResetHistogramEXT GLEW_GET_FUN(__glewResetHistogramEXT) +#define glResetMinmaxEXT GLEW_GET_FUN(__glewResetMinmaxEXT) + +#define GLEW_EXT_histogram GLEW_GET_VAR(__GLEW_EXT_histogram) + +#endif /* GL_EXT_histogram */ + +/* ----------------------- GL_EXT_index_array_formats ---------------------- */ + +#ifndef GL_EXT_index_array_formats +#define GL_EXT_index_array_formats 1 + +#define GLEW_EXT_index_array_formats GLEW_GET_VAR(__GLEW_EXT_index_array_formats) + +#endif /* GL_EXT_index_array_formats */ + +/* --------------------------- GL_EXT_index_func --------------------------- */ + +#ifndef GL_EXT_index_func +#define GL_EXT_index_func 1 + +typedef void (GLAPIENTRY * PFNGLINDEXFUNCEXTPROC) (GLenum func, GLfloat ref); + +#define glIndexFuncEXT GLEW_GET_FUN(__glewIndexFuncEXT) + +#define GLEW_EXT_index_func GLEW_GET_VAR(__GLEW_EXT_index_func) + +#endif /* GL_EXT_index_func */ + +/* ------------------------- GL_EXT_index_material ------------------------- */ + +#ifndef GL_EXT_index_material +#define GL_EXT_index_material 1 + +typedef void (GLAPIENTRY * PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glIndexMaterialEXT GLEW_GET_FUN(__glewIndexMaterialEXT) + +#define GLEW_EXT_index_material GLEW_GET_VAR(__GLEW_EXT_index_material) + +#endif /* GL_EXT_index_material */ + +/* -------------------------- GL_EXT_index_texture ------------------------- */ + +#ifndef GL_EXT_index_texture +#define GL_EXT_index_texture 1 + +#define GLEW_EXT_index_texture GLEW_GET_VAR(__GLEW_EXT_index_texture) + +#endif /* GL_EXT_index_texture */ + +/* -------------------------- GL_EXT_light_texture ------------------------- */ + +#ifndef GL_EXT_light_texture +#define GL_EXT_light_texture 1 + +#define GL_FRAGMENT_MATERIAL_EXT 0x8349 +#define GL_FRAGMENT_NORMAL_EXT 0x834A +#define GL_FRAGMENT_COLOR_EXT 0x834C +#define GL_ATTENUATION_EXT 0x834D +#define GL_SHADOW_ATTENUATION_EXT 0x834E +#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F +#define GL_TEXTURE_LIGHT_EXT 0x8350 +#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 +#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 +#define GL_FRAGMENT_DEPTH_EXT 0x8452 + +typedef void (GLAPIENTRY * PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); +typedef void (GLAPIENTRY * PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); +typedef void (GLAPIENTRY * PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); + +#define glApplyTextureEXT GLEW_GET_FUN(__glewApplyTextureEXT) +#define glTextureLightEXT GLEW_GET_FUN(__glewTextureLightEXT) +#define glTextureMaterialEXT GLEW_GET_FUN(__glewTextureMaterialEXT) + +#define GLEW_EXT_light_texture GLEW_GET_VAR(__GLEW_EXT_light_texture) + +#endif /* GL_EXT_light_texture */ + +/* ------------------------- GL_EXT_misc_attribute ------------------------- */ + +#ifndef GL_EXT_misc_attribute +#define GL_EXT_misc_attribute 1 + +#define GLEW_EXT_misc_attribute GLEW_GET_VAR(__GLEW_EXT_misc_attribute) + +#endif /* GL_EXT_misc_attribute */ + +/* ------------------------ GL_EXT_multi_draw_arrays ----------------------- */ + +#ifndef GL_EXT_multi_draw_arrays +#define GL_EXT_multi_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint* first, const GLsizei *count, GLsizei primcount); +typedef void (GLAPIENTRY * PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, GLsizei* count, GLenum type, const GLvoid **indices, GLsizei primcount); + +#define glMultiDrawArraysEXT GLEW_GET_FUN(__glewMultiDrawArraysEXT) +#define glMultiDrawElementsEXT GLEW_GET_FUN(__glewMultiDrawElementsEXT) + +#define GLEW_EXT_multi_draw_arrays GLEW_GET_VAR(__GLEW_EXT_multi_draw_arrays) + +#endif /* GL_EXT_multi_draw_arrays */ + +/* --------------------------- GL_EXT_multisample -------------------------- */ + +#ifndef GL_EXT_multisample +#define GL_EXT_multisample 1 + +#define GL_MULTISAMPLE_EXT 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F +#define GL_SAMPLE_MASK_EXT 0x80A0 +#define GL_1PASS_EXT 0x80A1 +#define GL_2PASS_0_EXT 0x80A2 +#define GL_2PASS_1_EXT 0x80A3 +#define GL_4PASS_0_EXT 0x80A4 +#define GL_4PASS_1_EXT 0x80A5 +#define GL_4PASS_2_EXT 0x80A6 +#define GL_4PASS_3_EXT 0x80A7 +#define GL_SAMPLE_BUFFERS_EXT 0x80A8 +#define GL_SAMPLES_EXT 0x80A9 +#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA +#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB +#define GL_SAMPLE_PATTERN_EXT 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); + +#define glSampleMaskEXT GLEW_GET_FUN(__glewSampleMaskEXT) +#define glSamplePatternEXT GLEW_GET_FUN(__glewSamplePatternEXT) + +#define GLEW_EXT_multisample GLEW_GET_VAR(__GLEW_EXT_multisample) + +#endif /* GL_EXT_multisample */ + +/* ---------------------- GL_EXT_packed_depth_stencil ---------------------- */ + +#ifndef GL_EXT_packed_depth_stencil +#define GL_EXT_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_EXT 0x84F9 +#define GL_UNSIGNED_INT_24_8_EXT 0x84FA +#define GL_DEPTH24_STENCIL8_EXT 0x88F0 +#define GL_TEXTURE_STENCIL_SIZE_EXT 0x88F1 + +#define GLEW_EXT_packed_depth_stencil GLEW_GET_VAR(__GLEW_EXT_packed_depth_stencil) + +#endif /* GL_EXT_packed_depth_stencil */ + +/* -------------------------- GL_EXT_packed_float -------------------------- */ + +#ifndef GL_EXT_packed_float +#define GL_EXT_packed_float 1 + +#define GL_R11F_G11F_B10F_EXT 0x8C3A +#define GL_UNSIGNED_INT_10F_11F_11F_REV_EXT 0x8C3B +#define GL_RGBA_SIGNED_COMPONENTS_EXT 0x8C3C + +#define GLEW_EXT_packed_float GLEW_GET_VAR(__GLEW_EXT_packed_float) + +#endif /* GL_EXT_packed_float */ + +/* -------------------------- GL_EXT_packed_pixels ------------------------- */ + +#ifndef GL_EXT_packed_pixels +#define GL_EXT_packed_pixels 1 + +#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 +#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 +#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 +#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 +#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 + +#define GLEW_EXT_packed_pixels GLEW_GET_VAR(__GLEW_EXT_packed_pixels) + +#endif /* GL_EXT_packed_pixels */ + +/* ------------------------ GL_EXT_paletted_texture ------------------------ */ + +#ifndef GL_EXT_paletted_texture +#define GL_EXT_paletted_texture 1 + +#define GL_TEXTURE_1D 0x0DE0 +#define GL_TEXTURE_2D 0x0DE1 +#define GL_PROXY_TEXTURE_1D 0x8063 +#define GL_PROXY_TEXTURE_2D 0x8064 +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_COLOR_TABLE_FORMAT_EXT 0x80D8 +#define GL_COLOR_TABLE_WIDTH_EXT 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_EXT 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_EXT 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_EXT 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_EXT 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_EXT 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_EXT 0x80DF +#define GL_COLOR_INDEX1_EXT 0x80E2 +#define GL_COLOR_INDEX2_EXT 0x80E3 +#define GL_COLOR_INDEX4_EXT 0x80E4 +#define GL_COLOR_INDEX8_EXT 0x80E5 +#define GL_COLOR_INDEX12_EXT 0x80E6 +#define GL_COLOR_INDEX16_EXT 0x80E7 +#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED +#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 +#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const void* data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, void* data); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint* params); + +#define glColorTableEXT GLEW_GET_FUN(__glewColorTableEXT) +#define glGetColorTableEXT GLEW_GET_FUN(__glewGetColorTableEXT) +#define glGetColorTableParameterfvEXT GLEW_GET_FUN(__glewGetColorTableParameterfvEXT) +#define glGetColorTableParameterivEXT GLEW_GET_FUN(__glewGetColorTableParameterivEXT) + +#define GLEW_EXT_paletted_texture GLEW_GET_VAR(__GLEW_EXT_paletted_texture) + +#endif /* GL_EXT_paletted_texture */ + +/* ----------------------- GL_EXT_pixel_buffer_object ---------------------- */ + +#ifndef GL_EXT_pixel_buffer_object +#define GL_EXT_pixel_buffer_object 1 + +#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB +#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC +#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED +#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF + +#define GLEW_EXT_pixel_buffer_object GLEW_GET_VAR(__GLEW_EXT_pixel_buffer_object) + +#endif /* GL_EXT_pixel_buffer_object */ + +/* ------------------------- GL_EXT_pixel_transform ------------------------ */ + +#ifndef GL_EXT_pixel_transform +#define GL_EXT_pixel_transform 1 + +#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 +#define GL_PIXEL_MAG_FILTER_EXT 0x8331 +#define GL_PIXEL_MIN_FILTER_EXT 0x8332 +#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 +#define GL_CUBIC_EXT 0x8334 +#define GL_AVERAGE_EXT 0x8335 +#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 +#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 +#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 + +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetPixelTransformParameterfvEXT GLEW_GET_FUN(__glewGetPixelTransformParameterfvEXT) +#define glGetPixelTransformParameterivEXT GLEW_GET_FUN(__glewGetPixelTransformParameterivEXT) +#define glPixelTransformParameterfEXT GLEW_GET_FUN(__glewPixelTransformParameterfEXT) +#define glPixelTransformParameterfvEXT GLEW_GET_FUN(__glewPixelTransformParameterfvEXT) +#define glPixelTransformParameteriEXT GLEW_GET_FUN(__glewPixelTransformParameteriEXT) +#define glPixelTransformParameterivEXT GLEW_GET_FUN(__glewPixelTransformParameterivEXT) + +#define GLEW_EXT_pixel_transform GLEW_GET_VAR(__GLEW_EXT_pixel_transform) + +#endif /* GL_EXT_pixel_transform */ + +/* ------------------- GL_EXT_pixel_transform_color_table ------------------ */ + +#ifndef GL_EXT_pixel_transform_color_table +#define GL_EXT_pixel_transform_color_table 1 + +#define GLEW_EXT_pixel_transform_color_table GLEW_GET_VAR(__GLEW_EXT_pixel_transform_color_table) + +#endif /* GL_EXT_pixel_transform_color_table */ + +/* ------------------------ GL_EXT_point_parameters ------------------------ */ + +#ifndef GL_EXT_point_parameters +#define GL_EXT_point_parameters 1 + +#define GL_POINT_SIZE_MIN_EXT 0x8126 +#define GL_POINT_SIZE_MAX_EXT 0x8127 +#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 +#define GL_DISTANCE_ATTENUATION_EXT 0x8129 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat* params); + +#define glPointParameterfEXT GLEW_GET_FUN(__glewPointParameterfEXT) +#define glPointParameterfvEXT GLEW_GET_FUN(__glewPointParameterfvEXT) + +#define GLEW_EXT_point_parameters GLEW_GET_VAR(__GLEW_EXT_point_parameters) + +#endif /* GL_EXT_point_parameters */ + +/* ------------------------- GL_EXT_polygon_offset ------------------------- */ + +#ifndef GL_EXT_polygon_offset +#define GL_EXT_polygon_offset 1 + +#define GL_POLYGON_OFFSET_EXT 0x8037 +#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 +#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 + +typedef void (GLAPIENTRY * PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); + +#define glPolygonOffsetEXT GLEW_GET_FUN(__glewPolygonOffsetEXT) + +#define GLEW_EXT_polygon_offset GLEW_GET_VAR(__GLEW_EXT_polygon_offset) + +#endif /* GL_EXT_polygon_offset */ + +/* ------------------------ GL_EXT_provoking_vertex ------------------------ */ + +#ifndef GL_EXT_provoking_vertex +#define GL_EXT_provoking_vertex 1 + +#define GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT 0x8E4C +#define GL_FIRST_VERTEX_CONVENTION_EXT 0x8E4D +#define GL_LAST_VERTEX_CONVENTION_EXT 0x8E4E +#define GL_PROVOKING_VERTEX_EXT 0x8E4F + +typedef void (GLAPIENTRY * PFNGLPROVOKINGVERTEXEXTPROC) (GLenum mode); + +#define glProvokingVertexEXT GLEW_GET_FUN(__glewProvokingVertexEXT) + +#define GLEW_EXT_provoking_vertex GLEW_GET_VAR(__GLEW_EXT_provoking_vertex) + +#endif /* GL_EXT_provoking_vertex */ + +/* ------------------------- GL_EXT_rescale_normal ------------------------- */ + +#ifndef GL_EXT_rescale_normal +#define GL_EXT_rescale_normal 1 + +#define GL_RESCALE_NORMAL_EXT 0x803A + +#define GLEW_EXT_rescale_normal GLEW_GET_VAR(__GLEW_EXT_rescale_normal) + +#endif /* GL_EXT_rescale_normal */ + +/* -------------------------- GL_EXT_scene_marker -------------------------- */ + +#ifndef GL_EXT_scene_marker +#define GL_EXT_scene_marker 1 + +typedef void (GLAPIENTRY * PFNGLBEGINSCENEEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLENDSCENEEXTPROC) (void); + +#define glBeginSceneEXT GLEW_GET_FUN(__glewBeginSceneEXT) +#define glEndSceneEXT GLEW_GET_FUN(__glewEndSceneEXT) + +#define GLEW_EXT_scene_marker GLEW_GET_VAR(__GLEW_EXT_scene_marker) + +#endif /* GL_EXT_scene_marker */ + +/* ------------------------- GL_EXT_secondary_color ------------------------ */ + +#ifndef GL_EXT_secondary_color +#define GL_EXT_secondary_color 1 + +#define GL_COLOR_SUM_EXT 0x8458 +#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 +#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A +#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B +#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C +#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D +#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E + +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); + +#define glSecondaryColor3bEXT GLEW_GET_FUN(__glewSecondaryColor3bEXT) +#define glSecondaryColor3bvEXT GLEW_GET_FUN(__glewSecondaryColor3bvEXT) +#define glSecondaryColor3dEXT GLEW_GET_FUN(__glewSecondaryColor3dEXT) +#define glSecondaryColor3dvEXT GLEW_GET_FUN(__glewSecondaryColor3dvEXT) +#define glSecondaryColor3fEXT GLEW_GET_FUN(__glewSecondaryColor3fEXT) +#define glSecondaryColor3fvEXT GLEW_GET_FUN(__glewSecondaryColor3fvEXT) +#define glSecondaryColor3iEXT GLEW_GET_FUN(__glewSecondaryColor3iEXT) +#define glSecondaryColor3ivEXT GLEW_GET_FUN(__glewSecondaryColor3ivEXT) +#define glSecondaryColor3sEXT GLEW_GET_FUN(__glewSecondaryColor3sEXT) +#define glSecondaryColor3svEXT GLEW_GET_FUN(__glewSecondaryColor3svEXT) +#define glSecondaryColor3ubEXT GLEW_GET_FUN(__glewSecondaryColor3ubEXT) +#define glSecondaryColor3ubvEXT GLEW_GET_FUN(__glewSecondaryColor3ubvEXT) +#define glSecondaryColor3uiEXT GLEW_GET_FUN(__glewSecondaryColor3uiEXT) +#define glSecondaryColor3uivEXT GLEW_GET_FUN(__glewSecondaryColor3uivEXT) +#define glSecondaryColor3usEXT GLEW_GET_FUN(__glewSecondaryColor3usEXT) +#define glSecondaryColor3usvEXT GLEW_GET_FUN(__glewSecondaryColor3usvEXT) +#define glSecondaryColorPointerEXT GLEW_GET_FUN(__glewSecondaryColorPointerEXT) + +#define GLEW_EXT_secondary_color GLEW_GET_VAR(__GLEW_EXT_secondary_color) + +#endif /* GL_EXT_secondary_color */ + +/* --------------------- GL_EXT_separate_shader_objects -------------------- */ + +#ifndef GL_EXT_separate_shader_objects +#define GL_EXT_separate_shader_objects 1 + +#define GL_ACTIVE_PROGRAM_EXT 0x8B8D + +typedef void (GLAPIENTRY * PFNGLACTIVEPROGRAMEXTPROC) (GLuint program); +typedef GLuint (GLAPIENTRY * PFNGLCREATESHADERPROGRAMEXTPROC) (GLenum type, const char* string); +typedef void (GLAPIENTRY * PFNGLUSESHADERPROGRAMEXTPROC) (GLenum type, GLuint program); + +#define glActiveProgramEXT GLEW_GET_FUN(__glewActiveProgramEXT) +#define glCreateShaderProgramEXT GLEW_GET_FUN(__glewCreateShaderProgramEXT) +#define glUseShaderProgramEXT GLEW_GET_FUN(__glewUseShaderProgramEXT) + +#define GLEW_EXT_separate_shader_objects GLEW_GET_VAR(__GLEW_EXT_separate_shader_objects) + +#endif /* GL_EXT_separate_shader_objects */ + +/* --------------------- GL_EXT_separate_specular_color -------------------- */ + +#ifndef GL_EXT_separate_specular_color +#define GL_EXT_separate_specular_color 1 + +#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 +#define GL_SINGLE_COLOR_EXT 0x81F9 +#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA + +#define GLEW_EXT_separate_specular_color GLEW_GET_VAR(__GLEW_EXT_separate_specular_color) + +#endif /* GL_EXT_separate_specular_color */ + +/* --------------------- GL_EXT_shader_image_load_store -------------------- */ + +#ifndef GL_EXT_shader_image_load_store +#define GL_EXT_shader_image_load_store 1 + +#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT 0x00000001 +#define GL_ELEMENT_ARRAY_BARRIER_BIT_EXT 0x00000002 +#define GL_UNIFORM_BARRIER_BIT_EXT 0x00000004 +#define GL_TEXTURE_FETCH_BARRIER_BIT_EXT 0x00000008 +#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT 0x00000020 +#define GL_COMMAND_BARRIER_BIT_EXT 0x00000040 +#define GL_PIXEL_BUFFER_BARRIER_BIT_EXT 0x00000080 +#define GL_TEXTURE_UPDATE_BARRIER_BIT_EXT 0x00000100 +#define GL_BUFFER_UPDATE_BARRIER_BIT_EXT 0x00000200 +#define GL_FRAMEBUFFER_BARRIER_BIT_EXT 0x00000400 +#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT 0x00000800 +#define GL_ATOMIC_COUNTER_BARRIER_BIT_EXT 0x00001000 +#define GL_MAX_IMAGE_UNITS_EXT 0x8F38 +#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT 0x8F39 +#define GL_IMAGE_BINDING_NAME_EXT 0x8F3A +#define GL_IMAGE_BINDING_LEVEL_EXT 0x8F3B +#define GL_IMAGE_BINDING_LAYERED_EXT 0x8F3C +#define GL_IMAGE_BINDING_LAYER_EXT 0x8F3D +#define GL_IMAGE_BINDING_ACCESS_EXT 0x8F3E +#define GL_IMAGE_1D_EXT 0x904C +#define GL_IMAGE_2D_EXT 0x904D +#define GL_IMAGE_3D_EXT 0x904E +#define GL_IMAGE_2D_RECT_EXT 0x904F +#define GL_IMAGE_CUBE_EXT 0x9050 +#define GL_IMAGE_BUFFER_EXT 0x9051 +#define GL_IMAGE_1D_ARRAY_EXT 0x9052 +#define GL_IMAGE_2D_ARRAY_EXT 0x9053 +#define GL_IMAGE_CUBE_MAP_ARRAY_EXT 0x9054 +#define GL_IMAGE_2D_MULTISAMPLE_EXT 0x9055 +#define GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9056 +#define GL_INT_IMAGE_1D_EXT 0x9057 +#define GL_INT_IMAGE_2D_EXT 0x9058 +#define GL_INT_IMAGE_3D_EXT 0x9059 +#define GL_INT_IMAGE_2D_RECT_EXT 0x905A +#define GL_INT_IMAGE_CUBE_EXT 0x905B +#define GL_INT_IMAGE_BUFFER_EXT 0x905C +#define GL_INT_IMAGE_1D_ARRAY_EXT 0x905D +#define GL_INT_IMAGE_2D_ARRAY_EXT 0x905E +#define GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x905F +#define GL_INT_IMAGE_2D_MULTISAMPLE_EXT 0x9060 +#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x9061 +#define GL_UNSIGNED_INT_IMAGE_1D_EXT 0x9062 +#define GL_UNSIGNED_INT_IMAGE_2D_EXT 0x9063 +#define GL_UNSIGNED_INT_IMAGE_3D_EXT 0x9064 +#define GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT 0x9065 +#define GL_UNSIGNED_INT_IMAGE_CUBE_EXT 0x9066 +#define GL_UNSIGNED_INT_IMAGE_BUFFER_EXT 0x9067 +#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT 0x9068 +#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT 0x9069 +#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT 0x906A +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT 0x906B +#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT 0x906C +#define GL_MAX_IMAGE_SAMPLES_EXT 0x906D +#define GL_IMAGE_BINDING_FORMAT_EXT 0x906E +#define GL_ALL_BARRIER_BITS_EXT 0xFFFFFFFF + +typedef void (GLAPIENTRY * PFNGLBINDIMAGETEXTUREEXTPROC) (GLuint index, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLint format); +typedef void (GLAPIENTRY * PFNGLMEMORYBARRIEREXTPROC) (GLbitfield barriers); + +#define glBindImageTextureEXT GLEW_GET_FUN(__glewBindImageTextureEXT) +#define glMemoryBarrierEXT GLEW_GET_FUN(__glewMemoryBarrierEXT) + +#define GLEW_EXT_shader_image_load_store GLEW_GET_VAR(__GLEW_EXT_shader_image_load_store) + +#endif /* GL_EXT_shader_image_load_store */ + +/* -------------------------- GL_EXT_shadow_funcs -------------------------- */ + +#ifndef GL_EXT_shadow_funcs +#define GL_EXT_shadow_funcs 1 + +#define GLEW_EXT_shadow_funcs GLEW_GET_VAR(__GLEW_EXT_shadow_funcs) + +#endif /* GL_EXT_shadow_funcs */ + +/* --------------------- GL_EXT_shared_texture_palette --------------------- */ + +#ifndef GL_EXT_shared_texture_palette +#define GL_EXT_shared_texture_palette 1 + +#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB + +#define GLEW_EXT_shared_texture_palette GLEW_GET_VAR(__GLEW_EXT_shared_texture_palette) + +#endif /* GL_EXT_shared_texture_palette */ + +/* ------------------------ GL_EXT_stencil_clear_tag ----------------------- */ + +#ifndef GL_EXT_stencil_clear_tag +#define GL_EXT_stencil_clear_tag 1 + +#define GL_STENCIL_TAG_BITS_EXT 0x88F2 +#define GL_STENCIL_CLEAR_TAG_VALUE_EXT 0x88F3 + +#define GLEW_EXT_stencil_clear_tag GLEW_GET_VAR(__GLEW_EXT_stencil_clear_tag) + +#endif /* GL_EXT_stencil_clear_tag */ + +/* ------------------------ GL_EXT_stencil_two_side ------------------------ */ + +#ifndef GL_EXT_stencil_two_side +#define GL_EXT_stencil_two_side 1 + +#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 +#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 + +typedef void (GLAPIENTRY * PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); + +#define glActiveStencilFaceEXT GLEW_GET_FUN(__glewActiveStencilFaceEXT) + +#define GLEW_EXT_stencil_two_side GLEW_GET_VAR(__GLEW_EXT_stencil_two_side) + +#endif /* GL_EXT_stencil_two_side */ + +/* -------------------------- GL_EXT_stencil_wrap -------------------------- */ + +#ifndef GL_EXT_stencil_wrap +#define GL_EXT_stencil_wrap 1 + +#define GL_INCR_WRAP_EXT 0x8507 +#define GL_DECR_WRAP_EXT 0x8508 + +#define GLEW_EXT_stencil_wrap GLEW_GET_VAR(__GLEW_EXT_stencil_wrap) + +#endif /* GL_EXT_stencil_wrap */ + +/* --------------------------- GL_EXT_subtexture --------------------------- */ + +#ifndef GL_EXT_subtexture +#define GL_EXT_subtexture 1 + +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels); + +#define glTexSubImage1DEXT GLEW_GET_FUN(__glewTexSubImage1DEXT) +#define glTexSubImage2DEXT GLEW_GET_FUN(__glewTexSubImage2DEXT) +#define glTexSubImage3DEXT GLEW_GET_FUN(__glewTexSubImage3DEXT) + +#define GLEW_EXT_subtexture GLEW_GET_VAR(__GLEW_EXT_subtexture) + +#endif /* GL_EXT_subtexture */ + +/* ----------------------------- GL_EXT_texture ---------------------------- */ + +#ifndef GL_EXT_texture +#define GL_EXT_texture 1 + +#define GL_ALPHA4_EXT 0x803B +#define GL_ALPHA8_EXT 0x803C +#define GL_ALPHA12_EXT 0x803D +#define GL_ALPHA16_EXT 0x803E +#define GL_LUMINANCE4_EXT 0x803F +#define GL_LUMINANCE8_EXT 0x8040 +#define GL_LUMINANCE12_EXT 0x8041 +#define GL_LUMINANCE16_EXT 0x8042 +#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 +#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 +#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 +#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 +#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 +#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 +#define GL_INTENSITY_EXT 0x8049 +#define GL_INTENSITY4_EXT 0x804A +#define GL_INTENSITY8_EXT 0x804B +#define GL_INTENSITY12_EXT 0x804C +#define GL_INTENSITY16_EXT 0x804D +#define GL_RGB2_EXT 0x804E +#define GL_RGB4_EXT 0x804F +#define GL_RGB5_EXT 0x8050 +#define GL_RGB8_EXT 0x8051 +#define GL_RGB10_EXT 0x8052 +#define GL_RGB12_EXT 0x8053 +#define GL_RGB16_EXT 0x8054 +#define GL_RGBA2_EXT 0x8055 +#define GL_RGBA4_EXT 0x8056 +#define GL_RGB5_A1_EXT 0x8057 +#define GL_RGBA8_EXT 0x8058 +#define GL_RGB10_A2_EXT 0x8059 +#define GL_RGBA12_EXT 0x805A +#define GL_RGBA16_EXT 0x805B +#define GL_TEXTURE_RED_SIZE_EXT 0x805C +#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D +#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E +#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F +#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 +#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 +#define GL_REPLACE_EXT 0x8062 +#define GL_PROXY_TEXTURE_1D_EXT 0x8063 +#define GL_PROXY_TEXTURE_2D_EXT 0x8064 + +#define GLEW_EXT_texture GLEW_GET_VAR(__GLEW_EXT_texture) + +#endif /* GL_EXT_texture */ + +/* ---------------------------- GL_EXT_texture3D --------------------------- */ + +#ifndef GL_EXT_texture3D +#define GL_EXT_texture3D 1 + +#define GL_PACK_SKIP_IMAGES_EXT 0x806B +#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C +#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D +#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E +#define GL_TEXTURE_3D_EXT 0x806F +#define GL_PROXY_TEXTURE_3D_EXT 0x8070 +#define GL_TEXTURE_DEPTH_EXT 0x8071 +#define GL_TEXTURE_WRAP_R_EXT 0x8072 +#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels); + +#define glTexImage3DEXT GLEW_GET_FUN(__glewTexImage3DEXT) + +#define GLEW_EXT_texture3D GLEW_GET_VAR(__GLEW_EXT_texture3D) + +#endif /* GL_EXT_texture3D */ + +/* -------------------------- GL_EXT_texture_array ------------------------- */ + +#ifndef GL_EXT_texture_array +#define GL_EXT_texture_array 1 + +#define GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT 0x884E +#define GL_MAX_ARRAY_TEXTURE_LAYERS_EXT 0x88FF +#define GL_TEXTURE_1D_ARRAY_EXT 0x8C18 +#define GL_PROXY_TEXTURE_1D_ARRAY_EXT 0x8C19 +#define GL_TEXTURE_2D_ARRAY_EXT 0x8C1A +#define GL_PROXY_TEXTURE_2D_ARRAY_EXT 0x8C1B +#define GL_TEXTURE_BINDING_1D_ARRAY_EXT 0x8C1C +#define GL_TEXTURE_BINDING_2D_ARRAY_EXT 0x8C1D + +#define GLEW_EXT_texture_array GLEW_GET_VAR(__GLEW_EXT_texture_array) + +#endif /* GL_EXT_texture_array */ + +/* ---------------------- GL_EXT_texture_buffer_object --------------------- */ + +#ifndef GL_EXT_texture_buffer_object +#define GL_EXT_texture_buffer_object 1 + +#define GL_TEXTURE_BUFFER_EXT 0x8C2A +#define GL_MAX_TEXTURE_BUFFER_SIZE_EXT 0x8C2B +#define GL_TEXTURE_BINDING_BUFFER_EXT 0x8C2C +#define GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT 0x8C2D +#define GL_TEXTURE_BUFFER_FORMAT_EXT 0x8C2E + +typedef void (GLAPIENTRY * PFNGLTEXBUFFEREXTPROC) (GLenum target, GLenum internalformat, GLuint buffer); + +#define glTexBufferEXT GLEW_GET_FUN(__glewTexBufferEXT) + +#define GLEW_EXT_texture_buffer_object GLEW_GET_VAR(__GLEW_EXT_texture_buffer_object) + +#endif /* GL_EXT_texture_buffer_object */ + +/* -------------------- GL_EXT_texture_compression_dxt1 -------------------- */ + +#ifndef GL_EXT_texture_compression_dxt1 +#define GL_EXT_texture_compression_dxt1 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 + +#define GLEW_EXT_texture_compression_dxt1 GLEW_GET_VAR(__GLEW_EXT_texture_compression_dxt1) + +#endif /* GL_EXT_texture_compression_dxt1 */ + +/* -------------------- GL_EXT_texture_compression_latc -------------------- */ + +#ifndef GL_EXT_texture_compression_latc +#define GL_EXT_texture_compression_latc 1 + +#define GL_COMPRESSED_LUMINANCE_LATC1_EXT 0x8C70 +#define GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT 0x8C71 +#define GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT 0x8C72 +#define GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT 0x8C73 + +#define GLEW_EXT_texture_compression_latc GLEW_GET_VAR(__GLEW_EXT_texture_compression_latc) + +#endif /* GL_EXT_texture_compression_latc */ + +/* -------------------- GL_EXT_texture_compression_rgtc -------------------- */ + +#ifndef GL_EXT_texture_compression_rgtc +#define GL_EXT_texture_compression_rgtc 1 + +#define GL_COMPRESSED_RED_RGTC1_EXT 0x8DBB +#define GL_COMPRESSED_SIGNED_RED_RGTC1_EXT 0x8DBC +#define GL_COMPRESSED_RED_GREEN_RGTC2_EXT 0x8DBD +#define GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT 0x8DBE + +#define GLEW_EXT_texture_compression_rgtc GLEW_GET_VAR(__GLEW_EXT_texture_compression_rgtc) + +#endif /* GL_EXT_texture_compression_rgtc */ + +/* -------------------- GL_EXT_texture_compression_s3tc -------------------- */ + +#ifndef GL_EXT_texture_compression_s3tc +#define GL_EXT_texture_compression_s3tc 1 + +#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 +#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 +#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 +#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 + +#define GLEW_EXT_texture_compression_s3tc GLEW_GET_VAR(__GLEW_EXT_texture_compression_s3tc) + +#endif /* GL_EXT_texture_compression_s3tc */ + +/* ------------------------ GL_EXT_texture_cube_map ------------------------ */ + +#ifndef GL_EXT_texture_cube_map +#define GL_EXT_texture_cube_map 1 + +#define GL_NORMAL_MAP_EXT 0x8511 +#define GL_REFLECTION_MAP_EXT 0x8512 +#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 +#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 +#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 +#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A +#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B +#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C + +#define GLEW_EXT_texture_cube_map GLEW_GET_VAR(__GLEW_EXT_texture_cube_map) + +#endif /* GL_EXT_texture_cube_map */ + +/* ----------------------- GL_EXT_texture_edge_clamp ----------------------- */ + +#ifndef GL_EXT_texture_edge_clamp +#define GL_EXT_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_EXT 0x812F + +#define GLEW_EXT_texture_edge_clamp GLEW_GET_VAR(__GLEW_EXT_texture_edge_clamp) + +#endif /* GL_EXT_texture_edge_clamp */ + +/* --------------------------- GL_EXT_texture_env -------------------------- */ + +#ifndef GL_EXT_texture_env +#define GL_EXT_texture_env 1 + +#define GL_TEXTURE_ENV0_EXT 0 +#define GL_ENV_BLEND_EXT 0 +#define GL_TEXTURE_ENV_SHIFT_EXT 0 +#define GL_ENV_REPLACE_EXT 0 +#define GL_ENV_ADD_EXT 0 +#define GL_ENV_SUBTRACT_EXT 0 +#define GL_TEXTURE_ENV_MODE_ALPHA_EXT 0 +#define GL_ENV_REVERSE_SUBTRACT_EXT 0 +#define GL_ENV_REVERSE_BLEND_EXT 0 +#define GL_ENV_COPY_EXT 0 +#define GL_ENV_MODULATE_EXT 0 + +#define GLEW_EXT_texture_env GLEW_GET_VAR(__GLEW_EXT_texture_env) + +#endif /* GL_EXT_texture_env */ + +/* ------------------------- GL_EXT_texture_env_add ------------------------ */ + +#ifndef GL_EXT_texture_env_add +#define GL_EXT_texture_env_add 1 + +#define GLEW_EXT_texture_env_add GLEW_GET_VAR(__GLEW_EXT_texture_env_add) + +#endif /* GL_EXT_texture_env_add */ + +/* ----------------------- GL_EXT_texture_env_combine ---------------------- */ + +#ifndef GL_EXT_texture_env_combine +#define GL_EXT_texture_env_combine 1 + +#define GL_COMBINE_EXT 0x8570 +#define GL_COMBINE_RGB_EXT 0x8571 +#define GL_COMBINE_ALPHA_EXT 0x8572 +#define GL_RGB_SCALE_EXT 0x8573 +#define GL_ADD_SIGNED_EXT 0x8574 +#define GL_INTERPOLATE_EXT 0x8575 +#define GL_CONSTANT_EXT 0x8576 +#define GL_PRIMARY_COLOR_EXT 0x8577 +#define GL_PREVIOUS_EXT 0x8578 +#define GL_SOURCE0_RGB_EXT 0x8580 +#define GL_SOURCE1_RGB_EXT 0x8581 +#define GL_SOURCE2_RGB_EXT 0x8582 +#define GL_SOURCE0_ALPHA_EXT 0x8588 +#define GL_SOURCE1_ALPHA_EXT 0x8589 +#define GL_SOURCE2_ALPHA_EXT 0x858A +#define GL_OPERAND0_RGB_EXT 0x8590 +#define GL_OPERAND1_RGB_EXT 0x8591 +#define GL_OPERAND2_RGB_EXT 0x8592 +#define GL_OPERAND0_ALPHA_EXT 0x8598 +#define GL_OPERAND1_ALPHA_EXT 0x8599 +#define GL_OPERAND2_ALPHA_EXT 0x859A + +#define GLEW_EXT_texture_env_combine GLEW_GET_VAR(__GLEW_EXT_texture_env_combine) + +#endif /* GL_EXT_texture_env_combine */ + +/* ------------------------ GL_EXT_texture_env_dot3 ------------------------ */ + +#ifndef GL_EXT_texture_env_dot3 +#define GL_EXT_texture_env_dot3 1 + +#define GL_DOT3_RGB_EXT 0x8740 +#define GL_DOT3_RGBA_EXT 0x8741 + +#define GLEW_EXT_texture_env_dot3 GLEW_GET_VAR(__GLEW_EXT_texture_env_dot3) + +#endif /* GL_EXT_texture_env_dot3 */ + +/* ------------------- GL_EXT_texture_filter_anisotropic ------------------- */ + +#ifndef GL_EXT_texture_filter_anisotropic +#define GL_EXT_texture_filter_anisotropic 1 + +#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE +#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF + +#define GLEW_EXT_texture_filter_anisotropic GLEW_GET_VAR(__GLEW_EXT_texture_filter_anisotropic) + +#endif /* GL_EXT_texture_filter_anisotropic */ + +/* ------------------------- GL_EXT_texture_integer ------------------------ */ + +#ifndef GL_EXT_texture_integer +#define GL_EXT_texture_integer 1 + +#define GL_RGBA32UI_EXT 0x8D70 +#define GL_RGB32UI_EXT 0x8D71 +#define GL_ALPHA32UI_EXT 0x8D72 +#define GL_INTENSITY32UI_EXT 0x8D73 +#define GL_LUMINANCE32UI_EXT 0x8D74 +#define GL_LUMINANCE_ALPHA32UI_EXT 0x8D75 +#define GL_RGBA16UI_EXT 0x8D76 +#define GL_RGB16UI_EXT 0x8D77 +#define GL_ALPHA16UI_EXT 0x8D78 +#define GL_INTENSITY16UI_EXT 0x8D79 +#define GL_LUMINANCE16UI_EXT 0x8D7A +#define GL_LUMINANCE_ALPHA16UI_EXT 0x8D7B +#define GL_RGBA8UI_EXT 0x8D7C +#define GL_RGB8UI_EXT 0x8D7D +#define GL_ALPHA8UI_EXT 0x8D7E +#define GL_INTENSITY8UI_EXT 0x8D7F +#define GL_LUMINANCE8UI_EXT 0x8D80 +#define GL_LUMINANCE_ALPHA8UI_EXT 0x8D81 +#define GL_RGBA32I_EXT 0x8D82 +#define GL_RGB32I_EXT 0x8D83 +#define GL_ALPHA32I_EXT 0x8D84 +#define GL_INTENSITY32I_EXT 0x8D85 +#define GL_LUMINANCE32I_EXT 0x8D86 +#define GL_LUMINANCE_ALPHA32I_EXT 0x8D87 +#define GL_RGBA16I_EXT 0x8D88 +#define GL_RGB16I_EXT 0x8D89 +#define GL_ALPHA16I_EXT 0x8D8A +#define GL_INTENSITY16I_EXT 0x8D8B +#define GL_LUMINANCE16I_EXT 0x8D8C +#define GL_LUMINANCE_ALPHA16I_EXT 0x8D8D +#define GL_RGBA8I_EXT 0x8D8E +#define GL_RGB8I_EXT 0x8D8F +#define GL_ALPHA8I_EXT 0x8D90 +#define GL_INTENSITY8I_EXT 0x8D91 +#define GL_LUMINANCE8I_EXT 0x8D92 +#define GL_LUMINANCE_ALPHA8I_EXT 0x8D93 +#define GL_RED_INTEGER_EXT 0x8D94 +#define GL_GREEN_INTEGER_EXT 0x8D95 +#define GL_BLUE_INTEGER_EXT 0x8D96 +#define GL_ALPHA_INTEGER_EXT 0x8D97 +#define GL_RGB_INTEGER_EXT 0x8D98 +#define GL_RGBA_INTEGER_EXT 0x8D99 +#define GL_BGR_INTEGER_EXT 0x8D9A +#define GL_BGRA_INTEGER_EXT 0x8D9B +#define GL_LUMINANCE_INTEGER_EXT 0x8D9C +#define GL_LUMINANCE_ALPHA_INTEGER_EXT 0x8D9D +#define GL_RGBA_INTEGER_MODE_EXT 0x8D9E + +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIIEXTPROC) (GLint red, GLint green, GLint blue, GLint alpha); +typedef void (GLAPIENTRY * PFNGLCLEARCOLORIUIEXTPROC) (GLuint red, GLuint green, GLuint blue, GLuint alpha); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, GLint *params); +typedef void (GLAPIENTRY * PFNGLGETTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, GLuint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); +typedef void (GLAPIENTRY * PFNGLTEXPARAMETERIUIVEXTPROC) (GLenum target, GLenum pname, const GLuint *params); + +#define glClearColorIiEXT GLEW_GET_FUN(__glewClearColorIiEXT) +#define glClearColorIuiEXT GLEW_GET_FUN(__glewClearColorIuiEXT) +#define glGetTexParameterIivEXT GLEW_GET_FUN(__glewGetTexParameterIivEXT) +#define glGetTexParameterIuivEXT GLEW_GET_FUN(__glewGetTexParameterIuivEXT) +#define glTexParameterIivEXT GLEW_GET_FUN(__glewTexParameterIivEXT) +#define glTexParameterIuivEXT GLEW_GET_FUN(__glewTexParameterIuivEXT) + +#define GLEW_EXT_texture_integer GLEW_GET_VAR(__GLEW_EXT_texture_integer) + +#endif /* GL_EXT_texture_integer */ + +/* ------------------------ GL_EXT_texture_lod_bias ------------------------ */ + +#ifndef GL_EXT_texture_lod_bias +#define GL_EXT_texture_lod_bias 1 + +#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD +#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 +#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 + +#define GLEW_EXT_texture_lod_bias GLEW_GET_VAR(__GLEW_EXT_texture_lod_bias) + +#endif /* GL_EXT_texture_lod_bias */ + +/* ---------------------- GL_EXT_texture_mirror_clamp ---------------------- */ + +#ifndef GL_EXT_texture_mirror_clamp +#define GL_EXT_texture_mirror_clamp 1 + +#define GL_MIRROR_CLAMP_EXT 0x8742 +#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 +#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 + +#define GLEW_EXT_texture_mirror_clamp GLEW_GET_VAR(__GLEW_EXT_texture_mirror_clamp) + +#endif /* GL_EXT_texture_mirror_clamp */ + +/* ------------------------- GL_EXT_texture_object ------------------------- */ + +#ifndef GL_EXT_texture_object +#define GL_EXT_texture_object 1 + +#define GL_TEXTURE_PRIORITY_EXT 0x8066 +#define GL_TEXTURE_RESIDENT_EXT 0x8067 +#define GL_TEXTURE_1D_BINDING_EXT 0x8068 +#define GL_TEXTURE_2D_BINDING_EXT 0x8069 +#define GL_TEXTURE_3D_BINDING_EXT 0x806A + +typedef GLboolean (GLAPIENTRY * PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint* textures, GLboolean* residences); +typedef void (GLAPIENTRY * PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); +typedef void (GLAPIENTRY * PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint* textures); +typedef void (GLAPIENTRY * PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint* textures); +typedef GLboolean (GLAPIENTRY * PFNGLISTEXTUREEXTPROC) (GLuint texture); +typedef void (GLAPIENTRY * PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint* textures, const GLclampf* priorities); + +#define glAreTexturesResidentEXT GLEW_GET_FUN(__glewAreTexturesResidentEXT) +#define glBindTextureEXT GLEW_GET_FUN(__glewBindTextureEXT) +#define glDeleteTexturesEXT GLEW_GET_FUN(__glewDeleteTexturesEXT) +#define glGenTexturesEXT GLEW_GET_FUN(__glewGenTexturesEXT) +#define glIsTextureEXT GLEW_GET_FUN(__glewIsTextureEXT) +#define glPrioritizeTexturesEXT GLEW_GET_FUN(__glewPrioritizeTexturesEXT) + +#define GLEW_EXT_texture_object GLEW_GET_VAR(__GLEW_EXT_texture_object) + +#endif /* GL_EXT_texture_object */ + +/* --------------------- GL_EXT_texture_perturb_normal --------------------- */ + +#ifndef GL_EXT_texture_perturb_normal +#define GL_EXT_texture_perturb_normal 1 + +#define GL_PERTURB_EXT 0x85AE +#define GL_TEXTURE_NORMAL_EXT 0x85AF + +typedef void (GLAPIENTRY * PFNGLTEXTURENORMALEXTPROC) (GLenum mode); + +#define glTextureNormalEXT GLEW_GET_FUN(__glewTextureNormalEXT) + +#define GLEW_EXT_texture_perturb_normal GLEW_GET_VAR(__GLEW_EXT_texture_perturb_normal) + +#endif /* GL_EXT_texture_perturb_normal */ + +/* ------------------------ GL_EXT_texture_rectangle ----------------------- */ + +#ifndef GL_EXT_texture_rectangle +#define GL_EXT_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_EXT 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_EXT 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_EXT 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_EXT 0x84F8 + +#define GLEW_EXT_texture_rectangle GLEW_GET_VAR(__GLEW_EXT_texture_rectangle) + +#endif /* GL_EXT_texture_rectangle */ + +/* -------------------------- GL_EXT_texture_sRGB -------------------------- */ + +#ifndef GL_EXT_texture_sRGB +#define GL_EXT_texture_sRGB 1 + +#define GL_SRGB_EXT 0x8C40 +#define GL_SRGB8_EXT 0x8C41 +#define GL_SRGB_ALPHA_EXT 0x8C42 +#define GL_SRGB8_ALPHA8_EXT 0x8C43 +#define GL_SLUMINANCE_ALPHA_EXT 0x8C44 +#define GL_SLUMINANCE8_ALPHA8_EXT 0x8C45 +#define GL_SLUMINANCE_EXT 0x8C46 +#define GL_SLUMINANCE8_EXT 0x8C47 +#define GL_COMPRESSED_SRGB_EXT 0x8C48 +#define GL_COMPRESSED_SRGB_ALPHA_EXT 0x8C49 +#define GL_COMPRESSED_SLUMINANCE_EXT 0x8C4A +#define GL_COMPRESSED_SLUMINANCE_ALPHA_EXT 0x8C4B +#define GL_COMPRESSED_SRGB_S3TC_DXT1_EXT 0x8C4C +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT 0x8C4D +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT 0x8C4E +#define GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT 0x8C4F + +#define GLEW_EXT_texture_sRGB GLEW_GET_VAR(__GLEW_EXT_texture_sRGB) + +#endif /* GL_EXT_texture_sRGB */ + +/* ----------------------- GL_EXT_texture_sRGB_decode ---------------------- */ + +#ifndef GL_EXT_texture_sRGB_decode +#define GL_EXT_texture_sRGB_decode 1 + +#define GL_TEXTURE_SRGB_DECODE_EXT 0x8A48 +#define GL_DECODE_EXT 0x8A49 +#define GL_SKIP_DECODE_EXT 0x8A4A + +#define GLEW_EXT_texture_sRGB_decode GLEW_GET_VAR(__GLEW_EXT_texture_sRGB_decode) + +#endif /* GL_EXT_texture_sRGB_decode */ + +/* --------------------- GL_EXT_texture_shared_exponent -------------------- */ + +#ifndef GL_EXT_texture_shared_exponent +#define GL_EXT_texture_shared_exponent 1 + +#define GL_RGB9_E5_EXT 0x8C3D +#define GL_UNSIGNED_INT_5_9_9_9_REV_EXT 0x8C3E +#define GL_TEXTURE_SHARED_SIZE_EXT 0x8C3F + +#define GLEW_EXT_texture_shared_exponent GLEW_GET_VAR(__GLEW_EXT_texture_shared_exponent) + +#endif /* GL_EXT_texture_shared_exponent */ + +/* -------------------------- GL_EXT_texture_snorm ------------------------- */ + +#ifndef GL_EXT_texture_snorm +#define GL_EXT_texture_snorm 1 + +#define GL_RED_SNORM 0x8F90 +#define GL_RG_SNORM 0x8F91 +#define GL_RGB_SNORM 0x8F92 +#define GL_RGBA_SNORM 0x8F93 +#define GL_R8_SNORM 0x8F94 +#define GL_RG8_SNORM 0x8F95 +#define GL_RGB8_SNORM 0x8F96 +#define GL_RGBA8_SNORM 0x8F97 +#define GL_R16_SNORM 0x8F98 +#define GL_RG16_SNORM 0x8F99 +#define GL_RGB16_SNORM 0x8F9A +#define GL_RGBA16_SNORM 0x8F9B +#define GL_SIGNED_NORMALIZED 0x8F9C +#define GL_ALPHA_SNORM 0x9010 +#define GL_LUMINANCE_SNORM 0x9011 +#define GL_LUMINANCE_ALPHA_SNORM 0x9012 +#define GL_INTENSITY_SNORM 0x9013 +#define GL_ALPHA8_SNORM 0x9014 +#define GL_LUMINANCE8_SNORM 0x9015 +#define GL_LUMINANCE8_ALPHA8_SNORM 0x9016 +#define GL_INTENSITY8_SNORM 0x9017 +#define GL_ALPHA16_SNORM 0x9018 +#define GL_LUMINANCE16_SNORM 0x9019 +#define GL_LUMINANCE16_ALPHA16_SNORM 0x901A +#define GL_INTENSITY16_SNORM 0x901B + +#define GLEW_EXT_texture_snorm GLEW_GET_VAR(__GLEW_EXT_texture_snorm) + +#endif /* GL_EXT_texture_snorm */ + +/* ------------------------- GL_EXT_texture_swizzle ------------------------ */ + +#ifndef GL_EXT_texture_swizzle +#define GL_EXT_texture_swizzle 1 + +#define GL_TEXTURE_SWIZZLE_R_EXT 0x8E42 +#define GL_TEXTURE_SWIZZLE_G_EXT 0x8E43 +#define GL_TEXTURE_SWIZZLE_B_EXT 0x8E44 +#define GL_TEXTURE_SWIZZLE_A_EXT 0x8E45 +#define GL_TEXTURE_SWIZZLE_RGBA_EXT 0x8E46 + +#define GLEW_EXT_texture_swizzle GLEW_GET_VAR(__GLEW_EXT_texture_swizzle) + +#endif /* GL_EXT_texture_swizzle */ + +/* --------------------------- GL_EXT_timer_query -------------------------- */ + +#ifndef GL_EXT_timer_query +#define GL_EXT_timer_query 1 + +#define GL_TIME_ELAPSED_EXT 0x88BF + +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTI64VEXTPROC) (GLuint id, GLenum pname, GLint64EXT *params); +typedef void (GLAPIENTRY * PFNGLGETQUERYOBJECTUI64VEXTPROC) (GLuint id, GLenum pname, GLuint64EXT *params); + +#define glGetQueryObjecti64vEXT GLEW_GET_FUN(__glewGetQueryObjecti64vEXT) +#define glGetQueryObjectui64vEXT GLEW_GET_FUN(__glewGetQueryObjectui64vEXT) + +#define GLEW_EXT_timer_query GLEW_GET_VAR(__GLEW_EXT_timer_query) + +#endif /* GL_EXT_timer_query */ + +/* ----------------------- GL_EXT_transform_feedback ----------------------- */ + +#ifndef GL_EXT_transform_feedback +#define GL_EXT_transform_feedback 1 + +#define GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT 0x8C76 +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT 0x8C80 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_EXT 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT 0x8C85 +#define GL_PRIMITIVES_GENERATED_EXT 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT 0x8C88 +#define GL_RASTERIZER_DISCARD_EXT 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_EXT 0x8C8C +#define GL_SEPARATE_ATTRIBS_EXT 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_EXT 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT 0x8C8F + +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKEXTPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASEEXTPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGEEXTPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei *size, GLenum *type, char *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC) (GLuint program, GLsizei count, const char ** varyings, GLenum bufferMode); + +#define glBeginTransformFeedbackEXT GLEW_GET_FUN(__glewBeginTransformFeedbackEXT) +#define glBindBufferBaseEXT GLEW_GET_FUN(__glewBindBufferBaseEXT) +#define glBindBufferOffsetEXT GLEW_GET_FUN(__glewBindBufferOffsetEXT) +#define glBindBufferRangeEXT GLEW_GET_FUN(__glewBindBufferRangeEXT) +#define glEndTransformFeedbackEXT GLEW_GET_FUN(__glewEndTransformFeedbackEXT) +#define glGetTransformFeedbackVaryingEXT GLEW_GET_FUN(__glewGetTransformFeedbackVaryingEXT) +#define glTransformFeedbackVaryingsEXT GLEW_GET_FUN(__glewTransformFeedbackVaryingsEXT) + +#define GLEW_EXT_transform_feedback GLEW_GET_VAR(__GLEW_EXT_transform_feedback) + +#endif /* GL_EXT_transform_feedback */ + +/* -------------------------- GL_EXT_vertex_array -------------------------- */ + +#ifndef GL_EXT_vertex_array +#define GL_EXT_vertex_array 1 + +#define GL_DOUBLE_EXT 0x140A +#define GL_VERTEX_ARRAY_EXT 0x8074 +#define GL_NORMAL_ARRAY_EXT 0x8075 +#define GL_COLOR_ARRAY_EXT 0x8076 +#define GL_INDEX_ARRAY_EXT 0x8077 +#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 +#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 +#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A +#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B +#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C +#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D +#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E +#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F +#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 +#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 +#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 +#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 +#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 +#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 +#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 +#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 +#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 +#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 +#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A +#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B +#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C +#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D +#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E +#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F +#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 +#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 +#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 +#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 + +typedef void (GLAPIENTRY * PFNGLARRAYELEMENTEXTPROC) (GLint i); +typedef void (GLAPIENTRY * PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean* pointer); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const void* pointer); + +#define glArrayElementEXT GLEW_GET_FUN(__glewArrayElementEXT) +#define glColorPointerEXT GLEW_GET_FUN(__glewColorPointerEXT) +#define glDrawArraysEXT GLEW_GET_FUN(__glewDrawArraysEXT) +#define glEdgeFlagPointerEXT GLEW_GET_FUN(__glewEdgeFlagPointerEXT) +#define glIndexPointerEXT GLEW_GET_FUN(__glewIndexPointerEXT) +#define glNormalPointerEXT GLEW_GET_FUN(__glewNormalPointerEXT) +#define glTexCoordPointerEXT GLEW_GET_FUN(__glewTexCoordPointerEXT) +#define glVertexPointerEXT GLEW_GET_FUN(__glewVertexPointerEXT) + +#define GLEW_EXT_vertex_array GLEW_GET_VAR(__GLEW_EXT_vertex_array) + +#endif /* GL_EXT_vertex_array */ + +/* ------------------------ GL_EXT_vertex_array_bgra ----------------------- */ + +#ifndef GL_EXT_vertex_array_bgra +#define GL_EXT_vertex_array_bgra 1 + +#define GL_BGRA 0x80E1 + +#define GLEW_EXT_vertex_array_bgra GLEW_GET_VAR(__GLEW_EXT_vertex_array_bgra) + +#endif /* GL_EXT_vertex_array_bgra */ + +/* ----------------------- GL_EXT_vertex_attrib_64bit ---------------------- */ + +#ifndef GL_EXT_vertex_attrib_64bit +#define GL_EXT_vertex_attrib_64bit 1 + +#define GL_DOUBLE_MAT2_EXT 0x8F46 +#define GL_DOUBLE_MAT3_EXT 0x8F47 +#define GL_DOUBLE_MAT4_EXT 0x8F48 +#define GL_DOUBLE_MAT2x3_EXT 0x8F49 +#define GL_DOUBLE_MAT2x4_EXT 0x8F4A +#define GL_DOUBLE_MAT3x2_EXT 0x8F4B +#define GL_DOUBLE_MAT3x4_EXT 0x8F4C +#define GL_DOUBLE_MAT4x2_EXT 0x8F4D +#define GL_DOUBLE_MAT4x3_EXT 0x8F4E +#define GL_DOUBLE_VEC2_EXT 0x8FFC +#define GL_DOUBLE_VEC3_EXT 0x8FFD +#define GL_DOUBLE_VEC4_EXT 0x8FFE + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLDVEXTPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC) (GLuint vaobj, GLuint buffer, GLuint index, GLint size, GLenum type, GLsizei stride, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DEXTPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DEXTPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DEXTPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4DVEXTPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLPOINTEREXTPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); + +#define glGetVertexAttribLdvEXT GLEW_GET_FUN(__glewGetVertexAttribLdvEXT) +#define glVertexArrayVertexAttribLOffsetEXT GLEW_GET_FUN(__glewVertexArrayVertexAttribLOffsetEXT) +#define glVertexAttribL1dEXT GLEW_GET_FUN(__glewVertexAttribL1dEXT) +#define glVertexAttribL1dvEXT GLEW_GET_FUN(__glewVertexAttribL1dvEXT) +#define glVertexAttribL2dEXT GLEW_GET_FUN(__glewVertexAttribL2dEXT) +#define glVertexAttribL2dvEXT GLEW_GET_FUN(__glewVertexAttribL2dvEXT) +#define glVertexAttribL3dEXT GLEW_GET_FUN(__glewVertexAttribL3dEXT) +#define glVertexAttribL3dvEXT GLEW_GET_FUN(__glewVertexAttribL3dvEXT) +#define glVertexAttribL4dEXT GLEW_GET_FUN(__glewVertexAttribL4dEXT) +#define glVertexAttribL4dvEXT GLEW_GET_FUN(__glewVertexAttribL4dvEXT) +#define glVertexAttribLPointerEXT GLEW_GET_FUN(__glewVertexAttribLPointerEXT) + +#define GLEW_EXT_vertex_attrib_64bit GLEW_GET_VAR(__GLEW_EXT_vertex_attrib_64bit) + +#endif /* GL_EXT_vertex_attrib_64bit */ + +/* -------------------------- GL_EXT_vertex_shader ------------------------- */ + +#ifndef GL_EXT_vertex_shader +#define GL_EXT_vertex_shader 1 + +#define GL_VERTEX_SHADER_EXT 0x8780 +#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 +#define GL_OP_INDEX_EXT 0x8782 +#define GL_OP_NEGATE_EXT 0x8783 +#define GL_OP_DOT3_EXT 0x8784 +#define GL_OP_DOT4_EXT 0x8785 +#define GL_OP_MUL_EXT 0x8786 +#define GL_OP_ADD_EXT 0x8787 +#define GL_OP_MADD_EXT 0x8788 +#define GL_OP_FRAC_EXT 0x8789 +#define GL_OP_MAX_EXT 0x878A +#define GL_OP_MIN_EXT 0x878B +#define GL_OP_SET_GE_EXT 0x878C +#define GL_OP_SET_LT_EXT 0x878D +#define GL_OP_CLAMP_EXT 0x878E +#define GL_OP_FLOOR_EXT 0x878F +#define GL_OP_ROUND_EXT 0x8790 +#define GL_OP_EXP_BASE_2_EXT 0x8791 +#define GL_OP_LOG_BASE_2_EXT 0x8792 +#define GL_OP_POWER_EXT 0x8793 +#define GL_OP_RECIP_EXT 0x8794 +#define GL_OP_RECIP_SQRT_EXT 0x8795 +#define GL_OP_SUB_EXT 0x8796 +#define GL_OP_CROSS_PRODUCT_EXT 0x8797 +#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 +#define GL_OP_MOV_EXT 0x8799 +#define GL_OUTPUT_VERTEX_EXT 0x879A +#define GL_OUTPUT_COLOR0_EXT 0x879B +#define GL_OUTPUT_COLOR1_EXT 0x879C +#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D +#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E +#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F +#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 +#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 +#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 +#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 +#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 +#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 +#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 +#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 +#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 +#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 +#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA +#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB +#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC +#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD +#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE +#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF +#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 +#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 +#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 +#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 +#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 +#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 +#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 +#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 +#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 +#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 +#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA +#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB +#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC +#define GL_OUTPUT_FOG_EXT 0x87BD +#define GL_SCALAR_EXT 0x87BE +#define GL_VECTOR_EXT 0x87BF +#define GL_MATRIX_EXT 0x87C0 +#define GL_VARIANT_EXT 0x87C1 +#define GL_INVARIANT_EXT 0x87C2 +#define GL_LOCAL_CONSTANT_EXT 0x87C3 +#define GL_LOCAL_EXT 0x87C4 +#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 +#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 +#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 +#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 +#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CC +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CD +#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE +#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF +#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 +#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 +#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 +#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 +#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 +#define GL_X_EXT 0x87D5 +#define GL_Y_EXT 0x87D6 +#define GL_Z_EXT 0x87D7 +#define GL_W_EXT 0x87D8 +#define GL_NEGATIVE_X_EXT 0x87D9 +#define GL_NEGATIVE_Y_EXT 0x87DA +#define GL_NEGATIVE_Z_EXT 0x87DB +#define GL_NEGATIVE_W_EXT 0x87DC +#define GL_ZERO_EXT 0x87DD +#define GL_ONE_EXT 0x87DE +#define GL_NEGATIVE_ONE_EXT 0x87DF +#define GL_NORMALIZED_RANGE_EXT 0x87E0 +#define GL_FULL_RANGE_EXT 0x87E1 +#define GL_CURRENT_VERTEX_EXT 0x87E2 +#define GL_MVP_MATRIX_EXT 0x87E3 +#define GL_VARIANT_VALUE_EXT 0x87E4 +#define GL_VARIANT_DATATYPE_EXT 0x87E5 +#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 +#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 +#define GL_VARIANT_ARRAY_EXT 0x87E8 +#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 +#define GL_INVARIANT_VALUE_EXT 0x87EA +#define GL_INVARIANT_DATATYPE_EXT 0x87EB +#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC +#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED + +typedef void (GLAPIENTRY * PFNGLBEGINVERTEXSHADEREXTPROC) (void); +typedef GLuint (GLAPIENTRY * PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDPARAMETEREXTPROC) (GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); +typedef GLuint (GLAPIENTRY * PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); +typedef void (GLAPIENTRY * PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLENDVERTEXSHADEREXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLuint (GLAPIENTRY * PFNGLGENSYMBOLSEXTPROC) (GLenum dataType, GLenum storageType, GLenum range, GLuint components); +typedef GLuint (GLAPIENTRY * PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); +typedef void (GLAPIENTRY * PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid **data); +typedef void (GLAPIENTRY * PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); +typedef GLboolean (GLAPIENTRY * PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); +typedef void (GLAPIENTRY * PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); +typedef void (GLAPIENTRY * PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); +typedef void (GLAPIENTRY * PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); +typedef void (GLAPIENTRY * PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); +typedef void (GLAPIENTRY * PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, GLvoid *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTBVEXTPROC) (GLuint id, GLbyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTDVEXTPROC) (GLuint id, GLdouble *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTFVEXTPROC) (GLuint id, GLfloat *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTIVEXTPROC) (GLuint id, GLint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTSVEXTPROC) (GLuint id, GLshort *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUBVEXTPROC) (GLuint id, GLubyte *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUIVEXTPROC) (GLuint id, GLuint *addr); +typedef void (GLAPIENTRY * PFNGLVARIANTUSVEXTPROC) (GLuint id, GLushort *addr); +typedef void (GLAPIENTRY * PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); + +#define glBeginVertexShaderEXT GLEW_GET_FUN(__glewBeginVertexShaderEXT) +#define glBindLightParameterEXT GLEW_GET_FUN(__glewBindLightParameterEXT) +#define glBindMaterialParameterEXT GLEW_GET_FUN(__glewBindMaterialParameterEXT) +#define glBindParameterEXT GLEW_GET_FUN(__glewBindParameterEXT) +#define glBindTexGenParameterEXT GLEW_GET_FUN(__glewBindTexGenParameterEXT) +#define glBindTextureUnitParameterEXT GLEW_GET_FUN(__glewBindTextureUnitParameterEXT) +#define glBindVertexShaderEXT GLEW_GET_FUN(__glewBindVertexShaderEXT) +#define glDeleteVertexShaderEXT GLEW_GET_FUN(__glewDeleteVertexShaderEXT) +#define glDisableVariantClientStateEXT GLEW_GET_FUN(__glewDisableVariantClientStateEXT) +#define glEnableVariantClientStateEXT GLEW_GET_FUN(__glewEnableVariantClientStateEXT) +#define glEndVertexShaderEXT GLEW_GET_FUN(__glewEndVertexShaderEXT) +#define glExtractComponentEXT GLEW_GET_FUN(__glewExtractComponentEXT) +#define glGenSymbolsEXT GLEW_GET_FUN(__glewGenSymbolsEXT) +#define glGenVertexShadersEXT GLEW_GET_FUN(__glewGenVertexShadersEXT) +#define glGetInvariantBooleanvEXT GLEW_GET_FUN(__glewGetInvariantBooleanvEXT) +#define glGetInvariantFloatvEXT GLEW_GET_FUN(__glewGetInvariantFloatvEXT) +#define glGetInvariantIntegervEXT GLEW_GET_FUN(__glewGetInvariantIntegervEXT) +#define glGetLocalConstantBooleanvEXT GLEW_GET_FUN(__glewGetLocalConstantBooleanvEXT) +#define glGetLocalConstantFloatvEXT GLEW_GET_FUN(__glewGetLocalConstantFloatvEXT) +#define glGetLocalConstantIntegervEXT GLEW_GET_FUN(__glewGetLocalConstantIntegervEXT) +#define glGetVariantBooleanvEXT GLEW_GET_FUN(__glewGetVariantBooleanvEXT) +#define glGetVariantFloatvEXT GLEW_GET_FUN(__glewGetVariantFloatvEXT) +#define glGetVariantIntegervEXT GLEW_GET_FUN(__glewGetVariantIntegervEXT) +#define glGetVariantPointervEXT GLEW_GET_FUN(__glewGetVariantPointervEXT) +#define glInsertComponentEXT GLEW_GET_FUN(__glewInsertComponentEXT) +#define glIsVariantEnabledEXT GLEW_GET_FUN(__glewIsVariantEnabledEXT) +#define glSetInvariantEXT GLEW_GET_FUN(__glewSetInvariantEXT) +#define glSetLocalConstantEXT GLEW_GET_FUN(__glewSetLocalConstantEXT) +#define glShaderOp1EXT GLEW_GET_FUN(__glewShaderOp1EXT) +#define glShaderOp2EXT GLEW_GET_FUN(__glewShaderOp2EXT) +#define glShaderOp3EXT GLEW_GET_FUN(__glewShaderOp3EXT) +#define glSwizzleEXT GLEW_GET_FUN(__glewSwizzleEXT) +#define glVariantPointerEXT GLEW_GET_FUN(__glewVariantPointerEXT) +#define glVariantbvEXT GLEW_GET_FUN(__glewVariantbvEXT) +#define glVariantdvEXT GLEW_GET_FUN(__glewVariantdvEXT) +#define glVariantfvEXT GLEW_GET_FUN(__glewVariantfvEXT) +#define glVariantivEXT GLEW_GET_FUN(__glewVariantivEXT) +#define glVariantsvEXT GLEW_GET_FUN(__glewVariantsvEXT) +#define glVariantubvEXT GLEW_GET_FUN(__glewVariantubvEXT) +#define glVariantuivEXT GLEW_GET_FUN(__glewVariantuivEXT) +#define glVariantusvEXT GLEW_GET_FUN(__glewVariantusvEXT) +#define glWriteMaskEXT GLEW_GET_FUN(__glewWriteMaskEXT) + +#define GLEW_EXT_vertex_shader GLEW_GET_VAR(__GLEW_EXT_vertex_shader) + +#endif /* GL_EXT_vertex_shader */ + +/* ------------------------ GL_EXT_vertex_weighting ------------------------ */ + +#ifndef GL_EXT_vertex_weighting +#define GL_EXT_vertex_weighting 1 + +#define GL_MODELVIEW0_STACK_DEPTH_EXT 0x0BA3 +#define GL_MODELVIEW0_MATRIX_EXT 0x0BA6 +#define GL_MODELVIEW0_EXT 0x1700 +#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 +#define GL_MODELVIEW1_MATRIX_EXT 0x8506 +#define GL_VERTEX_WEIGHTING_EXT 0x8509 +#define GL_MODELVIEW1_EXT 0x850A +#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B +#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C +#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D +#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E +#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F +#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 + +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTFVEXTPROC) (GLfloat* weight); + +#define glVertexWeightPointerEXT GLEW_GET_FUN(__glewVertexWeightPointerEXT) +#define glVertexWeightfEXT GLEW_GET_FUN(__glewVertexWeightfEXT) +#define glVertexWeightfvEXT GLEW_GET_FUN(__glewVertexWeightfvEXT) + +#define GLEW_EXT_vertex_weighting GLEW_GET_VAR(__GLEW_EXT_vertex_weighting) + +#endif /* GL_EXT_vertex_weighting */ + +/* ---------------------- GL_GREMEDY_frame_terminator ---------------------- */ + +#ifndef GL_GREMEDY_frame_terminator +#define GL_GREMEDY_frame_terminator 1 + +typedef void (GLAPIENTRY * PFNGLFRAMETERMINATORGREMEDYPROC) (void); + +#define glFrameTerminatorGREMEDY GLEW_GET_FUN(__glewFrameTerminatorGREMEDY) + +#define GLEW_GREMEDY_frame_terminator GLEW_GET_VAR(__GLEW_GREMEDY_frame_terminator) + +#endif /* GL_GREMEDY_frame_terminator */ + +/* ------------------------ GL_GREMEDY_string_marker ----------------------- */ + +#ifndef GL_GREMEDY_string_marker +#define GL_GREMEDY_string_marker 1 + +typedef void (GLAPIENTRY * PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const void* string); + +#define glStringMarkerGREMEDY GLEW_GET_FUN(__glewStringMarkerGREMEDY) + +#define GLEW_GREMEDY_string_marker GLEW_GET_VAR(__GLEW_GREMEDY_string_marker) + +#endif /* GL_GREMEDY_string_marker */ + +/* --------------------- GL_HP_convolution_border_modes -------------------- */ + +#ifndef GL_HP_convolution_border_modes +#define GL_HP_convolution_border_modes 1 + +#define GLEW_HP_convolution_border_modes GLEW_GET_VAR(__GLEW_HP_convolution_border_modes) + +#endif /* GL_HP_convolution_border_modes */ + +/* ------------------------- GL_HP_image_transform ------------------------- */ + +#ifndef GL_HP_image_transform +#define GL_HP_image_transform 1 + +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glGetImageTransformParameterfvHP GLEW_GET_FUN(__glewGetImageTransformParameterfvHP) +#define glGetImageTransformParameterivHP GLEW_GET_FUN(__glewGetImageTransformParameterivHP) +#define glImageTransformParameterfHP GLEW_GET_FUN(__glewImageTransformParameterfHP) +#define glImageTransformParameterfvHP GLEW_GET_FUN(__glewImageTransformParameterfvHP) +#define glImageTransformParameteriHP GLEW_GET_FUN(__glewImageTransformParameteriHP) +#define glImageTransformParameterivHP GLEW_GET_FUN(__glewImageTransformParameterivHP) + +#define GLEW_HP_image_transform GLEW_GET_VAR(__GLEW_HP_image_transform) + +#endif /* GL_HP_image_transform */ + +/* -------------------------- GL_HP_occlusion_test ------------------------- */ + +#ifndef GL_HP_occlusion_test +#define GL_HP_occlusion_test 1 + +#define GL_OCCLUSION_TEST_HP 0x8165 +#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 + +#define GLEW_HP_occlusion_test GLEW_GET_VAR(__GLEW_HP_occlusion_test) + +#endif /* GL_HP_occlusion_test */ + +/* ------------------------- GL_HP_texture_lighting ------------------------ */ + +#ifndef GL_HP_texture_lighting +#define GL_HP_texture_lighting 1 + +#define GLEW_HP_texture_lighting GLEW_GET_VAR(__GLEW_HP_texture_lighting) + +#endif /* GL_HP_texture_lighting */ + +/* --------------------------- GL_IBM_cull_vertex -------------------------- */ + +#ifndef GL_IBM_cull_vertex +#define GL_IBM_cull_vertex 1 + +#define GL_CULL_VERTEX_IBM 103050 + +#define GLEW_IBM_cull_vertex GLEW_GET_VAR(__GLEW_IBM_cull_vertex) + +#endif /* GL_IBM_cull_vertex */ + +/* ---------------------- GL_IBM_multimode_draw_arrays --------------------- */ + +#ifndef GL_IBM_multimode_draw_arrays +#define GL_IBM_multimode_draw_arrays 1 + +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum* mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); +typedef void (GLAPIENTRY * PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum* mode, const GLsizei *count, GLenum type, const GLvoid * const *indices, GLsizei primcount, GLint modestride); + +#define glMultiModeDrawArraysIBM GLEW_GET_FUN(__glewMultiModeDrawArraysIBM) +#define glMultiModeDrawElementsIBM GLEW_GET_FUN(__glewMultiModeDrawElementsIBM) + +#define GLEW_IBM_multimode_draw_arrays GLEW_GET_VAR(__GLEW_IBM_multimode_draw_arrays) + +#endif /* GL_IBM_multimode_draw_arrays */ + +/* ------------------------- GL_IBM_rasterpos_clip ------------------------- */ + +#ifndef GL_IBM_rasterpos_clip +#define GL_IBM_rasterpos_clip 1 + +#define GL_RASTER_POSITION_UNCLIPPED_IBM 103010 + +#define GLEW_IBM_rasterpos_clip GLEW_GET_VAR(__GLEW_IBM_rasterpos_clip) + +#endif /* GL_IBM_rasterpos_clip */ + +/* --------------------------- GL_IBM_static_data -------------------------- */ + +#ifndef GL_IBM_static_data +#define GL_IBM_static_data 1 + +#define GL_ALL_STATIC_DATA_IBM 103060 +#define GL_STATIC_VERTEX_ARRAY_IBM 103061 + +#define GLEW_IBM_static_data GLEW_GET_VAR(__GLEW_IBM_static_data) + +#endif /* GL_IBM_static_data */ + +/* --------------------- GL_IBM_texture_mirrored_repeat -------------------- */ + +#ifndef GL_IBM_texture_mirrored_repeat +#define GL_IBM_texture_mirrored_repeat 1 + +#define GL_MIRRORED_REPEAT_IBM 0x8370 + +#define GLEW_IBM_texture_mirrored_repeat GLEW_GET_VAR(__GLEW_IBM_texture_mirrored_repeat) + +#endif /* GL_IBM_texture_mirrored_repeat */ + +/* ----------------------- GL_IBM_vertex_array_lists ----------------------- */ + +#ifndef GL_IBM_vertex_array_lists +#define GL_IBM_vertex_array_lists 1 + +#define GL_VERTEX_ARRAY_LIST_IBM 103070 +#define GL_NORMAL_ARRAY_LIST_IBM 103071 +#define GL_COLOR_ARRAY_LIST_IBM 103072 +#define GL_INDEX_ARRAY_LIST_IBM 103073 +#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 +#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 +#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 +#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 +#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 +#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 +#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 +#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 +#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 +#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 +#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 +#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid ** pointer, GLint ptrstride); + +#define glColorPointerListIBM GLEW_GET_FUN(__glewColorPointerListIBM) +#define glEdgeFlagPointerListIBM GLEW_GET_FUN(__glewEdgeFlagPointerListIBM) +#define glFogCoordPointerListIBM GLEW_GET_FUN(__glewFogCoordPointerListIBM) +#define glIndexPointerListIBM GLEW_GET_FUN(__glewIndexPointerListIBM) +#define glNormalPointerListIBM GLEW_GET_FUN(__glewNormalPointerListIBM) +#define glSecondaryColorPointerListIBM GLEW_GET_FUN(__glewSecondaryColorPointerListIBM) +#define glTexCoordPointerListIBM GLEW_GET_FUN(__glewTexCoordPointerListIBM) +#define glVertexPointerListIBM GLEW_GET_FUN(__glewVertexPointerListIBM) + +#define GLEW_IBM_vertex_array_lists GLEW_GET_VAR(__GLEW_IBM_vertex_array_lists) + +#endif /* GL_IBM_vertex_array_lists */ + +/* -------------------------- GL_INGR_color_clamp -------------------------- */ + +#ifndef GL_INGR_color_clamp +#define GL_INGR_color_clamp 1 + +#define GL_RED_MIN_CLAMP_INGR 0x8560 +#define GL_GREEN_MIN_CLAMP_INGR 0x8561 +#define GL_BLUE_MIN_CLAMP_INGR 0x8562 +#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 +#define GL_RED_MAX_CLAMP_INGR 0x8564 +#define GL_GREEN_MAX_CLAMP_INGR 0x8565 +#define GL_BLUE_MAX_CLAMP_INGR 0x8566 +#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 + +#define GLEW_INGR_color_clamp GLEW_GET_VAR(__GLEW_INGR_color_clamp) + +#endif /* GL_INGR_color_clamp */ + +/* ------------------------- GL_INGR_interlace_read ------------------------ */ + +#ifndef GL_INGR_interlace_read +#define GL_INGR_interlace_read 1 + +#define GL_INTERLACE_READ_INGR 0x8568 + +#define GLEW_INGR_interlace_read GLEW_GET_VAR(__GLEW_INGR_interlace_read) + +#endif /* GL_INGR_interlace_read */ + +/* ------------------------ GL_INTEL_parallel_arrays ----------------------- */ + +#ifndef GL_INTEL_parallel_arrays +#define GL_INTEL_parallel_arrays 1 + +#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 +#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 +#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 +#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 +#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 + +typedef void (GLAPIENTRY * PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const void** pointer); + +#define glColorPointervINTEL GLEW_GET_FUN(__glewColorPointervINTEL) +#define glNormalPointervINTEL GLEW_GET_FUN(__glewNormalPointervINTEL) +#define glTexCoordPointervINTEL GLEW_GET_FUN(__glewTexCoordPointervINTEL) +#define glVertexPointervINTEL GLEW_GET_FUN(__glewVertexPointervINTEL) + +#define GLEW_INTEL_parallel_arrays GLEW_GET_VAR(__GLEW_INTEL_parallel_arrays) + +#endif /* GL_INTEL_parallel_arrays */ + +/* ------------------------ GL_INTEL_texture_scissor ----------------------- */ + +#ifndef GL_INTEL_texture_scissor +#define GL_INTEL_texture_scissor 1 + +typedef void (GLAPIENTRY * PFNGLTEXSCISSORFUNCINTELPROC) (GLenum target, GLenum lfunc, GLenum hfunc); +typedef void (GLAPIENTRY * PFNGLTEXSCISSORINTELPROC) (GLenum target, GLclampf tlow, GLclampf thigh); + +#define glTexScissorFuncINTEL GLEW_GET_FUN(__glewTexScissorFuncINTEL) +#define glTexScissorINTEL GLEW_GET_FUN(__glewTexScissorINTEL) + +#define GLEW_INTEL_texture_scissor GLEW_GET_VAR(__GLEW_INTEL_texture_scissor) + +#endif /* GL_INTEL_texture_scissor */ + +/* -------------------------- GL_KTX_buffer_region ------------------------- */ + +#ifndef GL_KTX_buffer_region +#define GL_KTX_buffer_region 1 + +#define GL_KTX_FRONT_REGION 0x0 +#define GL_KTX_BACK_REGION 0x1 +#define GL_KTX_Z_REGION 0x2 +#define GL_KTX_STENCIL_REGION 0x3 + +typedef GLuint (GLAPIENTRY * PFNGLBUFFERREGIONENABLEDEXTPROC) (void); +typedef void (GLAPIENTRY * PFNGLDELETEBUFFERREGIONEXTPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLDRAWBUFFERREGIONEXTPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height, GLint xDest, GLint yDest); +typedef GLuint (GLAPIENTRY * PFNGLNEWBUFFERREGIONEXTPROC) (GLenum region); +typedef void (GLAPIENTRY * PFNGLREADBUFFERREGIONEXTPROC) (GLuint region, GLint x, GLint y, GLsizei width, GLsizei height); + +#define glBufferRegionEnabledEXT GLEW_GET_FUN(__glewBufferRegionEnabledEXT) +#define glDeleteBufferRegionEXT GLEW_GET_FUN(__glewDeleteBufferRegionEXT) +#define glDrawBufferRegionEXT GLEW_GET_FUN(__glewDrawBufferRegionEXT) +#define glNewBufferRegionEXT GLEW_GET_FUN(__glewNewBufferRegionEXT) +#define glReadBufferRegionEXT GLEW_GET_FUN(__glewReadBufferRegionEXT) + +#define GLEW_KTX_buffer_region GLEW_GET_VAR(__GLEW_KTX_buffer_region) + +#endif /* GL_KTX_buffer_region */ + +/* ------------------------- GL_MESAX_texture_stack ------------------------ */ + +#ifndef GL_MESAX_texture_stack +#define GL_MESAX_texture_stack 1 + +#define GL_TEXTURE_1D_STACK_MESAX 0x8759 +#define GL_TEXTURE_2D_STACK_MESAX 0x875A +#define GL_PROXY_TEXTURE_1D_STACK_MESAX 0x875B +#define GL_PROXY_TEXTURE_2D_STACK_MESAX 0x875C +#define GL_TEXTURE_1D_STACK_BINDING_MESAX 0x875D +#define GL_TEXTURE_2D_STACK_BINDING_MESAX 0x875E + +#define GLEW_MESAX_texture_stack GLEW_GET_VAR(__GLEW_MESAX_texture_stack) + +#endif /* GL_MESAX_texture_stack */ + +/* -------------------------- GL_MESA_pack_invert -------------------------- */ + +#ifndef GL_MESA_pack_invert +#define GL_MESA_pack_invert 1 + +#define GL_PACK_INVERT_MESA 0x8758 + +#define GLEW_MESA_pack_invert GLEW_GET_VAR(__GLEW_MESA_pack_invert) + +#endif /* GL_MESA_pack_invert */ + +/* ------------------------- GL_MESA_resize_buffers ------------------------ */ + +#ifndef GL_MESA_resize_buffers +#define GL_MESA_resize_buffers 1 + +typedef void (GLAPIENTRY * PFNGLRESIZEBUFFERSMESAPROC) (void); + +#define glResizeBuffersMESA GLEW_GET_FUN(__glewResizeBuffersMESA) + +#define GLEW_MESA_resize_buffers GLEW_GET_VAR(__GLEW_MESA_resize_buffers) + +#endif /* GL_MESA_resize_buffers */ + +/* --------------------------- GL_MESA_window_pos -------------------------- */ + +#ifndef GL_MESA_window_pos +#define GL_MESA_window_pos 1 + +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS2SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS3SVMESAPROC) (const GLshort* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4IVMESAPROC) (const GLint* p); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLWINDOWPOS4SVMESAPROC) (const GLshort* p); + +#define glWindowPos2dMESA GLEW_GET_FUN(__glewWindowPos2dMESA) +#define glWindowPos2dvMESA GLEW_GET_FUN(__glewWindowPos2dvMESA) +#define glWindowPos2fMESA GLEW_GET_FUN(__glewWindowPos2fMESA) +#define glWindowPos2fvMESA GLEW_GET_FUN(__glewWindowPos2fvMESA) +#define glWindowPos2iMESA GLEW_GET_FUN(__glewWindowPos2iMESA) +#define glWindowPos2ivMESA GLEW_GET_FUN(__glewWindowPos2ivMESA) +#define glWindowPos2sMESA GLEW_GET_FUN(__glewWindowPos2sMESA) +#define glWindowPos2svMESA GLEW_GET_FUN(__glewWindowPos2svMESA) +#define glWindowPos3dMESA GLEW_GET_FUN(__glewWindowPos3dMESA) +#define glWindowPos3dvMESA GLEW_GET_FUN(__glewWindowPos3dvMESA) +#define glWindowPos3fMESA GLEW_GET_FUN(__glewWindowPos3fMESA) +#define glWindowPos3fvMESA GLEW_GET_FUN(__glewWindowPos3fvMESA) +#define glWindowPos3iMESA GLEW_GET_FUN(__glewWindowPos3iMESA) +#define glWindowPos3ivMESA GLEW_GET_FUN(__glewWindowPos3ivMESA) +#define glWindowPos3sMESA GLEW_GET_FUN(__glewWindowPos3sMESA) +#define glWindowPos3svMESA GLEW_GET_FUN(__glewWindowPos3svMESA) +#define glWindowPos4dMESA GLEW_GET_FUN(__glewWindowPos4dMESA) +#define glWindowPos4dvMESA GLEW_GET_FUN(__glewWindowPos4dvMESA) +#define glWindowPos4fMESA GLEW_GET_FUN(__glewWindowPos4fMESA) +#define glWindowPos4fvMESA GLEW_GET_FUN(__glewWindowPos4fvMESA) +#define glWindowPos4iMESA GLEW_GET_FUN(__glewWindowPos4iMESA) +#define glWindowPos4ivMESA GLEW_GET_FUN(__glewWindowPos4ivMESA) +#define glWindowPos4sMESA GLEW_GET_FUN(__glewWindowPos4sMESA) +#define glWindowPos4svMESA GLEW_GET_FUN(__glewWindowPos4svMESA) + +#define GLEW_MESA_window_pos GLEW_GET_VAR(__GLEW_MESA_window_pos) + +#endif /* GL_MESA_window_pos */ + +/* ------------------------- GL_MESA_ycbcr_texture ------------------------- */ + +#ifndef GL_MESA_ycbcr_texture +#define GL_MESA_ycbcr_texture 1 + +#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA +#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB +#define GL_YCBCR_MESA 0x8757 + +#define GLEW_MESA_ycbcr_texture GLEW_GET_VAR(__GLEW_MESA_ycbcr_texture) + +#endif /* GL_MESA_ycbcr_texture */ + +/* ------------------------- GL_NVX_gpu_memory_info ------------------------ */ + +#ifndef GL_NVX_gpu_memory_info +#define GL_NVX_gpu_memory_info 1 + +#define GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX 0x9047 +#define GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX 0x9048 +#define GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX 0x9049 +#define GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX 0x904A +#define GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX 0x904B + +#define GLEW_NVX_gpu_memory_info GLEW_GET_VAR(__GLEW_NVX_gpu_memory_info) + +#endif /* GL_NVX_gpu_memory_info */ + +/* --------------------------- GL_NV_blend_square -------------------------- */ + +#ifndef GL_NV_blend_square +#define GL_NV_blend_square 1 + +#define GLEW_NV_blend_square GLEW_GET_VAR(__GLEW_NV_blend_square) + +#endif /* GL_NV_blend_square */ + +/* ------------------------ GL_NV_conditional_render ----------------------- */ + +#ifndef GL_NV_conditional_render +#define GL_NV_conditional_render 1 + +#define GL_QUERY_WAIT_NV 0x8E13 +#define GL_QUERY_NO_WAIT_NV 0x8E14 +#define GL_QUERY_BY_REGION_WAIT_NV 0x8E15 +#define GL_QUERY_BY_REGION_NO_WAIT_NV 0x8E16 + +typedef void (GLAPIENTRY * PFNGLBEGINCONDITIONALRENDERNVPROC) (GLuint id, GLenum mode); +typedef void (GLAPIENTRY * PFNGLENDCONDITIONALRENDERNVPROC) (void); + +#define glBeginConditionalRenderNV GLEW_GET_FUN(__glewBeginConditionalRenderNV) +#define glEndConditionalRenderNV GLEW_GET_FUN(__glewEndConditionalRenderNV) + +#define GLEW_NV_conditional_render GLEW_GET_VAR(__GLEW_NV_conditional_render) + +#endif /* GL_NV_conditional_render */ + +/* ----------------------- GL_NV_copy_depth_to_color ----------------------- */ + +#ifndef GL_NV_copy_depth_to_color +#define GL_NV_copy_depth_to_color 1 + +#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E +#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F + +#define GLEW_NV_copy_depth_to_color GLEW_GET_VAR(__GLEW_NV_copy_depth_to_color) + +#endif /* GL_NV_copy_depth_to_color */ + +/* ---------------------------- GL_NV_copy_image --------------------------- */ + +#ifndef GL_NV_copy_image +#define GL_NV_copy_image 1 + +typedef void (GLAPIENTRY * PFNGLCOPYIMAGESUBDATANVPROC) (GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glCopyImageSubDataNV GLEW_GET_FUN(__glewCopyImageSubDataNV) + +#define GLEW_NV_copy_image GLEW_GET_VAR(__GLEW_NV_copy_image) + +#endif /* GL_NV_copy_image */ + +/* ------------------------ GL_NV_depth_buffer_float ----------------------- */ + +#ifndef GL_NV_depth_buffer_float +#define GL_NV_depth_buffer_float 1 + +#define GL_DEPTH_COMPONENT32F_NV 0x8DAB +#define GL_DEPTH32F_STENCIL8_NV 0x8DAC +#define GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV 0x8DAD +#define GL_DEPTH_BUFFER_FLOAT_MODE_NV 0x8DAF + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHDNVPROC) (GLdouble depth); +typedef void (GLAPIENTRY * PFNGLDEPTHBOUNDSDNVPROC) (GLdouble zmin, GLdouble zmax); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEDNVPROC) (GLdouble zNear, GLdouble zFar); + +#define glClearDepthdNV GLEW_GET_FUN(__glewClearDepthdNV) +#define glDepthBoundsdNV GLEW_GET_FUN(__glewDepthBoundsdNV) +#define glDepthRangedNV GLEW_GET_FUN(__glewDepthRangedNV) + +#define GLEW_NV_depth_buffer_float GLEW_GET_VAR(__GLEW_NV_depth_buffer_float) + +#endif /* GL_NV_depth_buffer_float */ + +/* --------------------------- GL_NV_depth_clamp --------------------------- */ + +#ifndef GL_NV_depth_clamp +#define GL_NV_depth_clamp 1 + +#define GL_DEPTH_CLAMP_NV 0x864F + +#define GLEW_NV_depth_clamp GLEW_GET_VAR(__GLEW_NV_depth_clamp) + +#endif /* GL_NV_depth_clamp */ + +/* ---------------------- GL_NV_depth_range_unclamped ---------------------- */ + +#ifndef GL_NV_depth_range_unclamped +#define GL_NV_depth_range_unclamped 1 + +#define GL_SAMPLE_COUNT_BITS_NV 0x8864 +#define GL_CURRENT_SAMPLE_COUNT_QUERY_NV 0x8865 +#define GL_QUERY_RESULT_NV 0x8866 +#define GL_QUERY_RESULT_AVAILABLE_NV 0x8867 +#define GL_SAMPLE_COUNT_NV 0x8914 + +#define GLEW_NV_depth_range_unclamped GLEW_GET_VAR(__GLEW_NV_depth_range_unclamped) + +#endif /* GL_NV_depth_range_unclamped */ + +/* ---------------------------- GL_NV_evaluators --------------------------- */ + +#ifndef GL_NV_evaluators +#define GL_NV_evaluators 1 + +#define GL_EVAL_2D_NV 0x86C0 +#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 +#define GL_MAP_TESSELLATION_NV 0x86C2 +#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 +#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 +#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 +#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 +#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 +#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 +#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 +#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA +#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB +#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC +#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD +#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE +#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF +#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 +#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 +#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 +#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 +#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 +#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 +#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 +#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 + +typedef void (GLAPIENTRY * PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, void* points); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const void* points); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint* params); + +#define glEvalMapsNV GLEW_GET_FUN(__glewEvalMapsNV) +#define glGetMapAttribParameterfvNV GLEW_GET_FUN(__glewGetMapAttribParameterfvNV) +#define glGetMapAttribParameterivNV GLEW_GET_FUN(__glewGetMapAttribParameterivNV) +#define glGetMapControlPointsNV GLEW_GET_FUN(__glewGetMapControlPointsNV) +#define glGetMapParameterfvNV GLEW_GET_FUN(__glewGetMapParameterfvNV) +#define glGetMapParameterivNV GLEW_GET_FUN(__glewGetMapParameterivNV) +#define glMapControlPointsNV GLEW_GET_FUN(__glewMapControlPointsNV) +#define glMapParameterfvNV GLEW_GET_FUN(__glewMapParameterfvNV) +#define glMapParameterivNV GLEW_GET_FUN(__glewMapParameterivNV) + +#define GLEW_NV_evaluators GLEW_GET_VAR(__GLEW_NV_evaluators) + +#endif /* GL_NV_evaluators */ + +/* ----------------------- GL_NV_explicit_multisample ---------------------- */ + +#ifndef GL_NV_explicit_multisample +#define GL_NV_explicit_multisample 1 + +#define GL_SAMPLE_POSITION_NV 0x8E50 +#define GL_SAMPLE_MASK_NV 0x8E51 +#define GL_SAMPLE_MASK_VALUE_NV 0x8E52 +#define GL_TEXTURE_BINDING_RENDERBUFFER_NV 0x8E53 +#define GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV 0x8E54 +#define GL_TEXTURE_RENDERBUFFER_NV 0x8E55 +#define GL_SAMPLER_RENDERBUFFER_NV 0x8E56 +#define GL_INT_SAMPLER_RENDERBUFFER_NV 0x8E57 +#define GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV 0x8E58 +#define GL_MAX_SAMPLE_MASK_WORDS_NV 0x8E59 + +typedef void (GLAPIENTRY * PFNGLGETMULTISAMPLEFVNVPROC) (GLenum pname, GLuint index, GLfloat* val); +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKINDEXEDNVPROC) (GLuint index, GLbitfield mask); +typedef void (GLAPIENTRY * PFNGLTEXRENDERBUFFERNVPROC) (GLenum target, GLuint renderbuffer); + +#define glGetMultisamplefvNV GLEW_GET_FUN(__glewGetMultisamplefvNV) +#define glSampleMaskIndexedNV GLEW_GET_FUN(__glewSampleMaskIndexedNV) +#define glTexRenderbufferNV GLEW_GET_FUN(__glewTexRenderbufferNV) + +#define GLEW_NV_explicit_multisample GLEW_GET_VAR(__GLEW_NV_explicit_multisample) + +#endif /* GL_NV_explicit_multisample */ + +/* ------------------------------ GL_NV_fence ------------------------------ */ + +#ifndef GL_NV_fence +#define GL_NV_fence 1 + +#define GL_ALL_COMPLETED_NV 0x84F2 +#define GL_FENCE_STATUS_NV 0x84F3 +#define GL_FENCE_CONDITION_NV 0x84F4 + +typedef void (GLAPIENTRY * PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint* fences); +typedef void (GLAPIENTRY * PFNGLFINISHFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLGENFENCESNVPROC) (GLsizei n, GLuint* fences); +typedef void (GLAPIENTRY * PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISFENCENVPROC) (GLuint fence); +typedef void (GLAPIENTRY * PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); +typedef GLboolean (GLAPIENTRY * PFNGLTESTFENCENVPROC) (GLuint fence); + +#define glDeleteFencesNV GLEW_GET_FUN(__glewDeleteFencesNV) +#define glFinishFenceNV GLEW_GET_FUN(__glewFinishFenceNV) +#define glGenFencesNV GLEW_GET_FUN(__glewGenFencesNV) +#define glGetFenceivNV GLEW_GET_FUN(__glewGetFenceivNV) +#define glIsFenceNV GLEW_GET_FUN(__glewIsFenceNV) +#define glSetFenceNV GLEW_GET_FUN(__glewSetFenceNV) +#define glTestFenceNV GLEW_GET_FUN(__glewTestFenceNV) + +#define GLEW_NV_fence GLEW_GET_VAR(__GLEW_NV_fence) + +#endif /* GL_NV_fence */ + +/* --------------------------- GL_NV_float_buffer -------------------------- */ + +#ifndef GL_NV_float_buffer +#define GL_NV_float_buffer 1 + +#define GL_FLOAT_R_NV 0x8880 +#define GL_FLOAT_RG_NV 0x8881 +#define GL_FLOAT_RGB_NV 0x8882 +#define GL_FLOAT_RGBA_NV 0x8883 +#define GL_FLOAT_R16_NV 0x8884 +#define GL_FLOAT_R32_NV 0x8885 +#define GL_FLOAT_RG16_NV 0x8886 +#define GL_FLOAT_RG32_NV 0x8887 +#define GL_FLOAT_RGB16_NV 0x8888 +#define GL_FLOAT_RGB32_NV 0x8889 +#define GL_FLOAT_RGBA16_NV 0x888A +#define GL_FLOAT_RGBA32_NV 0x888B +#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C +#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D +#define GL_FLOAT_RGBA_MODE_NV 0x888E + +#define GLEW_NV_float_buffer GLEW_GET_VAR(__GLEW_NV_float_buffer) + +#endif /* GL_NV_float_buffer */ + +/* --------------------------- GL_NV_fog_distance -------------------------- */ + +#ifndef GL_NV_fog_distance +#define GL_NV_fog_distance 1 + +#define GL_FOG_DISTANCE_MODE_NV 0x855A +#define GL_EYE_RADIAL_NV 0x855B +#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C + +#define GLEW_NV_fog_distance GLEW_GET_VAR(__GLEW_NV_fog_distance) + +#endif /* GL_NV_fog_distance */ + +/* ------------------------- GL_NV_fragment_program ------------------------ */ + +#ifndef GL_NV_fragment_program +#define GL_NV_fragment_program 1 + +#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 +#define GL_FRAGMENT_PROGRAM_NV 0x8870 +#define GL_MAX_TEXTURE_COORDS_NV 0x8871 +#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 +#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 +#define GL_PROGRAM_ERROR_STRING_NV 0x8874 + +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble *params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLdouble v[]); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte* name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte* name, const GLfloat v[]); + +#define glGetProgramNamedParameterdvNV GLEW_GET_FUN(__glewGetProgramNamedParameterdvNV) +#define glGetProgramNamedParameterfvNV GLEW_GET_FUN(__glewGetProgramNamedParameterfvNV) +#define glProgramNamedParameter4dNV GLEW_GET_FUN(__glewProgramNamedParameter4dNV) +#define glProgramNamedParameter4dvNV GLEW_GET_FUN(__glewProgramNamedParameter4dvNV) +#define glProgramNamedParameter4fNV GLEW_GET_FUN(__glewProgramNamedParameter4fNV) +#define glProgramNamedParameter4fvNV GLEW_GET_FUN(__glewProgramNamedParameter4fvNV) + +#define GLEW_NV_fragment_program GLEW_GET_VAR(__GLEW_NV_fragment_program) + +#endif /* GL_NV_fragment_program */ + +/* ------------------------ GL_NV_fragment_program2 ------------------------ */ + +#ifndef GL_NV_fragment_program2 +#define GL_NV_fragment_program2 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 +#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 +#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 +#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 + +#define GLEW_NV_fragment_program2 GLEW_GET_VAR(__GLEW_NV_fragment_program2) + +#endif /* GL_NV_fragment_program2 */ + +/* ------------------------ GL_NV_fragment_program4 ------------------------ */ + +#ifndef GL_NV_fragment_program4 +#define GL_NV_fragment_program4 1 + +#define GLEW_NV_fragment_program4 GLEW_GET_VAR(__GLEW_NV_fragment_program4) + +#endif /* GL_NV_fragment_program4 */ + +/* --------------------- GL_NV_fragment_program_option --------------------- */ + +#ifndef GL_NV_fragment_program_option +#define GL_NV_fragment_program_option 1 + +#define GLEW_NV_fragment_program_option GLEW_GET_VAR(__GLEW_NV_fragment_program_option) + +#endif /* GL_NV_fragment_program_option */ + +/* ----------------- GL_NV_framebuffer_multisample_coverage ---------------- */ + +#ifndef GL_NV_framebuffer_multisample_coverage +#define GL_NV_framebuffer_multisample_coverage 1 + +#define GL_RENDERBUFFER_COVERAGE_SAMPLES_NV 0x8CAB +#define GL_RENDERBUFFER_COLOR_SAMPLES_NV 0x8E10 +#define GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV 0x8E11 +#define GL_MULTISAMPLE_COVERAGE_MODES_NV 0x8E12 + +typedef void (GLAPIENTRY * PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC) (GLenum target, GLsizei coverageSamples, GLsizei colorSamples, GLenum internalformat, GLsizei width, GLsizei height); + +#define glRenderbufferStorageMultisampleCoverageNV GLEW_GET_FUN(__glewRenderbufferStorageMultisampleCoverageNV) + +#define GLEW_NV_framebuffer_multisample_coverage GLEW_GET_VAR(__GLEW_NV_framebuffer_multisample_coverage) + +#endif /* GL_NV_framebuffer_multisample_coverage */ + +/* ------------------------ GL_NV_geometry_program4 ------------------------ */ + +#ifndef GL_NV_geometry_program4 +#define GL_NV_geometry_program4 1 + +#define GL_GEOMETRY_PROGRAM_NV 0x8C26 +#define GL_MAX_PROGRAM_OUTPUT_VERTICES_NV 0x8C27 +#define GL_MAX_PROGRAM_TOTAL_OUTPUT_COMPONENTS_NV 0x8C28 + +typedef void (GLAPIENTRY * PFNGLPROGRAMVERTEXLIMITNVPROC) (GLenum target, GLint limit); + +#define glProgramVertexLimitNV GLEW_GET_FUN(__glewProgramVertexLimitNV) + +#define GLEW_NV_geometry_program4 GLEW_GET_VAR(__GLEW_NV_geometry_program4) + +#endif /* GL_NV_geometry_program4 */ + +/* ------------------------- GL_NV_geometry_shader4 ------------------------ */ + +#ifndef GL_NV_geometry_shader4 +#define GL_NV_geometry_shader4 1 + +#define GLEW_NV_geometry_shader4 GLEW_GET_VAR(__GLEW_NV_geometry_shader4) + +#endif /* GL_NV_geometry_shader4 */ + +/* --------------------------- GL_NV_gpu_program4 -------------------------- */ + +#ifndef GL_NV_gpu_program4 +#define GL_NV_gpu_program4 1 + +#define GL_MIN_PROGRAM_TEXEL_OFFSET_NV 0x8904 +#define GL_MAX_PROGRAM_TEXEL_OFFSET_NV 0x8905 +#define GL_PROGRAM_ATTRIB_COMPONENTS_NV 0x8906 +#define GL_PROGRAM_RESULT_COMPONENTS_NV 0x8907 +#define GL_MAX_PROGRAM_ATTRIB_COMPONENTS_NV 0x8908 +#define GL_MAX_PROGRAM_RESULT_COMPONENTS_NV 0x8909 +#define GL_MAX_PROGRAM_GENERIC_ATTRIBS_NV 0x8DA5 +#define GL_MAX_PROGRAM_GENERIC_RESULTS_NV 0x8DA6 + +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4INVPROC) (GLenum target, GLuint index, GLint x, GLint y, GLint z, GLint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC) (GLenum target, GLuint index, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UINVPROC) (GLenum target, GLuint index, GLuint x, GLuint y, GLuint z, GLuint w); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC) (GLenum target, GLuint index, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC) (GLenum target, GLuint index, GLsizei count, const GLuint *params); + +#define glProgramEnvParameterI4iNV GLEW_GET_FUN(__glewProgramEnvParameterI4iNV) +#define glProgramEnvParameterI4ivNV GLEW_GET_FUN(__glewProgramEnvParameterI4ivNV) +#define glProgramEnvParameterI4uiNV GLEW_GET_FUN(__glewProgramEnvParameterI4uiNV) +#define glProgramEnvParameterI4uivNV GLEW_GET_FUN(__glewProgramEnvParameterI4uivNV) +#define glProgramEnvParametersI4ivNV GLEW_GET_FUN(__glewProgramEnvParametersI4ivNV) +#define glProgramEnvParametersI4uivNV GLEW_GET_FUN(__glewProgramEnvParametersI4uivNV) +#define glProgramLocalParameterI4iNV GLEW_GET_FUN(__glewProgramLocalParameterI4iNV) +#define glProgramLocalParameterI4ivNV GLEW_GET_FUN(__glewProgramLocalParameterI4ivNV) +#define glProgramLocalParameterI4uiNV GLEW_GET_FUN(__glewProgramLocalParameterI4uiNV) +#define glProgramLocalParameterI4uivNV GLEW_GET_FUN(__glewProgramLocalParameterI4uivNV) +#define glProgramLocalParametersI4ivNV GLEW_GET_FUN(__glewProgramLocalParametersI4ivNV) +#define glProgramLocalParametersI4uivNV GLEW_GET_FUN(__glewProgramLocalParametersI4uivNV) + +#define GLEW_NV_gpu_program4 GLEW_GET_VAR(__GLEW_NV_gpu_program4) + +#endif /* GL_NV_gpu_program4 */ + +/* --------------------------- GL_NV_gpu_program5 -------------------------- */ + +#ifndef GL_NV_gpu_program5 +#define GL_NV_gpu_program5 1 + +#define GL_MAX_GEOMETRY_PROGRAM_INVOCATIONS_NV 0x8E5A +#define GL_MIN_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5B +#define GL_MAX_FRAGMENT_INTERPOLATION_OFFSET_NV 0x8E5C +#define GL_FRAGMENT_PROGRAM_INTERPOLATION_OFFSET_BITS_NV 0x8E5D +#define GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5E +#define GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_NV 0x8E5F + +#define GLEW_NV_gpu_program5 GLEW_GET_VAR(__GLEW_NV_gpu_program5) + +#endif /* GL_NV_gpu_program5 */ + +/* ------------------------- GL_NV_gpu_program_fp64 ------------------------ */ + +#ifndef GL_NV_gpu_program_fp64 +#define GL_NV_gpu_program_fp64 1 + +#define GLEW_NV_gpu_program_fp64 GLEW_GET_VAR(__GLEW_NV_gpu_program_fp64) + +#endif /* GL_NV_gpu_program_fp64 */ + +/* --------------------------- GL_NV_gpu_shader5 --------------------------- */ + +#ifndef GL_NV_gpu_shader5 +#define GL_NV_gpu_shader5 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F +#define GL_INT8_NV 0x8FE0 +#define GL_INT8_VEC2_NV 0x8FE1 +#define GL_INT8_VEC3_NV 0x8FE2 +#define GL_INT8_VEC4_NV 0x8FE3 +#define GL_INT16_NV 0x8FE4 +#define GL_INT16_VEC2_NV 0x8FE5 +#define GL_INT16_VEC3_NV 0x8FE6 +#define GL_INT16_VEC4_NV 0x8FE7 +#define GL_INT64_VEC2_NV 0x8FE9 +#define GL_INT64_VEC3_NV 0x8FEA +#define GL_INT64_VEC4_NV 0x8FEB +#define GL_UNSIGNED_INT8_NV 0x8FEC +#define GL_UNSIGNED_INT8_VEC2_NV 0x8FED +#define GL_UNSIGNED_INT8_VEC3_NV 0x8FEE +#define GL_UNSIGNED_INT8_VEC4_NV 0x8FEF +#define GL_UNSIGNED_INT16_NV 0x8FF0 +#define GL_UNSIGNED_INT16_VEC2_NV 0x8FF1 +#define GL_UNSIGNED_INT16_VEC3_NV 0x8FF2 +#define GL_UNSIGNED_INT16_VEC4_NV 0x8FF3 +#define GL_UNSIGNED_INT64_VEC2_NV 0x8FF5 +#define GL_UNSIGNED_INT64_VEC3_NV 0x8FF6 +#define GL_UNSIGNED_INT64_VEC4_NV 0x8FF7 +#define GL_FLOAT16_NV 0x8FF8 +#define GL_FLOAT16_VEC2_NV 0x8FF9 +#define GL_FLOAT16_VEC3_NV 0x8FFA +#define GL_FLOAT16_VEC4_NV 0x8FFB + +typedef void (GLAPIENTRY * PFNGLGETUNIFORMI64VNVPROC) (GLuint program, GLint location, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64NVPROC) (GLuint program, GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM1UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM2UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM3UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64NVPROC) (GLuint program, GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4I64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64NVPROC) (GLuint program, GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORM4UI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64NVPROC) (GLint location, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64NVPROC) (GLint location, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLUNIFORM1UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLUNIFORM2UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLUNIFORM3UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64NVPROC) (GLint location, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4I64VNVPROC) (GLint location, GLsizei count, const GLint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64NVPROC) (GLint location, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLUNIFORM4UI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetUniformi64vNV GLEW_GET_FUN(__glewGetUniformi64vNV) +#define glGetUniformui64vNV GLEW_GET_FUN(__glewGetUniformui64vNV) +#define glProgramUniform1i64NV GLEW_GET_FUN(__glewProgramUniform1i64NV) +#define glProgramUniform1i64vNV GLEW_GET_FUN(__glewProgramUniform1i64vNV) +#define glProgramUniform1ui64NV GLEW_GET_FUN(__glewProgramUniform1ui64NV) +#define glProgramUniform1ui64vNV GLEW_GET_FUN(__glewProgramUniform1ui64vNV) +#define glProgramUniform2i64NV GLEW_GET_FUN(__glewProgramUniform2i64NV) +#define glProgramUniform2i64vNV GLEW_GET_FUN(__glewProgramUniform2i64vNV) +#define glProgramUniform2ui64NV GLEW_GET_FUN(__glewProgramUniform2ui64NV) +#define glProgramUniform2ui64vNV GLEW_GET_FUN(__glewProgramUniform2ui64vNV) +#define glProgramUniform3i64NV GLEW_GET_FUN(__glewProgramUniform3i64NV) +#define glProgramUniform3i64vNV GLEW_GET_FUN(__glewProgramUniform3i64vNV) +#define glProgramUniform3ui64NV GLEW_GET_FUN(__glewProgramUniform3ui64NV) +#define glProgramUniform3ui64vNV GLEW_GET_FUN(__glewProgramUniform3ui64vNV) +#define glProgramUniform4i64NV GLEW_GET_FUN(__glewProgramUniform4i64NV) +#define glProgramUniform4i64vNV GLEW_GET_FUN(__glewProgramUniform4i64vNV) +#define glProgramUniform4ui64NV GLEW_GET_FUN(__glewProgramUniform4ui64NV) +#define glProgramUniform4ui64vNV GLEW_GET_FUN(__glewProgramUniform4ui64vNV) +#define glUniform1i64NV GLEW_GET_FUN(__glewUniform1i64NV) +#define glUniform1i64vNV GLEW_GET_FUN(__glewUniform1i64vNV) +#define glUniform1ui64NV GLEW_GET_FUN(__glewUniform1ui64NV) +#define glUniform1ui64vNV GLEW_GET_FUN(__glewUniform1ui64vNV) +#define glUniform2i64NV GLEW_GET_FUN(__glewUniform2i64NV) +#define glUniform2i64vNV GLEW_GET_FUN(__glewUniform2i64vNV) +#define glUniform2ui64NV GLEW_GET_FUN(__glewUniform2ui64NV) +#define glUniform2ui64vNV GLEW_GET_FUN(__glewUniform2ui64vNV) +#define glUniform3i64NV GLEW_GET_FUN(__glewUniform3i64NV) +#define glUniform3i64vNV GLEW_GET_FUN(__glewUniform3i64vNV) +#define glUniform3ui64NV GLEW_GET_FUN(__glewUniform3ui64NV) +#define glUniform3ui64vNV GLEW_GET_FUN(__glewUniform3ui64vNV) +#define glUniform4i64NV GLEW_GET_FUN(__glewUniform4i64NV) +#define glUniform4i64vNV GLEW_GET_FUN(__glewUniform4i64vNV) +#define glUniform4ui64NV GLEW_GET_FUN(__glewUniform4ui64NV) +#define glUniform4ui64vNV GLEW_GET_FUN(__glewUniform4ui64vNV) + +#define GLEW_NV_gpu_shader5 GLEW_GET_VAR(__GLEW_NV_gpu_shader5) + +#endif /* GL_NV_gpu_shader5 */ + +/* ---------------------------- GL_NV_half_float --------------------------- */ + +#ifndef GL_NV_half_float +#define GL_NV_half_float 1 + +#define GL_HALF_FLOAT_NV 0x140B + +typedef unsigned short GLhalf; + +typedef void (GLAPIENTRY * PFNGLCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLCOLOR4HNVPROC) (GLhalf red, GLhalf green, GLhalf blue, GLhalf alpha); +typedef void (GLAPIENTRY * PFNGLCOLOR4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHNVPROC) (GLhalf fog); +typedef void (GLAPIENTRY * PFNGLFOGCOORDHVNVPROC) (const GLhalf* fog); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalf s); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLNORMAL3HNVPROC) (GLhalf nx, GLhalf ny, GLhalf nz); +typedef void (GLAPIENTRY * PFNGLNORMAL3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HNVPROC) (GLhalf red, GLhalf green, GLhalf blue); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HNVPROC) (GLhalf s); +typedef void (GLAPIENTRY * PFNGLTEXCOORD1HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HNVPROC) (GLhalf s, GLhalf t); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HNVPROC) (GLhalf s, GLhalf t, GLhalf r); +typedef void (GLAPIENTRY * PFNGLTEXCOORD3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HNVPROC) (GLhalf s, GLhalf t, GLhalf r, GLhalf q); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX2HNVPROC) (GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEX2HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX3HNVPROC) (GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEX3HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEX4HNVPROC) (GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEX4HVNVPROC) (const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalf x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalf x, GLhalf y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalf x, GLhalf y, GLhalf z, GLhalf w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalf* v); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHNVPROC) (GLhalf weight); +typedef void (GLAPIENTRY * PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalf* weight); + +#define glColor3hNV GLEW_GET_FUN(__glewColor3hNV) +#define glColor3hvNV GLEW_GET_FUN(__glewColor3hvNV) +#define glColor4hNV GLEW_GET_FUN(__glewColor4hNV) +#define glColor4hvNV GLEW_GET_FUN(__glewColor4hvNV) +#define glFogCoordhNV GLEW_GET_FUN(__glewFogCoordhNV) +#define glFogCoordhvNV GLEW_GET_FUN(__glewFogCoordhvNV) +#define glMultiTexCoord1hNV GLEW_GET_FUN(__glewMultiTexCoord1hNV) +#define glMultiTexCoord1hvNV GLEW_GET_FUN(__glewMultiTexCoord1hvNV) +#define glMultiTexCoord2hNV GLEW_GET_FUN(__glewMultiTexCoord2hNV) +#define glMultiTexCoord2hvNV GLEW_GET_FUN(__glewMultiTexCoord2hvNV) +#define glMultiTexCoord3hNV GLEW_GET_FUN(__glewMultiTexCoord3hNV) +#define glMultiTexCoord3hvNV GLEW_GET_FUN(__glewMultiTexCoord3hvNV) +#define glMultiTexCoord4hNV GLEW_GET_FUN(__glewMultiTexCoord4hNV) +#define glMultiTexCoord4hvNV GLEW_GET_FUN(__glewMultiTexCoord4hvNV) +#define glNormal3hNV GLEW_GET_FUN(__glewNormal3hNV) +#define glNormal3hvNV GLEW_GET_FUN(__glewNormal3hvNV) +#define glSecondaryColor3hNV GLEW_GET_FUN(__glewSecondaryColor3hNV) +#define glSecondaryColor3hvNV GLEW_GET_FUN(__glewSecondaryColor3hvNV) +#define glTexCoord1hNV GLEW_GET_FUN(__glewTexCoord1hNV) +#define glTexCoord1hvNV GLEW_GET_FUN(__glewTexCoord1hvNV) +#define glTexCoord2hNV GLEW_GET_FUN(__glewTexCoord2hNV) +#define glTexCoord2hvNV GLEW_GET_FUN(__glewTexCoord2hvNV) +#define glTexCoord3hNV GLEW_GET_FUN(__glewTexCoord3hNV) +#define glTexCoord3hvNV GLEW_GET_FUN(__glewTexCoord3hvNV) +#define glTexCoord4hNV GLEW_GET_FUN(__glewTexCoord4hNV) +#define glTexCoord4hvNV GLEW_GET_FUN(__glewTexCoord4hvNV) +#define glVertex2hNV GLEW_GET_FUN(__glewVertex2hNV) +#define glVertex2hvNV GLEW_GET_FUN(__glewVertex2hvNV) +#define glVertex3hNV GLEW_GET_FUN(__glewVertex3hNV) +#define glVertex3hvNV GLEW_GET_FUN(__glewVertex3hvNV) +#define glVertex4hNV GLEW_GET_FUN(__glewVertex4hNV) +#define glVertex4hvNV GLEW_GET_FUN(__glewVertex4hvNV) +#define glVertexAttrib1hNV GLEW_GET_FUN(__glewVertexAttrib1hNV) +#define glVertexAttrib1hvNV GLEW_GET_FUN(__glewVertexAttrib1hvNV) +#define glVertexAttrib2hNV GLEW_GET_FUN(__glewVertexAttrib2hNV) +#define glVertexAttrib2hvNV GLEW_GET_FUN(__glewVertexAttrib2hvNV) +#define glVertexAttrib3hNV GLEW_GET_FUN(__glewVertexAttrib3hNV) +#define glVertexAttrib3hvNV GLEW_GET_FUN(__glewVertexAttrib3hvNV) +#define glVertexAttrib4hNV GLEW_GET_FUN(__glewVertexAttrib4hNV) +#define glVertexAttrib4hvNV GLEW_GET_FUN(__glewVertexAttrib4hvNV) +#define glVertexAttribs1hvNV GLEW_GET_FUN(__glewVertexAttribs1hvNV) +#define glVertexAttribs2hvNV GLEW_GET_FUN(__glewVertexAttribs2hvNV) +#define glVertexAttribs3hvNV GLEW_GET_FUN(__glewVertexAttribs3hvNV) +#define glVertexAttribs4hvNV GLEW_GET_FUN(__glewVertexAttribs4hvNV) +#define glVertexWeighthNV GLEW_GET_FUN(__glewVertexWeighthNV) +#define glVertexWeighthvNV GLEW_GET_FUN(__glewVertexWeighthvNV) + +#define GLEW_NV_half_float GLEW_GET_VAR(__GLEW_NV_half_float) + +#endif /* GL_NV_half_float */ + +/* ------------------------ GL_NV_light_max_exponent ----------------------- */ + +#ifndef GL_NV_light_max_exponent +#define GL_NV_light_max_exponent 1 + +#define GL_MAX_SHININESS_NV 0x8504 +#define GL_MAX_SPOT_EXPONENT_NV 0x8505 + +#define GLEW_NV_light_max_exponent GLEW_GET_VAR(__GLEW_NV_light_max_exponent) + +#endif /* GL_NV_light_max_exponent */ + +/* ----------------------- GL_NV_multisample_coverage ---------------------- */ + +#ifndef GL_NV_multisample_coverage +#define GL_NV_multisample_coverage 1 + +#define GL_COVERAGE_SAMPLES_NV 0x80A9 +#define GL_COLOR_SAMPLES_NV 0x8E20 + +#define GLEW_NV_multisample_coverage GLEW_GET_VAR(__GLEW_NV_multisample_coverage) + +#endif /* GL_NV_multisample_coverage */ + +/* --------------------- GL_NV_multisample_filter_hint --------------------- */ + +#ifndef GL_NV_multisample_filter_hint +#define GL_NV_multisample_filter_hint 1 + +#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 + +#define GLEW_NV_multisample_filter_hint GLEW_GET_VAR(__GLEW_NV_multisample_filter_hint) + +#endif /* GL_NV_multisample_filter_hint */ + +/* ------------------------- GL_NV_occlusion_query ------------------------- */ + +#ifndef GL_NV_occlusion_query +#define GL_NV_occlusion_query 1 + +#define GL_PIXEL_COUNTER_BITS_NV 0x8864 +#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 +#define GL_PIXEL_COUNT_NV 0x8866 +#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 + +typedef void (GLAPIENTRY * PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLENDOCCLUSIONQUERYNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); + +#define glBeginOcclusionQueryNV GLEW_GET_FUN(__glewBeginOcclusionQueryNV) +#define glDeleteOcclusionQueriesNV GLEW_GET_FUN(__glewDeleteOcclusionQueriesNV) +#define glEndOcclusionQueryNV GLEW_GET_FUN(__glewEndOcclusionQueryNV) +#define glGenOcclusionQueriesNV GLEW_GET_FUN(__glewGenOcclusionQueriesNV) +#define glGetOcclusionQueryivNV GLEW_GET_FUN(__glewGetOcclusionQueryivNV) +#define glGetOcclusionQueryuivNV GLEW_GET_FUN(__glewGetOcclusionQueryuivNV) +#define glIsOcclusionQueryNV GLEW_GET_FUN(__glewIsOcclusionQueryNV) + +#define GLEW_NV_occlusion_query GLEW_GET_VAR(__GLEW_NV_occlusion_query) + +#endif /* GL_NV_occlusion_query */ + +/* ----------------------- GL_NV_packed_depth_stencil ---------------------- */ + +#ifndef GL_NV_packed_depth_stencil +#define GL_NV_packed_depth_stencil 1 + +#define GL_DEPTH_STENCIL_NV 0x84F9 +#define GL_UNSIGNED_INT_24_8_NV 0x84FA + +#define GLEW_NV_packed_depth_stencil GLEW_GET_VAR(__GLEW_NV_packed_depth_stencil) + +#endif /* GL_NV_packed_depth_stencil */ + +/* --------------------- GL_NV_parameter_buffer_object --------------------- */ + +#ifndef GL_NV_parameter_buffer_object +#define GL_NV_parameter_buffer_object 1 + +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_BINDINGS_NV 0x8DA0 +#define GL_MAX_PROGRAM_PARAMETER_BUFFER_SIZE_NV 0x8DA1 +#define GL_VERTEX_PROGRAM_PARAMETER_BUFFER_NV 0x8DA2 +#define GL_GEOMETRY_PROGRAM_PARAMETER_BUFFER_NV 0x8DA3 +#define GL_FRAGMENT_PROGRAM_PARAMETER_BUFFER_NV 0x8DA4 + +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLuint *params); +typedef void (GLAPIENTRY * PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC) (GLenum target, GLuint buffer, GLuint index, GLsizei count, const GLfloat *params); + +#define glProgramBufferParametersIivNV GLEW_GET_FUN(__glewProgramBufferParametersIivNV) +#define glProgramBufferParametersIuivNV GLEW_GET_FUN(__glewProgramBufferParametersIuivNV) +#define glProgramBufferParametersfvNV GLEW_GET_FUN(__glewProgramBufferParametersfvNV) + +#define GLEW_NV_parameter_buffer_object GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object) + +#endif /* GL_NV_parameter_buffer_object */ + +/* --------------------- GL_NV_parameter_buffer_object2 -------------------- */ + +#ifndef GL_NV_parameter_buffer_object2 +#define GL_NV_parameter_buffer_object2 1 + +#define GLEW_NV_parameter_buffer_object2 GLEW_GET_VAR(__GLEW_NV_parameter_buffer_object2) + +#endif /* GL_NV_parameter_buffer_object2 */ + +/* ------------------------- GL_NV_pixel_data_range ------------------------ */ + +#ifndef GL_NV_pixel_data_range +#define GL_NV_pixel_data_range 1 + +#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 +#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 +#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A +#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B +#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C +#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D + +typedef void (GLAPIENTRY * PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, void* pointer); + +#define glFlushPixelDataRangeNV GLEW_GET_FUN(__glewFlushPixelDataRangeNV) +#define glPixelDataRangeNV GLEW_GET_FUN(__glewPixelDataRangeNV) + +#define GLEW_NV_pixel_data_range GLEW_GET_VAR(__GLEW_NV_pixel_data_range) + +#endif /* GL_NV_pixel_data_range */ + +/* --------------------------- GL_NV_point_sprite -------------------------- */ + +#ifndef GL_NV_point_sprite +#define GL_NV_point_sprite 1 + +#define GL_POINT_SPRITE_NV 0x8861 +#define GL_COORD_REPLACE_NV 0x8862 +#define GL_POINT_SPRITE_R_MODE_NV 0x8863 + +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint* params); + +#define glPointParameteriNV GLEW_GET_FUN(__glewPointParameteriNV) +#define glPointParameterivNV GLEW_GET_FUN(__glewPointParameterivNV) + +#define GLEW_NV_point_sprite GLEW_GET_VAR(__GLEW_NV_point_sprite) + +#endif /* GL_NV_point_sprite */ + +/* -------------------------- GL_NV_present_video -------------------------- */ + +#ifndef GL_NV_present_video +#define GL_NV_present_video 1 + +#define GL_FRAME_NV 0x8E26 +#define GL_FIELDS_NV 0x8E27 +#define GL_CURRENT_TIME_NV 0x8E28 +#define GL_NUM_FILL_STREAMS_NV 0x8E29 +#define GL_PRESENT_TIME_NV 0x8E2A +#define GL_PRESENT_DURATION_NV 0x8E2B + +typedef void (GLAPIENTRY * PFNGLGETVIDEOI64VNVPROC) (GLuint video_slot, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOIVNVPROC) (GLuint video_slot, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUI64VNVPROC) (GLuint video_slot, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVIDEOUIVNVPROC) (GLuint video_slot, GLenum pname, GLuint* params); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEDUALFILLNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLenum target1, GLuint fill1, GLenum target2, GLuint fill2, GLenum target3, GLuint fill3); +typedef void (GLAPIENTRY * PFNGLPRESENTFRAMEKEYEDNVPROC) (GLuint video_slot, GLuint64EXT minPresentTime, GLuint beginPresentTimeId, GLuint presentDurationId, GLenum type, GLenum target0, GLuint fill0, GLuint key0, GLenum target1, GLuint fill1, GLuint key1); + +#define glGetVideoi64vNV GLEW_GET_FUN(__glewGetVideoi64vNV) +#define glGetVideoivNV GLEW_GET_FUN(__glewGetVideoivNV) +#define glGetVideoui64vNV GLEW_GET_FUN(__glewGetVideoui64vNV) +#define glGetVideouivNV GLEW_GET_FUN(__glewGetVideouivNV) +#define glPresentFrameDualFillNV GLEW_GET_FUN(__glewPresentFrameDualFillNV) +#define glPresentFrameKeyedNV GLEW_GET_FUN(__glewPresentFrameKeyedNV) + +#define GLEW_NV_present_video GLEW_GET_VAR(__GLEW_NV_present_video) + +#endif /* GL_NV_present_video */ + +/* ------------------------ GL_NV_primitive_restart ------------------------ */ + +#ifndef GL_NV_primitive_restart +#define GL_NV_primitive_restart 1 + +#define GL_PRIMITIVE_RESTART_NV 0x8558 +#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 + +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); +typedef void (GLAPIENTRY * PFNGLPRIMITIVERESTARTNVPROC) (void); + +#define glPrimitiveRestartIndexNV GLEW_GET_FUN(__glewPrimitiveRestartIndexNV) +#define glPrimitiveRestartNV GLEW_GET_FUN(__glewPrimitiveRestartNV) + +#define GLEW_NV_primitive_restart GLEW_GET_VAR(__GLEW_NV_primitive_restart) + +#endif /* GL_NV_primitive_restart */ + +/* ------------------------ GL_NV_register_combiners ----------------------- */ + +#ifndef GL_NV_register_combiners +#define GL_NV_register_combiners 1 + +#define GL_REGISTER_COMBINERS_NV 0x8522 +#define GL_VARIABLE_A_NV 0x8523 +#define GL_VARIABLE_B_NV 0x8524 +#define GL_VARIABLE_C_NV 0x8525 +#define GL_VARIABLE_D_NV 0x8526 +#define GL_VARIABLE_E_NV 0x8527 +#define GL_VARIABLE_F_NV 0x8528 +#define GL_VARIABLE_G_NV 0x8529 +#define GL_CONSTANT_COLOR0_NV 0x852A +#define GL_CONSTANT_COLOR1_NV 0x852B +#define GL_PRIMARY_COLOR_NV 0x852C +#define GL_SECONDARY_COLOR_NV 0x852D +#define GL_SPARE0_NV 0x852E +#define GL_SPARE1_NV 0x852F +#define GL_DISCARD_NV 0x8530 +#define GL_E_TIMES_F_NV 0x8531 +#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 +#define GL_UNSIGNED_IDENTITY_NV 0x8536 +#define GL_UNSIGNED_INVERT_NV 0x8537 +#define GL_EXPAND_NORMAL_NV 0x8538 +#define GL_EXPAND_NEGATE_NV 0x8539 +#define GL_HALF_BIAS_NORMAL_NV 0x853A +#define GL_HALF_BIAS_NEGATE_NV 0x853B +#define GL_SIGNED_IDENTITY_NV 0x853C +#define GL_SIGNED_NEGATE_NV 0x853D +#define GL_SCALE_BY_TWO_NV 0x853E +#define GL_SCALE_BY_FOUR_NV 0x853F +#define GL_SCALE_BY_ONE_HALF_NV 0x8540 +#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 +#define GL_COMBINER_INPUT_NV 0x8542 +#define GL_COMBINER_MAPPING_NV 0x8543 +#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 +#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 +#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 +#define GL_COMBINER_MUX_SUM_NV 0x8547 +#define GL_COMBINER_SCALE_NV 0x8548 +#define GL_COMBINER_BIAS_NV 0x8549 +#define GL_COMBINER_AB_OUTPUT_NV 0x854A +#define GL_COMBINER_CD_OUTPUT_NV 0x854B +#define GL_COMBINER_SUM_OUTPUT_NV 0x854C +#define GL_MAX_GENERAL_COMBINERS_NV 0x854D +#define GL_NUM_GENERAL_COMBINERS_NV 0x854E +#define GL_COLOR_SUM_CLAMP_NV 0x854F +#define GL_COMBINER0_NV 0x8550 +#define GL_COMBINER1_NV 0x8551 +#define GL_COMBINER2_NV 0x8552 +#define GL_COMBINER3_NV 0x8553 +#define GL_COMBINER4_NV 0x8554 +#define GL_COMBINER5_NV 0x8555 +#define GL_COMBINER6_NV 0x8556 +#define GL_COMBINER7_NV 0x8557 + +typedef void (GLAPIENTRY * PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint* params); + +#define glCombinerInputNV GLEW_GET_FUN(__glewCombinerInputNV) +#define glCombinerOutputNV GLEW_GET_FUN(__glewCombinerOutputNV) +#define glCombinerParameterfNV GLEW_GET_FUN(__glewCombinerParameterfNV) +#define glCombinerParameterfvNV GLEW_GET_FUN(__glewCombinerParameterfvNV) +#define glCombinerParameteriNV GLEW_GET_FUN(__glewCombinerParameteriNV) +#define glCombinerParameterivNV GLEW_GET_FUN(__glewCombinerParameterivNV) +#define glFinalCombinerInputNV GLEW_GET_FUN(__glewFinalCombinerInputNV) +#define glGetCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetCombinerInputParameterfvNV) +#define glGetCombinerInputParameterivNV GLEW_GET_FUN(__glewGetCombinerInputParameterivNV) +#define glGetCombinerOutputParameterfvNV GLEW_GET_FUN(__glewGetCombinerOutputParameterfvNV) +#define glGetCombinerOutputParameterivNV GLEW_GET_FUN(__glewGetCombinerOutputParameterivNV) +#define glGetFinalCombinerInputParameterfvNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterfvNV) +#define glGetFinalCombinerInputParameterivNV GLEW_GET_FUN(__glewGetFinalCombinerInputParameterivNV) + +#define GLEW_NV_register_combiners GLEW_GET_VAR(__GLEW_NV_register_combiners) + +#endif /* GL_NV_register_combiners */ + +/* ----------------------- GL_NV_register_combiners2 ----------------------- */ + +#ifndef GL_NV_register_combiners2 +#define GL_NV_register_combiners2 1 + +#define GL_PER_STAGE_CONSTANTS_NV 0x8535 + +typedef void (GLAPIENTRY * PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat* params); + +#define glCombinerStageParameterfvNV GLEW_GET_FUN(__glewCombinerStageParameterfvNV) +#define glGetCombinerStageParameterfvNV GLEW_GET_FUN(__glewGetCombinerStageParameterfvNV) + +#define GLEW_NV_register_combiners2 GLEW_GET_VAR(__GLEW_NV_register_combiners2) + +#endif /* GL_NV_register_combiners2 */ + +/* ------------------------ GL_NV_shader_buffer_load ----------------------- */ + +#ifndef GL_NV_shader_buffer_load +#define GL_NV_shader_buffer_load 1 + +#define GL_BUFFER_GPU_ADDRESS_NV 0x8F1D +#define GL_GPU_ADDRESS_NV 0x8F34 +#define GL_MAX_SHADER_BUFFER_ADDRESS_NV 0x8F35 + +typedef void (GLAPIENTRY * PFNGLGETBUFFERPARAMETERUI64VNVPROC) (GLenum target, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64VNVPROC) (GLenum value, GLuint64EXT* result); +typedef void (GLAPIENTRY * PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC) (GLuint buffer, GLenum pname, GLuint64EXT* params); +typedef GLboolean (GLAPIENTRY * PFNGLISBUFFERRESIDENTNVPROC) (GLenum target); +typedef GLboolean (GLAPIENTRY * PFNGLISNAMEDBUFFERRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERNONRESIDENTNVPROC) (GLenum target); +typedef void (GLAPIENTRY * PFNGLMAKEBUFFERRESIDENTNVPROC) (GLenum target, GLenum access); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC) (GLuint buffer); +typedef void (GLAPIENTRY * PFNGLMAKENAMEDBUFFERRESIDENTNVPROC) (GLuint buffer, GLenum access); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64NVPROC) (GLuint program, GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLPROGRAMUNIFORMUI64VNVPROC) (GLuint program, GLint location, GLsizei count, const GLuint64EXT* value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64NVPROC) (GLint location, GLuint64EXT value); +typedef void (GLAPIENTRY * PFNGLUNIFORMUI64VNVPROC) (GLint location, GLsizei count, const GLuint64EXT* value); + +#define glGetBufferParameterui64vNV GLEW_GET_FUN(__glewGetBufferParameterui64vNV) +#define glGetIntegerui64vNV GLEW_GET_FUN(__glewGetIntegerui64vNV) +#define glGetNamedBufferParameterui64vNV GLEW_GET_FUN(__glewGetNamedBufferParameterui64vNV) +#define glIsBufferResidentNV GLEW_GET_FUN(__glewIsBufferResidentNV) +#define glIsNamedBufferResidentNV GLEW_GET_FUN(__glewIsNamedBufferResidentNV) +#define glMakeBufferNonResidentNV GLEW_GET_FUN(__glewMakeBufferNonResidentNV) +#define glMakeBufferResidentNV GLEW_GET_FUN(__glewMakeBufferResidentNV) +#define glMakeNamedBufferNonResidentNV GLEW_GET_FUN(__glewMakeNamedBufferNonResidentNV) +#define glMakeNamedBufferResidentNV GLEW_GET_FUN(__glewMakeNamedBufferResidentNV) +#define glProgramUniformui64NV GLEW_GET_FUN(__glewProgramUniformui64NV) +#define glProgramUniformui64vNV GLEW_GET_FUN(__glewProgramUniformui64vNV) +#define glUniformui64NV GLEW_GET_FUN(__glewUniformui64NV) +#define glUniformui64vNV GLEW_GET_FUN(__glewUniformui64vNV) + +#define GLEW_NV_shader_buffer_load GLEW_GET_VAR(__GLEW_NV_shader_buffer_load) + +#endif /* GL_NV_shader_buffer_load */ + +/* ---------------------- GL_NV_tessellation_program5 ---------------------- */ + +#ifndef GL_NV_tessellation_program5 +#define GL_NV_tessellation_program5 1 + +#define GL_MAX_PROGRAM_PATCH_ATTRIBS_NV 0x86D8 +#define GL_TESS_CONTROL_PROGRAM_NV 0x891E +#define GL_TESS_EVALUATION_PROGRAM_NV 0x891F +#define GL_TESS_CONTROL_PROGRAM_PARAMETER_BUFFER_NV 0x8C74 +#define GL_TESS_EVALUATION_PROGRAM_PARAMETER_BUFFER_NV 0x8C75 + +#define GLEW_NV_tessellation_program5 GLEW_GET_VAR(__GLEW_NV_tessellation_program5) + +#endif /* GL_NV_tessellation_program5 */ + +/* -------------------------- GL_NV_texgen_emboss -------------------------- */ + +#ifndef GL_NV_texgen_emboss +#define GL_NV_texgen_emboss 1 + +#define GL_EMBOSS_LIGHT_NV 0x855D +#define GL_EMBOSS_CONSTANT_NV 0x855E +#define GL_EMBOSS_MAP_NV 0x855F + +#define GLEW_NV_texgen_emboss GLEW_GET_VAR(__GLEW_NV_texgen_emboss) + +#endif /* GL_NV_texgen_emboss */ + +/* ------------------------ GL_NV_texgen_reflection ------------------------ */ + +#ifndef GL_NV_texgen_reflection +#define GL_NV_texgen_reflection 1 + +#define GL_NORMAL_MAP_NV 0x8511 +#define GL_REFLECTION_MAP_NV 0x8512 + +#define GLEW_NV_texgen_reflection GLEW_GET_VAR(__GLEW_NV_texgen_reflection) + +#endif /* GL_NV_texgen_reflection */ + +/* ------------------------- GL_NV_texture_barrier ------------------------- */ + +#ifndef GL_NV_texture_barrier +#define GL_NV_texture_barrier 1 + +typedef void (GLAPIENTRY * PFNGLTEXTUREBARRIERNVPROC) (void); + +#define glTextureBarrierNV GLEW_GET_FUN(__glewTextureBarrierNV) + +#define GLEW_NV_texture_barrier GLEW_GET_VAR(__GLEW_NV_texture_barrier) + +#endif /* GL_NV_texture_barrier */ + +/* --------------------- GL_NV_texture_compression_vtc --------------------- */ + +#ifndef GL_NV_texture_compression_vtc +#define GL_NV_texture_compression_vtc 1 + +#define GLEW_NV_texture_compression_vtc GLEW_GET_VAR(__GLEW_NV_texture_compression_vtc) + +#endif /* GL_NV_texture_compression_vtc */ + +/* ----------------------- GL_NV_texture_env_combine4 ---------------------- */ + +#ifndef GL_NV_texture_env_combine4 +#define GL_NV_texture_env_combine4 1 + +#define GL_COMBINE4_NV 0x8503 +#define GL_SOURCE3_RGB_NV 0x8583 +#define GL_SOURCE3_ALPHA_NV 0x858B +#define GL_OPERAND3_RGB_NV 0x8593 +#define GL_OPERAND3_ALPHA_NV 0x859B + +#define GLEW_NV_texture_env_combine4 GLEW_GET_VAR(__GLEW_NV_texture_env_combine4) + +#endif /* GL_NV_texture_env_combine4 */ + +/* ---------------------- GL_NV_texture_expand_normal ---------------------- */ + +#ifndef GL_NV_texture_expand_normal +#define GL_NV_texture_expand_normal 1 + +#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F + +#define GLEW_NV_texture_expand_normal GLEW_GET_VAR(__GLEW_NV_texture_expand_normal) + +#endif /* GL_NV_texture_expand_normal */ + +/* ------------------------ GL_NV_texture_rectangle ------------------------ */ + +#ifndef GL_NV_texture_rectangle +#define GL_NV_texture_rectangle 1 + +#define GL_TEXTURE_RECTANGLE_NV 0x84F5 +#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 +#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 +#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 + +#define GLEW_NV_texture_rectangle GLEW_GET_VAR(__GLEW_NV_texture_rectangle) + +#endif /* GL_NV_texture_rectangle */ + +/* -------------------------- GL_NV_texture_shader ------------------------- */ + +#ifndef GL_NV_texture_shader +#define GL_NV_texture_shader 1 + +#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C +#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D +#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E +#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_SHADER_CONSISTENT_NV 0x86DD +#define GL_TEXTURE_SHADER_NV 0x86DE +#define GL_SHADER_OPERATION_NV 0x86DF +#define GL_CULL_MODES_NV 0x86E0 +#define GL_OFFSET_TEXTURE_2D_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 +#define GL_OFFSET_TEXTURE_2D_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 +#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 +#define GL_OFFSET_TEXTURE_2D_BIAS_NV 0x86E3 +#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 +#define GL_CONST_EYE_NV 0x86E5 +#define GL_PASS_THROUGH_NV 0x86E6 +#define GL_CULL_FRAGMENT_NV 0x86E7 +#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 +#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 +#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA +#define GL_DOT_PRODUCT_NV 0x86EC +#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED +#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE +#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 +#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 +#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 +#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D +#define GL_HI_SCALE_NV 0x870E +#define GL_LO_SCALE_NV 0x870F +#define GL_DS_SCALE_NV 0x8710 +#define GL_DT_SCALE_NV 0x8711 +#define GL_MAGNITUDE_SCALE_NV 0x8712 +#define GL_VIBRANCE_SCALE_NV 0x8713 +#define GL_HI_BIAS_NV 0x8714 +#define GL_LO_BIAS_NV 0x8715 +#define GL_DS_BIAS_NV 0x8716 +#define GL_DT_BIAS_NV 0x8717 +#define GL_MAGNITUDE_BIAS_NV 0x8718 +#define GL_VIBRANCE_BIAS_NV 0x8719 +#define GL_TEXTURE_BORDER_VALUES_NV 0x871A +#define GL_TEXTURE_HI_SIZE_NV 0x871B +#define GL_TEXTURE_LO_SIZE_NV 0x871C +#define GL_TEXTURE_DS_SIZE_NV 0x871D +#define GL_TEXTURE_DT_SIZE_NV 0x871E +#define GL_TEXTURE_MAG_SIZE_NV 0x871F + +#define GLEW_NV_texture_shader GLEW_GET_VAR(__GLEW_NV_texture_shader) + +#endif /* GL_NV_texture_shader */ + +/* ------------------------- GL_NV_texture_shader2 ------------------------- */ + +#ifndef GL_NV_texture_shader2 +#define GL_NV_texture_shader2 1 + +#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA +#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB +#define GL_DSDT_MAG_INTENSITY_NV 0x86DC +#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF +#define GL_HILO_NV 0x86F4 +#define GL_DSDT_NV 0x86F5 +#define GL_DSDT_MAG_NV 0x86F6 +#define GL_DSDT_MAG_VIB_NV 0x86F7 +#define GL_HILO16_NV 0x86F8 +#define GL_SIGNED_HILO_NV 0x86F9 +#define GL_SIGNED_HILO16_NV 0x86FA +#define GL_SIGNED_RGBA_NV 0x86FB +#define GL_SIGNED_RGBA8_NV 0x86FC +#define GL_SIGNED_RGB_NV 0x86FE +#define GL_SIGNED_RGB8_NV 0x86FF +#define GL_SIGNED_LUMINANCE_NV 0x8701 +#define GL_SIGNED_LUMINANCE8_NV 0x8702 +#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 +#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 +#define GL_SIGNED_ALPHA_NV 0x8705 +#define GL_SIGNED_ALPHA8_NV 0x8706 +#define GL_SIGNED_INTENSITY_NV 0x8707 +#define GL_SIGNED_INTENSITY8_NV 0x8708 +#define GL_DSDT8_NV 0x8709 +#define GL_DSDT8_MAG8_NV 0x870A +#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B +#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C +#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D + +#define GLEW_NV_texture_shader2 GLEW_GET_VAR(__GLEW_NV_texture_shader2) + +#endif /* GL_NV_texture_shader2 */ + +/* ------------------------- GL_NV_texture_shader3 ------------------------- */ + +#ifndef GL_NV_texture_shader3 +#define GL_NV_texture_shader3 1 + +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 +#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 +#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 +#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 +#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 +#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 +#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 +#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 +#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A +#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B +#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C +#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D +#define GL_HILO8_NV 0x885E +#define GL_SIGNED_HILO8_NV 0x885F +#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 + +#define GLEW_NV_texture_shader3 GLEW_GET_VAR(__GLEW_NV_texture_shader3) + +#endif /* GL_NV_texture_shader3 */ + +/* ------------------------ GL_NV_transform_feedback ----------------------- */ + +#ifndef GL_NV_transform_feedback +#define GL_NV_transform_feedback 1 + +#define GL_BACK_PRIMARY_COLOR_NV 0x8C77 +#define GL_BACK_SECONDARY_COLOR_NV 0x8C78 +#define GL_TEXTURE_COORD_NV 0x8C79 +#define GL_CLIP_DISTANCE_NV 0x8C7A +#define GL_VERTEX_ID_NV 0x8C7B +#define GL_PRIMITIVE_ID_NV 0x8C7C +#define GL_GENERIC_ATTRIB_NV 0x8C7D +#define GL_TRANSFORM_FEEDBACK_ATTRIBS_NV 0x8C7E +#define GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV 0x8C7F +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV 0x8C80 +#define GL_ACTIVE_VARYINGS_NV 0x8C81 +#define GL_ACTIVE_VARYING_MAX_LENGTH_NV 0x8C82 +#define GL_TRANSFORM_FEEDBACK_VARYINGS_NV 0x8C83 +#define GL_TRANSFORM_FEEDBACK_BUFFER_START_NV 0x8C84 +#define GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV 0x8C85 +#define GL_TRANSFORM_FEEDBACK_RECORD_NV 0x8C86 +#define GL_PRIMITIVES_GENERATED_NV 0x8C87 +#define GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV 0x8C88 +#define GL_RASTERIZER_DISCARD_NV 0x8C89 +#define GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV 0x8C8A +#define GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV 0x8C8B +#define GL_INTERLEAVED_ATTRIBS_NV 0x8C8C +#define GL_SEPARATE_ATTRIBS_NV 0x8C8D +#define GL_TRANSFORM_FEEDBACK_BUFFER_NV 0x8C8E +#define GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV 0x8C8F + +typedef void (GLAPIENTRY * PFNGLACTIVEVARYINGNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLBEGINTRANSFORMFEEDBACKNVPROC) (GLenum primitiveMode); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERBASENVPROC) (GLenum target, GLuint index, GLuint buffer); +typedef void (GLAPIENTRY * PFNGLBINDBUFFEROFFSETNVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset); +typedef void (GLAPIENTRY * PFNGLBINDBUFFERRANGENVPROC) (GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size); +typedef void (GLAPIENTRY * PFNGLENDTRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLGETACTIVEVARYINGNVPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name); +typedef void (GLAPIENTRY * PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC) (GLuint program, GLuint index, GLint *location); +typedef GLint (GLAPIENTRY * PFNGLGETVARYINGLOCATIONNVPROC) (GLuint program, const GLchar *name); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC) (GLuint count, const GLint *attribs, GLenum bufferMode); +typedef void (GLAPIENTRY * PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC) (GLuint program, GLsizei count, const GLint *locations, GLenum bufferMode); + +#define glActiveVaryingNV GLEW_GET_FUN(__glewActiveVaryingNV) +#define glBeginTransformFeedbackNV GLEW_GET_FUN(__glewBeginTransformFeedbackNV) +#define glBindBufferBaseNV GLEW_GET_FUN(__glewBindBufferBaseNV) +#define glBindBufferOffsetNV GLEW_GET_FUN(__glewBindBufferOffsetNV) +#define glBindBufferRangeNV GLEW_GET_FUN(__glewBindBufferRangeNV) +#define glEndTransformFeedbackNV GLEW_GET_FUN(__glewEndTransformFeedbackNV) +#define glGetActiveVaryingNV GLEW_GET_FUN(__glewGetActiveVaryingNV) +#define glGetTransformFeedbackVaryingNV GLEW_GET_FUN(__glewGetTransformFeedbackVaryingNV) +#define glGetVaryingLocationNV GLEW_GET_FUN(__glewGetVaryingLocationNV) +#define glTransformFeedbackAttribsNV GLEW_GET_FUN(__glewTransformFeedbackAttribsNV) +#define glTransformFeedbackVaryingsNV GLEW_GET_FUN(__glewTransformFeedbackVaryingsNV) + +#define GLEW_NV_transform_feedback GLEW_GET_VAR(__GLEW_NV_transform_feedback) + +#endif /* GL_NV_transform_feedback */ + +/* ----------------------- GL_NV_transform_feedback2 ----------------------- */ + +#ifndef GL_NV_transform_feedback2 +#define GL_NV_transform_feedback2 1 + +#define GL_TRANSFORM_FEEDBACK_NV 0x8E22 +#define GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV 0x8E23 +#define GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV 0x8E24 +#define GL_TRANSFORM_FEEDBACK_BINDING_NV 0x8E25 + +typedef void (GLAPIENTRY * PFNGLBINDTRANSFORMFEEDBACKNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETETRANSFORMFEEDBACKSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLDRAWTRANSFORMFEEDBACKNVPROC) (GLenum mode, GLuint id); +typedef void (GLAPIENTRY * PFNGLGENTRANSFORMFEEDBACKSNVPROC) (GLsizei n, GLuint* ids); +typedef GLboolean (GLAPIENTRY * PFNGLISTRANSFORMFEEDBACKNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLPAUSETRANSFORMFEEDBACKNVPROC) (void); +typedef void (GLAPIENTRY * PFNGLRESUMETRANSFORMFEEDBACKNVPROC) (void); + +#define glBindTransformFeedbackNV GLEW_GET_FUN(__glewBindTransformFeedbackNV) +#define glDeleteTransformFeedbacksNV GLEW_GET_FUN(__glewDeleteTransformFeedbacksNV) +#define glDrawTransformFeedbackNV GLEW_GET_FUN(__glewDrawTransformFeedbackNV) +#define glGenTransformFeedbacksNV GLEW_GET_FUN(__glewGenTransformFeedbacksNV) +#define glIsTransformFeedbackNV GLEW_GET_FUN(__glewIsTransformFeedbackNV) +#define glPauseTransformFeedbackNV GLEW_GET_FUN(__glewPauseTransformFeedbackNV) +#define glResumeTransformFeedbackNV GLEW_GET_FUN(__glewResumeTransformFeedbackNV) + +#define GLEW_NV_transform_feedback2 GLEW_GET_VAR(__GLEW_NV_transform_feedback2) + +#endif /* GL_NV_transform_feedback2 */ + +/* -------------------------- GL_NV_vdpau_interop -------------------------- */ + +#ifndef GL_NV_vdpau_interop +#define GL_NV_vdpau_interop 1 + +#define GL_SURFACE_STATE_NV 0x86EB +#define GL_SURFACE_REGISTERED_NV 0x86FD +#define GL_SURFACE_MAPPED_NV 0x8700 +#define GL_WRITE_DISCARD_NV 0x88BE + +typedef GLintptr GLvdpauSurfaceNV; + +typedef void (GLAPIENTRY * PFNGLVDPAUFININVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVDPAUGETSURFACEIVNVPROC) (GLvdpauSurfaceNV surface, GLenum pname, GLsizei bufSize, GLsizei* length, GLint *values); +typedef void (GLAPIENTRY * PFNGLVDPAUINITNVPROC) (const void* vdpDevice, const GLvoid*getProcAddress); +typedef void (GLAPIENTRY * PFNGLVDPAUISSURFACENVPROC) (GLvdpauSurfaceNV surface); +typedef void (GLAPIENTRY * PFNGLVDPAUMAPSURFACESNVPROC) (GLsizei numSurfaces, const GLvdpauSurfaceNV* surfaces); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef GLvdpauSurfaceNV (GLAPIENTRY * PFNGLVDPAUREGISTERVIDEOSURFACENVPROC) (const void* vdpSurface, GLenum target, GLsizei numTextureNames, const GLuint *textureNames); +typedef void (GLAPIENTRY * PFNGLVDPAUSURFACEACCESSNVPROC) (GLvdpauSurfaceNV surface, GLenum access); +typedef void (GLAPIENTRY * PFNGLVDPAUUNMAPSURFACESNVPROC) (GLsizei numSurface, const GLvdpauSurfaceNV* surfaces); +typedef void (GLAPIENTRY * PFNGLVDPAUUNREGISTERSURFACENVPROC) (GLvdpauSurfaceNV surface); + +#define glVDPAUFiniNV GLEW_GET_FUN(__glewVDPAUFiniNV) +#define glVDPAUGetSurfaceivNV GLEW_GET_FUN(__glewVDPAUGetSurfaceivNV) +#define glVDPAUInitNV GLEW_GET_FUN(__glewVDPAUInitNV) +#define glVDPAUIsSurfaceNV GLEW_GET_FUN(__glewVDPAUIsSurfaceNV) +#define glVDPAUMapSurfacesNV GLEW_GET_FUN(__glewVDPAUMapSurfacesNV) +#define glVDPAURegisterOutputSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterOutputSurfaceNV) +#define glVDPAURegisterVideoSurfaceNV GLEW_GET_FUN(__glewVDPAURegisterVideoSurfaceNV) +#define glVDPAUSurfaceAccessNV GLEW_GET_FUN(__glewVDPAUSurfaceAccessNV) +#define glVDPAUUnmapSurfacesNV GLEW_GET_FUN(__glewVDPAUUnmapSurfacesNV) +#define glVDPAUUnregisterSurfaceNV GLEW_GET_FUN(__glewVDPAUUnregisterSurfaceNV) + +#define GLEW_NV_vdpau_interop GLEW_GET_VAR(__GLEW_NV_vdpau_interop) + +#endif /* GL_NV_vdpau_interop */ + +/* ------------------------ GL_NV_vertex_array_range ----------------------- */ + +#ifndef GL_NV_vertex_array_range +#define GL_NV_vertex_array_range 1 + +#define GL_VERTEX_ARRAY_RANGE_NV 0x851D +#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E +#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F +#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 +#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 + +typedef void (GLAPIENTRY * PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); +typedef void (GLAPIENTRY * PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, void* pointer); + +#define glFlushVertexArrayRangeNV GLEW_GET_FUN(__glewFlushVertexArrayRangeNV) +#define glVertexArrayRangeNV GLEW_GET_FUN(__glewVertexArrayRangeNV) + +#define GLEW_NV_vertex_array_range GLEW_GET_VAR(__GLEW_NV_vertex_array_range) + +#endif /* GL_NV_vertex_array_range */ + +/* ----------------------- GL_NV_vertex_array_range2 ----------------------- */ + +#ifndef GL_NV_vertex_array_range2 +#define GL_NV_vertex_array_range2 1 + +#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 + +#define GLEW_NV_vertex_array_range2 GLEW_GET_VAR(__GLEW_NV_vertex_array_range2) + +#endif /* GL_NV_vertex_array_range2 */ + +/* ------------------- GL_NV_vertex_attrib_integer_64bit ------------------- */ + +#ifndef GL_NV_vertex_attrib_integer_64bit +#define GL_NV_vertex_attrib_integer_64bit 1 + +#define GL_INT64_NV 0x140E +#define GL_UNSIGNED_INT64_NV 0x140F + +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLI64VNVPROC) (GLuint index, GLenum pname, GLint64EXT* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBLUI64VNVPROC) (GLuint index, GLenum pname, GLuint64EXT* params); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64NVPROC) (GLuint index, GLint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64NVPROC) (GLuint index, GLuint64EXT x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL1UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL2UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL3UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64NVPROC) (GLuint index, GLint64EXT x, GLint64EXT y, GLint64EXT z, GLint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4I64VNVPROC) (GLuint index, const GLint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64NVPROC) (GLuint index, GLuint64EXT x, GLuint64EXT y, GLuint64EXT z, GLuint64EXT w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBL4UI64VNVPROC) (GLuint index, const GLuint64EXT* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBLFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); + +#define glGetVertexAttribLi64vNV GLEW_GET_FUN(__glewGetVertexAttribLi64vNV) +#define glGetVertexAttribLui64vNV GLEW_GET_FUN(__glewGetVertexAttribLui64vNV) +#define glVertexAttribL1i64NV GLEW_GET_FUN(__glewVertexAttribL1i64NV) +#define glVertexAttribL1i64vNV GLEW_GET_FUN(__glewVertexAttribL1i64vNV) +#define glVertexAttribL1ui64NV GLEW_GET_FUN(__glewVertexAttribL1ui64NV) +#define glVertexAttribL1ui64vNV GLEW_GET_FUN(__glewVertexAttribL1ui64vNV) +#define glVertexAttribL2i64NV GLEW_GET_FUN(__glewVertexAttribL2i64NV) +#define glVertexAttribL2i64vNV GLEW_GET_FUN(__glewVertexAttribL2i64vNV) +#define glVertexAttribL2ui64NV GLEW_GET_FUN(__glewVertexAttribL2ui64NV) +#define glVertexAttribL2ui64vNV GLEW_GET_FUN(__glewVertexAttribL2ui64vNV) +#define glVertexAttribL3i64NV GLEW_GET_FUN(__glewVertexAttribL3i64NV) +#define glVertexAttribL3i64vNV GLEW_GET_FUN(__glewVertexAttribL3i64vNV) +#define glVertexAttribL3ui64NV GLEW_GET_FUN(__glewVertexAttribL3ui64NV) +#define glVertexAttribL3ui64vNV GLEW_GET_FUN(__glewVertexAttribL3ui64vNV) +#define glVertexAttribL4i64NV GLEW_GET_FUN(__glewVertexAttribL4i64NV) +#define glVertexAttribL4i64vNV GLEW_GET_FUN(__glewVertexAttribL4i64vNV) +#define glVertexAttribL4ui64NV GLEW_GET_FUN(__glewVertexAttribL4ui64NV) +#define glVertexAttribL4ui64vNV GLEW_GET_FUN(__glewVertexAttribL4ui64vNV) +#define glVertexAttribLFormatNV GLEW_GET_FUN(__glewVertexAttribLFormatNV) + +#define GLEW_NV_vertex_attrib_integer_64bit GLEW_GET_VAR(__GLEW_NV_vertex_attrib_integer_64bit) + +#endif /* GL_NV_vertex_attrib_integer_64bit */ + +/* ------------------- GL_NV_vertex_buffer_unified_memory ------------------ */ + +#ifndef GL_NV_vertex_buffer_unified_memory +#define GL_NV_vertex_buffer_unified_memory 1 + +#define GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV 0x8F1E +#define GL_ELEMENT_ARRAY_UNIFIED_NV 0x8F1F +#define GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV 0x8F20 +#define GL_VERTEX_ARRAY_ADDRESS_NV 0x8F21 +#define GL_NORMAL_ARRAY_ADDRESS_NV 0x8F22 +#define GL_COLOR_ARRAY_ADDRESS_NV 0x8F23 +#define GL_INDEX_ARRAY_ADDRESS_NV 0x8F24 +#define GL_TEXTURE_COORD_ARRAY_ADDRESS_NV 0x8F25 +#define GL_EDGE_FLAG_ARRAY_ADDRESS_NV 0x8F26 +#define GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV 0x8F27 +#define GL_FOG_COORD_ARRAY_ADDRESS_NV 0x8F28 +#define GL_ELEMENT_ARRAY_ADDRESS_NV 0x8F29 +#define GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV 0x8F2A +#define GL_VERTEX_ARRAY_LENGTH_NV 0x8F2B +#define GL_NORMAL_ARRAY_LENGTH_NV 0x8F2C +#define GL_COLOR_ARRAY_LENGTH_NV 0x8F2D +#define GL_INDEX_ARRAY_LENGTH_NV 0x8F2E +#define GL_TEXTURE_COORD_ARRAY_LENGTH_NV 0x8F2F +#define GL_EDGE_FLAG_ARRAY_LENGTH_NV 0x8F30 +#define GL_SECONDARY_COLOR_ARRAY_LENGTH_NV 0x8F31 +#define GL_FOG_COORD_ARRAY_LENGTH_NV 0x8F32 +#define GL_ELEMENT_ARRAY_LENGTH_NV 0x8F33 +#define GL_DRAW_INDIRECT_UNIFIED_NV 0x8F40 +#define GL_DRAW_INDIRECT_ADDRESS_NV 0x8F41 +#define GL_DRAW_INDIRECT_LENGTH_NV 0x8F42 + +typedef void (GLAPIENTRY * PFNGLBUFFERADDRESSRANGENVPROC) (GLenum pname, GLuint index, GLuint64EXT address, GLsizeiptr length); +typedef void (GLAPIENTRY * PFNGLCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLEDGEFLAGFORMATNVPROC) (GLsizei stride); +typedef void (GLAPIENTRY * PFNGLFOGCOORDFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLGETINTEGERUI64I_VNVPROC) (GLenum value, GLuint index, GLuint64EXT result[]); +typedef void (GLAPIENTRY * PFNGLINDEXFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLNORMALFORMATNVPROC) (GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLSECONDARYCOLORFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLTEXCOORDFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBIFORMATNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride); +typedef void (GLAPIENTRY * PFNGLVERTEXFORMATNVPROC) (GLint size, GLenum type, GLsizei stride); + +#define glBufferAddressRangeNV GLEW_GET_FUN(__glewBufferAddressRangeNV) +#define glColorFormatNV GLEW_GET_FUN(__glewColorFormatNV) +#define glEdgeFlagFormatNV GLEW_GET_FUN(__glewEdgeFlagFormatNV) +#define glFogCoordFormatNV GLEW_GET_FUN(__glewFogCoordFormatNV) +#define glGetIntegerui64i_vNV GLEW_GET_FUN(__glewGetIntegerui64i_vNV) +#define glIndexFormatNV GLEW_GET_FUN(__glewIndexFormatNV) +#define glNormalFormatNV GLEW_GET_FUN(__glewNormalFormatNV) +#define glSecondaryColorFormatNV GLEW_GET_FUN(__glewSecondaryColorFormatNV) +#define glTexCoordFormatNV GLEW_GET_FUN(__glewTexCoordFormatNV) +#define glVertexAttribFormatNV GLEW_GET_FUN(__glewVertexAttribFormatNV) +#define glVertexAttribIFormatNV GLEW_GET_FUN(__glewVertexAttribIFormatNV) +#define glVertexFormatNV GLEW_GET_FUN(__glewVertexFormatNV) + +#define GLEW_NV_vertex_buffer_unified_memory GLEW_GET_VAR(__GLEW_NV_vertex_buffer_unified_memory) + +#endif /* GL_NV_vertex_buffer_unified_memory */ + +/* -------------------------- GL_NV_vertex_program ------------------------- */ + +#ifndef GL_NV_vertex_program +#define GL_NV_vertex_program 1 + +#define GL_VERTEX_PROGRAM_NV 0x8620 +#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 +#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 +#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 +#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 +#define GL_CURRENT_ATTRIB_NV 0x8626 +#define GL_PROGRAM_LENGTH_NV 0x8627 +#define GL_PROGRAM_STRING_NV 0x8628 +#define GL_MODELVIEW_PROJECTION_NV 0x8629 +#define GL_IDENTITY_NV 0x862A +#define GL_INVERSE_NV 0x862B +#define GL_TRANSPOSE_NV 0x862C +#define GL_INVERSE_TRANSPOSE_NV 0x862D +#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E +#define GL_MAX_TRACK_MATRICES_NV 0x862F +#define GL_MATRIX0_NV 0x8630 +#define GL_MATRIX1_NV 0x8631 +#define GL_MATRIX2_NV 0x8632 +#define GL_MATRIX3_NV 0x8633 +#define GL_MATRIX4_NV 0x8634 +#define GL_MATRIX5_NV 0x8635 +#define GL_MATRIX6_NV 0x8636 +#define GL_MATRIX7_NV 0x8637 +#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 +#define GL_CURRENT_MATRIX_NV 0x8641 +#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 +#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 +#define GL_PROGRAM_PARAMETER_NV 0x8644 +#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 +#define GL_PROGRAM_TARGET_NV 0x8646 +#define GL_PROGRAM_RESIDENT_NV 0x8647 +#define GL_TRACK_MATRIX_NV 0x8648 +#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 +#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A +#define GL_PROGRAM_ERROR_POSITION_NV 0x864B +#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 +#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 +#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 +#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 +#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 +#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 +#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 +#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 +#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 +#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 +#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A +#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B +#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C +#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D +#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E +#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F +#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 +#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 +#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 +#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 +#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 +#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 +#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 +#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 +#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 +#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 +#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A +#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B +#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C +#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D +#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E +#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F +#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 +#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 +#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 +#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 +#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 +#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 +#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 +#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 +#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 +#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 +#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A +#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B +#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C +#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D +#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E +#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F + +typedef GLboolean (GLAPIENTRY * PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint* ids, GLboolean *residences); +typedef void (GLAPIENTRY * PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); +typedef void (GLAPIENTRY * PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint* ids); +typedef void (GLAPIENTRY * PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte* program); +typedef void (GLAPIENTRY * PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid** pointer); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint* params); +typedef GLboolean (GLAPIENTRY * PFNGLISPROGRAMNVPROC) (GLuint id); +typedef void (GLAPIENTRY * PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte* program); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLdouble* params); +typedef void (GLAPIENTRY * PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLsizei num, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, GLuint* ids); +typedef void (GLAPIENTRY * PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint size, GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei n, const GLdouble* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei n, const GLfloat* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei n, const GLshort* v); +typedef void (GLAPIENTRY * PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei n, const GLubyte* v); + +#define glAreProgramsResidentNV GLEW_GET_FUN(__glewAreProgramsResidentNV) +#define glBindProgramNV GLEW_GET_FUN(__glewBindProgramNV) +#define glDeleteProgramsNV GLEW_GET_FUN(__glewDeleteProgramsNV) +#define glExecuteProgramNV GLEW_GET_FUN(__glewExecuteProgramNV) +#define glGenProgramsNV GLEW_GET_FUN(__glewGenProgramsNV) +#define glGetProgramParameterdvNV GLEW_GET_FUN(__glewGetProgramParameterdvNV) +#define glGetProgramParameterfvNV GLEW_GET_FUN(__glewGetProgramParameterfvNV) +#define glGetProgramStringNV GLEW_GET_FUN(__glewGetProgramStringNV) +#define glGetProgramivNV GLEW_GET_FUN(__glewGetProgramivNV) +#define glGetTrackMatrixivNV GLEW_GET_FUN(__glewGetTrackMatrixivNV) +#define glGetVertexAttribPointervNV GLEW_GET_FUN(__glewGetVertexAttribPointervNV) +#define glGetVertexAttribdvNV GLEW_GET_FUN(__glewGetVertexAttribdvNV) +#define glGetVertexAttribfvNV GLEW_GET_FUN(__glewGetVertexAttribfvNV) +#define glGetVertexAttribivNV GLEW_GET_FUN(__glewGetVertexAttribivNV) +#define glIsProgramNV GLEW_GET_FUN(__glewIsProgramNV) +#define glLoadProgramNV GLEW_GET_FUN(__glewLoadProgramNV) +#define glProgramParameter4dNV GLEW_GET_FUN(__glewProgramParameter4dNV) +#define glProgramParameter4dvNV GLEW_GET_FUN(__glewProgramParameter4dvNV) +#define glProgramParameter4fNV GLEW_GET_FUN(__glewProgramParameter4fNV) +#define glProgramParameter4fvNV GLEW_GET_FUN(__glewProgramParameter4fvNV) +#define glProgramParameters4dvNV GLEW_GET_FUN(__glewProgramParameters4dvNV) +#define glProgramParameters4fvNV GLEW_GET_FUN(__glewProgramParameters4fvNV) +#define glRequestResidentProgramsNV GLEW_GET_FUN(__glewRequestResidentProgramsNV) +#define glTrackMatrixNV GLEW_GET_FUN(__glewTrackMatrixNV) +#define glVertexAttrib1dNV GLEW_GET_FUN(__glewVertexAttrib1dNV) +#define glVertexAttrib1dvNV GLEW_GET_FUN(__glewVertexAttrib1dvNV) +#define glVertexAttrib1fNV GLEW_GET_FUN(__glewVertexAttrib1fNV) +#define glVertexAttrib1fvNV GLEW_GET_FUN(__glewVertexAttrib1fvNV) +#define glVertexAttrib1sNV GLEW_GET_FUN(__glewVertexAttrib1sNV) +#define glVertexAttrib1svNV GLEW_GET_FUN(__glewVertexAttrib1svNV) +#define glVertexAttrib2dNV GLEW_GET_FUN(__glewVertexAttrib2dNV) +#define glVertexAttrib2dvNV GLEW_GET_FUN(__glewVertexAttrib2dvNV) +#define glVertexAttrib2fNV GLEW_GET_FUN(__glewVertexAttrib2fNV) +#define glVertexAttrib2fvNV GLEW_GET_FUN(__glewVertexAttrib2fvNV) +#define glVertexAttrib2sNV GLEW_GET_FUN(__glewVertexAttrib2sNV) +#define glVertexAttrib2svNV GLEW_GET_FUN(__glewVertexAttrib2svNV) +#define glVertexAttrib3dNV GLEW_GET_FUN(__glewVertexAttrib3dNV) +#define glVertexAttrib3dvNV GLEW_GET_FUN(__glewVertexAttrib3dvNV) +#define glVertexAttrib3fNV GLEW_GET_FUN(__glewVertexAttrib3fNV) +#define glVertexAttrib3fvNV GLEW_GET_FUN(__glewVertexAttrib3fvNV) +#define glVertexAttrib3sNV GLEW_GET_FUN(__glewVertexAttrib3sNV) +#define glVertexAttrib3svNV GLEW_GET_FUN(__glewVertexAttrib3svNV) +#define glVertexAttrib4dNV GLEW_GET_FUN(__glewVertexAttrib4dNV) +#define glVertexAttrib4dvNV GLEW_GET_FUN(__glewVertexAttrib4dvNV) +#define glVertexAttrib4fNV GLEW_GET_FUN(__glewVertexAttrib4fNV) +#define glVertexAttrib4fvNV GLEW_GET_FUN(__glewVertexAttrib4fvNV) +#define glVertexAttrib4sNV GLEW_GET_FUN(__glewVertexAttrib4sNV) +#define glVertexAttrib4svNV GLEW_GET_FUN(__glewVertexAttrib4svNV) +#define glVertexAttrib4ubNV GLEW_GET_FUN(__glewVertexAttrib4ubNV) +#define glVertexAttrib4ubvNV GLEW_GET_FUN(__glewVertexAttrib4ubvNV) +#define glVertexAttribPointerNV GLEW_GET_FUN(__glewVertexAttribPointerNV) +#define glVertexAttribs1dvNV GLEW_GET_FUN(__glewVertexAttribs1dvNV) +#define glVertexAttribs1fvNV GLEW_GET_FUN(__glewVertexAttribs1fvNV) +#define glVertexAttribs1svNV GLEW_GET_FUN(__glewVertexAttribs1svNV) +#define glVertexAttribs2dvNV GLEW_GET_FUN(__glewVertexAttribs2dvNV) +#define glVertexAttribs2fvNV GLEW_GET_FUN(__glewVertexAttribs2fvNV) +#define glVertexAttribs2svNV GLEW_GET_FUN(__glewVertexAttribs2svNV) +#define glVertexAttribs3dvNV GLEW_GET_FUN(__glewVertexAttribs3dvNV) +#define glVertexAttribs3fvNV GLEW_GET_FUN(__glewVertexAttribs3fvNV) +#define glVertexAttribs3svNV GLEW_GET_FUN(__glewVertexAttribs3svNV) +#define glVertexAttribs4dvNV GLEW_GET_FUN(__glewVertexAttribs4dvNV) +#define glVertexAttribs4fvNV GLEW_GET_FUN(__glewVertexAttribs4fvNV) +#define glVertexAttribs4svNV GLEW_GET_FUN(__glewVertexAttribs4svNV) +#define glVertexAttribs4ubvNV GLEW_GET_FUN(__glewVertexAttribs4ubvNV) + +#define GLEW_NV_vertex_program GLEW_GET_VAR(__GLEW_NV_vertex_program) + +#endif /* GL_NV_vertex_program */ + +/* ------------------------ GL_NV_vertex_program1_1 ------------------------ */ + +#ifndef GL_NV_vertex_program1_1 +#define GL_NV_vertex_program1_1 1 + +#define GLEW_NV_vertex_program1_1 GLEW_GET_VAR(__GLEW_NV_vertex_program1_1) + +#endif /* GL_NV_vertex_program1_1 */ + +/* ------------------------- GL_NV_vertex_program2 ------------------------- */ + +#ifndef GL_NV_vertex_program2 +#define GL_NV_vertex_program2 1 + +#define GLEW_NV_vertex_program2 GLEW_GET_VAR(__GLEW_NV_vertex_program2) + +#endif /* GL_NV_vertex_program2 */ + +/* ---------------------- GL_NV_vertex_program2_option --------------------- */ + +#ifndef GL_NV_vertex_program2_option +#define GL_NV_vertex_program2_option 1 + +#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 +#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 + +#define GLEW_NV_vertex_program2_option GLEW_GET_VAR(__GLEW_NV_vertex_program2_option) + +#endif /* GL_NV_vertex_program2_option */ + +/* ------------------------- GL_NV_vertex_program3 ------------------------- */ + +#ifndef GL_NV_vertex_program3 +#define GL_NV_vertex_program3 1 + +#define MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C + +#define GLEW_NV_vertex_program3 GLEW_GET_VAR(__GLEW_NV_vertex_program3) + +#endif /* GL_NV_vertex_program3 */ + +/* ------------------------- GL_NV_vertex_program4 ------------------------- */ + +#ifndef GL_NV_vertex_program4 +#define GL_NV_vertex_program4 1 + +#define GL_VERTEX_ATTRIB_ARRAY_INTEGER_NV 0x88FD + +#define GLEW_NV_vertex_program4 GLEW_GET_VAR(__GLEW_NV_vertex_program4) + +#endif /* GL_NV_vertex_program4 */ + +/* ------------------------ GL_OES_byte_coordinates ------------------------ */ + +#ifndef GL_OES_byte_coordinates +#define GL_OES_byte_coordinates 1 + +#define GL_BYTE 0x1400 + +#define GLEW_OES_byte_coordinates GLEW_GET_VAR(__GLEW_OES_byte_coordinates) + +#endif /* GL_OES_byte_coordinates */ + +/* ------------------- GL_OES_compressed_paletted_texture ------------------ */ + +#ifndef GL_OES_compressed_paletted_texture +#define GL_OES_compressed_paletted_texture 1 + +#define GL_PALETTE4_RGB8_OES 0x8B90 +#define GL_PALETTE4_RGBA8_OES 0x8B91 +#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 +#define GL_PALETTE4_RGBA4_OES 0x8B93 +#define GL_PALETTE4_RGB5_A1_OES 0x8B94 +#define GL_PALETTE8_RGB8_OES 0x8B95 +#define GL_PALETTE8_RGBA8_OES 0x8B96 +#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 +#define GL_PALETTE8_RGBA4_OES 0x8B98 +#define GL_PALETTE8_RGB5_A1_OES 0x8B99 + +#define GLEW_OES_compressed_paletted_texture GLEW_GET_VAR(__GLEW_OES_compressed_paletted_texture) + +#endif /* GL_OES_compressed_paletted_texture */ + +/* --------------------------- GL_OES_read_format -------------------------- */ + +#ifndef GL_OES_read_format +#define GL_OES_read_format 1 + +#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A +#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B + +#define GLEW_OES_read_format GLEW_GET_VAR(__GLEW_OES_read_format) + +#endif /* GL_OES_read_format */ + +/* ------------------------ GL_OES_single_precision ------------------------ */ + +#ifndef GL_OES_single_precision +#define GL_OES_single_precision 1 + +typedef void (GLAPIENTRY * PFNGLCLEARDEPTHFOESPROC) (GLclampd depth); +typedef void (GLAPIENTRY * PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f); +typedef void (GLAPIENTRY * PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); +typedef void (GLAPIENTRY * PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat* equation); +typedef void (GLAPIENTRY * PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f); + +#define glClearDepthfOES GLEW_GET_FUN(__glewClearDepthfOES) +#define glClipPlanefOES GLEW_GET_FUN(__glewClipPlanefOES) +#define glDepthRangefOES GLEW_GET_FUN(__glewDepthRangefOES) +#define glFrustumfOES GLEW_GET_FUN(__glewFrustumfOES) +#define glGetClipPlanefOES GLEW_GET_FUN(__glewGetClipPlanefOES) +#define glOrthofOES GLEW_GET_FUN(__glewOrthofOES) + +#define GLEW_OES_single_precision GLEW_GET_VAR(__GLEW_OES_single_precision) + +#endif /* GL_OES_single_precision */ + +/* ---------------------------- GL_OML_interlace --------------------------- */ + +#ifndef GL_OML_interlace +#define GL_OML_interlace 1 + +#define GL_INTERLACE_OML 0x8980 +#define GL_INTERLACE_READ_OML 0x8981 + +#define GLEW_OML_interlace GLEW_GET_VAR(__GLEW_OML_interlace) + +#endif /* GL_OML_interlace */ + +/* ---------------------------- GL_OML_resample ---------------------------- */ + +#ifndef GL_OML_resample +#define GL_OML_resample 1 + +#define GL_PACK_RESAMPLE_OML 0x8984 +#define GL_UNPACK_RESAMPLE_OML 0x8985 +#define GL_RESAMPLE_REPLICATE_OML 0x8986 +#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 +#define GL_RESAMPLE_AVERAGE_OML 0x8988 +#define GL_RESAMPLE_DECIMATE_OML 0x8989 + +#define GLEW_OML_resample GLEW_GET_VAR(__GLEW_OML_resample) + +#endif /* GL_OML_resample */ + +/* ---------------------------- GL_OML_subsample --------------------------- */ + +#ifndef GL_OML_subsample +#define GL_OML_subsample 1 + +#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 +#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 + +#define GLEW_OML_subsample GLEW_GET_VAR(__GLEW_OML_subsample) + +#endif /* GL_OML_subsample */ + +/* --------------------------- GL_PGI_misc_hints --------------------------- */ + +#ifndef GL_PGI_misc_hints +#define GL_PGI_misc_hints 1 + +#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 107000 +#define GL_CONSERVE_MEMORY_HINT_PGI 107005 +#define GL_RECLAIM_MEMORY_HINT_PGI 107006 +#define GL_NATIVE_GRAPHICS_HANDLE_PGI 107010 +#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 107011 +#define GL_NATIVE_GRAPHICS_END_HINT_PGI 107012 +#define GL_ALWAYS_FAST_HINT_PGI 107020 +#define GL_ALWAYS_SOFT_HINT_PGI 107021 +#define GL_ALLOW_DRAW_OBJ_HINT_PGI 107022 +#define GL_ALLOW_DRAW_WIN_HINT_PGI 107023 +#define GL_ALLOW_DRAW_FRG_HINT_PGI 107024 +#define GL_ALLOW_DRAW_MEM_HINT_PGI 107025 +#define GL_STRICT_DEPTHFUNC_HINT_PGI 107030 +#define GL_STRICT_LIGHTING_HINT_PGI 107031 +#define GL_STRICT_SCISSOR_HINT_PGI 107032 +#define GL_FULL_STIPPLE_HINT_PGI 107033 +#define GL_CLIP_NEAR_HINT_PGI 107040 +#define GL_CLIP_FAR_HINT_PGI 107041 +#define GL_WIDE_LINE_HINT_PGI 107042 +#define GL_BACK_NORMALS_HINT_PGI 107043 + +#define GLEW_PGI_misc_hints GLEW_GET_VAR(__GLEW_PGI_misc_hints) + +#endif /* GL_PGI_misc_hints */ + +/* -------------------------- GL_PGI_vertex_hints -------------------------- */ + +#ifndef GL_PGI_vertex_hints +#define GL_PGI_vertex_hints 1 + +#define GL_VERTEX23_BIT_PGI 0x00000004 +#define GL_VERTEX4_BIT_PGI 0x00000008 +#define GL_COLOR3_BIT_PGI 0x00010000 +#define GL_COLOR4_BIT_PGI 0x00020000 +#define GL_EDGEFLAG_BIT_PGI 0x00040000 +#define GL_INDEX_BIT_PGI 0x00080000 +#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 +#define GL_VERTEX_DATA_HINT_PGI 107050 +#define GL_VERTEX_CONSISTENT_HINT_PGI 107051 +#define GL_MATERIAL_SIDE_HINT_PGI 107052 +#define GL_MAX_VERTEX_HINT_PGI 107053 +#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 +#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 +#define GL_MAT_EMISSION_BIT_PGI 0x00800000 +#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 +#define GL_MAT_SHININESS_BIT_PGI 0x02000000 +#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 +#define GL_NORMAL_BIT_PGI 0x08000000 +#define GL_TEXCOORD1_BIT_PGI 0x10000000 +#define GL_TEXCOORD2_BIT_PGI 0x20000000 +#define GL_TEXCOORD3_BIT_PGI 0x40000000 +#define GL_TEXCOORD4_BIT_PGI 0x80000000 + +#define GLEW_PGI_vertex_hints GLEW_GET_VAR(__GLEW_PGI_vertex_hints) + +#endif /* GL_PGI_vertex_hints */ + +/* ----------------------- GL_REND_screen_coordinates ---------------------- */ + +#ifndef GL_REND_screen_coordinates +#define GL_REND_screen_coordinates 1 + +#define GL_SCREEN_COORDINATES_REND 0x8490 +#define GL_INVERTED_SCREEN_W_REND 0x8491 + +#define GLEW_REND_screen_coordinates GLEW_GET_VAR(__GLEW_REND_screen_coordinates) + +#endif /* GL_REND_screen_coordinates */ + +/* ------------------------------- GL_S3_s3tc ------------------------------ */ + +#ifndef GL_S3_s3tc +#define GL_S3_s3tc 1 + +#define GL_RGB_S3TC 0x83A0 +#define GL_RGB4_S3TC 0x83A1 +#define GL_RGBA_S3TC 0x83A2 +#define GL_RGBA4_S3TC 0x83A3 +#define GL_RGBA_DXT5_S3TC 0x83A4 +#define GL_RGBA4_DXT5_S3TC 0x83A5 + +#define GLEW_S3_s3tc GLEW_GET_VAR(__GLEW_S3_s3tc) + +#endif /* GL_S3_s3tc */ + +/* -------------------------- GL_SGIS_color_range -------------------------- */ + +#ifndef GL_SGIS_color_range +#define GL_SGIS_color_range 1 + +#define GL_EXTENDED_RANGE_SGIS 0x85A5 +#define GL_MIN_RED_SGIS 0x85A6 +#define GL_MAX_RED_SGIS 0x85A7 +#define GL_MIN_GREEN_SGIS 0x85A8 +#define GL_MAX_GREEN_SGIS 0x85A9 +#define GL_MIN_BLUE_SGIS 0x85AA +#define GL_MAX_BLUE_SGIS 0x85AB +#define GL_MIN_ALPHA_SGIS 0x85AC +#define GL_MAX_ALPHA_SGIS 0x85AD + +#define GLEW_SGIS_color_range GLEW_GET_VAR(__GLEW_SGIS_color_range) + +#endif /* GL_SGIS_color_range */ + +/* ------------------------- GL_SGIS_detail_texture ------------------------ */ + +#ifndef GL_SGIS_detail_texture +#define GL_SGIS_detail_texture 1 + +typedef void (GLAPIENTRY * PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat* points); + +#define glDetailTexFuncSGIS GLEW_GET_FUN(__glewDetailTexFuncSGIS) +#define glGetDetailTexFuncSGIS GLEW_GET_FUN(__glewGetDetailTexFuncSGIS) + +#define GLEW_SGIS_detail_texture GLEW_GET_VAR(__GLEW_SGIS_detail_texture) + +#endif /* GL_SGIS_detail_texture */ + +/* -------------------------- GL_SGIS_fog_function ------------------------- */ + +#ifndef GL_SGIS_fog_function +#define GL_SGIS_fog_function 1 + +typedef void (GLAPIENTRY * PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat* points); +typedef void (GLAPIENTRY * PFNGLGETFOGFUNCSGISPROC) (GLfloat* points); + +#define glFogFuncSGIS GLEW_GET_FUN(__glewFogFuncSGIS) +#define glGetFogFuncSGIS GLEW_GET_FUN(__glewGetFogFuncSGIS) + +#define GLEW_SGIS_fog_function GLEW_GET_VAR(__GLEW_SGIS_fog_function) + +#endif /* GL_SGIS_fog_function */ + +/* ------------------------ GL_SGIS_generate_mipmap ------------------------ */ + +#ifndef GL_SGIS_generate_mipmap +#define GL_SGIS_generate_mipmap 1 + +#define GL_GENERATE_MIPMAP_SGIS 0x8191 +#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 + +#define GLEW_SGIS_generate_mipmap GLEW_GET_VAR(__GLEW_SGIS_generate_mipmap) + +#endif /* GL_SGIS_generate_mipmap */ + +/* -------------------------- GL_SGIS_multisample -------------------------- */ + +#ifndef GL_SGIS_multisample +#define GL_SGIS_multisample 1 + +#define GL_MULTISAMPLE_SGIS 0x809D +#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E +#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F +#define GL_SAMPLE_MASK_SGIS 0x80A0 +#define GL_1PASS_SGIS 0x80A1 +#define GL_2PASS_0_SGIS 0x80A2 +#define GL_2PASS_1_SGIS 0x80A3 +#define GL_4PASS_0_SGIS 0x80A4 +#define GL_4PASS_1_SGIS 0x80A5 +#define GL_4PASS_2_SGIS 0x80A6 +#define GL_4PASS_3_SGIS 0x80A7 +#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 +#define GL_SAMPLES_SGIS 0x80A9 +#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA +#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB +#define GL_SAMPLE_PATTERN_SGIS 0x80AC +#define GL_MULTISAMPLE_BIT_EXT 0x20000000 + +typedef void (GLAPIENTRY * PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); +typedef void (GLAPIENTRY * PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); + +#define glSampleMaskSGIS GLEW_GET_FUN(__glewSampleMaskSGIS) +#define glSamplePatternSGIS GLEW_GET_FUN(__glewSamplePatternSGIS) + +#define GLEW_SGIS_multisample GLEW_GET_VAR(__GLEW_SGIS_multisample) + +#endif /* GL_SGIS_multisample */ + +/* ------------------------- GL_SGIS_pixel_texture ------------------------- */ + +#ifndef GL_SGIS_pixel_texture +#define GL_SGIS_pixel_texture 1 + +#define GLEW_SGIS_pixel_texture GLEW_GET_VAR(__GLEW_SGIS_pixel_texture) + +#endif /* GL_SGIS_pixel_texture */ + +/* ----------------------- GL_SGIS_point_line_texgen ----------------------- */ + +#ifndef GL_SGIS_point_line_texgen +#define GL_SGIS_point_line_texgen 1 + +#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 +#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 +#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 +#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 +#define GL_EYE_POINT_SGIS 0x81F4 +#define GL_OBJECT_POINT_SGIS 0x81F5 +#define GL_EYE_LINE_SGIS 0x81F6 +#define GL_OBJECT_LINE_SGIS 0x81F7 + +#define GLEW_SGIS_point_line_texgen GLEW_GET_VAR(__GLEW_SGIS_point_line_texgen) + +#endif /* GL_SGIS_point_line_texgen */ + +/* ------------------------ GL_SGIS_sharpen_texture ------------------------ */ + +#ifndef GL_SGIS_sharpen_texture +#define GL_SGIS_sharpen_texture 1 + +typedef void (GLAPIENTRY * PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat* points); +typedef void (GLAPIENTRY * PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat* points); + +#define glGetSharpenTexFuncSGIS GLEW_GET_FUN(__glewGetSharpenTexFuncSGIS) +#define glSharpenTexFuncSGIS GLEW_GET_FUN(__glewSharpenTexFuncSGIS) + +#define GLEW_SGIS_sharpen_texture GLEW_GET_VAR(__GLEW_SGIS_sharpen_texture) + +#endif /* GL_SGIS_sharpen_texture */ + +/* --------------------------- GL_SGIS_texture4D --------------------------- */ + +#ifndef GL_SGIS_texture4D +#define GL_SGIS_texture4D 1 + +typedef void (GLAPIENTRY * PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLint border, GLenum format, GLenum type, const void* pixels); +typedef void (GLAPIENTRY * PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei extent, GLenum format, GLenum type, const void* pixels); + +#define glTexImage4DSGIS GLEW_GET_FUN(__glewTexImage4DSGIS) +#define glTexSubImage4DSGIS GLEW_GET_FUN(__glewTexSubImage4DSGIS) + +#define GLEW_SGIS_texture4D GLEW_GET_VAR(__GLEW_SGIS_texture4D) + +#endif /* GL_SGIS_texture4D */ + +/* ---------------------- GL_SGIS_texture_border_clamp --------------------- */ + +#ifndef GL_SGIS_texture_border_clamp +#define GL_SGIS_texture_border_clamp 1 + +#define GL_CLAMP_TO_BORDER_SGIS 0x812D + +#define GLEW_SGIS_texture_border_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_border_clamp) + +#endif /* GL_SGIS_texture_border_clamp */ + +/* ----------------------- GL_SGIS_texture_edge_clamp ---------------------- */ + +#ifndef GL_SGIS_texture_edge_clamp +#define GL_SGIS_texture_edge_clamp 1 + +#define GL_CLAMP_TO_EDGE_SGIS 0x812F + +#define GLEW_SGIS_texture_edge_clamp GLEW_GET_VAR(__GLEW_SGIS_texture_edge_clamp) + +#endif /* GL_SGIS_texture_edge_clamp */ + +/* ------------------------ GL_SGIS_texture_filter4 ------------------------ */ + +#ifndef GL_SGIS_texture_filter4 +#define GL_SGIS_texture_filter4 1 + +typedef void (GLAPIENTRY * PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat* weights); +typedef void (GLAPIENTRY * PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat* weights); + +#define glGetTexFilterFuncSGIS GLEW_GET_FUN(__glewGetTexFilterFuncSGIS) +#define glTexFilterFuncSGIS GLEW_GET_FUN(__glewTexFilterFuncSGIS) + +#define GLEW_SGIS_texture_filter4 GLEW_GET_VAR(__GLEW_SGIS_texture_filter4) + +#endif /* GL_SGIS_texture_filter4 */ + +/* -------------------------- GL_SGIS_texture_lod -------------------------- */ + +#ifndef GL_SGIS_texture_lod +#define GL_SGIS_texture_lod 1 + +#define GL_TEXTURE_MIN_LOD_SGIS 0x813A +#define GL_TEXTURE_MAX_LOD_SGIS 0x813B +#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C +#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D + +#define GLEW_SGIS_texture_lod GLEW_GET_VAR(__GLEW_SGIS_texture_lod) + +#endif /* GL_SGIS_texture_lod */ + +/* ------------------------- GL_SGIS_texture_select ------------------------ */ + +#ifndef GL_SGIS_texture_select +#define GL_SGIS_texture_select 1 + +#define GLEW_SGIS_texture_select GLEW_GET_VAR(__GLEW_SGIS_texture_select) + +#endif /* GL_SGIS_texture_select */ + +/* ----------------------------- GL_SGIX_async ----------------------------- */ + +#ifndef GL_SGIX_async +#define GL_SGIX_async 1 + +#define GL_ASYNC_MARKER_SGIX 0x8329 + +typedef void (GLAPIENTRY * PFNGLASYNCMARKERSGIXPROC) (GLuint marker); +typedef void (GLAPIENTRY * PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); +typedef GLint (GLAPIENTRY * PFNGLFINISHASYNCSGIXPROC) (GLuint* markerp); +typedef GLuint (GLAPIENTRY * PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); +typedef GLboolean (GLAPIENTRY * PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); +typedef GLint (GLAPIENTRY * PFNGLPOLLASYNCSGIXPROC) (GLuint* markerp); + +#define glAsyncMarkerSGIX GLEW_GET_FUN(__glewAsyncMarkerSGIX) +#define glDeleteAsyncMarkersSGIX GLEW_GET_FUN(__glewDeleteAsyncMarkersSGIX) +#define glFinishAsyncSGIX GLEW_GET_FUN(__glewFinishAsyncSGIX) +#define glGenAsyncMarkersSGIX GLEW_GET_FUN(__glewGenAsyncMarkersSGIX) +#define glIsAsyncMarkerSGIX GLEW_GET_FUN(__glewIsAsyncMarkerSGIX) +#define glPollAsyncSGIX GLEW_GET_FUN(__glewPollAsyncSGIX) + +#define GLEW_SGIX_async GLEW_GET_VAR(__GLEW_SGIX_async) + +#endif /* GL_SGIX_async */ + +/* ------------------------ GL_SGIX_async_histogram ------------------------ */ + +#ifndef GL_SGIX_async_histogram +#define GL_SGIX_async_histogram 1 + +#define GL_ASYNC_HISTOGRAM_SGIX 0x832C +#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D + +#define GLEW_SGIX_async_histogram GLEW_GET_VAR(__GLEW_SGIX_async_histogram) + +#endif /* GL_SGIX_async_histogram */ + +/* -------------------------- GL_SGIX_async_pixel -------------------------- */ + +#ifndef GL_SGIX_async_pixel +#define GL_SGIX_async_pixel 1 + +#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C +#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D +#define GL_ASYNC_READ_PIXELS_SGIX 0x835E +#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F +#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 +#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 + +#define GLEW_SGIX_async_pixel GLEW_GET_VAR(__GLEW_SGIX_async_pixel) + +#endif /* GL_SGIX_async_pixel */ + +/* ----------------------- GL_SGIX_blend_alpha_minmax ---------------------- */ + +#ifndef GL_SGIX_blend_alpha_minmax +#define GL_SGIX_blend_alpha_minmax 1 + +#define GL_ALPHA_MIN_SGIX 0x8320 +#define GL_ALPHA_MAX_SGIX 0x8321 + +#define GLEW_SGIX_blend_alpha_minmax GLEW_GET_VAR(__GLEW_SGIX_blend_alpha_minmax) + +#endif /* GL_SGIX_blend_alpha_minmax */ + +/* ---------------------------- GL_SGIX_clipmap ---------------------------- */ + +#ifndef GL_SGIX_clipmap +#define GL_SGIX_clipmap 1 + +#define GLEW_SGIX_clipmap GLEW_GET_VAR(__GLEW_SGIX_clipmap) + +#endif /* GL_SGIX_clipmap */ + +/* ---------------------- GL_SGIX_convolution_accuracy --------------------- */ + +#ifndef GL_SGIX_convolution_accuracy +#define GL_SGIX_convolution_accuracy 1 + +#define GL_CONVOLUTION_HINT_SGIX 0x8316 + +#define GLEW_SGIX_convolution_accuracy GLEW_GET_VAR(__GLEW_SGIX_convolution_accuracy) + +#endif /* GL_SGIX_convolution_accuracy */ + +/* ------------------------- GL_SGIX_depth_texture ------------------------- */ + +#ifndef GL_SGIX_depth_texture +#define GL_SGIX_depth_texture 1 + +#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 +#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 +#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 + +#define GLEW_SGIX_depth_texture GLEW_GET_VAR(__GLEW_SGIX_depth_texture) + +#endif /* GL_SGIX_depth_texture */ + +/* -------------------------- GL_SGIX_flush_raster ------------------------- */ + +#ifndef GL_SGIX_flush_raster +#define GL_SGIX_flush_raster 1 + +typedef void (GLAPIENTRY * PFNGLFLUSHRASTERSGIXPROC) (void); + +#define glFlushRasterSGIX GLEW_GET_FUN(__glewFlushRasterSGIX) + +#define GLEW_SGIX_flush_raster GLEW_GET_VAR(__GLEW_SGIX_flush_raster) + +#endif /* GL_SGIX_flush_raster */ + +/* --------------------------- GL_SGIX_fog_offset -------------------------- */ + +#ifndef GL_SGIX_fog_offset +#define GL_SGIX_fog_offset 1 + +#define GL_FOG_OFFSET_SGIX 0x8198 +#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 + +#define GLEW_SGIX_fog_offset GLEW_GET_VAR(__GLEW_SGIX_fog_offset) + +#endif /* GL_SGIX_fog_offset */ + +/* -------------------------- GL_SGIX_fog_texture -------------------------- */ + +#ifndef GL_SGIX_fog_texture +#define GL_SGIX_fog_texture 1 + +#define GL_TEXTURE_FOG_SGIX 0 +#define GL_FOG_PATCHY_FACTOR_SGIX 0 +#define GL_FRAGMENT_FOG_SGIX 0 + +typedef void (GLAPIENTRY * PFNGLTEXTUREFOGSGIXPROC) (GLenum pname); + +#define glTextureFogSGIX GLEW_GET_FUN(__glewTextureFogSGIX) + +#define GLEW_SGIX_fog_texture GLEW_GET_VAR(__GLEW_SGIX_fog_texture) + +#endif /* GL_SGIX_fog_texture */ + +/* ------------------- GL_SGIX_fragment_specular_lighting ------------------ */ + +#ifndef GL_SGIX_fragment_specular_lighting +#define GL_SGIX_fragment_specular_lighting 1 + +typedef void (GLAPIENTRY * PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, const GLfloat param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, const GLint param); +typedef void (GLAPIENTRY * PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum value, GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum value, GLint* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat* data); +typedef void (GLAPIENTRY * PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint* data); + +#define glFragmentColorMaterialSGIX GLEW_GET_FUN(__glewFragmentColorMaterialSGIX) +#define glFragmentLightModelfSGIX GLEW_GET_FUN(__glewFragmentLightModelfSGIX) +#define glFragmentLightModelfvSGIX GLEW_GET_FUN(__glewFragmentLightModelfvSGIX) +#define glFragmentLightModeliSGIX GLEW_GET_FUN(__glewFragmentLightModeliSGIX) +#define glFragmentLightModelivSGIX GLEW_GET_FUN(__glewFragmentLightModelivSGIX) +#define glFragmentLightfSGIX GLEW_GET_FUN(__glewFragmentLightfSGIX) +#define glFragmentLightfvSGIX GLEW_GET_FUN(__glewFragmentLightfvSGIX) +#define glFragmentLightiSGIX GLEW_GET_FUN(__glewFragmentLightiSGIX) +#define glFragmentLightivSGIX GLEW_GET_FUN(__glewFragmentLightivSGIX) +#define glFragmentMaterialfSGIX GLEW_GET_FUN(__glewFragmentMaterialfSGIX) +#define glFragmentMaterialfvSGIX GLEW_GET_FUN(__glewFragmentMaterialfvSGIX) +#define glFragmentMaterialiSGIX GLEW_GET_FUN(__glewFragmentMaterialiSGIX) +#define glFragmentMaterialivSGIX GLEW_GET_FUN(__glewFragmentMaterialivSGIX) +#define glGetFragmentLightfvSGIX GLEW_GET_FUN(__glewGetFragmentLightfvSGIX) +#define glGetFragmentLightivSGIX GLEW_GET_FUN(__glewGetFragmentLightivSGIX) +#define glGetFragmentMaterialfvSGIX GLEW_GET_FUN(__glewGetFragmentMaterialfvSGIX) +#define glGetFragmentMaterialivSGIX GLEW_GET_FUN(__glewGetFragmentMaterialivSGIX) + +#define GLEW_SGIX_fragment_specular_lighting GLEW_GET_VAR(__GLEW_SGIX_fragment_specular_lighting) + +#endif /* GL_SGIX_fragment_specular_lighting */ + +/* --------------------------- GL_SGIX_framezoom --------------------------- */ + +#ifndef GL_SGIX_framezoom +#define GL_SGIX_framezoom 1 + +typedef void (GLAPIENTRY * PFNGLFRAMEZOOMSGIXPROC) (GLint factor); + +#define glFrameZoomSGIX GLEW_GET_FUN(__glewFrameZoomSGIX) + +#define GLEW_SGIX_framezoom GLEW_GET_VAR(__GLEW_SGIX_framezoom) + +#endif /* GL_SGIX_framezoom */ + +/* --------------------------- GL_SGIX_interlace --------------------------- */ + +#ifndef GL_SGIX_interlace +#define GL_SGIX_interlace 1 + +#define GL_INTERLACE_SGIX 0x8094 + +#define GLEW_SGIX_interlace GLEW_GET_VAR(__GLEW_SGIX_interlace) + +#endif /* GL_SGIX_interlace */ + +/* ------------------------- GL_SGIX_ir_instrument1 ------------------------ */ + +#ifndef GL_SGIX_ir_instrument1 +#define GL_SGIX_ir_instrument1 1 + +#define GLEW_SGIX_ir_instrument1 GLEW_GET_VAR(__GLEW_SGIX_ir_instrument1) + +#endif /* GL_SGIX_ir_instrument1 */ + +/* ------------------------- GL_SGIX_list_priority ------------------------- */ + +#ifndef GL_SGIX_list_priority +#define GL_SGIX_list_priority 1 + +#define GLEW_SGIX_list_priority GLEW_GET_VAR(__GLEW_SGIX_list_priority) + +#endif /* GL_SGIX_list_priority */ + +/* ------------------------- GL_SGIX_pixel_texture ------------------------- */ + +#ifndef GL_SGIX_pixel_texture +#define GL_SGIX_pixel_texture 1 + +typedef void (GLAPIENTRY * PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); + +#define glPixelTexGenSGIX GLEW_GET_FUN(__glewPixelTexGenSGIX) + +#define GLEW_SGIX_pixel_texture GLEW_GET_VAR(__GLEW_SGIX_pixel_texture) + +#endif /* GL_SGIX_pixel_texture */ + +/* ----------------------- GL_SGIX_pixel_texture_bits ---------------------- */ + +#ifndef GL_SGIX_pixel_texture_bits +#define GL_SGIX_pixel_texture_bits 1 + +#define GLEW_SGIX_pixel_texture_bits GLEW_GET_VAR(__GLEW_SGIX_pixel_texture_bits) + +#endif /* GL_SGIX_pixel_texture_bits */ + +/* ------------------------ GL_SGIX_reference_plane ------------------------ */ + +#ifndef GL_SGIX_reference_plane +#define GL_SGIX_reference_plane 1 + +typedef void (GLAPIENTRY * PFNGLREFERENCEPLANESGIXPROC) (const GLdouble* equation); + +#define glReferencePlaneSGIX GLEW_GET_FUN(__glewReferencePlaneSGIX) + +#define GLEW_SGIX_reference_plane GLEW_GET_VAR(__GLEW_SGIX_reference_plane) + +#endif /* GL_SGIX_reference_plane */ + +/* ---------------------------- GL_SGIX_resample --------------------------- */ + +#ifndef GL_SGIX_resample +#define GL_SGIX_resample 1 + +#define GL_PACK_RESAMPLE_SGIX 0x842E +#define GL_UNPACK_RESAMPLE_SGIX 0x842F +#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 +#define GL_RESAMPLE_REPLICATE_SGIX 0x8433 +#define GL_RESAMPLE_ZERO_FILL_SGIX 0x8434 + +#define GLEW_SGIX_resample GLEW_GET_VAR(__GLEW_SGIX_resample) + +#endif /* GL_SGIX_resample */ + +/* ----------------------------- GL_SGIX_shadow ---------------------------- */ + +#ifndef GL_SGIX_shadow +#define GL_SGIX_shadow 1 + +#define GL_TEXTURE_COMPARE_SGIX 0x819A +#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B +#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C +#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D + +#define GLEW_SGIX_shadow GLEW_GET_VAR(__GLEW_SGIX_shadow) + +#endif /* GL_SGIX_shadow */ + +/* ------------------------- GL_SGIX_shadow_ambient ------------------------ */ + +#ifndef GL_SGIX_shadow_ambient +#define GL_SGIX_shadow_ambient 1 + +#define GL_SHADOW_AMBIENT_SGIX 0x80BF + +#define GLEW_SGIX_shadow_ambient GLEW_GET_VAR(__GLEW_SGIX_shadow_ambient) + +#endif /* GL_SGIX_shadow_ambient */ + +/* ----------------------------- GL_SGIX_sprite ---------------------------- */ + +#ifndef GL_SGIX_sprite +#define GL_SGIX_sprite 1 + +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); +typedef void (GLAPIENTRY * PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, GLint* params); + +#define glSpriteParameterfSGIX GLEW_GET_FUN(__glewSpriteParameterfSGIX) +#define glSpriteParameterfvSGIX GLEW_GET_FUN(__glewSpriteParameterfvSGIX) +#define glSpriteParameteriSGIX GLEW_GET_FUN(__glewSpriteParameteriSGIX) +#define glSpriteParameterivSGIX GLEW_GET_FUN(__glewSpriteParameterivSGIX) + +#define GLEW_SGIX_sprite GLEW_GET_VAR(__GLEW_SGIX_sprite) + +#endif /* GL_SGIX_sprite */ + +/* ----------------------- GL_SGIX_tag_sample_buffer ----------------------- */ + +#ifndef GL_SGIX_tag_sample_buffer +#define GL_SGIX_tag_sample_buffer 1 + +typedef void (GLAPIENTRY * PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); + +#define glTagSampleBufferSGIX GLEW_GET_FUN(__glewTagSampleBufferSGIX) + +#define GLEW_SGIX_tag_sample_buffer GLEW_GET_VAR(__GLEW_SGIX_tag_sample_buffer) + +#endif /* GL_SGIX_tag_sample_buffer */ + +/* ------------------------ GL_SGIX_texture_add_env ------------------------ */ + +#ifndef GL_SGIX_texture_add_env +#define GL_SGIX_texture_add_env 1 + +#define GLEW_SGIX_texture_add_env GLEW_GET_VAR(__GLEW_SGIX_texture_add_env) + +#endif /* GL_SGIX_texture_add_env */ + +/* -------------------- GL_SGIX_texture_coordinate_clamp ------------------- */ + +#ifndef GL_SGIX_texture_coordinate_clamp +#define GL_SGIX_texture_coordinate_clamp 1 + +#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 +#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A +#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B + +#define GLEW_SGIX_texture_coordinate_clamp GLEW_GET_VAR(__GLEW_SGIX_texture_coordinate_clamp) + +#endif /* GL_SGIX_texture_coordinate_clamp */ + +/* ------------------------ GL_SGIX_texture_lod_bias ----------------------- */ + +#ifndef GL_SGIX_texture_lod_bias +#define GL_SGIX_texture_lod_bias 1 + +#define GLEW_SGIX_texture_lod_bias GLEW_GET_VAR(__GLEW_SGIX_texture_lod_bias) + +#endif /* GL_SGIX_texture_lod_bias */ + +/* ---------------------- GL_SGIX_texture_multi_buffer --------------------- */ + +#ifndef GL_SGIX_texture_multi_buffer +#define GL_SGIX_texture_multi_buffer 1 + +#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E + +#define GLEW_SGIX_texture_multi_buffer GLEW_GET_VAR(__GLEW_SGIX_texture_multi_buffer) + +#endif /* GL_SGIX_texture_multi_buffer */ + +/* ------------------------- GL_SGIX_texture_range ------------------------- */ + +#ifndef GL_SGIX_texture_range +#define GL_SGIX_texture_range 1 + +#define GL_RGB_SIGNED_SGIX 0x85E0 +#define GL_RGBA_SIGNED_SGIX 0x85E1 +#define GL_ALPHA_SIGNED_SGIX 0x85E2 +#define GL_LUMINANCE_SIGNED_SGIX 0x85E3 +#define GL_INTENSITY_SIGNED_SGIX 0x85E4 +#define GL_LUMINANCE_ALPHA_SIGNED_SGIX 0x85E5 +#define GL_RGB16_SIGNED_SGIX 0x85E6 +#define GL_RGBA16_SIGNED_SGIX 0x85E7 +#define GL_ALPHA16_SIGNED_SGIX 0x85E8 +#define GL_LUMINANCE16_SIGNED_SGIX 0x85E9 +#define GL_INTENSITY16_SIGNED_SGIX 0x85EA +#define GL_LUMINANCE16_ALPHA16_SIGNED_SGIX 0x85EB +#define GL_RGB_EXTENDED_RANGE_SGIX 0x85EC +#define GL_RGBA_EXTENDED_RANGE_SGIX 0x85ED +#define GL_ALPHA_EXTENDED_RANGE_SGIX 0x85EE +#define GL_LUMINANCE_EXTENDED_RANGE_SGIX 0x85EF +#define GL_INTENSITY_EXTENDED_RANGE_SGIX 0x85F0 +#define GL_LUMINANCE_ALPHA_EXTENDED_RANGE_SGIX 0x85F1 +#define GL_RGB16_EXTENDED_RANGE_SGIX 0x85F2 +#define GL_RGBA16_EXTENDED_RANGE_SGIX 0x85F3 +#define GL_ALPHA16_EXTENDED_RANGE_SGIX 0x85F4 +#define GL_LUMINANCE16_EXTENDED_RANGE_SGIX 0x85F5 +#define GL_INTENSITY16_EXTENDED_RANGE_SGIX 0x85F6 +#define GL_LUMINANCE16_ALPHA16_EXTENDED_RANGE_SGIX 0x85F7 +#define GL_MIN_LUMINANCE_SGIS 0x85F8 +#define GL_MAX_LUMINANCE_SGIS 0x85F9 +#define GL_MIN_INTENSITY_SGIS 0x85FA +#define GL_MAX_INTENSITY_SGIS 0x85FB + +#define GLEW_SGIX_texture_range GLEW_GET_VAR(__GLEW_SGIX_texture_range) + +#endif /* GL_SGIX_texture_range */ + +/* ----------------------- GL_SGIX_texture_scale_bias ---------------------- */ + +#ifndef GL_SGIX_texture_scale_bias +#define GL_SGIX_texture_scale_bias 1 + +#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 +#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A +#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B +#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C + +#define GLEW_SGIX_texture_scale_bias GLEW_GET_VAR(__GLEW_SGIX_texture_scale_bias) + +#endif /* GL_SGIX_texture_scale_bias */ + +/* ------------------------- GL_SGIX_vertex_preclip ------------------------ */ + +#ifndef GL_SGIX_vertex_preclip +#define GL_SGIX_vertex_preclip 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip) + +#endif /* GL_SGIX_vertex_preclip */ + +/* ---------------------- GL_SGIX_vertex_preclip_hint ---------------------- */ + +#ifndef GL_SGIX_vertex_preclip_hint +#define GL_SGIX_vertex_preclip_hint 1 + +#define GL_VERTEX_PRECLIP_SGIX 0x83EE +#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF + +#define GLEW_SGIX_vertex_preclip_hint GLEW_GET_VAR(__GLEW_SGIX_vertex_preclip_hint) + +#endif /* GL_SGIX_vertex_preclip_hint */ + +/* ----------------------------- GL_SGIX_ycrcb ----------------------------- */ + +#ifndef GL_SGIX_ycrcb +#define GL_SGIX_ycrcb 1 + +#define GLEW_SGIX_ycrcb GLEW_GET_VAR(__GLEW_SGIX_ycrcb) + +#endif /* GL_SGIX_ycrcb */ + +/* -------------------------- GL_SGI_color_matrix -------------------------- */ + +#ifndef GL_SGI_color_matrix +#define GL_SGI_color_matrix 1 + +#define GL_COLOR_MATRIX_SGI 0x80B1 +#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 +#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 +#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 +#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 +#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 +#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 +#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 +#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 +#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA +#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB + +#define GLEW_SGI_color_matrix GLEW_GET_VAR(__GLEW_SGI_color_matrix) + +#endif /* GL_SGI_color_matrix */ + +/* --------------------------- GL_SGI_color_table -------------------------- */ + +#ifndef GL_SGI_color_table +#define GL_SGI_color_table 1 + +#define GL_COLOR_TABLE_SGI 0x80D0 +#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 +#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 +#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 +#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 +#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 +#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 +#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 +#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 +#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 +#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA +#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB +#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC +#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD +#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE +#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF + +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint* params); +typedef void (GLAPIENTRY * PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const void* table); +typedef void (GLAPIENTRY * PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint* params); +typedef void (GLAPIENTRY * PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, void* table); + +#define glColorTableParameterfvSGI GLEW_GET_FUN(__glewColorTableParameterfvSGI) +#define glColorTableParameterivSGI GLEW_GET_FUN(__glewColorTableParameterivSGI) +#define glColorTableSGI GLEW_GET_FUN(__glewColorTableSGI) +#define glCopyColorTableSGI GLEW_GET_FUN(__glewCopyColorTableSGI) +#define glGetColorTableParameterfvSGI GLEW_GET_FUN(__glewGetColorTableParameterfvSGI) +#define glGetColorTableParameterivSGI GLEW_GET_FUN(__glewGetColorTableParameterivSGI) +#define glGetColorTableSGI GLEW_GET_FUN(__glewGetColorTableSGI) + +#define GLEW_SGI_color_table GLEW_GET_VAR(__GLEW_SGI_color_table) + +#endif /* GL_SGI_color_table */ + +/* ----------------------- GL_SGI_texture_color_table ---------------------- */ + +#ifndef GL_SGI_texture_color_table +#define GL_SGI_texture_color_table 1 + +#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC +#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD + +#define GLEW_SGI_texture_color_table GLEW_GET_VAR(__GLEW_SGI_texture_color_table) + +#endif /* GL_SGI_texture_color_table */ + +/* ------------------------- GL_SUNX_constant_data ------------------------- */ + +#ifndef GL_SUNX_constant_data +#define GL_SUNX_constant_data 1 + +#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 +#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 + +typedef void (GLAPIENTRY * PFNGLFINISHTEXTURESUNXPROC) (void); + +#define glFinishTextureSUNX GLEW_GET_FUN(__glewFinishTextureSUNX) + +#define GLEW_SUNX_constant_data GLEW_GET_VAR(__GLEW_SUNX_constant_data) + +#endif /* GL_SUNX_constant_data */ + +/* -------------------- GL_SUN_convolution_border_modes -------------------- */ + +#ifndef GL_SUN_convolution_border_modes +#define GL_SUN_convolution_border_modes 1 + +#define GL_WRAP_BORDER_SUN 0x81D4 + +#define GLEW_SUN_convolution_border_modes GLEW_GET_VAR(__GLEW_SUN_convolution_border_modes) + +#endif /* GL_SUN_convolution_border_modes */ + +/* -------------------------- GL_SUN_global_alpha -------------------------- */ + +#ifndef GL_SUN_global_alpha +#define GL_SUN_global_alpha 1 + +#define GL_GLOBAL_ALPHA_SUN 0x81D9 +#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA + +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); +typedef void (GLAPIENTRY * PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); + +#define glGlobalAlphaFactorbSUN GLEW_GET_FUN(__glewGlobalAlphaFactorbSUN) +#define glGlobalAlphaFactordSUN GLEW_GET_FUN(__glewGlobalAlphaFactordSUN) +#define glGlobalAlphaFactorfSUN GLEW_GET_FUN(__glewGlobalAlphaFactorfSUN) +#define glGlobalAlphaFactoriSUN GLEW_GET_FUN(__glewGlobalAlphaFactoriSUN) +#define glGlobalAlphaFactorsSUN GLEW_GET_FUN(__glewGlobalAlphaFactorsSUN) +#define glGlobalAlphaFactorubSUN GLEW_GET_FUN(__glewGlobalAlphaFactorubSUN) +#define glGlobalAlphaFactoruiSUN GLEW_GET_FUN(__glewGlobalAlphaFactoruiSUN) +#define glGlobalAlphaFactorusSUN GLEW_GET_FUN(__glewGlobalAlphaFactorusSUN) + +#define GLEW_SUN_global_alpha GLEW_GET_VAR(__GLEW_SUN_global_alpha) + +#endif /* GL_SUN_global_alpha */ + +/* --------------------------- GL_SUN_mesh_array --------------------------- */ + +#ifndef GL_SUN_mesh_array +#define GL_SUN_mesh_array 1 + +#define GL_QUAD_MESH_SUN 0x8614 +#define GL_TRIANGLE_MESH_SUN 0x8615 + +#define GLEW_SUN_mesh_array GLEW_GET_VAR(__GLEW_SUN_mesh_array) + +#endif /* GL_SUN_mesh_array */ + +/* ------------------------ GL_SUN_read_video_pixels ----------------------- */ + +#ifndef GL_SUN_read_video_pixels +#define GL_SUN_read_video_pixels 1 + +typedef void (GLAPIENTRY * PFNGLREADVIDEOPIXELSSUNPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid* pixels); + +#define glReadVideoPixelsSUN GLEW_GET_FUN(__glewReadVideoPixelsSUN) + +#define GLEW_SUN_read_video_pixels GLEW_GET_VAR(__GLEW_SUN_read_video_pixels) + +#endif /* GL_SUN_read_video_pixels */ + +/* --------------------------- GL_SUN_slice_accum -------------------------- */ + +#ifndef GL_SUN_slice_accum +#define GL_SUN_slice_accum 1 + +#define GL_SLICE_ACCUM_SUN 0x85CC + +#define GLEW_SUN_slice_accum GLEW_GET_VAR(__GLEW_SUN_slice_accum) + +#endif /* GL_SUN_slice_accum */ + +/* -------------------------- GL_SUN_triangle_list ------------------------- */ + +#ifndef GL_SUN_triangle_list +#define GL_SUN_triangle_list 1 + +#define GL_RESTART_SUN 0x01 +#define GL_REPLACE_MIDDLE_SUN 0x02 +#define GL_REPLACE_OLDEST_SUN 0x03 +#define GL_TRIANGLE_LIST_SUN 0x81D7 +#define GL_REPLACEMENT_CODE_SUN 0x81D8 +#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 +#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 +#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 +#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 +#define GL_R1UI_V3F_SUN 0x85C4 +#define GL_R1UI_C4UB_V3F_SUN 0x85C5 +#define GL_R1UI_C3F_V3F_SUN 0x85C6 +#define GL_R1UI_N3F_V3F_SUN 0x85C7 +#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 +#define GL_R1UI_T2F_V3F_SUN 0x85C9 +#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA +#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB + +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const void* pointer); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint* code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort* code); + +#define glReplacementCodePointerSUN GLEW_GET_FUN(__glewReplacementCodePointerSUN) +#define glReplacementCodeubSUN GLEW_GET_FUN(__glewReplacementCodeubSUN) +#define glReplacementCodeubvSUN GLEW_GET_FUN(__glewReplacementCodeubvSUN) +#define glReplacementCodeuiSUN GLEW_GET_FUN(__glewReplacementCodeuiSUN) +#define glReplacementCodeuivSUN GLEW_GET_FUN(__glewReplacementCodeuivSUN) +#define glReplacementCodeusSUN GLEW_GET_FUN(__glewReplacementCodeusSUN) +#define glReplacementCodeusvSUN GLEW_GET_FUN(__glewReplacementCodeusvSUN) + +#define GLEW_SUN_triangle_list GLEW_GET_VAR(__GLEW_SUN_triangle_list) + +#endif /* GL_SUN_triangle_list */ + +/* ----------------------------- GL_SUN_vertex ----------------------------- */ + +#ifndef GL_SUN_vertex +#define GL_SUN_vertex 1 + +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte* c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint* rc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint* rc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat* tc, const GLubyte *c, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); +typedef void (GLAPIENTRY * PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat* tc, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); +typedef void (GLAPIENTRY * PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat* tc, const GLfloat *v); + +#define glColor3fVertex3fSUN GLEW_GET_FUN(__glewColor3fVertex3fSUN) +#define glColor3fVertex3fvSUN GLEW_GET_FUN(__glewColor3fVertex3fvSUN) +#define glColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fSUN) +#define glColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewColor4fNormal3fVertex3fvSUN) +#define glColor4ubVertex2fSUN GLEW_GET_FUN(__glewColor4ubVertex2fSUN) +#define glColor4ubVertex2fvSUN GLEW_GET_FUN(__glewColor4ubVertex2fvSUN) +#define glColor4ubVertex3fSUN GLEW_GET_FUN(__glewColor4ubVertex3fSUN) +#define glColor4ubVertex3fvSUN GLEW_GET_FUN(__glewColor4ubVertex3fvSUN) +#define glNormal3fVertex3fSUN GLEW_GET_FUN(__glewNormal3fVertex3fSUN) +#define glNormal3fVertex3fvSUN GLEW_GET_FUN(__glewNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fSUN) +#define glReplacementCodeuiColor3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor3fVertex3fvSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiColor4ubVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fSUN) +#define glReplacementCodeuiColor4ubVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiColor4ubVertex3fvSUN) +#define glReplacementCodeuiNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fSUN) +#define glReplacementCodeuiNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN) +#define glReplacementCodeuiTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fSUN) +#define glReplacementCodeuiTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiTexCoord2fVertex3fvSUN) +#define glReplacementCodeuiVertex3fSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fSUN) +#define glReplacementCodeuiVertex3fvSUN GLEW_GET_FUN(__glewReplacementCodeuiVertex3fvSUN) +#define glTexCoord2fColor3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fSUN) +#define glTexCoord2fColor3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor3fVertex3fvSUN) +#define glTexCoord2fColor4fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fSUN) +#define glTexCoord2fColor4fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4fNormal3fVertex3fvSUN) +#define glTexCoord2fColor4ubVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fSUN) +#define glTexCoord2fColor4ubVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fColor4ubVertex3fvSUN) +#define glTexCoord2fNormal3fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fSUN) +#define glTexCoord2fNormal3fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fNormal3fVertex3fvSUN) +#define glTexCoord2fVertex3fSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fSUN) +#define glTexCoord2fVertex3fvSUN GLEW_GET_FUN(__glewTexCoord2fVertex3fvSUN) +#define glTexCoord4fColor4fNormal3fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fSUN) +#define glTexCoord4fColor4fNormal3fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fColor4fNormal3fVertex4fvSUN) +#define glTexCoord4fVertex4fSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fSUN) +#define glTexCoord4fVertex4fvSUN GLEW_GET_FUN(__glewTexCoord4fVertex4fvSUN) + +#define GLEW_SUN_vertex GLEW_GET_VAR(__GLEW_SUN_vertex) + +#endif /* GL_SUN_vertex */ + +/* -------------------------- GL_WIN_phong_shading ------------------------- */ + +#ifndef GL_WIN_phong_shading +#define GL_WIN_phong_shading 1 + +#define GL_PHONG_WIN 0x80EA +#define GL_PHONG_HINT_WIN 0x80EB + +#define GLEW_WIN_phong_shading GLEW_GET_VAR(__GLEW_WIN_phong_shading) + +#endif /* GL_WIN_phong_shading */ + +/* -------------------------- GL_WIN_specular_fog -------------------------- */ + +#ifndef GL_WIN_specular_fog +#define GL_WIN_specular_fog 1 + +#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC + +#define GLEW_WIN_specular_fog GLEW_GET_VAR(__GLEW_WIN_specular_fog) + +#endif /* GL_WIN_specular_fog */ + +/* ---------------------------- GL_WIN_swap_hint --------------------------- */ + +#ifndef GL_WIN_swap_hint +#define GL_WIN_swap_hint 1 + +typedef void (GLAPIENTRY * PFNGLADDSWAPHINTRECTWINPROC) (GLint x, GLint y, GLsizei width, GLsizei height); + +#define glAddSwapHintRectWIN GLEW_GET_FUN(__glewAddSwapHintRectWIN) + +#define GLEW_WIN_swap_hint GLEW_GET_VAR(__GLEW_WIN_swap_hint) + +#endif /* GL_WIN_swap_hint */ + +/* ------------------------------------------------------------------------- */ + +#if defined(GLEW_MX) && defined(_WIN32) +#define GLEW_FUN_EXPORT +#else +#define GLEW_FUN_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) +#define GLEW_VAR_EXPORT +#else +#define GLEW_VAR_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#if defined(GLEW_MX) && defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DPROC __glewCopyTexSubImage3D; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSPROC __glewDrawRangeElements; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DPROC __glewTexImage3D; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DPROC __glewTexSubImage3D; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREPROC __glewActiveTexture; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREPROC __glewClientActiveTexture; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DPROC __glewCompressedTexImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DPROC __glewCompressedTexImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DPROC __glewCompressedTexImage3D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC __glewCompressedTexSubImage1D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC __glewCompressedTexSubImage2D; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC __glewCompressedTexSubImage3D; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEPROC __glewGetCompressedTexImage; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDPROC __glewLoadTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFPROC __glewLoadTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDPROC __glewMultTransposeMatrixd; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFPROC __glewMultTransposeMatrixf; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DPROC __glewMultiTexCoord1d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVPROC __glewMultiTexCoord1dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FPROC __glewMultiTexCoord1f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVPROC __glewMultiTexCoord1fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IPROC __glewMultiTexCoord1i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVPROC __glewMultiTexCoord1iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SPROC __glewMultiTexCoord1s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVPROC __glewMultiTexCoord1sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DPROC __glewMultiTexCoord2d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVPROC __glewMultiTexCoord2dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FPROC __glewMultiTexCoord2f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVPROC __glewMultiTexCoord2fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IPROC __glewMultiTexCoord2i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVPROC __glewMultiTexCoord2iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SPROC __glewMultiTexCoord2s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVPROC __glewMultiTexCoord2sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DPROC __glewMultiTexCoord3d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVPROC __glewMultiTexCoord3dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FPROC __glewMultiTexCoord3f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVPROC __glewMultiTexCoord3fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IPROC __glewMultiTexCoord3i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVPROC __glewMultiTexCoord3iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SPROC __glewMultiTexCoord3s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVPROC __glewMultiTexCoord3sv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DPROC __glewMultiTexCoord4d; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVPROC __glewMultiTexCoord4dv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FPROC __glewMultiTexCoord4f; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVPROC __glewMultiTexCoord4fv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IPROC __glewMultiTexCoord4i; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVPROC __glewMultiTexCoord4iv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SPROC __glewMultiTexCoord4s; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVPROC __glewMultiTexCoord4sv; +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEPROC __glewSampleCoverage; + +GLEW_FUN_EXPORT PFNGLBLENDCOLORPROC __glewBlendColor; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONPROC __glewBlendEquation; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEPROC __glewBlendFuncSeparate; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERPROC __glewFogCoordPointer; +GLEW_FUN_EXPORT PFNGLFOGCOORDDPROC __glewFogCoordd; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVPROC __glewFogCoorddv; +GLEW_FUN_EXPORT PFNGLFOGCOORDFPROC __glewFogCoordf; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVPROC __glewFogCoordfv; +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSPROC __glewMultiDrawArrays; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSPROC __glewMultiDrawElements; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFPROC __glewPointParameterf; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVPROC __glewPointParameterfv; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIPROC __glewPointParameteri; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVPROC __glewPointParameteriv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BPROC __glewSecondaryColor3b; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVPROC __glewSecondaryColor3bv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DPROC __glewSecondaryColor3d; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVPROC __glewSecondaryColor3dv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FPROC __glewSecondaryColor3f; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVPROC __glewSecondaryColor3fv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IPROC __glewSecondaryColor3i; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVPROC __glewSecondaryColor3iv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SPROC __glewSecondaryColor3s; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVPROC __glewSecondaryColor3sv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBPROC __glewSecondaryColor3ub; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVPROC __glewSecondaryColor3ubv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIPROC __glewSecondaryColor3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVPROC __glewSecondaryColor3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USPROC __glewSecondaryColor3us; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVPROC __glewSecondaryColor3usv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERPROC __glewSecondaryColorPointer; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DPROC __glewWindowPos2d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVPROC __glewWindowPos2dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FPROC __glewWindowPos2f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVPROC __glewWindowPos2fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IPROC __glewWindowPos2i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVPROC __glewWindowPos2iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SPROC __glewWindowPos2s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVPROC __glewWindowPos2sv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DPROC __glewWindowPos3d; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVPROC __glewWindowPos3dv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FPROC __glewWindowPos3f; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVPROC __glewWindowPos3fv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IPROC __glewWindowPos3i; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVPROC __glewWindowPos3iv; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SPROC __glewWindowPos3s; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVPROC __glewWindowPos3sv; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYPROC __glewBeginQuery; +GLEW_FUN_EXPORT PFNGLBINDBUFFERPROC __glewBindBuffer; +GLEW_FUN_EXPORT PFNGLBUFFERDATAPROC __glewBufferData; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAPROC __glewBufferSubData; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSPROC __glewDeleteBuffers; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESPROC __glewDeleteQueries; +GLEW_FUN_EXPORT PFNGLENDQUERYPROC __glewEndQuery; +GLEW_FUN_EXPORT PFNGLGENBUFFERSPROC __glewGenBuffers; +GLEW_FUN_EXPORT PFNGLGENQUERIESPROC __glewGenQueries; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVPROC __glewGetBufferParameteriv; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVPROC __glewGetBufferPointerv; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAPROC __glewGetBufferSubData; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVPROC __glewGetQueryObjectiv; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVPROC __glewGetQueryObjectuiv; +GLEW_FUN_EXPORT PFNGLGETQUERYIVPROC __glewGetQueryiv; +GLEW_FUN_EXPORT PFNGLISBUFFERPROC __glewIsBuffer; +GLEW_FUN_EXPORT PFNGLISQUERYPROC __glewIsQuery; +GLEW_FUN_EXPORT PFNGLMAPBUFFERPROC __glewMapBuffer; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERPROC __glewUnmapBuffer; + +GLEW_FUN_EXPORT PFNGLATTACHSHADERPROC __glewAttachShader; +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONPROC __glewBindAttribLocation; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEPROC __glewBlendEquationSeparate; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERPROC __glewCompileShader; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMPROC __glewCreateProgram; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROC __glewCreateShader; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPROC __glewDeleteProgram; +GLEW_FUN_EXPORT PFNGLDELETESHADERPROC __glewDeleteShader; +GLEW_FUN_EXPORT PFNGLDETACHSHADERPROC __glewDetachShader; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYPROC __glewDisableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSPROC __glewDrawBuffers; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYPROC __glewEnableVertexAttribArray; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBPROC __glewGetActiveAttrib; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMPROC __glewGetActiveUniform; +GLEW_FUN_EXPORT PFNGLGETATTACHEDSHADERSPROC __glewGetAttachedShaders; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONPROC __glewGetAttribLocation; +GLEW_FUN_EXPORT PFNGLGETPROGRAMINFOLOGPROC __glewGetProgramInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVPROC __glewGetProgramiv; +GLEW_FUN_EXPORT PFNGLGETSHADERINFOLOGPROC __glewGetShaderInfoLog; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEPROC __glewGetShaderSource; +GLEW_FUN_EXPORT PFNGLGETSHADERIVPROC __glewGetShaderiv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONPROC __glewGetUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVPROC __glewGetUniformfv; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVPROC __glewGetUniformiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVPROC __glewGetVertexAttribPointerv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVPROC __glewGetVertexAttribdv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVPROC __glewGetVertexAttribfv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVPROC __glewGetVertexAttribiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPROC __glewIsProgram; +GLEW_FUN_EXPORT PFNGLISSHADERPROC __glewIsShader; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMPROC __glewLinkProgram; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEPROC __glewShaderSource; +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEPROC __glewStencilFuncSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILMASKSEPARATEPROC __glewStencilMaskSeparate; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEPROC __glewStencilOpSeparate; +GLEW_FUN_EXPORT PFNGLUNIFORM1FPROC __glewUniform1f; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVPROC __glewUniform1fv; +GLEW_FUN_EXPORT PFNGLUNIFORM1IPROC __glewUniform1i; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVPROC __glewUniform1iv; +GLEW_FUN_EXPORT PFNGLUNIFORM2FPROC __glewUniform2f; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVPROC __glewUniform2fv; +GLEW_FUN_EXPORT PFNGLUNIFORM2IPROC __glewUniform2i; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVPROC __glewUniform2iv; +GLEW_FUN_EXPORT PFNGLUNIFORM3FPROC __glewUniform3f; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVPROC __glewUniform3fv; +GLEW_FUN_EXPORT PFNGLUNIFORM3IPROC __glewUniform3i; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVPROC __glewUniform3iv; +GLEW_FUN_EXPORT PFNGLUNIFORM4FPROC __glewUniform4f; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVPROC __glewUniform4fv; +GLEW_FUN_EXPORT PFNGLUNIFORM4IPROC __glewUniform4i; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVPROC __glewUniform4iv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVPROC __glewUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVPROC __glewUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVPROC __glewUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMPROC __glewUseProgram; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPROC __glewValidateProgram; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DPROC __glewVertexAttrib1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVPROC __glewVertexAttrib1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FPROC __glewVertexAttrib1f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVPROC __glewVertexAttrib1fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SPROC __glewVertexAttrib1s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVPROC __glewVertexAttrib1sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DPROC __glewVertexAttrib2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVPROC __glewVertexAttrib2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FPROC __glewVertexAttrib2f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVPROC __glewVertexAttrib2fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SPROC __glewVertexAttrib2s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVPROC __glewVertexAttrib2sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DPROC __glewVertexAttrib3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVPROC __glewVertexAttrib3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FPROC __glewVertexAttrib3f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVPROC __glewVertexAttrib3fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SPROC __glewVertexAttrib3s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVPROC __glewVertexAttrib3sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVPROC __glewVertexAttrib4Nbv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVPROC __glewVertexAttrib4Niv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVPROC __glewVertexAttrib4Nsv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBPROC __glewVertexAttrib4Nub; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVPROC __glewVertexAttrib4Nubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVPROC __glewVertexAttrib4Nuiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVPROC __glewVertexAttrib4Nusv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVPROC __glewVertexAttrib4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DPROC __glewVertexAttrib4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVPROC __glewVertexAttrib4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FPROC __glewVertexAttrib4f; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVPROC __glewVertexAttrib4fv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVPROC __glewVertexAttrib4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SPROC __glewVertexAttrib4s; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVPROC __glewVertexAttrib4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVPROC __glewVertexAttrib4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVPROC __glewVertexAttrib4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVPROC __glewVertexAttrib4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERPROC __glewVertexAttribPointer; + +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3FVPROC __glewUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4FVPROC __glewUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2FVPROC __glewUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4FVPROC __glewUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2FVPROC __glewUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3FVPROC __glewUniformMatrix4x3fv; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERPROC __glewBeginConditionalRender; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKPROC __glewBeginTransformFeedback; +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONPROC __glewBindFragDataLocation; +GLEW_FUN_EXPORT PFNGLCLAMPCOLORPROC __glewClampColor; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFIPROC __glewClearBufferfi; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERFVPROC __glewClearBufferfv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERIVPROC __glewClearBufferiv; +GLEW_FUN_EXPORT PFNGLCLEARBUFFERUIVPROC __glewClearBufferuiv; +GLEW_FUN_EXPORT PFNGLCOLORMASKIPROC __glewColorMaski; +GLEW_FUN_EXPORT PFNGLDISABLEIPROC __glewDisablei; +GLEW_FUN_EXPORT PFNGLENABLEIPROC __glewEnablei; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERPROC __glewEndConditionalRender; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKPROC __glewEndTransformFeedback; +GLEW_FUN_EXPORT PFNGLGETBOOLEANI_VPROC __glewGetBooleani_v; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONPROC __glewGetFragDataLocation; +GLEW_FUN_EXPORT PFNGLGETSTRINGIPROC __glewGetStringi; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVPROC __glewGetTexParameterIiv; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVPROC __glewGetTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGPROC __glewGetTransformFeedbackVarying; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVPROC __glewGetUniformuiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVPROC __glewGetVertexAttribIiv; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVPROC __glewGetVertexAttribIuiv; +GLEW_FUN_EXPORT PFNGLISENABLEDIPROC __glewIsEnabledi; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVPROC __glewTexParameterIiv; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVPROC __glewTexParameterIuiv; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSPROC __glewTransformFeedbackVaryings; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIPROC __glewUniform1ui; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVPROC __glewUniform1uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIPROC __glewUniform2ui; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVPROC __glewUniform2uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIPROC __glewUniform3ui; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVPROC __glewUniform3uiv; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIPROC __glewUniform4ui; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVPROC __glewUniform4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IPROC __glewVertexAttribI1i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVPROC __glewVertexAttribI1iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIPROC __glewVertexAttribI1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVPROC __glewVertexAttribI1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IPROC __glewVertexAttribI2i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVPROC __glewVertexAttribI2iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIPROC __glewVertexAttribI2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVPROC __glewVertexAttribI2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IPROC __glewVertexAttribI3i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVPROC __glewVertexAttribI3iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIPROC __glewVertexAttribI3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVPROC __glewVertexAttribI3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVPROC __glewVertexAttribI4bv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IPROC __glewVertexAttribI4i; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVPROC __glewVertexAttribI4iv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVPROC __glewVertexAttribI4sv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVPROC __glewVertexAttribI4ubv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIPROC __glewVertexAttribI4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVPROC __glewVertexAttribI4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVPROC __glewVertexAttribI4usv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTERPROC __glewVertexAttribIPointer; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDPROC __glewDrawArraysInstanced; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDPROC __glewDrawElementsInstanced; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXPROC __glewPrimitiveRestartIndex; +GLEW_FUN_EXPORT PFNGLTEXBUFFERPROC __glewTexBuffer; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREPROC __glewFramebufferTexture; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERI64VPROC __glewGetBufferParameteri64v; +GLEW_FUN_EXPORT PFNGLGETINTEGER64I_VPROC __glewGetInteger64i_v; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORPROC __glewVertexAttribDivisor; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIPROC __glewBlendEquationSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIPROC __glewBlendEquationi; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIPROC __glewBlendFuncSeparatei; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIPROC __glewBlendFunci; +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGPROC __glewMinSampleShading; + +GLEW_FUN_EXPORT PFNGLTBUFFERMASK3DFXPROC __glewTbufferMask3DFX; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKAMDPROC __glewDebugMessageCallbackAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEENABLEAMDPROC __glewDebugMessageEnableAMD; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTAMDPROC __glewDebugMessageInsertAMD; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGAMDPROC __glewGetDebugMessageLogAMD; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONINDEXEDAMDPROC __glewBlendEquationIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEINDEXEDAMDPROC __glewBlendEquationSeparateIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCINDEXEDAMDPROC __glewBlendFuncIndexedAMD; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEINDEXEDAMDPROC __glewBlendFuncSeparateIndexedAMD; + +GLEW_FUN_EXPORT PFNGLDELETENAMESAMDPROC __glewDeleteNamesAMD; +GLEW_FUN_EXPORT PFNGLGENNAMESAMDPROC __glewGenNamesAMD; +GLEW_FUN_EXPORT PFNGLISNAMEAMDPROC __glewIsNameAMD; + +GLEW_FUN_EXPORT PFNGLBEGINPERFMONITORAMDPROC __glewBeginPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLDELETEPERFMONITORSAMDPROC __glewDeletePerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLENDPERFMONITORAMDPROC __glewEndPerfMonitorAMD; +GLEW_FUN_EXPORT PFNGLGENPERFMONITORSAMDPROC __glewGenPerfMonitorsAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERDATAAMDPROC __glewGetPerfMonitorCounterDataAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERINFOAMDPROC __glewGetPerfMonitorCounterInfoAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSTRINGAMDPROC __glewGetPerfMonitorCounterStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORCOUNTERSAMDPROC __glewGetPerfMonitorCountersAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSTRINGAMDPROC __glewGetPerfMonitorGroupStringAMD; +GLEW_FUN_EXPORT PFNGLGETPERFMONITORGROUPSAMDPROC __glewGetPerfMonitorGroupsAMD; +GLEW_FUN_EXPORT PFNGLSELECTPERFMONITORCOUNTERSAMDPROC __glewSelectPerfMonitorCountersAMD; + +GLEW_FUN_EXPORT PFNGLTESSELLATIONFACTORAMDPROC __glewTessellationFactorAMD; +GLEW_FUN_EXPORT PFNGLTESSELLATIONMODEAMDPROC __glewTessellationModeAMD; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYAPPLEPROC __glewDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC __glewDrawRangeElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERAPPLEPROC __glewElementPointerAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC __glewMultiDrawElementArrayAPPLE; +GLEW_FUN_EXPORT PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC __glewMultiDrawRangeElementArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESAPPLEPROC __glewDeleteFencesAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHFENCEAPPLEPROC __glewFinishFenceAPPLE; +GLEW_FUN_EXPORT PFNGLFINISHOBJECTAPPLEPROC __glewFinishObjectAPPLE; +GLEW_FUN_EXPORT PFNGLGENFENCESAPPLEPROC __glewGenFencesAPPLE; +GLEW_FUN_EXPORT PFNGLISFENCEAPPLEPROC __glewIsFenceAPPLE; +GLEW_FUN_EXPORT PFNGLSETFENCEAPPLEPROC __glewSetFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTFENCEAPPLEPROC __glewTestFenceAPPLE; +GLEW_FUN_EXPORT PFNGLTESTOBJECTAPPLEPROC __glewTestObjectAPPLE; + +GLEW_FUN_EXPORT PFNGLBUFFERPARAMETERIAPPLEPROC __glewBufferParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC __glewFlushMappedBufferRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVAPPLEPROC __glewGetObjectParameterivAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTPURGEABLEAPPLEPROC __glewObjectPurgeableAPPLE; +GLEW_FUN_EXPORT PFNGLOBJECTUNPURGEABLEAPPLEPROC __glewObjectUnpurgeableAPPLE; + +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERPOINTERVAPPLEPROC __glewGetTexParameterPointervAPPLE; +GLEW_FUN_EXPORT PFNGLTEXTURERANGEAPPLEPROC __glewTextureRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYAPPLEPROC __glewBindVertexArrayAPPLE; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSAPPLEPROC __glewDeleteVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSAPPLEPROC __glewGenVertexArraysAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYAPPLEPROC __glewIsVertexArrayAPPLE; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC __glewFlushVertexArrayRangeAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYPARAMETERIAPPLEPROC __glewVertexArrayParameteriAPPLE; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGEAPPLEPROC __glewVertexArrayRangeAPPLE; + +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBAPPLEPROC __glewDisableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBAPPLEPROC __glewEnableVertexAttribAPPLE; +GLEW_FUN_EXPORT PFNGLISVERTEXATTRIBENABLEDAPPLEPROC __glewIsVertexAttribEnabledAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1DAPPLEPROC __glewMapVertexAttrib1dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB1FAPPLEPROC __glewMapVertexAttrib1fAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2DAPPLEPROC __glewMapVertexAttrib2dAPPLE; +GLEW_FUN_EXPORT PFNGLMAPVERTEXATTRIB2FAPPLEPROC __glewMapVertexAttrib2fAPPLE; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFPROC __glewClearDepthf; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFPROC __glewDepthRangef; +GLEW_FUN_EXPORT PFNGLGETSHADERPRECISIONFORMATPROC __glewGetShaderPrecisionFormat; +GLEW_FUN_EXPORT PFNGLRELEASESHADERCOMPILERPROC __glewReleaseShaderCompiler; +GLEW_FUN_EXPORT PFNGLSHADERBINARYPROC __glewShaderBinary; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONINDEXEDPROC __glewBindFragDataLocationIndexed; +GLEW_FUN_EXPORT PFNGLGETFRAGDATAINDEXPROC __glewGetFragDataIndex; + +GLEW_FUN_EXPORT PFNGLCREATESYNCFROMCLEVENTARBPROC __glewCreateSyncFromCLeventARB; + +GLEW_FUN_EXPORT PFNGLCLAMPCOLORARBPROC __glewClampColorARB; + +GLEW_FUN_EXPORT PFNGLCOPYBUFFERSUBDATAPROC __glewCopyBufferSubData; + +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECALLBACKARBPROC __glewDebugMessageCallbackARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGECONTROLARBPROC __glewDebugMessageControlARB; +GLEW_FUN_EXPORT PFNGLDEBUGMESSAGEINSERTARBPROC __glewDebugMessageInsertARB; +GLEW_FUN_EXPORT PFNGLGETDEBUGMESSAGELOGARBPROC __glewGetDebugMessageLogARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSARBPROC __glewDrawBuffersARB; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEIARBPROC __glewBlendEquationSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONIARBPROC __glewBlendEquationiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEIARBPROC __glewBlendFuncSeparateiARB; +GLEW_FUN_EXPORT PFNGLBLENDFUNCIARBPROC __glewBlendFunciARB; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSBASEVERTEXPROC __glewDrawElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXPROC __glewDrawElementsInstancedBaseVertex; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSBASEVERTEXPROC __glewDrawRangeElementsBaseVertex; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSBASEVERTEXPROC __glewMultiDrawElementsBaseVertex; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINDIRECTPROC __glewDrawArraysIndirect; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINDIRECTPROC __glewDrawElementsIndirect; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDARBPROC __glewDrawArraysInstancedARB; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDARBPROC __glewDrawElementsInstancedARB; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFERPROC __glewBindFramebuffer; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFERPROC __glewBindRenderbuffer; +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFERPROC __glewBlitFramebuffer; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSPROC __glewCheckFramebufferStatus; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSPROC __glewDeleteFramebuffers; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSPROC __glewDeleteRenderbuffers; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFERPROC __glewFramebufferRenderbuffer; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DPROC __glewFramebufferTexture1D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DPROC __glewFramebufferTexture2D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DPROC __glewFramebufferTexture3D; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERPROC __glewFramebufferTextureLayer; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSPROC __glewGenFramebuffers; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSPROC __glewGenRenderbuffers; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPPROC __glewGenerateMipmap; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC __glewGetFramebufferAttachmentParameteriv; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVPROC __glewGetRenderbufferParameteriv; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFERPROC __glewIsFramebuffer; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFERPROC __glewIsRenderbuffer; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEPROC __glewRenderbufferStorage; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEPROC __glewRenderbufferStorageMultisample; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREARBPROC __glewFramebufferTextureARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEARBPROC __glewFramebufferTextureFaceARB; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYERARBPROC __glewFramebufferTextureLayerARB; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIARBPROC __glewProgramParameteriARB; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMBINARYPROC __glewGetProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMBINARYPROC __glewProgramBinary; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIPROC __glewProgramParameteri; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMDVPROC __glewGetUniformdv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DEXTPROC __glewProgramUniform1dEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVEXTPROC __glewProgramUniform1dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DEXTPROC __glewProgramUniform2dEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVEXTPROC __glewProgramUniform2dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DEXTPROC __glewProgramUniform3dEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVEXTPROC __glewProgramUniform3dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DEXTPROC __glewProgramUniform4dEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVEXTPROC __glewProgramUniform4dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVEXTPROC __glewProgramUniformMatrix2dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVEXTPROC __glewProgramUniformMatrix2x3dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVEXTPROC __glewProgramUniformMatrix2x4dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVEXTPROC __glewProgramUniformMatrix3dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVEXTPROC __glewProgramUniformMatrix3x2dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVEXTPROC __glewProgramUniformMatrix3x4dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVEXTPROC __glewProgramUniformMatrix4dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVEXTPROC __glewProgramUniformMatrix4x2dvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVEXTPROC __glewProgramUniformMatrix4x3dvEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1DPROC __glewUniform1d; +GLEW_FUN_EXPORT PFNGLUNIFORM1DVPROC __glewUniform1dv; +GLEW_FUN_EXPORT PFNGLUNIFORM2DPROC __glewUniform2d; +GLEW_FUN_EXPORT PFNGLUNIFORM2DVPROC __glewUniform2dv; +GLEW_FUN_EXPORT PFNGLUNIFORM3DPROC __glewUniform3d; +GLEW_FUN_EXPORT PFNGLUNIFORM3DVPROC __glewUniform3dv; +GLEW_FUN_EXPORT PFNGLUNIFORM4DPROC __glewUniform4d; +GLEW_FUN_EXPORT PFNGLUNIFORM4DVPROC __glewUniform4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2DVPROC __glewUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X3DVPROC __glewUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2X4DVPROC __glewUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3DVPROC __glewUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X2DVPROC __glewUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3X4DVPROC __glewUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4DVPROC __glewUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X2DVPROC __glewUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4X3DVPROC __glewUniformMatrix4x3dv; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEPROC __glewColorSubTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPROC __glewColorTable; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVPROC __glewColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVPROC __glewColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DPROC __glewConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DPROC __glewConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFPROC __glewConvolutionParameterf; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVPROC __glewConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIPROC __glewConvolutionParameteri; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVPROC __glewConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEPROC __glewCopyColorSubTable; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLEPROC __glewCopyColorTable; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DPROC __glewCopyConvolutionFilter1D; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DPROC __glewCopyConvolutionFilter2D; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPROC __glewGetColorTable; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVPROC __glewGetColorTableParameterfv; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVPROC __glewGetColorTableParameteriv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTERPROC __glewGetConvolutionFilter; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVPROC __glewGetConvolutionParameterfv; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVPROC __glewGetConvolutionParameteriv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPROC __glewGetHistogram; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVPROC __glewGetHistogramParameterfv; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVPROC __glewGetHistogramParameteriv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPROC __glewGetMinmax; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVPROC __glewGetMinmaxParameterfv; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVPROC __glewGetMinmaxParameteriv; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTERPROC __glewGetSeparableFilter; +GLEW_FUN_EXPORT PFNGLHISTOGRAMPROC __glewHistogram; +GLEW_FUN_EXPORT PFNGLMINMAXPROC __glewMinmax; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMPROC __glewResetHistogram; +GLEW_FUN_EXPORT PFNGLRESETMINMAXPROC __glewResetMinmax; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DPROC __glewSeparableFilter2D; + +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBDIVISORARBPROC __glewVertexAttribDivisorARB; + +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDBUFFERRANGEPROC __glewFlushMappedBufferRange; +GLEW_FUN_EXPORT PFNGLMAPBUFFERRANGEPROC __glewMapBufferRange; + +GLEW_FUN_EXPORT PFNGLCURRENTPALETTEMATRIXARBPROC __glewCurrentPaletteMatrixARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXPOINTERARBPROC __glewMatrixIndexPointerARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUBVARBPROC __glewMatrixIndexubvARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUIVARBPROC __glewMatrixIndexuivARB; +GLEW_FUN_EXPORT PFNGLMATRIXINDEXUSVARBPROC __glewMatrixIndexusvARB; + +GLEW_FUN_EXPORT PFNGLSAMPLECOVERAGEARBPROC __glewSampleCoverageARB; + +GLEW_FUN_EXPORT PFNGLACTIVETEXTUREARBPROC __glewActiveTextureARB; +GLEW_FUN_EXPORT PFNGLCLIENTACTIVETEXTUREARBPROC __glewClientActiveTextureARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DARBPROC __glewMultiTexCoord1dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1DVARBPROC __glewMultiTexCoord1dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FARBPROC __glewMultiTexCoord1fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1FVARBPROC __glewMultiTexCoord1fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IARBPROC __glewMultiTexCoord1iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1IVARBPROC __glewMultiTexCoord1ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SARBPROC __glewMultiTexCoord1sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1SVARBPROC __glewMultiTexCoord1svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DARBPROC __glewMultiTexCoord2dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2DVARBPROC __glewMultiTexCoord2dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FARBPROC __glewMultiTexCoord2fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2FVARBPROC __glewMultiTexCoord2fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IARBPROC __glewMultiTexCoord2iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2IVARBPROC __glewMultiTexCoord2ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SARBPROC __glewMultiTexCoord2sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2SVARBPROC __glewMultiTexCoord2svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DARBPROC __glewMultiTexCoord3dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3DVARBPROC __glewMultiTexCoord3dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FARBPROC __glewMultiTexCoord3fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3FVARBPROC __glewMultiTexCoord3fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IARBPROC __glewMultiTexCoord3iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3IVARBPROC __glewMultiTexCoord3ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SARBPROC __glewMultiTexCoord3sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3SVARBPROC __glewMultiTexCoord3svARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DARBPROC __glewMultiTexCoord4dARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4DVARBPROC __glewMultiTexCoord4dvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FARBPROC __glewMultiTexCoord4fARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4FVARBPROC __glewMultiTexCoord4fvARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IARBPROC __glewMultiTexCoord4iARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4IVARBPROC __glewMultiTexCoord4ivARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SARBPROC __glewMultiTexCoord4sARB; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4SVARBPROC __glewMultiTexCoord4svARB; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYARBPROC __glewBeginQueryARB; +GLEW_FUN_EXPORT PFNGLDELETEQUERIESARBPROC __glewDeleteQueriesARB; +GLEW_FUN_EXPORT PFNGLENDQUERYARBPROC __glewEndQueryARB; +GLEW_FUN_EXPORT PFNGLGENQUERIESARBPROC __glewGenQueriesARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTIVARBPROC __glewGetQueryObjectivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUIVARBPROC __glewGetQueryObjectuivARB; +GLEW_FUN_EXPORT PFNGLGETQUERYIVARBPROC __glewGetQueryivARB; +GLEW_FUN_EXPORT PFNGLISQUERYARBPROC __glewIsQueryARB; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFARBPROC __glewPointParameterfARB; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVARBPROC __glewPointParameterfvARB; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXPROC __glewProvokingVertex; + +GLEW_FUN_EXPORT PFNGLGETNCOLORTABLEARBPROC __glewGetnColorTableARB; +GLEW_FUN_EXPORT PFNGLGETNCOMPRESSEDTEXIMAGEARBPROC __glewGetnCompressedTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNCONVOLUTIONFILTERARBPROC __glewGetnConvolutionFilterARB; +GLEW_FUN_EXPORT PFNGLGETNHISTOGRAMARBPROC __glewGetnHistogramARB; +GLEW_FUN_EXPORT PFNGLGETNMAPDVARBPROC __glewGetnMapdvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPFVARBPROC __glewGetnMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNMAPIVARBPROC __glewGetnMapivARB; +GLEW_FUN_EXPORT PFNGLGETNMINMAXARBPROC __glewGetnMinmaxARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPFVARBPROC __glewGetnPixelMapfvARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUIVARBPROC __glewGetnPixelMapuivARB; +GLEW_FUN_EXPORT PFNGLGETNPIXELMAPUSVARBPROC __glewGetnPixelMapusvARB; +GLEW_FUN_EXPORT PFNGLGETNPOLYGONSTIPPLEARBPROC __glewGetnPolygonStippleARB; +GLEW_FUN_EXPORT PFNGLGETNSEPARABLEFILTERARBPROC __glewGetnSeparableFilterARB; +GLEW_FUN_EXPORT PFNGLGETNTEXIMAGEARBPROC __glewGetnTexImageARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMDVARBPROC __glewGetnUniformdvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMFVARBPROC __glewGetnUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMIVARBPROC __glewGetnUniformivARB; +GLEW_FUN_EXPORT PFNGLGETNUNIFORMUIVARBPROC __glewGetnUniformuivARB; +GLEW_FUN_EXPORT PFNGLREADNPIXELSARBPROC __glewReadnPixelsARB; + +GLEW_FUN_EXPORT PFNGLMINSAMPLESHADINGARBPROC __glewMinSampleShadingARB; + +GLEW_FUN_EXPORT PFNGLBINDSAMPLERPROC __glewBindSampler; +GLEW_FUN_EXPORT PFNGLDELETESAMPLERSPROC __glewDeleteSamplers; +GLEW_FUN_EXPORT PFNGLGENSAMPLERSPROC __glewGenSamplers; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIIVPROC __glewGetSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIUIVPROC __glewGetSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERFVPROC __glewGetSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLGETSAMPLERPARAMETERIVPROC __glewGetSamplerParameteriv; +GLEW_FUN_EXPORT PFNGLISSAMPLERPROC __glewIsSampler; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIIVPROC __glewSamplerParameterIiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIUIVPROC __glewSamplerParameterIuiv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFPROC __glewSamplerParameterf; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERFVPROC __glewSamplerParameterfv; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIPROC __glewSamplerParameteri; +GLEW_FUN_EXPORT PFNGLSAMPLERPARAMETERIVPROC __glewSamplerParameteriv; + +GLEW_FUN_EXPORT PFNGLACTIVESHADERPROGRAMPROC __glewActiveShaderProgram; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMPIPELINEPROC __glewBindProgramPipeline; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMVPROC __glewCreateShaderProgramv; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMPIPELINESPROC __glewDeleteProgramPipelines; +GLEW_FUN_EXPORT PFNGLGENPROGRAMPIPELINESPROC __glewGenProgramPipelines; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEINFOLOGPROC __glewGetProgramPipelineInfoLog; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPIPELINEIVPROC __glewGetProgramPipelineiv; +GLEW_FUN_EXPORT PFNGLISPROGRAMPIPELINEPROC __glewIsProgramPipeline; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DPROC __glewProgramUniform1d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1DVPROC __glewProgramUniform1dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FPROC __glewProgramUniform1f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVPROC __glewProgramUniform1fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IPROC __glewProgramUniform1i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVPROC __glewProgramUniform1iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIPROC __glewProgramUniform1ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVPROC __glewProgramUniform1uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DPROC __glewProgramUniform2d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2DVPROC __glewProgramUniform2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FPROC __glewProgramUniform2f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVPROC __glewProgramUniform2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IPROC __glewProgramUniform2i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVPROC __glewProgramUniform2iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIPROC __glewProgramUniform2ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVPROC __glewProgramUniform2uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DPROC __glewProgramUniform3d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3DVPROC __glewProgramUniform3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FPROC __glewProgramUniform3f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVPROC __glewProgramUniform3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IPROC __glewProgramUniform3i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVPROC __glewProgramUniform3iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIPROC __glewProgramUniform3ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVPROC __glewProgramUniform3uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DPROC __glewProgramUniform4d; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4DVPROC __glewProgramUniform4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FPROC __glewProgramUniform4f; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVPROC __glewProgramUniform4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IPROC __glewProgramUniform4i; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVPROC __glewProgramUniform4iv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIPROC __glewProgramUniform4ui; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVPROC __glewProgramUniform4uiv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2DVPROC __glewProgramUniformMatrix2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVPROC __glewProgramUniformMatrix2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3DVPROC __glewProgramUniformMatrix2x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVPROC __glewProgramUniformMatrix2x3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4DVPROC __glewProgramUniformMatrix2x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVPROC __glewProgramUniformMatrix2x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3DVPROC __glewProgramUniformMatrix3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVPROC __glewProgramUniformMatrix3fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2DVPROC __glewProgramUniformMatrix3x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVPROC __glewProgramUniformMatrix3x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4DVPROC __glewProgramUniformMatrix3x4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVPROC __glewProgramUniformMatrix3x4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4DVPROC __glewProgramUniformMatrix4dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVPROC __glewProgramUniformMatrix4fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2DVPROC __glewProgramUniformMatrix4x2dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVPROC __glewProgramUniformMatrix4x2fv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3DVPROC __glewProgramUniformMatrix4x3dv; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVPROC __glewProgramUniformMatrix4x3fv; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMSTAGESPROC __glewUseProgramStages; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMPIPELINEPROC __glewValidateProgramPipeline; + +GLEW_FUN_EXPORT PFNGLATTACHOBJECTARBPROC __glewAttachObjectARB; +GLEW_FUN_EXPORT PFNGLCOMPILESHADERARBPROC __glewCompileShaderARB; +GLEW_FUN_EXPORT PFNGLCREATEPROGRAMOBJECTARBPROC __glewCreateProgramObjectARB; +GLEW_FUN_EXPORT PFNGLCREATESHADEROBJECTARBPROC __glewCreateShaderObjectARB; +GLEW_FUN_EXPORT PFNGLDELETEOBJECTARBPROC __glewDeleteObjectARB; +GLEW_FUN_EXPORT PFNGLDETACHOBJECTARBPROC __glewDetachObjectARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMARBPROC __glewGetActiveUniformARB; +GLEW_FUN_EXPORT PFNGLGETATTACHEDOBJECTSARBPROC __glewGetAttachedObjectsARB; +GLEW_FUN_EXPORT PFNGLGETHANDLEARBPROC __glewGetHandleARB; +GLEW_FUN_EXPORT PFNGLGETINFOLOGARBPROC __glewGetInfoLogARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERFVARBPROC __glewGetObjectParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETOBJECTPARAMETERIVARBPROC __glewGetObjectParameterivARB; +GLEW_FUN_EXPORT PFNGLGETSHADERSOURCEARBPROC __glewGetShaderSourceARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMLOCATIONARBPROC __glewGetUniformLocationARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMFVARBPROC __glewGetUniformfvARB; +GLEW_FUN_EXPORT PFNGLGETUNIFORMIVARBPROC __glewGetUniformivARB; +GLEW_FUN_EXPORT PFNGLLINKPROGRAMARBPROC __glewLinkProgramARB; +GLEW_FUN_EXPORT PFNGLSHADERSOURCEARBPROC __glewShaderSourceARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FARBPROC __glewUniform1fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1FVARBPROC __glewUniform1fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IARBPROC __glewUniform1iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM1IVARBPROC __glewUniform1ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FARBPROC __glewUniform2fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2FVARBPROC __glewUniform2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IARBPROC __glewUniform2iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM2IVARBPROC __glewUniform2ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FARBPROC __glewUniform3fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3FVARBPROC __glewUniform3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IARBPROC __glewUniform3iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM3IVARBPROC __glewUniform3ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FARBPROC __glewUniform4fARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4FVARBPROC __glewUniform4fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IARBPROC __glewUniform4iARB; +GLEW_FUN_EXPORT PFNGLUNIFORM4IVARBPROC __glewUniform4ivARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX2FVARBPROC __glewUniformMatrix2fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX3FVARBPROC __glewUniformMatrix3fvARB; +GLEW_FUN_EXPORT PFNGLUNIFORMMATRIX4FVARBPROC __glewUniformMatrix4fvARB; +GLEW_FUN_EXPORT PFNGLUSEPROGRAMOBJECTARBPROC __glewUseProgramObjectARB; +GLEW_FUN_EXPORT PFNGLVALIDATEPROGRAMARBPROC __glewValidateProgramARB; + +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINENAMEPROC __glewGetActiveSubroutineName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMNAMEPROC __glewGetActiveSubroutineUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVESUBROUTINEUNIFORMIVPROC __glewGetActiveSubroutineUniformiv; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTAGEIVPROC __glewGetProgramStageiv; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEINDEXPROC __glewGetSubroutineIndex; +GLEW_FUN_EXPORT PFNGLGETSUBROUTINEUNIFORMLOCATIONPROC __glewGetSubroutineUniformLocation; +GLEW_FUN_EXPORT PFNGLGETUNIFORMSUBROUTINEUIVPROC __glewGetUniformSubroutineuiv; +GLEW_FUN_EXPORT PFNGLUNIFORMSUBROUTINESUIVPROC __glewUniformSubroutinesuiv; + +GLEW_FUN_EXPORT PFNGLCOMPILESHADERINCLUDEARBPROC __glewCompileShaderIncludeARB; +GLEW_FUN_EXPORT PFNGLDELETENAMEDSTRINGARBPROC __glewDeleteNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGARBPROC __glewGetNamedStringARB; +GLEW_FUN_EXPORT PFNGLGETNAMEDSTRINGIVARBPROC __glewGetNamedStringivARB; +GLEW_FUN_EXPORT PFNGLISNAMEDSTRINGARBPROC __glewIsNamedStringARB; +GLEW_FUN_EXPORT PFNGLNAMEDSTRINGARBPROC __glewNamedStringARB; + +GLEW_FUN_EXPORT PFNGLCLIENTWAITSYNCPROC __glewClientWaitSync; +GLEW_FUN_EXPORT PFNGLDELETESYNCPROC __glewDeleteSync; +GLEW_FUN_EXPORT PFNGLFENCESYNCPROC __glewFenceSync; +GLEW_FUN_EXPORT PFNGLGETINTEGER64VPROC __glewGetInteger64v; +GLEW_FUN_EXPORT PFNGLGETSYNCIVPROC __glewGetSynciv; +GLEW_FUN_EXPORT PFNGLISSYNCPROC __glewIsSync; +GLEW_FUN_EXPORT PFNGLWAITSYNCPROC __glewWaitSync; + +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERFVPROC __glewPatchParameterfv; +GLEW_FUN_EXPORT PFNGLPATCHPARAMETERIPROC __glewPatchParameteri; + +GLEW_FUN_EXPORT PFNGLTEXBUFFERARBPROC __glewTexBufferARB; + +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE1DARBPROC __glewCompressedTexImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE2DARBPROC __glewCompressedTexImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXIMAGE3DARBPROC __glewCompressedTexImage3DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC __glewCompressedTexSubImage1DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC __glewCompressedTexSubImage2DARB; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC __glewCompressedTexSubImage3DARB; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXIMAGEARBPROC __glewGetCompressedTexImageARB; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVPROC __glewGetMultisamplefv; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKIPROC __glewSampleMaski; +GLEW_FUN_EXPORT PFNGLTEXIMAGE2DMULTISAMPLEPROC __glewTexImage2DMultisample; +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DMULTISAMPLEPROC __glewTexImage3DMultisample; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VPROC __glewGetQueryObjecti64v; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VPROC __glewGetQueryObjectui64v; +GLEW_FUN_EXPORT PFNGLQUERYCOUNTERPROC __glewQueryCounter; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKPROC __glewBindTransformFeedback; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSPROC __glewDeleteTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKPROC __glewDrawTransformFeedback; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSPROC __glewGenTransformFeedbacks; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKPROC __glewIsTransformFeedback; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKPROC __glewPauseTransformFeedback; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKPROC __glewResumeTransformFeedback; + +GLEW_FUN_EXPORT PFNGLBEGINQUERYINDEXEDPROC __glewBeginQueryIndexed; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKSTREAMPROC __glewDrawTransformFeedbackStream; +GLEW_FUN_EXPORT PFNGLENDQUERYINDEXEDPROC __glewEndQueryIndexed; +GLEW_FUN_EXPORT PFNGLGETQUERYINDEXEDIVPROC __glewGetQueryIndexediv; + +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXDARBPROC __glewLoadTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLLOADTRANSPOSEMATRIXFARBPROC __glewLoadTransposeMatrixfARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXDARBPROC __glewMultTransposeMatrixdARB; +GLEW_FUN_EXPORT PFNGLMULTTRANSPOSEMATRIXFARBPROC __glewMultTransposeMatrixfARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEPROC __glewBindBufferBase; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEPROC __glewBindBufferRange; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKNAMEPROC __glewGetActiveUniformBlockName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMBLOCKIVPROC __glewGetActiveUniformBlockiv; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMNAMEPROC __glewGetActiveUniformName; +GLEW_FUN_EXPORT PFNGLGETACTIVEUNIFORMSIVPROC __glewGetActiveUniformsiv; +GLEW_FUN_EXPORT PFNGLGETINTEGERI_VPROC __glewGetIntegeri_v; +GLEW_FUN_EXPORT PFNGLGETUNIFORMBLOCKINDEXPROC __glewGetUniformBlockIndex; +GLEW_FUN_EXPORT PFNGLGETUNIFORMINDICESPROC __glewGetUniformIndices; +GLEW_FUN_EXPORT PFNGLUNIFORMBLOCKBINDINGPROC __glewUniformBlockBinding; + +GLEW_FUN_EXPORT PFNGLBINDVERTEXARRAYPROC __glewBindVertexArray; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXARRAYSPROC __glewDeleteVertexArrays; +GLEW_FUN_EXPORT PFNGLGENVERTEXARRAYSPROC __glewGenVertexArrays; +GLEW_FUN_EXPORT PFNGLISVERTEXARRAYPROC __glewIsVertexArray; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVPROC __glewGetVertexAttribLdv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DPROC __glewVertexAttribL1d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVPROC __glewVertexAttribL1dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DPROC __glewVertexAttribL2d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVPROC __glewVertexAttribL2dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DPROC __glewVertexAttribL3d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVPROC __glewVertexAttribL3dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DPROC __glewVertexAttribL4d; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVPROC __glewVertexAttribL4dv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTERPROC __glewVertexAttribLPointer; + +GLEW_FUN_EXPORT PFNGLVERTEXBLENDARBPROC __glewVertexBlendARB; +GLEW_FUN_EXPORT PFNGLWEIGHTPOINTERARBPROC __glewWeightPointerARB; +GLEW_FUN_EXPORT PFNGLWEIGHTBVARBPROC __glewWeightbvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTDVARBPROC __glewWeightdvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTFVARBPROC __glewWeightfvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTIVARBPROC __glewWeightivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTSVARBPROC __glewWeightsvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUBVARBPROC __glewWeightubvARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUIVARBPROC __glewWeightuivARB; +GLEW_FUN_EXPORT PFNGLWEIGHTUSVARBPROC __glewWeightusvARB; + +GLEW_FUN_EXPORT PFNGLBINDBUFFERARBPROC __glewBindBufferARB; +GLEW_FUN_EXPORT PFNGLBUFFERDATAARBPROC __glewBufferDataARB; +GLEW_FUN_EXPORT PFNGLBUFFERSUBDATAARBPROC __glewBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERSARBPROC __glewDeleteBuffersARB; +GLEW_FUN_EXPORT PFNGLGENBUFFERSARBPROC __glewGenBuffersARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERIVARBPROC __glewGetBufferParameterivARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERPOINTERVARBPROC __glewGetBufferPointervARB; +GLEW_FUN_EXPORT PFNGLGETBUFFERSUBDATAARBPROC __glewGetBufferSubDataARB; +GLEW_FUN_EXPORT PFNGLISBUFFERARBPROC __glewIsBufferARB; +GLEW_FUN_EXPORT PFNGLMAPBUFFERARBPROC __glewMapBufferARB; +GLEW_FUN_EXPORT PFNGLUNMAPBUFFERARBPROC __glewUnmapBufferARB; + +GLEW_FUN_EXPORT PFNGLBINDPROGRAMARBPROC __glewBindProgramARB; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSARBPROC __glewDeleteProgramsARB; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXATTRIBARRAYARBPROC __glewDisableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXATTRIBARRAYARBPROC __glewEnableVertexAttribArrayARB; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSARBPROC __glewGenProgramsARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERDVARBPROC __glewGetProgramEnvParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMENVPARAMETERFVARBPROC __glewGetProgramEnvParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC __glewGetProgramLocalParameterdvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC __glewGetProgramLocalParameterfvARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGARBPROC __glewGetProgramStringARB; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVARBPROC __glewGetProgramivARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVARBPROC __glewGetVertexAttribPointervARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVARBPROC __glewGetVertexAttribdvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVARBPROC __glewGetVertexAttribfvARB; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVARBPROC __glewGetVertexAttribivARB; +GLEW_FUN_EXPORT PFNGLISPROGRAMARBPROC __glewIsProgramARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DARBPROC __glewProgramEnvParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4DVARBPROC __glewProgramEnvParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FARBPROC __glewProgramEnvParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETER4FVARBPROC __glewProgramEnvParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DARBPROC __glewProgramLocalParameter4dARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4DVARBPROC __glewProgramLocalParameter4dvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FARBPROC __glewProgramLocalParameter4fARB; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETER4FVARBPROC __glewProgramLocalParameter4fvARB; +GLEW_FUN_EXPORT PFNGLPROGRAMSTRINGARBPROC __glewProgramStringARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DARBPROC __glewVertexAttrib1dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVARBPROC __glewVertexAttrib1dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FARBPROC __glewVertexAttrib1fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVARBPROC __glewVertexAttrib1fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SARBPROC __glewVertexAttrib1sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVARBPROC __glewVertexAttrib1svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DARBPROC __glewVertexAttrib2dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVARBPROC __glewVertexAttrib2dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FARBPROC __glewVertexAttrib2fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVARBPROC __glewVertexAttrib2fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SARBPROC __glewVertexAttrib2sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVARBPROC __glewVertexAttrib2svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DARBPROC __glewVertexAttrib3dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVARBPROC __glewVertexAttrib3dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FARBPROC __glewVertexAttrib3fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVARBPROC __glewVertexAttrib3fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SARBPROC __glewVertexAttrib3sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVARBPROC __glewVertexAttrib3svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NBVARBPROC __glewVertexAttrib4NbvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NIVARBPROC __glewVertexAttrib4NivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NSVARBPROC __glewVertexAttrib4NsvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBARBPROC __glewVertexAttrib4NubARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUBVARBPROC __glewVertexAttrib4NubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUIVARBPROC __glewVertexAttrib4NuivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4NUSVARBPROC __glewVertexAttrib4NusvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4BVARBPROC __glewVertexAttrib4bvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DARBPROC __glewVertexAttrib4dARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVARBPROC __glewVertexAttrib4dvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FARBPROC __glewVertexAttrib4fARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVARBPROC __glewVertexAttrib4fvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4IVARBPROC __glewVertexAttrib4ivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SARBPROC __glewVertexAttrib4sARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVARBPROC __glewVertexAttrib4svARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVARBPROC __glewVertexAttrib4ubvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UIVARBPROC __glewVertexAttrib4uivARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4USVARBPROC __glewVertexAttrib4usvARB; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERARBPROC __glewVertexAttribPointerARB; + +GLEW_FUN_EXPORT PFNGLBINDATTRIBLOCATIONARBPROC __glewBindAttribLocationARB; +GLEW_FUN_EXPORT PFNGLGETACTIVEATTRIBARBPROC __glewGetActiveAttribARB; +GLEW_FUN_EXPORT PFNGLGETATTRIBLOCATIONARBPROC __glewGetAttribLocationARB; + +GLEW_FUN_EXPORT PFNGLCOLORP3UIPROC __glewColorP3ui; +GLEW_FUN_EXPORT PFNGLCOLORP3UIVPROC __glewColorP3uiv; +GLEW_FUN_EXPORT PFNGLCOLORP4UIPROC __glewColorP4ui; +GLEW_FUN_EXPORT PFNGLCOLORP4UIVPROC __glewColorP4uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIPROC __glewMultiTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP1UIVPROC __glewMultiTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIPROC __glewMultiTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP2UIVPROC __glewMultiTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIPROC __glewMultiTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP3UIVPROC __glewMultiTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIPROC __glewMultiTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDP4UIVPROC __glewMultiTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLNORMALP3UIPROC __glewNormalP3ui; +GLEW_FUN_EXPORT PFNGLNORMALP3UIVPROC __glewNormalP3uiv; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIPROC __glewSecondaryColorP3ui; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORP3UIVPROC __glewSecondaryColorP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIPROC __glewTexCoordP1ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP1UIVPROC __glewTexCoordP1uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIPROC __glewTexCoordP2ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP2UIVPROC __glewTexCoordP2uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIPROC __glewTexCoordP3ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP3UIVPROC __glewTexCoordP3uiv; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIPROC __glewTexCoordP4ui; +GLEW_FUN_EXPORT PFNGLTEXCOORDP4UIVPROC __glewTexCoordP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIPROC __glewVertexAttribP1ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP1UIVPROC __glewVertexAttribP1uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIPROC __glewVertexAttribP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP2UIVPROC __glewVertexAttribP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIPROC __glewVertexAttribP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP3UIVPROC __glewVertexAttribP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIPROC __glewVertexAttribP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBP4UIVPROC __glewVertexAttribP4uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIPROC __glewVertexP2ui; +GLEW_FUN_EXPORT PFNGLVERTEXP2UIVPROC __glewVertexP2uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIPROC __glewVertexP3ui; +GLEW_FUN_EXPORT PFNGLVERTEXP3UIVPROC __glewVertexP3uiv; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIPROC __glewVertexP4ui; +GLEW_FUN_EXPORT PFNGLVERTEXP4UIVPROC __glewVertexP4uiv; + +GLEW_FUN_EXPORT PFNGLDEPTHRANGEARRAYVPROC __glewDepthRangeArrayv; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEINDEXEDPROC __glewDepthRangeIndexed; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VPROC __glewGetDoublei_v; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VPROC __glewGetFloati_v; +GLEW_FUN_EXPORT PFNGLSCISSORARRAYVPROC __glewScissorArrayv; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDPROC __glewScissorIndexed; +GLEW_FUN_EXPORT PFNGLSCISSORINDEXEDVPROC __glewScissorIndexedv; +GLEW_FUN_EXPORT PFNGLVIEWPORTARRAYVPROC __glewViewportArrayv; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFPROC __glewViewportIndexedf; +GLEW_FUN_EXPORT PFNGLVIEWPORTINDEXEDFVPROC __glewViewportIndexedfv; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DARBPROC __glewWindowPos2dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVARBPROC __glewWindowPos2dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FARBPROC __glewWindowPos2fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVARBPROC __glewWindowPos2fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IARBPROC __glewWindowPos2iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVARBPROC __glewWindowPos2ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SARBPROC __glewWindowPos2sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVARBPROC __glewWindowPos2svARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DARBPROC __glewWindowPos3dARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVARBPROC __glewWindowPos3dvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FARBPROC __glewWindowPos3fARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVARBPROC __glewWindowPos3fvARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IARBPROC __glewWindowPos3iARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVARBPROC __glewWindowPos3ivARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SARBPROC __glewWindowPos3sARB; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVARBPROC __glewWindowPos3svARB; + +GLEW_FUN_EXPORT PFNGLDRAWBUFFERSATIPROC __glewDrawBuffersATI; + +GLEW_FUN_EXPORT PFNGLDRAWELEMENTARRAYATIPROC __glewDrawElementArrayATI; +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTARRAYATIPROC __glewDrawRangeElementArrayATI; +GLEW_FUN_EXPORT PFNGLELEMENTPOINTERATIPROC __glewElementPointerATI; + +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERFVATIPROC __glewGetTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLGETTEXBUMPPARAMETERIVATIPROC __glewGetTexBumpParameterivATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERFVATIPROC __glewTexBumpParameterfvATI; +GLEW_FUN_EXPORT PFNGLTEXBUMPPARAMETERIVATIPROC __glewTexBumpParameterivATI; + +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP1ATIPROC __glewAlphaFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP2ATIPROC __glewAlphaFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLALPHAFRAGMENTOP3ATIPROC __glewAlphaFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLBEGINFRAGMENTSHADERATIPROC __glewBeginFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLBINDFRAGMENTSHADERATIPROC __glewBindFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP1ATIPROC __glewColorFragmentOp1ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP2ATIPROC __glewColorFragmentOp2ATI; +GLEW_FUN_EXPORT PFNGLCOLORFRAGMENTOP3ATIPROC __glewColorFragmentOp3ATI; +GLEW_FUN_EXPORT PFNGLDELETEFRAGMENTSHADERATIPROC __glewDeleteFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLENDFRAGMENTSHADERATIPROC __glewEndFragmentShaderATI; +GLEW_FUN_EXPORT PFNGLGENFRAGMENTSHADERSATIPROC __glewGenFragmentShadersATI; +GLEW_FUN_EXPORT PFNGLPASSTEXCOORDATIPROC __glewPassTexCoordATI; +GLEW_FUN_EXPORT PFNGLSAMPLEMAPATIPROC __glewSampleMapATI; +GLEW_FUN_EXPORT PFNGLSETFRAGMENTSHADERCONSTANTATIPROC __glewSetFragmentShaderConstantATI; + +GLEW_FUN_EXPORT PFNGLMAPOBJECTBUFFERATIPROC __glewMapObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUNMAPOBJECTBUFFERATIPROC __glewUnmapObjectBufferATI; + +GLEW_FUN_EXPORT PFNGLPNTRIANGLESFATIPROC __glPNTrianglewesfATI; +GLEW_FUN_EXPORT PFNGLPNTRIANGLESIATIPROC __glPNTrianglewesiATI; + +GLEW_FUN_EXPORT PFNGLSTENCILFUNCSEPARATEATIPROC __glewStencilFuncSeparateATI; +GLEW_FUN_EXPORT PFNGLSTENCILOPSEPARATEATIPROC __glewStencilOpSeparateATI; + +GLEW_FUN_EXPORT PFNGLARRAYOBJECTATIPROC __glewArrayObjectATI; +GLEW_FUN_EXPORT PFNGLFREEOBJECTBUFFERATIPROC __glewFreeObjectBufferATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTFVATIPROC __glewGetArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETARRAYOBJECTIVATIPROC __glewGetArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERFVATIPROC __glewGetObjectBufferfvATI; +GLEW_FUN_EXPORT PFNGLGETOBJECTBUFFERIVATIPROC __glewGetObjectBufferivATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTFVATIPROC __glewGetVariantArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVARIANTARRAYOBJECTIVATIPROC __glewGetVariantArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLISOBJECTBUFFERATIPROC __glewIsObjectBufferATI; +GLEW_FUN_EXPORT PFNGLNEWOBJECTBUFFERATIPROC __glewNewObjectBufferATI; +GLEW_FUN_EXPORT PFNGLUPDATEOBJECTBUFFERATIPROC __glewUpdateObjectBufferATI; +GLEW_FUN_EXPORT PFNGLVARIANTARRAYOBJECTATIPROC __glewVariantArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC __glewGetVertexAttribArrayObjectfvATI; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC __glewGetVertexAttribArrayObjectivATI; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBARRAYOBJECTATIPROC __glewVertexAttribArrayObjectATI; + +GLEW_FUN_EXPORT PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC __glewClientActiveVertexStreamATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BATIPROC __glewNormalStream3bATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3BVATIPROC __glewNormalStream3bvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DATIPROC __glewNormalStream3dATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3DVATIPROC __glewNormalStream3dvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FATIPROC __glewNormalStream3fATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3FVATIPROC __glewNormalStream3fvATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IATIPROC __glewNormalStream3iATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3IVATIPROC __glewNormalStream3ivATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SATIPROC __glewNormalStream3sATI; +GLEW_FUN_EXPORT PFNGLNORMALSTREAM3SVATIPROC __glewNormalStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVFATIPROC __glewVertexBlendEnvfATI; +GLEW_FUN_EXPORT PFNGLVERTEXBLENDENVIATIPROC __glewVertexBlendEnviATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DATIPROC __glewVertexStream2dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2DVATIPROC __glewVertexStream2dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FATIPROC __glewVertexStream2fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2FVATIPROC __glewVertexStream2fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IATIPROC __glewVertexStream2iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2IVATIPROC __glewVertexStream2ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SATIPROC __glewVertexStream2sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM2SVATIPROC __glewVertexStream2svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DATIPROC __glewVertexStream3dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3DVATIPROC __glewVertexStream3dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FATIPROC __glewVertexStream3fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3FVATIPROC __glewVertexStream3fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IATIPROC __glewVertexStream3iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3IVATIPROC __glewVertexStream3ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SATIPROC __glewVertexStream3sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM3SVATIPROC __glewVertexStream3svATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DATIPROC __glewVertexStream4dATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4DVATIPROC __glewVertexStream4dvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FATIPROC __glewVertexStream4fATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4FVATIPROC __glewVertexStream4fvATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IATIPROC __glewVertexStream4iATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4IVATIPROC __glewVertexStream4ivATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SATIPROC __glewVertexStream4sATI; +GLEW_FUN_EXPORT PFNGLVERTEXSTREAM4SVATIPROC __glewVertexStream4svATI; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMBUFFERSIZEEXTPROC __glewGetUniformBufferSizeEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMOFFSETEXTPROC __glewGetUniformOffsetEXT; +GLEW_FUN_EXPORT PFNGLUNIFORMBUFFEREXTPROC __glewUniformBufferEXT; + +GLEW_FUN_EXPORT PFNGLBLENDCOLOREXTPROC __glewBlendColorEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONSEPARATEEXTPROC __glewBlendEquationSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDFUNCSEPARATEEXTPROC __glewBlendFuncSeparateEXT; + +GLEW_FUN_EXPORT PFNGLBLENDEQUATIONEXTPROC __glewBlendEquationEXT; + +GLEW_FUN_EXPORT PFNGLCOLORSUBTABLEEXTPROC __glewColorSubTableEXT; +GLEW_FUN_EXPORT PFNGLCOPYCOLORSUBTABLEEXTPROC __glewCopyColorSubTableEXT; + +GLEW_FUN_EXPORT PFNGLLOCKARRAYSEXTPROC __glewLockArraysEXT; +GLEW_FUN_EXPORT PFNGLUNLOCKARRAYSEXTPROC __glewUnlockArraysEXT; + +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER1DEXTPROC __glewConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONFILTER2DEXTPROC __glewConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFEXTPROC __glewConvolutionParameterfEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERFVEXTPROC __glewConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIEXTPROC __glewConvolutionParameteriEXT; +GLEW_FUN_EXPORT PFNGLCONVOLUTIONPARAMETERIVEXTPROC __glewConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC __glewCopyConvolutionFilter1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC __glewCopyConvolutionFilter2DEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONFILTEREXTPROC __glewGetConvolutionFilterEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC __glewGetConvolutionParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC __glewGetConvolutionParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETSEPARABLEFILTEREXTPROC __glewGetSeparableFilterEXT; +GLEW_FUN_EXPORT PFNGLSEPARABLEFILTER2DEXTPROC __glewSeparableFilter2DEXT; + +GLEW_FUN_EXPORT PFNGLBINORMALPOINTEREXTPROC __glewBinormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTANGENTPOINTEREXTPROC __glewTangentPointerEXT; + +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE1DEXTPROC __glewCopyTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXIMAGE2DEXTPROC __glewCopyTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE1DEXTPROC __glewCopyTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE2DEXTPROC __glewCopyTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXSUBIMAGE3DEXTPROC __glewCopyTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLCULLPARAMETERDVEXTPROC __glewCullParameterdvEXT; +GLEW_FUN_EXPORT PFNGLCULLPARAMETERFVEXTPROC __glewCullParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSEXTPROC __glewDepthBoundsEXT; + +GLEW_FUN_EXPORT PFNGLBINDMULTITEXTUREEXTPROC __glewBindMultiTextureEXT; +GLEW_FUN_EXPORT PFNGLCHECKNAMEDFRAMEBUFFERSTATUSEXTPROC __glewCheckNamedFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLCLIENTATTRIBDEFAULTEXTPROC __glewClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE1DEXTPROC __glewCompressedMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE2DEXTPROC __glewCompressedMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXIMAGE3DEXTPROC __glewCompressedMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE1DEXTPROC __glewCompressedMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE2DEXTPROC __glewCompressedMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDMULTITEXSUBIMAGE3DEXTPROC __glewCompressedMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE1DEXTPROC __glewCompressedTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE2DEXTPROC __glewCompressedTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTUREIMAGE3DEXTPROC __glewCompressedTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE1DEXTPROC __glewCompressedTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE2DEXTPROC __glewCompressedTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOMPRESSEDTEXTURESUBIMAGE3DEXTPROC __glewCompressedTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE1DEXTPROC __glewCopyMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXIMAGE2DEXTPROC __glewCopyMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE1DEXTPROC __glewCopyMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE2DEXTPROC __glewCopyMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYMULTITEXSUBIMAGE3DEXTPROC __glewCopyMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE1DEXTPROC __glewCopyTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTUREIMAGE2DEXTPROC __glewCopyTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE1DEXTPROC __glewCopyTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE2DEXTPROC __glewCopyTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLCOPYTEXTURESUBIMAGE3DEXTPROC __glewCopyTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEINDEXEDEXTPROC __glewDisableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLECLIENTSTATEIEXTPROC __glewDisableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYATTRIBEXTPROC __glewDisableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVERTEXARRAYEXTPROC __glewDisableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEINDEXEDEXTPROC __glewEnableClientStateIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLECLIENTSTATEIEXTPROC __glewEnableClientStateiEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYATTRIBEXTPROC __glewEnableVertexArrayAttribEXT; +GLEW_FUN_EXPORT PFNGLENABLEVERTEXARRAYEXTPROC __glewEnableVertexArrayEXT; +GLEW_FUN_EXPORT PFNGLFLUSHMAPPEDNAMEDBUFFERRANGEEXTPROC __glewFlushMappedNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFEREXTPROC __glewFramebufferDrawBufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERDRAWBUFFERSEXTPROC __glewFramebufferDrawBuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERREADBUFFEREXTPROC __glewFramebufferReadBufferEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMULTITEXMIPMAPEXTPROC __glewGenerateMultiTexMipmapEXT; +GLEW_FUN_EXPORT PFNGLGENERATETEXTUREMIPMAPEXTPROC __glewGenerateTextureMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDMULTITEXIMAGEEXTPROC __glewGetCompressedMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETCOMPRESSEDTEXTUREIMAGEEXTPROC __glewGetCompressedTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEINDEXEDVEXTPROC __glewGetDoubleIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETDOUBLEI_VEXTPROC __glewGetDoublei_vEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATINDEXEDVEXTPROC __glewGetFloatIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETFLOATI_VEXTPROC __glewGetFloati_vEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERPARAMETERIVEXTPROC __glewGetFramebufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVFVEXTPROC __glewGetMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXENVIVEXTPROC __glewGetMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENDVEXTPROC __glewGetMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENFVEXTPROC __glewGetMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXGENIVEXTPROC __glewGetMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXIMAGEEXTPROC __glewGetMultiTexImageEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERFVEXTPROC __glewGetMultiTexLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXLEVELPARAMETERIVEXTPROC __glewGetMultiTexLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIIVEXTPROC __glewGetMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIUIVEXTPROC __glewGetMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERFVEXTPROC __glewGetMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMULTITEXPARAMETERIVEXTPROC __glewGetMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERIVEXTPROC __glewGetNamedBufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPOINTERVEXTPROC __glewGetNamedBufferPointervEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERSUBDATAEXTPROC __glewGetNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetNamedFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIIVEXTPROC __glewGetNamedProgramLocalParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERIUIVEXTPROC __glewGetNamedProgramLocalParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERDVEXTPROC __glewGetNamedProgramLocalParameterdvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMLOCALPARAMETERFVEXTPROC __glewGetNamedProgramLocalParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMSTRINGEXTPROC __glewGetNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDPROGRAMIVEXTPROC __glewGetNamedProgramivEXT; +GLEW_FUN_EXPORT PFNGLGETNAMEDRENDERBUFFERPARAMETERIVEXTPROC __glewGetNamedRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERINDEXEDVEXTPROC __glewGetPointerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETPOINTERI_VEXTPROC __glewGetPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREIMAGEEXTPROC __glewGetTextureImageEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERFVEXTPROC __glewGetTextureLevelParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTURELEVELPARAMETERIVEXTPROC __glewGetTextureLevelParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIIVEXTPROC __glewGetTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIUIVEXTPROC __glewGetTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERFVEXTPROC __glewGetTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETTEXTUREPARAMETERIVEXTPROC __glewGetTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERI_VEXTPROC __glewGetVertexArrayIntegeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYINTEGERVEXTPROC __glewGetVertexArrayIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERI_VEXTPROC __glewGetVertexArrayPointeri_vEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXARRAYPOINTERVEXTPROC __glewGetVertexArrayPointervEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFEREXTPROC __glewMapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLMAPNAMEDBUFFERRANGEEXTPROC __glewMapNamedBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLMATRIXFRUSTUMEXTPROC __glewMatrixFrustumEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADIDENTITYEXTPROC __glewMatrixLoadIdentityEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEDEXTPROC __glewMatrixLoadTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADTRANSPOSEFEXTPROC __glewMatrixLoadTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADDEXTPROC __glewMatrixLoaddEXT; +GLEW_FUN_EXPORT PFNGLMATRIXLOADFEXTPROC __glewMatrixLoadfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEDEXTPROC __glewMatrixMultTransposedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTTRANSPOSEFEXTPROC __glewMatrixMultTransposefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTDEXTPROC __glewMatrixMultdEXT; +GLEW_FUN_EXPORT PFNGLMATRIXMULTFEXTPROC __glewMatrixMultfEXT; +GLEW_FUN_EXPORT PFNGLMATRIXORTHOEXTPROC __glewMatrixOrthoEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPOPEXTPROC __glewMatrixPopEXT; +GLEW_FUN_EXPORT PFNGLMATRIXPUSHEXTPROC __glewMatrixPushEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEDEXTPROC __glewMatrixRotatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXROTATEFEXTPROC __glewMatrixRotatefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEDEXTPROC __glewMatrixScaledEXT; +GLEW_FUN_EXPORT PFNGLMATRIXSCALEFEXTPROC __glewMatrixScalefEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEDEXTPROC __glewMatrixTranslatedEXT; +GLEW_FUN_EXPORT PFNGLMATRIXTRANSLATEFEXTPROC __glewMatrixTranslatefEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXBUFFEREXTPROC __glewMultiTexBufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORDPOINTEREXTPROC __glewMultiTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFEXTPROC __glewMultiTexEnvfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVFVEXTPROC __glewMultiTexEnvfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIEXTPROC __glewMultiTexEnviEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXENVIVEXTPROC __glewMultiTexEnvivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDEXTPROC __glewMultiTexGendEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENDVEXTPROC __glewMultiTexGendvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFEXTPROC __glewMultiTexGenfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENFVEXTPROC __glewMultiTexGenfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIEXTPROC __glewMultiTexGeniEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXGENIVEXTPROC __glewMultiTexGenivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE1DEXTPROC __glewMultiTexImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE2DEXTPROC __glewMultiTexImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXIMAGE3DEXTPROC __glewMultiTexImage3DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIIVEXTPROC __glewMultiTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIUIVEXTPROC __glewMultiTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFEXTPROC __glewMultiTexParameterfEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERFVEXTPROC __glewMultiTexParameterfvEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIEXTPROC __glewMultiTexParameteriEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXPARAMETERIVEXTPROC __glewMultiTexParameterivEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXRENDERBUFFEREXTPROC __glewMultiTexRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE1DEXTPROC __glewMultiTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE2DEXTPROC __glewMultiTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLMULTITEXSUBIMAGE3DEXTPROC __glewMultiTexSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERDATAEXTPROC __glewNamedBufferDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDBUFFERSUBDATAEXTPROC __glewNamedBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDCOPYBUFFERSUBDATAEXTPROC __glewNamedCopyBufferSubDataEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERRENDERBUFFEREXTPROC __glewNamedFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE1DEXTPROC __glewNamedFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE2DEXTPROC __glewNamedFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURE3DEXTPROC __glewNamedFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREEXTPROC __glewNamedFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTUREFACEEXTPROC __glewNamedFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLNAMEDFRAMEBUFFERTEXTURELAYEREXTPROC __glewNamedFramebufferTextureLayerEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DEXTPROC __glewNamedProgramLocalParameter4dEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4DVEXTPROC __glewNamedProgramLocalParameter4dvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FEXTPROC __glewNamedProgramLocalParameter4fEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETER4FVEXTPROC __glewNamedProgramLocalParameter4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IEXTPROC __glewNamedProgramLocalParameterI4iEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4IVEXTPROC __glewNamedProgramLocalParameterI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIEXTPROC __glewNamedProgramLocalParameterI4uiEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERI4UIVEXTPROC __glewNamedProgramLocalParameterI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERS4FVEXTPROC __glewNamedProgramLocalParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4IVEXTPROC __glewNamedProgramLocalParametersI4ivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMLOCALPARAMETERSI4UIVEXTPROC __glewNamedProgramLocalParametersI4uivEXT; +GLEW_FUN_EXPORT PFNGLNAMEDPROGRAMSTRINGEXTPROC __glewNamedProgramStringEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEEXTPROC __glewNamedRenderbufferStorageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLECOVERAGEEXTPROC __glewNamedRenderbufferStorageMultisampleCoverageEXT; +GLEW_FUN_EXPORT PFNGLNAMEDRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewNamedRenderbufferStorageMultisampleEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FEXTPROC __glewProgramUniform1fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1FVEXTPROC __glewProgramUniform1fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IEXTPROC __glewProgramUniform1iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1IVEXTPROC __glewProgramUniform1ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIEXTPROC __glewProgramUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UIVEXTPROC __glewProgramUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FEXTPROC __glewProgramUniform2fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2FVEXTPROC __glewProgramUniform2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IEXTPROC __glewProgramUniform2iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2IVEXTPROC __glewProgramUniform2ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIEXTPROC __glewProgramUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UIVEXTPROC __glewProgramUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FEXTPROC __glewProgramUniform3fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3FVEXTPROC __glewProgramUniform3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IEXTPROC __glewProgramUniform3iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3IVEXTPROC __glewProgramUniform3ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIEXTPROC __glewProgramUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UIVEXTPROC __glewProgramUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FEXTPROC __glewProgramUniform4fEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4FVEXTPROC __glewProgramUniform4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IEXTPROC __glewProgramUniform4iEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4IVEXTPROC __glewProgramUniform4ivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIEXTPROC __glewProgramUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UIVEXTPROC __glewProgramUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2FVEXTPROC __glewProgramUniformMatrix2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X3FVEXTPROC __glewProgramUniformMatrix2x3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX2X4FVEXTPROC __glewProgramUniformMatrix2x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3FVEXTPROC __glewProgramUniformMatrix3fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X2FVEXTPROC __glewProgramUniformMatrix3x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX3X4FVEXTPROC __glewProgramUniformMatrix3x4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4FVEXTPROC __glewProgramUniformMatrix4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X2FVEXTPROC __glewProgramUniformMatrix4x2fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMMATRIX4X3FVEXTPROC __glewProgramUniformMatrix4x3fvEXT; +GLEW_FUN_EXPORT PFNGLPUSHCLIENTATTRIBDEFAULTEXTPROC __glewPushClientAttribDefaultEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREBUFFEREXTPROC __glewTextureBufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE1DEXTPROC __glewTextureImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE2DEXTPROC __glewTextureImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREIMAGE3DEXTPROC __glewTextureImage3DEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIIVEXTPROC __glewTextureParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIUIVEXTPROC __glewTextureParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFEXTPROC __glewTextureParameterfEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERFVEXTPROC __glewTextureParameterfvEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIEXTPROC __glewTextureParameteriEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREPARAMETERIVEXTPROC __glewTextureParameterivEXT; +GLEW_FUN_EXPORT PFNGLTEXTURERENDERBUFFEREXTPROC __glewTextureRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE1DEXTPROC __glewTextureSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE2DEXTPROC __glewTextureSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXTURESUBIMAGE3DEXTPROC __glewTextureSubImage3DEXT; +GLEW_FUN_EXPORT PFNGLUNMAPNAMEDBUFFEREXTPROC __glewUnmapNamedBufferEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYCOLOROFFSETEXTPROC __glewVertexArrayColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYEDGEFLAGOFFSETEXTPROC __glewVertexArrayEdgeFlagOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYFOGCOORDOFFSETEXTPROC __glewVertexArrayFogCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYINDEXOFFSETEXTPROC __glewVertexArrayIndexOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYMULTITEXCOORDOFFSETEXTPROC __glewVertexArrayMultiTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYNORMALOFFSETEXTPROC __glewVertexArrayNormalOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYSECONDARYCOLOROFFSETEXTPROC __glewVertexArraySecondaryColorOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYTEXCOORDOFFSETEXTPROC __glewVertexArrayTexCoordOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBIOFFSETEXTPROC __glewVertexArrayVertexAttribIOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBOFFSETEXTPROC __glewVertexArrayVertexAttribOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXOFFSETEXTPROC __glewVertexArrayVertexOffsetEXT; + +GLEW_FUN_EXPORT PFNGLCOLORMASKINDEXEDEXTPROC __glewColorMaskIndexedEXT; +GLEW_FUN_EXPORT PFNGLDISABLEINDEXEDEXTPROC __glewDisableIndexedEXT; +GLEW_FUN_EXPORT PFNGLENABLEINDEXEDEXTPROC __glewEnableIndexedEXT; +GLEW_FUN_EXPORT PFNGLGETBOOLEANINDEXEDVEXTPROC __glewGetBooleanIndexedvEXT; +GLEW_FUN_EXPORT PFNGLGETINTEGERINDEXEDVEXTPROC __glewGetIntegerIndexedvEXT; +GLEW_FUN_EXPORT PFNGLISENABLEDINDEXEDEXTPROC __glewIsEnabledIndexedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWARRAYSINSTANCEDEXTPROC __glewDrawArraysInstancedEXT; +GLEW_FUN_EXPORT PFNGLDRAWELEMENTSINSTANCEDEXTPROC __glewDrawElementsInstancedEXT; + +GLEW_FUN_EXPORT PFNGLDRAWRANGEELEMENTSEXTPROC __glewDrawRangeElementsEXT; + +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTEREXTPROC __glewFogCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDEXTPROC __glewFogCoorddEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDDVEXTPROC __glewFogCoorddvEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFEXTPROC __glewFogCoordfEXT; +GLEW_FUN_EXPORT PFNGLFOGCOORDFVEXTPROC __glewFogCoordfvEXT; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALEXTPROC __glewFragmentColorMaterialEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFEXTPROC __glewFragmentLightModelfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVEXTPROC __glewFragmentLightModelfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIEXTPROC __glewFragmentLightModeliEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVEXTPROC __glewFragmentLightModelivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFEXTPROC __glewFragmentLightfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVEXTPROC __glewFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIEXTPROC __glewFragmentLightiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVEXTPROC __glewFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFEXTPROC __glewFragmentMaterialfEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVEXTPROC __glewFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIEXTPROC __glewFragmentMaterialiEXT; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVEXTPROC __glewFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVEXTPROC __glewGetFragmentLightfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVEXTPROC __glewGetFragmentLightivEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVEXTPROC __glewGetFragmentMaterialfvEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVEXTPROC __glewGetFragmentMaterialivEXT; +GLEW_FUN_EXPORT PFNGLLIGHTENVIEXTPROC __glewLightEnviEXT; + +GLEW_FUN_EXPORT PFNGLBLITFRAMEBUFFEREXTPROC __glewBlitFramebufferEXT; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC __glewRenderbufferStorageMultisampleEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAMEBUFFEREXTPROC __glewBindFramebufferEXT; +GLEW_FUN_EXPORT PFNGLBINDRENDERBUFFEREXTPROC __glewBindRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC __glewCheckFramebufferStatusEXT; +GLEW_FUN_EXPORT PFNGLDELETEFRAMEBUFFERSEXTPROC __glewDeleteFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLDELETERENDERBUFFERSEXTPROC __glewDeleteRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC __glewFramebufferRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE1DEXTPROC __glewFramebufferTexture1DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE2DEXTPROC __glewFramebufferTexture2DEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURE3DEXTPROC __glewFramebufferTexture3DEXT; +GLEW_FUN_EXPORT PFNGLGENFRAMEBUFFERSEXTPROC __glewGenFramebuffersEXT; +GLEW_FUN_EXPORT PFNGLGENRENDERBUFFERSEXTPROC __glewGenRenderbuffersEXT; +GLEW_FUN_EXPORT PFNGLGENERATEMIPMAPEXTPROC __glewGenerateMipmapEXT; +GLEW_FUN_EXPORT PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC __glewGetFramebufferAttachmentParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC __glewGetRenderbufferParameterivEXT; +GLEW_FUN_EXPORT PFNGLISFRAMEBUFFEREXTPROC __glewIsFramebufferEXT; +GLEW_FUN_EXPORT PFNGLISRENDERBUFFEREXTPROC __glewIsRenderbufferEXT; +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEEXTPROC __glewRenderbufferStorageEXT; + +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREEXTPROC __glewFramebufferTextureEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTUREFACEEXTPROC __glewFramebufferTextureFaceEXT; +GLEW_FUN_EXPORT PFNGLFRAMEBUFFERTEXTURELAYEREXTPROC __glewFramebufferTextureLayerEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERIEXTPROC __glewProgramParameteriEXT; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERS4FVEXTPROC __glewProgramEnvParameters4fvEXT; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC __glewProgramLocalParameters4fvEXT; + +GLEW_FUN_EXPORT PFNGLBINDFRAGDATALOCATIONEXTPROC __glewBindFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETFRAGDATALOCATIONEXTPROC __glewGetFragDataLocationEXT; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUIVEXTPROC __glewGetUniformuivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIIVEXTPROC __glewGetVertexAttribIivEXT; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIUIVEXTPROC __glewGetVertexAttribIuivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIEXTPROC __glewUniform1uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM1UIVEXTPROC __glewUniform1uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIEXTPROC __glewUniform2uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM2UIVEXTPROC __glewUniform2uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIEXTPROC __glewUniform3uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM3UIVEXTPROC __glewUniform3uivEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIEXTPROC __glewUniform4uiEXT; +GLEW_FUN_EXPORT PFNGLUNIFORM4UIVEXTPROC __glewUniform4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IEXTPROC __glewVertexAttribI1iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1IVEXTPROC __glewVertexAttribI1ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIEXTPROC __glewVertexAttribI1uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI1UIVEXTPROC __glewVertexAttribI1uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IEXTPROC __glewVertexAttribI2iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2IVEXTPROC __glewVertexAttribI2ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIEXTPROC __glewVertexAttribI2uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI2UIVEXTPROC __glewVertexAttribI2uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IEXTPROC __glewVertexAttribI3iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3IVEXTPROC __glewVertexAttribI3ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIEXTPROC __glewVertexAttribI3uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI3UIVEXTPROC __glewVertexAttribI3uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4BVEXTPROC __glewVertexAttribI4bvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IEXTPROC __glewVertexAttribI4iEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4IVEXTPROC __glewVertexAttribI4ivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4SVEXTPROC __glewVertexAttribI4svEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UBVEXTPROC __glewVertexAttribI4ubvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIEXTPROC __glewVertexAttribI4uiEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4UIVEXTPROC __glewVertexAttribI4uivEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBI4USVEXTPROC __glewVertexAttribI4usvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIPOINTEREXTPROC __glewVertexAttribIPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMEXTPROC __glewGetHistogramEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERFVEXTPROC __glewGetHistogramParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETHISTOGRAMPARAMETERIVEXTPROC __glewGetHistogramParameterivEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXEXTPROC __glewGetMinmaxEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERFVEXTPROC __glewGetMinmaxParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETMINMAXPARAMETERIVEXTPROC __glewGetMinmaxParameterivEXT; +GLEW_FUN_EXPORT PFNGLHISTOGRAMEXTPROC __glewHistogramEXT; +GLEW_FUN_EXPORT PFNGLMINMAXEXTPROC __glewMinmaxEXT; +GLEW_FUN_EXPORT PFNGLRESETHISTOGRAMEXTPROC __glewResetHistogramEXT; +GLEW_FUN_EXPORT PFNGLRESETMINMAXEXTPROC __glewResetMinmaxEXT; + +GLEW_FUN_EXPORT PFNGLINDEXFUNCEXTPROC __glewIndexFuncEXT; + +GLEW_FUN_EXPORT PFNGLINDEXMATERIALEXTPROC __glewIndexMaterialEXT; + +GLEW_FUN_EXPORT PFNGLAPPLYTEXTUREEXTPROC __glewApplyTextureEXT; +GLEW_FUN_EXPORT PFNGLTEXTURELIGHTEXTPROC __glewTextureLightEXT; +GLEW_FUN_EXPORT PFNGLTEXTUREMATERIALEXTPROC __glewTextureMaterialEXT; + +GLEW_FUN_EXPORT PFNGLMULTIDRAWARRAYSEXTPROC __glewMultiDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLMULTIDRAWELEMENTSEXTPROC __glewMultiDrawElementsEXT; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKEXTPROC __glewSampleMaskEXT; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNEXTPROC __glewSamplePatternEXT; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEEXTPROC __glewColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEEXTPROC __glewGetColorTableEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVEXTPROC __glewGetColorTableParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVEXTPROC __glewGetColorTableParameterivEXT; + +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERFVEXTPROC __glewGetPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLGETPIXELTRANSFORMPARAMETERIVEXTPROC __glewGetPixelTransformParameterivEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFEXTPROC __glewPixelTransformParameterfEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC __glewPixelTransformParameterfvEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIEXTPROC __glewPixelTransformParameteriEXT; +GLEW_FUN_EXPORT PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC __glewPixelTransformParameterivEXT; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFEXTPROC __glewPointParameterfEXT; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERFVEXTPROC __glewPointParameterfvEXT; + +GLEW_FUN_EXPORT PFNGLPOLYGONOFFSETEXTPROC __glewPolygonOffsetEXT; + +GLEW_FUN_EXPORT PFNGLPROVOKINGVERTEXEXTPROC __glewProvokingVertexEXT; + +GLEW_FUN_EXPORT PFNGLBEGINSCENEEXTPROC __glewBeginSceneEXT; +GLEW_FUN_EXPORT PFNGLENDSCENEEXTPROC __glewEndSceneEXT; + +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BEXTPROC __glewSecondaryColor3bEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3BVEXTPROC __glewSecondaryColor3bvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DEXTPROC __glewSecondaryColor3dEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3DVEXTPROC __glewSecondaryColor3dvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FEXTPROC __glewSecondaryColor3fEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3FVEXTPROC __glewSecondaryColor3fvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IEXTPROC __glewSecondaryColor3iEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3IVEXTPROC __glewSecondaryColor3ivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SEXTPROC __glewSecondaryColor3sEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3SVEXTPROC __glewSecondaryColor3svEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBEXTPROC __glewSecondaryColor3ubEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UBVEXTPROC __glewSecondaryColor3ubvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIEXTPROC __glewSecondaryColor3uiEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3UIVEXTPROC __glewSecondaryColor3uivEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USEXTPROC __glewSecondaryColor3usEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3USVEXTPROC __glewSecondaryColor3usvEXT; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTEREXTPROC __glewSecondaryColorPointerEXT; + +GLEW_FUN_EXPORT PFNGLACTIVEPROGRAMEXTPROC __glewActiveProgramEXT; +GLEW_FUN_EXPORT PFNGLCREATESHADERPROGRAMEXTPROC __glewCreateShaderProgramEXT; +GLEW_FUN_EXPORT PFNGLUSESHADERPROGRAMEXTPROC __glewUseShaderProgramEXT; + +GLEW_FUN_EXPORT PFNGLBINDIMAGETEXTUREEXTPROC __glewBindImageTextureEXT; +GLEW_FUN_EXPORT PFNGLMEMORYBARRIEREXTPROC __glewMemoryBarrierEXT; + +GLEW_FUN_EXPORT PFNGLACTIVESTENCILFACEEXTPROC __glewActiveStencilFaceEXT; + +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE1DEXTPROC __glewTexSubImage1DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE2DEXTPROC __glewTexSubImage2DEXT; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE3DEXTPROC __glewTexSubImage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE3DEXTPROC __glewTexImage3DEXT; + +GLEW_FUN_EXPORT PFNGLTEXBUFFEREXTPROC __glewTexBufferEXT; + +GLEW_FUN_EXPORT PFNGLCLEARCOLORIIEXTPROC __glewClearColorIiEXT; +GLEW_FUN_EXPORT PFNGLCLEARCOLORIUIEXTPROC __glewClearColorIuiEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIIVEXTPROC __glewGetTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLGETTEXPARAMETERIUIVEXTPROC __glewGetTexParameterIuivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIIVEXTPROC __glewTexParameterIivEXT; +GLEW_FUN_EXPORT PFNGLTEXPARAMETERIUIVEXTPROC __glewTexParameterIuivEXT; + +GLEW_FUN_EXPORT PFNGLARETEXTURESRESIDENTEXTPROC __glewAreTexturesResidentEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREEXTPROC __glewBindTextureEXT; +GLEW_FUN_EXPORT PFNGLDELETETEXTURESEXTPROC __glewDeleteTexturesEXT; +GLEW_FUN_EXPORT PFNGLGENTEXTURESEXTPROC __glewGenTexturesEXT; +GLEW_FUN_EXPORT PFNGLISTEXTUREEXTPROC __glewIsTextureEXT; +GLEW_FUN_EXPORT PFNGLPRIORITIZETEXTURESEXTPROC __glewPrioritizeTexturesEXT; + +GLEW_FUN_EXPORT PFNGLTEXTURENORMALEXTPROC __glewTextureNormalEXT; + +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTI64VEXTPROC __glewGetQueryObjecti64vEXT; +GLEW_FUN_EXPORT PFNGLGETQUERYOBJECTUI64VEXTPROC __glewGetQueryObjectui64vEXT; + +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKEXTPROC __glewBeginTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASEEXTPROC __glewBindBufferBaseEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETEXTPROC __glewBindBufferOffsetEXT; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGEEXTPROC __glewBindBufferRangeEXT; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKEXTPROC __glewEndTransformFeedbackEXT; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGEXTPROC __glewGetTransformFeedbackVaryingEXT; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSEXTPROC __glewTransformFeedbackVaryingsEXT; + +GLEW_FUN_EXPORT PFNGLARRAYELEMENTEXTPROC __glewArrayElementEXT; +GLEW_FUN_EXPORT PFNGLCOLORPOINTEREXTPROC __glewColorPointerEXT; +GLEW_FUN_EXPORT PFNGLDRAWARRAYSEXTPROC __glewDrawArraysEXT; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTEREXTPROC __glewEdgeFlagPointerEXT; +GLEW_FUN_EXPORT PFNGLINDEXPOINTEREXTPROC __glewIndexPointerEXT; +GLEW_FUN_EXPORT PFNGLNORMALPOINTEREXTPROC __glewNormalPointerEXT; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTEREXTPROC __glewTexCoordPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTEREXTPROC __glewVertexPointerEXT; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLDVEXTPROC __glewGetVertexAttribLdvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYVERTEXATTRIBLOFFSETEXTPROC __glewVertexArrayVertexAttribLOffsetEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DEXTPROC __glewVertexAttribL1dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1DVEXTPROC __glewVertexAttribL1dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DEXTPROC __glewVertexAttribL2dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2DVEXTPROC __glewVertexAttribL2dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DEXTPROC __glewVertexAttribL3dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3DVEXTPROC __glewVertexAttribL3dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DEXTPROC __glewVertexAttribL4dEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4DVEXTPROC __glewVertexAttribL4dvEXT; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLPOINTEREXTPROC __glewVertexAttribLPointerEXT; + +GLEW_FUN_EXPORT PFNGLBEGINVERTEXSHADEREXTPROC __glewBeginVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLBINDLIGHTPARAMETEREXTPROC __glewBindLightParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDMATERIALPARAMETEREXTPROC __glewBindMaterialParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDPARAMETEREXTPROC __glewBindParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXGENPARAMETEREXTPROC __glewBindTexGenParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDTEXTUREUNITPARAMETEREXTPROC __glewBindTextureUnitParameterEXT; +GLEW_FUN_EXPORT PFNGLBINDVERTEXSHADEREXTPROC __glewBindVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDELETEVERTEXSHADEREXTPROC __glewDeleteVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC __glewDisableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENABLEVARIANTCLIENTSTATEEXTPROC __glewEnableVariantClientStateEXT; +GLEW_FUN_EXPORT PFNGLENDVERTEXSHADEREXTPROC __glewEndVertexShaderEXT; +GLEW_FUN_EXPORT PFNGLEXTRACTCOMPONENTEXTPROC __glewExtractComponentEXT; +GLEW_FUN_EXPORT PFNGLGENSYMBOLSEXTPROC __glewGenSymbolsEXT; +GLEW_FUN_EXPORT PFNGLGENVERTEXSHADERSEXTPROC __glewGenVertexShadersEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTBOOLEANVEXTPROC __glewGetInvariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTFLOATVEXTPROC __glewGetInvariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETINVARIANTINTEGERVEXTPROC __glewGetInvariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC __glewGetLocalConstantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTFLOATVEXTPROC __glewGetLocalConstantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETLOCALCONSTANTINTEGERVEXTPROC __glewGetLocalConstantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTBOOLEANVEXTPROC __glewGetVariantBooleanvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTFLOATVEXTPROC __glewGetVariantFloatvEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTINTEGERVEXTPROC __glewGetVariantIntegervEXT; +GLEW_FUN_EXPORT PFNGLGETVARIANTPOINTERVEXTPROC __glewGetVariantPointervEXT; +GLEW_FUN_EXPORT PFNGLINSERTCOMPONENTEXTPROC __glewInsertComponentEXT; +GLEW_FUN_EXPORT PFNGLISVARIANTENABLEDEXTPROC __glewIsVariantEnabledEXT; +GLEW_FUN_EXPORT PFNGLSETINVARIANTEXTPROC __glewSetInvariantEXT; +GLEW_FUN_EXPORT PFNGLSETLOCALCONSTANTEXTPROC __glewSetLocalConstantEXT; +GLEW_FUN_EXPORT PFNGLSHADEROP1EXTPROC __glewShaderOp1EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP2EXTPROC __glewShaderOp2EXT; +GLEW_FUN_EXPORT PFNGLSHADEROP3EXTPROC __glewShaderOp3EXT; +GLEW_FUN_EXPORT PFNGLSWIZZLEEXTPROC __glewSwizzleEXT; +GLEW_FUN_EXPORT PFNGLVARIANTPOINTEREXTPROC __glewVariantPointerEXT; +GLEW_FUN_EXPORT PFNGLVARIANTBVEXTPROC __glewVariantbvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTDVEXTPROC __glewVariantdvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTFVEXTPROC __glewVariantfvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTIVEXTPROC __glewVariantivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTSVEXTPROC __glewVariantsvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUBVEXTPROC __glewVariantubvEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUIVEXTPROC __glewVariantuivEXT; +GLEW_FUN_EXPORT PFNGLVARIANTUSVEXTPROC __glewVariantusvEXT; +GLEW_FUN_EXPORT PFNGLWRITEMASKEXTPROC __glewWriteMaskEXT; + +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTPOINTEREXTPROC __glewVertexWeightPointerEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFEXTPROC __glewVertexWeightfEXT; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTFVEXTPROC __glewVertexWeightfvEXT; + +GLEW_FUN_EXPORT PFNGLFRAMETERMINATORGREMEDYPROC __glewFrameTerminatorGREMEDY; + +GLEW_FUN_EXPORT PFNGLSTRINGMARKERGREMEDYPROC __glewStringMarkerGREMEDY; + +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC __glewGetImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC __glewGetImageTransformParameterivHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFHPPROC __glewImageTransformParameterfHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERFVHPPROC __glewImageTransformParameterfvHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIHPPROC __glewImageTransformParameteriHP; +GLEW_FUN_EXPORT PFNGLIMAGETRANSFORMPARAMETERIVHPPROC __glewImageTransformParameterivHP; + +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWARRAYSIBMPROC __glewMultiModeDrawArraysIBM; +GLEW_FUN_EXPORT PFNGLMULTIMODEDRAWELEMENTSIBMPROC __glewMultiModeDrawElementsIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERLISTIBMPROC __glewColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLEDGEFLAGPOINTERLISTIBMPROC __glewEdgeFlagPointerListIBM; +GLEW_FUN_EXPORT PFNGLFOGCOORDPOINTERLISTIBMPROC __glewFogCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLINDEXPOINTERLISTIBMPROC __glewIndexPointerListIBM; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERLISTIBMPROC __glewNormalPointerListIBM; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORPOINTERLISTIBMPROC __glewSecondaryColorPointerListIBM; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERLISTIBMPROC __glewTexCoordPointerListIBM; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERLISTIBMPROC __glewVertexPointerListIBM; + +GLEW_FUN_EXPORT PFNGLCOLORPOINTERVINTELPROC __glewColorPointervINTEL; +GLEW_FUN_EXPORT PFNGLNORMALPOINTERVINTELPROC __glewNormalPointervINTEL; +GLEW_FUN_EXPORT PFNGLTEXCOORDPOINTERVINTELPROC __glewTexCoordPointervINTEL; +GLEW_FUN_EXPORT PFNGLVERTEXPOINTERVINTELPROC __glewVertexPointervINTEL; + +GLEW_FUN_EXPORT PFNGLTEXSCISSORFUNCINTELPROC __glewTexScissorFuncINTEL; +GLEW_FUN_EXPORT PFNGLTEXSCISSORINTELPROC __glewTexScissorINTEL; + +GLEW_FUN_EXPORT PFNGLBUFFERREGIONENABLEDEXTPROC __glewBufferRegionEnabledEXT; +GLEW_FUN_EXPORT PFNGLDELETEBUFFERREGIONEXTPROC __glewDeleteBufferRegionEXT; +GLEW_FUN_EXPORT PFNGLDRAWBUFFERREGIONEXTPROC __glewDrawBufferRegionEXT; +GLEW_FUN_EXPORT PFNGLNEWBUFFERREGIONEXTPROC __glewNewBufferRegionEXT; +GLEW_FUN_EXPORT PFNGLREADBUFFERREGIONEXTPROC __glewReadBufferRegionEXT; + +GLEW_FUN_EXPORT PFNGLRESIZEBUFFERSMESAPROC __glewResizeBuffersMESA; + +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DMESAPROC __glewWindowPos2dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2DVMESAPROC __glewWindowPos2dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FMESAPROC __glewWindowPos2fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2FVMESAPROC __glewWindowPos2fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IMESAPROC __glewWindowPos2iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2IVMESAPROC __glewWindowPos2ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SMESAPROC __glewWindowPos2sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS2SVMESAPROC __glewWindowPos2svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DMESAPROC __glewWindowPos3dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3DVMESAPROC __glewWindowPos3dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FMESAPROC __glewWindowPos3fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3FVMESAPROC __glewWindowPos3fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IMESAPROC __glewWindowPos3iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3IVMESAPROC __glewWindowPos3ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SMESAPROC __glewWindowPos3sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS3SVMESAPROC __glewWindowPos3svMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DMESAPROC __glewWindowPos4dMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4DVMESAPROC __glewWindowPos4dvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FMESAPROC __glewWindowPos4fMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4FVMESAPROC __glewWindowPos4fvMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IMESAPROC __glewWindowPos4iMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4IVMESAPROC __glewWindowPos4ivMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SMESAPROC __glewWindowPos4sMESA; +GLEW_FUN_EXPORT PFNGLWINDOWPOS4SVMESAPROC __glewWindowPos4svMESA; + +GLEW_FUN_EXPORT PFNGLBEGINCONDITIONALRENDERNVPROC __glewBeginConditionalRenderNV; +GLEW_FUN_EXPORT PFNGLENDCONDITIONALRENDERNVPROC __glewEndConditionalRenderNV; + +GLEW_FUN_EXPORT PFNGLCOPYIMAGESUBDATANVPROC __glewCopyImageSubDataNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHDNVPROC __glewClearDepthdNV; +GLEW_FUN_EXPORT PFNGLDEPTHBOUNDSDNVPROC __glewDepthBoundsdNV; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEDNVPROC __glewDepthRangedNV; + +GLEW_FUN_EXPORT PFNGLEVALMAPSNVPROC __glewEvalMapsNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERFVNVPROC __glewGetMapAttribParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPATTRIBPARAMETERIVNVPROC __glewGetMapAttribParameterivNV; +GLEW_FUN_EXPORT PFNGLGETMAPCONTROLPOINTSNVPROC __glewGetMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERFVNVPROC __glewGetMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETMAPPARAMETERIVNVPROC __glewGetMapParameterivNV; +GLEW_FUN_EXPORT PFNGLMAPCONTROLPOINTSNVPROC __glewMapControlPointsNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERFVNVPROC __glewMapParameterfvNV; +GLEW_FUN_EXPORT PFNGLMAPPARAMETERIVNVPROC __glewMapParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETMULTISAMPLEFVNVPROC __glewGetMultisamplefvNV; +GLEW_FUN_EXPORT PFNGLSAMPLEMASKINDEXEDNVPROC __glewSampleMaskIndexedNV; +GLEW_FUN_EXPORT PFNGLTEXRENDERBUFFERNVPROC __glewTexRenderbufferNV; + +GLEW_FUN_EXPORT PFNGLDELETEFENCESNVPROC __glewDeleteFencesNV; +GLEW_FUN_EXPORT PFNGLFINISHFENCENVPROC __glewFinishFenceNV; +GLEW_FUN_EXPORT PFNGLGENFENCESNVPROC __glewGenFencesNV; +GLEW_FUN_EXPORT PFNGLGETFENCEIVNVPROC __glewGetFenceivNV; +GLEW_FUN_EXPORT PFNGLISFENCENVPROC __glewIsFenceNV; +GLEW_FUN_EXPORT PFNGLSETFENCENVPROC __glewSetFenceNV; +GLEW_FUN_EXPORT PFNGLTESTFENCENVPROC __glewTestFenceNV; + +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC __glewGetProgramNamedParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC __glewGetProgramNamedParameterfvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DNVPROC __glewProgramNamedParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC __glewProgramNamedParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FNVPROC __glewProgramNamedParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC __glewProgramNamedParameter4fvNV; + +GLEW_FUN_EXPORT PFNGLRENDERBUFFERSTORAGEMULTISAMPLECOVERAGENVPROC __glewRenderbufferStorageMultisampleCoverageNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMVERTEXLIMITNVPROC __glewProgramVertexLimitNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4INVPROC __glewProgramEnvParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4IVNVPROC __glewProgramEnvParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UINVPROC __glewProgramEnvParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERI4UIVNVPROC __glewProgramEnvParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4IVNVPROC __glewProgramEnvParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMENVPARAMETERSI4UIVNVPROC __glewProgramEnvParametersI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4INVPROC __glewProgramLocalParameterI4iNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4IVNVPROC __glewProgramLocalParameterI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UINVPROC __glewProgramLocalParameterI4uiNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERI4UIVNVPROC __glewProgramLocalParameterI4uivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4IVNVPROC __glewProgramLocalParametersI4ivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMLOCALPARAMETERSI4UIVNVPROC __glewProgramLocalParametersI4uivNV; + +GLEW_FUN_EXPORT PFNGLGETUNIFORMI64VNVPROC __glewGetUniformi64vNV; +GLEW_FUN_EXPORT PFNGLGETUNIFORMUI64VNVPROC __glewGetUniformui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64NVPROC __glewProgramUniform1i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1I64VNVPROC __glewProgramUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64NVPROC __glewProgramUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM1UI64VNVPROC __glewProgramUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64NVPROC __glewProgramUniform2i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2I64VNVPROC __glewProgramUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64NVPROC __glewProgramUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM2UI64VNVPROC __glewProgramUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64NVPROC __glewProgramUniform3i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3I64VNVPROC __glewProgramUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64NVPROC __glewProgramUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM3UI64VNVPROC __glewProgramUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64NVPROC __glewProgramUniform4i64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4I64VNVPROC __glewProgramUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64NVPROC __glewProgramUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORM4UI64VNVPROC __glewProgramUniform4ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64NVPROC __glewUniform1i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1I64VNVPROC __glewUniform1i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64NVPROC __glewUniform1ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM1UI64VNVPROC __glewUniform1ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64NVPROC __glewUniform2i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2I64VNVPROC __glewUniform2i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64NVPROC __glewUniform2ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM2UI64VNVPROC __glewUniform2ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64NVPROC __glewUniform3i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3I64VNVPROC __glewUniform3i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64NVPROC __glewUniform3ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM3UI64VNVPROC __glewUniform3ui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64NVPROC __glewUniform4i64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4I64VNVPROC __glewUniform4i64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64NVPROC __glewUniform4ui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORM4UI64VNVPROC __glewUniform4ui64vNV; + +GLEW_FUN_EXPORT PFNGLCOLOR3HNVPROC __glewColor3hNV; +GLEW_FUN_EXPORT PFNGLCOLOR3HVNVPROC __glewColor3hvNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HNVPROC __glewColor4hNV; +GLEW_FUN_EXPORT PFNGLCOLOR4HVNVPROC __glewColor4hvNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHNVPROC __glewFogCoordhNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDHVNVPROC __glewFogCoordhvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HNVPROC __glewMultiTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD1HVNVPROC __glewMultiTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HNVPROC __glewMultiTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD2HVNVPROC __glewMultiTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HNVPROC __glewMultiTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD3HVNVPROC __glewMultiTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HNVPROC __glewMultiTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLMULTITEXCOORD4HVNVPROC __glewMultiTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HNVPROC __glewNormal3hNV; +GLEW_FUN_EXPORT PFNGLNORMAL3HVNVPROC __glewNormal3hvNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HNVPROC __glewSecondaryColor3hNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLOR3HVNVPROC __glewSecondaryColor3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HNVPROC __glewTexCoord1hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD1HVNVPROC __glewTexCoord1hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HNVPROC __glewTexCoord2hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD2HVNVPROC __glewTexCoord2hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HNVPROC __glewTexCoord3hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD3HVNVPROC __glewTexCoord3hvNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HNVPROC __glewTexCoord4hNV; +GLEW_FUN_EXPORT PFNGLTEXCOORD4HVNVPROC __glewTexCoord4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HNVPROC __glewVertex2hNV; +GLEW_FUN_EXPORT PFNGLVERTEX2HVNVPROC __glewVertex2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HNVPROC __glewVertex3hNV; +GLEW_FUN_EXPORT PFNGLVERTEX3HVNVPROC __glewVertex3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HNVPROC __glewVertex4hNV; +GLEW_FUN_EXPORT PFNGLVERTEX4HVNVPROC __glewVertex4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HNVPROC __glewVertexAttrib1hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1HVNVPROC __glewVertexAttrib1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HNVPROC __glewVertexAttrib2hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2HVNVPROC __glewVertexAttrib2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HNVPROC __glewVertexAttrib3hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3HVNVPROC __glewVertexAttrib3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HNVPROC __glewVertexAttrib4hNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4HVNVPROC __glewVertexAttrib4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1HVNVPROC __glewVertexAttribs1hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2HVNVPROC __glewVertexAttribs2hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3HVNVPROC __glewVertexAttribs3hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4HVNVPROC __glewVertexAttribs4hvNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHNVPROC __glewVertexWeighthNV; +GLEW_FUN_EXPORT PFNGLVERTEXWEIGHTHVNVPROC __glewVertexWeighthvNV; + +GLEW_FUN_EXPORT PFNGLBEGINOCCLUSIONQUERYNVPROC __glewBeginOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLDELETEOCCLUSIONQUERIESNVPROC __glewDeleteOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLENDOCCLUSIONQUERYNVPROC __glewEndOcclusionQueryNV; +GLEW_FUN_EXPORT PFNGLGENOCCLUSIONQUERIESNVPROC __glewGenOcclusionQueriesNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYIVNVPROC __glewGetOcclusionQueryivNV; +GLEW_FUN_EXPORT PFNGLGETOCCLUSIONQUERYUIVNVPROC __glewGetOcclusionQueryuivNV; +GLEW_FUN_EXPORT PFNGLISOCCLUSIONQUERYNVPROC __glewIsOcclusionQueryNV; + +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIIVNVPROC __glewProgramBufferParametersIivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSIUIVNVPROC __glewProgramBufferParametersIuivNV; +GLEW_FUN_EXPORT PFNGLPROGRAMBUFFERPARAMETERSFVNVPROC __glewProgramBufferParametersfvNV; + +GLEW_FUN_EXPORT PFNGLFLUSHPIXELDATARANGENVPROC __glewFlushPixelDataRangeNV; +GLEW_FUN_EXPORT PFNGLPIXELDATARANGENVPROC __glewPixelDataRangeNV; + +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERINVPROC __glewPointParameteriNV; +GLEW_FUN_EXPORT PFNGLPOINTPARAMETERIVNVPROC __glewPointParameterivNV; + +GLEW_FUN_EXPORT PFNGLGETVIDEOI64VNVPROC __glewGetVideoi64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOIVNVPROC __glewGetVideoivNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUI64VNVPROC __glewGetVideoui64vNV; +GLEW_FUN_EXPORT PFNGLGETVIDEOUIVNVPROC __glewGetVideouivNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEDUALFILLNVPROC __glewPresentFrameDualFillNV; +GLEW_FUN_EXPORT PFNGLPRESENTFRAMEKEYEDNVPROC __glewPresentFrameKeyedNV; + +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTINDEXNVPROC __glewPrimitiveRestartIndexNV; +GLEW_FUN_EXPORT PFNGLPRIMITIVERESTARTNVPROC __glewPrimitiveRestartNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERINPUTNVPROC __glewCombinerInputNV; +GLEW_FUN_EXPORT PFNGLCOMBINEROUTPUTNVPROC __glewCombinerOutputNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFNVPROC __glewCombinerParameterfNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERFVNVPROC __glewCombinerParameterfvNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERINVPROC __glewCombinerParameteriNV; +GLEW_FUN_EXPORT PFNGLCOMBINERPARAMETERIVNVPROC __glewCombinerParameterivNV; +GLEW_FUN_EXPORT PFNGLFINALCOMBINERINPUTNVPROC __glewFinalCombinerInputNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC __glewGetCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC __glewGetCombinerInputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC __glewGetCombinerOutputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC __glewGetCombinerOutputParameterivNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC __glewGetFinalCombinerInputParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC __glewGetFinalCombinerInputParameterivNV; + +GLEW_FUN_EXPORT PFNGLCOMBINERSTAGEPARAMETERFVNVPROC __glewCombinerStageParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC __glewGetCombinerStageParameterfvNV; + +GLEW_FUN_EXPORT PFNGLGETBUFFERPARAMETERUI64VNVPROC __glewGetBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64VNVPROC __glewGetIntegerui64vNV; +GLEW_FUN_EXPORT PFNGLGETNAMEDBUFFERPARAMETERUI64VNVPROC __glewGetNamedBufferParameterui64vNV; +GLEW_FUN_EXPORT PFNGLISBUFFERRESIDENTNVPROC __glewIsBufferResidentNV; +GLEW_FUN_EXPORT PFNGLISNAMEDBUFFERRESIDENTNVPROC __glewIsNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERNONRESIDENTNVPROC __glewMakeBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKEBUFFERRESIDENTNVPROC __glewMakeBufferResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERNONRESIDENTNVPROC __glewMakeNamedBufferNonResidentNV; +GLEW_FUN_EXPORT PFNGLMAKENAMEDBUFFERRESIDENTNVPROC __glewMakeNamedBufferResidentNV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64NVPROC __glewProgramUniformui64NV; +GLEW_FUN_EXPORT PFNGLPROGRAMUNIFORMUI64VNVPROC __glewProgramUniformui64vNV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64NVPROC __glewUniformui64NV; +GLEW_FUN_EXPORT PFNGLUNIFORMUI64VNVPROC __glewUniformui64vNV; + +GLEW_FUN_EXPORT PFNGLTEXTUREBARRIERNVPROC __glewTextureBarrierNV; + +GLEW_FUN_EXPORT PFNGLACTIVEVARYINGNVPROC __glewActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLBEGINTRANSFORMFEEDBACKNVPROC __glewBeginTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERBASENVPROC __glewBindBufferBaseNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFEROFFSETNVPROC __glewBindBufferOffsetNV; +GLEW_FUN_EXPORT PFNGLBINDBUFFERRANGENVPROC __glewBindBufferRangeNV; +GLEW_FUN_EXPORT PFNGLENDTRANSFORMFEEDBACKNVPROC __glewEndTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGETACTIVEVARYINGNVPROC __glewGetActiveVaryingNV; +GLEW_FUN_EXPORT PFNGLGETTRANSFORMFEEDBACKVARYINGNVPROC __glewGetTransformFeedbackVaryingNV; +GLEW_FUN_EXPORT PFNGLGETVARYINGLOCATIONNVPROC __glewGetVaryingLocationNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKATTRIBSNVPROC __glewTransformFeedbackAttribsNV; +GLEW_FUN_EXPORT PFNGLTRANSFORMFEEDBACKVARYINGSNVPROC __glewTransformFeedbackVaryingsNV; + +GLEW_FUN_EXPORT PFNGLBINDTRANSFORMFEEDBACKNVPROC __glewBindTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLDELETETRANSFORMFEEDBACKSNVPROC __glewDeleteTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLDRAWTRANSFORMFEEDBACKNVPROC __glewDrawTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLGENTRANSFORMFEEDBACKSNVPROC __glewGenTransformFeedbacksNV; +GLEW_FUN_EXPORT PFNGLISTRANSFORMFEEDBACKNVPROC __glewIsTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLPAUSETRANSFORMFEEDBACKNVPROC __glewPauseTransformFeedbackNV; +GLEW_FUN_EXPORT PFNGLRESUMETRANSFORMFEEDBACKNVPROC __glewResumeTransformFeedbackNV; + +GLEW_FUN_EXPORT PFNGLVDPAUFININVPROC __glewVDPAUFiniNV; +GLEW_FUN_EXPORT PFNGLVDPAUGETSURFACEIVNVPROC __glewVDPAUGetSurfaceivNV; +GLEW_FUN_EXPORT PFNGLVDPAUINITNVPROC __glewVDPAUInitNV; +GLEW_FUN_EXPORT PFNGLVDPAUISSURFACENVPROC __glewVDPAUIsSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUMAPSURFACESNVPROC __glewVDPAUMapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTEROUTPUTSURFACENVPROC __glewVDPAURegisterOutputSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUREGISTERVIDEOSURFACENVPROC __glewVDPAURegisterVideoSurfaceNV; +GLEW_FUN_EXPORT PFNGLVDPAUSURFACEACCESSNVPROC __glewVDPAUSurfaceAccessNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNMAPSURFACESNVPROC __glewVDPAUUnmapSurfacesNV; +GLEW_FUN_EXPORT PFNGLVDPAUUNREGISTERSURFACENVPROC __glewVDPAUUnregisterSurfaceNV; + +GLEW_FUN_EXPORT PFNGLFLUSHVERTEXARRAYRANGENVPROC __glewFlushVertexArrayRangeNV; +GLEW_FUN_EXPORT PFNGLVERTEXARRAYRANGENVPROC __glewVertexArrayRangeNV; + +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLI64VNVPROC __glewGetVertexAttribLi64vNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBLUI64VNVPROC __glewGetVertexAttribLui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64NVPROC __glewVertexAttribL1i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1I64VNVPROC __glewVertexAttribL1i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64NVPROC __glewVertexAttribL1ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL1UI64VNVPROC __glewVertexAttribL1ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64NVPROC __glewVertexAttribL2i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2I64VNVPROC __glewVertexAttribL2i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64NVPROC __glewVertexAttribL2ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL2UI64VNVPROC __glewVertexAttribL2ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64NVPROC __glewVertexAttribL3i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3I64VNVPROC __glewVertexAttribL3i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64NVPROC __glewVertexAttribL3ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL3UI64VNVPROC __glewVertexAttribL3ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64NVPROC __glewVertexAttribL4i64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4I64VNVPROC __glewVertexAttribL4i64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64NVPROC __glewVertexAttribL4ui64NV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBL4UI64VNVPROC __glewVertexAttribL4ui64vNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBLFORMATNVPROC __glewVertexAttribLFormatNV; + +GLEW_FUN_EXPORT PFNGLBUFFERADDRESSRANGENVPROC __glewBufferAddressRangeNV; +GLEW_FUN_EXPORT PFNGLCOLORFORMATNVPROC __glewColorFormatNV; +GLEW_FUN_EXPORT PFNGLEDGEFLAGFORMATNVPROC __glewEdgeFlagFormatNV; +GLEW_FUN_EXPORT PFNGLFOGCOORDFORMATNVPROC __glewFogCoordFormatNV; +GLEW_FUN_EXPORT PFNGLGETINTEGERUI64I_VNVPROC __glewGetIntegerui64i_vNV; +GLEW_FUN_EXPORT PFNGLINDEXFORMATNVPROC __glewIndexFormatNV; +GLEW_FUN_EXPORT PFNGLNORMALFORMATNVPROC __glewNormalFormatNV; +GLEW_FUN_EXPORT PFNGLSECONDARYCOLORFORMATNVPROC __glewSecondaryColorFormatNV; +GLEW_FUN_EXPORT PFNGLTEXCOORDFORMATNVPROC __glewTexCoordFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBFORMATNVPROC __glewVertexAttribFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBIFORMATNVPROC __glewVertexAttribIFormatNV; +GLEW_FUN_EXPORT PFNGLVERTEXFORMATNVPROC __glewVertexFormatNV; + +GLEW_FUN_EXPORT PFNGLAREPROGRAMSRESIDENTNVPROC __glewAreProgramsResidentNV; +GLEW_FUN_EXPORT PFNGLBINDPROGRAMNVPROC __glewBindProgramNV; +GLEW_FUN_EXPORT PFNGLDELETEPROGRAMSNVPROC __glewDeleteProgramsNV; +GLEW_FUN_EXPORT PFNGLEXECUTEPROGRAMNVPROC __glewExecuteProgramNV; +GLEW_FUN_EXPORT PFNGLGENPROGRAMSNVPROC __glewGenProgramsNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERDVNVPROC __glewGetProgramParameterdvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMPARAMETERFVNVPROC __glewGetProgramParameterfvNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMSTRINGNVPROC __glewGetProgramStringNV; +GLEW_FUN_EXPORT PFNGLGETPROGRAMIVNVPROC __glewGetProgramivNV; +GLEW_FUN_EXPORT PFNGLGETTRACKMATRIXIVNVPROC __glewGetTrackMatrixivNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBPOINTERVNVPROC __glewGetVertexAttribPointervNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBDVNVPROC __glewGetVertexAttribdvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBFVNVPROC __glewGetVertexAttribfvNV; +GLEW_FUN_EXPORT PFNGLGETVERTEXATTRIBIVNVPROC __glewGetVertexAttribivNV; +GLEW_FUN_EXPORT PFNGLISPROGRAMNVPROC __glewIsProgramNV; +GLEW_FUN_EXPORT PFNGLLOADPROGRAMNVPROC __glewLoadProgramNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DNVPROC __glewProgramParameter4dNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4DVNVPROC __glewProgramParameter4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FNVPROC __glewProgramParameter4fNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETER4FVNVPROC __glewProgramParameter4fvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4DVNVPROC __glewProgramParameters4dvNV; +GLEW_FUN_EXPORT PFNGLPROGRAMPARAMETERS4FVNVPROC __glewProgramParameters4fvNV; +GLEW_FUN_EXPORT PFNGLREQUESTRESIDENTPROGRAMSNVPROC __glewRequestResidentProgramsNV; +GLEW_FUN_EXPORT PFNGLTRACKMATRIXNVPROC __glewTrackMatrixNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DNVPROC __glewVertexAttrib1dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1DVNVPROC __glewVertexAttrib1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FNVPROC __glewVertexAttrib1fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1FVNVPROC __glewVertexAttrib1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SNVPROC __glewVertexAttrib1sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB1SVNVPROC __glewVertexAttrib1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DNVPROC __glewVertexAttrib2dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2DVNVPROC __glewVertexAttrib2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FNVPROC __glewVertexAttrib2fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2FVNVPROC __glewVertexAttrib2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SNVPROC __glewVertexAttrib2sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB2SVNVPROC __glewVertexAttrib2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DNVPROC __glewVertexAttrib3dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3DVNVPROC __glewVertexAttrib3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FNVPROC __glewVertexAttrib3fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3FVNVPROC __glewVertexAttrib3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SNVPROC __glewVertexAttrib3sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB3SVNVPROC __glewVertexAttrib3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DNVPROC __glewVertexAttrib4dNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4DVNVPROC __glewVertexAttrib4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FNVPROC __glewVertexAttrib4fNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4FVNVPROC __glewVertexAttrib4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SNVPROC __glewVertexAttrib4sNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4SVNVPROC __glewVertexAttrib4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBNVPROC __glewVertexAttrib4ubNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIB4UBVNVPROC __glewVertexAttrib4ubvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBPOINTERNVPROC __glewVertexAttribPointerNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1DVNVPROC __glewVertexAttribs1dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1FVNVPROC __glewVertexAttribs1fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS1SVNVPROC __glewVertexAttribs1svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2DVNVPROC __glewVertexAttribs2dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2FVNVPROC __glewVertexAttribs2fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS2SVNVPROC __glewVertexAttribs2svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3DVNVPROC __glewVertexAttribs3dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3FVNVPROC __glewVertexAttribs3fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS3SVNVPROC __glewVertexAttribs3svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4DVNVPROC __glewVertexAttribs4dvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4FVNVPROC __glewVertexAttribs4fvNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4SVNVPROC __glewVertexAttribs4svNV; +GLEW_FUN_EXPORT PFNGLVERTEXATTRIBS4UBVNVPROC __glewVertexAttribs4ubvNV; + +GLEW_FUN_EXPORT PFNGLCLEARDEPTHFOESPROC __glewClearDepthfOES; +GLEW_FUN_EXPORT PFNGLCLIPPLANEFOESPROC __glewClipPlanefOES; +GLEW_FUN_EXPORT PFNGLDEPTHRANGEFOESPROC __glewDepthRangefOES; +GLEW_FUN_EXPORT PFNGLFRUSTUMFOESPROC __glewFrustumfOES; +GLEW_FUN_EXPORT PFNGLGETCLIPPLANEFOESPROC __glewGetClipPlanefOES; +GLEW_FUN_EXPORT PFNGLORTHOFOESPROC __glewOrthofOES; + +GLEW_FUN_EXPORT PFNGLDETAILTEXFUNCSGISPROC __glewDetailTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETDETAILTEXFUNCSGISPROC __glewGetDetailTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLFOGFUNCSGISPROC __glewFogFuncSGIS; +GLEW_FUN_EXPORT PFNGLGETFOGFUNCSGISPROC __glewGetFogFuncSGIS; + +GLEW_FUN_EXPORT PFNGLSAMPLEMASKSGISPROC __glewSampleMaskSGIS; +GLEW_FUN_EXPORT PFNGLSAMPLEPATTERNSGISPROC __glewSamplePatternSGIS; + +GLEW_FUN_EXPORT PFNGLGETSHARPENTEXFUNCSGISPROC __glewGetSharpenTexFuncSGIS; +GLEW_FUN_EXPORT PFNGLSHARPENTEXFUNCSGISPROC __glewSharpenTexFuncSGIS; + +GLEW_FUN_EXPORT PFNGLTEXIMAGE4DSGISPROC __glewTexImage4DSGIS; +GLEW_FUN_EXPORT PFNGLTEXSUBIMAGE4DSGISPROC __glewTexSubImage4DSGIS; + +GLEW_FUN_EXPORT PFNGLGETTEXFILTERFUNCSGISPROC __glewGetTexFilterFuncSGIS; +GLEW_FUN_EXPORT PFNGLTEXFILTERFUNCSGISPROC __glewTexFilterFuncSGIS; + +GLEW_FUN_EXPORT PFNGLASYNCMARKERSGIXPROC __glewAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLDELETEASYNCMARKERSSGIXPROC __glewDeleteAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLFINISHASYNCSGIXPROC __glewFinishAsyncSGIX; +GLEW_FUN_EXPORT PFNGLGENASYNCMARKERSSGIXPROC __glewGenAsyncMarkersSGIX; +GLEW_FUN_EXPORT PFNGLISASYNCMARKERSGIXPROC __glewIsAsyncMarkerSGIX; +GLEW_FUN_EXPORT PFNGLPOLLASYNCSGIXPROC __glewPollAsyncSGIX; + +GLEW_FUN_EXPORT PFNGLFLUSHRASTERSGIXPROC __glewFlushRasterSGIX; + +GLEW_FUN_EXPORT PFNGLTEXTUREFOGSGIXPROC __glewTextureFogSGIX; + +GLEW_FUN_EXPORT PFNGLFRAGMENTCOLORMATERIALSGIXPROC __glewFragmentColorMaterialSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFSGIXPROC __glewFragmentLightModelfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELFVSGIXPROC __glewFragmentLightModelfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELISGIXPROC __glewFragmentLightModeliSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTMODELIVSGIXPROC __glewFragmentLightModelivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFSGIXPROC __glewFragmentLightfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTFVSGIXPROC __glewFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTISGIXPROC __glewFragmentLightiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTLIGHTIVSGIXPROC __glewFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFSGIXPROC __glewFragmentMaterialfSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALFVSGIXPROC __glewFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALISGIXPROC __glewFragmentMaterialiSGIX; +GLEW_FUN_EXPORT PFNGLFRAGMENTMATERIALIVSGIXPROC __glewFragmentMaterialivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTFVSGIXPROC __glewGetFragmentLightfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTLIGHTIVSGIXPROC __glewGetFragmentLightivSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALFVSGIXPROC __glewGetFragmentMaterialfvSGIX; +GLEW_FUN_EXPORT PFNGLGETFRAGMENTMATERIALIVSGIXPROC __glewGetFragmentMaterialivSGIX; + +GLEW_FUN_EXPORT PFNGLFRAMEZOOMSGIXPROC __glewFrameZoomSGIX; + +GLEW_FUN_EXPORT PFNGLPIXELTEXGENSGIXPROC __glewPixelTexGenSGIX; + +GLEW_FUN_EXPORT PFNGLREFERENCEPLANESGIXPROC __glewReferencePlaneSGIX; + +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFSGIXPROC __glewSpriteParameterfSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERFVSGIXPROC __glewSpriteParameterfvSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERISGIXPROC __glewSpriteParameteriSGIX; +GLEW_FUN_EXPORT PFNGLSPRITEPARAMETERIVSGIXPROC __glewSpriteParameterivSGIX; + +GLEW_FUN_EXPORT PFNGLTAGSAMPLEBUFFERSGIXPROC __glewTagSampleBufferSGIX; + +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERFVSGIPROC __glewColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLEPARAMETERIVSGIPROC __glewColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLCOLORTABLESGIPROC __glewColorTableSGI; +GLEW_FUN_EXPORT PFNGLCOPYCOLORTABLESGIPROC __glewCopyColorTableSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERFVSGIPROC __glewGetColorTableParameterfvSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLEPARAMETERIVSGIPROC __glewGetColorTableParameterivSGI; +GLEW_FUN_EXPORT PFNGLGETCOLORTABLESGIPROC __glewGetColorTableSGI; + +GLEW_FUN_EXPORT PFNGLFINISHTEXTURESUNXPROC __glewFinishTextureSUNX; + +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORBSUNPROC __glewGlobalAlphaFactorbSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORDSUNPROC __glewGlobalAlphaFactordSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORFSUNPROC __glewGlobalAlphaFactorfSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORISUNPROC __glewGlobalAlphaFactoriSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORSSUNPROC __glewGlobalAlphaFactorsSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUBSUNPROC __glewGlobalAlphaFactorubSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUISUNPROC __glewGlobalAlphaFactoruiSUN; +GLEW_FUN_EXPORT PFNGLGLOBALALPHAFACTORUSSUNPROC __glewGlobalAlphaFactorusSUN; + +GLEW_FUN_EXPORT PFNGLREADVIDEOPIXELSSUNPROC __glewReadVideoPixelsSUN; + +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEPOINTERSUNPROC __glewReplacementCodePointerSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBSUNPROC __glewReplacementCodeubSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUBVSUNPROC __glewReplacementCodeubvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUISUNPROC __glewReplacementCodeuiSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVSUNPROC __glewReplacementCodeuivSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSSUNPROC __glewReplacementCodeusSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUSVSUNPROC __glewReplacementCodeusvSUN; + +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FSUNPROC __glewColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR3FVERTEX3FVSUNPROC __glewColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FSUNPROC __glewColor4ubVertex2fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX2FVSUNPROC __glewColor4ubVertex2fvSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FSUNPROC __glewColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLCOLOR4UBVERTEX3FVSUNPROC __glewColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FSUNPROC __glewNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLNORMAL3FVERTEX3FVSUNPROC __glewNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC __glewReplacementCodeuiColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC __glewReplacementCodeuiColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC __glewReplacementCodeuiColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC __glewReplacementCodeuiTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC __glewReplacementCodeuiVertex3fSUN; +GLEW_FUN_EXPORT PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC __glewReplacementCodeuiVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC __glewTexCoord2fColor3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC __glewTexCoord2fColor3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fColor4fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC __glewTexCoord2fColor4ubVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC __glewTexCoord2fColor4ubVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC __glewTexCoord2fNormal3fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC __glewTexCoord2fNormal3fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FSUNPROC __glewTexCoord2fVertex3fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD2FVERTEX3FVSUNPROC __glewTexCoord2fVertex3fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC __glewTexCoord4fColor4fNormal3fVertex4fvSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FSUNPROC __glewTexCoord4fVertex4fSUN; +GLEW_FUN_EXPORT PFNGLTEXCOORD4FVERTEX4FVSUNPROC __glewTexCoord4fVertex4fvSUN; + +GLEW_FUN_EXPORT PFNGLADDSWAPHINTRECTWINPROC __glewAddSwapHintRectWIN; + +#if defined(GLEW_MX) && !defined(_WIN32) +struct GLEWContextStruct +{ +#endif /* GLEW_MX */ + +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_4; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_1_5; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_2_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_1; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_2; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_3_3; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_0; +GLEW_VAR_EXPORT GLboolean __GLEW_VERSION_4_1; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_tbuffer; +GLEW_VAR_EXPORT GLboolean __GLEW_3DFX_texture_compression_FXT1; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_conservative_depth; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_depth_clamp_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_name_gen_delete; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_performance_monitor; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_seamless_cubemap_per_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_texture_texture4; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_transform_feedback3_lines_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_AMD_vertex_shader_tessellator; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_aux_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_client_storage; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_float_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_flush_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_object_purgeable; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_pixel_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_rgb_422; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_row_bytes; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_specular_vector; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_transform_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_vertex_program_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_APPLE_ycbcr_422; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_ES2_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_blend_func_extended; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_cl_event; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_color_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_compatibility; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_copy_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_debug_output; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_buffers_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_elements_base_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_indirect; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_explicit_attrib_location; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_coord_conventions; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_program_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_get_program_binary; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_gpu_shader_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_half_float_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_imaging; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_instanced_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_map_buffer_range; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_matrix_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_multitexture; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_occlusion_query2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_robustness; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sample_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sampler_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_seamless_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_bit_encoding; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_stencil_export; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_subroutine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_100; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shading_language_include; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_sync; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_tessellation_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_buffer_object_rgb32; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_bptc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_cube_map_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_crossbar; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_gather; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_non_power_of_two; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_query_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rg; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_rgb10_a2ui; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transform_feedback3; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_transpose_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_uniform_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_blend; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_vertex_type_2_10_10_10_rev; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_viewport_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ARB_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_point_sprites; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_texture_env_route; +GLEW_VAR_EXPORT GLboolean __GLEW_ATIX_vertex_shader_output_point_size; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_draw_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_element_array; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_envmap_bumpmap; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_map_object_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_meminfo; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_pn_triangles; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_separate_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_shader_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_text_fragment_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_compression_3dc; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_env_combine3; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_float; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_texture_mirror_once; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_attrib_array_object; +GLEW_VAR_EXPORT GLboolean __GLEW_ATI_vertex_streams; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_422_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_Cg_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_abgr; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_bindable_uniform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_equation_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_func_separate; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_logic_op; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_blend_subtract; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_clip_volume_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cmyka; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_color_subtable; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_compiled_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_convolution; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_coordinate_frame; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_copy_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_depth_bounds_test; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_direct_state_access; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_buffers2; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_instanced; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_draw_range_elements; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fog_coord; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_fragment_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_blit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_framebuffer_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_program_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_gpu_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_array_formats; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_func; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_material; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_index_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_light_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_misc_attribute; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multi_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_float; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_packed_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_pixel_transform_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_point_parameters; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_polygon_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_provoking_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_rescale_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_scene_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_secondary_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_shader_objects; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_separate_specular_color; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shader_image_load_store; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shadow_funcs; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_shared_texture_palette; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_clear_tag; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_two_side; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_stencil_wrap; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_subtexture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture3D; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_dxt1; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_latc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_rgtc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_compression_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_cube_map; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_add; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_combine; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_env_dot3; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_filter_anisotropic; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_integer; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_mirror_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_object; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_perturb_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_sRGB_decode; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_shared_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_snorm; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_texture_swizzle; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_timer_query; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_array_bgra; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_attrib_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_EXT_vertex_weighting; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_frame_terminator; +GLEW_VAR_EXPORT GLboolean __GLEW_GREMEDY_string_marker; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_image_transform; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_occlusion_test; +GLEW_VAR_EXPORT GLboolean __GLEW_HP_texture_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_cull_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_multimode_draw_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_rasterpos_clip; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_static_data; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_texture_mirrored_repeat; +GLEW_VAR_EXPORT GLboolean __GLEW_IBM_vertex_array_lists; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_color_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_INGR_interlace_read; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_parallel_arrays; +GLEW_VAR_EXPORT GLboolean __GLEW_INTEL_texture_scissor; +GLEW_VAR_EXPORT GLboolean __GLEW_KTX_buffer_region; +GLEW_VAR_EXPORT GLboolean __GLEW_MESAX_texture_stack; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_pack_invert; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_resize_buffers; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_window_pos; +GLEW_VAR_EXPORT GLboolean __GLEW_MESA_ycbcr_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_NVX_gpu_memory_info; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_blend_square; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_conditional_render; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_depth_to_color; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_copy_image; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_buffer_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_depth_range_unclamped; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_evaluators; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_explicit_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fence; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_float_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fog_distance; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_fragment_program_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_framebuffer_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_geometry_shader4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_program_fp64; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_gpu_shader5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_half_float; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_light_max_exponent; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_coverage; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_multisample_filter_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_occlusion_query; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_packed_depth_stencil; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_parameter_buffer_object2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_pixel_data_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_point_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_present_video; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_primitive_restart; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_register_combiners2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_shader_buffer_load; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_tessellation_program5; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_emboss; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texgen_reflection; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_barrier; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_compression_vtc; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_env_combine4; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_expand_normal; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_rectangle; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_texture_shader3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_transform_feedback2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vdpau_interop; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_array_range2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_attrib_integer_64bit; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_buffer_unified_memory; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program1_1; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program2_option; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program3; +GLEW_VAR_EXPORT GLboolean __GLEW_NV_vertex_program4; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_byte_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_compressed_paletted_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_read_format; +GLEW_VAR_EXPORT GLboolean __GLEW_OES_single_precision; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_OML_subsample; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_misc_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_PGI_vertex_hints; +GLEW_VAR_EXPORT GLboolean __GLEW_REND_screen_coordinates; +GLEW_VAR_EXPORT GLboolean __GLEW_S3_s3tc; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_color_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_detail_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_fog_function; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_generate_mipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_multisample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_point_line_texgen; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_sharpen_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture4D; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_border_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_edge_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_filter4; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_lod; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIS_texture_select; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_histogram; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_async_pixel; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_blend_alpha_minmax; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_clipmap; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_convolution_accuracy; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_depth_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_flush_raster; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_offset; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fog_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_fragment_specular_lighting; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_framezoom; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_interlace; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ir_instrument1; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_list_priority; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_pixel_texture_bits; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_reference_plane; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_resample; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_shadow_ambient; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_sprite; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_tag_sample_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_add_env; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_coordinate_clamp; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_lod_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_multi_buffer; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_range; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_texture_scale_bias; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_vertex_preclip_hint; +GLEW_VAR_EXPORT GLboolean __GLEW_SGIX_ycrcb; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_matrix; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SGI_texture_color_table; +GLEW_VAR_EXPORT GLboolean __GLEW_SUNX_constant_data; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_convolution_border_modes; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_global_alpha; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_mesh_array; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_read_video_pixels; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_slice_accum; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_triangle_list; +GLEW_VAR_EXPORT GLboolean __GLEW_SUN_vertex; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_phong_shading; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_specular_fog; +GLEW_VAR_EXPORT GLboolean __GLEW_WIN_swap_hint; + +#ifdef GLEW_MX +}; /* GLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +/* error codes */ +#define GLEW_OK 0 +#define GLEW_NO_ERROR 0 +#define GLEW_ERROR_NO_GL_VERSION 1 /* missing GL version */ +#define GLEW_ERROR_GL_VERSION_10_ONLY 2 /* Need at least OpenGL 1.1 */ +#define GLEW_ERROR_GLX_VERSION_11_ONLY 3 /* Need at least GLX 1.2 */ + +/* string codes */ +#define GLEW_VERSION 1 +#define GLEW_VERSION_MAJOR 2 +#define GLEW_VERSION_MINOR 3 +#define GLEW_VERSION_MICRO 4 + +/* API */ +#ifdef GLEW_MX + +typedef struct GLEWContextStruct GLEWContext; +GLEWAPI GLenum glewContextInit (GLEWContext* ctx); +GLEWAPI GLboolean glewContextIsSupported (const GLEWContext* ctx, const char* name); + +#define glewInit() glewContextInit(glewGetContext()) +#define glewIsSupported(x) glewContextIsSupported(glewGetContext(), x) +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&(glewGetContext()->x)) +#ifdef _WIN32 +# define GLEW_GET_FUN(x) glewGetContext()->x +#else +# define GLEW_GET_FUN(x) x +#endif + +#else /* GLEW_MX */ + +GLEWAPI GLenum glewInit (); +GLEWAPI GLboolean glewIsSupported (const char* name); +#define glewIsExtensionSupported(x) glewIsSupported(x) + +#define GLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLEW_GET_FUN(x) x + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean glewExperimental; +GLEWAPI GLboolean glewGetExtension (const char* name); +GLEWAPI const GLubyte* glewGetErrorString (GLenum error); +GLEWAPI const GLubyte* glewGetString (GLenum name); + +#ifdef __cplusplus +} +#endif + +#ifdef GLEW_APIENTRY_DEFINED +#undef GLEW_APIENTRY_DEFINED +#undef APIENTRY +#undef GLAPIENTRY +#define GLAPIENTRY +#endif + +#ifdef GLEW_CALLBACK_DEFINED +#undef GLEW_CALLBACK_DEFINED +#undef CALLBACK +#endif + +#ifdef GLEW_WINGDIAPI_DEFINED +#undef GLEW_WINGDIAPI_DEFINED +#undef WINGDIAPI +#endif + +#undef GLAPI +/* #undef GLEWAPI */ + +#endif /* __glew_h__ */ diff --git a/Pkgs/glxew.h b/Pkgs/glxew.h new file mode 100644 index 0000000..566b507 --- /dev/null +++ b/Pkgs/glxew.h @@ -0,0 +1,1537 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** 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. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** 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 OWNER 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. +*/ + +/* + * Mesa 3-D graphics library + * Version: 7.0 + * + * Copyright (C) 1999-2007 Brian Paul 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 and this permission notice 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 + * BRIAN PAUL 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. + */ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE 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 THE AUTHORS OR COPYRIGHT HOLDERS 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 +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __glxew_h__ +#define __glxew_h__ +#define __GLXEW_H__ + +#ifdef __glxext_h_ +#error glxext.h included before glxew.h +#endif + +#if defined(GLX_H) || defined(__GLX_glx_h__) || defined(__glx_h__) +#error glx.h included before glxew.h +#endif + +#define __glxext_h_ + +#define GLX_H +#define __GLX_glx_h__ +#define __glx_h__ + +#include +#include +#include +#include "Pkgs/glew.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/* ---------------------------- GLX_VERSION_1_0 --------------------------- */ + +#ifndef GLX_VERSION_1_0 +#define GLX_VERSION_1_0 1 + +#define GLX_USE_GL 1 +#define GLX_BUFFER_SIZE 2 +#define GLX_LEVEL 3 +#define GLX_RGBA 4 +#define GLX_DOUBLEBUFFER 5 +#define GLX_STEREO 6 +#define GLX_AUX_BUFFERS 7 +#define GLX_RED_SIZE 8 +#define GLX_GREEN_SIZE 9 +#define GLX_BLUE_SIZE 10 +#define GLX_ALPHA_SIZE 11 +#define GLX_DEPTH_SIZE 12 +#define GLX_STENCIL_SIZE 13 +#define GLX_ACCUM_RED_SIZE 14 +#define GLX_ACCUM_GREEN_SIZE 15 +#define GLX_ACCUM_BLUE_SIZE 16 +#define GLX_ACCUM_ALPHA_SIZE 17 +#define GLX_BAD_SCREEN 1 +#define GLX_BAD_ATTRIBUTE 2 +#define GLX_NO_EXTENSION 3 +#define GLX_BAD_VISUAL 4 +#define GLX_BAD_CONTEXT 5 +#define GLX_BAD_VALUE 6 +#define GLX_BAD_ENUM 7 + +typedef XID GLXDrawable; +typedef XID GLXPixmap; +#ifdef __sun +typedef struct __glXContextRec *GLXContext; +#else +typedef struct __GLXcontextRec *GLXContext; +#endif + +typedef unsigned int GLXVideoDeviceNV; + +extern Bool glXQueryExtension (Display *dpy, int *errorBase, int *eventBase); +extern Bool glXQueryVersion (Display *dpy, int *major, int *minor); +extern int glXGetConfig (Display *dpy, XVisualInfo *vis, int attrib, int *value); +extern XVisualInfo* glXChooseVisual (Display *dpy, int screen, int *attribList); +extern GLXPixmap glXCreateGLXPixmap (Display *dpy, XVisualInfo *vis, Pixmap pixmap); +extern void glXDestroyGLXPixmap (Display *dpy, GLXPixmap pix); +extern GLXContext glXCreateContext (Display *dpy, XVisualInfo *vis, GLXContext shareList, Bool direct); +extern void glXDestroyContext (Display *dpy, GLXContext ctx); +extern Bool glXIsDirect (Display *dpy, GLXContext ctx); +extern void glXCopyContext (Display *dpy, GLXContext src, GLXContext dst, GLulong mask); +extern Bool glXMakeCurrent (Display *dpy, GLXDrawable drawable, GLXContext ctx); +extern GLXContext glXGetCurrentContext (void); +extern GLXDrawable glXGetCurrentDrawable (void); +extern void glXWaitGL (void); +extern void glXWaitX (void); +extern void glXSwapBuffers (Display *dpy, GLXDrawable drawable); +extern void glXUseXFont (Font font, int first, int count, int listBase); + +#define GLXEW_VERSION_1_0 GLXEW_GET_VAR(__GLXEW_VERSION_1_0) + +#endif /* GLX_VERSION_1_0 */ + +/* ---------------------------- GLX_VERSION_1_1 --------------------------- */ + +#ifndef GLX_VERSION_1_1 +#define GLX_VERSION_1_1 + +#define GLX_VENDOR 0x1 +#define GLX_VERSION 0x2 +#define GLX_EXTENSIONS 0x3 + +extern const char* glXQueryExtensionsString (Display *dpy, int screen); +extern const char* glXGetClientString (Display *dpy, int name); +extern const char* glXQueryServerString (Display *dpy, int screen, int name); + +#define GLXEW_VERSION_1_1 GLXEW_GET_VAR(__GLXEW_VERSION_1_1) + +#endif /* GLX_VERSION_1_1 */ + +/* ---------------------------- GLX_VERSION_1_2 ---------------------------- */ + +#ifndef GLX_VERSION_1_2 +#define GLX_VERSION_1_2 1 + +typedef Display* ( * PFNGLXGETCURRENTDISPLAYPROC) (void); + +#define glXGetCurrentDisplay GLXEW_GET_FUN(__glewXGetCurrentDisplay) + +#define GLXEW_VERSION_1_2 GLXEW_GET_VAR(__GLXEW_VERSION_1_2) + +#endif /* GLX_VERSION_1_2 */ + +/* ---------------------------- GLX_VERSION_1_3 ---------------------------- */ + +#ifndef GLX_VERSION_1_3 +#define GLX_VERSION_1_3 1 + +#define GLX_RGBA_BIT 0x00000001 +#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001 +#define GLX_WINDOW_BIT 0x00000001 +#define GLX_COLOR_INDEX_BIT 0x00000002 +#define GLX_PIXMAP_BIT 0x00000002 +#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002 +#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004 +#define GLX_PBUFFER_BIT 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008 +#define GLX_AUX_BUFFERS_BIT 0x00000010 +#define GLX_CONFIG_CAVEAT 0x20 +#define GLX_DEPTH_BUFFER_BIT 0x00000020 +#define GLX_X_VISUAL_TYPE 0x22 +#define GLX_TRANSPARENT_TYPE 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE 0x24 +#define GLX_TRANSPARENT_RED_VALUE 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE 0x28 +#define GLX_STENCIL_BUFFER_BIT 0x00000040 +#define GLX_ACCUM_BUFFER_BIT 0x00000080 +#define GLX_NONE 0x8000 +#define GLX_SLOW_CONFIG 0x8001 +#define GLX_TRUE_COLOR 0x8002 +#define GLX_DIRECT_COLOR 0x8003 +#define GLX_PSEUDO_COLOR 0x8004 +#define GLX_STATIC_COLOR 0x8005 +#define GLX_GRAY_SCALE 0x8006 +#define GLX_STATIC_GRAY 0x8007 +#define GLX_TRANSPARENT_RGB 0x8008 +#define GLX_TRANSPARENT_INDEX 0x8009 +#define GLX_VISUAL_ID 0x800B +#define GLX_SCREEN 0x800C +#define GLX_NON_CONFORMANT_CONFIG 0x800D +#define GLX_DRAWABLE_TYPE 0x8010 +#define GLX_RENDER_TYPE 0x8011 +#define GLX_X_RENDERABLE 0x8012 +#define GLX_FBCONFIG_ID 0x8013 +#define GLX_RGBA_TYPE 0x8014 +#define GLX_COLOR_INDEX_TYPE 0x8015 +#define GLX_MAX_PBUFFER_WIDTH 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT 0x8017 +#define GLX_MAX_PBUFFER_PIXELS 0x8018 +#define GLX_PRESERVED_CONTENTS 0x801B +#define GLX_LARGEST_PBUFFER 0x801C +#define GLX_WIDTH 0x801D +#define GLX_HEIGHT 0x801E +#define GLX_EVENT_MASK 0x801F +#define GLX_DAMAGED 0x8020 +#define GLX_SAVED 0x8021 +#define GLX_WINDOW 0x8022 +#define GLX_PBUFFER 0x8023 +#define GLX_PBUFFER_HEIGHT 0x8040 +#define GLX_PBUFFER_WIDTH 0x8041 +#define GLX_PBUFFER_CLOBBER_MASK 0x08000000 +#define GLX_DONT_CARE 0xFFFFFFFF + +typedef XID GLXFBConfigID; +typedef XID GLXPbuffer; +typedef XID GLXWindow; +typedef struct __GLXFBConfigRec *GLXFBConfig; + +typedef struct { + int event_type; + int draw_type; + unsigned long serial; + Bool send_event; + Display *display; + GLXDrawable drawable; + unsigned int buffer_mask; + unsigned int aux_buffer; + int x, y; + int width, height; + int count; +} GLXPbufferClobberEvent; +typedef union __GLXEvent { + GLXPbufferClobberEvent glxpbufferclobber; + long pad[24]; +} GLXEvent; + +typedef GLXFBConfig* ( * PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPbuffer ( * PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list); +typedef GLXPixmap ( * PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list); +typedef GLXWindow ( * PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list); +typedef void ( * PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap); +typedef void ( * PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win); +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLEPROC) (void); +typedef int ( * PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value); +typedef GLXFBConfig* ( * PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements); +typedef void ( * PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config); +typedef Bool ( * PFNGLXMAKECONTEXTCURRENTPROC) (Display *display, GLXDrawable draw, GLXDrawable read, GLXContext ctx); +typedef int ( * PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value); +typedef void ( * PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask); + +#define glXChooseFBConfig GLXEW_GET_FUN(__glewXChooseFBConfig) +#define glXCreateNewContext GLXEW_GET_FUN(__glewXCreateNewContext) +#define glXCreatePbuffer GLXEW_GET_FUN(__glewXCreatePbuffer) +#define glXCreatePixmap GLXEW_GET_FUN(__glewXCreatePixmap) +#define glXCreateWindow GLXEW_GET_FUN(__glewXCreateWindow) +#define glXDestroyPbuffer GLXEW_GET_FUN(__glewXDestroyPbuffer) +#define glXDestroyPixmap GLXEW_GET_FUN(__glewXDestroyPixmap) +#define glXDestroyWindow GLXEW_GET_FUN(__glewXDestroyWindow) +#define glXGetCurrentReadDrawable GLXEW_GET_FUN(__glewXGetCurrentReadDrawable) +#define glXGetFBConfigAttrib GLXEW_GET_FUN(__glewXGetFBConfigAttrib) +#define glXGetFBConfigs GLXEW_GET_FUN(__glewXGetFBConfigs) +#define glXGetSelectedEvent GLXEW_GET_FUN(__glewXGetSelectedEvent) +#define glXGetVisualFromFBConfig GLXEW_GET_FUN(__glewXGetVisualFromFBConfig) +#define glXMakeContextCurrent GLXEW_GET_FUN(__glewXMakeContextCurrent) +#define glXQueryContext GLXEW_GET_FUN(__glewXQueryContext) +#define glXQueryDrawable GLXEW_GET_FUN(__glewXQueryDrawable) +#define glXSelectEvent GLXEW_GET_FUN(__glewXSelectEvent) + +#define GLXEW_VERSION_1_3 GLXEW_GET_VAR(__GLXEW_VERSION_1_3) + +#endif /* GLX_VERSION_1_3 */ + +/* ---------------------------- GLX_VERSION_1_4 ---------------------------- */ + +#ifndef GLX_VERSION_1_4 +#define GLX_VERSION_1_4 1 + +#define GLX_SAMPLE_BUFFERS 100000 +#define GLX_SAMPLES 100001 + +extern void ( * glXGetProcAddress (const GLubyte *procName)) (void); + +#define GLXEW_VERSION_1_4 GLXEW_GET_VAR(__GLXEW_VERSION_1_4) + +#endif /* GLX_VERSION_1_4 */ + +/* -------------------------- GLX_3DFX_multisample ------------------------- */ + +#ifndef GLX_3DFX_multisample +#define GLX_3DFX_multisample 1 + +#define GLX_SAMPLE_BUFFERS_3DFX 0x8050 +#define GLX_SAMPLES_3DFX 0x8051 + +#define GLXEW_3DFX_multisample GLXEW_GET_VAR(__GLXEW_3DFX_multisample) + +#endif /* GLX_3DFX_multisample */ + +/* ------------------------ GLX_AMD_gpu_association ------------------------ */ + +#ifndef GLX_AMD_gpu_association +#define GLX_AMD_gpu_association 1 + +#define GLX_GPU_VENDOR_AMD 0x1F00 +#define GLX_GPU_RENDERER_STRING_AMD 0x1F01 +#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define GLX_GPU_RAM_AMD 0x21A3 +#define GLX_GPU_CLOCK_AMD 0x21A4 +#define GLX_GPU_NUM_PIPES_AMD 0x21A5 +#define GLX_GPU_NUM_SIMD_AMD 0x21A6 +#define GLX_GPU_NUM_RB_AMD 0x21A7 +#define GLX_GPU_NUM_SPI_AMD 0x21A8 + +#define GLXEW_AMD_gpu_association GLXEW_GET_VAR(__GLXEW_AMD_gpu_association) + +#endif /* GLX_AMD_gpu_association */ + +/* ------------------------- GLX_ARB_create_context ------------------------ */ + +#ifndef GLX_ARB_create_context +#define GLX_ARB_create_context 1 + +#define GLX_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define GLX_CONTEXT_FLAGS_ARB 0x2094 + +typedef GLXContext ( * PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display* dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list); + +#define glXCreateContextAttribsARB GLXEW_GET_FUN(__glewXCreateContextAttribsARB) + +#define GLXEW_ARB_create_context GLXEW_GET_VAR(__GLXEW_ARB_create_context) + +#endif /* GLX_ARB_create_context */ + +/* --------------------- GLX_ARB_create_context_profile -------------------- */ + +#ifndef GLX_ARB_create_context_profile +#define GLX_ARB_create_context_profile 1 + +#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define GLXEW_ARB_create_context_profile GLXEW_GET_VAR(__GLXEW_ARB_create_context_profile) + +#endif /* GLX_ARB_create_context_profile */ + +/* ------------------- GLX_ARB_create_context_robustness ------------------- */ + +#ifndef GLX_ARB_create_context_robustness +#define GLX_ARB_create_context_robustness 1 + +#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define GLXEW_ARB_create_context_robustness GLXEW_GET_VAR(__GLXEW_ARB_create_context_robustness) + +#endif /* GLX_ARB_create_context_robustness */ + +/* ------------------------- GLX_ARB_fbconfig_float ------------------------ */ + +#ifndef GLX_ARB_fbconfig_float +#define GLX_ARB_fbconfig_float 1 + +#define GLX_RGBA_FLOAT_BIT 0x00000004 +#define GLX_RGBA_FLOAT_TYPE 0x20B9 + +#define GLXEW_ARB_fbconfig_float GLXEW_GET_VAR(__GLXEW_ARB_fbconfig_float) + +#endif /* GLX_ARB_fbconfig_float */ + +/* ------------------------ GLX_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_ARB_framebuffer_sRGB +#define GLX_ARB_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2 + +#define GLXEW_ARB_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_ARB_framebuffer_sRGB) + +#endif /* GLX_ARB_framebuffer_sRGB */ + +/* ------------------------ GLX_ARB_get_proc_address ----------------------- */ + +#ifndef GLX_ARB_get_proc_address +#define GLX_ARB_get_proc_address 1 + +extern void ( * glXGetProcAddressARB (const GLubyte *procName)) (void); + +#define GLXEW_ARB_get_proc_address GLXEW_GET_VAR(__GLXEW_ARB_get_proc_address) + +#endif /* GLX_ARB_get_proc_address */ + +/* -------------------------- GLX_ARB_multisample -------------------------- */ + +#ifndef GLX_ARB_multisample +#define GLX_ARB_multisample 1 + +#define GLX_SAMPLE_BUFFERS_ARB 100000 +#define GLX_SAMPLES_ARB 100001 + +#define GLXEW_ARB_multisample GLXEW_GET_VAR(__GLXEW_ARB_multisample) + +#endif /* GLX_ARB_multisample */ + +/* ---------------------- GLX_ARB_vertex_buffer_object --------------------- */ + +#ifndef GLX_ARB_vertex_buffer_object +#define GLX_ARB_vertex_buffer_object 1 + +#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095 + +#define GLXEW_ARB_vertex_buffer_object GLXEW_GET_VAR(__GLXEW_ARB_vertex_buffer_object) + +#endif /* GLX_ARB_vertex_buffer_object */ + +/* ----------------------- GLX_ATI_pixel_format_float ---------------------- */ + +#ifndef GLX_ATI_pixel_format_float +#define GLX_ATI_pixel_format_float 1 + +#define GLX_RGBA_FLOAT_ATI_BIT 0x00000100 + +#define GLXEW_ATI_pixel_format_float GLXEW_GET_VAR(__GLXEW_ATI_pixel_format_float) + +#endif /* GLX_ATI_pixel_format_float */ + +/* ------------------------- GLX_ATI_render_texture ------------------------ */ + +#ifndef GLX_ATI_render_texture +#define GLX_ATI_render_texture 1 + +#define GLX_BIND_TO_TEXTURE_RGB_ATI 0x9800 +#define GLX_BIND_TO_TEXTURE_RGBA_ATI 0x9801 +#define GLX_TEXTURE_FORMAT_ATI 0x9802 +#define GLX_TEXTURE_TARGET_ATI 0x9803 +#define GLX_MIPMAP_TEXTURE_ATI 0x9804 +#define GLX_TEXTURE_RGB_ATI 0x9805 +#define GLX_TEXTURE_RGBA_ATI 0x9806 +#define GLX_NO_TEXTURE_ATI 0x9807 +#define GLX_TEXTURE_CUBE_MAP_ATI 0x9808 +#define GLX_TEXTURE_1D_ATI 0x9809 +#define GLX_TEXTURE_2D_ATI 0x980A +#define GLX_MIPMAP_LEVEL_ATI 0x980B +#define GLX_CUBE_MAP_FACE_ATI 0x980C +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_X_ATI 0x980D +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_X_ATI 0x980E +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Y_ATI 0x980F +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Y_ATI 0x9810 +#define GLX_TEXTURE_CUBE_MAP_POSITIVE_Z_ATI 0x9811 +#define GLX_TEXTURE_CUBE_MAP_NEGATIVE_Z_ATI 0x9812 +#define GLX_FRONT_LEFT_ATI 0x9813 +#define GLX_FRONT_RIGHT_ATI 0x9814 +#define GLX_BACK_LEFT_ATI 0x9815 +#define GLX_BACK_RIGHT_ATI 0x9816 +#define GLX_AUX0_ATI 0x9817 +#define GLX_AUX1_ATI 0x9818 +#define GLX_AUX2_ATI 0x9819 +#define GLX_AUX3_ATI 0x981A +#define GLX_AUX4_ATI 0x981B +#define GLX_AUX5_ATI 0x981C +#define GLX_AUX6_ATI 0x981D +#define GLX_AUX7_ATI 0x981E +#define GLX_AUX8_ATI 0x981F +#define GLX_AUX9_ATI 0x9820 +#define GLX_BIND_TO_TEXTURE_LUMINANCE_ATI 0x9821 +#define GLX_BIND_TO_TEXTURE_INTENSITY_ATI 0x9822 + +typedef void ( * PFNGLXBINDTEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); +typedef void ( * PFNGLXDRAWABLEATTRIBATIPROC) (Display *dpy, GLXDrawable draw, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEATIPROC) (Display *dpy, GLXPbuffer pbuf, int buffer); + +#define glXBindTexImageATI GLXEW_GET_FUN(__glewXBindTexImageATI) +#define glXDrawableAttribATI GLXEW_GET_FUN(__glewXDrawableAttribATI) +#define glXReleaseTexImageATI GLXEW_GET_FUN(__glewXReleaseTexImageATI) + +#define GLXEW_ATI_render_texture GLXEW_GET_VAR(__GLXEW_ATI_render_texture) + +#endif /* GLX_ATI_render_texture */ + +/* ------------------- GLX_EXT_create_context_es2_profile ------------------ */ + +#ifndef GLX_EXT_create_context_es2_profile +#define GLX_EXT_create_context_es2_profile 1 + +#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define GLXEW_EXT_create_context_es2_profile GLXEW_GET_VAR(__GLXEW_EXT_create_context_es2_profile) + +#endif /* GLX_EXT_create_context_es2_profile */ + +/* --------------------- GLX_EXT_fbconfig_packed_float --------------------- */ + +#ifndef GLX_EXT_fbconfig_packed_float +#define GLX_EXT_fbconfig_packed_float 1 + +#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008 +#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1 + +#define GLXEW_EXT_fbconfig_packed_float GLXEW_GET_VAR(__GLXEW_EXT_fbconfig_packed_float) + +#endif /* GLX_EXT_fbconfig_packed_float */ + +/* ------------------------ GLX_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef GLX_EXT_framebuffer_sRGB +#define GLX_EXT_framebuffer_sRGB 1 + +#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2 + +#define GLXEW_EXT_framebuffer_sRGB GLXEW_GET_VAR(__GLXEW_EXT_framebuffer_sRGB) + +#endif /* GLX_EXT_framebuffer_sRGB */ + +/* ------------------------- GLX_EXT_import_context ------------------------ */ + +#ifndef GLX_EXT_import_context +#define GLX_EXT_import_context 1 + +#define GLX_SHARE_CONTEXT_EXT 0x800A +#define GLX_VISUAL_ID_EXT 0x800B +#define GLX_SCREEN_EXT 0x800C + +typedef XID GLXContextID; + +typedef void ( * PFNGLXFREECONTEXTEXTPROC) (Display* dpy, GLXContext context); +typedef GLXContextID ( * PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context); +typedef GLXContext ( * PFNGLXIMPORTCONTEXTEXTPROC) (Display* dpy, GLXContextID contextID); +typedef int ( * PFNGLXQUERYCONTEXTINFOEXTPROC) (Display* dpy, GLXContext context, int attribute,int *value); + +#define glXFreeContextEXT GLXEW_GET_FUN(__glewXFreeContextEXT) +#define glXGetContextIDEXT GLXEW_GET_FUN(__glewXGetContextIDEXT) +#define glXImportContextEXT GLXEW_GET_FUN(__glewXImportContextEXT) +#define glXQueryContextInfoEXT GLXEW_GET_FUN(__glewXQueryContextInfoEXT) + +#define GLXEW_EXT_import_context GLXEW_GET_VAR(__GLXEW_EXT_import_context) + +#endif /* GLX_EXT_import_context */ + +/* -------------------------- GLX_EXT_scene_marker ------------------------- */ + +#ifndef GLX_EXT_scene_marker +#define GLX_EXT_scene_marker 1 + +#define GLXEW_EXT_scene_marker GLXEW_GET_VAR(__GLXEW_EXT_scene_marker) + +#endif /* GLX_EXT_scene_marker */ + +/* -------------------------- GLX_EXT_swap_control ------------------------- */ + +#ifndef GLX_EXT_swap_control +#define GLX_EXT_swap_control 1 + +#define GLX_SWAP_INTERVAL_EXT 0x20F1 +#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2 + +typedef void ( * PFNGLXSWAPINTERVALEXTPROC) (Display* dpy, GLXDrawable drawable, int interval); + +#define glXSwapIntervalEXT GLXEW_GET_FUN(__glewXSwapIntervalEXT) + +#define GLXEW_EXT_swap_control GLXEW_GET_VAR(__GLXEW_EXT_swap_control) + +#endif /* GLX_EXT_swap_control */ + +/* ---------------------- GLX_EXT_texture_from_pixmap ---------------------- */ + +#ifndef GLX_EXT_texture_from_pixmap +#define GLX_EXT_texture_from_pixmap 1 + +#define GLX_TEXTURE_1D_BIT_EXT 0x00000001 +#define GLX_TEXTURE_2D_BIT_EXT 0x00000002 +#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004 +#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0 +#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1 +#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2 +#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3 +#define GLX_Y_INVERTED_EXT 0x20D4 +#define GLX_TEXTURE_FORMAT_EXT 0x20D5 +#define GLX_TEXTURE_TARGET_EXT 0x20D6 +#define GLX_MIPMAP_TEXTURE_EXT 0x20D7 +#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8 +#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9 +#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA +#define GLX_TEXTURE_1D_EXT 0x20DB +#define GLX_TEXTURE_2D_EXT 0x20DC +#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD +#define GLX_FRONT_LEFT_EXT 0x20DE +#define GLX_FRONT_RIGHT_EXT 0x20DF +#define GLX_BACK_LEFT_EXT 0x20E0 +#define GLX_BACK_RIGHT_EXT 0x20E1 +#define GLX_AUX0_EXT 0x20E2 +#define GLX_AUX1_EXT 0x20E3 +#define GLX_AUX2_EXT 0x20E4 +#define GLX_AUX3_EXT 0x20E5 +#define GLX_AUX4_EXT 0x20E6 +#define GLX_AUX5_EXT 0x20E7 +#define GLX_AUX6_EXT 0x20E8 +#define GLX_AUX7_EXT 0x20E9 +#define GLX_AUX8_EXT 0x20EA +#define GLX_AUX9_EXT 0x20EB + +typedef void ( * PFNGLXBINDTEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer, const int *attrib_list); +typedef void ( * PFNGLXRELEASETEXIMAGEEXTPROC) (Display* display, GLXDrawable drawable, int buffer); + +#define glXBindTexImageEXT GLXEW_GET_FUN(__glewXBindTexImageEXT) +#define glXReleaseTexImageEXT GLXEW_GET_FUN(__glewXReleaseTexImageEXT) + +#define GLXEW_EXT_texture_from_pixmap GLXEW_GET_VAR(__GLXEW_EXT_texture_from_pixmap) + +#endif /* GLX_EXT_texture_from_pixmap */ + +/* -------------------------- GLX_EXT_visual_info -------------------------- */ + +#ifndef GLX_EXT_visual_info +#define GLX_EXT_visual_info 1 + +#define GLX_X_VISUAL_TYPE_EXT 0x22 +#define GLX_TRANSPARENT_TYPE_EXT 0x23 +#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24 +#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25 +#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26 +#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27 +#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28 +#define GLX_NONE_EXT 0x8000 +#define GLX_TRUE_COLOR_EXT 0x8002 +#define GLX_DIRECT_COLOR_EXT 0x8003 +#define GLX_PSEUDO_COLOR_EXT 0x8004 +#define GLX_STATIC_COLOR_EXT 0x8005 +#define GLX_GRAY_SCALE_EXT 0x8006 +#define GLX_STATIC_GRAY_EXT 0x8007 +#define GLX_TRANSPARENT_RGB_EXT 0x8008 +#define GLX_TRANSPARENT_INDEX_EXT 0x8009 + +#define GLXEW_EXT_visual_info GLXEW_GET_VAR(__GLXEW_EXT_visual_info) + +#endif /* GLX_EXT_visual_info */ + +/* ------------------------- GLX_EXT_visual_rating ------------------------- */ + +#ifndef GLX_EXT_visual_rating +#define GLX_EXT_visual_rating 1 + +#define GLX_VISUAL_CAVEAT_EXT 0x20 +#define GLX_SLOW_VISUAL_EXT 0x8001 +#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D + +#define GLXEW_EXT_visual_rating GLXEW_GET_VAR(__GLXEW_EXT_visual_rating) + +#endif /* GLX_EXT_visual_rating */ + +/* -------------------------- GLX_INTEL_swap_event ------------------------- */ + +#ifndef GLX_INTEL_swap_event +#define GLX_INTEL_swap_event 1 + +#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180 +#define GLX_COPY_COMPLETE_INTEL 0x8181 +#define GLX_FLIP_COMPLETE_INTEL 0x8182 +#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000 + +#define GLXEW_INTEL_swap_event GLXEW_GET_VAR(__GLXEW_INTEL_swap_event) + +#endif /* GLX_INTEL_swap_event */ + +/* -------------------------- GLX_MESA_agp_offset -------------------------- */ + +#ifndef GLX_MESA_agp_offset +#define GLX_MESA_agp_offset 1 + +typedef unsigned int ( * PFNGLXGETAGPOFFSETMESAPROC) (const void* pointer); + +#define glXGetAGPOffsetMESA GLXEW_GET_FUN(__glewXGetAGPOffsetMESA) + +#define GLXEW_MESA_agp_offset GLXEW_GET_VAR(__GLXEW_MESA_agp_offset) + +#endif /* GLX_MESA_agp_offset */ + +/* ------------------------ GLX_MESA_copy_sub_buffer ----------------------- */ + +#ifndef GLX_MESA_copy_sub_buffer +#define GLX_MESA_copy_sub_buffer 1 + +typedef void ( * PFNGLXCOPYSUBBUFFERMESAPROC) (Display* dpy, GLXDrawable drawable, int x, int y, int width, int height); + +#define glXCopySubBufferMESA GLXEW_GET_FUN(__glewXCopySubBufferMESA) + +#define GLXEW_MESA_copy_sub_buffer GLXEW_GET_VAR(__GLXEW_MESA_copy_sub_buffer) + +#endif /* GLX_MESA_copy_sub_buffer */ + +/* ------------------------ GLX_MESA_pixmap_colormap ----------------------- */ + +#ifndef GLX_MESA_pixmap_colormap +#define GLX_MESA_pixmap_colormap 1 + +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPMESAPROC) (Display* dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap); + +#define glXCreateGLXPixmapMESA GLXEW_GET_FUN(__glewXCreateGLXPixmapMESA) + +#define GLXEW_MESA_pixmap_colormap GLXEW_GET_VAR(__GLXEW_MESA_pixmap_colormap) + +#endif /* GLX_MESA_pixmap_colormap */ + +/* ------------------------ GLX_MESA_release_buffers ----------------------- */ + +#ifndef GLX_MESA_release_buffers +#define GLX_MESA_release_buffers 1 + +typedef Bool ( * PFNGLXRELEASEBUFFERSMESAPROC) (Display* dpy, GLXDrawable d); + +#define glXReleaseBuffersMESA GLXEW_GET_FUN(__glewXReleaseBuffersMESA) + +#define GLXEW_MESA_release_buffers GLXEW_GET_VAR(__GLXEW_MESA_release_buffers) + +#endif /* GLX_MESA_release_buffers */ + +/* ------------------------- GLX_MESA_set_3dfx_mode ------------------------ */ + +#ifndef GLX_MESA_set_3dfx_mode +#define GLX_MESA_set_3dfx_mode 1 + +#define GLX_3DFX_WINDOW_MODE_MESA 0x1 +#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2 + +typedef GLboolean ( * PFNGLXSET3DFXMODEMESAPROC) (GLint mode); + +#define glXSet3DfxModeMESA GLXEW_GET_FUN(__glewXSet3DfxModeMESA) + +#define GLXEW_MESA_set_3dfx_mode GLXEW_GET_VAR(__GLXEW_MESA_set_3dfx_mode) + +#endif /* GLX_MESA_set_3dfx_mode */ + +/* --------------------------- GLX_NV_copy_image --------------------------- */ + +#ifndef GLX_NV_copy_image +#define GLX_NV_copy_image 1 + +typedef void ( * PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define glXCopyImageSubDataNV GLXEW_GET_FUN(__glewXCopyImageSubDataNV) + +#define GLXEW_NV_copy_image GLXEW_GET_VAR(__GLXEW_NV_copy_image) + +#endif /* GLX_NV_copy_image */ + +/* -------------------------- GLX_NV_float_buffer -------------------------- */ + +#ifndef GLX_NV_float_buffer +#define GLX_NV_float_buffer 1 + +#define GLX_FLOAT_COMPONENTS_NV 0x20B0 + +#define GLXEW_NV_float_buffer GLXEW_GET_VAR(__GLXEW_NV_float_buffer) + +#endif /* GLX_NV_float_buffer */ + +/* ---------------------- GLX_NV_multisample_coverage ---------------------- */ + +#ifndef GLX_NV_multisample_coverage +#define GLX_NV_multisample_coverage 1 + +#define GLX_COLOR_SAMPLES_NV 0x20B3 +#define GLX_COVERAGE_SAMPLES_NV 100001 + +#define GLXEW_NV_multisample_coverage GLXEW_GET_VAR(__GLXEW_NV_multisample_coverage) + +#endif /* GLX_NV_multisample_coverage */ + +/* -------------------------- GLX_NV_present_video ------------------------- */ + +#ifndef GLX_NV_present_video +#define GLX_NV_present_video 1 + +#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0 + +typedef int ( * PFNGLXBINDVIDEODEVICENVPROC) (Display* dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list); +typedef unsigned int* ( * PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements); + +#define glXBindVideoDeviceNV GLXEW_GET_FUN(__glewXBindVideoDeviceNV) +#define glXEnumerateVideoDevicesNV GLXEW_GET_FUN(__glewXEnumerateVideoDevicesNV) + +#define GLXEW_NV_present_video GLXEW_GET_VAR(__GLXEW_NV_present_video) + +#endif /* GLX_NV_present_video */ + +/* --------------------------- GLX_NV_swap_group --------------------------- */ + +#ifndef GLX_NV_swap_group +#define GLX_NV_swap_group 1 + +typedef Bool ( * PFNGLXBINDSWAPBARRIERNVPROC) (Display* dpy, GLuint group, GLuint barrier); +typedef Bool ( * PFNGLXJOINSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint group); +typedef Bool ( * PFNGLXQUERYFRAMECOUNTNVPROC) (Display* dpy, int screen, GLuint *count); +typedef Bool ( * PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display* dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers); +typedef Bool ( * PFNGLXQUERYSWAPGROUPNVPROC) (Display* dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier); +typedef Bool ( * PFNGLXRESETFRAMECOUNTNVPROC) (Display* dpy, int screen); + +#define glXBindSwapBarrierNV GLXEW_GET_FUN(__glewXBindSwapBarrierNV) +#define glXJoinSwapGroupNV GLXEW_GET_FUN(__glewXJoinSwapGroupNV) +#define glXQueryFrameCountNV GLXEW_GET_FUN(__glewXQueryFrameCountNV) +#define glXQueryMaxSwapGroupsNV GLXEW_GET_FUN(__glewXQueryMaxSwapGroupsNV) +#define glXQuerySwapGroupNV GLXEW_GET_FUN(__glewXQuerySwapGroupNV) +#define glXResetFrameCountNV GLXEW_GET_FUN(__glewXResetFrameCountNV) + +#define GLXEW_NV_swap_group GLXEW_GET_VAR(__GLXEW_NV_swap_group) + +#endif /* GLX_NV_swap_group */ + +/* ----------------------- GLX_NV_vertex_array_range ----------------------- */ + +#ifndef GLX_NV_vertex_array_range +#define GLX_NV_vertex_array_range 1 + +typedef void * ( * PFNGLXALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void ( * PFNGLXFREEMEMORYNVPROC) (void *pointer); + +#define glXAllocateMemoryNV GLXEW_GET_FUN(__glewXAllocateMemoryNV) +#define glXFreeMemoryNV GLXEW_GET_FUN(__glewXFreeMemoryNV) + +#define GLXEW_NV_vertex_array_range GLXEW_GET_VAR(__GLXEW_NV_vertex_array_range) + +#endif /* GLX_NV_vertex_array_range */ + +/* -------------------------- GLX_NV_video_output -------------------------- */ + +#ifndef GLX_NV_video_output +#define GLX_NV_video_output 1 + +#define GLX_VIDEO_OUT_COLOR_NV 0x20C3 +#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4 +#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5 +#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define GLX_VIDEO_OUT_FRAME_NV 0x20C8 +#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9 +#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA +#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB +#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC + +typedef int ( * PFNGLXBINDVIDEOIMAGENVPROC) (Display* dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer); +typedef int ( * PFNGLXGETVIDEODEVICENVPROC) (Display* dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice); +typedef int ( * PFNGLXGETVIDEOINFONVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef int ( * PFNGLXRELEASEVIDEODEVICENVPROC) (Display* dpy, int screen, GLXVideoDeviceNV VideoDevice); +typedef int ( * PFNGLXRELEASEVIDEOIMAGENVPROC) (Display* dpy, GLXPbuffer pbuf); +typedef int ( * PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display* dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock); + +#define glXBindVideoImageNV GLXEW_GET_FUN(__glewXBindVideoImageNV) +#define glXGetVideoDeviceNV GLXEW_GET_FUN(__glewXGetVideoDeviceNV) +#define glXGetVideoInfoNV GLXEW_GET_FUN(__glewXGetVideoInfoNV) +#define glXReleaseVideoDeviceNV GLXEW_GET_FUN(__glewXReleaseVideoDeviceNV) +#define glXReleaseVideoImageNV GLXEW_GET_FUN(__glewXReleaseVideoImageNV) +#define glXSendPbufferToVideoNV GLXEW_GET_FUN(__glewXSendPbufferToVideoNV) + +#define GLXEW_NV_video_output GLXEW_GET_VAR(__GLXEW_NV_video_output) + +#endif /* GLX_NV_video_output */ + +/* -------------------------- GLX_OML_swap_method -------------------------- */ + +#ifndef GLX_OML_swap_method +#define GLX_OML_swap_method 1 + +#define GLX_SWAP_METHOD_OML 0x8060 +#define GLX_SWAP_EXCHANGE_OML 0x8061 +#define GLX_SWAP_COPY_OML 0x8062 +#define GLX_SWAP_UNDEFINED_OML 0x8063 + +#define GLXEW_OML_swap_method GLXEW_GET_VAR(__GLXEW_OML_swap_method) + +#endif /* GLX_OML_swap_method */ + +/* -------------------------- GLX_OML_sync_control ------------------------- */ + +#if !defined(GLX_OML_sync_control) && defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) +#include +#define GLX_OML_sync_control 1 + +typedef Bool ( * PFNGLXGETMSCRATEOMLPROC) (Display* dpy, GLXDrawable drawable, int32_t* numerator, int32_t* denominator); +typedef Bool ( * PFNGLXGETSYNCVALUESOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef int64_t ( * PFNGLXSWAPBUFFERSMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder); +typedef Bool ( * PFNGLXWAITFORMSCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t* ust, int64_t* msc, int64_t* sbc); +typedef Bool ( * PFNGLXWAITFORSBCOMLPROC) (Display* dpy, GLXDrawable drawable, int64_t target_sbc, int64_t* ust, int64_t* msc, int64_t* sbc); + +#define glXGetMscRateOML GLXEW_GET_FUN(__glewXGetMscRateOML) +#define glXGetSyncValuesOML GLXEW_GET_FUN(__glewXGetSyncValuesOML) +#define glXSwapBuffersMscOML GLXEW_GET_FUN(__glewXSwapBuffersMscOML) +#define glXWaitForMscOML GLXEW_GET_FUN(__glewXWaitForMscOML) +#define glXWaitForSbcOML GLXEW_GET_FUN(__glewXWaitForSbcOML) + +#define GLXEW_OML_sync_control GLXEW_GET_VAR(__GLXEW_OML_sync_control) + +#endif /* GLX_OML_sync_control */ + +/* ------------------------ GLX_SGIS_blended_overlay ----------------------- */ + +#ifndef GLX_SGIS_blended_overlay +#define GLX_SGIS_blended_overlay 1 + +#define GLX_BLENDED_RGBA_SGIS 0x8025 + +#define GLXEW_SGIS_blended_overlay GLXEW_GET_VAR(__GLXEW_SGIS_blended_overlay) + +#endif /* GLX_SGIS_blended_overlay */ + +/* -------------------------- GLX_SGIS_color_range ------------------------- */ + +#ifndef GLX_SGIS_color_range +#define GLX_SGIS_color_range 1 + +#define GLX_MIN_RED_SGIS 0 +#define GLX_MAX_GREEN_SGIS 0 +#define GLX_MIN_BLUE_SGIS 0 +#define GLX_MAX_ALPHA_SGIS 0 +#define GLX_MIN_GREEN_SGIS 0 +#define GLX_MIN_ALPHA_SGIS 0 +#define GLX_MAX_RED_SGIS 0 +#define GLX_EXTENDED_RANGE_SGIS 0 +#define GLX_MAX_BLUE_SGIS 0 + +#define GLXEW_SGIS_color_range GLXEW_GET_VAR(__GLXEW_SGIS_color_range) + +#endif /* GLX_SGIS_color_range */ + +/* -------------------------- GLX_SGIS_multisample ------------------------- */ + +#ifndef GLX_SGIS_multisample +#define GLX_SGIS_multisample 1 + +#define GLX_SAMPLE_BUFFERS_SGIS 100000 +#define GLX_SAMPLES_SGIS 100001 + +#define GLXEW_SGIS_multisample GLXEW_GET_VAR(__GLXEW_SGIS_multisample) + +#endif /* GLX_SGIS_multisample */ + +/* ---------------------- GLX_SGIS_shared_multisample ---------------------- */ + +#ifndef GLX_SGIS_shared_multisample +#define GLX_SGIS_shared_multisample 1 + +#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026 +#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027 + +#define GLXEW_SGIS_shared_multisample GLXEW_GET_VAR(__GLXEW_SGIS_shared_multisample) + +#endif /* GLX_SGIS_shared_multisample */ + +/* --------------------------- GLX_SGIX_fbconfig --------------------------- */ + +#ifndef GLX_SGIX_fbconfig +#define GLX_SGIX_fbconfig 1 + +#define GLX_WINDOW_BIT_SGIX 0x00000001 +#define GLX_RGBA_BIT_SGIX 0x00000001 +#define GLX_PIXMAP_BIT_SGIX 0x00000002 +#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002 +#define GLX_SCREEN_EXT 0x800C +#define GLX_DRAWABLE_TYPE_SGIX 0x8010 +#define GLX_RENDER_TYPE_SGIX 0x8011 +#define GLX_X_RENDERABLE_SGIX 0x8012 +#define GLX_FBCONFIG_ID_SGIX 0x8013 +#define GLX_RGBA_TYPE_SGIX 0x8014 +#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015 + +typedef XID GLXFBConfigIDSGIX; +typedef struct __GLXFBConfigRec *GLXFBConfigSGIX; + +typedef GLXFBConfigSGIX* ( * PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements); +typedef GLXContext ( * PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct); +typedef GLXPixmap ( * PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display* dpy, GLXFBConfig config, Pixmap pixmap); +typedef int ( * PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display* dpy, GLXFBConfigSGIX config, int attribute, int *value); +typedef GLXFBConfigSGIX ( * PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display* dpy, XVisualInfo *vis); +typedef XVisualInfo* ( * PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfig config); + +#define glXChooseFBConfigSGIX GLXEW_GET_FUN(__glewXChooseFBConfigSGIX) +#define glXCreateContextWithConfigSGIX GLXEW_GET_FUN(__glewXCreateContextWithConfigSGIX) +#define glXCreateGLXPixmapWithConfigSGIX GLXEW_GET_FUN(__glewXCreateGLXPixmapWithConfigSGIX) +#define glXGetFBConfigAttribSGIX GLXEW_GET_FUN(__glewXGetFBConfigAttribSGIX) +#define glXGetFBConfigFromVisualSGIX GLXEW_GET_FUN(__glewXGetFBConfigFromVisualSGIX) +#define glXGetVisualFromFBConfigSGIX GLXEW_GET_FUN(__glewXGetVisualFromFBConfigSGIX) + +#define GLXEW_SGIX_fbconfig GLXEW_GET_VAR(__GLXEW_SGIX_fbconfig) + +#endif /* GLX_SGIX_fbconfig */ + +/* --------------------------- GLX_SGIX_hyperpipe -------------------------- */ + +#ifndef GLX_SGIX_hyperpipe +#define GLX_SGIX_hyperpipe 1 + +#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001 +#define GLX_PIPE_RECT_SGIX 0x00000001 +#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002 +#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002 +#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003 +#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004 +#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80 +#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91 +#define GLX_BAD_HYPERPIPE_SGIX 92 +#define GLX_HYPERPIPE_ID_SGIX 0x8030 + +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int networkId; +} GLXHyperpipeNetworkSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int XOrigin; + int YOrigin; + int maxHeight; + int maxWidth; +} GLXPipeRectLimits; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int channel; + unsigned int participationType; + int timeSlice; +} GLXHyperpipeConfigSGIX; +typedef struct { + char pipeName[GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX]; + int srcXOrigin; + int srcYOrigin; + int srcWidth; + int srcHeight; + int destXOrigin; + int destYOrigin; + int destWidth; + int destHeight; +} GLXPipeRect; + +typedef int ( * PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId); +typedef int ( * PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList); +typedef int ( * PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId); +typedef int ( * PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList); +typedef int ( * PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList); +typedef GLXHyperpipeConfigSGIX * ( * PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes); +typedef GLXHyperpipeNetworkSGIX * ( * PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes); + +#define glXBindHyperpipeSGIX GLXEW_GET_FUN(__glewXBindHyperpipeSGIX) +#define glXDestroyHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXDestroyHyperpipeConfigSGIX) +#define glXHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXHyperpipeAttribSGIX) +#define glXHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXHyperpipeConfigSGIX) +#define glXQueryHyperpipeAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeAttribSGIX) +#define glXQueryHyperpipeBestAttribSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeBestAttribSGIX) +#define glXQueryHyperpipeConfigSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeConfigSGIX) +#define glXQueryHyperpipeNetworkSGIX GLXEW_GET_FUN(__glewXQueryHyperpipeNetworkSGIX) + +#define GLXEW_SGIX_hyperpipe GLXEW_GET_VAR(__GLXEW_SGIX_hyperpipe) + +#endif /* GLX_SGIX_hyperpipe */ + +/* ---------------------------- GLX_SGIX_pbuffer --------------------------- */ + +#ifndef GLX_SGIX_pbuffer +#define GLX_SGIX_pbuffer 1 + +#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001 +#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002 +#define GLX_PBUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004 +#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008 +#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010 +#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020 +#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040 +#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080 +#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100 +#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016 +#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017 +#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018 +#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019 +#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A +#define GLX_PRESERVED_CONTENTS_SGIX 0x801B +#define GLX_LARGEST_PBUFFER_SGIX 0x801C +#define GLX_WIDTH_SGIX 0x801D +#define GLX_HEIGHT_SGIX 0x801E +#define GLX_EVENT_MASK_SGIX 0x801F +#define GLX_DAMAGED_SGIX 0x8020 +#define GLX_SAVED_SGIX 0x8021 +#define GLX_WINDOW_SGIX 0x8022 +#define GLX_PBUFFER_SGIX 0x8023 +#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000 + +typedef XID GLXPbufferSGIX; +typedef struct { int type; unsigned long serial; Bool send_event; Display *display; GLXDrawable drawable; int event_type; int draw_type; unsigned int mask; int x, y; int width, height; int count; } GLXBufferClobberEventSGIX; + +typedef GLXPbuffer ( * PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display* dpy, GLXFBConfig config, unsigned int width, unsigned int height, int *attrib_list); +typedef void ( * PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf); +typedef void ( * PFNGLXGETSELECTEDEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long *mask); +typedef void ( * PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display* dpy, GLXPbuffer pbuf, int attribute, unsigned int *value); +typedef void ( * PFNGLXSELECTEVENTSGIXPROC) (Display* dpy, GLXDrawable drawable, unsigned long mask); + +#define glXCreateGLXPbufferSGIX GLXEW_GET_FUN(__glewXCreateGLXPbufferSGIX) +#define glXDestroyGLXPbufferSGIX GLXEW_GET_FUN(__glewXDestroyGLXPbufferSGIX) +#define glXGetSelectedEventSGIX GLXEW_GET_FUN(__glewXGetSelectedEventSGIX) +#define glXQueryGLXPbufferSGIX GLXEW_GET_FUN(__glewXQueryGLXPbufferSGIX) +#define glXSelectEventSGIX GLXEW_GET_FUN(__glewXSelectEventSGIX) + +#define GLXEW_SGIX_pbuffer GLXEW_GET_VAR(__GLXEW_SGIX_pbuffer) + +#endif /* GLX_SGIX_pbuffer */ + +/* ------------------------- GLX_SGIX_swap_barrier ------------------------- */ + +#ifndef GLX_SGIX_swap_barrier +#define GLX_SGIX_swap_barrier 1 + +typedef void ( * PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier); +typedef Bool ( * PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max); + +#define glXBindSwapBarrierSGIX GLXEW_GET_FUN(__glewXBindSwapBarrierSGIX) +#define glXQueryMaxSwapBarriersSGIX GLXEW_GET_FUN(__glewXQueryMaxSwapBarriersSGIX) + +#define GLXEW_SGIX_swap_barrier GLXEW_GET_VAR(__GLXEW_SGIX_swap_barrier) + +#endif /* GLX_SGIX_swap_barrier */ + +/* -------------------------- GLX_SGIX_swap_group -------------------------- */ + +#ifndef GLX_SGIX_swap_group +#define GLX_SGIX_swap_group 1 + +typedef void ( * PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member); + +#define glXJoinSwapGroupSGIX GLXEW_GET_FUN(__glewXJoinSwapGroupSGIX) + +#define GLXEW_SGIX_swap_group GLXEW_GET_VAR(__GLXEW_SGIX_swap_group) + +#endif /* GLX_SGIX_swap_group */ + +/* ------------------------- GLX_SGIX_video_resize ------------------------- */ + +#ifndef GLX_SGIX_video_resize +#define GLX_SGIX_video_resize 1 + +#define GLX_SYNC_FRAME_SGIX 0x00000000 +#define GLX_SYNC_SWAP_SGIX 0x00000001 + +typedef int ( * PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display* display, int screen, int channel, Window window); +typedef int ( * PFNGLXCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int x, int y, int w, int h); +typedef int ( * PFNGLXCHANNELRECTSYNCSGIXPROC) (Display* display, int screen, int channel, GLenum synctype); +typedef int ( * PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display* display, int screen, int channel, int *x, int *y, int *w, int *h); +typedef int ( * PFNGLXQUERYCHANNELRECTSGIXPROC) (Display* display, int screen, int channel, int *dx, int *dy, int *dw, int *dh); + +#define glXBindChannelToWindowSGIX GLXEW_GET_FUN(__glewXBindChannelToWindowSGIX) +#define glXChannelRectSGIX GLXEW_GET_FUN(__glewXChannelRectSGIX) +#define glXChannelRectSyncSGIX GLXEW_GET_FUN(__glewXChannelRectSyncSGIX) +#define glXQueryChannelDeltasSGIX GLXEW_GET_FUN(__glewXQueryChannelDeltasSGIX) +#define glXQueryChannelRectSGIX GLXEW_GET_FUN(__glewXQueryChannelRectSGIX) + +#define GLXEW_SGIX_video_resize GLXEW_GET_VAR(__GLXEW_SGIX_video_resize) + +#endif /* GLX_SGIX_video_resize */ + +/* ---------------------- GLX_SGIX_visual_select_group --------------------- */ + +#ifndef GLX_SGIX_visual_select_group +#define GLX_SGIX_visual_select_group 1 + +#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028 + +#define GLXEW_SGIX_visual_select_group GLXEW_GET_VAR(__GLXEW_SGIX_visual_select_group) + +#endif /* GLX_SGIX_visual_select_group */ + +/* ---------------------------- GLX_SGI_cushion ---------------------------- */ + +#ifndef GLX_SGI_cushion +#define GLX_SGI_cushion 1 + +typedef void ( * PFNGLXCUSHIONSGIPROC) (Display* dpy, Window window, float cushion); + +#define glXCushionSGI GLXEW_GET_FUN(__glewXCushionSGI) + +#define GLXEW_SGI_cushion GLXEW_GET_VAR(__GLXEW_SGI_cushion) + +#endif /* GLX_SGI_cushion */ + +/* ----------------------- GLX_SGI_make_current_read ----------------------- */ + +#ifndef GLX_SGI_make_current_read +#define GLX_SGI_make_current_read 1 + +typedef GLXDrawable ( * PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void); +typedef Bool ( * PFNGLXMAKECURRENTREADSGIPROC) (Display* dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx); + +#define glXGetCurrentReadDrawableSGI GLXEW_GET_FUN(__glewXGetCurrentReadDrawableSGI) +#define glXMakeCurrentReadSGI GLXEW_GET_FUN(__glewXMakeCurrentReadSGI) + +#define GLXEW_SGI_make_current_read GLXEW_GET_VAR(__GLXEW_SGI_make_current_read) + +#endif /* GLX_SGI_make_current_read */ + +/* -------------------------- GLX_SGI_swap_control ------------------------- */ + +#ifndef GLX_SGI_swap_control +#define GLX_SGI_swap_control 1 + +typedef int ( * PFNGLXSWAPINTERVALSGIPROC) (int interval); + +#define glXSwapIntervalSGI GLXEW_GET_FUN(__glewXSwapIntervalSGI) + +#define GLXEW_SGI_swap_control GLXEW_GET_VAR(__GLXEW_SGI_swap_control) + +#endif /* GLX_SGI_swap_control */ + +/* --------------------------- GLX_SGI_video_sync -------------------------- */ + +#ifndef GLX_SGI_video_sync +#define GLX_SGI_video_sync 1 + +typedef int ( * PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int* count); +typedef int ( * PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int* count); + +#define glXGetVideoSyncSGI GLXEW_GET_FUN(__glewXGetVideoSyncSGI) +#define glXWaitVideoSyncSGI GLXEW_GET_FUN(__glewXWaitVideoSyncSGI) + +#define GLXEW_SGI_video_sync GLXEW_GET_VAR(__GLXEW_SGI_video_sync) + +#endif /* GLX_SGI_video_sync */ + +/* --------------------- GLX_SUN_get_transparent_index --------------------- */ + +#ifndef GLX_SUN_get_transparent_index +#define GLX_SUN_get_transparent_index 1 + +typedef Status ( * PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display* dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex); + +#define glXGetTransparentIndexSUN GLXEW_GET_FUN(__glewXGetTransparentIndexSUN) + +#define GLXEW_SUN_get_transparent_index GLXEW_GET_VAR(__GLXEW_SUN_get_transparent_index) + +#endif /* GLX_SUN_get_transparent_index */ + +/* -------------------------- GLX_SUN_video_resize ------------------------- */ + +#ifndef GLX_SUN_video_resize +#define GLX_SUN_video_resize 1 + +#define GLX_VIDEO_RESIZE_SUN 0x8171 +#define GL_VIDEO_RESIZE_COMPENSATION_SUN 0x85CD + +typedef int ( * PFNGLXGETVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float* factor); +typedef int ( * PFNGLXVIDEORESIZESUNPROC) (Display* display, GLXDrawable window, float factor); + +#define glXGetVideoResizeSUN GLXEW_GET_FUN(__glewXGetVideoResizeSUN) +#define glXVideoResizeSUN GLXEW_GET_FUN(__glewXVideoResizeSUN) + +#define GLXEW_SUN_video_resize GLXEW_GET_VAR(__GLXEW_SUN_video_resize) + +#endif /* GLX_SUN_video_resize */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define GLXEW_EXPORT +#else +#define GLXEW_EXPORT extern +#endif /* GLEW_MX */ + +extern PFNGLXGETCURRENTDISPLAYPROC __glewXGetCurrentDisplay; + +extern PFNGLXCHOOSEFBCONFIGPROC __glewXChooseFBConfig; +extern PFNGLXCREATENEWCONTEXTPROC __glewXCreateNewContext; +extern PFNGLXCREATEPBUFFERPROC __glewXCreatePbuffer; +extern PFNGLXCREATEPIXMAPPROC __glewXCreatePixmap; +extern PFNGLXCREATEWINDOWPROC __glewXCreateWindow; +extern PFNGLXDESTROYPBUFFERPROC __glewXDestroyPbuffer; +extern PFNGLXDESTROYPIXMAPPROC __glewXDestroyPixmap; +extern PFNGLXDESTROYWINDOWPROC __glewXDestroyWindow; +extern PFNGLXGETCURRENTREADDRAWABLEPROC __glewXGetCurrentReadDrawable; +extern PFNGLXGETFBCONFIGATTRIBPROC __glewXGetFBConfigAttrib; +extern PFNGLXGETFBCONFIGSPROC __glewXGetFBConfigs; +extern PFNGLXGETSELECTEDEVENTPROC __glewXGetSelectedEvent; +extern PFNGLXGETVISUALFROMFBCONFIGPROC __glewXGetVisualFromFBConfig; +extern PFNGLXMAKECONTEXTCURRENTPROC __glewXMakeContextCurrent; +extern PFNGLXQUERYCONTEXTPROC __glewXQueryContext; +extern PFNGLXQUERYDRAWABLEPROC __glewXQueryDrawable; +extern PFNGLXSELECTEVENTPROC __glewXSelectEvent; + +extern PFNGLXCREATECONTEXTATTRIBSARBPROC __glewXCreateContextAttribsARB; + +extern PFNGLXBINDTEXIMAGEATIPROC __glewXBindTexImageATI; +extern PFNGLXDRAWABLEATTRIBATIPROC __glewXDrawableAttribATI; +extern PFNGLXRELEASETEXIMAGEATIPROC __glewXReleaseTexImageATI; + +extern PFNGLXFREECONTEXTEXTPROC __glewXFreeContextEXT; +extern PFNGLXGETCONTEXTIDEXTPROC __glewXGetContextIDEXT; +extern PFNGLXIMPORTCONTEXTEXTPROC __glewXImportContextEXT; +extern PFNGLXQUERYCONTEXTINFOEXTPROC __glewXQueryContextInfoEXT; + +extern PFNGLXSWAPINTERVALEXTPROC __glewXSwapIntervalEXT; + +extern PFNGLXBINDTEXIMAGEEXTPROC __glewXBindTexImageEXT; +extern PFNGLXRELEASETEXIMAGEEXTPROC __glewXReleaseTexImageEXT; + +extern PFNGLXGETAGPOFFSETMESAPROC __glewXGetAGPOffsetMESA; + +extern PFNGLXCOPYSUBBUFFERMESAPROC __glewXCopySubBufferMESA; + +extern PFNGLXCREATEGLXPIXMAPMESAPROC __glewXCreateGLXPixmapMESA; + +extern PFNGLXRELEASEBUFFERSMESAPROC __glewXReleaseBuffersMESA; + +extern PFNGLXSET3DFXMODEMESAPROC __glewXSet3DfxModeMESA; + +extern PFNGLXCOPYIMAGESUBDATANVPROC __glewXCopyImageSubDataNV; + +extern PFNGLXBINDVIDEODEVICENVPROC __glewXBindVideoDeviceNV; +extern PFNGLXENUMERATEVIDEODEVICESNVPROC __glewXEnumerateVideoDevicesNV; + +extern PFNGLXBINDSWAPBARRIERNVPROC __glewXBindSwapBarrierNV; +extern PFNGLXJOINSWAPGROUPNVPROC __glewXJoinSwapGroupNV; +extern PFNGLXQUERYFRAMECOUNTNVPROC __glewXQueryFrameCountNV; +extern PFNGLXQUERYMAXSWAPGROUPSNVPROC __glewXQueryMaxSwapGroupsNV; +extern PFNGLXQUERYSWAPGROUPNVPROC __glewXQuerySwapGroupNV; +extern PFNGLXRESETFRAMECOUNTNVPROC __glewXResetFrameCountNV; + +extern PFNGLXALLOCATEMEMORYNVPROC __glewXAllocateMemoryNV; +extern PFNGLXFREEMEMORYNVPROC __glewXFreeMemoryNV; + +extern PFNGLXBINDVIDEOIMAGENVPROC __glewXBindVideoImageNV; +extern PFNGLXGETVIDEODEVICENVPROC __glewXGetVideoDeviceNV; +extern PFNGLXGETVIDEOINFONVPROC __glewXGetVideoInfoNV; +extern PFNGLXRELEASEVIDEODEVICENVPROC __glewXReleaseVideoDeviceNV; +extern PFNGLXRELEASEVIDEOIMAGENVPROC __glewXReleaseVideoImageNV; +extern PFNGLXSENDPBUFFERTOVIDEONVPROC __glewXSendPbufferToVideoNV; + +#ifdef GLX_OML_sync_control +extern PFNGLXGETMSCRATEOMLPROC __glewXGetMscRateOML; +extern PFNGLXGETSYNCVALUESOMLPROC __glewXGetSyncValuesOML; +extern PFNGLXSWAPBUFFERSMSCOMLPROC __glewXSwapBuffersMscOML; +extern PFNGLXWAITFORMSCOMLPROC __glewXWaitForMscOML; +extern PFNGLXWAITFORSBCOMLPROC __glewXWaitForSbcOML; +#endif + +extern PFNGLXCHOOSEFBCONFIGSGIXPROC __glewXChooseFBConfigSGIX; +extern PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC __glewXCreateContextWithConfigSGIX; +extern PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC __glewXCreateGLXPixmapWithConfigSGIX; +extern PFNGLXGETFBCONFIGATTRIBSGIXPROC __glewXGetFBConfigAttribSGIX; +extern PFNGLXGETFBCONFIGFROMVISUALSGIXPROC __glewXGetFBConfigFromVisualSGIX; +extern PFNGLXGETVISUALFROMFBCONFIGSGIXPROC __glewXGetVisualFromFBConfigSGIX; + +extern PFNGLXBINDHYPERPIPESGIXPROC __glewXBindHyperpipeSGIX; +extern PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC __glewXDestroyHyperpipeConfigSGIX; +extern PFNGLXHYPERPIPEATTRIBSGIXPROC __glewXHyperpipeAttribSGIX; +extern PFNGLXHYPERPIPECONFIGSGIXPROC __glewXHyperpipeConfigSGIX; +extern PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC __glewXQueryHyperpipeAttribSGIX; +extern PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC __glewXQueryHyperpipeBestAttribSGIX; +extern PFNGLXQUERYHYPERPIPECONFIGSGIXPROC __glewXQueryHyperpipeConfigSGIX; +extern PFNGLXQUERYHYPERPIPENETWORKSGIXPROC __glewXQueryHyperpipeNetworkSGIX; + +extern PFNGLXCREATEGLXPBUFFERSGIXPROC __glewXCreateGLXPbufferSGIX; +extern PFNGLXDESTROYGLXPBUFFERSGIXPROC __glewXDestroyGLXPbufferSGIX; +extern PFNGLXGETSELECTEDEVENTSGIXPROC __glewXGetSelectedEventSGIX; +extern PFNGLXQUERYGLXPBUFFERSGIXPROC __glewXQueryGLXPbufferSGIX; +extern PFNGLXSELECTEVENTSGIXPROC __glewXSelectEventSGIX; + +extern PFNGLXBINDSWAPBARRIERSGIXPROC __glewXBindSwapBarrierSGIX; +extern PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC __glewXQueryMaxSwapBarriersSGIX; + +extern PFNGLXJOINSWAPGROUPSGIXPROC __glewXJoinSwapGroupSGIX; + +extern PFNGLXBINDCHANNELTOWINDOWSGIXPROC __glewXBindChannelToWindowSGIX; +extern PFNGLXCHANNELRECTSGIXPROC __glewXChannelRectSGIX; +extern PFNGLXCHANNELRECTSYNCSGIXPROC __glewXChannelRectSyncSGIX; +extern PFNGLXQUERYCHANNELDELTASSGIXPROC __glewXQueryChannelDeltasSGIX; +extern PFNGLXQUERYCHANNELRECTSGIXPROC __glewXQueryChannelRectSGIX; + +extern PFNGLXCUSHIONSGIPROC __glewXCushionSGI; + +extern PFNGLXGETCURRENTREADDRAWABLESGIPROC __glewXGetCurrentReadDrawableSGI; +extern PFNGLXMAKECURRENTREADSGIPROC __glewXMakeCurrentReadSGI; + +extern PFNGLXSWAPINTERVALSGIPROC __glewXSwapIntervalSGI; + +extern PFNGLXGETVIDEOSYNCSGIPROC __glewXGetVideoSyncSGI; +extern PFNGLXWAITVIDEOSYNCSGIPROC __glewXWaitVideoSyncSGI; + +extern PFNGLXGETTRANSPARENTINDEXSUNPROC __glewXGetTransparentIndexSUN; + +extern PFNGLXGETVIDEORESIZESUNPROC __glewXGetVideoResizeSUN; +extern PFNGLXVIDEORESIZESUNPROC __glewXVideoResizeSUN; + +#if defined(GLEW_MX) +struct GLXEWContextStruct +{ +#endif /* GLEW_MX */ + +GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_0; +GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_1; +GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_2; +GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_3; +GLXEW_EXPORT GLboolean __GLXEW_VERSION_1_4; +GLXEW_EXPORT GLboolean __GLXEW_3DFX_multisample; +GLXEW_EXPORT GLboolean __GLXEW_AMD_gpu_association; +GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context; +GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context_profile; +GLXEW_EXPORT GLboolean __GLXEW_ARB_create_context_robustness; +GLXEW_EXPORT GLboolean __GLXEW_ARB_fbconfig_float; +GLXEW_EXPORT GLboolean __GLXEW_ARB_framebuffer_sRGB; +GLXEW_EXPORT GLboolean __GLXEW_ARB_get_proc_address; +GLXEW_EXPORT GLboolean __GLXEW_ARB_multisample; +GLXEW_EXPORT GLboolean __GLXEW_ARB_vertex_buffer_object; +GLXEW_EXPORT GLboolean __GLXEW_ATI_pixel_format_float; +GLXEW_EXPORT GLboolean __GLXEW_ATI_render_texture; +GLXEW_EXPORT GLboolean __GLXEW_EXT_create_context_es2_profile; +GLXEW_EXPORT GLboolean __GLXEW_EXT_fbconfig_packed_float; +GLXEW_EXPORT GLboolean __GLXEW_EXT_framebuffer_sRGB; +GLXEW_EXPORT GLboolean __GLXEW_EXT_import_context; +GLXEW_EXPORT GLboolean __GLXEW_EXT_scene_marker; +GLXEW_EXPORT GLboolean __GLXEW_EXT_swap_control; +GLXEW_EXPORT GLboolean __GLXEW_EXT_texture_from_pixmap; +GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_info; +GLXEW_EXPORT GLboolean __GLXEW_EXT_visual_rating; +GLXEW_EXPORT GLboolean __GLXEW_INTEL_swap_event; +GLXEW_EXPORT GLboolean __GLXEW_MESA_agp_offset; +GLXEW_EXPORT GLboolean __GLXEW_MESA_copy_sub_buffer; +GLXEW_EXPORT GLboolean __GLXEW_MESA_pixmap_colormap; +GLXEW_EXPORT GLboolean __GLXEW_MESA_release_buffers; +GLXEW_EXPORT GLboolean __GLXEW_MESA_set_3dfx_mode; +GLXEW_EXPORT GLboolean __GLXEW_NV_copy_image; +GLXEW_EXPORT GLboolean __GLXEW_NV_float_buffer; +GLXEW_EXPORT GLboolean __GLXEW_NV_multisample_coverage; +GLXEW_EXPORT GLboolean __GLXEW_NV_present_video; +GLXEW_EXPORT GLboolean __GLXEW_NV_swap_group; +GLXEW_EXPORT GLboolean __GLXEW_NV_vertex_array_range; +GLXEW_EXPORT GLboolean __GLXEW_NV_video_output; +GLXEW_EXPORT GLboolean __GLXEW_OML_swap_method; +GLXEW_EXPORT GLboolean __GLXEW_OML_sync_control; +GLXEW_EXPORT GLboolean __GLXEW_SGIS_blended_overlay; +GLXEW_EXPORT GLboolean __GLXEW_SGIS_color_range; +GLXEW_EXPORT GLboolean __GLXEW_SGIS_multisample; +GLXEW_EXPORT GLboolean __GLXEW_SGIS_shared_multisample; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_fbconfig; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_hyperpipe; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_pbuffer; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_barrier; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_swap_group; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_video_resize; +GLXEW_EXPORT GLboolean __GLXEW_SGIX_visual_select_group; +GLXEW_EXPORT GLboolean __GLXEW_SGI_cushion; +GLXEW_EXPORT GLboolean __GLXEW_SGI_make_current_read; +GLXEW_EXPORT GLboolean __GLXEW_SGI_swap_control; +GLXEW_EXPORT GLboolean __GLXEW_SGI_video_sync; +GLXEW_EXPORT GLboolean __GLXEW_SUN_get_transparent_index; +GLXEW_EXPORT GLboolean __GLXEW_SUN_video_resize; + +#ifdef GLEW_MX +}; /* GLXEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------ */ + +#ifdef GLEW_MX + +typedef struct GLXEWContextStruct GLXEWContext; +extern GLenum glxewContextInit (GLXEWContext* ctx); +extern GLboolean glxewContextIsSupported (const GLXEWContext* ctx, const char* name); + +#define glxewInit() glxewContextInit(glxewGetContext()) +#define glxewIsSupported(x) glxewContextIsSupported(glxewGetContext(), x) + +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&(glxewGetContext()->x)) +#define GLXEW_GET_FUN(x) x + +#else /* GLEW_MX */ + +#define GLXEW_GET_VAR(x) (*(const GLboolean*)&x) +#define GLXEW_GET_FUN(x) x + +extern GLboolean glxewIsSupported (const char* name); + +#endif /* GLEW_MX */ + +extern GLboolean glxewGetExtension (const char* name); + +#ifdef __cplusplus +} +#endif + +#endif /* __glxew_h__ */ diff --git a/Pkgs/ioapi.c b/Pkgs/ioapi.c new file mode 100644 index 0000000..49958f6 --- /dev/null +++ b/Pkgs/ioapi.c @@ -0,0 +1,235 @@ +/* ioapi.h -- IO base function header for compress/uncompress .zip + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + +*/ + +#if (defined(_WIN32)) + #define _CRT_SECURE_NO_WARNINGS +#endif + +#include "ioapi.h" + +voidpf call_zopen64 (const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode) +{ + if (pfilefunc->zfile_func64.zopen64_file != NULL) + return (*(pfilefunc->zfile_func64.zopen64_file)) (pfilefunc->zfile_func64.opaque,filename,mode); + else + { + return (*(pfilefunc->zopen32_file))(pfilefunc->zfile_func64.opaque,(const char*)filename,mode); + } +} + +long call_zseek64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin) +{ + if (pfilefunc->zfile_func64.zseek64_file != NULL) + return (*(pfilefunc->zfile_func64.zseek64_file)) (pfilefunc->zfile_func64.opaque,filestream,offset,origin); + else + { + uLong offsetTruncated = (uLong)offset; + if (offsetTruncated != offset) + return -1; + else + return (*(pfilefunc->zseek32_file))(pfilefunc->zfile_func64.opaque,filestream,offsetTruncated,origin); + } +} + +ZPOS64_T call_ztell64 (const zlib_filefunc64_32_def* pfilefunc,voidpf filestream) +{ + if (pfilefunc->zfile_func64.zseek64_file != NULL) + return (*(pfilefunc->zfile_func64.ztell64_file)) (pfilefunc->zfile_func64.opaque,filestream); + else + { + uLong tell_uLong = (*(pfilefunc->ztell32_file))(pfilefunc->zfile_func64.opaque,filestream); + if ((tell_uLong) == ((uLong)-1)) + return (ZPOS64_T)-1; + else + return tell_uLong; + } +} + +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32) +{ + p_filefunc64_32->zfile_func64.zopen64_file = NULL; + p_filefunc64_32->zopen32_file = p_filefunc32->zopen_file; + p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; + p_filefunc64_32->zfile_func64.zread_file = p_filefunc32->zread_file; + p_filefunc64_32->zfile_func64.zwrite_file = p_filefunc32->zwrite_file; + p_filefunc64_32->zfile_func64.ztell64_file = NULL; + p_filefunc64_32->zfile_func64.zseek64_file = NULL; + p_filefunc64_32->zfile_func64.zclose_file = p_filefunc32->zclose_file; + p_filefunc64_32->zfile_func64.zerror_file = p_filefunc32->zerror_file; + p_filefunc64_32->zfile_func64.opaque = p_filefunc32->opaque; + p_filefunc64_32->zseek32_file = p_filefunc32->zseek_file; + p_filefunc64_32->ztell32_file = p_filefunc32->ztell_file; +} + + + +static voidpf ZCALLBACK fopen_file_func OF((voidpf opaque, const char* filename, int mode)); +static uLong ZCALLBACK fread_file_func OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +static uLong ZCALLBACK fwrite_file_func OF((voidpf opaque, voidpf stream, const void* buf,uLong size)); +static ZPOS64_T ZCALLBACK ftell64_file_func OF((voidpf opaque, voidpf stream)); +static long ZCALLBACK fseek64_file_func OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); +static int ZCALLBACK fclose_file_func OF((voidpf opaque, voidpf stream)); +static int ZCALLBACK ferror_file_func OF((voidpf opaque, voidpf stream)); + +static voidpf ZCALLBACK fopen_file_func (voidpf opaque, const char* filename, int mode) +{ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + mode_fopen = "r+b"; + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + mode_fopen = "wb"; + + if ((filename!=NULL) && (mode_fopen != NULL)) + file = fopen(filename, mode_fopen); + return file; +} + +static voidpf ZCALLBACK fopen64_file_func (voidpf opaque, const void* filename, int mode) +{ + FILE* file = NULL; + const char* mode_fopen = NULL; + if ((mode & ZLIB_FILEFUNC_MODE_READWRITEFILTER)==ZLIB_FILEFUNC_MODE_READ) + mode_fopen = "rb"; + else + if (mode & ZLIB_FILEFUNC_MODE_EXISTING) + mode_fopen = "r+b"; + else + if (mode & ZLIB_FILEFUNC_MODE_CREATE) + mode_fopen = "wb"; + + if ((filename!=NULL) && (mode_fopen != NULL)) + file = fopen64((const char*)filename, mode_fopen); + return file; +} + + +static uLong ZCALLBACK fread_file_func (voidpf opaque, voidpf stream, void* buf, uLong size) +{ + uLong ret; + ret = (uLong)fread(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + +static uLong ZCALLBACK fwrite_file_func (voidpf opaque, voidpf stream, const void* buf, uLong size) +{ + uLong ret; + ret = (uLong)fwrite(buf, 1, (size_t)size, (FILE *)stream); + return ret; +} + +static long ZCALLBACK ftell_file_func (voidpf opaque, voidpf stream) +{ + long ret; + ret = ftell((FILE *)stream); + return ret; +} + + +static ZPOS64_T ZCALLBACK ftell64_file_func (voidpf opaque, voidpf stream) +{ + ZPOS64_T ret; + ret = ftello64((FILE *)stream); + return ret; +} + +static long ZCALLBACK fseek_file_func (voidpf opaque, voidpf stream, uLong offset, int origin) +{ + int fseek_origin=0; + long ret; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + fseek_origin = SEEK_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END : + fseek_origin = SEEK_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + fseek_origin = SEEK_SET; + break; + default: return -1; + } + ret = 0; + if (fseek((FILE *)stream, offset, fseek_origin) != 0) + ret = -1; + return ret; +} + +static long ZCALLBACK fseek64_file_func (voidpf opaque, voidpf stream, ZPOS64_T offset, int origin) +{ + int fseek_origin=0; + long ret; + switch (origin) + { + case ZLIB_FILEFUNC_SEEK_CUR : + fseek_origin = SEEK_CUR; + break; + case ZLIB_FILEFUNC_SEEK_END : + fseek_origin = SEEK_END; + break; + case ZLIB_FILEFUNC_SEEK_SET : + fseek_origin = SEEK_SET; + break; + default: return -1; + } + ret = 0; + + if(fseeko64((FILE *)stream, offset, fseek_origin) != 0) + ret = -1; + + return ret; +} + + +static int ZCALLBACK fclose_file_func (voidpf opaque, voidpf stream) +{ + int ret; + ret = fclose((FILE *)stream); + return ret; +} + +static int ZCALLBACK ferror_file_func (voidpf opaque, voidpf stream) +{ + int ret; + ret = ferror((FILE *)stream); + return ret; +} + +void fill_fopen_filefunc (pzlib_filefunc_def) + zlib_filefunc_def* pzlib_filefunc_def; +{ + pzlib_filefunc_def->zopen_file = fopen_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; + pzlib_filefunc_def->zwrite_file = fwrite_file_func; + pzlib_filefunc_def->ztell_file = ftell_file_func; + pzlib_filefunc_def->zseek_file = fseek_file_func; + pzlib_filefunc_def->zclose_file = fclose_file_func; + pzlib_filefunc_def->zerror_file = ferror_file_func; + pzlib_filefunc_def->opaque = NULL; +} + +void fill_fopen64_filefunc (zlib_filefunc64_def* pzlib_filefunc_def) +{ + pzlib_filefunc_def->zopen64_file = fopen64_file_func; + pzlib_filefunc_def->zread_file = fread_file_func; + pzlib_filefunc_def->zwrite_file = fwrite_file_func; + pzlib_filefunc_def->ztell64_file = ftell64_file_func; + pzlib_filefunc_def->zseek64_file = fseek64_file_func; + pzlib_filefunc_def->zclose_file = fclose_file_func; + pzlib_filefunc_def->zerror_file = ferror_file_func; + pzlib_filefunc_def->opaque = NULL; +} diff --git a/Pkgs/ioapi.h b/Pkgs/ioapi.h new file mode 100644 index 0000000..8309c4c --- /dev/null +++ b/Pkgs/ioapi.h @@ -0,0 +1,200 @@ +/* ioapi.h -- IO base function header for compress/uncompress .zip + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications for Zip64 support + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + Changes + + Oct-2009 - Defined ZPOS64_T to fpos_t on windows and u_int64_t on linux. (might need to find a better why for this) + Oct-2009 - Change to fseeko64, ftello64 and fopen64 so large files would work on linux. + More if/def section may be needed to support other platforms + Oct-2009 - Defined fxxxx64 calls to normal fopen/ftell/fseek so they would compile on windows. + (but you should use iowin32.c for windows instead) + +*/ + +#ifndef _ZLIBIOAPI64_H +#define _ZLIBIOAPI64_H + +#if (!defined(_WIN32)) && (!defined(WIN32)) + + // Linux needs this to support file operation on files larger then 4+GB + // But might need better if/def to select just the platforms that needs them. + + #ifndef __USE_FILE_OFFSET64 + #define __USE_FILE_OFFSET64 + #endif + #ifndef __USE_LARGEFILE64 + #define __USE_LARGEFILE64 + #endif + #ifndef _LARGEFILE64_SOURCE + #define _LARGEFILE64_SOURCE + #endif + #ifndef _FILE_OFFSET_BIT + #define _FILE_OFFSET_BIT 64 + #endif +#endif + +#include +#include +#include "zlib.h" + +#if defined(USE_FILE32API) +#define fopen64 fopen +#define ftello64 ftell +#define fseeko64 fseek +#else +#ifdef _MSC_VER + #define fopen64 fopen + #if (_MSC_VER >= 1400) && (!(defined(NO_MSCVER_FILE64_FUNC))) + #define ftello64 _ftelli64 + #define fseeko64 _fseeki64 + #else // old MSC + #define ftello64 ftell + #define fseeko64 fseek + #endif +#endif +#endif + +/* +#ifndef ZPOS64_T + #ifdef _WIN32 + #define ZPOS64_T fpos_t + #else + #include + #define ZPOS64_T uint64_t + #endif +#endif +*/ + +#ifdef HAVE_MINIZIP64_CONF_H +#include "mz64conf.h" +#endif + +/* a type choosen by DEFINE */ +#ifdef HAVE_64BIT_INT_CUSTOM +typedef 64BIT_INT_CUSTOM_TYPE ZPOS64_T; +#else +#ifdef HAS_STDINT_H +#include "stdint.h" +typedef uint64_t ZPOS64_T; +#else + + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef unsigned __int64 ZPOS64_T; +#else +typedef unsigned long long int ZPOS64_T; +#endif +#endif +#endif + + + +#ifdef __cplusplus +extern "C" { +#endif + + +#define ZLIB_FILEFUNC_SEEK_CUR (1) +#define ZLIB_FILEFUNC_SEEK_END (2) +#define ZLIB_FILEFUNC_SEEK_SET (0) + +#define ZLIB_FILEFUNC_MODE_READ (1) +#define ZLIB_FILEFUNC_MODE_WRITE (2) +#define ZLIB_FILEFUNC_MODE_READWRITEFILTER (3) + +#define ZLIB_FILEFUNC_MODE_EXISTING (4) +#define ZLIB_FILEFUNC_MODE_CREATE (8) + + +#ifndef ZCALLBACK + #if (defined(WIN32) || defined(_WIN32) || defined (WINDOWS) || defined (_WINDOWS)) && defined(CALLBACK) && defined (USEWINDOWS_CALLBACK) + #define ZCALLBACK CALLBACK + #else + #define ZCALLBACK + #endif +#endif + + + + +typedef voidpf (ZCALLBACK *open_file_func) OF((voidpf opaque, const char* filename, int mode)); +typedef uLong (ZCALLBACK *read_file_func) OF((voidpf opaque, voidpf stream, void* buf, uLong size)); +typedef uLong (ZCALLBACK *write_file_func) OF((voidpf opaque, voidpf stream, const void* buf, uLong size)); +typedef int (ZCALLBACK *close_file_func) OF((voidpf opaque, voidpf stream)); +typedef int (ZCALLBACK *testerror_file_func) OF((voidpf opaque, voidpf stream)); + +typedef long (ZCALLBACK *tell_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek_file_func) OF((voidpf opaque, voidpf stream, uLong offset, int origin)); + + +/* here is the "old" 32 bits structure structure */ +typedef struct zlib_filefunc_def_s +{ + open_file_func zopen_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell_file_func ztell_file; + seek_file_func zseek_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc_def; + +typedef ZPOS64_T (ZCALLBACK *tell64_file_func) OF((voidpf opaque, voidpf stream)); +typedef long (ZCALLBACK *seek64_file_func) OF((voidpf opaque, voidpf stream, ZPOS64_T offset, int origin)); +typedef voidpf (ZCALLBACK *open64_file_func) OF((voidpf opaque, const void* filename, int mode)); + +typedef struct zlib_filefunc64_def_s +{ + open64_file_func zopen64_file; + read_file_func zread_file; + write_file_func zwrite_file; + tell64_file_func ztell64_file; + seek64_file_func zseek64_file; + close_file_func zclose_file; + testerror_file_func zerror_file; + voidpf opaque; +} zlib_filefunc64_def; + +void fill_fopen64_filefunc OF((zlib_filefunc64_def* pzlib_filefunc_def)); +void fill_fopen_filefunc OF((zlib_filefunc_def* pzlib_filefunc_def)); + +/* now internal definition, only for zip.c and unzip.h */ +typedef struct zlib_filefunc64_32_def_s +{ + zlib_filefunc64_def zfile_func64; + open_file_func zopen32_file; + tell_file_func ztell32_file; + seek_file_func zseek32_file; +} zlib_filefunc64_32_def; + + +#define ZREAD64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zread_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) +#define ZWRITE64(filefunc,filestream,buf,size) ((*((filefunc).zfile_func64.zwrite_file)) ((filefunc).zfile_func64.opaque,filestream,buf,size)) +//#define ZTELL64(filefunc,filestream) ((*((filefunc).ztell64_file)) ((filefunc).opaque,filestream)) +//#define ZSEEK64(filefunc,filestream,pos,mode) ((*((filefunc).zseek64_file)) ((filefunc).opaque,filestream,pos,mode)) +#define ZCLOSE64(filefunc,filestream) ((*((filefunc).zfile_func64.zclose_file)) ((filefunc).zfile_func64.opaque,filestream)) +#define ZERROR64(filefunc,filestream) ((*((filefunc).zfile_func64.zerror_file)) ((filefunc).zfile_func64.opaque,filestream)) + +voidpf call_zopen64 OF((const zlib_filefunc64_32_def* pfilefunc,const void*filename,int mode)); +long call_zseek64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream, ZPOS64_T offset, int origin)); +ZPOS64_T call_ztell64 OF((const zlib_filefunc64_32_def* pfilefunc,voidpf filestream)); + +void fill_zlib_filefunc64_32_def_from_filefunc32(zlib_filefunc64_32_def* p_filefunc64_32,const zlib_filefunc_def* p_filefunc32); + +#define ZOPEN64(filefunc,filename,mode) (call_zopen64((&(filefunc)),(filename),(mode))) +#define ZTELL64(filefunc,filestream) (call_ztell64((&(filefunc)),(filestream))) +#define ZSEEK64(filefunc,filestream,pos,mode) (call_zseek64((&(filefunc)),(filestream),(pos),(mode))) + +#ifdef __cplusplus +} +#endif + +#endif diff --git a/Pkgs/unzip.c b/Pkgs/unzip.c new file mode 100644 index 0000000..7617f41 --- /dev/null +++ b/Pkgs/unzip.c @@ -0,0 +1,2125 @@ +/* unzip.c -- IO for uncompress .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications of Unzip for Zip64 + Copyright (C) 2007-2008 Even Rouault + + Modifications for Zip64 support on both zip and unzip + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + + ------------------------------------------------------------------------------------ + Decryption code comes from crypt.c by Info-ZIP but has been greatly reduced in terms of + compatibility with older software. The following is from the original crypt.c. + Code woven in by Terry Thorsen 1/2003. + + Copyright (c) 1990-2000 Info-ZIP. All rights reserved. + + See the accompanying file LICENSE, version 2000-Apr-09 or later + (the contents of which are also included in zip.h) for terms of use. + If, for some reason, all these files are missing, the Info-ZIP license + also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html + + crypt.c (full version) by Info-ZIP. Last revised: [see crypt.h] + + The encryption/decryption parts of this source code (as opposed to the + non-echoing password parts) were originally written in Europe. The + whole source package can be freely distributed, including from the USA. + (Prior to January 2000, re-export from the US was a violation of US law.) + + This encryption code is a direct transcription of the algorithm from + Roger Schlafly, described by Phil Katz in the file appnote.txt. This + file (appnote.txt) is distributed with the PKZIP program (even in the + version without encryption capabilities). + + ------------------------------------------------------------------------------------ + + Changes in unzip.c + + 2007-2008 - Even Rouault - Addition of cpl_unzGetCurrentFileZStreamPos + 2007-2008 - Even Rouault - Decoration of symbol names unz* -> cpl_unz* + 2007-2008 - Even Rouault - Remove old C style function prototypes + 2007-2008 - Even Rouault - Add unzip support for ZIP64 + + Copyright (C) 2007-2008 Even Rouault + + + Oct-2009 - Mathias Svensson - Removed cpl_* from symbol names (Even Rouault added them but since this is now moved to a new project (minizip64) I renamed them again). + Oct-2009 - Mathias Svensson - Fixed problem if uncompressed size was > 4G and compressed size was <4G + should only read the compressed/uncompressed size from the Zip64 format if + the size from normal header was 0xFFFFFFFF + Oct-2009 - Mathias Svensson - Applied some bug fixes from paches recived from Gilles Vollant + Oct-2009 - Mathias Svensson - Applied support to unzip files with compression mathod BZIP2 (bzip2 lib is required) + Patch created by Daniel Borca + + Jan-2010 - back to unzip and minizip 1.0 name scheme, with compatibility layer + + Copyright (C) 1998 - 2010 Gilles Vollant, Even Rouault, Mathias Svensson + +*/ + + +#include +#include +#include + +#ifndef NOUNCRYPT + #define NOUNCRYPT +#endif + +#include "zlib.h" +#include "unzip.h" + +#ifdef STDC +# include +# include +# include +#endif +#ifdef NO_ERRNO_H + extern int errno; +#else +# include +#endif + + +#ifndef local +# define local static +#endif +/* compile with -Dlocal if your debugger can't find static symbols */ + + +#ifndef CASESENSITIVITYDEFAULT_NO +# if !defined(unix) && !defined(CASESENSITIVITYDEFAULT_YES) +# define CASESENSITIVITYDEFAULT_NO +# endif +#endif + + +#ifndef UNZ_BUFSIZE +#define UNZ_BUFSIZE (16384) +#endif + +#ifndef UNZ_MAXFILENAMEINZIP +#define UNZ_MAXFILENAMEINZIP (256) +#endif + +#ifndef ALLOC +# define ALLOC(size) (malloc(size)) +#endif +#ifndef TRYFREE +# define TRYFREE(p) {if (p) free(p);} +#endif + +#define SIZECENTRALDIRITEM (0x2e) +#define SIZEZIPLOCALHEADER (0x1e) + + +const char unz_copyright[] = + " unzip 1.01 Copyright 1998-2004 Gilles Vollant - http://www.winimage.com/zLibDll"; + +/* unz_file_info_interntal contain internal info about a file in zipfile*/ +typedef struct unz_file_info64_internal_s +{ + ZPOS64_T offset_curfile;/* relative offset of local header 8 bytes */ +} unz_file_info64_internal; + + +/* file_in_zip_read_info_s contain internal information about a file in zipfile, + when reading and decompress it */ +typedef struct +{ + char *read_buffer; /* internal buffer for compressed data */ + z_stream stream; /* zLib stream structure for inflate */ + +#ifdef HAVE_BZIP2 + bz_stream bstream; /* bzLib stream structure for bziped */ +#endif + + ZPOS64_T pos_in_zipfile; /* position in byte on the zipfile, for fseek*/ + uLong stream_initialised; /* flag set if stream structure is initialised*/ + + ZPOS64_T offset_local_extrafield;/* offset of the local extra field */ + uInt size_local_extrafield;/* size of the local extra field */ + ZPOS64_T pos_local_extrafield; /* position in the local extra field in read*/ + ZPOS64_T total_out_64; + + uLong crc32; /* crc32 of all data uncompressed */ + uLong crc32_wait; /* crc32 we must obtain after decompress all */ + ZPOS64_T rest_read_compressed; /* number of byte to be decompressed */ + ZPOS64_T rest_read_uncompressed;/*number of byte to be obtained after decomp*/ + zlib_filefunc64_32_def z_filefunc; + voidpf filestream; /* io structore of the zipfile */ + uLong compression_method; /* compression method (0==store) */ + ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + int raw; +} file_in_zip64_read_info_s; + + +/* unz64_s contain internal information about the zipfile +*/ +typedef struct +{ + zlib_filefunc64_32_def z_filefunc; + int is64bitOpenFunction; + voidpf filestream; /* io structore of the zipfile */ + unz_global_info64 gi; /* public global information */ + ZPOS64_T byte_before_the_zipfile;/* byte before the zipfile, (>0 for sfx)*/ + ZPOS64_T num_file; /* number of the current file in the zipfile*/ + ZPOS64_T pos_in_central_dir; /* pos of the current file in the central dir*/ + ZPOS64_T current_file_ok; /* flag about the usability of the current file*/ + ZPOS64_T central_pos; /* position of the beginning of the central dir*/ + + ZPOS64_T size_central_dir; /* size of the central directory */ + ZPOS64_T offset_central_dir; /* offset of start of central directory with + respect to the starting disk number */ + + unz_file_info64 cur_file_info; /* public info about the current file in zip*/ + unz_file_info64_internal cur_file_info_internal; /* private info about it*/ + file_in_zip64_read_info_s* pfile_in_zip_read; /* structure about the current + file if we are decompressing it */ + int encrypted; + + int isZip64; + +# ifndef NOUNCRYPT + unsigned long keys[3]; /* keys defining the pseudo-random sequence */ + const unsigned long* pcrc_32_tab; +# endif +} unz64_s; + + +#ifndef NOUNCRYPT +#include "crypt.h" +#endif + +/* =========================================================================== + Read a byte from a gz_stream; update next_in and avail_in. Return EOF + for end of file. + IN assertion: the stream s has been sucessfully opened for reading. +*/ + + +local int unz64local_getByte OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + int *pi)); + +local int unz64local_getByte(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream, int *pi) +{ + unsigned char c; + int err = (int)ZREAD64(*pzlib_filefunc_def,filestream,&c,1); + if (err==1) + { + *pi = (int)c; + return UNZ_OK; + } + else + { + if (ZERROR64(*pzlib_filefunc_def,filestream)) + return UNZ_ERRNO; + else + return UNZ_EOF; + } +} + + +/* =========================================================================== + Reads a long in LSB order from the given gz_stream. Sets +*/ +local int unz64local_getShort OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unz64local_getShort (const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX) +{ + uLong x ; + int i = 0; + int err; + + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((uLong)i)<<8; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int unz64local_getLong OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX)); + +local int unz64local_getLong (const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + uLong *pX) +{ + uLong x ; + int i = 0; + int err; + + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (uLong)i; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((uLong)i)<<8; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((uLong)i)<<16; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x += ((uLong)i)<<24; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +local int unz64local_getLong64 OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + ZPOS64_T *pX)); + + +local int unz64local_getLong64 (const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream, + ZPOS64_T *pX) +{ + ZPOS64_T x ; + int i = 0; + int err; + + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x = (ZPOS64_T)i; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<8; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<16; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<24; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<32; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<40; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<48; + + if (err==UNZ_OK) + err = unz64local_getByte(pzlib_filefunc_def,filestream,&i); + x |= ((ZPOS64_T)i)<<56; + + if (err==UNZ_OK) + *pX = x; + else + *pX = 0; + return err; +} + +/* My own strcmpi / strcasecmp */ +local int strcmpcasenosensitive_internal (const char* fileName1, const char* fileName2) +{ + for (;;) + { + char c1=*(fileName1++); + char c2=*(fileName2++); + if ((c1>='a') && (c1<='z')) + c1 -= 0x20; + if ((c2>='a') && (c2<='z')) + c2 -= 0x20; + if (c1=='\0') + return ((c2=='\0') ? 0 : -1); + if (c2=='\0') + return 1; + if (c1c2) + return 1; + } +} + + +#ifdef CASESENSITIVITYDEFAULT_NO +#define CASESENSITIVITYDEFAULTVALUE 2 +#else +#define CASESENSITIVITYDEFAULTVALUE 1 +#endif + +#ifndef STRCMPCASENOSENTIVEFUNCTION +#define STRCMPCASENOSENTIVEFUNCTION strcmpcasenosensitive_internal +#endif + +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) + +*/ +extern int ZEXPORT unzStringFileNameCompare (const char* fileName1, + const char* fileName2, + int iCaseSensitivity) + +{ + if (iCaseSensitivity==0) + iCaseSensitivity=CASESENSITIVITYDEFAULTVALUE; + + if (iCaseSensitivity==1) + return strcmp(fileName1,fileName2); + + return STRCMPCASENOSENTIVEFUNCTION(fileName1,fileName2); +} + +#ifndef BUFREADCOMMENT +#define BUFREADCOMMENT (0x400) +#endif + +/* + Locate the Central directory of a zipfile (at the end, just before + the global comment) +*/ +local ZPOS64_T unz64local_SearchCentralDir OF((const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream)); +local ZPOS64_T unz64local_SearchCentralDir(const zlib_filefunc64_32_def* pzlib_filefunc_def, voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x05) && ((*(buf+i+3))==0x06)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + return uPosFound; +} + + +/* + Locate the Central directory 64 of a zipfile (at the end, just before + the global comment) +*/ +local ZPOS64_T unz64local_SearchCentralDir64 OF(( + const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream)); + +local ZPOS64_T unz64local_SearchCentralDir64(const zlib_filefunc64_32_def* pzlib_filefunc_def, + voidpf filestream) +{ + unsigned char* buf; + ZPOS64_T uSizeFile; + ZPOS64_T uBackRead; + ZPOS64_T uMaxBack=0xffff; /* maximum size of global comment */ + ZPOS64_T uPosFound=0; + uLong uL; + ZPOS64_T relativeOffset; + + if (ZSEEK64(*pzlib_filefunc_def,filestream,0,ZLIB_FILEFUNC_SEEK_END) != 0) + return 0; + + + uSizeFile = ZTELL64(*pzlib_filefunc_def,filestream); + + if (uMaxBack>uSizeFile) + uMaxBack = uSizeFile; + + buf = (unsigned char*)ALLOC(BUFREADCOMMENT+4); + if (buf==NULL) + return 0; + + uBackRead = 4; + while (uBackReaduMaxBack) + uBackRead = uMaxBack; + else + uBackRead+=BUFREADCOMMENT; + uReadPos = uSizeFile-uBackRead ; + + uReadSize = ((BUFREADCOMMENT+4) < (uSizeFile-uReadPos)) ? + (BUFREADCOMMENT+4) : (uLong)(uSizeFile-uReadPos); + if (ZSEEK64(*pzlib_filefunc_def,filestream,uReadPos,ZLIB_FILEFUNC_SEEK_SET)!=0) + break; + + if (ZREAD64(*pzlib_filefunc_def,filestream,buf,uReadSize)!=uReadSize) + break; + + for (i=(int)uReadSize-3; (i--)>0;) + if (((*(buf+i))==0x50) && ((*(buf+i+1))==0x4b) && + ((*(buf+i+2))==0x06) && ((*(buf+i+3))==0x07)) + { + uPosFound = uReadPos+i; + break; + } + + if (uPosFound!=0) + break; + } + TRYFREE(buf); + if (uPosFound == 0) + return 0; + + /* Zip64 end of central directory locator */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, uPosFound,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature, already checked */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + + /* number of the disk with the start of the zip64 end of central directory */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + if (uL != 0) + return 0; + + /* relative offset of the zip64 end of central directory record */ + if (unz64local_getLong64(pzlib_filefunc_def,filestream,&relativeOffset)!=UNZ_OK) + return 0; + + /* total number of disks */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + if (uL != 1) + return 0; + + /* Goto end of central directory record */ + if (ZSEEK64(*pzlib_filefunc_def,filestream, relativeOffset,ZLIB_FILEFUNC_SEEK_SET)!=0) + return 0; + + /* the signature */ + if (unz64local_getLong(pzlib_filefunc_def,filestream,&uL)!=UNZ_OK) + return 0; + + if (uL != 0x06064b50) + return 0; + + return relativeOffset; +} + +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows NT computer "c:\\test\\zlib114.zip" or on an Unix computer + "zlib/zlib114.zip". + If the zipfile cannot be opened (file doesn't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. +*/ +local unzFile unzOpenInternal (const void *path, + zlib_filefunc64_32_def* pzlib_filefunc64_32_def, + int is64bitOpenFunction) +{ + unz64_s us; + unz64_s *s; + ZPOS64_T central_pos; + uLong uL; + + uLong number_disk; /* number of the current dist, used for + spaning ZIP, unsupported, always 0*/ + uLong number_disk_with_CD; /* number the the disk with central dir, used + for spaning ZIP, unsupported, always 0*/ + ZPOS64_T number_entry_CD; /* total number of entries in + the central dir + (same than number_entry on nospan) */ + + int err=UNZ_OK; + + if (unz_copyright[0]!=' ') + return NULL; + + us.z_filefunc.zseek32_file = NULL; + us.z_filefunc.ztell32_file = NULL; + if (pzlib_filefunc64_32_def==NULL) + fill_fopen64_filefunc(&us.z_filefunc.zfile_func64); + else + us.z_filefunc = *pzlib_filefunc64_32_def; + us.is64bitOpenFunction = is64bitOpenFunction; + + + + us.filestream = ZOPEN64(us.z_filefunc, + path, + ZLIB_FILEFUNC_MODE_READ | + ZLIB_FILEFUNC_MODE_EXISTING); + if (us.filestream==NULL) + return NULL; + + central_pos = unz64local_SearchCentralDir64(&us.z_filefunc,us.filestream); + if (central_pos) + { + uLong uS; + ZPOS64_T uL64; + + us.isZip64 = 1; + + if (ZSEEK64(us.z_filefunc, us.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* size of zip64 end of central directory record */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&uL64)!=UNZ_OK) + err=UNZ_ERRNO; + + /* version made by */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) + err=UNZ_ERRNO; + + /* version needed to extract */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uS)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central directory on this disk */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.gi.number_entry)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central directory */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&number_entry_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.size_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unz64local_getLong64(&us.z_filefunc, us.filestream,&us.offset_central_dir)!=UNZ_OK) + err=UNZ_ERRNO; + + us.gi.size_comment = 0; + } + else + { + central_pos = unz64local_SearchCentralDir(&us.z_filefunc,us.filestream); + if (central_pos==0) + err=UNZ_ERRNO; + + us.isZip64 = 0; + + if (ZSEEK64(us.z_filefunc, us.filestream, + central_pos,ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + /* the signature, already checked */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of this disk */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk)!=UNZ_OK) + err=UNZ_ERRNO; + + /* number of the disk with the start of the central directory */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&number_disk_with_CD)!=UNZ_OK) + err=UNZ_ERRNO; + + /* total number of entries in the central dir on this disk */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + us.gi.number_entry = uL; + + /* total number of entries in the central dir */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + number_entry_CD = uL; + + if ((number_entry_CD!=us.gi.number_entry) || + (number_disk_with_CD!=0) || + (number_disk!=0)) + err=UNZ_BADZIPFILE; + + /* size of the central directory */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + us.size_central_dir = uL; + + /* offset of start of central directory with respect to the + starting disk number */ + if (unz64local_getLong(&us.z_filefunc, us.filestream,&uL)!=UNZ_OK) + err=UNZ_ERRNO; + us.offset_central_dir = uL; + + /* zipfile comment length */ + if (unz64local_getShort(&us.z_filefunc, us.filestream,&us.gi.size_comment)!=UNZ_OK) + err=UNZ_ERRNO; + } + + if ((central_pospfile_in_zip_read!=NULL) + unzCloseCurrentFile(file); + + ZCLOSE64(s->z_filefunc, s->filestream); + TRYFREE(s); + return UNZ_OK; +} + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ +extern int ZEXPORT unzGetGlobalInfo64 (unzFile file, unz_global_info64* pglobal_info) +{ + unz64_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + *pglobal_info=s->gi; + return UNZ_OK; +} + +extern int ZEXPORT unzGetGlobalInfo (unzFile file, unz_global_info* pglobal_info32) +{ + unz64_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + /* to do : check if number_entry is not truncated */ + pglobal_info32->number_entry = (uLong)s->gi.number_entry; + pglobal_info32->size_comment = s->gi.size_comment; + return UNZ_OK; +} +/* + Translate date/time from Dos format to tm_unz (readable more easilty) +*/ +local void unz64local_DosDateToTmuDate (ZPOS64_T ulDosDate, tm_unz* ptm) +{ + ZPOS64_T uDate; + uDate = (ZPOS64_T)(ulDosDate>>16); + ptm->tm_mday = (uInt)(uDate&0x1f) ; + ptm->tm_mon = (uInt)((((uDate)&0x1E0)/0x20)-1) ; + ptm->tm_year = (uInt)(((uDate&0x0FE00)/0x0200)+1980) ; + + ptm->tm_hour = (uInt) ((ulDosDate &0xF800)/0x800); + ptm->tm_min = (uInt) ((ulDosDate&0x7E0)/0x20) ; + ptm->tm_sec = (uInt) (2*(ulDosDate&0x1f)) ; +} + +/* + Get Info about the current file in the zipfile, with internal only info +*/ +local int unz64local_GetCurrentFileInfoInternal OF((unzFile file, + unz_file_info64 *pfile_info, + unz_file_info64_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); + +local int unz64local_GetCurrentFileInfoInternal (unzFile file, + unz_file_info64 *pfile_info, + unz_file_info64_internal + *pfile_info_internal, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize) +{ + unz64_s* s; + unz_file_info64 file_info; + unz_file_info64_internal file_info_internal; + int err=UNZ_OK; + uLong uMagic; + long lSeek=0; + uLong uL; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (ZSEEK64(s->z_filefunc, s->filestream, + s->pos_in_central_dir+s->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + err=UNZ_ERRNO; + + + /* we check the magic */ + if (err==UNZ_OK) + { + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x02014b50) + err=UNZ_BADZIPFILE; + } + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.version_needed) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.flag) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.compression_method) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.dosDate) != UNZ_OK) + err=UNZ_ERRNO; + + unz64local_DosDateToTmuDate(file_info.dosDate,&file_info.tmu_date); + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.crc) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + file_info.compressed_size = uL; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + file_info.uncompressed_size = uL; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_filename) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_extra) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.size_file_comment) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.disk_num_start) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&file_info.internal_fa) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&file_info.external_fa) != UNZ_OK) + err=UNZ_ERRNO; + + // relative offset of local header + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + file_info_internal.offset_curfile = uL; + + lSeek+=file_info.size_filename; + if ((err==UNZ_OK) && (szFileName!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_filename0) && (fileNameBufferSize>0)) + if (ZREAD64(s->z_filefunc, s->filestream,szFileName,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek -= uSizeRead; + } + + // Read extrafield + if ((err==UNZ_OK) && (extraField!=NULL)) + { + ZPOS64_T uSizeRead ; + if (file_info.size_file_extraz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + + if ((file_info.size_file_extra>0) && (extraFieldBufferSize>0)) + if (ZREAD64(s->z_filefunc, s->filestream,extraField,(uLong)uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + + lSeek += file_info.size_file_extra - (uLong)uSizeRead; + } + else + lSeek += file_info.size_file_extra; + + + if ((err==UNZ_OK) && (file_info.size_file_extra != 0)) + { + uLong acc = 0; + + // since lSeek now points to after the extra field we need to move back + lSeek -= file_info.size_file_extra; + + if (lSeek!=0) + { + if (ZSEEK64(s->z_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + + while(acc < file_info.size_file_extra) + { + uLong headerId; + uLong dataSize; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&headerId) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&dataSize) != UNZ_OK) + err=UNZ_ERRNO; + + /* ZIP64 extra fields */ + if (headerId == 0x0001) + { + uLong uL; + + if(file_info.uncompressed_size == (ZPOS64_T)(unsigned long)-1) + { + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.uncompressed_size) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info.compressed_size == (ZPOS64_T)(unsigned long)-1) + { + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info.compressed_size) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info_internal.offset_curfile == (ZPOS64_T)(unsigned long)-1) + { + /* Relative Header offset */ + if (unz64local_getLong64(&s->z_filefunc, s->filestream,&file_info_internal.offset_curfile) != UNZ_OK) + err=UNZ_ERRNO; + } + + if(file_info.disk_num_start == (unsigned long)-1) + { + /* Disk Start Number */ + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uL) != UNZ_OK) + err=UNZ_ERRNO; + } + + } + else + { + if (ZSEEK64(s->z_filefunc, s->filestream,dataSize,ZLIB_FILEFUNC_SEEK_CUR)!=0) + err=UNZ_ERRNO; + } + + acc += 2 + 2 + dataSize; + } + } + + if ((err==UNZ_OK) && (szComment!=NULL)) + { + uLong uSizeRead ; + if (file_info.size_file_commentz_filefunc, s->filestream,lSeek,ZLIB_FILEFUNC_SEEK_CUR)==0) + lSeek=0; + else + err=UNZ_ERRNO; + } + + if ((file_info.size_file_comment>0) && (commentBufferSize>0)) + if (ZREAD64(s->z_filefunc, s->filestream,szComment,uSizeRead)!=uSizeRead) + err=UNZ_ERRNO; + lSeek+=file_info.size_file_comment - uSizeRead; + } + else + lSeek+=file_info.size_file_comment; + + + if ((err==UNZ_OK) && (pfile_info!=NULL)) + *pfile_info=file_info; + + if ((err==UNZ_OK) && (pfile_info_internal!=NULL)) + *pfile_info_internal=file_info_internal; + + return err; +} + + + +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. +*/ +extern int ZEXPORT unzGetCurrentFileInfo64 (unzFile file, + unz_file_info64 * pfile_info, + char * szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, + char* szComment, uLong commentBufferSize) +{ + return unz64local_GetCurrentFileInfoInternal(file,pfile_info,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); +} + +extern int ZEXPORT unzGetCurrentFileInfo (unzFile file, + unz_file_info * pfile_info, + char * szFileName, uLong fileNameBufferSize, + void *extraField, uLong extraFieldBufferSize, + char* szComment, uLong commentBufferSize) +{ + int err; + unz_file_info64 file_info64; + err = unz64local_GetCurrentFileInfoInternal(file,&file_info64,NULL, + szFileName,fileNameBufferSize, + extraField,extraFieldBufferSize, + szComment,commentBufferSize); + if (err==UNZ_OK) + { + pfile_info->version = file_info64.version; + pfile_info->version_needed = file_info64.version_needed; + pfile_info->flag = file_info64.flag; + pfile_info->compression_method = file_info64.compression_method; + pfile_info->dosDate = file_info64.dosDate; + pfile_info->crc = file_info64.crc; + + pfile_info->size_filename = file_info64.size_filename; + pfile_info->size_file_extra = file_info64.size_file_extra; + pfile_info->size_file_comment = file_info64.size_file_comment; + + pfile_info->disk_num_start = file_info64.disk_num_start; + pfile_info->internal_fa = file_info64.internal_fa; + pfile_info->external_fa = file_info64.external_fa; + + pfile_info->tmu_date = file_info64.tmu_date, + + + pfile_info->compressed_size = (uLong)file_info64.compressed_size; + pfile_info->uncompressed_size = (uLong)file_info64.uncompressed_size; + + } + return err; +} +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ +extern int ZEXPORT unzGoToFirstFile (unzFile file) +{ + int err=UNZ_OK; + unz64_s* s; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + s->pos_in_central_dir=s->offset_central_dir; + s->num_file=0; + err=unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ +extern int ZEXPORT unzGoToNextFile (unzFile file) +{ + unz64_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + if (s->gi.number_entry != 0xffff) /* 2^16 files overflow hack */ + if (s->num_file+1==s->gi.number_entry) + return UNZ_END_OF_LIST_OF_FILE; + + s->pos_in_central_dir += SIZECENTRALDIRITEM + s->cur_file_info.size_filename + + s->cur_file_info.size_file_extra + s->cur_file_info.size_file_comment ; + s->num_file++; + err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + + +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzipStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ +extern int ZEXPORT unzLocateFile (unzFile file, const char *szFileName, int iCaseSensitivity) +{ + unz64_s* s; + int err; + + /* We remember the 'current' position in the file so that we can jump + * back there if we fail. + */ + unz_file_info64 cur_file_infoSaved; + unz_file_info64_internal cur_file_info_internalSaved; + ZPOS64_T num_fileSaved; + ZPOS64_T pos_in_central_dirSaved; + + + if (file==NULL) + return UNZ_PARAMERROR; + + if (strlen(szFileName)>=UNZ_MAXFILENAMEINZIP) + return UNZ_PARAMERROR; + + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + /* Save the current state */ + num_fileSaved = s->num_file; + pos_in_central_dirSaved = s->pos_in_central_dir; + cur_file_infoSaved = s->cur_file_info; + cur_file_info_internalSaved = s->cur_file_info_internal; + + err = unzGoToFirstFile(file); + + while (err == UNZ_OK) + { + char szCurrentFileName[UNZ_MAXFILENAMEINZIP+1]; + err = unzGetCurrentFileInfo64(file,NULL, + szCurrentFileName,sizeof(szCurrentFileName)-1, + NULL,0,NULL,0); + if (err == UNZ_OK) + { + if (unzStringFileNameCompare(szCurrentFileName, + szFileName,iCaseSensitivity)==0) + return UNZ_OK; + err = unzGoToNextFile(file); + } + } + + /* We failed, so restore the state of the 'current file' to where we + * were. + */ + s->num_file = num_fileSaved ; + s->pos_in_central_dir = pos_in_central_dirSaved ; + s->cur_file_info = cur_file_infoSaved; + s->cur_file_info_internal = cur_file_info_internalSaved; + return err; +} + + +/* +/////////////////////////////////////////// +// Contributed by Ryan Haksi (mailto://cryogen@infoserve.net) +// I need random access +// +// Further optimization could be realized by adding an ability +// to cache the directory in memory. The goal being a single +// comprehensive file read to put the file I need in a memory. +*/ + +/* +typedef struct unz_file_pos_s +{ + ZPOS64_T pos_in_zip_directory; // offset in file + ZPOS64_T num_of_file; // # of file +} unz_file_pos; +*/ + +extern int ZEXPORT unzGetFilePos64(unzFile file, unz64_file_pos* file_pos) +{ + unz64_s* s; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_END_OF_LIST_OF_FILE; + + file_pos->pos_in_zip_directory = s->pos_in_central_dir; + file_pos->num_of_file = s->num_file; + + return UNZ_OK; +} + +extern int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos) +{ + unz64_file_pos file_pos64; + int err = unzGetFilePos64(file,&file_pos64); + if (err==UNZ_OK) + { + file_pos->pos_in_zip_directory = (uLong)file_pos64.pos_in_zip_directory; + file_pos->num_of_file = (uLong)file_pos64.num_of_file; + } + return err; +} + +extern int ZEXPORT unzGoToFilePos64(unzFile file, const unz64_file_pos* file_pos) +{ + unz64_s* s; + int err; + + if (file==NULL || file_pos==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + + /* jump to the right spot */ + s->pos_in_central_dir = file_pos->pos_in_zip_directory; + s->num_file = file_pos->num_of_file; + + /* set the current file */ + err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + /* return results */ + s->current_file_ok = (err == UNZ_OK); + return err; +} + +extern int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos) +{ + unz64_file_pos file_pos64; + if (file_pos == NULL) + return UNZ_PARAMERROR; + + file_pos64.pos_in_zip_directory = file_pos->pos_in_zip_directory; + file_pos64.num_of_file = file_pos->num_of_file; + return unzGoToFilePos64(file,&file_pos64); +} + +/* +// Unzip Helper Functions - should be here? +/////////////////////////////////////////// +*/ + +/* + Read the local header of the current zipfile + Check the coherency of the local header and info in the end of central + directory about this file + store in *piSizeVar the size of extra info in local header + (filename and size of extra field data) +*/ +local int unz64local_CheckCurrentFileCoherencyHeader (unz64_s* s, uInt* piSizeVar, + ZPOS64_T * poffset_local_extrafield, + uInt * psize_local_extrafield) +{ + uLong uMagic,uData,uFlags; + uLong size_filename; + uLong size_extra_field; + int err=UNZ_OK; + + *piSizeVar = 0; + *poffset_local_extrafield = 0; + *psize_local_extrafield = 0; + + if (ZSEEK64(s->z_filefunc, s->filestream,s->cur_file_info_internal.offset_curfile + + s->byte_before_the_zipfile,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + + if (err==UNZ_OK) + { + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uMagic) != UNZ_OK) + err=UNZ_ERRNO; + else if (uMagic!=0x04034b50) + err=UNZ_BADZIPFILE; + } + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; +/* + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.wVersion)) + err=UNZ_BADZIPFILE; +*/ + if (unz64local_getShort(&s->z_filefunc, s->filestream,&uFlags) != UNZ_OK) + err=UNZ_ERRNO; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.compression_method)) + err=UNZ_BADZIPFILE; + + if ((err==UNZ_OK) && (s->cur_file_info.compression_method!=0) && +/* #ifdef HAVE_BZIP2 */ + (s->cur_file_info.compression_method!=Z_BZIP2ED) && +/* #endif */ + (s->cur_file_info.compression_method!=Z_DEFLATED)) + err=UNZ_BADZIPFILE; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* date/time */ + err=UNZ_ERRNO; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* crc */ + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (uData!=s->cur_file_info.crc) && ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size compr */ + err=UNZ_ERRNO; + else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.compressed_size) && ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unz64local_getLong(&s->z_filefunc, s->filestream,&uData) != UNZ_OK) /* size uncompr */ + err=UNZ_ERRNO; + else if (uData != 0xFFFFFFFF && (err==UNZ_OK) && (uData!=s->cur_file_info.uncompressed_size) && ((uFlags & 8)==0)) + err=UNZ_BADZIPFILE; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_filename) != UNZ_OK) + err=UNZ_ERRNO; + else if ((err==UNZ_OK) && (size_filename!=s->cur_file_info.size_filename)) + err=UNZ_BADZIPFILE; + + *piSizeVar += (uInt)size_filename; + + if (unz64local_getShort(&s->z_filefunc, s->filestream,&size_extra_field) != UNZ_OK) + err=UNZ_ERRNO; + *poffset_local_extrafield= s->cur_file_info_internal.offset_curfile + + SIZEZIPLOCALHEADER + size_filename; + *psize_local_extrafield = (uInt)size_extra_field; + + *piSizeVar += (uInt)size_extra_field; + + return err; +} + +/* + Open for reading data the current file in the zipfile. + If there is no error and the file is opened, the return value is UNZ_OK. +*/ +extern int ZEXPORT unzOpenCurrentFile3 (unzFile file, int* method, + int* level, int raw, const char* password) +{ + int err=UNZ_OK; + uInt iSizeVar; + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + ZPOS64_T offset_local_extrafield; /* offset of the local extra field */ + uInt size_local_extrafield; /* size of the local extra field */ +# ifndef NOUNCRYPT + char source[12]; +# else + if (password != NULL) + return UNZ_PARAMERROR; +# endif + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return UNZ_PARAMERROR; + + if (s->pfile_in_zip_read != NULL) + unzCloseCurrentFile(file); + + if (unz64local_CheckCurrentFileCoherencyHeader(s,&iSizeVar, &offset_local_extrafield,&size_local_extrafield)!=UNZ_OK) + return UNZ_BADZIPFILE; + + pfile_in_zip_read_info = (file_in_zip64_read_info_s*)ALLOC(sizeof(file_in_zip64_read_info_s)); + if (pfile_in_zip_read_info==NULL) + return UNZ_INTERNALERROR; + + pfile_in_zip_read_info->read_buffer=(char*)ALLOC(UNZ_BUFSIZE); + pfile_in_zip_read_info->offset_local_extrafield = offset_local_extrafield; + pfile_in_zip_read_info->size_local_extrafield = size_local_extrafield; + pfile_in_zip_read_info->pos_local_extrafield=0; + pfile_in_zip_read_info->raw=raw; + + if (pfile_in_zip_read_info->read_buffer==NULL) + { + TRYFREE(pfile_in_zip_read_info); + return UNZ_INTERNALERROR; + } + + pfile_in_zip_read_info->stream_initialised=0; + + if (method!=NULL) + *method = (int)s->cur_file_info.compression_method; + + if (level!=NULL) + { + *level = 6; + switch (s->cur_file_info.flag & 0x06) + { + case 6 : *level = 1; break; + case 4 : *level = 2; break; + case 2 : *level = 9; break; + } + } + + if ((s->cur_file_info.compression_method!=0) && +/* #ifdef HAVE_BZIP2 */ + (s->cur_file_info.compression_method!=Z_BZIP2ED) && +/* #endif */ + (s->cur_file_info.compression_method!=Z_DEFLATED)) + + err=UNZ_BADZIPFILE; + + pfile_in_zip_read_info->crc32_wait=s->cur_file_info.crc; + pfile_in_zip_read_info->crc32=0; + pfile_in_zip_read_info->total_out_64=0; + pfile_in_zip_read_info->compression_method = s->cur_file_info.compression_method; + pfile_in_zip_read_info->filestream=s->filestream; + pfile_in_zip_read_info->z_filefunc=s->z_filefunc; + pfile_in_zip_read_info->byte_before_the_zipfile=s->byte_before_the_zipfile; + + pfile_in_zip_read_info->stream.total_out = 0; + + if ((s->cur_file_info.compression_method==Z_BZIP2ED) && (!raw)) + { +#ifdef HAVE_BZIP2 + pfile_in_zip_read_info->bstream.bzalloc = (void *(*) (void *, int, int))0; + pfile_in_zip_read_info->bstream.bzfree = (free_func)0; + pfile_in_zip_read_info->bstream.opaque = (voidpf)0; + pfile_in_zip_read_info->bstream.state = (voidpf)0; + + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + pfile_in_zip_read_info->stream.next_in = (voidpf)0; + pfile_in_zip_read_info->stream.avail_in = 0; + + err=BZ2_bzDecompressInit(&pfile_in_zip_read_info->bstream, 0, 0); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=Z_BZIP2ED; + else + { + TRYFREE(pfile_in_zip_read_info); + return err; + } +#else + pfile_in_zip_read_info->raw=1; +#endif + } + else if ((s->cur_file_info.compression_method==Z_DEFLATED) && (!raw)) + { + pfile_in_zip_read_info->stream.zalloc = (alloc_func)0; + pfile_in_zip_read_info->stream.zfree = (free_func)0; + pfile_in_zip_read_info->stream.opaque = (voidpf)0; + pfile_in_zip_read_info->stream.next_in = 0; + pfile_in_zip_read_info->stream.avail_in = 0; + + err=inflateInit2(&pfile_in_zip_read_info->stream, -MAX_WBITS); + if (err == Z_OK) + pfile_in_zip_read_info->stream_initialised=Z_DEFLATED; + else + { + TRYFREE(pfile_in_zip_read_info); + return err; + } + /* windowBits is passed < 0 to tell that there is no zlib header. + * Note that in this case inflate *requires* an extra "dummy" byte + * after the compressed stream in order to complete decompression and + * return Z_STREAM_END. + * In unzip, i don't wait absolutely Z_STREAM_END because I known the + * size of both compressed and uncompressed data + */ + } + pfile_in_zip_read_info->rest_read_compressed = + s->cur_file_info.compressed_size ; + pfile_in_zip_read_info->rest_read_uncompressed = + s->cur_file_info.uncompressed_size ; + + + pfile_in_zip_read_info->pos_in_zipfile = + s->cur_file_info_internal.offset_curfile + SIZEZIPLOCALHEADER + + iSizeVar; + + pfile_in_zip_read_info->stream.avail_in = (uInt)0; + + s->pfile_in_zip_read = pfile_in_zip_read_info; + s->encrypted = 0; + +# ifndef NOUNCRYPT + if (password != NULL) + { + int i; + s->pcrc_32_tab = get_crc_table(); + init_keys(password,s->keys,s->pcrc_32_tab); + if (ZSEEK64(s->z_filefunc, s->filestream, + s->pfile_in_zip_read->pos_in_zipfile + + s->pfile_in_zip_read->byte_before_the_zipfile, + SEEK_SET)!=0) + return UNZ_INTERNALERROR; + if(ZREAD64(s->z_filefunc, s->filestream,source, 12)<12) + return UNZ_INTERNALERROR; + + for (i = 0; i<12; i++) + zdecode(s->keys,s->pcrc_32_tab,source[i]); + + s->pfile_in_zip_read->pos_in_zipfile+=12; + s->encrypted=1; + } +# endif + + + return UNZ_OK; +} + +extern int ZEXPORT unzOpenCurrentFile (unzFile file) +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, NULL); +} + +extern int ZEXPORT unzOpenCurrentFilePassword (unzFile file, const char* password) +{ + return unzOpenCurrentFile3(file, NULL, NULL, 0, password); +} + +extern int ZEXPORT unzOpenCurrentFile2 (unzFile file, int* method, int* level, int raw) +{ + return unzOpenCurrentFile3(file, method, level, raw, NULL); +} + +/** Addition for GDAL : START */ + +extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64( unzFile file) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + s=(unz64_s*)file; + if (file==NULL) + return 0; //UNZ_PARAMERROR; + pfile_in_zip_read_info=s->pfile_in_zip_read; + if (pfile_in_zip_read_info==NULL) + return 0; //UNZ_PARAMERROR; + return pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile; +} + +/** Addition for GDAL : END */ + +/* + Read bytes from the current file. + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ +extern int ZEXPORT unzReadCurrentFile (unzFile file, voidp buf, unsigned len) +{ + int err=UNZ_OK; + uInt iRead = 0; + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->read_buffer == NULL)) + return UNZ_END_OF_LIST_OF_FILE; + if (len==0) + return 0; + + pfile_in_zip_read_info->stream.next_out = (Bytef*)buf; + + pfile_in_zip_read_info->stream.avail_out = (uInt)len; + + if ((len>pfile_in_zip_read_info->rest_read_uncompressed) && + (!(pfile_in_zip_read_info->raw))) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_uncompressed; + + if ((len>pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in) && + (pfile_in_zip_read_info->raw)) + pfile_in_zip_read_info->stream.avail_out = + (uInt)pfile_in_zip_read_info->rest_read_compressed+ + pfile_in_zip_read_info->stream.avail_in; + + while (pfile_in_zip_read_info->stream.avail_out>0) + { + if ((pfile_in_zip_read_info->stream.avail_in==0) && + (pfile_in_zip_read_info->rest_read_compressed>0)) + { + uInt uReadThis = UNZ_BUFSIZE; + if (pfile_in_zip_read_info->rest_read_compressedrest_read_compressed; + if (uReadThis == 0) + return UNZ_EOF; + if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->pos_in_zipfile + + pfile_in_zip_read_info->byte_before_the_zipfile, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + if (ZREAD64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->read_buffer, + uReadThis)!=uReadThis) + return UNZ_ERRNO; + + +# ifndef NOUNCRYPT + if(s->encrypted) + { + uInt i; + for(i=0;iread_buffer[i] = + zdecode(s->keys,s->pcrc_32_tab, + pfile_in_zip_read_info->read_buffer[i]); + } +# endif + + + pfile_in_zip_read_info->pos_in_zipfile += uReadThis; + + pfile_in_zip_read_info->rest_read_compressed-=uReadThis; + + pfile_in_zip_read_info->stream.next_in = + (Bytef*)pfile_in_zip_read_info->read_buffer; + pfile_in_zip_read_info->stream.avail_in = (uInt)uReadThis; + } + + if ((pfile_in_zip_read_info->compression_method==0) || (pfile_in_zip_read_info->raw)) + { + uInt uDoCopy,i ; + + if ((pfile_in_zip_read_info->stream.avail_in == 0) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + return (iRead==0) ? UNZ_EOF : iRead; + + if (pfile_in_zip_read_info->stream.avail_out < + pfile_in_zip_read_info->stream.avail_in) + uDoCopy = pfile_in_zip_read_info->stream.avail_out ; + else + uDoCopy = pfile_in_zip_read_info->stream.avail_in ; + + for (i=0;istream.next_out+i) = + *(pfile_in_zip_read_info->stream.next_in+i); + + pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uDoCopy; + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32, + pfile_in_zip_read_info->stream.next_out, + uDoCopy); + pfile_in_zip_read_info->rest_read_uncompressed-=uDoCopy; + pfile_in_zip_read_info->stream.avail_in -= uDoCopy; + pfile_in_zip_read_info->stream.avail_out -= uDoCopy; + pfile_in_zip_read_info->stream.next_out += uDoCopy; + pfile_in_zip_read_info->stream.next_in += uDoCopy; + pfile_in_zip_read_info->stream.total_out += uDoCopy; + iRead += uDoCopy; + } + else if (pfile_in_zip_read_info->compression_method==Z_BZIP2ED) + { +#ifdef HAVE_BZIP2 + uLong uTotalOutBefore,uTotalOutAfter; + const Bytef *bufBefore; + uLong uOutThis; + + pfile_in_zip_read_info->bstream.next_in = (char*)pfile_in_zip_read_info->stream.next_in; + pfile_in_zip_read_info->bstream.avail_in = pfile_in_zip_read_info->stream.avail_in; + pfile_in_zip_read_info->bstream.total_in_lo32 = pfile_in_zip_read_info->stream.total_in; + pfile_in_zip_read_info->bstream.total_in_hi32 = 0; + pfile_in_zip_read_info->bstream.next_out = (char*)pfile_in_zip_read_info->stream.next_out; + pfile_in_zip_read_info->bstream.avail_out = pfile_in_zip_read_info->stream.avail_out; + pfile_in_zip_read_info->bstream.total_out_lo32 = pfile_in_zip_read_info->stream.total_out; + pfile_in_zip_read_info->bstream.total_out_hi32 = 0; + + uTotalOutBefore = pfile_in_zip_read_info->bstream.total_out_lo32; + bufBefore = (const Bytef *)pfile_in_zip_read_info->bstream.next_out; + + err=BZ2_bzDecompress(&pfile_in_zip_read_info->bstream); + + uTotalOutAfter = pfile_in_zip_read_info->bstream.total_out_lo32; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; + + pfile_in_zip_read_info->crc32 = crc32(pfile_in_zip_read_info->crc32,bufBefore, (uInt)(uOutThis)); + pfile_in_zip_read_info->rest_read_uncompressed -= uOutThis; + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + pfile_in_zip_read_info->stream.next_in = (Bytef*)pfile_in_zip_read_info->bstream.next_in; + pfile_in_zip_read_info->stream.avail_in = pfile_in_zip_read_info->bstream.avail_in; + pfile_in_zip_read_info->stream.total_in = pfile_in_zip_read_info->bstream.total_in_lo32; + pfile_in_zip_read_info->stream.next_out = (Bytef*)pfile_in_zip_read_info->bstream.next_out; + pfile_in_zip_read_info->stream.avail_out = pfile_in_zip_read_info->bstream.avail_out; + pfile_in_zip_read_info->stream.total_out = pfile_in_zip_read_info->bstream.total_out_lo32; + + if (err==BZ_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=BZ_OK) + break; +#endif + } // end Z_BZIP2ED + else + { + ZPOS64_T uTotalOutBefore,uTotalOutAfter; + const Bytef *bufBefore; + ZPOS64_T uOutThis; + int flush=Z_SYNC_FLUSH; + + uTotalOutBefore = pfile_in_zip_read_info->stream.total_out; + bufBefore = pfile_in_zip_read_info->stream.next_out; + + /* + if ((pfile_in_zip_read_info->rest_read_uncompressed == + pfile_in_zip_read_info->stream.avail_out) && + (pfile_in_zip_read_info->rest_read_compressed == 0)) + flush = Z_FINISH; + */ + err=inflate(&pfile_in_zip_read_info->stream,flush); + + if ((err>=0) && (pfile_in_zip_read_info->stream.msg!=NULL)) + err = Z_DATA_ERROR; + + uTotalOutAfter = pfile_in_zip_read_info->stream.total_out; + uOutThis = uTotalOutAfter-uTotalOutBefore; + + pfile_in_zip_read_info->total_out_64 = pfile_in_zip_read_info->total_out_64 + uOutThis; + + pfile_in_zip_read_info->crc32 = + crc32(pfile_in_zip_read_info->crc32,bufBefore, + (uInt)(uOutThis)); + + pfile_in_zip_read_info->rest_read_uncompressed -= + uOutThis; + + iRead += (uInt)(uTotalOutAfter - uTotalOutBefore); + + if (err==Z_STREAM_END) + return (iRead==0) ? UNZ_EOF : iRead; + if (err!=Z_OK) + break; + } + } + + if (err==Z_OK) + return iRead; + return err; +} + + +/* + Give the current position in uncompressed data +*/ +extern z_off_t ZEXPORT unztell (unzFile file) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + return (z_off_t)pfile_in_zip_read_info->stream.total_out; +} + +extern ZPOS64_T ZEXPORT unztell64 (unzFile file) +{ + + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return (ZPOS64_T)-1; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return (ZPOS64_T)-1; + + return pfile_in_zip_read_info->total_out_64; +} + + +/* + return 1 if the end of file was reached, 0 elsewhere +*/ +extern int ZEXPORT unzeof (unzFile file) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + if (pfile_in_zip_read_info->rest_read_uncompressed == 0) + return 1; + else + return 0; +} + + + +/* +Read extra field from the current file (opened by unzOpenCurrentFile) +This is the local-header version of the extra field (sometimes, there is +more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field that can be read + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ +extern int ZEXPORT unzGetLocalExtrafield (unzFile file, voidp buf, unsigned len) +{ + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + uInt read_now; + ZPOS64_T size_to_read; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + size_to_read = (pfile_in_zip_read_info->size_local_extrafield - + pfile_in_zip_read_info->pos_local_extrafield); + + if (buf==NULL) + return (int)size_to_read; + + if (len>size_to_read) + read_now = (uInt)size_to_read; + else + read_now = (uInt)len ; + + if (read_now==0) + return 0; + + if (ZSEEK64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + pfile_in_zip_read_info->offset_local_extrafield + + pfile_in_zip_read_info->pos_local_extrafield, + ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (ZREAD64(pfile_in_zip_read_info->z_filefunc, + pfile_in_zip_read_info->filestream, + buf,read_now)!=read_now) + return UNZ_ERRNO; + + return (int)read_now; +} + +/* + Close the file in zip opened with unzipOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ +extern int ZEXPORT unzCloseCurrentFile (unzFile file) +{ + int err=UNZ_OK; + + unz64_s* s; + file_in_zip64_read_info_s* pfile_in_zip_read_info; + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + pfile_in_zip_read_info=s->pfile_in_zip_read; + + if (pfile_in_zip_read_info==NULL) + return UNZ_PARAMERROR; + + + if ((pfile_in_zip_read_info->rest_read_uncompressed == 0) && + (!pfile_in_zip_read_info->raw)) + { + if (pfile_in_zip_read_info->crc32 != pfile_in_zip_read_info->crc32_wait) + err=UNZ_CRCERROR; + } + + + TRYFREE(pfile_in_zip_read_info->read_buffer); + pfile_in_zip_read_info->read_buffer = NULL; + if (pfile_in_zip_read_info->stream_initialised == Z_DEFLATED) + inflateEnd(&pfile_in_zip_read_info->stream); +#ifdef HAVE_BZIP2 + else if (pfile_in_zip_read_info->stream_initialised == Z_BZIP2ED) + BZ2_bzDecompressEnd(&pfile_in_zip_read_info->bstream); +#endif + + + pfile_in_zip_read_info->stream_initialised = 0; + TRYFREE(pfile_in_zip_read_info); + + s->pfile_in_zip_read=NULL; + + return err; +} + + +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ +extern int ZEXPORT unzGetGlobalComment (unzFile file, char * szComment, uLong uSizeBuf) +{ + unz64_s* s; + uLong uReadThis ; + if (file==NULL) + return (int)UNZ_PARAMERROR; + s=(unz64_s*)file; + + uReadThis = uSizeBuf; + if (uReadThis>s->gi.size_comment) + uReadThis = s->gi.size_comment; + + if (ZSEEK64(s->z_filefunc,s->filestream,s->central_pos+22,ZLIB_FILEFUNC_SEEK_SET)!=0) + return UNZ_ERRNO; + + if (uReadThis>0) + { + *szComment='\0'; + if (ZREAD64(s->z_filefunc,s->filestream,szComment,uReadThis)!=uReadThis) + return UNZ_ERRNO; + } + + if ((szComment != NULL) && (uSizeBuf > s->gi.size_comment)) + *(szComment+s->gi.size_comment)='\0'; + return (int)uReadThis; +} + +/* Additions by RX '2004 */ +extern ZPOS64_T ZEXPORT unzGetOffset64(unzFile file) +{ + unz64_s* s; + + if (file==NULL) + return 0; //UNZ_PARAMERROR; + s=(unz64_s*)file; + if (!s->current_file_ok) + return 0; + if (s->gi.number_entry != 0 && s->gi.number_entry != 0xffff) + if (s->num_file==s->gi.number_entry) + return 0; + return s->pos_in_central_dir; +} + +extern uLong ZEXPORT unzGetOffset (unzFile file) +{ + ZPOS64_T offset64; + + if (file==NULL) + return 0; //UNZ_PARAMERROR; + offset64 = unzGetOffset64(file); + return (uLong)offset64; +} + +extern int ZEXPORT unzSetOffset64(unzFile file, ZPOS64_T pos) +{ + unz64_s* s; + int err; + + if (file==NULL) + return UNZ_PARAMERROR; + s=(unz64_s*)file; + + s->pos_in_central_dir = pos; + s->num_file = s->gi.number_entry; /* hack */ + err = unz64local_GetCurrentFileInfoInternal(file,&s->cur_file_info, + &s->cur_file_info_internal, + NULL,0,NULL,0,NULL,0); + s->current_file_ok = (err == UNZ_OK); + return err; +} + +extern int ZEXPORT unzSetOffset (unzFile file, uLong pos) +{ + return unzSetOffset64(file,pos); +} diff --git a/Pkgs/unzip.h b/Pkgs/unzip.h new file mode 100644 index 0000000..3183968 --- /dev/null +++ b/Pkgs/unzip.h @@ -0,0 +1,437 @@ +/* unzip.h -- IO for uncompress .zip files using zlib + Version 1.1, February 14h, 2010 + part of the MiniZip project - ( http://www.winimage.com/zLibDll/minizip.html ) + + Copyright (C) 1998-2010 Gilles Vollant (minizip) ( http://www.winimage.com/zLibDll/minizip.html ) + + Modifications of Unzip for Zip64 + Copyright (C) 2007-2008 Even Rouault + + Modifications for Zip64 support on both zip and unzip + Copyright (C) 2009-2010 Mathias Svensson ( http://result42.com ) + + For more info read MiniZip_info.txt + + --------------------------------------------------------------------------------- + + Condition of use and distribution are the same than zlib : + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + --------------------------------------------------------------------------------- + + Changes + + See header of unzip64.c + +*/ + +#ifndef _unz64_H +#define _unz64_H + +#ifdef __cplusplus +extern "C" { +#endif + +#ifndef _ZLIB_H +#include "zlib.h" +#endif + +#ifndef _ZLIBIOAPI_H +#include "ioapi.h" +#endif + +#ifdef HAVE_BZIP2 +#include "bzlib.h" +#endif + +#define Z_BZIP2ED 12 + +#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP) +/* like the STRICT of WIN32, we define a pointer that cannot be converted + from (void*) without cast */ +typedef struct TagunzFile__ { int unused; } unzFile__; +typedef unzFile__ *unzFile; +#else +typedef voidp unzFile; +#endif + + +#define UNZ_OK (0) +#define UNZ_END_OF_LIST_OF_FILE (-100) +#define UNZ_ERRNO (Z_ERRNO) +#define UNZ_EOF (0) +#define UNZ_PARAMERROR (-102) +#define UNZ_BADZIPFILE (-103) +#define UNZ_INTERNALERROR (-104) +#define UNZ_CRCERROR (-105) + +/* tm_unz contain date/time info */ +typedef struct tm_unz_s +{ + uInt tm_sec; /* seconds after the minute - [0,59] */ + uInt tm_min; /* minutes after the hour - [0,59] */ + uInt tm_hour; /* hours since midnight - [0,23] */ + uInt tm_mday; /* day of the month - [1,31] */ + uInt tm_mon; /* months since January - [0,11] */ + uInt tm_year; /* years - [1980..2044] */ +} tm_unz; + +/* unz_global_info structure contain global data about the ZIPfile + These data comes from the end of central dir */ +typedef struct unz_global_info64_s +{ + ZPOS64_T number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info64; + +typedef struct unz_global_info_s +{ + uLong number_entry; /* total number of entries in + the central dir on this disk */ + uLong size_comment; /* size of the global comment of the zipfile */ +} unz_global_info; + +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_info64_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + ZPOS64_T compressed_size; /* compressed size 8 bytes */ + ZPOS64_T uncompressed_size; /* uncompressed size 8 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info64; + +typedef struct unz_file_info_s +{ + uLong version; /* version made by 2 bytes */ + uLong version_needed; /* version needed to extract 2 bytes */ + uLong flag; /* general purpose bit flag 2 bytes */ + uLong compression_method; /* compression method 2 bytes */ + uLong dosDate; /* last mod file date in Dos fmt 4 bytes */ + uLong crc; /* crc-32 4 bytes */ + uLong compressed_size; /* compressed size 4 bytes */ + uLong uncompressed_size; /* uncompressed size 4 bytes */ + uLong size_filename; /* filename length 2 bytes */ + uLong size_file_extra; /* extra field length 2 bytes */ + uLong size_file_comment; /* file comment length 2 bytes */ + + uLong disk_num_start; /* disk number start 2 bytes */ + uLong internal_fa; /* internal file attributes 2 bytes */ + uLong external_fa; /* external file attributes 4 bytes */ + + tm_unz tmu_date; +} unz_file_info; + +extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1, + const char* fileName2, + int iCaseSensitivity)); +/* + Compare two filename (fileName1,fileName2). + If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp) + If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi + or strcasecmp) + If iCaseSenisivity = 0, case sensitivity is defaut of your operating system + (like 1 on Unix, 2 on Windows) +*/ + + +extern unzFile ZEXPORT unzOpen OF((const char *path)); +extern unzFile ZEXPORT unzOpen64 OF((const void *path)); +/* + Open a Zip file. path contain the full pathname (by example, + on a Windows XP computer "c:\\zlib\\zlib113.zip" or on an Unix computer + "zlib/zlib113.zip". + If the zipfile cannot be opened (file don't exist or in not valid), the + return value is NULL. + Else, the return value is a unzFile Handle, usable with other function + of this unzip package. + the "64" function take a const void* pointer, because the path is just the + value passed to the open64_file_func callback. + Under Windows, if UNICODE is defined, using fill_fopen64_filefunc, the path + is a pointer to a wide unicode string (LPCTSTR is LPCWSTR), so const char* + does not describe the reality +*/ + + +extern unzFile ZEXPORT unzOpen2 OF((const char *path, + zlib_filefunc_def* pzlib_filefunc_def)); +/* + Open a Zip file, like unzOpen, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +extern unzFile ZEXPORT unzOpen2_64 OF((const void *path, + zlib_filefunc64_def* pzlib_filefunc_def)); +/* + Open a Zip file, like unz64Open, but provide a set of file low level API + for read/write the zip file (see ioapi.h) +*/ + +extern int ZEXPORT unzClose OF((unzFile file)); +/* + Close a ZipFile opened with unzipOpen. + If there is files inside the .Zip opened with unzOpenCurrentFile (see later), + these files MUST be closed with unzipCloseCurrentFile before call unzipClose. + return UNZ_OK if there is no problem. */ + +extern int ZEXPORT unzGetGlobalInfo OF((unzFile file, + unz_global_info *pglobal_info)); + +extern int ZEXPORT unzGetGlobalInfo64 OF((unzFile file, + unz_global_info64 *pglobal_info)); +/* + Write info about the ZipFile in the *pglobal_info structure. + No preparation of the structure is needed + return UNZ_OK if there is no problem. */ + + +extern int ZEXPORT unzGetGlobalComment OF((unzFile file, + char *szComment, + uLong uSizeBuf)); +/* + Get the global comment string of the ZipFile, in the szComment buffer. + uSizeBuf is the size of the szComment buffer. + return the number of byte copied or an error code <0 +*/ + + +/***************************************************************************/ +/* Unzip package allow you browse the directory of the zipfile */ + +extern int ZEXPORT unzGoToFirstFile OF((unzFile file)); +/* + Set the current file of the zipfile to the first file. + return UNZ_OK if there is no problem +*/ + +extern int ZEXPORT unzGoToNextFile OF((unzFile file)); +/* + Set the current file of the zipfile to the next file. + return UNZ_OK if there is no problem + return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest. +*/ + +extern int ZEXPORT unzLocateFile OF((unzFile file, + const char *szFileName, + int iCaseSensitivity)); +/* + Try locate the file szFileName in the zipfile. + For the iCaseSensitivity signification, see unzStringFileNameCompare + + return value : + UNZ_OK if the file is found. It becomes the current file. + UNZ_END_OF_LIST_OF_FILE if the file is not found +*/ + + +/* ****************************************** */ +/* Ryan supplied functions */ +/* unz_file_info contain information about a file in the zipfile */ +typedef struct unz_file_pos_s +{ + uLong pos_in_zip_directory; /* offset in zip file directory */ + uLong num_of_file; /* # of file */ +} unz_file_pos; + +extern int ZEXPORT unzGetFilePos( + unzFile file, + unz_file_pos* file_pos); + +extern int ZEXPORT unzGoToFilePos( + unzFile file, + unz_file_pos* file_pos); + +typedef struct unz64_file_pos_s +{ + ZPOS64_T pos_in_zip_directory; /* offset in zip file directory */ + ZPOS64_T num_of_file; /* # of file */ +} unz64_file_pos; + +extern int ZEXPORT unzGetFilePos64( + unzFile file, + unz64_file_pos* file_pos); + +extern int ZEXPORT unzGoToFilePos64( + unzFile file, + const unz64_file_pos* file_pos); + +/* ****************************************** */ + +extern int ZEXPORT unzGetCurrentFileInfo64 OF((unzFile file, + unz_file_info64 *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); + +extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file, + unz_file_info *pfile_info, + char *szFileName, + uLong fileNameBufferSize, + void *extraField, + uLong extraFieldBufferSize, + char *szComment, + uLong commentBufferSize)); +/* + Get Info about the current file + if pfile_info!=NULL, the *pfile_info structure will contain somes info about + the current file + if szFileName!=NULL, the filemane string will be copied in szFileName + (fileNameBufferSize is the size of the buffer) + if extraField!=NULL, the extra field information will be copied in extraField + (extraFieldBufferSize is the size of the buffer). + This is the Central-header version of the extra field + if szComment!=NULL, the comment string of the file will be copied in szComment + (commentBufferSize is the size of the buffer) +*/ + + +/** Addition for GDAL : START */ + +extern ZPOS64_T ZEXPORT unzGetCurrentFileZStreamPos64 OF((unzFile file)); + +/** Addition for GDAL : END */ + + +/***************************************************************************/ +/* for reading the content of the current zipfile, you can open it, read data + from it, and close it (you can close it before reading all the file) + */ + +extern int ZEXPORT unzOpenCurrentFile OF((unzFile file)); +/* + Open for reading data the current file in the zipfile. + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFilePassword OF((unzFile file, + const char* password)); +/* + Open for reading data the current file in the zipfile. + password is a crypting password + If there is no error, the return value is UNZ_OK. +*/ + +extern int ZEXPORT unzOpenCurrentFile2 OF((unzFile file, + int* method, + int* level, + int raw)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + +extern int ZEXPORT unzOpenCurrentFile3 OF((unzFile file, + int* method, + int* level, + int raw, + const char* password)); +/* + Same than unzOpenCurrentFile, but open for read raw the file (not uncompress) + if raw==1 + *method will receive method of compression, *level will receive level of + compression + note : you can set level parameter as NULL (if you did not want known level, + but you CANNOT set method parameter as NULL +*/ + + +extern int ZEXPORT unzCloseCurrentFile OF((unzFile file)); +/* + Close the file in zip opened with unzOpenCurrentFile + Return UNZ_CRCERROR if all the file was read but the CRC is not good +*/ + +extern int ZEXPORT unzReadCurrentFile OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read bytes from the current file (opened by unzOpenCurrentFile) + buf contain buffer where data must be copied + len the size of buf. + + return the number of byte copied if somes bytes are copied + return 0 if the end of file was reached + return <0 with error code if there is an error + (UNZ_ERRNO for IO error, or zLib error for uncompress error) +*/ + +extern z_off_t ZEXPORT unztell OF((unzFile file)); + +extern ZPOS64_T ZEXPORT unztell64 OF((unzFile file)); +/* + Give the current position in uncompressed data +*/ + +extern int ZEXPORT unzeof OF((unzFile file)); +/* + return 1 if the end of file was reached, 0 elsewhere +*/ + +extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file, + voidp buf, + unsigned len)); +/* + Read extra field from the current file (opened by unzOpenCurrentFile) + This is the local-header version of the extra field (sometimes, there is + more info in the local-header version than in the central-header) + + if buf==NULL, it return the size of the local extra field + + if buf!=NULL, len is the size of the buffer, the extra header is copied in + buf. + the return value is the number of bytes copied in buf, or (if <0) + the error code +*/ + +/***************************************************************************/ + +/* Get the current file offset */ +extern ZPOS64_T ZEXPORT unzGetOffset64 (unzFile file); +extern uLong ZEXPORT unzGetOffset (unzFile file); + +/* Set the current file offset */ +extern int ZEXPORT unzSetOffset64 (unzFile file, ZPOS64_T pos); +extern int ZEXPORT unzSetOffset (unzFile file, uLong pos); + + + +#ifdef __cplusplus +} +#endif + +#endif /* _unz64_H */ diff --git a/Pkgs/wglew.h b/Pkgs/wglew.h new file mode 100644 index 0000000..c3ac01a --- /dev/null +++ b/Pkgs/wglew.h @@ -0,0 +1,1287 @@ +/* +** The OpenGL Extension Wrangler Library +** Copyright (C) 2002-2008, Milan Ikits +** Copyright (C) 2002-2008, Marcelo E. Magallon +** Copyright (C) 2002, Lev Povalahev +** 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. +** * The name of the author may be used to endorse or promote products +** derived from this software without specific prior written permission. +** +** 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 OWNER 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. +*/ + +/* +** Copyright (c) 2007 The Khronos Group Inc. +** +** Permission is hereby granted, free of charge, to any person obtaining a +** copy of this software and/or associated documentation files (the +** "Materials"), to deal in the Materials without restriction, including +** without limitation the rights to use, copy, modify, merge, publish, +** distribute, sublicense, and/or sell copies of the Materials, and to +** permit persons to whom the Materials are furnished to do so, subject to +** the following conditions: +** +** The above copyright notice and this permission notice shall be included +** in all copies or substantial portions of the Materials. +** +** THE MATERIALS ARE 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 THE AUTHORS OR COPYRIGHT HOLDERS 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 +** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. +*/ + +#ifndef __wglew_h__ +#define __wglew_h__ +#define __WGLEW_H__ + +#ifdef __wglext_h_ +#error wglext.h included before wglew.h +#endif + +#define __wglext_h_ + +#if !defined(WINAPI) +# ifndef WIN32_LEAN_AND_MEAN +# define WIN32_LEAN_AND_MEAN 1 +# endif +#include +# undef WIN32_LEAN_AND_MEAN +#endif + +/* + * GLEW_STATIC needs to be set when using the static version. + * GLEW_BUILD is set when building the DLL version. + */ +#ifdef GLEW_STATIC +# define GLEWAPI extern +#else +# ifdef GLEW_BUILD +# define GLEWAPI extern __declspec(dllexport) +# else +# define GLEWAPI extern __declspec(dllimport) +# endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +/* -------------------------- WGL_3DFX_multisample ------------------------- */ + +#ifndef WGL_3DFX_multisample +#define WGL_3DFX_multisample 1 + +#define WGL_SAMPLE_BUFFERS_3DFX 0x2060 +#define WGL_SAMPLES_3DFX 0x2061 + +#define WGLEW_3DFX_multisample WGLEW_GET_VAR(__WGLEW_3DFX_multisample) + +#endif /* WGL_3DFX_multisample */ + +/* ------------------------- WGL_3DL_stereo_control ------------------------ */ + +#ifndef WGL_3DL_stereo_control +#define WGL_3DL_stereo_control 1 + +#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055 +#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056 +#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057 +#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058 + +typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState); + +#define wglSetStereoEmitterState3DL WGLEW_GET_FUN(__wglewSetStereoEmitterState3DL) + +#define WGLEW_3DL_stereo_control WGLEW_GET_VAR(__WGLEW_3DL_stereo_control) + +#endif /* WGL_3DL_stereo_control */ + +/* ------------------------ WGL_AMD_gpu_association ------------------------ */ + +#ifndef WGL_AMD_gpu_association +#define WGL_AMD_gpu_association 1 + +#define WGL_GPU_VENDOR_AMD 0x1F00 +#define WGL_GPU_RENDERER_STRING_AMD 0x1F01 +#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02 +#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2 +#define WGL_GPU_RAM_AMD 0x21A3 +#define WGL_GPU_CLOCK_AMD 0x21A4 +#define WGL_GPU_NUM_PIPES_AMD 0x21A5 +#define WGL_GPU_NUM_SIMD_AMD 0x21A6 +#define WGL_GPU_NUM_RB_AMD 0x21A7 +#define WGL_GPU_NUM_SPI_AMD 0x21A8 + +typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id); +typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int* attribList); +typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc); +typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc); +typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void); +typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT* ids); +typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void* data); +typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc); + +#define wglBlitContextFramebufferAMD WGLEW_GET_FUN(__wglewBlitContextFramebufferAMD) +#define wglCreateAssociatedContextAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAMD) +#define wglCreateAssociatedContextAttribsAMD WGLEW_GET_FUN(__wglewCreateAssociatedContextAttribsAMD) +#define wglDeleteAssociatedContextAMD WGLEW_GET_FUN(__wglewDeleteAssociatedContextAMD) +#define wglGetContextGPUIDAMD WGLEW_GET_FUN(__wglewGetContextGPUIDAMD) +#define wglGetCurrentAssociatedContextAMD WGLEW_GET_FUN(__wglewGetCurrentAssociatedContextAMD) +#define wglGetGPUIDsAMD WGLEW_GET_FUN(__wglewGetGPUIDsAMD) +#define wglGetGPUInfoAMD WGLEW_GET_FUN(__wglewGetGPUInfoAMD) +#define wglMakeAssociatedContextCurrentAMD WGLEW_GET_FUN(__wglewMakeAssociatedContextCurrentAMD) + +#define WGLEW_AMD_gpu_association WGLEW_GET_VAR(__WGLEW_AMD_gpu_association) + +#endif /* WGL_AMD_gpu_association */ + +/* ------------------------- WGL_ARB_buffer_region ------------------------- */ + +#ifndef WGL_ARB_buffer_region +#define WGL_ARB_buffer_region 1 + +#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001 +#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002 +#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004 +#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008 + +typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType); +typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion); +typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc); +typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height); + +#define wglCreateBufferRegionARB WGLEW_GET_FUN(__wglewCreateBufferRegionARB) +#define wglDeleteBufferRegionARB WGLEW_GET_FUN(__wglewDeleteBufferRegionARB) +#define wglRestoreBufferRegionARB WGLEW_GET_FUN(__wglewRestoreBufferRegionARB) +#define wglSaveBufferRegionARB WGLEW_GET_FUN(__wglewSaveBufferRegionARB) + +#define WGLEW_ARB_buffer_region WGLEW_GET_VAR(__WGLEW_ARB_buffer_region) + +#endif /* WGL_ARB_buffer_region */ + +/* ------------------------- WGL_ARB_create_context ------------------------ */ + +#ifndef WGL_ARB_create_context +#define WGL_ARB_create_context 1 + +#define WGL_CONTEXT_DEBUG_BIT_ARB 0x0001 +#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x0002 +#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091 +#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092 +#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093 +#define WGL_CONTEXT_FLAGS_ARB 0x2094 + +typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int* attribList); + +#define wglCreateContextAttribsARB WGLEW_GET_FUN(__wglewCreateContextAttribsARB) + +#define WGLEW_ARB_create_context WGLEW_GET_VAR(__WGLEW_ARB_create_context) + +#endif /* WGL_ARB_create_context */ + +/* --------------------- WGL_ARB_create_context_profile -------------------- */ + +#ifndef WGL_ARB_create_context_profile +#define WGL_ARB_create_context_profile 1 + +#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001 +#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002 +#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126 + +#define WGLEW_ARB_create_context_profile WGLEW_GET_VAR(__WGLEW_ARB_create_context_profile) + +#endif /* WGL_ARB_create_context_profile */ + +/* ------------------- WGL_ARB_create_context_robustness ------------------- */ + +#ifndef WGL_ARB_create_context_robustness +#define WGL_ARB_create_context_robustness 1 + +#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004 +#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252 +#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256 +#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261 + +#define WGLEW_ARB_create_context_robustness WGLEW_GET_VAR(__WGLEW_ARB_create_context_robustness) + +#endif /* WGL_ARB_create_context_robustness */ + +/* ----------------------- WGL_ARB_extensions_string ----------------------- */ + +#ifndef WGL_ARB_extensions_string +#define WGL_ARB_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc); + +#define wglGetExtensionsStringARB WGLEW_GET_FUN(__wglewGetExtensionsStringARB) + +#define WGLEW_ARB_extensions_string WGLEW_GET_VAR(__WGLEW_ARB_extensions_string) + +#endif /* WGL_ARB_extensions_string */ + +/* ------------------------ WGL_ARB_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_ARB_framebuffer_sRGB +#define WGL_ARB_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9 + +#define WGLEW_ARB_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_ARB_framebuffer_sRGB) + +#endif /* WGL_ARB_framebuffer_sRGB */ + +/* ----------------------- WGL_ARB_make_current_read ----------------------- */ + +#ifndef WGL_ARB_make_current_read +#define WGL_ARB_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043 +#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCARB WGLEW_GET_FUN(__wglewGetCurrentReadDCARB) +#define wglMakeContextCurrentARB WGLEW_GET_FUN(__wglewMakeContextCurrentARB) + +#define WGLEW_ARB_make_current_read WGLEW_GET_VAR(__WGLEW_ARB_make_current_read) + +#endif /* WGL_ARB_make_current_read */ + +/* -------------------------- WGL_ARB_multisample -------------------------- */ + +#ifndef WGL_ARB_multisample +#define WGL_ARB_multisample 1 + +#define WGL_SAMPLE_BUFFERS_ARB 0x2041 +#define WGL_SAMPLES_ARB 0x2042 + +#define WGLEW_ARB_multisample WGLEW_GET_VAR(__WGLEW_ARB_multisample) + +#endif /* WGL_ARB_multisample */ + +/* ---------------------------- WGL_ARB_pbuffer ---------------------------- */ + +#ifndef WGL_ARB_pbuffer +#define WGL_ARB_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_ARB 0x202D +#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E +#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030 +#define WGL_PBUFFER_LARGEST_ARB 0x2033 +#define WGL_PBUFFER_WIDTH_ARB 0x2034 +#define WGL_PBUFFER_HEIGHT_ARB 0x2035 +#define WGL_PBUFFER_LOST_ARB 0x2036 + +DECLARE_HANDLE(HPBUFFERARB); + +typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC); + +#define wglCreatePbufferARB WGLEW_GET_FUN(__wglewCreatePbufferARB) +#define wglDestroyPbufferARB WGLEW_GET_FUN(__wglewDestroyPbufferARB) +#define wglGetPbufferDCARB WGLEW_GET_FUN(__wglewGetPbufferDCARB) +#define wglQueryPbufferARB WGLEW_GET_FUN(__wglewQueryPbufferARB) +#define wglReleasePbufferDCARB WGLEW_GET_FUN(__wglewReleasePbufferDCARB) + +#define WGLEW_ARB_pbuffer WGLEW_GET_VAR(__WGLEW_ARB_pbuffer) + +#endif /* WGL_ARB_pbuffer */ + +/* -------------------------- WGL_ARB_pixel_format ------------------------- */ + +#ifndef WGL_ARB_pixel_format +#define WGL_ARB_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000 +#define WGL_DRAW_TO_WINDOW_ARB 0x2001 +#define WGL_DRAW_TO_BITMAP_ARB 0x2002 +#define WGL_ACCELERATION_ARB 0x2003 +#define WGL_NEED_PALETTE_ARB 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006 +#define WGL_SWAP_METHOD_ARB 0x2007 +#define WGL_NUMBER_OVERLAYS_ARB 0x2008 +#define WGL_NUMBER_UNDERLAYS_ARB 0x2009 +#define WGL_TRANSPARENT_ARB 0x200A +#define WGL_SHARE_DEPTH_ARB 0x200C +#define WGL_SHARE_STENCIL_ARB 0x200D +#define WGL_SHARE_ACCUM_ARB 0x200E +#define WGL_SUPPORT_GDI_ARB 0x200F +#define WGL_SUPPORT_OPENGL_ARB 0x2010 +#define WGL_DOUBLE_BUFFER_ARB 0x2011 +#define WGL_STEREO_ARB 0x2012 +#define WGL_PIXEL_TYPE_ARB 0x2013 +#define WGL_COLOR_BITS_ARB 0x2014 +#define WGL_RED_BITS_ARB 0x2015 +#define WGL_RED_SHIFT_ARB 0x2016 +#define WGL_GREEN_BITS_ARB 0x2017 +#define WGL_GREEN_SHIFT_ARB 0x2018 +#define WGL_BLUE_BITS_ARB 0x2019 +#define WGL_BLUE_SHIFT_ARB 0x201A +#define WGL_ALPHA_BITS_ARB 0x201B +#define WGL_ALPHA_SHIFT_ARB 0x201C +#define WGL_ACCUM_BITS_ARB 0x201D +#define WGL_ACCUM_RED_BITS_ARB 0x201E +#define WGL_ACCUM_GREEN_BITS_ARB 0x201F +#define WGL_ACCUM_BLUE_BITS_ARB 0x2020 +#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021 +#define WGL_DEPTH_BITS_ARB 0x2022 +#define WGL_STENCIL_BITS_ARB 0x2023 +#define WGL_AUX_BUFFERS_ARB 0x2024 +#define WGL_NO_ACCELERATION_ARB 0x2025 +#define WGL_GENERIC_ACCELERATION_ARB 0x2026 +#define WGL_FULL_ACCELERATION_ARB 0x2027 +#define WGL_SWAP_EXCHANGE_ARB 0x2028 +#define WGL_SWAP_COPY_ARB 0x2029 +#define WGL_SWAP_UNDEFINED_ARB 0x202A +#define WGL_TYPE_RGBA_ARB 0x202B +#define WGL_TYPE_COLORINDEX_ARB 0x202C +#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037 +#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038 +#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039 +#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A +#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int* piAttributes, int *piValues); + +#define wglChoosePixelFormatARB WGLEW_GET_FUN(__wglewChoosePixelFormatARB) +#define wglGetPixelFormatAttribfvARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvARB) +#define wglGetPixelFormatAttribivARB WGLEW_GET_FUN(__wglewGetPixelFormatAttribivARB) + +#define WGLEW_ARB_pixel_format WGLEW_GET_VAR(__WGLEW_ARB_pixel_format) + +#endif /* WGL_ARB_pixel_format */ + +/* ----------------------- WGL_ARB_pixel_format_float ---------------------- */ + +#ifndef WGL_ARB_pixel_format_float +#define WGL_ARB_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0 + +#define WGLEW_ARB_pixel_format_float WGLEW_GET_VAR(__WGLEW_ARB_pixel_format_float) + +#endif /* WGL_ARB_pixel_format_float */ + +/* ------------------------- WGL_ARB_render_texture ------------------------ */ + +#ifndef WGL_ARB_render_texture +#define WGL_ARB_render_texture 1 + +#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070 +#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071 +#define WGL_TEXTURE_FORMAT_ARB 0x2072 +#define WGL_TEXTURE_TARGET_ARB 0x2073 +#define WGL_MIPMAP_TEXTURE_ARB 0x2074 +#define WGL_TEXTURE_RGB_ARB 0x2075 +#define WGL_TEXTURE_RGBA_ARB 0x2076 +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078 +#define WGL_TEXTURE_1D_ARB 0x2079 +#define WGL_TEXTURE_2D_ARB 0x207A +#define WGL_MIPMAP_LEVEL_ARB 0x207B +#define WGL_CUBE_MAP_FACE_ARB 0x207C +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080 +#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081 +#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082 +#define WGL_FRONT_LEFT_ARB 0x2083 +#define WGL_FRONT_RIGHT_ARB 0x2084 +#define WGL_BACK_LEFT_ARB 0x2085 +#define WGL_BACK_RIGHT_ARB 0x2086 +#define WGL_AUX0_ARB 0x2087 +#define WGL_AUX1_ARB 0x2088 +#define WGL_AUX2_ARB 0x2089 +#define WGL_AUX3_ARB 0x208A +#define WGL_AUX4_ARB 0x208B +#define WGL_AUX5_ARB 0x208C +#define WGL_AUX6_ARB 0x208D +#define WGL_AUX7_ARB 0x208E +#define WGL_AUX8_ARB 0x208F +#define WGL_AUX9_ARB 0x2090 + +typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer); +typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int* piAttribList); + +#define wglBindTexImageARB WGLEW_GET_FUN(__wglewBindTexImageARB) +#define wglReleaseTexImageARB WGLEW_GET_FUN(__wglewReleaseTexImageARB) +#define wglSetPbufferAttribARB WGLEW_GET_FUN(__wglewSetPbufferAttribARB) + +#define WGLEW_ARB_render_texture WGLEW_GET_VAR(__WGLEW_ARB_render_texture) + +#endif /* WGL_ARB_render_texture */ + +/* ----------------------- WGL_ATI_pixel_format_float ---------------------- */ + +#ifndef WGL_ATI_pixel_format_float +#define WGL_ATI_pixel_format_float 1 + +#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0 +#define GL_RGBA_FLOAT_MODE_ATI 0x8820 +#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 + +#define WGLEW_ATI_pixel_format_float WGLEW_GET_VAR(__WGLEW_ATI_pixel_format_float) + +#endif /* WGL_ATI_pixel_format_float */ + +/* -------------------- WGL_ATI_render_texture_rectangle ------------------- */ + +#ifndef WGL_ATI_render_texture_rectangle +#define WGL_ATI_render_texture_rectangle 1 + +#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5 + +#define WGLEW_ATI_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_ATI_render_texture_rectangle) + +#endif /* WGL_ATI_render_texture_rectangle */ + +/* ------------------- WGL_EXT_create_context_es2_profile ------------------ */ + +#ifndef WGL_EXT_create_context_es2_profile +#define WGL_EXT_create_context_es2_profile 1 + +#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004 + +#define WGLEW_EXT_create_context_es2_profile WGLEW_GET_VAR(__WGLEW_EXT_create_context_es2_profile) + +#endif /* WGL_EXT_create_context_es2_profile */ + +/* -------------------------- WGL_EXT_depth_float -------------------------- */ + +#ifndef WGL_EXT_depth_float +#define WGL_EXT_depth_float 1 + +#define WGL_DEPTH_FLOAT_EXT 0x2040 + +#define WGLEW_EXT_depth_float WGLEW_GET_VAR(__WGLEW_EXT_depth_float) + +#endif /* WGL_EXT_depth_float */ + +/* ---------------------- WGL_EXT_display_color_table ---------------------- */ + +#ifndef WGL_EXT_display_color_table +#define WGL_EXT_display_color_table 1 + +typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef void (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id); +typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (GLushort* table, GLuint length); + +#define wglBindDisplayColorTableEXT WGLEW_GET_FUN(__wglewBindDisplayColorTableEXT) +#define wglCreateDisplayColorTableEXT WGLEW_GET_FUN(__wglewCreateDisplayColorTableEXT) +#define wglDestroyDisplayColorTableEXT WGLEW_GET_FUN(__wglewDestroyDisplayColorTableEXT) +#define wglLoadDisplayColorTableEXT WGLEW_GET_FUN(__wglewLoadDisplayColorTableEXT) + +#define WGLEW_EXT_display_color_table WGLEW_GET_VAR(__WGLEW_EXT_display_color_table) + +#endif /* WGL_EXT_display_color_table */ + +/* ----------------------- WGL_EXT_extensions_string ----------------------- */ + +#ifndef WGL_EXT_extensions_string +#define WGL_EXT_extensions_string 1 + +typedef const char* (WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void); + +#define wglGetExtensionsStringEXT WGLEW_GET_FUN(__wglewGetExtensionsStringEXT) + +#define WGLEW_EXT_extensions_string WGLEW_GET_VAR(__WGLEW_EXT_extensions_string) + +#endif /* WGL_EXT_extensions_string */ + +/* ------------------------ WGL_EXT_framebuffer_sRGB ----------------------- */ + +#ifndef WGL_EXT_framebuffer_sRGB +#define WGL_EXT_framebuffer_sRGB 1 + +#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9 + +#define WGLEW_EXT_framebuffer_sRGB WGLEW_GET_VAR(__WGLEW_EXT_framebuffer_sRGB) + +#endif /* WGL_EXT_framebuffer_sRGB */ + +/* ----------------------- WGL_EXT_make_current_read ----------------------- */ + +#ifndef WGL_EXT_make_current_read +#define WGL_EXT_make_current_read 1 + +#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043 + +typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc); + +#define wglGetCurrentReadDCEXT WGLEW_GET_FUN(__wglewGetCurrentReadDCEXT) +#define wglMakeContextCurrentEXT WGLEW_GET_FUN(__wglewMakeContextCurrentEXT) + +#define WGLEW_EXT_make_current_read WGLEW_GET_VAR(__WGLEW_EXT_make_current_read) + +#endif /* WGL_EXT_make_current_read */ + +/* -------------------------- WGL_EXT_multisample -------------------------- */ + +#ifndef WGL_EXT_multisample +#define WGL_EXT_multisample 1 + +#define WGL_SAMPLE_BUFFERS_EXT 0x2041 +#define WGL_SAMPLES_EXT 0x2042 + +#define WGLEW_EXT_multisample WGLEW_GET_VAR(__WGLEW_EXT_multisample) + +#endif /* WGL_EXT_multisample */ + +/* ---------------------------- WGL_EXT_pbuffer ---------------------------- */ + +#ifndef WGL_EXT_pbuffer +#define WGL_EXT_pbuffer 1 + +#define WGL_DRAW_TO_PBUFFER_EXT 0x202D +#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E +#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F +#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030 +#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031 +#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032 +#define WGL_PBUFFER_LARGEST_EXT 0x2033 +#define WGL_PBUFFER_WIDTH_EXT 0x2034 +#define WGL_PBUFFER_HEIGHT_EXT 0x2035 + +DECLARE_HANDLE(HPBUFFEREXT); + +typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int* piAttribList); +typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer); +typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer); +typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int* piValue); +typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC); + +#define wglCreatePbufferEXT WGLEW_GET_FUN(__wglewCreatePbufferEXT) +#define wglDestroyPbufferEXT WGLEW_GET_FUN(__wglewDestroyPbufferEXT) +#define wglGetPbufferDCEXT WGLEW_GET_FUN(__wglewGetPbufferDCEXT) +#define wglQueryPbufferEXT WGLEW_GET_FUN(__wglewQueryPbufferEXT) +#define wglReleasePbufferDCEXT WGLEW_GET_FUN(__wglewReleasePbufferDCEXT) + +#define WGLEW_EXT_pbuffer WGLEW_GET_VAR(__WGLEW_EXT_pbuffer) + +#endif /* WGL_EXT_pbuffer */ + +/* -------------------------- WGL_EXT_pixel_format ------------------------- */ + +#ifndef WGL_EXT_pixel_format +#define WGL_EXT_pixel_format 1 + +#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000 +#define WGL_DRAW_TO_WINDOW_EXT 0x2001 +#define WGL_DRAW_TO_BITMAP_EXT 0x2002 +#define WGL_ACCELERATION_EXT 0x2003 +#define WGL_NEED_PALETTE_EXT 0x2004 +#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005 +#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006 +#define WGL_SWAP_METHOD_EXT 0x2007 +#define WGL_NUMBER_OVERLAYS_EXT 0x2008 +#define WGL_NUMBER_UNDERLAYS_EXT 0x2009 +#define WGL_TRANSPARENT_EXT 0x200A +#define WGL_TRANSPARENT_VALUE_EXT 0x200B +#define WGL_SHARE_DEPTH_EXT 0x200C +#define WGL_SHARE_STENCIL_EXT 0x200D +#define WGL_SHARE_ACCUM_EXT 0x200E +#define WGL_SUPPORT_GDI_EXT 0x200F +#define WGL_SUPPORT_OPENGL_EXT 0x2010 +#define WGL_DOUBLE_BUFFER_EXT 0x2011 +#define WGL_STEREO_EXT 0x2012 +#define WGL_PIXEL_TYPE_EXT 0x2013 +#define WGL_COLOR_BITS_EXT 0x2014 +#define WGL_RED_BITS_EXT 0x2015 +#define WGL_RED_SHIFT_EXT 0x2016 +#define WGL_GREEN_BITS_EXT 0x2017 +#define WGL_GREEN_SHIFT_EXT 0x2018 +#define WGL_BLUE_BITS_EXT 0x2019 +#define WGL_BLUE_SHIFT_EXT 0x201A +#define WGL_ALPHA_BITS_EXT 0x201B +#define WGL_ALPHA_SHIFT_EXT 0x201C +#define WGL_ACCUM_BITS_EXT 0x201D +#define WGL_ACCUM_RED_BITS_EXT 0x201E +#define WGL_ACCUM_GREEN_BITS_EXT 0x201F +#define WGL_ACCUM_BLUE_BITS_EXT 0x2020 +#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021 +#define WGL_DEPTH_BITS_EXT 0x2022 +#define WGL_STENCIL_BITS_EXT 0x2023 +#define WGL_AUX_BUFFERS_EXT 0x2024 +#define WGL_NO_ACCELERATION_EXT 0x2025 +#define WGL_GENERIC_ACCELERATION_EXT 0x2026 +#define WGL_FULL_ACCELERATION_EXT 0x2027 +#define WGL_SWAP_EXCHANGE_EXT 0x2028 +#define WGL_SWAP_COPY_EXT 0x2029 +#define WGL_SWAP_UNDEFINED_EXT 0x202A +#define WGL_TYPE_RGBA_EXT 0x202B +#define WGL_TYPE_COLORINDEX_EXT 0x202C + +typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int* piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, FLOAT *pfValues); +typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int* piAttributes, int *piValues); + +#define wglChoosePixelFormatEXT WGLEW_GET_FUN(__wglewChoosePixelFormatEXT) +#define wglGetPixelFormatAttribfvEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribfvEXT) +#define wglGetPixelFormatAttribivEXT WGLEW_GET_FUN(__wglewGetPixelFormatAttribivEXT) + +#define WGLEW_EXT_pixel_format WGLEW_GET_VAR(__WGLEW_EXT_pixel_format) + +#endif /* WGL_EXT_pixel_format */ + +/* ------------------- WGL_EXT_pixel_format_packed_float ------------------- */ + +#ifndef WGL_EXT_pixel_format_packed_float +#define WGL_EXT_pixel_format_packed_float 1 + +#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8 + +#define WGLEW_EXT_pixel_format_packed_float WGLEW_GET_VAR(__WGLEW_EXT_pixel_format_packed_float) + +#endif /* WGL_EXT_pixel_format_packed_float */ + +/* -------------------------- WGL_EXT_swap_control ------------------------- */ + +#ifndef WGL_EXT_swap_control +#define WGL_EXT_swap_control 1 + +typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void); +typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval); + +#define wglGetSwapIntervalEXT WGLEW_GET_FUN(__wglewGetSwapIntervalEXT) +#define wglSwapIntervalEXT WGLEW_GET_FUN(__wglewSwapIntervalEXT) + +#define WGLEW_EXT_swap_control WGLEW_GET_VAR(__WGLEW_EXT_swap_control) + +#endif /* WGL_EXT_swap_control */ + +/* --------------------- WGL_I3D_digital_video_control --------------------- */ + +#ifndef WGL_I3D_digital_video_control +#define WGL_I3D_digital_video_control 1 + +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050 +#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051 +#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052 +#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053 + +typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewGetDigitalVideoParametersI3D) +#define wglSetDigitalVideoParametersI3D WGLEW_GET_FUN(__wglewSetDigitalVideoParametersI3D) + +#define WGLEW_I3D_digital_video_control WGLEW_GET_VAR(__WGLEW_I3D_digital_video_control) + +#endif /* WGL_I3D_digital_video_control */ + +/* ----------------------------- WGL_I3D_gamma ----------------------------- */ + +#ifndef WGL_I3D_gamma +#define WGL_I3D_gamma 1 + +#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E +#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F + +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT* puRed, USHORT *puGreen, USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int* piValue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT* puRed, const USHORT *puGreen, const USHORT *puBlue); +typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int* piValue); + +#define wglGetGammaTableI3D WGLEW_GET_FUN(__wglewGetGammaTableI3D) +#define wglGetGammaTableParametersI3D WGLEW_GET_FUN(__wglewGetGammaTableParametersI3D) +#define wglSetGammaTableI3D WGLEW_GET_FUN(__wglewSetGammaTableI3D) +#define wglSetGammaTableParametersI3D WGLEW_GET_FUN(__wglewSetGammaTableParametersI3D) + +#define WGLEW_I3D_gamma WGLEW_GET_VAR(__WGLEW_I3D_gamma) + +#endif /* WGL_I3D_gamma */ + +/* ---------------------------- WGL_I3D_genlock ---------------------------- */ + +#ifndef WGL_I3D_genlock +#define WGL_I3D_genlock 1 + +#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044 +#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045 +#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046 +#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047 +#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048 +#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049 +#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A +#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B +#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C + +typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC); +typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge); +typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT* uRate); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT* uDelay); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT* uEdge); +typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT* uSource); +typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT* uMaxLineDelay, UINT *uMaxPixelDelay); + +#define wglDisableGenlockI3D WGLEW_GET_FUN(__wglewDisableGenlockI3D) +#define wglEnableGenlockI3D WGLEW_GET_FUN(__wglewEnableGenlockI3D) +#define wglGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGenlockSampleRateI3D) +#define wglGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGenlockSourceDelayI3D) +#define wglGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGenlockSourceEdgeI3D) +#define wglGenlockSourceI3D WGLEW_GET_FUN(__wglewGenlockSourceI3D) +#define wglGetGenlockSampleRateI3D WGLEW_GET_FUN(__wglewGetGenlockSampleRateI3D) +#define wglGetGenlockSourceDelayI3D WGLEW_GET_FUN(__wglewGetGenlockSourceDelayI3D) +#define wglGetGenlockSourceEdgeI3D WGLEW_GET_FUN(__wglewGetGenlockSourceEdgeI3D) +#define wglGetGenlockSourceI3D WGLEW_GET_FUN(__wglewGetGenlockSourceI3D) +#define wglIsEnabledGenlockI3D WGLEW_GET_FUN(__wglewIsEnabledGenlockI3D) +#define wglQueryGenlockMaxSourceDelayI3D WGLEW_GET_FUN(__wglewQueryGenlockMaxSourceDelayI3D) + +#define WGLEW_I3D_genlock WGLEW_GET_VAR(__WGLEW_I3D_genlock) + +#endif /* WGL_I3D_genlock */ + +/* -------------------------- WGL_I3D_image_buffer ------------------------- */ + +#ifndef WGL_I3D_image_buffer +#define WGL_I3D_image_buffer 1 + +#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001 +#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002 + +typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, HANDLE* pEvent, LPVOID *pAddress, DWORD *pSize, UINT count); +typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags); +typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress); +typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hdc, LPVOID* pAddress, UINT count); + +#define wglAssociateImageBufferEventsI3D WGLEW_GET_FUN(__wglewAssociateImageBufferEventsI3D) +#define wglCreateImageBufferI3D WGLEW_GET_FUN(__wglewCreateImageBufferI3D) +#define wglDestroyImageBufferI3D WGLEW_GET_FUN(__wglewDestroyImageBufferI3D) +#define wglReleaseImageBufferEventsI3D WGLEW_GET_FUN(__wglewReleaseImageBufferEventsI3D) + +#define WGLEW_I3D_image_buffer WGLEW_GET_VAR(__WGLEW_I3D_image_buffer) + +#endif /* WGL_I3D_image_buffer */ + +/* ------------------------ WGL_I3D_swap_frame_lock ------------------------ */ + +#ifndef WGL_I3D_swap_frame_lock +#define WGL_I3D_swap_frame_lock 1 + +typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (VOID); +typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL* pFlag); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL* pFlag); + +#define wglDisableFrameLockI3D WGLEW_GET_FUN(__wglewDisableFrameLockI3D) +#define wglEnableFrameLockI3D WGLEW_GET_FUN(__wglewEnableFrameLockI3D) +#define wglIsEnabledFrameLockI3D WGLEW_GET_FUN(__wglewIsEnabledFrameLockI3D) +#define wglQueryFrameLockMasterI3D WGLEW_GET_FUN(__wglewQueryFrameLockMasterI3D) + +#define WGLEW_I3D_swap_frame_lock WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_lock) + +#endif /* WGL_I3D_swap_frame_lock */ + +/* ------------------------ WGL_I3D_swap_frame_usage ----------------------- */ + +#ifndef WGL_I3D_swap_frame_usage +#define WGL_I3D_swap_frame_usage 1 + +typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void); +typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float* pUsage); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD* pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage); + +#define wglBeginFrameTrackingI3D WGLEW_GET_FUN(__wglewBeginFrameTrackingI3D) +#define wglEndFrameTrackingI3D WGLEW_GET_FUN(__wglewEndFrameTrackingI3D) +#define wglGetFrameUsageI3D WGLEW_GET_FUN(__wglewGetFrameUsageI3D) +#define wglQueryFrameTrackingI3D WGLEW_GET_FUN(__wglewQueryFrameTrackingI3D) + +#define WGLEW_I3D_swap_frame_usage WGLEW_GET_VAR(__WGLEW_I3D_swap_frame_usage) + +#endif /* WGL_I3D_swap_frame_usage */ + +/* --------------------------- WGL_NV_copy_image --------------------------- */ + +#ifndef WGL_NV_copy_image +#define WGL_NV_copy_image 1 + +typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth); + +#define wglCopyImageSubDataNV WGLEW_GET_FUN(__wglewCopyImageSubDataNV) + +#define WGLEW_NV_copy_image WGLEW_GET_VAR(__WGLEW_NV_copy_image) + +#endif /* WGL_NV_copy_image */ + +/* -------------------------- WGL_NV_float_buffer -------------------------- */ + +#ifndef WGL_NV_float_buffer +#define WGL_NV_float_buffer 1 + +#define WGL_FLOAT_COMPONENTS_NV 0x20B0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4 +#define WGL_TEXTURE_FLOAT_R_NV 0x20B5 +#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6 +#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7 +#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8 + +#define WGLEW_NV_float_buffer WGLEW_GET_VAR(__WGLEW_NV_float_buffer) + +#endif /* WGL_NV_float_buffer */ + +/* -------------------------- WGL_NV_gpu_affinity -------------------------- */ + +#ifndef WGL_NV_gpu_affinity +#define WGL_NV_gpu_affinity 1 + +#define WGL_ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0 +#define WGL_ERROR_MISSING_AFFINITY_MASK_NV 0x20D1 + +DECLARE_HANDLE(HGPUNV); +typedef struct _GPU_DEVICE { + DWORD cb; + CHAR DeviceName[32]; + CHAR DeviceString[128]; + DWORD Flags; + RECT rcVirtualScreen; +} GPU_DEVICE, *PGPU_DEVICE; + +typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList); +typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc); +typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice); +typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu); +typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu); + +#define wglCreateAffinityDCNV WGLEW_GET_FUN(__wglewCreateAffinityDCNV) +#define wglDeleteDCNV WGLEW_GET_FUN(__wglewDeleteDCNV) +#define wglEnumGpuDevicesNV WGLEW_GET_FUN(__wglewEnumGpuDevicesNV) +#define wglEnumGpusFromAffinityDCNV WGLEW_GET_FUN(__wglewEnumGpusFromAffinityDCNV) +#define wglEnumGpusNV WGLEW_GET_FUN(__wglewEnumGpusNV) + +#define WGLEW_NV_gpu_affinity WGLEW_GET_VAR(__WGLEW_NV_gpu_affinity) + +#endif /* WGL_NV_gpu_affinity */ + +/* ---------------------- WGL_NV_multisample_coverage ---------------------- */ + +#ifndef WGL_NV_multisample_coverage +#define WGL_NV_multisample_coverage 1 + +#define WGL_COVERAGE_SAMPLES_NV 0x2042 +#define WGL_COLOR_SAMPLES_NV 0x20B9 + +#define WGLEW_NV_multisample_coverage WGLEW_GET_VAR(__WGLEW_NV_multisample_coverage) + +#endif /* WGL_NV_multisample_coverage */ + +/* -------------------------- WGL_NV_present_video ------------------------- */ + +#ifndef WGL_NV_present_video +#define WGL_NV_present_video 1 + +#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0 + +DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int* piAttribList); +typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV* phDeviceList); +typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int* piValue); + +#define wglBindVideoDeviceNV WGLEW_GET_FUN(__wglewBindVideoDeviceNV) +#define wglEnumerateVideoDevicesNV WGLEW_GET_FUN(__wglewEnumerateVideoDevicesNV) +#define wglQueryCurrentContextNV WGLEW_GET_FUN(__wglewQueryCurrentContextNV) + +#define WGLEW_NV_present_video WGLEW_GET_VAR(__WGLEW_NV_present_video) + +#endif /* WGL_NV_present_video */ + +/* ---------------------- WGL_NV_render_depth_texture ---------------------- */ + +#ifndef WGL_NV_render_depth_texture +#define WGL_NV_render_depth_texture 1 + +#define WGL_NO_TEXTURE_ARB 0x2077 +#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4 +#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5 +#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6 +#define WGL_DEPTH_COMPONENT_NV 0x20A7 + +#define WGLEW_NV_render_depth_texture WGLEW_GET_VAR(__WGLEW_NV_render_depth_texture) + +#endif /* WGL_NV_render_depth_texture */ + +/* -------------------- WGL_NV_render_texture_rectangle -------------------- */ + +#ifndef WGL_NV_render_texture_rectangle +#define WGL_NV_render_texture_rectangle 1 + +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0 +#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1 +#define WGL_TEXTURE_RECTANGLE_NV 0x20A2 + +#define WGLEW_NV_render_texture_rectangle WGLEW_GET_VAR(__WGLEW_NV_render_texture_rectangle) + +#endif /* WGL_NV_render_texture_rectangle */ + +/* --------------------------- WGL_NV_swap_group --------------------------- */ + +#ifndef WGL_NV_swap_group +#define WGL_NV_swap_group 1 + +typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier); +typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group); +typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint* count); +typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint* maxGroups, GLuint *maxBarriers); +typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint* group, GLuint *barrier); +typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC); + +#define wglBindSwapBarrierNV WGLEW_GET_FUN(__wglewBindSwapBarrierNV) +#define wglJoinSwapGroupNV WGLEW_GET_FUN(__wglewJoinSwapGroupNV) +#define wglQueryFrameCountNV WGLEW_GET_FUN(__wglewQueryFrameCountNV) +#define wglQueryMaxSwapGroupsNV WGLEW_GET_FUN(__wglewQueryMaxSwapGroupsNV) +#define wglQuerySwapGroupNV WGLEW_GET_FUN(__wglewQuerySwapGroupNV) +#define wglResetFrameCountNV WGLEW_GET_FUN(__wglewResetFrameCountNV) + +#define WGLEW_NV_swap_group WGLEW_GET_VAR(__WGLEW_NV_swap_group) + +#endif /* WGL_NV_swap_group */ + +/* ----------------------- WGL_NV_vertex_array_range ----------------------- */ + +#ifndef WGL_NV_vertex_array_range +#define WGL_NV_vertex_array_range 1 + +typedef void * (WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readFrequency, GLfloat writeFrequency, GLfloat priority); +typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer); + +#define wglAllocateMemoryNV WGLEW_GET_FUN(__wglewAllocateMemoryNV) +#define wglFreeMemoryNV WGLEW_GET_FUN(__wglewFreeMemoryNV) + +#define WGLEW_NV_vertex_array_range WGLEW_GET_VAR(__WGLEW_NV_vertex_array_range) + +#endif /* WGL_NV_vertex_array_range */ + +/* -------------------------- WGL_NV_video_output -------------------------- */ + +#ifndef WGL_NV_video_output +#define WGL_NV_video_output 1 + +#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0 +#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1 +#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2 +#define WGL_VIDEO_OUT_COLOR_NV 0x20C3 +#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4 +#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5 +#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6 +#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7 +#define WGL_VIDEO_OUT_FRAME 0x20C8 +#define WGL_VIDEO_OUT_FIELD_1 0x20C9 +#define WGL_VIDEO_OUT_FIELD_2 0x20CA +#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB +#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC + +DECLARE_HANDLE(HPVIDEODEV); + +typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV* hVideoDevice); +typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long* pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice); +typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer); +typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long* pulCounterPbuffer, BOOL bBlock); + +#define wglBindVideoImageNV WGLEW_GET_FUN(__wglewBindVideoImageNV) +#define wglGetVideoDeviceNV WGLEW_GET_FUN(__wglewGetVideoDeviceNV) +#define wglGetVideoInfoNV WGLEW_GET_FUN(__wglewGetVideoInfoNV) +#define wglReleaseVideoDeviceNV WGLEW_GET_FUN(__wglewReleaseVideoDeviceNV) +#define wglReleaseVideoImageNV WGLEW_GET_FUN(__wglewReleaseVideoImageNV) +#define wglSendPbufferToVideoNV WGLEW_GET_FUN(__wglewSendPbufferToVideoNV) + +#define WGLEW_NV_video_output WGLEW_GET_VAR(__WGLEW_NV_video_output) + +#endif /* WGL_NV_video_output */ + +/* -------------------------- WGL_OML_sync_control ------------------------- */ + +#ifndef WGL_OML_sync_control +#define WGL_OML_sync_control 1 + +typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32* numerator, INT32 *denominator); +typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64* ust, INT64 *msc, INT64 *sbc); +typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder); +typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64* ust, INT64 *msc, INT64 *sbc); +typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64* ust, INT64 *msc, INT64 *sbc); + +#define wglGetMscRateOML WGLEW_GET_FUN(__wglewGetMscRateOML) +#define wglGetSyncValuesOML WGLEW_GET_FUN(__wglewGetSyncValuesOML) +#define wglSwapBuffersMscOML WGLEW_GET_FUN(__wglewSwapBuffersMscOML) +#define wglSwapLayerBuffersMscOML WGLEW_GET_FUN(__wglewSwapLayerBuffersMscOML) +#define wglWaitForMscOML WGLEW_GET_FUN(__wglewWaitForMscOML) +#define wglWaitForSbcOML WGLEW_GET_FUN(__wglewWaitForSbcOML) + +#define WGLEW_OML_sync_control WGLEW_GET_VAR(__WGLEW_OML_sync_control) + +#endif /* WGL_OML_sync_control */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX +#define WGLEW_EXPORT +#else +#define WGLEW_EXPORT GLEWAPI +#endif /* GLEW_MX */ + +#ifdef GLEW_MX +struct WGLEWContextStruct +{ +#endif /* GLEW_MX */ + +WGLEW_EXPORT PFNWGLSETSTEREOEMITTERSTATE3DLPROC __wglewSetStereoEmitterState3DL; + +WGLEW_EXPORT PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC __wglewBlitContextFramebufferAMD; +WGLEW_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC __wglewCreateAssociatedContextAMD; +WGLEW_EXPORT PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC __wglewCreateAssociatedContextAttribsAMD; +WGLEW_EXPORT PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC __wglewDeleteAssociatedContextAMD; +WGLEW_EXPORT PFNWGLGETCONTEXTGPUIDAMDPROC __wglewGetContextGPUIDAMD; +WGLEW_EXPORT PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC __wglewGetCurrentAssociatedContextAMD; +WGLEW_EXPORT PFNWGLGETGPUIDSAMDPROC __wglewGetGPUIDsAMD; +WGLEW_EXPORT PFNWGLGETGPUINFOAMDPROC __wglewGetGPUInfoAMD; +WGLEW_EXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC __wglewMakeAssociatedContextCurrentAMD; + +WGLEW_EXPORT PFNWGLCREATEBUFFERREGIONARBPROC __wglewCreateBufferRegionARB; +WGLEW_EXPORT PFNWGLDELETEBUFFERREGIONARBPROC __wglewDeleteBufferRegionARB; +WGLEW_EXPORT PFNWGLRESTOREBUFFERREGIONARBPROC __wglewRestoreBufferRegionARB; +WGLEW_EXPORT PFNWGLSAVEBUFFERREGIONARBPROC __wglewSaveBufferRegionARB; + +WGLEW_EXPORT PFNWGLCREATECONTEXTATTRIBSARBPROC __wglewCreateContextAttribsARB; + +WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGARBPROC __wglewGetExtensionsStringARB; + +WGLEW_EXPORT PFNWGLGETCURRENTREADDCARBPROC __wglewGetCurrentReadDCARB; +WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTARBPROC __wglewMakeContextCurrentARB; + +WGLEW_EXPORT PFNWGLCREATEPBUFFERARBPROC __wglewCreatePbufferARB; +WGLEW_EXPORT PFNWGLDESTROYPBUFFERARBPROC __wglewDestroyPbufferARB; +WGLEW_EXPORT PFNWGLGETPBUFFERDCARBPROC __wglewGetPbufferDCARB; +WGLEW_EXPORT PFNWGLQUERYPBUFFERARBPROC __wglewQueryPbufferARB; +WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCARBPROC __wglewReleasePbufferDCARB; + +WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATARBPROC __wglewChoosePixelFormatARB; +WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVARBPROC __wglewGetPixelFormatAttribfvARB; +WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVARBPROC __wglewGetPixelFormatAttribivARB; + +WGLEW_EXPORT PFNWGLBINDTEXIMAGEARBPROC __wglewBindTexImageARB; +WGLEW_EXPORT PFNWGLRELEASETEXIMAGEARBPROC __wglewReleaseTexImageARB; +WGLEW_EXPORT PFNWGLSETPBUFFERATTRIBARBPROC __wglewSetPbufferAttribARB; + +WGLEW_EXPORT PFNWGLBINDDISPLAYCOLORTABLEEXTPROC __wglewBindDisplayColorTableEXT; +WGLEW_EXPORT PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC __wglewCreateDisplayColorTableEXT; +WGLEW_EXPORT PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC __wglewDestroyDisplayColorTableEXT; +WGLEW_EXPORT PFNWGLLOADDISPLAYCOLORTABLEEXTPROC __wglewLoadDisplayColorTableEXT; + +WGLEW_EXPORT PFNWGLGETEXTENSIONSSTRINGEXTPROC __wglewGetExtensionsStringEXT; + +WGLEW_EXPORT PFNWGLGETCURRENTREADDCEXTPROC __wglewGetCurrentReadDCEXT; +WGLEW_EXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC __wglewMakeContextCurrentEXT; + +WGLEW_EXPORT PFNWGLCREATEPBUFFEREXTPROC __wglewCreatePbufferEXT; +WGLEW_EXPORT PFNWGLDESTROYPBUFFEREXTPROC __wglewDestroyPbufferEXT; +WGLEW_EXPORT PFNWGLGETPBUFFERDCEXTPROC __wglewGetPbufferDCEXT; +WGLEW_EXPORT PFNWGLQUERYPBUFFEREXTPROC __wglewQueryPbufferEXT; +WGLEW_EXPORT PFNWGLRELEASEPBUFFERDCEXTPROC __wglewReleasePbufferDCEXT; + +WGLEW_EXPORT PFNWGLCHOOSEPIXELFORMATEXTPROC __wglewChoosePixelFormatEXT; +WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBFVEXTPROC __wglewGetPixelFormatAttribfvEXT; +WGLEW_EXPORT PFNWGLGETPIXELFORMATATTRIBIVEXTPROC __wglewGetPixelFormatAttribivEXT; + +WGLEW_EXPORT PFNWGLGETSWAPINTERVALEXTPROC __wglewGetSwapIntervalEXT; +WGLEW_EXPORT PFNWGLSWAPINTERVALEXTPROC __wglewSwapIntervalEXT; + +WGLEW_EXPORT PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC __wglewGetDigitalVideoParametersI3D; +WGLEW_EXPORT PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC __wglewSetDigitalVideoParametersI3D; + +WGLEW_EXPORT PFNWGLGETGAMMATABLEI3DPROC __wglewGetGammaTableI3D; +WGLEW_EXPORT PFNWGLGETGAMMATABLEPARAMETERSI3DPROC __wglewGetGammaTableParametersI3D; +WGLEW_EXPORT PFNWGLSETGAMMATABLEI3DPROC __wglewSetGammaTableI3D; +WGLEW_EXPORT PFNWGLSETGAMMATABLEPARAMETERSI3DPROC __wglewSetGammaTableParametersI3D; + +WGLEW_EXPORT PFNWGLDISABLEGENLOCKI3DPROC __wglewDisableGenlockI3D; +WGLEW_EXPORT PFNWGLENABLEGENLOCKI3DPROC __wglewEnableGenlockI3D; +WGLEW_EXPORT PFNWGLGENLOCKSAMPLERATEI3DPROC __wglewGenlockSampleRateI3D; +WGLEW_EXPORT PFNWGLGENLOCKSOURCEDELAYI3DPROC __wglewGenlockSourceDelayI3D; +WGLEW_EXPORT PFNWGLGENLOCKSOURCEEDGEI3DPROC __wglewGenlockSourceEdgeI3D; +WGLEW_EXPORT PFNWGLGENLOCKSOURCEI3DPROC __wglewGenlockSourceI3D; +WGLEW_EXPORT PFNWGLGETGENLOCKSAMPLERATEI3DPROC __wglewGetGenlockSampleRateI3D; +WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEDELAYI3DPROC __wglewGetGenlockSourceDelayI3D; +WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEEDGEI3DPROC __wglewGetGenlockSourceEdgeI3D; +WGLEW_EXPORT PFNWGLGETGENLOCKSOURCEI3DPROC __wglewGetGenlockSourceI3D; +WGLEW_EXPORT PFNWGLISENABLEDGENLOCKI3DPROC __wglewIsEnabledGenlockI3D; +WGLEW_EXPORT PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC __wglewQueryGenlockMaxSourceDelayI3D; + +WGLEW_EXPORT PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC __wglewAssociateImageBufferEventsI3D; +WGLEW_EXPORT PFNWGLCREATEIMAGEBUFFERI3DPROC __wglewCreateImageBufferI3D; +WGLEW_EXPORT PFNWGLDESTROYIMAGEBUFFERI3DPROC __wglewDestroyImageBufferI3D; +WGLEW_EXPORT PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC __wglewReleaseImageBufferEventsI3D; + +WGLEW_EXPORT PFNWGLDISABLEFRAMELOCKI3DPROC __wglewDisableFrameLockI3D; +WGLEW_EXPORT PFNWGLENABLEFRAMELOCKI3DPROC __wglewEnableFrameLockI3D; +WGLEW_EXPORT PFNWGLISENABLEDFRAMELOCKI3DPROC __wglewIsEnabledFrameLockI3D; +WGLEW_EXPORT PFNWGLQUERYFRAMELOCKMASTERI3DPROC __wglewQueryFrameLockMasterI3D; + +WGLEW_EXPORT PFNWGLBEGINFRAMETRACKINGI3DPROC __wglewBeginFrameTrackingI3D; +WGLEW_EXPORT PFNWGLENDFRAMETRACKINGI3DPROC __wglewEndFrameTrackingI3D; +WGLEW_EXPORT PFNWGLGETFRAMEUSAGEI3DPROC __wglewGetFrameUsageI3D; +WGLEW_EXPORT PFNWGLQUERYFRAMETRACKINGI3DPROC __wglewQueryFrameTrackingI3D; + +WGLEW_EXPORT PFNWGLCOPYIMAGESUBDATANVPROC __wglewCopyImageSubDataNV; + +WGLEW_EXPORT PFNWGLCREATEAFFINITYDCNVPROC __wglewCreateAffinityDCNV; +WGLEW_EXPORT PFNWGLDELETEDCNVPROC __wglewDeleteDCNV; +WGLEW_EXPORT PFNWGLENUMGPUDEVICESNVPROC __wglewEnumGpuDevicesNV; +WGLEW_EXPORT PFNWGLENUMGPUSFROMAFFINITYDCNVPROC __wglewEnumGpusFromAffinityDCNV; +WGLEW_EXPORT PFNWGLENUMGPUSNVPROC __wglewEnumGpusNV; + +WGLEW_EXPORT PFNWGLBINDVIDEODEVICENVPROC __wglewBindVideoDeviceNV; +WGLEW_EXPORT PFNWGLENUMERATEVIDEODEVICESNVPROC __wglewEnumerateVideoDevicesNV; +WGLEW_EXPORT PFNWGLQUERYCURRENTCONTEXTNVPROC __wglewQueryCurrentContextNV; + +WGLEW_EXPORT PFNWGLBINDSWAPBARRIERNVPROC __wglewBindSwapBarrierNV; +WGLEW_EXPORT PFNWGLJOINSWAPGROUPNVPROC __wglewJoinSwapGroupNV; +WGLEW_EXPORT PFNWGLQUERYFRAMECOUNTNVPROC __wglewQueryFrameCountNV; +WGLEW_EXPORT PFNWGLQUERYMAXSWAPGROUPSNVPROC __wglewQueryMaxSwapGroupsNV; +WGLEW_EXPORT PFNWGLQUERYSWAPGROUPNVPROC __wglewQuerySwapGroupNV; +WGLEW_EXPORT PFNWGLRESETFRAMECOUNTNVPROC __wglewResetFrameCountNV; + +WGLEW_EXPORT PFNWGLALLOCATEMEMORYNVPROC __wglewAllocateMemoryNV; +WGLEW_EXPORT PFNWGLFREEMEMORYNVPROC __wglewFreeMemoryNV; + +WGLEW_EXPORT PFNWGLBINDVIDEOIMAGENVPROC __wglewBindVideoImageNV; +WGLEW_EXPORT PFNWGLGETVIDEODEVICENVPROC __wglewGetVideoDeviceNV; +WGLEW_EXPORT PFNWGLGETVIDEOINFONVPROC __wglewGetVideoInfoNV; +WGLEW_EXPORT PFNWGLRELEASEVIDEODEVICENVPROC __wglewReleaseVideoDeviceNV; +WGLEW_EXPORT PFNWGLRELEASEVIDEOIMAGENVPROC __wglewReleaseVideoImageNV; +WGLEW_EXPORT PFNWGLSENDPBUFFERTOVIDEONVPROC __wglewSendPbufferToVideoNV; + +WGLEW_EXPORT PFNWGLGETMSCRATEOMLPROC __wglewGetMscRateOML; +WGLEW_EXPORT PFNWGLGETSYNCVALUESOMLPROC __wglewGetSyncValuesOML; +WGLEW_EXPORT PFNWGLSWAPBUFFERSMSCOMLPROC __wglewSwapBuffersMscOML; +WGLEW_EXPORT PFNWGLSWAPLAYERBUFFERSMSCOMLPROC __wglewSwapLayerBuffersMscOML; +WGLEW_EXPORT PFNWGLWAITFORMSCOMLPROC __wglewWaitForMscOML; +WGLEW_EXPORT PFNWGLWAITFORSBCOMLPROC __wglewWaitForSbcOML; +WGLEW_EXPORT GLboolean __WGLEW_3DFX_multisample; +WGLEW_EXPORT GLboolean __WGLEW_3DL_stereo_control; +WGLEW_EXPORT GLboolean __WGLEW_AMD_gpu_association; +WGLEW_EXPORT GLboolean __WGLEW_ARB_buffer_region; +WGLEW_EXPORT GLboolean __WGLEW_ARB_create_context; +WGLEW_EXPORT GLboolean __WGLEW_ARB_create_context_profile; +WGLEW_EXPORT GLboolean __WGLEW_ARB_create_context_robustness; +WGLEW_EXPORT GLboolean __WGLEW_ARB_extensions_string; +WGLEW_EXPORT GLboolean __WGLEW_ARB_framebuffer_sRGB; +WGLEW_EXPORT GLboolean __WGLEW_ARB_make_current_read; +WGLEW_EXPORT GLboolean __WGLEW_ARB_multisample; +WGLEW_EXPORT GLboolean __WGLEW_ARB_pbuffer; +WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format; +WGLEW_EXPORT GLboolean __WGLEW_ARB_pixel_format_float; +WGLEW_EXPORT GLboolean __WGLEW_ARB_render_texture; +WGLEW_EXPORT GLboolean __WGLEW_ATI_pixel_format_float; +WGLEW_EXPORT GLboolean __WGLEW_ATI_render_texture_rectangle; +WGLEW_EXPORT GLboolean __WGLEW_EXT_create_context_es2_profile; +WGLEW_EXPORT GLboolean __WGLEW_EXT_depth_float; +WGLEW_EXPORT GLboolean __WGLEW_EXT_display_color_table; +WGLEW_EXPORT GLboolean __WGLEW_EXT_extensions_string; +WGLEW_EXPORT GLboolean __WGLEW_EXT_framebuffer_sRGB; +WGLEW_EXPORT GLboolean __WGLEW_EXT_make_current_read; +WGLEW_EXPORT GLboolean __WGLEW_EXT_multisample; +WGLEW_EXPORT GLboolean __WGLEW_EXT_pbuffer; +WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format; +WGLEW_EXPORT GLboolean __WGLEW_EXT_pixel_format_packed_float; +WGLEW_EXPORT GLboolean __WGLEW_EXT_swap_control; +WGLEW_EXPORT GLboolean __WGLEW_I3D_digital_video_control; +WGLEW_EXPORT GLboolean __WGLEW_I3D_gamma; +WGLEW_EXPORT GLboolean __WGLEW_I3D_genlock; +WGLEW_EXPORT GLboolean __WGLEW_I3D_image_buffer; +WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_lock; +WGLEW_EXPORT GLboolean __WGLEW_I3D_swap_frame_usage; +WGLEW_EXPORT GLboolean __WGLEW_NV_copy_image; +WGLEW_EXPORT GLboolean __WGLEW_NV_float_buffer; +WGLEW_EXPORT GLboolean __WGLEW_NV_gpu_affinity; +WGLEW_EXPORT GLboolean __WGLEW_NV_multisample_coverage; +WGLEW_EXPORT GLboolean __WGLEW_NV_present_video; +WGLEW_EXPORT GLboolean __WGLEW_NV_render_depth_texture; +WGLEW_EXPORT GLboolean __WGLEW_NV_render_texture_rectangle; +WGLEW_EXPORT GLboolean __WGLEW_NV_swap_group; +WGLEW_EXPORT GLboolean __WGLEW_NV_vertex_array_range; +WGLEW_EXPORT GLboolean __WGLEW_NV_video_output; +WGLEW_EXPORT GLboolean __WGLEW_OML_sync_control; + +#ifdef GLEW_MX +}; /* WGLEWContextStruct */ +#endif /* GLEW_MX */ + +/* ------------------------------------------------------------------------- */ + +#ifdef GLEW_MX + +typedef struct WGLEWContextStruct WGLEWContext; +GLEWAPI GLenum wglewContextInit (WGLEWContext* ctx); +GLEWAPI GLboolean wglewContextIsSupported (const WGLEWContext* ctx, const char* name); + +#define wglewInit() wglewContextInit(wglewGetContext()) +#define wglewIsSupported(x) wglewContextIsSupported(wglewGetContext(), x) + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&(wglewGetContext()->x)) +#define WGLEW_GET_FUN(x) wglewGetContext()->x + +#else /* GLEW_MX */ + +#define WGLEW_GET_VAR(x) (*(const GLboolean*)&x) +#define WGLEW_GET_FUN(x) x + +GLEWAPI GLboolean wglewIsSupported (const char* name); + +#endif /* GLEW_MX */ + +GLEWAPI GLboolean wglewGetExtension (const char* name); + +#ifdef __cplusplus +} +#endif + +#undef GLEWAPI + +#endif /* __wglew_h__ */ diff --git a/ROMLoad.cpp b/ROMLoad.cpp new file mode 100644 index 0000000..00498bd --- /dev/null +++ b/ROMLoad.cpp @@ -0,0 +1,332 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * ROMLoad.cpp + * + * ROM loading functions. + */ + +#include +#include +#include "Supermodel.h" +#include "Pkgs/unzip.h" + + +/* + * CopyRegion(dest, destOffset, destSize, src, srcSize): + * + * Repeatedly mirror (copy) to destination from source until destination is + * filled. + * + * Parameters: + * dest Destination region. + * destOffset Offset within destination to begin mirroring to. + * destSize Size in bytes of destination region. + * src Source region to copy from. + * srcSize Size of region to copy from. + */ +void CopyRegion(UINT8 *dest, unsigned destOffset, unsigned destSize, UINT8 *src, unsigned srcSize) +{ + while (destOffset < destSize) + { + // If we'll overrun the destination, trim the copy length + if ((destOffset+srcSize) >= destSize) + srcSize = destSize-destOffset; + + // Copy! + memcpy(&dest[destOffset], src, srcSize); + + destOffset += srcSize; + } +} + +// Search for a ROM within a single game based on its CRC +static BOOL FindROMByCRCInGame(const struct GameInfo **gamePtr, int *romIdxPtr, const struct GameInfo *Game, UINT32 crc) +{ + unsigned j; + + for (j = 0; Game->ROM[j].region != NULL; j++) + { + if (crc == Game->ROM[j].crc) // found it! + { + *gamePtr = Game; + *romIdxPtr = j; + return OKAY; + } + } + + return FAIL; +} + +// Search for a ROM in the complete game list based on CRC32 and return its GameInfo and ROMInfo entries +static BOOL FindROMByCRC(const struct GameInfo **gamePtr, int *romIdxPtr, const struct GameInfo *GameList, const struct GameInfo *TryGame, UINT32 crc) +{ + unsigned i; + + if (TryGame != NULL) + { + if (FindROMByCRCInGame(gamePtr, romIdxPtr, TryGame, crc) == OKAY) + return OKAY; + } + + for (i = 0; GameList[i].title != NULL; i++) + { + if (FindROMByCRCInGame(gamePtr, romIdxPtr, &(GameList[i]), crc) == OKAY) + return OKAY; + } + + return FAIL; +} + +static void ByteSwap(UINT8 *buf, unsigned size) +{ + unsigned i; + UINT8 x; + + for (i = 0; i < size; i += 2) + { + x = buf[i+0]; + buf[i+0] = buf[i+1]; + buf[i+1] = x; + } +} + +// Load a single ROM file +static BOOL LoadROM(UINT8 *buf, unsigned bufSize, const struct ROMMap *Map, const struct ROMInfo *ROM, unzFile zf, const char *zipFile, BOOL loadAll) +{ + char file[2048+1]; + int err, bytes; + unz_file_info fileInfo; + unsigned i, j, destIdx, srcIdx; + + // Read the file into the buffer + err = unzGetCurrentFileInfo(zf, &fileInfo, file, 2048, NULL, 0, NULL, 0); + if (err != UNZ_OK) + return ErrorLog("Unable to extract a file name from %s.", zipFile); + if (fileInfo.uncompressed_size != ROM->fileSize) + return ErrorLog("%s in %s is not the correct size (must be %d bytes).", file, zipFile, ROM->fileSize); + err = unzOpenCurrentFile(zf); + if (UNZ_OK != err) + return ErrorLog("Unable to read %s from %s.", file, zipFile); + bytes = unzReadCurrentFile(zf, buf, bufSize); + if (bytes != ROM->fileSize) + { + unzCloseCurrentFile(zf); + return ErrorLog("Unable to read %s from %s.", file, zipFile); + } + err = unzCloseCurrentFile(zf); + if (UNZ_CRCERROR == err) + ErrorLog("CRC error reading %s from %s. File may be corrupt.", file, zipFile); + + // Byte swap + if (ROM->byteSwap) + ByteSwap(buf, ROM->fileSize); + + // Find out how to map the ROM and do it + for (i = 0; Map[i].region != NULL; i++) + { + if (!strcmp(Map[i].region, ROM->region)) + { + destIdx = ROM->offset; + for (srcIdx = 0; srcIdx < ROM->fileSize; ) + { + for (j = 0; j < ROM->groupSize; j++) + Map[i].ptr[destIdx+j] = buf[srcIdx++]; + + destIdx += ROM->stride; + } + + return OKAY; + } + } + + if (loadAll) // need to load all ROMs, so there should be no unmapped regions + return ErrorLog("%s:%d: No mapping for \"%s\".", __FILE__, __LINE__, ROM->region); + else + return OKAY; +} + +/* + * LoadROMSetFromZIPFile(Map, GameList, zipFile): + * + * Loads a complete ROM set from a ZIP archive. Automatically detects the game. + * If multiple games exist within the archive, an error will be printed and all + * but the first detected game will be ignored. + * + * Parameters: + * Map A list of pointers to the memory buffers for each ROM + * region. + * GameList List of all supported games and their ROMs. + * zipFile ZIP file to load from. + * loadAll If true, will check to ensure all ROMs were loaded. + * Otherwise, omits this check and loads only specified + * regions. + * + * Returns: + * Pointer to GameInfo struct for loaded game if successful, NULL + * otherwise. Prints errors. + */ +const struct GameInfo * LoadROMSetFromZIPFile(const struct ROMMap *Map, const struct GameInfo *GameList, const char *zipFile, BOOL loadAll) +{ + unzFile zf; + unz_file_info fileInfo; + const struct GameInfo *Game = NULL, *CurGame; + int romIdx; // index within Game->ROM + unsigned romsFound[sizeof(Game->ROM)/sizeof(struct ROMInfo)], numROMs; + int err; + unsigned i, n, maxSize; + BOOL multipleGameError = FALSE; + UINT8 *buf; + + // Try to open file + zf = unzOpen(zipFile); + if (NULL == zf) + { + ErrorLog("Unable to open %s.", zipFile); + return NULL; + } + + // Check ROMs: scan ZIP file for first known ROM and check to ensure all ROMs are present + memset(romsFound, 0, sizeof(romsFound)); + err = unzGoToFirstFile(zf); + if (UNZ_OK != err) + { + ErrorLog("Unable to read the contents of %s (code %X)", zipFile, err); + return NULL; + } + for (; err != UNZ_END_OF_LIST_OF_FILE; err = unzGoToNextFile(zf)) + { + // Identify the file we're looking at + err = unzGetCurrentFileInfo(zf, &fileInfo, NULL, 0, NULL, 0, NULL, 0); + if (err != UNZ_OK) + continue; + if (OKAY != FindROMByCRC(&CurGame, &romIdx, GameList, Game, fileInfo.crc)) + continue; + if (Game == NULL) // this is the first game we've identified within the ZIP + { + Game = CurGame; + DebugLog("%ROM set identified: %s (%s), %s\n", Game->id, Game->title, zipFile); + } + else + { + if (CurGame != Game) + { + DebugLog("%s also contains: %s (%s)\n", zipFile, CurGame->id, CurGame->title); + if (multipleGameError == FALSE) // only warn about this once + { + ErrorLog("Multiple games were found in %s; loading \"%s\".", zipFile, Game->title); + multipleGameError = TRUE; + } + } + } + + // If we have found a ROM for the correct game, mark it + if (Game == CurGame) + romsFound[romIdx] = 1; + } + + if (Game == NULL) + { + ErrorLog("%s contains no supported games.", zipFile); + return NULL; + } + + // Compute how many ROM files this game has + for (numROMs = 0; Game->ROM[numROMs].region != NULL; numROMs++) + ; + + // If not all ROMs were present, tell the user + err = OKAY; + for (i = 0; i < numROMs; i++) + { + if (romsFound[i] == 0) + err |= ErrorLog("%s (CRC=%08X) is missing from %s.", Game->ROM[i].file, Game->ROM[i].crc, zipFile); + } + if (err != OKAY) + { + unzClose(zf); + return NULL; + //return FAIL; + } + + // Allocate memory for the largest ROM to load + maxSize = 0; + for (i = 0; i < numROMs; i++) + { + if (Game->ROM[i].fileSize > maxSize) + maxSize = Game->ROM[i].fileSize; + } + buf = new(std::nothrow) UINT8[maxSize]; + if (NULL == buf) + { + unzClose(zf); + ErrorLog("Insufficient memory to load ROM files (%d bytes).", maxSize); + return NULL; + } + + // Load ROMs + memset(romsFound, 0, sizeof(romsFound)); + err = unzGoToFirstFile(zf); + if (UNZ_OK != err) + { + ErrorLog("Unable to read the contents of %s (code %X).", zipFile, err); + err = FAIL; + goto Quit; + } + for (; err != UNZ_END_OF_LIST_OF_FILE; err = unzGoToNextFile(zf)) + { + err = unzGetCurrentFileInfo(zf, &fileInfo, NULL, 0, NULL, 0, NULL, 0); + if (err != UNZ_OK) + continue; + if (OKAY != FindROMByCRC(&CurGame, &romIdx, GameList, Game, fileInfo.crc)) + continue; + if (CurGame == Game) // if ROM belongs to correct game + { + if (OKAY == LoadROM(buf, maxSize, Map, &Game->ROM[romIdx], zf, zipFile, loadAll)) + romsFound[romIdx] = 1; // success! mark as loaded + } + } + + // Ensure all ROMs were loaded + if (loadAll) + { + n = 0; + for (i = 0; i < numROMs; i++) + { + if (romsFound[i]) + ++n; + else + ErrorLog("Failed to load %s (CRC=%08X) from %s.", Game->ROM[i].file, Game->ROM[i].crc, zipFile); + } + if (n < numROMs) + err = FAIL; + else + err = OKAY; + } + else + err = OKAY; + +Quit: + unzClose(zf); + delete [] buf; + return (err == OKAY) ? Game : NULL; +} diff --git a/ROMLoad.h b/ROMLoad.h new file mode 100644 index 0000000..1d03174 --- /dev/null +++ b/ROMLoad.h @@ -0,0 +1,118 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * ROMLoad.h + * + * Header file for ROM loading functions. + */ + +#ifndef INCLUDED_ROMLOAD_H +#define INCLUDED_ROMLOAD_H + + +/****************************************************************************** + Data Structures +******************************************************************************/ + +/* + * ROMInfo: + * + * Describes a single ROM file. + */ +struct ROMInfo +{ + // Function + const char *region; // ROM region identifier (used as a key to search ROMMap) + + // Information used to identify files + const char *file; // file name + UINT32 crc; // CRC-32 checksum (same as zip format) + unsigned fileSize; // file size in bytes (must be the same as all other ROMs with same region ID) + + // Interleaving information + unsigned groupSize; // number of consecutive bytes to fetch each time (groupSize%2 must = 0, must be consistent for region) + unsigned offset; // starting offset within ROM region + unsigned stride; // number of bytes to skip before loading next group of bytes from file (must be >= groupSize) + BOOL byteSwap; // swap every pair of bytes if true +}; + +/* + * ROMMap: + * + * Describes how to map ROM regions (where to load them). This structure is + * assembled after memory allocation is completed and tells the ROM loading + * functions where to load files by matching region identifiers with memory + * pointers. + * + * Both pointers must be set to NULL to terminate an array of ROM maps. + */ +struct ROMMap +{ + const char *region; // ROM region identifier + UINT8 *ptr; // pointer to memory region +}; + + +/****************************************************************************** + Functions +******************************************************************************/ + +/* + * CopyRegion(dest, destOffset, destSize, src, srcSize): + * + * Repeatedly mirror (copy) to destination from source until destination is + * filled. + * + * Parameters: + * dest Destination region. + * destOffset Offset within destination to begin mirroring to. + * destSize Size in bytes of destination region. + * src Source region to copy from. + * srcSize Size of region to copy from. + */ +extern void CopyRegion(UINT8 *dest, unsigned destOffset, unsigned destSize, UINT8 *src, unsigned srcSize); + +/* + * LoadROMSetFromZIPFile(Map, GameList, zipFile): + * + * Loads a complete ROM set from a zip archive. Automatically detects the game. + * If multiple games exist within the archive, an error will be printed and all + * but the first detected game will be ignored. + * + * Parameters: + * Map A list of pointers to the memory buffers for each ROM + * region. + * GameList List of all supported games and their ROMs. + * zipFile ZIP file to load from. + * loadAll If true, will check to ensure all ROMs were loaded. + * Otherwise, omits this check and loads only specified + * regions. + * + * Returns: + * Pointer to GameInfo struct for loaded game if successful, NULL + * otherwise. Prints errors. + */ +extern const struct GameInfo * LoadROMSetFromZIPFile(const struct ROMMap *Map, const struct GameInfo *GameList, const char *zipFile, + BOOL loadAll); + + +#endif // INCLUDED_ROMLOAD_H diff --git a/Sound/SCSP.cpp b/Sound/SCSP.cpp new file mode 100644 index 0000000..d130a82 --- /dev/null +++ b/Sound/SCSP.cpp @@ -0,0 +1,2021 @@ + +unsigned char midiCtrlPort=0; + +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * SCSP.cpp + * + * SCSP (Sega Custom Sound Processor) emulation. This code was generously + * donated by ElSemi. Interfaces directly to the 68K processor through + * callbacks. Some minor interface changes were made (external global variables + * were removed). + * + * To-Do List + * ---------- + * - Remove asserts() in DSP code and make sure memory allocation errors are + * being handled properly. + * - Wrap up into an object. Remove any unused #ifdef pathways. + */ + + +/* + SEGA Custom Sound Processor (SCSP) Emulation + by ElSemi. + Driven by MC68000 +*/ + +#include "Supermodel.h" +#include "Sound/SCSP.h" +#include +#include +#include +#include "Sound/SCSPDSP.h" + +//#define NEWSCSP +//#define RB_VOLUME + +//#define REVERB +#define USEDSP + +#define MAX_SCSP 2 +/*#define TIMER_LIMITSA 0x101 +#define TIMER_LIMITSB 0x100 +#define TIMER_LIMITSC 0xff +*/ + +#define TIMER_LIMITSA 0xff +#define TIMER_LIMITSB 0xff +#define TIMER_LIMITSC 0xff + +// These globals control the operation of the SCSP, they are no longer extern and are set through SCSP_SetBuffers(). --Bart +float SysFPS; +//extern "C" A68KContext M68000_regs; +//extern void __cdecl ErrorLogMessage(char *,...); +signed short *bufferl; +signed short *bufferr; +int length; +int cnts; + +signed int *buffertmpl,*buffertmpr; // these are allocated inside this file + +unsigned int srate=44100; + + + +#define REVERB_LEN 0x10000 +#define REVERB_DIF 6000 +#define REVERB_DIV 4 + + +signed short bufferrevr[REVERB_LEN]; +signed short bufferrevl[REVERB_LEN]; +unsigned int RevR,RevW; + +//#define _DEBUG + +#ifndef _DEBUG +#define ErrorLogMessage +#endif + +#ifndef BYTE +#define BYTE UINT8 +#endif + +#ifndef WORD +#define WORD UINT16 +#endif + +#ifndef DWORD +#define DWORD UINT32 +#endif + +static CIRQ *ppcIRQ; +static unsigned ppcSoundIRQBit; +static int (*Run68kCB)(int cycles); +static void (*Int68kCB)(int irq); +static void (*RetIntCB)(); +static DWORD IrqTimA=1; +static DWORD IrqTimBC=2; +static DWORD IrqMidi=3; + +static BYTE MidiOutStack[8]; +static BYTE MidiOutW=0,MidiOutR=0; +static BYTE MidiStack[8]; +static BYTE MidiOutFill; +static BYTE MidiInFill; +static BYTE MidiW=0,MidiR=0; +static BYTE HasSlaveSCSP=0; + +static DWORD FNS_Table[0x400]; +/*static int TLTABLE[256]; +static int LPANTABLE[16]; +static int RPANTABLE[16]; +*/ + +#ifdef RB_VOLUME +static int volume[256*4]; // precalculated attenuation values with some marging for enveloppe and pan levels +static int pan_left[32], pan_right[32]; // pan volume offsets +#else +static float SDLT[8]={-1000000.0,-36.0,-30.0,-24.0,-18.0,-12.0,-6.0,0.0}; +static int LPANTABLE[0x10000]; +static int RPANTABLE[0x10000]; +#endif + +static int TimPris[3]; +static int TimCnt[3]; +static DWORD OnIRQ=0; + +#define SHIFT 12 +#define FIX(v) ((DWORD) ((float) (1<data[0x0]>>0x0)&0x1000) +#define KEYONB(slot) ((slot->data[0x0]>>0x0)&0x0800) +#define SBCTL(slot) ((slot->data[0x0]>>0x9)&0x0003) +#define SSCTL(slot) ((slot->data[0x0]>>0x7)&0x0003) +#define LPCTL(slot) ((slot->data[0x0]>>0x5)&0x0003) +#define PCM8B(slot) ((slot->data[0x0]>>0x0)&0x0010) + +#define SA(slot) (((slot->data[0x0]&0xF)<<16)|(slot->data[0x1])) + +#define LSA(slot) (slot->data[0x2]) + +#define LEA(slot) (slot->data[0x3]) + +#define D2R(slot) ((slot->data[0x4]>>0xB)&0x001F) +#define D1R(slot) ((slot->data[0x4]>>0x6)&0x001F) +#define EGHOLD(slot) ((slot->data[0x4]>>0x0)&0x0020) +#define AR(slot) ((slot->data[0x4]>>0x0)&0x001F) + +#define LPSLNK(slot) ((slot->data[0x5]>>0x0)&0x4000) +#define KRS(slot) ((slot->data[0x5]>>0xA)&0x000F) +#define DL(slot) ((slot->data[0x5]>>0x5)&0x001F) +#define RR(slot) ((slot->data[0x5]>>0x0)&0x001F) + +#define STWINH(slot) ((slot->data[0x6]>>0x0)&0x0200) +#define SDIR(slot) ((slot->data[0x6]>>0x0)&0x0100) +#define TL(slot) ((slot->data[0x6]>>0x0)&0x00FF) + +#define MDL(slot) ((slot->data[0x7]>>0xB)&0x0007) +#define MDXSL(slot) ((slot->data[0x7]>>0x6)&0x003F) +#define MDYSL(slot) ((slot->data[0x7]>>0x0)&0x003F) + +#define OCT(slot) ((slot->data[0x8]>>0xB)&0x000F) +#define FNS(slot) ((slot->data[0x8]>>0x0)&0x03FF) + +#define LFORE(slot) ((slot->data[0x9]>>0x0)&0x8000) +#define LFOF(slot) ((slot->data[0x9]>>0xA)&0x001F) +#define PLFOWS(slot) ((slot->data[0x9]>>0x8)&0x0003) +#define PLFOS(slot) ((slot->data[0x9]>>0x5)&0x0007) +#define ALFOWS(slot) ((slot->data[0x9]>>0x3)&0x0003) +#define ALFOS(slot) ((slot->data[0x9]>>0x0)&0x0007) + +#define ISEL(slot) ((slot->data[0xA]>>0x3)&0x000F) +#define IMXL(slot) ((slot->data[0xA]>>0x0)&0x0007) + +#define DISDL(slot) ((slot->data[0xB]>>0xD)&0x0007) +#define DIPAN(slot) ((slot->data[0xB]>>0x8)&0x001F) +#define EFSDL(slot) ((slot->data[0xB]>>0x5)&0x0007) +#define EFPAN(slot) ((slot->data[0xB]>>0x0)&0x001F) + +//Envelope step (fixed point) +int ARTABLE[64],DRTABLE[64]; + +//Envelope times in ms +double ARTimes[64]={100000/*infinity*/,100000/*infinity*/,8100.0,6900.0,6000.0,4800.0,4000.0,3400.0,3000.0,2400.0,2000.0,1700.0,1500.0, + 1200.0,1000.0,860.0,760.0,600.0,500.0,430.0,380.0,300.0,250.0,220.0,190.0,150.0,130.0,110.0,95.0, + 76.0,63.0,55.0,47.0,38.0,31.0,27.0,24.0,19.0,15.0,13.0,12.0,9.4,7.9,6.8,6.0,4.7,3.8,3.4,3.0,2.4, + 2.0,1.8,1.6,1.3,1.1,0.93,0.85,0.65,0.53,0.44,0.40,0.35,0.0,0.0}; +double DRTimes[64]={100000/*infinity*/,100000/*infinity*/,118200.0,101300.0,88600.0,70900.0,59100.0,50700.0,44300.0,35500.0,29600.0,25300.0,22200.0,17700.0, + 14800.0,12700.0,11100.0,8900.0,7400.0,6300.0,5500.0,4400.0,3700.0,3200.0,2800.0,2200.0,1800.0,1600.0,1400.0,1100.0, + 920.0,790.0,690.0,550.0,460.0,390.0,340.0,270.0,230.0,200.0,170.0,140.0,110.0,98.0,85.0,68.0,57.0,49.0,43.0,34.0, + 28.0,25.0,22.0,18.0,14.0,12.0,11.0,8.5,7.1,6.1,5.4,4.3,3.6,3.1}; + + +typedef enum {ATTACK,DECAY1,DECAY2,RELEASE} _STATE; +struct _EG +{ + int volume; // + _STATE state; + int step; + //step vals + int AR; //Attack + int D1R; //Decay1 + int D2R; //Decay2 + int RR; //Release + + int DL; //Decay level + BYTE EGHOLD; + BYTE LPLINK; +}; + +struct _SLOT +{ + union + { + WORD data[0x10]; //only 0x1a bytes used + BYTE datab[0x20]; + }; + BYTE active; //this slot is currently playing + BYTE *base; //samples base address + DWORD cur_addr; //current play address (24.8) + DWORD step; //pitch step (24.8) + BYTE Back; + _EG EG; //Envelope + _LFO PLFO; //Phase LFO + _LFO ALFO; //Amplitude LFO + int slot; + signed short Prev; //Previous sample (for interpolation) +}; + +#define MEM4B(scsp) ((scsp->data[0]>>0x0)&0x0200) +#define DAC18B(scsp) ((scsp->data[0]>>0x0)&0x0100) +#define MVOL(scsp) ((scsp->data[0]>>0x0)&0x000F) +#define RBL(scsp) ((scsp->data[1]>>0x7)&0x0003) +#define RBP(scsp) ((scsp->data[1]>>0x0)&0x007F) +#define MOFULL(scsp) ((scsp->data[2]>>0x0)&0x1000) +#define MOEMPTY(scsp) ((scsp->data[2]>>0x0)&0x0800) +#define MIOVF(scsp) ((scsp->data[2]>>0x0)&0x0400) +#define MIFULL(scsp) ((scsp->data[2]>>0x0)&0x0200) +#define MIEMPTY(scsp) ((scsp->data[2]>>0x0)&0x0100) + +#define SCILV0(scsp) ((scsp->data[0x24/2]>>0x0)&0xff) +#define SCILV1(scsp) ((scsp->data[0x26/2]>>0x0)&0xff) +#define SCILV2(scsp) ((scsp->data[0x28/2]>>0x0)&0xff) + +#define SCIEX0 0 +#define SCIEX1 1 +#define SCIEX2 2 +#define SCIMID 3 +#define SCIDMA 4 +#define SCIIRQ 5 +#define SCITMA 6 +#define SCITMB 7 + +struct _SCSP +{ + union + { + WORD data[0x30/2]; + BYTE datab[0x30]; + }; + _SLOT Slots[32]; + signed short RINGBUF[64]; + unsigned char BUFPTR; + unsigned char *SCSPRAM; + char Master; +#ifdef USEDSP + _SCSPDSP DSP; + signed short *MIXBuf; +#endif +} SCSPs[MAX_SCSP],*SCSP=SCSPs; + +signed short *RBUFDST; //this points to where the sample will be stored in the RingBuf + +unsigned char DecodeSCI(unsigned char irq) +{ + unsigned char SCI=0; + unsigned char v; + v=(SCILV0((SCSP))&(1<63) Rate=63; + if(Rate<0) Rate=0; + return ARTABLE[Rate]; +} + +int Get_DR(int base,int R) +{ + int Rate=base+(R<<1); +// int Rate=(base+R)<<1; + if(Rate>63) Rate=63; + if(Rate<0) Rate=0; + return DRTABLE[Rate]; +} + +int Get_RR(int base,int R) +{ + int Rate=base+(R<<1); +// int Rate=(base+R)<<1; + if(Rate>63) Rate=63; + if(Rate<0) Rate=0; + return DRTABLE[Rate]; +} + +void Compute_EG(_SLOT *slot) +{ + int octave=OCT(slot); + int rate; + if(octave&8) octave=octave-16; + if(KRS(slot)!=0xf) + rate=2*(octave+KRS(slot))+((FNS(slot)>>9)&1); + else + rate=((FNS(slot)>>9)&1); + slot->EG.volume=0; + slot->EG.AR=Get_AR(rate,AR(slot)); + slot->EG.D1R=Get_DR(rate,D1R(slot)); + slot->EG.D2R=Get_DR(rate,D2R(slot)); + slot->EG.RR=Get_RR(rate,RR(slot)); + slot->EG.DL=0x1f-DL(slot); + slot->EG.EGHOLD=EGHOLD(slot); +} + +void SCSP_StopSlot(_SLOT *slot,int keyoff); + +int EG_Update(_SLOT *slot) +{ + + switch(slot->EG.state) + { + case ATTACK: + slot->EG.volume+=slot->EG.AR; + if(slot->EG.volume>=(0x3ff<EG.state=DECAY1; + if(slot->EG.D1R>=(1024<EG.state=DECAY2; + slot->EG.volume=0x3ff<EG.EGHOLD) + return 0x3ff<<(SHIFT-10); + break; + case DECAY1: + slot->EG.volume-=slot->EG.D1R; + if((slot->EG.volume>>(EG_SHIFT+5))<=slot->EG.DL) + slot->EG.state=DECAY2; + break; + case DECAY2: + if(slot->EG.volume<=0 || slot->EG.DL==0) + { + slot->EG.volume=0; + SCSP_StopSlot(slot,0); + } + if(D2R(slot)==0) + return (slot->EG.volume>>EG_SHIFT)<<(SHIFT-10); + slot->EG.volume-=slot->EG.D2R; + if(slot->EG.volume<=0) + slot->EG.volume=0; + + break; + case RELEASE: + slot->EG.volume-=slot->EG.RR; + if(slot->EG.volume<=0) + { + SCSP_StopSlot(slot,0); + slot->EG.volume=0; + slot->EG.state=ATTACK; + } + //slot->EG.volume=0; + break; + default: + return 1<EG.volume>>EG_SHIFT)<<(SHIFT-10); + +} + +DWORD SCSP_Step(_SLOT *slot) +{ + int octave=OCT(slot); + int Fn; + /* + int Fo=44100; + if(octave&8) + Fo>>=(16-octave); + else + Fo<<=octave; + Fn=Fo*(((FNS(slot))<<(SHIFT-10))|(1<>=(16-octave); + else + Fn<<=octave; + + + return Fn/srate; +} + +void Compute_LFO(_SLOT *slot) +{ + if(PLFOS(slot)!=0) + LFO_ComputeStep(&(slot->PLFO),LFOF(slot),PLFOWS(slot),PLFOS(slot),0); + if(ALFOS(slot)!=0) + LFO_ComputeStep(&(slot->ALFO),LFOF(slot),ALFOWS(slot),ALFOS(slot),1); +} + +void SCSP_StartSlot(_SLOT *slot) +{ + slot->active=1; + slot->Back=0; + slot->base=SCSP->SCSPRAM+SA(slot); + slot->cur_addr=0; + slot->step=SCSP_Step(slot); + Compute_EG(slot); + slot->EG.state=ATTACK; + slot->EG.volume=0; + slot->Prev=0; + Compute_LFO(slot); + /*{ + char aux[12]; + static n=0; + sprintf(aux,"smp%d.raw",n); + FILE *f=fopen(aux,"wb"); + fwrite(slot->base,LEA(slot),1,f); + fclose(f); + ++n; + } + */ + +} + +void SCSP_StopSlot(_SLOT *slot,int keyoff) +{ + if(keyoff && slot->EG.state!=RELEASE) + { + slot->EG.state=RELEASE; +// return; + } + else + slot->active=0; + slot->data[0]&=~0x800; + DebugLog("KEYOFF2 %d",slot->slot); +} + +#define log2(n) (log((float) n)/log((float) 2)) + +void SCSP_Init(int n) +{ + if(n==2) + { + SCSP=SCSPs+1; + memset(SCSP,0,sizeof(SCSP)); + SCSP->Master=0; + HasSlaveSCSP=1; +#ifdef USEDSP + SCSPDSP_Init(&SCSP->DSP); +#endif + + } + SCSP=SCSPs+0; + memset(SCSP,0,sizeof(SCSP)); +#ifdef USEDSP + SCSPDSP_Init(&SCSP->DSP); +#endif + SCSP->Master=1; + RevR=0; + RevW=REVERB_DIF; + memset(bufferrevl,0,sizeof(bufferrevl)); + memset(bufferrevr,0,sizeof(bufferrevr)); + MidiR=MidiW=0; + MidiOutR=MidiOutW=0; + MidiOutFill=0; + MidiInFill=0; + for(int i=0;i<0x400;++i) + { + float fcent=(double) 1200.0*log2((double)(((double) 1024.0+(double)i)/(double)1024.0)); + //float fcent=1.0+(float) i/1024.0; + fcent=(double) 44100.0*pow(2.0,fcent/1200.0); + FNS_Table[i]=(float) (1<>(10-SHIFT))|(1<>0x8)&0xff; + int iPAN=(i>>0x0)&0x1f; + int iSDL=(i>>0x5)&0x07; + + float TL=1.0; + float SegaDB=0; + //2^(-(TL-2^4)) + /*if(iTL&0x01) TL*=0.95760; + if(iTL&0x02) TL*=0.91700; + if(iTL&0x04) TL*=0.84090; + if(iTL&0x08) TL*=0.70711; + if(iTL&0x10) TL*=0.50000; + if(iTL&0x20) TL*=0.25000; + if(iTL&0x40) TL*=0.06250; + if(iTL&0x80) TL*=0.00391;*/ + if(iTL&0x01) SegaDB-=0.4; + if(iTL&0x02) SegaDB-=0.8; + if(iTL&0x04) SegaDB-=1.5; + if(iTL&0x08) SegaDB-=3; + if(iTL&0x10) SegaDB-=6; + if(iTL&0x20) SegaDB-=12; + if(iTL&0x40) SegaDB-=24; + if(iTL&0x80) SegaDB-=48; + + TL=pow(10.0,SegaDB/20.0); + + float PAN=1.0; + //2^(-2^(PAN-2)) + /*if(iPAN&0x1) PAN*=0.70711; + if(iPAN&0x2) PAN*=0.50000; + if(iPAN&0x4) PAN*=0.25000; + if(iPAN&0x8) PAN*=0.06250; + if(iPAN==0xf) PAN=0.0;*/ + + SegaDB=0; + if(iPAN&0x1) SegaDB-=3; + if(iPAN&0x2) SegaDB-=6; + if(iPAN&0x4) SegaDB-=12; + if(iPAN&0x8) SegaDB-=24; + + if(iPAN==0xf) PAN=0.0; + else if(iPAN==0x1f) PAN=0.0; + else PAN=pow(10.0,SegaDB/20.0); + + float LPAN,RPAN; + + if(iPAN<0x10) + { + LPAN=PAN; + RPAN=1.0; + } + else + { + RPAN=PAN; + LPAN=1.0; + } + + float SDL=1.0; + if(iSDL) + SDL=pow(10.0,(SDLT[iSDL])/20.0); + else + SDL=0.0; + + if(iSDL==0x6) + int a=1; + if(iTL==0x3a) + int a=1; + + LPANTABLE[i]=FIX((4.0*LPAN*TL*SDL)); + RPANTABLE[i]=FIX((4.0*RPAN*TL*SDL)); + + + } +#endif + /*for(i=0;i<4;++i) + ARTABLE[i]=DRTABLE[i]=0; + for(i=4;i<62;++i)*/ + + /*for(i=2;i<62;++i) + { + //double t=BaseTimes[i]; //In ms + double t=BaseTimes2[i/2]/AR2DR; //In ms + double step=(1023*1000.0)/((float) srate*t); + double scale=(double) (1<MIXBuf=(signed short *) malloc(0x300*32*sizeof(signed short)); +#endif + + LFO_Init(); + buffertmpl=(signed int*) malloc(44100*sizeof(signed int)); + buffertmpr=(signed int*) malloc(44100*sizeof(signed int)); + memset(buffertmpl,0,44100*sizeof(signed int)); + memset(buffertmpr,0,44100*sizeof(signed int)); +} + +void SCSP_SetRAM(int n,unsigned char *r) +{ + SCSPs[n].SCSPRAM=r; +#ifdef USEDSP + SCSPs[n].DSP.SCSPRAM=(unsigned short*) r; +#endif +} + +void SCSP_UpdateSlotReg(int s,int r) +{ + _SLOT *slot=SCSP->Slots+s; + switch(r&0x3f) + { + case 0: + case 1: + if(KEYONEX(slot)) + { + for(int sl=0;sl<32;++sl) + { + _SLOT *s2=SCSP->Slots+sl; + if(!KEYONB(s2) && sl==cnts && s2->active) + int a=1; + //if(s2->EG.state!=RELEASE) + { + if(KEYONB(s2) && (!s2->active || (s2->active && s2->EG.state==RELEASE))) + { + DebugLog("KEYON %d",sl); + SCSP_StartSlot(s2); + } + if(!KEYONB(s2) && s2->active) + { + //s2->active=0; + SCSP_StopSlot(s2,1); + DebugLog("KEYOFF %d",sl); + } + } + } + slot->data[0]&=~0x1000; + } + break; + case 0x10: + case 0x11: + slot->step=SCSP_Step(slot); + break; + case 0xA: + case 0xB: + if(slot->active) + int a=1; +// if(RR(slot)==0x1f) +// SCSP_StopSlot(slot,0); + slot->EG.RR=Get_RR(0,RR(slot)); + slot->EG.DL=0x1f-DL(slot); + break; + case 0x12: + case 0x13: + Compute_LFO(slot); + break; + } +} + +void SCSP_UpdateReg(int reg) +{ + switch(reg&0x3f) + { + case 0x2: + case 0x3: + { +#ifdef USEDSP + unsigned int v=RBL(SCSP); + SCSP->DSP.RBP=RBP(SCSP); + if(v==0) + SCSP->DSP.RBL=8*1024; + else if(v==1) + SCSP->DSP.RBL=16*1024; + else if(v==2) + SCSP->DSP.RBL=32*1024; + else if(v==3) + SCSP->DSP.RBL=64*1024; +#endif + } + break; + + case 0x6: + case 0x7: + SCSP_MidiOutW(SCSP->data[0x6/2]&0xff); + break; + +/* case 0x8: + case 0x9: + { + unsigned char slot=SCSP.data[0x8/2]>>11; + int a=1; + + } + break; +*/ + case 0x12: + case 0x13: + case 0x14: + case 0x15: + case 0x16: + case 0x17: + { + int a=1; + } + break; + case 0x18: + case 0x19: + if(SCSP->Master) + { + TimPris[0]=1<<((SCSP->data[0x18/2]>>8)&0x7); + TimCnt[0]=((SCSP->data[0x18/2]&0xff)<<8)|(TimCnt[0]&0xff); + } + break; + case 0x1a: + case 0x1b: + if(SCSP->Master) + { + TimPris[1]=1<<((SCSP->data[0x1A/2]>>8)&0x7); + TimCnt[1]=((SCSP->data[0x1A/2]&0xff)<<8)|(TimCnt[1]&0xff); + } + break; + case 0x1C: + case 0x1D: + if(SCSP->Master) + { + TimPris[2]=1<<((SCSP->data[0x1C/2]>>8)&0x7); + TimCnt[2]=((SCSP->data[0x1C/2]&0xff)<<8)|(TimCnt[2]&0xff); + } + break; + case 0x22: //SCIRE + case 0x23: + if(SCSP->Master) + { + SCSP->data[0x20/2]&=~SCSP->data[0x22/2]; + CheckPendingIRQ(); + } + break; + case 0x24: + case 0x25: + case 0x26: + case 0x27: + case 0x28: + case 0x29: + if(SCSP->Master) + { + IrqTimA=DecodeSCI(SCITMA); + IrqTimBC=DecodeSCI(SCITMB); + IrqMidi=DecodeSCI(SCIMID); + } + break; + } +} + +void SCSP_UpdateSlotRegR(int slot,int reg) +{ + +} + +void SCSP_UpdateRegR(int reg) +{ + switch(reg&0x3f) + { + case 4: + case 5: + { + unsigned short v=SCSP->data[0x5/2]; + v&=0xff00; + v|=MidiStack[MidiR]; + printf("read MIDI\n"); + if(MidiR!=MidiW) + { + ++MidiR; + MidiR&=7; + //Int68kCB(IrqMidi); + + } + + MidiInFill--; + SCSP->data[0x5/2]=v; + } + break; + case 8: + case 9: + { + unsigned char slot=SCSP->data[0x8/2]>>11; + unsigned int CA=SCSP->Slots[slot&0x1f].cur_addr>>(SHIFT+12); + SCSP->data[0x8/2]&=~(0x780); + SCSP->data[0x8/2]|=CA<<7; + } + break; + } +} + + +void SCSP_w8(unsigned int addr,unsigned char val) +{ + addr&=0xffff; + if(addr<0x400) + { + int slot=addr/0x20; + addr&=0x1f; + DebugLog("Slot %02X Reg %02X write byte %04X",slot,addr^1,val); + *((unsigned char *) (SCSP->Slots[slot].datab+(addr^1))) = val; + SCSP_UpdateSlotReg(slot,(addr^1)&0x1f); + } + else if(addr<0x600) + { + *((unsigned char *) (SCSP->datab+((addr&0xff)^1))) = val; + SCSP_UpdateReg((addr^1)&0xff); + } + else if(addr<0x700) + SCSP->RINGBUF[(addr-0x600)/2]=val; + else + { +#ifdef USEDSP + //DSP + if(addr<0x780) //COEF + *(((unsigned char *) SCSP->DSP.COEF) + ((addr-0x700)^1))=val; + else if(addr<0x7C0) + *(((unsigned char *) SCSP->DSP.MADRS) + ((addr-0x780)^1))=val; + else if(addr>=0x800 && addr<0xC00) + *(((unsigned char *) SCSP->DSP.MPRO) + ((addr-0x800)^1))=val; + else + int a=1; + if(addr==0xBFE) + { + SCSPDSP_Start(&SCSP->DSP); + } + int a=1; +#endif + } +} + +void SCSP_w16(unsigned int addr,unsigned short val) +{ + addr&=0xffff; + if(addr<0x400) + { + int slot=addr/0x20; + addr&=0x1f; + DebugLog("Slot %02X Reg %02X write word %04X",slot,addr,val); + *((unsigned short *) (SCSP->Slots[slot].datab+(addr))) = val; + SCSP_UpdateSlotReg(slot,addr&0x1f); + } + else if(addr<0x600) + { + *((unsigned short *) (SCSP->datab+((addr&0xff)))) = val; + SCSP_UpdateReg(addr&0xff); + } + else if(addr<0x700) + SCSP->RINGBUF[(addr-0x600)/2]=val; + else + { +#ifdef USEDSP + //DSP + if(addr<0x780) //COEF + *((unsigned short *) (SCSP->DSP.COEF+(addr-0x700)/2))=val; + else if(addr<0x800) + *((unsigned short *) (SCSP->DSP.MADRS+(addr-0x780)/2))=val; + else if(addr<0xC00) + *((unsigned short *) (SCSP->DSP.MPRO+(addr-0x800)/2))=val; + else + int a=1; + if(addr==0xBFE) + SCSPDSP_Start(&SCSP->DSP); + int a=1; +#endif + + } +} + +void SCSP_w32(unsigned int addr,unsigned int val) +{ + addr&=0xffff; + + if(addr<0x400) + { + int slot=addr/0x20; + addr&=0x1f; + DebugLog("Slot %02X Reg %02X write dword %08X",slot,addr,val); + _asm rol val,16 + *((unsigned int *) (SCSP->Slots[slot].datab+(addr))) = val; + SCSP_UpdateSlotReg(slot,addr&0x1f); + SCSP_UpdateSlotReg(slot,(addr&0x1f)+2); + } + else if(addr<0x600) + { + _asm rol val,16 + *((unsigned int *) (SCSP->datab+((addr&0xff)))) = val; + SCSP_UpdateReg(addr&0xff); + SCSP_UpdateReg((addr&0xff)+2); + } + else if(addr<0x700) + int a=1; + else + { +#ifdef USEDSP + //DSP + _asm rol val,16 + if(addr<0x780) //COEF + *((unsigned int *) (SCSP->DSP.COEF+(addr-0x700)/2))=val; + else if(addr<0x800) + *((unsigned int *) (SCSP->DSP.MADRS+(addr-0x780)/2))=val; + else if(addr<0xC00) + *((unsigned int *) (SCSP->DSP.MPRO+(addr-0x800)/2))=val; + else + int a=1; + if(addr==0xBFC) + SCSPDSP_Start(&SCSP->DSP); + int a=1; +#endif + } +} + +unsigned char SCSP_r8(unsigned int addr) +{ + unsigned char v=0; + addr&=0xffff; + if(addr<0x400) + { + int slot=addr/0x20; + addr&=0x1f; + SCSP_UpdateSlotRegR(slot,(addr^1)&0x1f); + + v=*((unsigned char *) (SCSP->Slots[slot].datab+(addr^1))); + DebugLog("Slot %02X Reg %02X Read byte %02X",slot,addr^1,v); + } + else if(addr<0x600) + { + SCSP_UpdateRegR(addr&0xff); + v= *((unsigned char *) (SCSP->datab+((addr&0xff)^1))); + //ErrorLogMessage("SCSP Reg %02X Read byte %02X",addr&0xff,v); + } + else if(addr<0x700) + v=0; + return v; +} + +unsigned short SCSP_r16(unsigned int addr) +{ + unsigned short v=0; + addr&=0xffff; + if(addr<0x400) + { + int slot=addr/0x20; + addr&=0x1f; + SCSP_UpdateSlotRegR(slot,addr&0x1f); + v=*((unsigned short *) (SCSP->Slots[slot].datab+(addr))); + DebugLog("Slot %02X Reg %02X Read word %04X",slot,addr,v); + } + else if(addr<0x600) + { + SCSP_UpdateRegR(addr&0xff); + v= *((unsigned short *) (SCSP->datab+((addr&0xff)))); + //ErrorLogMessage("SCSP Reg %02X Read word %04X",addr&0xff,v); + } + else if(addr<0x700) + v=SCSP->RINGBUF[(addr-0x600)/2]; + return v; +} + +unsigned int SCSP_r32(unsigned int addr) +{ + return 0xffffffff; +} + +#define REVSIGN(v) ((~v)+1) + + +void SCSP_TimersAddTicks2(int ticks) +{ + //Update timers + WORD cnt; + WORD step; + //Timer A + + if(!TimPris[0]) + { + //cnt=SCSPs[0].data[0x18/2]&0xff; + cnt=TimCnt[0]; + if(cnt==0xffff) + goto noTA; + ++cnt; + ++TimCnt[0]; + if(cnt>=TIMER_LIMITSA) + { + /*if((SCSPs[0].data[0x20/2]&SCSPs[0].data[0x1e/2])&0x40) //timer pending ack + int a=1;*/ + SCSPs[0].data[0x20/2]|=0x40; + /*if(SCSP.data[0x1e/2]&0x40) + Int68kCB(IrqTimA);*/ + cnt=0xff; + TimCnt[0]=0xffff; + } + step=1<<((SCSPs[0].data[0x18/2]>>8)&0x7); + TimPris[0]=step; + SCSPs[0].data[0x18/2]&=0xff00; + SCSPs[0].data[0x18/2]|=cnt; + } +// else + TimPris[0]--; +noTA: +; + //Timer B + + if(!TimPris[1]) + { + //cnt=SCSPs[0].data[0x1a/2]&0xff; + cnt=TimCnt[1]; + if(cnt==0xffff) + goto noTB; + ++cnt; + ++TimCnt[1]; + if(cnt>=TIMER_LIMITSB) + { + /*if((SCSP.data[0x20/2]&SCSP.data[0x1e/2])&0x80) //timer pending ack + int a=1;*/ + SCSPs[0].data[0x20/2]|=0x80; + /*if(SCSP.data[0x1e/2]&0x80) + Int68kCB(IrqTimBC);*/ + cnt=0xff; + TimCnt[1]=0xffff; + } + step=1<<((SCSP[0].data[0x1a/2]>>8)&0x7); + TimPris[1]=step; + SCSPs[0].data[0x1a/2]&=0xff00; + SCSPs[0].data[0x1a/2]|=cnt; + } +// else + TimPris[1]--; +noTB: +; + //Timer C + + if(!TimPris[2]) + { + //cnt=SCSPs[0].data[0x1c/2]&0xff; + cnt=TimCnt[2]; + if(cnt==0xffff) + goto noTC; + ++cnt; + ++TimCnt[2]; + if(cnt>=TIMER_LIMITSC) + { + /*if((SCSP.data[0x20/2]&SCSP.data[0x1e/2])&0x100) //timer pending ack + int a=1;*/ + SCSP[0].data[0x20/2]|=0x100; + /*if(SCSP.data[0x1e/2]&0x100) + Int68kCB(IrqTimBC);*/ + cnt=0xff; + TimCnt[2]=0xffff; + } + step=1<<((SCSPs[0].data[0x1c/2]>>8)&0x7); + TimPris[2]=step; + SCSPs[0].data[0x1c/2]&=0xff00; + SCSPs[0].data[0x1c/2]|=cnt; + } +// else + TimPris[2]--; +noTC: +; +} + +void SCSP_TimersAddTicks(int ticks) +{ + if(TimCnt[0]<=0xff00) + { + TimCnt[0]+=ticks << (8-((SCSPs[0].data[0x18/2]>>8)&0x7)); + if (TimCnt[0] > 0xFE00) + { + TimCnt[0] = 0xFFFF; + SCSPs[0].data[0x20/2]|=0x40; + } + SCSPs[0].data[0x18/2]&=0xff00; + SCSPs[0].data[0x18/2]|=TimCnt[0]>>8; + } + if(TimCnt[1]<=0xff00) + { + TimCnt[1]+=ticks << (8-((SCSPs[0].data[0x1a/2]>>8)&0x7)); + if (TimCnt[1] > 0xFE00) + { + TimCnt[1] = 0xFFFF; + SCSPs[0].data[0x20/2]|=0x80; + } + SCSPs[0].data[0x1a/2]&=0xff00; + SCSPs[0].data[0x1a/2]|=TimCnt[1]>>8; + + } + if(TimCnt[2]<=0xff00) + { + TimCnt[2]+=ticks << (8-((SCSPs[0].data[0x1c/2]>>8)&0x7)); + if (TimCnt[2] > 0xFE00) + { + TimCnt[2] = 0xFFFF; + SCSPs[0].data[0x20/2]|=0x100; + } + SCSPs[0].data[0x1c/2]&=0xff00; + SCSPs[0].data[0x1c/2]|=TimCnt[2]>>8; + } + +} + + +#ifdef NEWSCSP + +#ifdef USEDSP +const bool hasDSP=true; + +#else +const bool hasDSP=false; +#endif +signed short *bufmix; + +signed int *bufl1,*bufr1; +#define SCSPNAME(_8bit,lfo,alfo,loop) \ +void SCSP_Update##_8bit##lfo##alfo##loop(_SLOT *slot,unsigned int Enc,unsigned int nsamples) + +//TRUST ON THE COMPILER OPTIMIZATIONS +#define SCSPTMPL(_8bit,lfo,alfo,loop) \ +SCSPNAME(_8bit,lfo,alfo,loop)\ +{\ + signed int sample;\ + DWORD addr;\ + for(unsigned int s=0;sstep;\ + if(!slot->active)\ + return;\ + if(lfo) \ + {\ + step=step*PLFO_Step(&(slot->PLFO));\ + step>>=SHIFT; \ + }\ + if(_8bit)\ + {\ + unsigned int offs=(slot->cur_addr>>SHIFT);\ + signed char *p=(signed char *) (slot->base);\ + int s;\ + signed int fpart=slot->cur_addr&((1<>SHIFT)<<8;\ + }\ + else\ + {\ + signed short *p=(signed short *) (slot->base+((slot->cur_addr>>(SHIFT-1))&(~1)));\ + signed int fpart=slot->cur_addr&((1<cur_addr+=step;\ + addr=slot->cur_addr>>SHIFT;\ + if(addr>LEA(slot))\ + {\ + SCSP_StopSlot(slot,0);\ + }\ + }\ + if(loop==1)\ + {\ + slot->cur_addr+=step;\ + addr=slot->cur_addr>>SHIFT;\ + if(addr>LEA(slot))\ + slot->cur_addr=(LSA(slot)+1)<Back)\ + slot->cur_addr+=REVSIGN(step);\ + else\ + slot->cur_addr+=step;\ + addr=slot->cur_addr>>SHIFT;\ + if(addr>=LEA(slot))\ + {\ + slot->cur_addr=LEA(slot)<Back=1;\ + }\ + if((addrBack)\ + slot->cur_addr=LEA(slot)<Back)\ + slot->cur_addr+=REVSIGN(step);\ + else\ + slot->cur_addr+=step;\ + addr=slot->cur_addr>>SHIFT;\ + if(addr>=LEA(slot)) /*reached end, reverse till start*/ \ + {\ + slot->cur_addr=LEA(slot)<Back=1;\ + }\ + if((addr<=LSA(slot) || (addr&0x80000000)) && slot->Back) /*reached start or negative*/\ + {\ + slot->cur_addr=LSA(slot)<Back=0;\ + }\ + }\ + if(alfo)\ + {\ + sample=sample*ALFO_Step(&(slot->ALFO));\ + sample>>=SHIFT;\ + }\ + *RBUFDST=sample;\ + \ + sample=(sample*EG_Update(slot))>>SHIFT;\ + if(hasDSP)\ + *bufmix++=((sample*LPANTABLE[(Enc|0xE0)&0xFFE0])>>(SHIFT+3));\ + \ + *bufl1=*bufl1 + ((sample*LPANTABLE[Enc])>>SHIFT);\ + *bufr1=*bufr1 + ((sample*RPANTABLE[Enc])>>SHIFT);\ + ++bufl1;\ + ++bufr1;\ + }\ +} + +SCSPTMPL(0,0,0,0) SCSPTMPL(0,0,0,1) SCSPTMPL(0,0,0,2) SCSPTMPL(0,0,0,3) +SCSPTMPL(0,0,1,0) SCSPTMPL(0,0,1,1) SCSPTMPL(0,0,1,2) SCSPTMPL(0,0,1,3) +SCSPTMPL(0,1,0,0) SCSPTMPL(0,1,0,1) SCSPTMPL(0,1,0,2) SCSPTMPL(0,1,0,3) +SCSPTMPL(0,1,1,0) SCSPTMPL(0,1,1,1) SCSPTMPL(0,1,1,2) SCSPTMPL(0,1,1,3) +SCSPTMPL(1,0,0,0) SCSPTMPL(1,0,0,1) SCSPTMPL(1,0,0,2) SCSPTMPL(1,0,0,3) +SCSPTMPL(1,0,1,0) SCSPTMPL(1,0,1,1) SCSPTMPL(1,0,1,2) SCSPTMPL(1,0,1,3) +SCSPTMPL(1,1,0,0) SCSPTMPL(1,1,0,1) SCSPTMPL(1,1,0,2) SCSPTMPL(1,1,0,3) +SCSPTMPL(1,1,1,0) SCSPTMPL(1,1,1,1) SCSPTMPL(1,1,1,2) SCSPTMPL(1,1,1,3) + +#undef SCSPTMPL +#define SCSPTMPL(_8bit,lfo,alfo,loop) \ + SCSP_Update##_8bit##lfo##alfo##loop , + + +typedef void (*_SCSPUpdateModes)(_SLOT *,unsigned int,unsigned int); + +_SCSPUpdateModes SCSPUpdateModes[]= +{ + SCSPTMPL(0,0,0,0) SCSPTMPL(0,0,0,1) SCSPTMPL(0,0,0,2) SCSPTMPL(0,0,0,3) + SCSPTMPL(0,0,1,0) SCSPTMPL(0,0,1,1) SCSPTMPL(0,0,1,2) SCSPTMPL(0,0,1,3) + SCSPTMPL(0,1,0,0) SCSPTMPL(0,1,0,1) SCSPTMPL(0,1,0,2) SCSPTMPL(0,1,0,3) + SCSPTMPL(0,1,1,0) SCSPTMPL(0,1,1,1) SCSPTMPL(0,1,1,2) SCSPTMPL(0,1,1,3) + SCSPTMPL(1,0,0,0) SCSPTMPL(1,0,0,1) SCSPTMPL(1,0,0,2) SCSPTMPL(1,0,0,3) + SCSPTMPL(1,0,1,0) SCSPTMPL(1,0,1,1) SCSPTMPL(1,0,1,2) SCSPTMPL(1,0,1,3) + SCSPTMPL(1,1,0,0) SCSPTMPL(1,1,0,1) SCSPTMPL(1,1,0,2) SCSPTMPL(1,1,0,3) + SCSPTMPL(1,1,1,0) SCSPTMPL(1,1,1,1) SCSPTMPL(1,1,1,2) SCSPTMPL(1,1,1,3) + +}; + +#define SCANLINES 210 + +void SCSP_CpuRunScanline() +{ + int slice=12000000/(44100); + static unsigned int smp=0; + smp+=(unsigned int) ((256.0*44100.0)/((float) SCANLINES*SysFPS)); + int lastdiff=0; + for(;smp&0xffffff00;) + { + lastdiff=Run68kCB(slice+lastdiff); + /*while(slice>0) + { + lastdiff=Run68kCB(1); + slice+=lastdiff; + if(M68000_regs.pc==0x0602620) + int a=1; + }*/ + SCSP_TimersAddTicks(1); + CheckPendingIRQ(); + smp-=0x100; + } +} + +void SCSP_DoMasterSamples(int nsamples) +{ + + static int lastdiff=0; + signed short *bufr,*bufl; + + + for(int sl=0;sl<32;++sl) + { + bufr1=buffertmpr; + bufl1=buffertmpl; +// if(sl!=0x3) +// continue; + + if(SCSPs[0].Slots[sl].active) + { + _SLOT *slot=SCSPs[0].Slots+sl; + unsigned int disdl=DISDL(slot); + unsigned int efsdl=EFSDL(slot); + unsigned int tl=TL(slot); + unsigned short Enc=((TL(slot))<<0x8)|((DIPAN(slot))<<0x0)|((DISDL(slot))<<0x5); + //unsigned short Enc=(0x00)|((DIPAN(slot))<<0x8)|((0x7)<<0xd); + unsigned int mode=LPCTL(slot); + +/* if(SSCTL(slot)!=0) //no FM or noise yet + int a=1; + int MDX=MDXSL(slot); + int MDY=MDYSL(slot); + int LEV=MDL(slot); + if(LEV!=0 || MDX!=0 || MDY!=0) + goto norender; + if(SBCTL(slot)) + int a=1; + +*/ + RBUFDST=SCSPs[0].RINGBUF+SCSPs[0].BUFPTR; + if(sl==0x15) + int a=1; + if(PLFOS(slot)) + mode|=8; + if(ALFOS(slot)) + mode|=4; + if(PCM8B(slot)) + mode|=0x10; +#ifdef USEDSP + bufmix=SCSPs[0].MIXBuf+0x300*slot->slot; +#endif + + SCSPUpdateModes[mode](slot,Enc,nsamples); +//norender: +//; + + } + ++SCSPs[0].BUFPTR; + SCSPs[0].BUFPTR&=63; + } + if(HasSlaveSCSP) + { + for(int sl=0;sl<32;++sl) + { + bufr1=buffertmpr; + bufl1=buffertmpl; + if(SCSPs[1].Slots[sl].active) + { + _SLOT *slot=SCSPs[1].Slots+sl; + //unsigned short Enc=((TL(slot))<<0x0)|((DIPAN(slot))<<0x8)|((0x7)<<0xd); + unsigned short Enc=((TL(slot))<<0x8)|((DIPAN(slot))<<0x0)|((DISDL(slot))<<0x5); + unsigned int mode=LPCTL(slot); + + if(PLFOS(slot)) + mode|=8; + if(ALFOS(slot)) + mode|=4; + if(PCM8B(slot)) + mode|=0x10; + RBUFDST=SCSPs[1].RINGBUF+SCSPs[1].BUFPTR; +#ifdef USEDSP + bufmix=SCSPs[1].MIXBuf+0x300*slot->slot; +#endif + SCSPUpdateModes[mode](slot,Enc,nsamples); + + } + ++SCSPs[1].BUFPTR; + SCSPs[1].BUFPTR&=63; + } + } + bufr=bufferr; + bufl=bufferl; + bufr1=buffertmpr; + bufl1=buffertmpl; + for(int s=0;s32767)?32767:x) + signed int smpl=*bufl1; + signed int smpr=*bufr1; +#ifdef USEDSP + signed short *pt=SCSPs[0].MIXBuf+s; + for(int sl=0;sl<32;++sl) + { + _SLOT *slot=SCSPs[0].Slots+sl; + if(slot->active) + { + SCSPDSP_SetSample(&SCSP[0].DSP,pt[0],ISEL(slot),IMXL(slot)); + } + pt+=0x300; + } + SCSPDSP_Step(&SCSP[0].DSP); + if(HasSlaveSCSP) + { + pt=SCSPs[1].MIXBuf+s; + for(int sl=0;sl<32;++sl) + { + _SLOT *slot=SCSPs[1].Slots+sl; + if(slot->active) + { + SCSPDSP_SetSample(&SCSP[1].DSP,pt[0],ISEL(slot),IMXL(slot)); + } + pt+=0x300; + } + SCSPDSP_Step(&SCSP[1].DSP); + } + + // smpl=0; + // smpr=0; + for(int i=0;i<16;++i) + { + _SLOT *slot=SCSPs[0].Slots+i; + int ef=EFSDL(slot); + if(ef) + { + unsigned short Enc=0|((EFPAN(slot))<<0x0)|((EFSDL(slot))<<0x5); + smpl+=(SCSPs[0].DSP.EFREG[i]*LPANTABLE[Enc])>>SHIFT; + smpr+=(SCSPs[0].DSP.EFREG[i]*RPANTABLE[Enc])>>SHIFT; + } + + if(HasSlaveSCSP) + { + _SLOT *slot=SCSPs[1].Slots+i; + ef=EFSDL(slot); + if(ef) + { + unsigned short Enc=0|((EFPAN(slot))<<0x0)|((EFSDL(slot))<<0x5); + smpl+=(SCSPs[1].DSP.EFREG[i]*LPANTABLE[Enc])>>SHIFT; + smpr+=(SCSPs[1].DSP.EFREG[i]*RPANTABLE[Enc])>>SHIFT; + } + } + } +#endif +#ifdef REVERB + smpl+=bufferrevl[RevR]; + smpr+=bufferrevr[RevR]; + bufferrevl[RevW]=((smpl<<0)/REVERB_DIV)>>0; + bufferrevr[RevW]=((smpr<<0)/REVERB_DIV)>>0; + ++RevW; + if(RevW==REVERB_LEN) + RevW=0; + ++RevR; + if(RevR==REVERB_LEN) + RevR=0; +#endif + *bufl=ICLIP16(smpl); + *bufr=ICLIP16(smpr); + *bufl1=0; + *bufr1=0; + ++bufl; + ++bufr; + ++bufl1; + ++bufr1; + + } +} + + +#else + +signed int inline SCSP_UpdateSlot(_SLOT *slot) +{ + signed int sample; + int step=slot->step; + DWORD addr; + + if(SSCTL(slot)!=0) //no FM or noise yet + return 0; + + if(PLFOS(slot)!=0) + { + step=step*PLFO_Step(&(slot->PLFO)); + step>>=SHIFT; + } + + if(PCM8B(slot)) + addr=slot->cur_addr>>SHIFT; + else + addr=(slot->cur_addr>>(SHIFT-1))&(~1); + + if(MDL(slot)!=0 || MDXSL(slot)!=0 || MDYSL(slot)!=0) + { + unsigned char v; + signed int smp=(SCSP->RINGBUF[(SCSP->BUFPTR+MDXSL(slot))&63]+SCSP->RINGBUF[(SCSP->BUFPTR+MDYSL(slot))&63])/2; + + smp>>=11; + addr+=smp; + if(!PCM8B(slot)) + addr&=~1; + } + + if(PCM8B(slot)) //8 bit signed + { + signed char *p=(signed char *) (slot->base+(addr^1)); + int s; + signed int fpart=slot->cur_addr&((1<>SHIFT)<<8; + */ +/* if(SBCTL(slot)&1) //reverse data + sample^=0x7f; + if(SBCTL(slot)&2) //reverse sign + sample^=0x80; +*/ + } + else //16 bit signed (endianness?) + { + signed short *p=(signed short *) (slot->base+addr); + int s; + signed int fpart=slot->cur_addr&((1<>8)&0xFF)|(p[0]<<8); + //s=(int) p[0]*((1<>SHIFT; + + /* if(SBCTL(slot)&1) //reverse data + sample^=0x7fff; + if(SBCTL(slot)&2) //reverse sign + sample^=0x8000; + */ + } + + + switch(LPCTL(slot)) + { + case 0: //no loop + slot->cur_addr+=step; + addr=slot->cur_addr>>SHIFT; + if(addr>LEA(slot)) + { + //slot->active=0; + SCSP_StopSlot(slot,0); + } + break; + case 1: //normal loop + slot->cur_addr+=step; + addr=slot->cur_addr>>SHIFT; + if(addr>LEA(slot)) + slot->cur_addr=LSA(slot)<Back) + slot->cur_addr+=REVSIGN(step); + else + slot->cur_addr+=step; + addr=slot->cur_addr>>SHIFT; + if(addr>LEA(slot)) + { + slot->cur_addr=LEA(slot)<Back=1; + } + if((addrBack) + slot->cur_addr=LEA(slot)<Back) + slot->cur_addr+=REVSIGN(step); + else + slot->cur_addr+=step; + addr=slot->cur_addr>>SHIFT; + if(addr>LEA(slot)) //reached end, reverse till start + { + slot->cur_addr=LEA(slot)<step=REVSIGN(slot->step); + slot->Back=1; + } + if((addrBack)) //reached start or negative + { + slot->cur_addr=LSA(slot)<step=REVSIGN(slot->step); + slot->Back=0; + } + break; + } + + if(ALFOS(slot)!=0) + { + sample=sample*ALFO_Step(&(slot->ALFO)); + sample>>=SHIFT; + } + + if(!STWINH(slot)) + *RBUFDST=sample; + else + int a=1; + + sample=(sample*EG_Update(slot))>>SHIFT; + + return sample; +} + +void SCSP_CpuRunScanline() +{ + +} + +void SCSP_DoMasterSamples(int nsamples) +{ + int slice=12000000/(SysFPS*nsamples); // 68K cycles/sample + static int lastdiff=0; + + for(int s=0;s0xf) ef=0xf; + unsigned short Enc=((TL(slot))<<0x0)|((DIPAN(slot))<<0x8)|((ef)<<0xd); + */ +#ifdef USEDSP + SCSPDSP_SetSample(&SCSPs[0].DSP,/*sample>>5*/(sample*LPANTABLE[(Enc|0xE0)&0xFFE0])>>(SHIFT+3)/*>>SHIFT*/,ISEL(slot),IMXL(slot)); +#endif + +#ifdef RB_VOLUME + smpl += (sample * volume[TL(slot)+pan_left [DIPAN(slot)]])>>17; + smpr += (sample * volume[TL(slot)+pan_right[DIPAN(slot)]])>>17; +#else + + //if(sl==cnts) + { + smpl+=(sample*LPANTABLE[Enc])>>SHIFT; + smpr+=(sample*RPANTABLE[Enc])>>SHIFT; + } +#endif + } + ++SCSPs[0].BUFPTR; + SCSPs[0].BUFPTR&=63; + if(HasSlaveSCSP) + { + if(SCSPs[1].Slots[sl].active) + { + _SLOT *slot=SCSPs[1].Slots+sl; + unsigned short Enc=((TL(slot))<<0x8)|((DIPAN(slot))<<0x0)|((DISDL(slot))<<0x5); + RBUFDST=SCSPs[1].RINGBUF+SCSPs[1].BUFPTR; + signed int sample=SCSP_UpdateSlot(slot); +#ifdef USEDSP + SCSPDSP_SetSample(&SCSPs[1].DSP,(sample*LPANTABLE[(Enc|0xE0)&0xFFE0])>>(SHIFT+3),ISEL(slot),IMXL(slot)); +#endif +#ifdef RB_VOLUME + smpl += (sample * volume[TL(slot)+pan_left [DIPAN(slot)]])>>17; + smpr += (sample * volume[TL(slot)+pan_right[DIPAN(slot)]])>>17; +#else + smpl+=(sample*LPANTABLE[Enc])>>SHIFT; + smpr+=(sample*RPANTABLE[Enc])>>SHIFT; +#endif + } + ++SCSPs[1].BUFPTR; + SCSPs[1].BUFPTR&=63; + } + } +#define ICLIP16(x) (x<-32768)?-32768:((x>32767)?32767:x) +#ifdef USEDSP + SCSPDSP_Step(&SCSPs[0].DSP); + if(HasSlaveSCSP) + SCSPDSP_Step(&SCSPs[1].DSP); + +// smpl=0; +// smpr=0; + for(int i=0;i<16;++i) + { + _SLOT *slot=SCSPs[0].Slots+i; + int ef=EFSDL(slot); + if(ef) + { + unsigned short Enc=0|((EFPAN(slot))<<0x0)|((EFSDL(slot))<<0x5); + smpl+=(SCSPs[0].DSP.EFREG[i]*LPANTABLE[Enc])>>SHIFT; + smpr+=(SCSPs[0].DSP.EFREG[i]*RPANTABLE[Enc])>>SHIFT; + } + if(HasSlaveSCSP) + { + _SLOT *slot=SCSPs[1].Slots+i; + ef=EFSDL(slot); + if(ef) + { + unsigned short Enc=0|((EFPAN(slot))<<0x0)|((EFSDL(slot))<<0x5); + smpl+=(SCSPs[1].DSP.EFREG[i]*LPANTABLE[Enc])>>SHIFT; + smpr+=(SCSPs[1].DSP.EFREG[i]*RPANTABLE[Enc])>>SHIFT; + } + } + } +#endif +#ifdef REVERB + smpl+=bufferrevl[RevR]; + smpr+=bufferrevr[RevR]; + bufferrevl[RevW]=((smpl<<0)/REVERB_DIV)>>0; + bufferrevr[RevW]=((smpr<<0)/REVERB_DIV)>>0; + ++RevW; + if(RevW==REVERB_LEN) + RevW=0; + ++RevR; + if(RevR==REVERB_LEN) + RevR=0; +#endif + if(smpl<-32768) + smpl=-32768; + else if(smpl>32767) + smpl=32767; + bufferl[s]=smpl; + //bufferl[s]=ICLIP16(smpl); + bufferr[s]=ICLIP16(smpr); + + SCSP_TimersAddTicks(1); + CheckPendingIRQ(); + + /*for(int nc=slice;nc;nc--) + { + Run68kCB(1); + if(M68000_regs.pc==0x6035A6) + { + + int a=1; + } + } + */ + + + lastdiff=Run68kCB(slice-lastdiff); + } +} +#endif + +void SCSP_Update() +{ + SCSP_DoMasterSamples(length); +} + +void SCSP_SetCB(int (*Run68k)(int cycles),void (*Int68k)(int irq), CIRQ *ppcIRQObjectPtr, unsigned ppcIRQBit) +{ + Int68kCB=Int68k; + Run68kCB=Run68k; + ppcIRQ = ppcIRQObjectPtr; + ppcSoundIRQBit = ppcIRQBit; +} + +void SCSP_MidiIn(BYTE val) +{ + DebugLog("Midi Buffer push %02X",val); + + MidiStack[MidiW++]=val; + MidiW&=7; + MidiInFill++; + //Int68kCB(IrqMidi); +// SCSP.data[0x20/2]|=0x8; +} + +void SCSP_MidiOutW(BYTE val) +{ + printf("MIDI out\n"); + DebugLog("Midi Out Buffer push %02X",val); + MidiStack[MidiOutW++]=val; + MidiOutW&=7; + ++MidiOutFill; +} + + +unsigned char SCSP_MidiOutR() +{ + unsigned char val; + if(MidiOutR==MidiOutW) + return 0xff; + + val=MidiStack[MidiOutR++]; + DebugLog("Midi Out Buffer pop %02X",val); + MidiOutR&=7; + --MidiOutFill; + return val; +} + +unsigned char SCSP_MidiOutFill() +{ + return MidiOutFill; +} + +unsigned char SCSP_MidiInFill() +{ + return MidiInFill; +} + +void SCSP_RTECheck() +{ +/* unsigned short pend=SCSP.data[0x20/2]&0xfff; + if(pend) + { + if(pend&0x40) + { + Int68kCB(IrqTimA); + return; + } + if(pend&(0x80|0x100)) + { + Int68kCB(IrqTimBC); + return; + } + if(pend&0x8) + Int68kCB(IrqMidi); + } +*/ +} + +int SCSP_IRQCB(int) +{ + CheckPendingIRQ(); + return -1; +} + +void SCSP_Master_w8(unsigned int addr,unsigned char val) +{ + SCSP=SCSPs+0; + SCSP_w8(addr,val); +} + +void SCSP_Master_w16(unsigned int addr,unsigned short val) +{ + SCSP=SCSPs+0; + SCSP_w16(addr,val); +} + +void SCSP_Master_w32(unsigned int addr,unsigned int val) +{ + SCSP=SCSPs+0; + SCSP_w32(addr,val); +} + +void SCSP_Slave_w8(unsigned int addr,unsigned char val) +{ + SCSP=SCSPs+1; + SCSP_w8(addr,val); +} + +void SCSP_Slave_w16(unsigned int addr,unsigned short val) +{ + SCSP=SCSPs+1; + SCSP_w16(addr,val); +} + +void SCSP_Slave_w32(unsigned int addr,unsigned int val) +{ + SCSP=SCSPs+1; + SCSP_w32(addr,val); +} + +unsigned char SCSP_Master_r8(unsigned int addr) +{ + SCSP=SCSPs+0; + return SCSP_r8(addr); +} + +unsigned short SCSP_Master_r16(unsigned int addr) +{ + SCSP=SCSPs+0; + return SCSP_r16(addr); +} + +unsigned int SCSP_Master_r32(unsigned int addr) +{ + SCSP=SCSPs+0; + return SCSP_r32(addr); +} + +unsigned char SCSP_Slave_r8(unsigned int addr) +{ + SCSP=SCSPs+1; + return SCSP_r8(addr); +} + +unsigned short SCSP_Slave_r16(unsigned int addr) +{ + SCSP=SCSPs+1; + return SCSP_r16(addr); +} + +unsigned int SCSP_Slave_r32(unsigned int addr) +{ + SCSP=SCSPs+1; + return SCSP_r32(addr); +} + + +/****************************************************************************** + Extra Supermodel Interface Functions +******************************************************************************/ + +void SCSP_WriteMIDICtrlPort(UINT8 data) +{ + midiCtrlPort = data; +} + +void SCSP_SetBuffers(INT16 *leftBufferPtr, INT16 *rightBufferPtr, int bufferLength) +{ + SysFPS = 60.0; // should this be updated to reflect actual FPS? + bufferl = leftBufferPtr; + bufferr = rightBufferPtr; + length = bufferLength; + + cnts = 0; // what is this for? seems unimportant but need to find out +} + +void SCSP_Deinit(void) +{ +#ifdef USEDSP + free(SCSP->MIXBuf); +#endif + free(buffertmpl); + free(buffertmpr); +} diff --git a/Sound/SCSP.h b/Sound/SCSP.h new file mode 100644 index 0000000..fa309fa --- /dev/null +++ b/Sound/SCSP.h @@ -0,0 +1,71 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * SCSP.h + * + * Header file defining for SCSP emulation. + */ + +#ifndef INCLUDED_SCSP_H +#define INCLUDED_SCSP_H + + +void SCSP_w8(unsigned int addr,unsigned char val); +void SCSP_w16(unsigned int addr,unsigned short val); +void SCSP_w32(unsigned int addr,unsigned int val); +unsigned char SCSP_r8(unsigned int addr); +unsigned short SCSP_r16(unsigned int addr); +unsigned int SCSP_r32(unsigned int addr); + +void SCSP_SetCB(int (*Run68k)(int cycles),void (*Int68k)(int irq), CIRQ *ppcIRQObjectPtr, unsigned soundIRQBit); +void SCSP_Update(); +void SCSP_MidiIn(unsigned char); +void SCSP_MidiOutW(unsigned char); +unsigned char SCSP_MidiOutFill(); +unsigned char SCSP_MidiInFill(); +void SCSP_CpuRunScanline(); +unsigned char SCSP_MidiOutR(); +void SCSP_Init(int n); +void SCSP_SetRAM(int n,unsigned char *r); +void SCSP_RTECheck(); +int SCSP_IRQCB(int); + +void SCSP_Master_w8(unsigned int addr,unsigned char val); +void SCSP_Master_w16(unsigned int addr,unsigned short val); +void SCSP_Master_w32(unsigned int addr,unsigned int val); +void SCSP_Slave_w8(unsigned int addr,unsigned char val); +void SCSP_Slave_w16(unsigned int addr,unsigned short val); +void SCSP_Slave_w32(unsigned int addr,unsigned int val); +unsigned char SCSP_Master_r8(unsigned int addr); +unsigned short SCSP_Master_r16(unsigned int addr); +unsigned int SCSP_Master_r32(unsigned int addr); +unsigned char SCSP_Slave_r8(unsigned int addr); +unsigned short SCSP_Slave_r16(unsigned int addr); +unsigned int SCSP_Slave_r32(unsigned int addr); + +// Supermodel interface functions +void SCSP_WriteMIDICtrlPort(UINT8 data); +void SCSP_SetBuffers(INT16 *leftBufferPtr, INT16 *rightBufferPtr, int bufferLength); +void SCSP_Deinit(void); + + +#endif // INCLUDED_SCSP_H \ No newline at end of file diff --git a/Sound/SCSPDSP.cpp b/Sound/SCSPDSP.cpp new file mode 100644 index 0000000..1079677 --- /dev/null +++ b/Sound/SCSPDSP.cpp @@ -0,0 +1,1101 @@ +#include "SCSPDSP.h" +#include +#include +#include +#include + +#pragma warning(disable:4311) + +#define DYNBUF 0x10000 + +//this doesn't work at all +//#define USEFLOATPACK + +//the PACK func in asm plus mov [esi],ax +unsigned char PackFunc[]={0x8B,0xD8,0xA9,0x00,0x00,0x80,0x00,0x75,0x02,0xF7,0xD3,0xF7,0xD3,0x0F,0xBD,0xCB, + 0xF7,0xD9,0xC1,0xE0,0x08,0x83,0xC1,0x16,0xD3,0xE0,0xC1,0xF8,0x13,0xC1,0xE1,0x0B, + 0x25,0xFF,0x87,0x00,0x00,0x0B,0xC1,0x66,0x89,0x06}; +unsigned char UnpackFunc[]={0x8B,0xD8,0x8B,0xC8,0x81,0xE3,0x00,0x80,0x00,0x00,0x25,0xFF,0x07, + 0x00,0x00,0xC1,0xE9,0x0B,0xC1,0xE0,0x0B,0xC1,0xE3,0x08,0x83,0xE1,0x0F,0x0B,0xC3, + 0xD1,0xEB,0x81,0xF3,0x00,0x00,0x40,0x00,0x0B,0xC3,0x83,0xC1,0x08,0xC1,0xE0,0x08, + 0xD3,0xF8}; +#if 0 +unsigned short inline PACK(signed int val) +{ +/* signed int v1=val; + int n=0; + while(((v1>>22)&1) == ((v1>>23)&1)) + { + v1<<=1; + ++n; + } + v1<<=8; + v1>>=11+8; + v1=(v1&(~0x7800))|(n<<11); + return v1; +*/ +#ifdef USEFLOATPACK + unsigned short f; + __asm + { + mov eax,val + mov ebx,eax + test eax,0x00800000 + jne negval + not ebx +negval: not ebx + bsr ecx,ebx + neg ecx + shl eax,8 + add ecx,22 + shl eax,cl + sar eax,8+11 + shl ecx,11 + and eax,~0x7800 + or eax,ecx + mov f,ax + } + return f; +#else + + //cut to 16 bits + unsigned int f=((unsigned int ) val)>>8; + return f; +#endif +} + +signed int inline UNPACK(unsigned short val) +{ +/* if(val) + int a=1; + unsigned int mant=val&0x7ff; + unsigned int exp=(val>>11)&0xf; + unsigned int sign=(val>>15)&1; + signed int r=0; + r|=mant<<11; + r|=sign<<23; + r|=(sign^1)<<22; + + //signed int r=val<<8; + //if(r&0x00800000) + // r|=0xFF000000; + r<<=8; + r>>=8+exp; + return r; +*/ +#ifdef USEFLOATPACK + signed int r; + __asm + { + xor eax,eax + mov ax,val + mov ebx,eax + mov ecx,eax + and ebx,0x8000 + and eax,0x07ff + shr ecx,11 + shl eax,11 + shl ebx,8 + and ecx,0xF + or eax,ebx + shr ebx,1 + xor ebx,0x00400000 + or eax,ebx + add ecx,8 + shl eax,8 + sar eax,cl + mov r,eax + } +#else + //unpack 16->24 + signed int r=val<<8; + r<<=8; + r>>=8; +#endif + return r; +} +#else + +static signed short PACK(signed int val) +{ + unsigned int temp; + int sign,exponent,k; + + sign = (val >> 23) & 0x1; + temp = (val ^ (val << 1)) & 0xFFFFFF; + exponent = 0; + for (k=0; k<12; k++) + { + if (temp & 0x800000) + break; + temp <<= 1; + exponent += 1; + } + if (exponent < 12) + val = (val << exponent) & 0x3FFFFF; + else + val <<= 11; + val >>= 11; + val |= sign << 15; + val |= exponent << 11; + + return (unsigned short)val; +} + +static signed int UNPACK(unsigned short val) +{ + int sign,exponent,mantissa; + signed int uval; + + sign = (val >> 15) & 0x1; + exponent = (val >> 11) & 0xF; + mantissa = val & 0x7FF; + uval = mantissa << 11; + if (exponent > 11) + exponent = 11; + else + uval |= (sign ^ 1) << 22; + uval |= sign << 23; + uval <<= 8; + uval >>= 8; + uval >>= exponent; + + return uval; +} +#endif + +void SCSPDSP_Init(_SCSPDSP *DSP) +{ + memset(DSP,0,sizeof(_SCSPDSP)); + DSP->RBL=0x8000; + DSP->Stopped=true; +} +#ifndef DYNDSP +void SCSPDSP_Step(_SCSPDSP *DSP) +{ + if(DSP->Stopped) + return; + signed int ACC=0; //26 bit + signed int SHIFTED=0; //24 bit + signed int X=0; //24 bit + signed int Y=0; //13 bit + signed int B=0; //26 bit + signed int INPUTS=0; //24 bit + signed int MEMVAL=0; + signed int FRC_REG=0; //13 bit + signed int Y_REG=0; //24 bit + unsigned int ADDR=0; + unsigned int ADRS_REG=0; //13 bit + + memset(DSP->EFREG,0,2*16); + int dump=0; + FILE *f=NULL; + if(dump) + f=fopen("dsp.txt","wt"); + for(int step=0;stepLastStep;++step) + { + unsigned short *IPtr=DSP->MPRO+step*4; + +// if(IPtr[0]==0 && IPtr[1]==0 && IPtr[2]==0 && IPtr[3]==0) +// break; + + unsigned int TRA=(IPtr[0]>>8)&0x7F; + unsigned int TWT=(IPtr[0]>>7)&0x01; + unsigned int TWA=(IPtr[0]>>0)&0x7F; + + unsigned int XSEL=(IPtr[1]>>15)&0x01; + unsigned int YSEL=(IPtr[1]>>13)&0x03; + unsigned int IRA=(IPtr[1]>>6)&0x3F; + unsigned int IWT=(IPtr[1]>>5)&0x01; + unsigned int IWA=(IPtr[1]>>0)&0x1F; + + unsigned int TABLE=(IPtr[2]>>15)&0x01; + unsigned int MWT=(IPtr[2]>>14)&0x01; + unsigned int MRD=(IPtr[2]>>13)&0x01; + unsigned int EWT=(IPtr[2]>>12)&0x01; + unsigned int EWA=(IPtr[2]>>8)&0x0F; + unsigned int ADRL=(IPtr[2]>>7)&0x01; + unsigned int FRCL=(IPtr[2]>>6)&0x01; + unsigned int SHIFT=(IPtr[2]>>4)&0x03; + unsigned int YRL=(IPtr[2]>>3)&0x01; + unsigned int NEGB=(IPtr[2]>>2)&0x01; + unsigned int ZERO=(IPtr[2]>>1)&0x01; + unsigned int BSEL=(IPtr[2]>>0)&0x01; + + unsigned int NOFL=(IPtr[3]>>15)&1; //???? + unsigned int COEF=(IPtr[3]>>9)&0x3f; + + unsigned int MASA=(IPtr[3]>>2)&0x1f; //??? + unsigned int ADREB=(IPtr[3]>>1)&0x1; + unsigned int NXADR=(IPtr[3]>>0)&0x1; + + + //operations are done at 24 bit precision + + if(MASA) + int a=1; + if(NOFL) + int a=1; + + int dump=0; + + if(f) + { +#define DUMP(v) fprintf(f," " #v ": %04X",v); + + fprintf(f,"%d: ",step); + DUMP(ACC); + DUMP(SHIFTED); + DUMP(X); + DUMP(Y); + DUMP(B); + DUMP(INPUTS); + DUMP(MEMVAL); + DUMP(FRC_REG); + DUMP(Y_REG); + DUMP(ADDR); + DUMP(ADRS_REG); + fprintf(f,"\n"); + } + //INPUTS RW + assert(IRA<0x32); + if(IRA<=0x1f) + INPUTS=DSP->MEMS[IRA]; + else if(IRA<=0x2F) + INPUTS=DSP->MIXS[IRA-0x20]; //MIXS is 24 bit + else if(IRA<=0x31) + INPUTS=DSP->EXTS[IRA-0x30]; + else INPUTS=0; + + INPUTS<<=8; + INPUTS>>=8; + //if(INPUTS&0x00800000) + // INPUTS|=0xFF000000; + + if(IWT) + { + DSP->MEMS[IWA]=MEMVAL; //MEMVAL was selected in previous MRD + if(IRA==IWA) + INPUTS=MEMVAL; + } + + //Operand sel + //B + if(!ZERO) + { + if(BSEL) + B=ACC; + else + { + B=DSP->TEMP[(TRA+DSP->DEC)&0x7F]; + B<<=8; + B>>=8; + //if(B&0x00800000) + // B|=0xFF000000; //Sign extend + } + if(NEGB) + B=0-B; + } + else + B=0; + + //X + if(XSEL) + X=INPUTS; + else + { + X=DSP->TEMP[(TRA+DSP->DEC)&0x7F]; + X<<=8; + X>>=8; + //if(X&0x00800000) + // X|=0xFF000000; + } + + //Y + if(YSEL==0) + Y=FRC_REG; + else if(YSEL==1) + Y=DSP->COEF[COEF]>>3; //COEF is 16 bits + else if(YSEL==2) + Y=(Y_REG>>11)&0x1FFF; + else if(YSEL==3) + Y=(Y_REG>>4)&0x0FFF; + + if(YRL) + Y_REG=INPUTS; + + //Shifter + if(SHIFT==0) + { + SHIFTED=ACC; + if(SHIFTED>0x007FFFFF) + SHIFTED=0x007FFFFF; + if(SHIFTED<(-0x00800000)) + SHIFTED=-0x00800000; + } + else if(SHIFT==1) + { + SHIFTED=ACC*2; + if(SHIFTED>0x007FFFFF) + SHIFTED=0x007FFFFF; + if(SHIFTED<(-0x00800000)) + SHIFTED=-0x00800000; + } + else if(SHIFT==2) + { + SHIFTED=ACC*2; + SHIFTED<<=8; + SHIFTED>>=8; + //SHIFTED&=0x00FFFFFF; + //if(SHIFTED&0x00800000) + // SHIFTED|=0xFF000000; + } + else if(SHIFT==3) + { + SHIFTED=ACC; + SHIFTED<<=8; + SHIFTED>>=8; + //SHIFTED&=0x00FFFFFF; + //if(SHIFTED&0x00800000) + // SHIFTED|=0xFF000000; + } + + //ACCUM + Y<<=19; + Y>>=19; + //if(Y&0x1000) + // Y|=0xFFFFF000; + + __int64 v=(((__int64) X*(__int64) Y)>>12); + ACC=(int) v+B; + + if(TWT) + DSP->TEMP[(TWA+DSP->DEC)&0x7F]=SHIFTED; + + if(FRCL) + { + if(SHIFT==3) + FRC_REG=SHIFTED&0x0FFF; + else + FRC_REG=(SHIFTED>>11)&0x1FFF; + } + + if(MRD || MWT) + //if(0) + { + ADDR=DSP->MADRS[MASA]; + if(!TABLE) + ADDR+=DSP->DEC; + if(ADREB) + ADDR+=ADRS_REG&0x0FFF; + if(NXADR) + ADDR++; + if(!TABLE) + ADDR&=DSP->RBL-1; + else + ADDR&=0xFFFF; + //ADDR<<=1; + //ADDR+=DSP->RBP<<13; + //MEMVAL=DSP->SCSPRAM[ADDR>>1]; + ADDR+=DSP->RBP<<12; + + if(MWT && (step&1)) + { + if(NOFL) + DSP->SCSPRAM[ADDR]=SHIFTED>>8; + else + DSP->SCSPRAM[ADDR]=PACK(SHIFTED); + } + + if(MRD && (step&1)) //memory only allowed on odd? DoA inserts NOPs on even + { + if(NOFL) + MEMVAL=DSP->SCSPRAM[ADDR]<<8; + else + MEMVAL=UNPACK(DSP->SCSPRAM[ADDR]); + if(MEMVAL) + int a=1; + + } + + } + + if(ADRL) + { + if(SHIFT==3) + ADRS_REG=(SHIFTED>>12)&0xFFF; + else + ADRS_REG=(INPUTS>>16); + } + + if(EWT) + DSP->EFREG[EWA]+=SHIFTED>>8; + + } + --DSP->DEC; + memset(DSP->MIXS,0,4*16); + if(f) + fclose(f); +} +#else + +FILE *f=NULL; + +void SCSPDSP_Step(_SCSPDSP *DSP) +{ + if(DSP->Stopped) + return; + + memset(DSP->EFREG,0,2*16); + + assert(DSP->DoSteps!=NULL); + + int dump=0; + if(dump) + f=fopen("dsp2.txt","wt"); + + DSP->DoSteps(); + + if(f) + { + fclose(f); + f=NULL; + } + + --DSP->DEC; + memset(DSP->MIXS,0,4*16); + +} + +void __fastcall dumpreg(_SCSPDSP *DSP) +{ + static int n=0; + //f=fopen("dsp2.txt","a+t"); + if(f) + { +#define DUMP(v) fprintf(f," " #v ": %04X",DSP->v); + + fprintf(f,"%d: ",n++); + DUMP(ACC); + DUMP(SHIFTED); + DUMP(X); + DUMP(Y); + DUMP(B); + DUMP(INPUTS); + DUMP(MEMVAL); + DUMP(FRC_REG); + DUMP(Y_REG); + DUMP(ADDR); + DUMP(ADRS_REG); + fprintf(f,"\n"); + } +} + +#define EMIT8(x) *PtrInsts=x; ++PtrInsts; +#define EMIT16(x) *((unsigned short *) PtrInsts)=x; PtrInsts+=2; +#define EMIT32(x) *((unsigned int *) PtrInsts)=x; PtrInsts+=4; + +#define MOV_EAXTOMEM(addr) EMIT8(0xA3); EMIT32((unsigned int) addr); +#define MOV_MEMTOEAX(addr) EMIT8(0xA1); EMIT32((unsigned int) addr); +#define MOV_MEMTOAX(addr) EMIT8(0x66); EMIT8(0xA1); EMIT32((unsigned int) addr); +#define MOV_MEMTOEBX(addr) EMIT8(0x8B); EMIT8(0x1D); EMIT32((unsigned int) addr); +#define ADD_MEMTOEAX(addr) EMIT8(0x03); EMIT8(0x05); EMIT32((unsigned int) addr); +#define ADD_EAXTOMEM(addr) EMIT8(0x01); EMIT8(0x05); EMIT32((unsigned int) addr); +#define ADD_AXTOMEM(addr) EMIT8(0x66); EMIT8(0x01); EMIT8(0x05); EMIT32((unsigned int) addr); +#define MOV_IMMTOEAX(imm) EMIT8(0xB8); EMIT32((unsigned int) imm); +#define MOV_IMMTOECX(imm) EMIT8(0xB9); EMIT32((unsigned int) imm); +#define ADD_IMMTOEAX(imm) EMIT8(0x05); EMIT32((unsigned int) imm); +#define ADD_EBXTOEAX() EMIT8(0x03); EMIT8(0xC3); +#define CMP_IMMTOEAX(imm) EMIT8(0x3D); EMIT32((unsigned int) imm); +#define MOV_0TOEAX() EMIT8(0x33); EMIT8(0xC0); +#define MOV_EAXTOEBX() EMIT8(0x8B); EMIT8(0xD8); +#define MOV_EAXTOECX() EMIT8(0x8B); EMIT8(0xC8); +#define NEG_EAX() EMIT8(0xF7); EMIT8(0xD8); +#define INC_EAX() EMIT8(0x40); +#define MOV_MEMEAXTOEAX() EMIT8(0x8b); EMIT8(0x00); +#define MOV_MEMEAXTOAX() EMIT8(0x66); EMIT8(0x8b); EMIT8(0x00); +#define MOV_EBXTOMEMEAX() EMIT8(0x89); EMIT8(0x18); +#define MOV_EAXTOMEMEBX() EMIT8(0x89); EMIT8(0x03); +#define MOV_AXTOMEMEBX() EMIT8(0x66); EMIT8(0x89); EMIT8(0x03); +#define SHL_EAX(count) EMIT8(0xC1); EMIT8(0xE0); EMIT8(count); +#define SHL_EBX(count) EMIT8(0xC1); EMIT8(0xE3); EMIT8(count); +#define SHL_EDX(count) EMIT8(0xC1); EMIT8(0xE2); EMIT8(count); +#define SHRD_EAX_EDX(count) EMIT8(0x0F); EMIT8(0xAC); EMIT8(0xD0); EMIT8(count); +#define SAR_EAX(count) EMIT8(0xC1); EMIT8(0xF8); EMIT8(count); +#define SHR_EAX(count) EMIT8(0xC1); EMIT8(0xE8); EMIT8(count); +#define AND_EAX(mask) EMIT8(0x25); EMIT32(mask); +#define AND_EBX(mask) EMIT8(0x81); EMIT8(0xE3); EMIT32(mask); +#define AND_EAX_EBX() EMIT8(0x23); EMIT8(0xC3); +#define DEC_EBX() EMIT8(0x4B); +#define OR_EAX_EDX() EMIT8(0x0B); EMIT8(0xC2); +#define ADD_EAX_ECX() EMIT8(0x03); EMIT8(0xC1); +#define IMUL_EAX_EBX() EMIT8(0xF7); EMIT8(0xEB); +//#define IMUL_EAX_EBX() EMIT8(0xF7); EMIT8(0xE3); +#define RET() EMIT8(0xC3); +#define PUSHA() EMIT8(0x51); EMIT8(0x52); EMIT8(0x53); EMIT8(0x56); //ecx edx ebx esi +#define POPA() EMIT8(0x5E); EMIT8(0x5B); EMIT8(0x5A); EMIT8(0x59); //esi ebx edx ecx + +struct _INST +{ + unsigned int TRA; + unsigned int TWT; + unsigned int TWA; + + unsigned int XSEL; + unsigned int YSEL; + unsigned int IRA; + unsigned int IWT; + unsigned int IWA; + + unsigned int TABLE; + unsigned int MWT; + unsigned int MRD; + unsigned int EWT; + unsigned int EWA; + unsigned int ADRL; + unsigned int FRCL; + unsigned int SHIFT; + unsigned int YRL; + unsigned int NEGB; + unsigned int ZERO; + unsigned int BSEL; + + unsigned int NOFL; + unsigned int COEF; + + unsigned int MASA; + unsigned int ADREB; + unsigned int NXADR; +}; + +void DecodeInst(unsigned short *IPtr,_INST *i) +{ + i->TRA=(IPtr[0]>>8)&0x7F; + i->TWT=(IPtr[0]>>7)&0x01; + i->TWA=(IPtr[0]>>0)&0x7F; + + i->XSEL=(IPtr[1]>>15)&0x01; + i->YSEL=(IPtr[1]>>13)&0x03; + i->IRA=(IPtr[1]>>6)&0x3F; + i->IWT=(IPtr[1]>>5)&0x01; + i->IWA=(IPtr[1]>>0)&0x1F; + + i->TABLE=(IPtr[2]>>15)&0x01; + i->MWT=(IPtr[2]>>14)&0x01; + i->MRD=(IPtr[2]>>13)&0x01; + i->EWT=(IPtr[2]>>12)&0x01; + i->EWA=(IPtr[2]>>8)&0x0F; + i->ADRL=(IPtr[2]>>7)&0x01; + i->FRCL=(IPtr[2]>>6)&0x01; + i->SHIFT=(IPtr[2]>>4)&0x03; + i->YRL=(IPtr[2]>>3)&0x01; + i->NEGB=(IPtr[2]>>2)&0x01; + i->ZERO=(IPtr[2]>>1)&0x01; + i->BSEL=(IPtr[2]>>0)&0x01; + + i->NOFL=(IPtr[3]>>15)&1; //???? + i->COEF=(IPtr[3]>>9)&0x3f; + + i->MASA=(IPtr[3]>>2)&0x1f; //??? + i->ADREB=(IPtr[3]>>1)&0x1; + i->NXADR=(IPtr[3]>>0)&0x1; +} + +#define USES_SHIFTED(inst) (inst.TWT || inst.FRCL || inst.MWT || inst.ADRL || inst.EWT) + +void SCSPDSP_Recompile(_SCSPDSP *DSP) +{ + if(DSP->DoSteps) + free(DSP->DoSteps); + DSP->DoSteps=(void (*)()) malloc(DYNBUF); + unsigned char *PtrInsts=(unsigned char *)DSP->DoSteps; + + PUSHA(); + + for(int step=0;stepLastStep;++step) + { + unsigned short *IPtr=DSP->MPRO+step*4; + _INST ThisInst,NextInst; + DecodeInst(IPtr,&ThisInst); + DecodeInst(IPtr+4,&NextInst); + + + + EMIT8(0x90); + + MOV_IMMTOECX(DSP); + MOV_IMMTOEAX(dumpreg); + EMIT8(0xFF); EMIT8(0xD0); + + //INPUTS RW + assert(ThisInst.IRA<0x32); + if((ThisInst.XSEL || ThisInst.YRL || ThisInst.ADRL) || !DYNOPT) + { + if(ThisInst.IRA<=0x1f) + { + //INPUTS=DSP->MEMS[IRA]; + MOV_MEMTOEAX(&(DSP->MEMS[ThisInst.IRA])); + SHL_EAX(8); + } + else if(ThisInst.IRA<=0x2F) + { + //INPUTS=DSP->MIXS[IRA-0x20]<<8; //MIXS is 16 bit + MOV_MEMTOEAX(&(DSP->MIXS[ThisInst.IRA-0x20])); + SHL_EAX(8); + } + else if(ThisInst.IRA<=0x31) + { + MOV_MEMTOEAX(&(DSP->EXTS[ThisInst.IRA-0x30])); + SHL_EAX(8); + } + else + { + MOV_0TOEAX(); + } + SAR_EAX(8); + + MOV_EAXTOMEM(&(DSP->INPUTS)); + } + + if(ThisInst.IWT) + { + MOV_MEMTOEAX(&DSP->MEMVAL); + MOV_EAXTOMEM(&DSP->MEMS[ThisInst.IWA]); + //DSP->MEMS[IWA]=MEMVAL; //MEMVAL was selected in previous MRD + if(ThisInst.IRA==ThisInst.IWA) + { + //INPUTS=MEMVAL; + MOV_EAXTOMEM(&DSP->INPUTS); + } + } + + if((USES_SHIFTED(NextInst) || NextInst.BSEL) || !DYNOPT) + { + //Operand sel + //B + if(!ThisInst.ZERO) + { + if(ThisInst.BSEL) + { + //B=ACC; + MOV_MEMTOEAX(&DSP->ACC); + // MOV_EAXTOMEM(&DSP->B); // + } + else + { + MOV_IMMTOEAX(ThisInst.TRA); + ADD_MEMTOEAX(&(DSP->DEC)); + AND_EAX(0x7F); + SHL_EAX(2); + ADD_IMMTOEAX(&(DSP->TEMP)); + MOV_MEMEAXTOEAX(); + SHL_EAX(8); + SAR_EAX(8); + // MOV_EAXTOMEM(&DSP->B); // + + + //B=DSP->TEMP[(TRA+DSP->DEC)&0x7F]; + //B<<=8; + //B>>=8; + //if(B&0x00800000) + // B|=0xFF000000; //Sign extend + } + if(ThisInst.NEGB) + { + //B=0-B; + NEG_EAX(); + } + } + else + { + MOV_0TOEAX(); + } + //MOV_EAXTOMEM(&DSP->B); + MOV_EAXTOECX(); + + //X + if(ThisInst.XSEL) + { + //X=INPUTS; + MOV_MEMTOEAX(&DSP->INPUTS); + // MOV_EAXTOMEM(&DSP->X); // + } + else + { + //X=DSP->TEMP[(TRA+DSP->DEC)&0x7F]; + //X<<=8; + //X>>=8; + MOV_IMMTOEAX(ThisInst.TRA); + ADD_MEMTOEAX(&(DSP->DEC)); + AND_EAX(0x7F); + SHL_EAX(2); + ADD_IMMTOEAX(&(DSP->TEMP)); + MOV_MEMEAXTOEAX(); + SHL_EAX(8); + SAR_EAX(8); + //if(X&0x00800000) + // X|=0xFF000000; + // MOV_EAXTOMEM(&DSP->X); // + } + MOV_EAXTOEBX(); + } + + + //if(TWT || /*MRD ||*/ MWT || EWT || ADRL || FRCL) + if(USES_SHIFTED(ThisInst) || !DYNOPT) + { + if(ThisInst.SHIFT==0) + { + MOV_MEMTOEAX(&DSP->ACC); + CMP_IMMTOEAX(0x007FFFFF); + EMIT8(0x7E); EMIT8(0x05); //JLE + MOV_IMMTOEAX(0x007FFFFF); + CMP_IMMTOEAX(0xFF800000); + EMIT8(0x7D); EMIT8(0x05); //JGE + MOV_IMMTOEAX(0xFF800000); + + + //SHIFTED=ACC; + //if(SHIFTED>0x007FFFFF) + // SHIFTED=0x007FFFFF; + //if(SHIFTED<(-0x00800000)) + // SHIFTED=-0x00800000; + } + else if(ThisInst.SHIFT==1) + { + //SHIFTED=ACC*2; + MOV_MEMTOEAX(&DSP->ACC); + SHL_EAX(1); + CMP_IMMTOEAX(0x007FFFFF); + EMIT8(0x7E); EMIT8(0x05); //JLE + MOV_IMMTOEAX(0x007FFFFF); + CMP_IMMTOEAX(0xFF800000); + EMIT8(0x7D); EMIT8(0x05); //JGE + MOV_IMMTOEAX(0xFF800000); + //if(SHIFTED>0x007FFFFF) + // SHIFTED=0x007FFFFF; + //if(SHIFTED<(-0x00800000)) + // SHIFTED=-0x00800000; + } + else if(ThisInst.SHIFT==2) + { + //SHIFTED=ACC*2; + //SHIFTED<<=8; + //SHIFTED>>=8; + MOV_MEMTOEAX(&DSP->ACC); + SHL_EAX(9); + SAR_EAX(8); + //SHIFTED&=0x00FFFFFF; + //if(SHIFTED&0x00800000) + // SHIFTED|=0xFF000000; + } + else if(ThisInst.SHIFT==3) + { + //SHIFTED=ACC; + //SHIFTED<<=8; + //SHIFTED>>=8; + MOV_MEMTOEAX(&DSP->ACC); + SHL_EAX(8); + SAR_EAX(8); + //SHIFTED&=0x00FFFFFF; + //if(SHIFTED&0x00800000) + // SHIFTED|=0xFF000000; + } + MOV_EAXTOMEM(&DSP->SHIFTED); + } + + if((USES_SHIFTED(NextInst) || NextInst.BSEL) || !DYNOPT) + { + //Y + if(ThisInst.YSEL==0) + { + //Y=FRC_REG; + MOV_MEMTOEAX(&DSP->FRC_REG); + } + else if(ThisInst.YSEL==1) + { + //MOV_0TOEAX(); + MOV_MEMTOAX(&DSP->COEF[ThisInst.COEF]); + SAR_EAX(3); + //Y=DSP->COEF[COEF]>>3; //COEF is 16 bits + } + else if(ThisInst.YSEL==2) + { + //Y=(Y_REG>>11)&0x1FFF; + MOV_MEMTOEAX(&DSP->Y_REG); + SAR_EAX(11); + AND_EAX(0x1FFF); + } + else if(ThisInst.YSEL==3) + { + //Y=(Y_REG>>4)&0x0FFF; + MOV_MEMTOEAX(&DSP->Y_REG); + SAR_EAX(4); + AND_EAX(0x0FFF); + } + + SHL_EAX(19); + SAR_EAX(19); + // MOV_EAXTOMEM(&DSP->Y); // + + + + //X:EBX + //B:ECX + //Y:EAX + IMUL_EAX_EBX(); + // SHR_EAX(12); + // SHL_EDX((32-12)); + SHRD_EAX_EDX(12); + ADD_EAX_ECX(); + + MOV_EAXTOMEM(&DSP->ACC); + } + + if(ThisInst.YRL) + { + MOV_MEMTOEAX(&DSP->INPUTS); + MOV_EAXTOMEM(&DSP->Y_REG); + //Y_REG=INPUTS; + } + + if(ThisInst.TWT) + { + MOV_MEMTOEAX(&DSP->SHIFTED); + MOV_EAXTOEBX(); + //DSP->TEMP[(TWA+DSP->DEC)&0x7F]=SHIFTED; + MOV_IMMTOEAX(ThisInst.TWA); + ADD_MEMTOEAX(&(DSP->DEC)); + AND_EAX(0x7F); + SHL_EAX(2); + ADD_IMMTOEAX(&(DSP->TEMP)); + MOV_EBXTOMEMEAX(); + } + + if(ThisInst.FRCL) + { + if(ThisInst.SHIFT==3) + { + //FRC_REG=SHIFTED&0x0FFF; + MOV_MEMTOEAX(&DSP->SHIFTED); + AND_EAX(0x0FFF); + MOV_EAXTOMEM(&DSP->FRC_REG); + } + else + { + //FRC_REG=(SHIFTED>>11)&0x1FFF; + MOV_MEMTOEAX(&DSP->SHIFTED); + SHR_EAX(11); + AND_EAX(0x1FFF); + MOV_EAXTOMEM(&DSP->FRC_REG); + } + } + + //MEM + if(ThisInst.MRD || ThisInst.MWT) + //if(0) + { + MOV_0TOEAX(); + MOV_MEMTOAX(&DSP->MADRS[ThisInst.MASA]); + //ADDR=DSP->MADRS[MASA]; + if(!ThisInst.TABLE) + { + //ADDR+=DSP->DEC; + //ADD_MEMTOEAX(&DSP->DEC); + MOV_MEMTOEBX(&DSP->DEC); + ADD_EBXTOEAX(); + } + if(ThisInst.ADREB) + { + MOV_MEMTOEBX(&(DSP->ADRS_REG)); + AND_EBX(0x0FFF); + ADD_EBXTOEAX(); + //ADDR+=ADRS_REG&0x0FFF; + } + if(ThisInst.NXADR) + { + //ADDR++; + INC_EAX(); + } + if(!ThisInst.TABLE) + { + MOV_MEMTOEBX(&(DSP->RBL)); + DEC_EBX(); + //ADDR&=DSP->RBL-1; + AND_EAX_EBX(); + + //AND_EAX((DSP->RBL-1)); + } + else + { + //ADDR&=0xFFFF; + AND_EAX(0xFFFF); + } + + //ADDR+=DSP->RBP<<12; + MOV_MEMTOEBX(&(DSP->RBP)); + SHL_EBX(12); + ADD_EBXTOEAX(); + + assert(!(ThisInst.MRD && ThisInst.MWT)); //this shouldn't happen, read & write in the same cycle + + if(ThisInst.MWT && (step&1)) + { + if(ThisInst.NOFL) + { + SHL_EAX(1); + ADD_IMMTOEAX(DSP->SCSPRAM); + MOV_EAXTOEBX(); + MOV_MEMTOEAX(&DSP->SHIFTED); + SHR_EAX(8); + MOV_AXTOMEMEBX(); + //DSP->SCSPRAM[ADDR]=SHIFTED>>8; + } + else + { +#ifdef USEFLOATPACK + SHL_EAX(1); + ADD_IMMTOEAX(DSP->SCSPRAM); + EMIT8(0x8B); EMIT8(0xF0); //mov esi,eax + MOV_MEMTOEAX(&DSP->SHIFTED); + SHR_EAX(8); + memcpy(PtrInsts,PackFunc,sizeof(PackFunc)); + PtrInsts+=sizeof(PackFunc); +#else + SHL_EAX(1); + ADD_IMMTOEAX(DSP->SCSPRAM); + MOV_EAXTOEBX(); + MOV_MEMTOEAX(&DSP->SHIFTED); + SHR_EAX(8); + MOV_AXTOMEMEBX(); +#endif + //DSP->SCSPRAM[ADDR]=PACK(SHIFTED); + } + } + + if(ThisInst.MRD && (step&1)) //memory only allowed on odd? DoA inserts NOPs on even + { + if(ThisInst.NOFL) + { + //MEMVAL=DSP->SCSPRAM[ADDR]<<8; + SHL_EAX(1); + ADD_IMMTOEAX(DSP->SCSPRAM); + MOV_MEMEAXTOAX(); + SHL_EAX(8); + //MOV_EAXTOMEM(&DSP->MEMVAL); + } + else + { + //MEMVAL=UNPACK(DSP->SCSPRAM[ADDR]); + SHL_EAX(1); + ADD_IMMTOEAX(DSP->SCSPRAM); + MOV_MEMEAXTOAX(); +#ifdef USEFLOATPACK + memcpy(PtrInsts,UnpackFunc,sizeof(UnpackFunc)); + PtrInsts+=sizeof(UnpackFunc); +#else + SHL_EAX(16); + SAR_EAX(8); +#endif + MOV_EAXTOMEM(&DSP->MEMVAL); + } + } + + + + } + + if(ThisInst.ADRL) + { + if(ThisInst.SHIFT==3) + { + MOV_MEMTOEAX(&DSP->SHIFTED); + SAR_EAX(12); + AND_EAX(0xFFF); + MOV_EAXTOMEM(&DSP->ADRS_REG); + //ADRS_REG=(SHIFTED>>12)&0xFFF; + } + else + { + MOV_MEMTOEAX(&DSP->INPUTS); + SAR_EAX(16); + MOV_EAXTOMEM(&DSP->ADRS_REG); + //ADRS_REG=(INPUTS>>16); + } + } + + if(ThisInst.EWT) + { + MOV_MEMTOEAX(&DSP->SHIFTED); + SAR_EAX(8); + ADD_AXTOMEM(&DSP->EFREG[ThisInst.EWA]); + //DSP->EFREG[EWA]+=SHIFTED>>8; + } +// EMIT8(0x90); +// EMIT8(0xCC); + + } + + POPA(); + + RET(); + + FILE *f=fopen("dsp.rec","wb"); + fwrite(DSP->DoSteps,1,PtrInsts-(unsigned char *)DSP->DoSteps,f); + fclose(f); +} + +#endif +void SCSPDSP_SetSample(_SCSPDSP *DSP,signed int sample,int SEL,int MXL) +{ +// if(MXL!=6) +// return; + //16 to 24 + DSP->MIXS[SEL]+=sample<<(MXL+1)/*7*/; +// DSP->MIXS[SEL]+=sample<<7; + if(MXL) + { + int a=1; + if(MXL!=6) + int a=1; + } + +} + +void SCSPDSP_Start(_SCSPDSP *DSP) +{ + int i; + DSP->Stopped=false; + for(i=127;i>=0;--i) + { + unsigned short *IPtr=DSP->MPRO+i*4; + + if(IPtr[0]!=0 || IPtr[1]!=0 || IPtr[2]!=0 || IPtr[3]!=0) + break; + } + DSP->LastStep=i+1; + + int test=0; + if(test) + { + //test + FILE *f1; + f1=fopen("MPRO","wb"); + fwrite(DSP->MPRO,128*4*2,1,f1); + fwrite(DSP->COEF,64*2,1,f1); + fwrite(DSP->MADRS,32*2,1,f1); + fclose(f1); + } + + for(int t=0;t<0x10000;++t) + { + signed int unp=UNPACK(t); + unsigned short t2=PACK(unp); + if(t2!=t) + int a=1; + } + +#ifdef DYNDSP + SCSPDSP_Recompile(DSP); +#endif +} \ No newline at end of file diff --git a/Sound/SCSPDSP.h b/Sound/SCSPDSP.h new file mode 100644 index 0000000..2abf25e --- /dev/null +++ b/Sound/SCSPDSP.h @@ -0,0 +1,59 @@ +//#ifndef SCSPDSP_H +#define SCSPDSP_H + +//#define DYNDSP +#define DYNOPT 1 //set to 1 to enable optimization of recompiler + + +//the DSP Context +struct _SCSPDSP +{ +//Config + unsigned short *SCSPRAM; + unsigned int RBP; //Ring buf pointer + unsigned int RBL; //Delay ram (Ring buffer) size in words + +//context + + signed short COEF[64]; //16 bit signed + unsigned short MADRS[32]; //offsets (in words), 16 bit + unsigned short MPRO[128*4]; //128 steps 64 bit + signed int TEMP[128]; //TEMP regs,24 bit signed + signed int MEMS[32]; //MEMS regs,24 bit signed + unsigned int DEC; + +//input + signed int MIXS[16]; //MIXS, 24 bit signed + signed short EXTS[2]; //External inputs (CDDA) 16 bit signed + +//output + signed short EFREG[16]; //EFREG, 16 bit signed + + bool Stopped; + int LastStep; +#ifdef DYNDSP + signed int ACC; //26 bit + signed int SHIFTED; //24 bit + signed int X; //24 bit + signed int Y; //13 bit + signed int B; //26 bit + signed int INPUTS; //24 bit + signed int MEMVAL; + signed int FRC_REG; //13 bit + signed int Y_REG; //24 bit + unsigned int ADDR; + unsigned int ADRS_REG; //13 bit + + void (*DoSteps)(); +#endif +}; + +void SCSPDSP_Init(_SCSPDSP *DSP); +void SCSPDSP_SetSample(_SCSPDSP *DSP,signed int sample,int SEL,int MXL); +void SCSPDSP_Step(_SCSPDSP *DSP); +void SCSPDSP_Start(_SCSPDSP *DSP); + + + + +//#endif \ No newline at end of file diff --git a/Sound/SCSPLFO.cpp b/Sound/SCSPLFO.cpp new file mode 100644 index 0000000..7d5f51e --- /dev/null +++ b/Sound/SCSPLFO.cpp @@ -0,0 +1,153 @@ +// included from SCSP.c, do not compile + +//LFOs +#include +#include + +#define LFO_SHIFT 8 + +struct _LFO +{ + unsigned short phase; + DWORD phase_step; + int *table; + int *scale; +}; + +#define LFIX(v) ((unsigned int) ((float) (1<phase+=LFO->phase_step; +#if LFO_SHIFT!=8 + LFO->phase&=(1<<(LFO_SHIFT+8))-1; +#endif + p=LFO->table[LFO->phase>>LFO_SHIFT]; + p=LFO->scale[p+128]; + return p<<(SHIFT-LFO_SHIFT); +} + +signed int inline ALFO_Step(_LFO *LFO) +{ + int p; + LFO->phase+=LFO->phase_step; +#if LFO_SHIFT!=8 + LFO->phase&=(1<<(LFO_SHIFT+8))-1; +#endif + p=LFO->table[LFO->phase>>LFO_SHIFT]; + p=LFO->scale[p]; + return p<<(SHIFT-LFO_SHIFT); +} + +void LFO_ComputeStep(_LFO *LFO,DWORD LFOF,DWORD LFOWS,DWORD LFOS,int ALFO) +{ + float step=(float) LFOFreq[LFOF]*256.0f/(float) srate; + LFO->phase_step=(unsigned int) ((float) (1<table=ALFO_SAW; break; + case 1: LFO->table=ALFO_SQR; break; + case 2: LFO->table=ALFO_TRI; break; + case 3: LFO->table=ALFO_NOI; break; + } + LFO->scale=ASCALES[LFOS]; + } + else + { + switch(LFOWS) + { + case 0: LFO->table=PLFO_SAW; break; + case 1: LFO->table=PLFO_SQR; break; + case 2: LFO->table=PLFO_TRI; break; + case 3: LFO->table=PLFO_NOI; break; + } + LFO->scale=PSCALES[LFOS]; + } +} diff --git a/Supermodel.h b/Supermodel.h new file mode 100644 index 0000000..9bc1820 --- /dev/null +++ b/Supermodel.h @@ -0,0 +1,188 @@ +/** + ** Supermodel + ** A Sega Model 3 Arcade Emulator. + ** Copyright 2011 Bart Trzynadlowski + ** + ** This file is part of Supermodel. + ** + ** Supermodel is free software: you can redistribute it and/or modify it under + ** the terms of the GNU General Public License as published by the Free + ** Software Foundation, either version 3 of the License, or (at your option) + ** any later version. + ** + ** Supermodel is distributed in the hope that it will be useful, but WITHOUT + ** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + ** FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + ** more details. + ** + ** You should have received a copy of the GNU General Public License along + ** with Supermodel. If not, see . + **/ + +/* + * Supermodel.h + * + * Program-wide header file. + */ + +#ifndef INCLUDED_SUPERMODEL_H +#define INCLUDED_SUPERMODEL_H + +/****************************************************************************** + Program-Wide Definitions +******************************************************************************/ + +#define SUPERMODEL_VERSION "0.2-WIP" // version string + + +/****************************************************************************** + OS-Dependent (OSD) Items + + Everything here must be provided by the OSD layer. Include files should be + located in the OSD directories for each port. +******************************************************************************/ + +// stricmp() is non-standard, apparently... +#ifdef _MSC_VER // MS VisualC++ + #define stricmp _stricmp +#else // assume GCC + #define stricmp strcasecmp +#endif + +/* + * Fundamental Data Types: + * + * BOOL Boolean (w/ TRUE = FAIL = 1, OKAY = FALSE = 0). + * UINT64 Unsigned 64-bit integer. + * INT64 Signed 64-bit integer. + * UINT32 Unsigned 32-bit integer. + * INT32 Signed 32-bit integer. + * UINT16 Unsigned 16-bit integer. + * INT16 Signed 16-bit integer. + * UINT8 Unsigned 8-bit integer. + * INT8 Signed 8-bit integer. + * FLOAT32 Single-precision, 32-bit floating point number. + * FLOAT64 Double-precision, 64-bit floating point number. + */ +#include "Types.h" + +/* + * Error and Debug Logging + */ + +/* + * DebugLog(fmt, ...): + * + * Prints debugging information. The OSD layer may choose to print this to a + * log file, the screen, neither, or both. Newlines and other formatting codes + * must be explicitly included. + * + * Parameters: + * fmt A format string (the same as printf()). + * ... Variable number of arguments, as required by format string. + */ +extern void DebugLog(const char *fmt, ...); + +/* + * ErrorLog(fmt, ...): + * + * Prints error information. Errors need not require program termination and + * may simply be informative warnings to the user. Newlines should not be + * included in the format string -- they are automatically added at the end of + * a line. + * + * Parameters: + * fmt A format string (the same as printf()). + * ... Variable number of arguments, as required by format string. + * + * Returns: + * Must always return FAIL. + */ +extern BOOL ErrorLog(const char *fmt, ...); + +/* + * InfoLog(fmt, ...); + * + * Prints information to the error log file but does not print to stderr. This + * is useful for logging non-error information. Newlines are automatically + * appended. + * + * Parameters: + * fmt Format string (same as printf()). + * ... Variable number of arguments as required by format string. + */ +extern void InfoLog(const char *fmt, ...); + + +/****************************************************************************** + Header Files + + All primary header files for modules used throughout Supermodel are included + here, except for external packages and APIs. +******************************************************************************/ + +#include +#include +#include +#include "Games.h" +#include "ROMLoad.h" +#include "INIFile.h" +#include "BlockFile.h" +#include "Graphics/Render2D.h" +#include "Graphics/Render3D.h" +#include "Graphics/Shader.h" +#include "CPU/PowerPC/ppc.h" +#include "CPU/PowerPC/PPCDisasm.h" +#ifdef SUPERMODEL_SOUND +#include "CPU/68K/Turbo68K.h" +#endif +#include "Model3/Bus.h" +#include "Model3/IRQ.h" +#include "Model3/PCI.h" +#include "Model3/53C810.h" +#include "Model3/MPC10x.h" +#include "Model3/RTC72421.h" +#include "Model3/93C46.h" +#include "Model3/TileGen.h" +#include "Model3/Real3D.h" +#include "Sound/SCSP.h" +#include "Model3/SoundBoard.h" +#include "Model3/Model3.h" +#include "Inputs/Input.h" +#include "Inputs/Inputs.h" +#include "Inputs/InputSource.h" +#include "Inputs/InputSystem.h" +#include "Inputs/InputTypes.h" +#include "Inputs/MultiInputSource.h" + +/****************************************************************************** + Helpful Macros and Inlines +******************************************************************************/ + +/* + * FLIPENDIAN16(data): + * FLIPENDIAN32(data): + * + * Flips the endianness of the data (reverses bytes). + * + * Parameters: + * data Word or half-word to flip. + * + * Returns: + * Flipped word. + */ +static inline UINT16 FLIPENDIAN16(UINT16 d) +{ + return(((d >> 8) & 0x00FF) | + ((d << 8) & 0xFF00)); +} + +static inline UINT32 FLIPENDIAN32(UINT32 d) +{ + return(((d >> 24) & 0x000000FF) | + ((d >> 8) & 0x0000FF00) | + ((d << 8) & 0x00FF0000) | + ((d << 24) & 0xFF000000)); +} + +#endif // INCLUDED_SUPERMODEL_H